[PATCH v5 5/7] net/mana: fix fast-path ops setup in secondary process

Long Li
2026-02-27T02:00:17Z

On hotplug, the secondary process is not able to set rte_eth_fp_ops
because the primary process has not finished setting up the device
for datapath.

Fix this by properly setting up rte_eth_fp_ops in the secondary
process when the primary requests to start datapath. Set both
rxq.data and txq.data to point to the device's RX/TX queue arrays,
enabling the fast-path operations to access queues correctly.

Also update rte_eth_fp_ops burst function pointers in the STOP_RXTX
handler. Without this, the secondary's rte_eth_fp_ops retains stale
burst function pointers after stop, since rte_eth_fp_ops is
process-local and eth_dev_fp_ops_reset() in rte_eth_dev_stop() only
affects the primary.

Without this fix, the secondary process cannot transmit or receive
packets because the fast-path queue data pointers are NULL.

Fixes: 62724d1a3981 ("net/mana: start/stop device")
Cc: stable@dpdk.org

Signed-off-by: Long Li <longli@microsoft.com>
---
drivers/net/mana/mp.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/net/mana/mp.c b/drivers/net/mana/mp.c
index 5467d385ce..72417fc0c7 100644
--- a/drivers/net/mana/mp.c
+++ b/drivers/net/mana/mp.c
@@ -145,6 +145,11 @@ mana_mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
dev->tx_pkt_burst = mana_tx_burst;
dev->rx_pkt_burst = mana_rx_burst;

+ rte_eth_fp_ops[param->port_id].rx_pkt_burst = mana_rx_burst;
+ rte_eth_fp_ops[param->port_id].tx_pkt_burst = mana_tx_burst;
+ rte_eth_fp_ops[param->port_id].rxq.data = dev->data->rx_queues;
+ rte_eth_fp_ops[param->port_id].txq.data = dev->data->tx_queues;
+
rte_mb();

res->result = 0;
@@ -154,6 +159,9 @@ mana_mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
case MANA_MP_REQ_STOP_RXTX:
DRV_LOG(INFO, "Port %u stopping datapath", dev->data->port_id);

+ rte_eth_fp_ops[param->port_id].rx_pkt_burst = mana_rx_burst_removed;
+ rte_eth_fp_ops[param->port_id].tx_pkt_burst = mana_tx_burst_removed;
+
dev->tx_pkt_burst = mana_tx_burst_removed;
dev->rx_pkt_burst = mana_rx_burst_removed;

--
2.43.0