From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B97A489F4 for ; Tue, 28 Oct 2025 04:16:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A5ED4021E; Tue, 28 Oct 2025 04:16:54 +0100 (CET) Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) by mails.dpdk.org (Postfix) with ESMTP id 7D30B4021E for ; Tue, 28 Oct 2025 04:16:52 +0100 (CET) dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=JH5u41l49ytK76drvW5sA5AJgnZRQjPL/TkkGfsl+gY=; b=mmkQN+JcL06wdRxu6FkcufILQCEwN7CZF35R4A/pwiGqVke+xoWian8FYYhNGEcdHQYDz2z/5 5kxa5UmcGomMzqWa4pEBevrEbz3szradQwnRvvRM4acd5aDGDffbakzXKzllhHQPWZcdX1JdGXc HNWLA0OF4GLgnVcZm5spcTs= Received: from mail.maildlp.com (unknown [172.19.163.174]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4cwb9D0bcRzcZyk for ; Tue, 28 Oct 2025 11:15:28 +0800 (CST) Received: from kwepemk500009.china.huawei.com (unknown [7.202.194.94]) by mail.maildlp.com (Postfix) with ESMTPS id A42CB1402EA for ; Tue, 28 Oct 2025 11:16:49 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 28 Oct 2025 11:16:49 +0800 From: Chengwen Feng To: CC: , Subject: [PATCH 22.11] net/hns3: fix overwrite mbuf in vector path Date: Tue, 28 Oct 2025 11:16:44 +0800 Message-ID: <20251028031644.54023-1-fengchengwen@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: kwepems200002.china.huawei.com (7.221.188.68) To kwepemk500009.china.huawei.com (7.202.194.94) X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ upstream commit 06b296a2264fcd1fe2d167f2d90a58607f5e81f5 ] The vector path processes multiple descriptors at a time and modifies the corresponding mbufs accordingly. When the mbufs cannot be applied for, the previous patch [1] only clears the first descriptor's valid bit, which is not enough. In this patch, the mbufs points to the fake_mbuf to prevent overwrite. [1] commit 01843ab2f2fc ("net/hns3: fix crash for NEON and SVE") Fixes: a3d4f4d291d7 ("net/hns3: support NEON Rx") Fixes: 01843ab2f2fc ("net/hns3: fix crash for NEON and SVE") Signed-off-by: Chengwen Feng Signed-off-by: Dengdui Huang --- drivers/net/hns3/hns3_rxtx_vec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/hns3/hns3_rxtx_vec.c b/drivers/net/hns3/hns3_rxtx_vec.c index 2265804fda..1af064e77f 100644 --- a/drivers/net/hns3/hns3_rxtx_vec.c +++ b/drivers/net/hns3/hns3_rxtx_vec.c @@ -69,8 +69,12 @@ hns3_rxq_rearm_mbuf(struct hns3_rx_queue *rxq) /* * Clear VLD bit for the first descriptor rearmed in case * of going to receive packets later. + * And also point mbufs to fake_mbuf to prevent modification + * of the mbuf field during vector packet receiving. */ rxdp[0].rx.bd_base_info = 0; + for (i = 0; i < HNS3_VECTOR_RX_OFFSET_TABLE_LEN; i++) + rxep[i].mbuf = &rxq->fake_mbuf; rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed++; return; } -- 2.17.1