X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fvirtio%2Fvirtio_pci_ethdev.c;h=4083853c4887bf1711c1f421868eb37f7f1dc5fe;hb=6a11a1eac0b6dcd52580eef99cf6f09e3361cc3b;hp=e725c105af48e08d0e689d93e5955f9a4a1b334b;hpb=c8d4b02f72aefda2dbe2895cd661c29161a6770d;p=dpdk.git diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c index e725c105af..4083853c48 100644 --- a/drivers/net/virtio/virtio_pci_ethdev.c +++ b/drivers/net/virtio/virtio_pci_ethdev.c @@ -19,6 +19,7 @@ #include #include +#include "virtio.h" #include "virtio_ethdev.h" #include "virtio_pci.h" #include "virtio_logs.h" @@ -76,16 +77,19 @@ eth_virtio_pci_init(struct rte_eth_dev *eth_dev) int ret; if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + hw->port_id = eth_dev->data->port_id; + VTPCI_DEV(hw) = pci_dev; ret = vtpci_init(RTE_ETH_DEV_TO_PCI(eth_dev), dev); if (ret) { PMD_INIT_LOG(ERR, "Failed to init PCI device\n"); return -1; } } else { + VTPCI_DEV(hw) = pci_dev; if (dev->modern) - VTPCI_OPS(hw) = &modern_ops; + VIRTIO_OPS(hw) = &modern_ops; else - VTPCI_OPS(hw) = &legacy_ops; + VIRTIO_OPS(hw) = &legacy_ops; ret = virtio_remap_pci(RTE_ETH_DEV_TO_PCI(eth_dev), dev); if (ret < 0) {