DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH resend] virtio: fix link state regression
@ 2015-12-04 15:59 Stephen Hemminger
  2015-12-04 16:18 ` Iremonger, Bernard
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2015-12-04 15:59 UTC (permalink / raw)
  To: huawei.xie, yuanhan.liu, bernard.iremonger; +Cc: dev

Support for link state interrupt was broken on virtio by

commit bda66c418c85 ("ethdev: add device fields from PCI layer")

This is caused because the actual value of drv_flags is not set
until after the resource_init has figured out whether it is using
UIO or direct I/O instructions.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

---

There maybe other drivers with the same problem. It would have
been better to move the structure elements (and break ABI) rather
than assume it safe to copy them.

 drivers/net/virtio/virtio_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 74c00ee..8e12804 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1289,11 +1289,11 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
 
 	pci_dev = eth_dev->pci_dev;
 
-	rte_eth_copy_pci_info(eth_dev, pci_dev);
-
 	if (virtio_resource_init(pci_dev) < 0)
 		return -1;
 
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	hw->use_msix = virtio_has_msix(&pci_dev->addr);
 	hw->io_base = (uint32_t)(uintptr_t)pci_dev->mem_resource[0].addr;
 
-- 
2.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-04 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04 15:59 [dpdk-dev] [PATCH resend] virtio: fix link state regression Stephen Hemminger
2015-12-04 16:18 ` Iremonger, Bernard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).