From: Long Li <longli@microsoft.com>
To: dev@dpdk.org, Wei Hu <weh@microsoft.com>,
Stephen Hemminger <stephen@networkplumber.org>,
stable@dpdk.org, Dariusz Sosnowski <dsosnowski@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Cc: Long Li <longli@microsoft.com>
Subject: [PATCH v5 6/7] net/mlx5: fix fast-path ops setup in secondary process
Date: Thu, 26 Feb 2026 17:59:26 -0800 [thread overview]
Message-ID: <20260227015928.14338-7-longli@microsoft.com> (raw)
In-Reply-To: <20260227015928.14338-1-longli@microsoft.com>
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.
When the primary process re-attaches a VF during a hot-add event
(e.g. Accelerated Networking re-enabled on Azure), it sends
MLX5_MP_REQ_START_RXTX to the secondary process. The secondary
handler sets rx/tx burst functions and reinitializes UAR mappings,
but does not update the fast-path queue data pointers. The stale
rxq.data and txq.data in rte_eth_fp_ops cause a segfault when the
secondary resumes polling the re-added VF port.
Fix this by setting rte_eth_fp_ops rxq.data and txq.data to point
to the device's RX/TX queue arrays in the secondary process when
the primary requests to start datapath, before the memory barrier.
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 crashes with SIGSEGV in
rte_eth_rx_burst() at qd = p->rxq.data[queue_id] when the VF is
hot-added back.
Fixes: 2aac5b5d119f ("net/mlx5: sync stop/start with secondary process")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
---
drivers/net/mlx5/linux/mlx5_mp_os.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/mlx5/linux/mlx5_mp_os.c b/drivers/net/mlx5/linux/mlx5_mp_os.c
index f2e71c9bd4..ca7b1cfa97 100644
--- a/drivers/net/mlx5/linux/mlx5_mp_os.c
+++ b/drivers/net/mlx5/linux/mlx5_mp_os.c
@@ -189,6 +189,10 @@ struct rte_mp_msg mp_res;
}
}
close(mp_msg->fds[0]);
+ rte_eth_fp_ops[param->port_id].rx_pkt_burst = dev->rx_pkt_burst;
+ rte_eth_fp_ops[param->port_id].tx_pkt_burst = dev->tx_pkt_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();
mp_init_msg(&priv->mp_id, &mp_res, param->type);
res->result = 0;
@@ -198,6 +202,8 @@ struct rte_mp_msg mp_res;
DRV_LOG(INFO, "port %u stopping datapath", dev->data->port_id);
dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
+ rte_eth_fp_ops[param->port_id].rx_pkt_burst = rte_eth_pkt_burst_dummy;
+ rte_eth_fp_ops[param->port_id].tx_pkt_burst = rte_eth_pkt_burst_dummy;
rte_mb();
mp_init_msg(&priv->mp_id, &mp_res, param->type);
res->result = 0;
--
2.43.0
next prev parent reply other threads:[~2026-02-27 2:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 1:59 [PATCH v5 0/7] multi-process and VF hotplug fixes Long Li
2026-02-27 1:59 ` [PATCH v5 1/7] net/netvsc: fix race conditions on VF add/remove events Long Li
2026-02-27 1:59 ` [PATCH v5 2/7] net/netvsc: add multi-process VF device removal support Long Li
2026-02-27 1:59 ` [PATCH v5 3/7] net/mana: fix PD resource leak on device close Long Li
2026-02-27 1:59 ` [PATCH v5 4/7] net/netvsc: fix devargs memory leak on hotplug Long Li
2026-02-27 1:59 ` [PATCH v5 5/7] net/mana: fix fast-path ops setup in secondary process Long Li
2026-02-27 1:59 ` Long Li [this message]
2026-02-27 1:59 ` [PATCH v5 7/7] net/mlx4: " Long Li
2026-02-28 0:41 ` [PATCH v5 0/7] multi-process and VF hotplug fixes Stephen Hemminger
2026-02-28 1:36 ` [EXTERNAL] " Long Li
2026-02-28 17:03 ` Stephen Hemminger
2026-03-01 5:00 ` [EXTERNAL] " Long Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260227015928.14338-7-longli@microsoft.com \
--to=longli@microsoft.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
--cc=weh@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.