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 BC45FFD375F for ; Wed, 25 Feb 2026 13:59:25 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03DE0402DF; Wed, 25 Feb 2026 14:58:38 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4B245402E4; Wed, 25 Feb 2026 03:03:02 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1202) id D7F9D20B6F04; Tue, 24 Feb 2026 18:03:01 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D7F9D20B6F04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1771984981; bh=5RBm0nhVkH2eH5gBQn6cJaM2XG/uz3Z7o7NNfY5px28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GiQp/i8RfGgEIFfrpzG6ScFe1KI/nRj2btYq4xBNNV6+Z4bAl7ZmtfShjN8AETTfH nZTjIEr4n0waydQZ4glcW57D3qlqsfe+09Bt5TDuTzUH0E62dE8xNT7xd3IqQpthVk LK12CgYIQMMatr2Hoq91JrFgrAJERGEydjBov+P0= 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 v3 7/7] net/mlx4: fix fast-path ops setup in secondary process Date: Tue, 24 Feb 2026 18:02:39 -0800 Message-ID: <20260225020246.890306-8-longli@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260225020246.890306-1-longli@linux.microsoft.com> References: <20260225020246.890306-1-longli@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 25 Feb 2026 14:58:29 +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