From: longli@linux.microsoft.com
To: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>,
stable@dpdk.org, Matan Azrad <matan@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: Long Li <longli@microsoft.com>
Subject: [PATCH 8/8] net/mlx4: fix fast-path ops setup in secondary process
Date: Thu, 19 Feb 2026 17:12:09 -0800 [thread overview]
Message-ID: <20260220011209.595538-1-longli@linux.microsoft.com> (raw)
From: Long Li <longli@microsoft.com>
The secondary process MLX4_MP_REQ_START_RXTX handler sets
dev->rx_pkt_burst and dev->tx_pkt_burst, but does not update
rte_eth_fp_ops[].rxq.data and txq.data. Since rte_eth_rx_burst()
uses rte_eth_fp_ops (which is process-local), the secondary
retains stale queue data pointers after VF hot-add, causing a
segfault.
Similarly, the MLX4_MP_REQ_STOP_RXTX handler sets dev burst
functions to dummy but does not update rte_eth_fp_ops burst
pointers, leaving the secondary calling into freed resources.
Fix by updating rte_eth_fp_ops rxq.data and txq.data in the
START_RXTX handler, and rte_eth_fp_ops burst function pointers
in the STOP_RXTX handler.
Fixes: 080d8bc15905 ("net/mlx4: sync stop/start with secondary process")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
---
drivers/net/mlx4/mlx4_mp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/mlx4/mlx4_mp.c b/drivers/net/mlx4/mlx4_mp.c
index 534cb31151..00ecadee79 100644
--- a/drivers/net/mlx4/mlx4_mp.c
+++ b/drivers/net/mlx4/mlx4_mp.c
@@ -149,6 +149,8 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
}
#endif
close(mp_msg->fds[0]);
+ 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(dev, &mp_res, param->type);
res->result = 0;
@@ -158,6 +160,8 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
INFO("port %u stopping datapath", dev->data->port_id);
dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
dev->rx_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(dev, &mp_res, param->type);
res->result = 0;
--
2.43.0
reply other threads:[~2026-02-20 10:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260220011209.595538-1-longli@linux.microsoft.com \
--to=longli@linux.microsoft.com \
--cc=dev@dpdk.org \
--cc=longli@microsoft.com \
--cc=matan@nvidia.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=viacheslavo@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox