net/null: fix multi-process rx and tx
PATCH 1/1 net/null: fix multi-process rx and tx
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.
--- drivers/net/null/rte_eth_null.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/null/rte_eth_null.c +7 -0
@@ -586,6 +586,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 ; }
Signature · 1 line
2.17.1
Quoted 18 lines · Yasufumi Ogawa
Packet processing in secondary process cannot work because
rx_pkt_burstandtx_pkt_burstineth_devare not initialized while probing device. This patch is to the initialization.Signed-off-by Yasufumi Ogawa <[email protected]>--- drivers/net/null/rte_eth_null.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/null/rte_eth_null.c +0
-0@@ -586,6 +586,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;
drivers/net/null/rte_eth_null.c rte_pmd_null_probe(struct rte_vdev_device *dev) · line 598
Quoted 10 lines
drivers/net/null/rte_eth_null.c +7
-0+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 ; }
But this seems the issue for other virtual PMDs too, @Yasufumi, can you please check others too if you have any bandwidth for it?
I assume this is missing for a long time because there is not easy way to test them in secondary process, testpmd doesn't support the multi process. cc'ed testpmd and multi process maintainers, what do you think about adding multi process support to testpmd?
I tested with "examples/multi_process/symmetric_mp" sample app, it required fixing with null pmd:
1- Requested offload config was not supported by null pmd
2- promics_enable dev_ops was not implemented in null pmd
We should fix sample app / virtual pmds too so they can work together...
Ferruh Yigit
AppliedQuoted 24 lines · Ferruh Yigit
Quoted 23 lines · Yasufumi Ogawa
Packet processing in secondary process cannot work because
rx_pkt_burstandtx_pkt_burstineth_devare not initialized while probing device. This patch is to the initialization.Signed-off-by Yasufumi Ogawa <[email protected]>--- drivers/net/null/rte_eth_null.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/null/rte_eth_null.c +6
-0@@ -586,6 +586,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;
Quoted 8 lines
drivers/net/null/rte_eth_null.c rte_pmd_null_probe(struct rte_vdev_device *dev) · line 598
Quoted 5 lines
drivers/net/null/rte_eth_null.c +1
-0+ }rte_eth_dev_probing_finish (eth_dev);return 0 ; }Reviewed-by Ferruh Yigit <[email protected]>
Applied to dpdk-next-net/master, thanks.
Quoted 33 lines · Ferruh Yigit
Quoted 18 lines · Yasufumi Ogawa
Packet processing in secondary process cannot work because
rx_pkt_burstandtx_pkt_burstineth_devare not initialized while probing device. This patch is to the initialization.Signed-off-by Yasufumi Ogawa <[email protected]>--- drivers/net/null/rte_eth_null.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/null/rte_eth_null.c +0
-0@@ -586,6 +586,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;drivers/net/null/rte_eth_null.c rte_pmd_null_probe(struct rte_vdev_device *dev) · line 598
Quoted 10 lines
drivers/net/null/rte_eth_null.c +7
-0+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 ; }Reviewed-by Ferruh Yigit <[email protected]>
Quoted 2 lines
But this seems the issue for other virtual PMDs too, @Yasufumi, can you please check others too if you have any bandwidth for it?
Yes. I have also tried to fix other PMDs, and would like to make some updates for vhost and virtio next if possible.
Yasufumi
Quoted 15 lines
I assume this is missing for a long time because there is not easy way to test them in secondary process, testpmd doesn't support the multi process. cc'ed testpmd and multi process maintainers, what do you think about adding multi process support to testpmd?
I tested with "examples/multi_process/symmetric_mp" sample app, it required fixing with null pmd:
1- Requested offload config was not supported by null pmd
2-promics_enabledev_opswas not implemented in null pmdWe should fix sample app / virtual pmds too so they can work together...