net/null: fix multi-process Rx and Tx
authorYasufumi Ogawa <yasufum.o@gmail.com>
Sun, 29 Sep 2019 02:41:41 +0000 (11:41 +0900)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:58 +0000 (15:00 +0200)
Packet processing in secondary process cannot work because rx_pkt_burst
and tx_pkt_burst in eth_dev are not initialized while probing device.
This patch is to the initialization.

Fixes: ee27edbe0c10 ("drivers/net: share vdev data to secondary process")
Cc: stable@dpdk.org
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/null/rte_eth_null.c

index e2ff41a..3a89047 100644 (file)
@@ -590,6 +590,13 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)
                /* TODO: request info from primary to set up Rx and Tx */
                eth_dev->dev_ops = &ops;
                eth_dev->device = &dev->device;
+               if (packet_copy) {
+                       eth_dev->rx_pkt_burst = eth_null_copy_rx;
+                       eth_dev->tx_pkt_burst = eth_null_copy_tx;
+               } else {
+                       eth_dev->rx_pkt_burst = eth_null_rx;
+                       eth_dev->tx_pkt_burst = eth_null_tx;
+               }
                rte_eth_dev_probing_finish(eth_dev);
                return 0;
        }