Skip to contentSkip to conversation

e1000 emulation

Qemu-devel Dan Aloni 4 participants 5 messages Aug 25, 2007 – Sep 2, 2007

lore
Share & tools
lore

Dan Aloni

author
#0 lore raw

Hello,

Is anyone interested in a patch for an unstable, though working e1000 emulation for QEMU? It is aimed for this chip-set version:

0e:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller

I originally created it very recently to provide a virtual NIC that supports Jumbo packets. Unfortunately it appears that the tun driver doesn't implement change_mtu() so it didn't integrate very well with qemu-kvm.

Signature · 3 lines
Dan Aloni
XIV LTD, http://www.xivstorage.com
da-x (at) monatomic.org, dan (at) xiv.co.il
#1 lore raw

Dan Aloni schreef:

Quoted 6 lines

Hello,

Is anyone interested in a patch for an unstable, though working e1000 emulation for
QEMU? It is aimed for this chip-set version:

Quoted 8 lines

0e:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller

I originally created it very recently to provide a virtual NIC that supports Jumbo
packets. Unfortunately it appears that the tun driver doesn't implement change_mtu() so it didn't integrate very well with qemu-kvm.

I am very interested in a patch for Gbit-capable network card. Please post a patch!

Thank you
Frederik van Hövell

#4 lore raw
In reply to Dan Aloni
Quoted 5 lines · Dan Aloni

Hello,

Is anyone interested in a patch for an unstable, though working e1000 emulation for
QEMU? It is aimed for this chip-set version:

Yes! The e1000 has a lot of interesting features that should make it emulation friendly.

Quoted 7 lines

0e:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller

I originally created it very recently to provide a virtual NIC that supports Jumbo
packets. Unfortunately it appears that the tun driver doesn't implement change_mtu() so it didn't integrate very well with qemu-kvm.

If it proves useful, then there's no reason the tun driver can't be changed. Were you expecting to get a significant performance boost with jumbo frames or was this just a functionality thing? The current emulated nic performance is pretty bad...

Regards,

Anthony Liguori

author
#2 lore raw
In reply to Triggered
Quoted 10 lines · Triggered

Dan Aloni schreef:

Quoted 9 lines

Hello,

Is anyone interested in a patch for an unstable, though working e1000 emulation for
QEMU? It is aimed for this chip-set version:

0e:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller

Quoted 7 lines
Quoted 5 lines

I originally created it very recently to provide a virtual NIC that supports Jumbo
packets. Unfortunately it appears that the tun driver doesn't implement change_mtu() so it didn't integrate very well with qemu-kvm.

I am very interested in a patch for Gbit-capable network card. Please post a patch!

Okay, just a few notes:

* Sorry for sending this rather badly written patch, I have loads of other stuff at the moment. I hope that it serves as a ground for further development, though.
* It depends on the e1000_hw.h header from a the Linux kernel driver (look in drivers/net/e1000), I haven't included this header in the patch.
* As far as I've seen, ICMP ping works, but TCP doesn't (I think it is because this emulator implementation doesn't do the off-load of packet checksuming, as the guest expects)
* Several up/downs of the interface while it is working seem to cause guest memory corruption. Haven't looked into this yet.

Have fun hacking!

qemu/Makefile.target +1 -1
index aeee2af..9363e22 100644
@@ -372,7 +372,7 @@ VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
 VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
 
 # PCI network cards
-VL_OBJS+= ne2000.o rtl8139.o pcnet.o
+VL_OBJS+= ne2000.o rtl8139.o pcnet.o e1000.o
 
 # PCI Hypercall
 VL_OBJS+= hypercall.o
qemu/hw/e1000.c new file +695 -0

695 lines not on this page · raw message

qemu/hw/pci.c +2 -0
index b895f98..6d3be5c 100644
@@ -552,6 +552,8 @@ void pci_nic_init(PCIBus *bus, NICInfo *nd, int devfn)
         pci_rtl8139_init(bus, nd, devfn);
     } else if (strcmp(nd->model, "pcnet") == 0) {
         pci_pcnet_init(bus, nd, devfn);
+    } else if (strcmp(nd->model, "e1000") == 0) {
+        pci_e1000_init(bus, nd, devfn);
     } else {
         fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
         exit (1);
Signature · 3 lines
Dan Aloni
XIV LTD, http://www.xivstorage.com
da-x (at) monatomic.org, dan (at) xiv.co.il
#3 lore raw

Hi Dan...!

How are you doing?

Quoted 6 lines

Okay, just a few notes:

* Sorry for sending this rather badly written patch, I have loads of other stuff at the moment. I hope that it serves as a ground for further development, though.

I appreciate your work here, congratulations!

regards,

Mulyadi