From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id F252AFC591F for ; Thu, 26 Feb 2026 10:17:20 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D18C40650; Thu, 26 Feb 2026 11:16:45 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id DF71D4021F; Thu, 26 Feb 2026 03:39:54 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1202) id 7901C20B6F07; Wed, 25 Feb 2026 18:39:54 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7901C20B6F07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1772073594; bh=5RBm0nhVkH2eH5gBQn6cJaM2XG/uz3Z7o7NNfY5px28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nyu7K9jF5yczy/MkwEqS3jj48RxvYXDCqqIg11h1VGTNX4VpS1watGDx3dXitmEQI +AZbLJ88a2JXEBAZ7//lrni2IqwHKuhAXmo48arK9nUXjXZD9Yl82W048KgYZFU2x5 H5nQSrY4yTg3mNU9Sgzh0Q70ZjQIM964OHF8LC+s= From: longli@linux.microsoft.com To: dev@dpdk.org, Wei Hu , Stephen Hemminger , stable@dpdk.org, Dariusz Sosnowski , Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad Cc: Long Li Subject: [PATCH v4 7/7] net/mlx4: fix fast-path ops setup in secondary process Date: Wed, 25 Feb 2026 18:39:38 -0800 Message-ID: <20260226023940.961844-8-longli@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260226023940.961844-1-longli@linux.microsoft.com> References: <20260226023940.961844-1-longli@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 26 Feb 2026 11:16:38 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Li 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 --- 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