Skip to contentSkip to conversation

82571 emulation

PATCH In review akepner 2 participants 2 messages Nov 7, 2013 – Nov 8, 2013

lore
Share & tools
lore

akepner

author
#0 lore raw

PATCH 1/1 82571 emulation

First cut at emulating 82571. I'm sure there are lots of rough edges, but it's working for me.

Pretty obviously I started with a copy of the e1000 code, and modified just what was necessary to get it working. I'd like to also do a s/e1000_/e1000e/ to uniqify identifiers, but for now I've left it as it is to make comparison with e1000 easier.

---

default-configs/pci.mak +1 -0
index ee2d18d..d548ff4 100644
@@ -13,6 +13,7 @@ CONFIG_LSI_SCSI_PCI=y
 CONFIG_MEGASAS_SCSI_PCI=y
 CONFIG_RTL8139_PCI=y
 CONFIG_E1000_PCI=y
+CONFIG_E1000E_PCI=y
 CONFIG_IDE_CORE=y
 CONFIG_IDE_QDEV=y
 CONFIG_IDE_PCI=y
hw/Makefile.objs +1 -0
index 54521f2..2241f45 100644
@@ -115,6 +115,7 @@ common-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
 common-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
 common-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
 common-obj-$(CONFIG_E1000_PCI) += e1000.o
+common-obj-$(CONFIG_E1000E_PCI) += e1000e.o
 common-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
 
 common-obj-$(CONFIG_SMC91C111) += smc91c111.o
hw/e1000e.c new file +1449 -0

1,449 lines not on this page · raw message

hw/e1000e_hw.h new file +909 -0

909 lines not on this page · raw message

#1 lore raw
Quoted 10 lines · akepner

First cut at emulating 82571. I'm sure there are lots of rough edges, but it's working for me.

Pretty obviously I started with a copy of the e1000 code, and modified just what was necessary to get it working. I'd like to also do a s/e1000_/e1000e/ to uniqify identifiers, but for now I've left it as it is to make comparison with e1000 easier.

---

Cool, thanks for sharing! You've probably seen it already since your email generally follows the conventions, but here's the link for submitting patches:

http://qemu-project.org/Contribute/SubmitAPatch

If you stuck to the e1000.c code for the most part then there's probably not much to comment on yet except a few suggestions for getting the patch into a mergable state:

* Sharing code with e1000.c may be reasonable, you decide

* After renaming remaining code to e1000e, please drop dead-code or unused parts

* Please audit the vmstate (migration data fields) to see if cruft can be dropped. In particular, it's tricky to stay backwards-compatible with live migration so things tend to get appended rather than replaced.

Since e1000e is starting from a fresh slate, you can delete any duplicated or workaround vmstate fields which were solely used for backwards compatibility during migration.

* Please describe your testing: which guest OSes and versions?

* Please add an indication of missing features from the hardware spec which you haven't implemented. If this is literally just a hack of the e1000 code to make the Linux e1000e driver happy, then it may still need more work to be generally usable by other OSes.

* Please test live migration several times with the NIC up and down

If any of this seems overwhelming or more effort than you were prepared to go through, please ask questions and maybe people will turn up who can help.

Thanks,
Stefan