net/virtio: fix wrong Rx/Tx method for secondary process
[dpdk.git] / drivers / net / virtio / virtio_ethdev.c
index 54ea7d7..c3c3826 100644 (file)
@@ -1212,8 +1212,10 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
        else
                eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 
-       if (pci_dev)
+       if (pci_dev) {
                rte_eth_copy_pci_info(eth_dev, pci_dev);
+               eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
+       }
 
        rx_func_get(eth_dev);
 
@@ -1306,7 +1308,12 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
        eth_dev->tx_pkt_burst = &virtio_xmit_pkts;
 
        if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
-               rx_func_get(eth_dev);
+               if (hw->use_simple_rxtx) {
+                       eth_dev->tx_pkt_burst = virtio_xmit_pkts_simple;
+                       eth_dev->rx_pkt_burst = virtio_recv_pkts_vec;
+               } else {
+                       rx_func_get(eth_dev);
+               }
                return 0;
        }
 
@@ -1383,7 +1390,7 @@ static struct eth_driver rte_virtio_pmd = {
                        .name = "net_virtio",
                },
                .id_table = pci_id_virtio_map,
-               .drv_flags = RTE_PCI_DRV_DETACHABLE,
+               .drv_flags = 0,
                .probe = rte_eth_dev_pci_probe,
                .remove = rte_eth_dev_pci_remove,
        },