net/cnxk: support CPT CTX write through microcode op
[dpdk.git] / drivers / net / virtio / virtio_pci_ethdev.c
index e725c10..54645dc 100644 (file)
@@ -19,6 +19,7 @@
 #include <rte_dev.h>
 #include <rte_kvargs.h>
 
+#include "virtio.h"
 #include "virtio_ethdev.h"
 #include "virtio_pci.h"
 #include "virtio_logs.h"
@@ -76,27 +77,30 @@ 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");
+                       PMD_INIT_LOG(ERR, "Failed to init PCI device");
                        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) {
-                       PMD_INIT_LOG(ERR, "Failed to remap PCI device\n");
+                       PMD_INIT_LOG(ERR, "Failed to remap PCI device");
                        return -1;
                }
        }
 
        ret = eth_virtio_dev_init(eth_dev);
        if (ret < 0) {
-               PMD_INIT_LOG(ERR, "Failed to init virtio device\n");
+               PMD_INIT_LOG(ERR, "Failed to init virtio device");
                goto err_unmap;
        }