Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qemu IGB network device #3513

Closed
ventaquil opened this issue Oct 2, 2023 · 7 comments · Fixed by #3516, GNS3/gns3-server#2296, GNS3/gns3-web-ui#1469 or GNS3/gns3-registry#836
Closed

Qemu IGB network device #3513

ventaquil opened this issue Oct 2, 2023 · 7 comments · Fixed by #3516, GNS3/gns3-server#2296, GNS3/gns3-web-ui#1469 or GNS3/gns3-registry#836

Comments

@ventaquil
Copy link
Contributor

Since version 8.0 IGB device is available in Qemu (see changelog).

$ qemu-system-x86_64 --version
QEMU emulator version 8.1.1 (v8.1.1)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
$ qemu-system-x86_64 -nic user,model=help
Available NIC models:
e1000
e1000-82544gc
e1000-82545em
e1000e
i82550
i82551
i82557a
i82557b
i82557c
i82558a
i82558b
i82559a
i82559b
i82559c
i82559er
i82562
i82801
igb
ne2k_pci
pcnet
rtl8139
tulip
virtio-net-pci
virtio-net-pci-non-transitional
virtio-net-pci-transitional
vmxnet3

As far as I see it shouldn't be difficult to add it, right?

# Supported NIC models: e1000, e1000-82544gc, e1000-82545em, e1000e, i82550, i82551, i82557a, i82557b, i82557c, i82558a
# i82558b, i82559a, i82559b, i82559c, i82559er, i82562, i82801, ne2k_pci, pcnet, rocker, rtl8139, virtio-net-pci, vmxnet3
# This list can be retrieved using "qemu-system-x86_64 -nic model=?" or "qemu-system-x86_64 -device help"
self._legacy_devices = ("e1000", "i82551", "i82557b", "i82559er", "ne2k_pci", "pcnet", "rtl8139", "virtio")
self._qemu_network_devices = OrderedDict([("e1000", "Intel Gigabit Ethernet"),
("e1000-82544gc", "Intel 82544GC Gigabit Ethernet"),
("e1000-82545em", "Intel 82545EM Gigabit Ethernet"),
("e1000e", "Intel PCIe Gigabit Ethernet"),
("i82550", "Intel i82550 Ethernet"),
("i82551", "Intel i82551 Ethernet"),
("i82557a", "Intel i82557A Ethernet"),
("i82557b", "Intel i82557B Ethernet"),
("i82557c", "Intel i82557C Ethernet"),
("i82558a", "Intel i82558A Ethernet"),
("i82558b", "Intel i82558B Ethernet"),
("i82559a", "Intel i82559A Ethernet"),
("i82559b", "Intel i82559B Ethernet"),
("i82559c", "Intel i82559C Ethernet"),
("i82559er", "Intel i82559ER Ethernet"),
("i82562", "Intel i82562 Ethernet"),
("i82801", "Intel i82801 Ethernet"),
("ne2k_pci", "NE2000 Ethernet"),
("pcnet", "AMD PCNet Ethernet"),
("rocker", "Rocker L2 switch device"),
("rtl8139", "Realtek 8139 Ethernet"),
("virtio", "Legacy paravirtualized Network I/O"),
("virtio-net-pci", "Paravirtualized Network I/O"),
("vmxnet3", "VMWare Paravirtualized Ethernet v3")])

In comparison to e1000/e1000e it supports multi queues.

@ghost
Copy link

ghost commented Oct 3, 2023

As far as I see it shouldn't be difficult to add it, right?

I fear it needs a little more changes:

A drawback of your changes is, that a user with an older qemu, who tries to use the IGB device, gets a strange error message. That might lead to some confusion. Maybe this situation needs some extra handling.

@ventaquil
Copy link
Contributor Author

Hey @b-ehlers

I prepared PR already, it works quite fine on my setup. It doesn't need any changes in server code, however I agree that changes in other repos should be next step.

First attempt to test IGB driver was quite simple - just replacement e1000 into igb in my project file. Finally everything worked as expected - excluding that used network interface driver was empty (that should be fixed?).

Regarding to older Qemu version that someone may use - maybe additional information (like minimal supported Qemu version - MSQV) should be added to the list of available drivers.

IGB driver is much more powerful than any existing Intel drivers - I cannot run application by using any of existing ones because of single queue. IGB supports multi queues and for me it's must have feature. For other users maybe too.

@ventaquil
Copy link
Contributor Author

Hey @grossmj

Is there any chance to add this change to the 3.0.0 release?

@grossmj
Copy link
Member

grossmj commented Oct 20, 2023

Hi,

Yes I think we should add it to 3.0 👍

@grossmj
Copy link
Member

grossmj commented Oct 24, 2023

I have decided to add this to 2.2 (and it will make its way to 3.0 as well). Also, I have updated the registry: GNS3/gns3-registry#836 to support this new adapter.

A drawback of your changes is, that a user with an older qemu, who tries to use the IGB device, gets a strange error message. That might lead to some confusion. Maybe this situation needs some extra handling.

This is definitely something to improve. The only way I know to get a list of supported devices is to execute Qemu with the -device help param and there is some parsing to do. I wish Qemu would make it easier to know what devices are supported... I guess we could work on this after v3.0.

Regarding to older Qemu version that someone may use - maybe additional information (like minimal supported Qemu version - MSQV) should be added to the list of available drivers.

That could be a way to mitigate the problem in the meantime.

@ventaquil
Copy link
Contributor Author

This is definitely something to improve. The only way I know to get a list of supported devices is to execute Qemu with the -device help param and there is some parsing to do. I wish Qemu would make it easier to know what devices are supported... I guess we could work on this after v3.0.

In theory, we can simply review the changes in Qemu's changelog to determine when each network device was introduced.

Using -nic model=help is necessary solely for dynamically updating the list of available NIC devices without hardcoding them into the code.

@grossmj, please note that -nic model=help is significantly easier to parse (just skip the first line) compared to -device help.

@grossmj
Copy link
Member

grossmj commented Oct 26, 2023

@grossmj, please note that -nic model=help is significantly easier to parse (just skip the first line) compared to -device help.

Thanks, based on this we will improve the whole process in a future version without hard-coded adapter names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment