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 B7265A0550 for ; Mon, 15 Feb 2021 12:59:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A46BA1606C3; Mon, 15 Feb 2021 12:59:43 +0100 (CET) Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by mails.dpdk.org (Postfix) with ESMTP id B16A140FDF; Mon, 15 Feb 2021 12:59:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=C8Aq46L17s9XvTsXEt k/dTZMKPmRk4ayB6gIlQgGVYk=; b=WEERKUvfOrOLAsxzEARCtX5YYRfzfX7SF8 Jd4IR49cgEqL6cmhJi+jH27hL76f+RwBcH0OWN30NgQzX/PmFHbR9kEHQ4dM1q/9 sFJE+nZ6LrdOqN4+0lSIw3SwVbgGKr5voBkcI9b4VjVSLbZmjjZS9g+mhq9sonYl zKKYSGyj4= Received: from localhost.localdomain.localdomain (unknown [183.134.202.55]) by smtp14 (Coremail) with SMTP id EsCowACHjQknYipgjzwmUQ--.13742S2; Mon, 15 Feb 2021 19:59:36 +0800 (CST) From: Jiawei Zhu <17826875952@163.com> To: dev@dpdk.org Cc: zhujiawei12@huawei.com, matan@nvidia.com, shahafs@nvidia.com, viacheslavo@nvidia.com, Jiawei Zhu <17826875952@163.com>, stable@dpdk.org Date: Mon, 15 Feb 2021 05:15:14 -0500 Message-Id: <1613384114-17855-1-git-send-email-17826875952@163.com> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: EsCowACHjQknYipgjzwmUQ--.13742S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrZr13Jw1kWrWDGr17JFy7Jrb_yoWfGrc_KF 4fXF13ZryUWryayr1YkrW5trWFgrWxWrnavFyxtaySqayYqryfJrnY9F13Zw1xWw1xZ3Z8 A3W3t348Ary3XjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRi4rW3UUUUU== X-Originating-IP: [183.134.202.55] X-CM-SenderInfo: bprxmjywyxkmivs6il2tof0z/1tbiqgg69lr7sHaZVQAAsF Subject: [dpdk-stable] [PATCH] net/mlx5: fix wrong segmented packet in Rx 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 Sender: "stable" Fixed issue could occur when Mbuf starvation happens in a middle of reception of a segmented packet. In such a situation, after release the segments of that packet, it does not align consumer index to the next stride. This would cause receive a wrong segmented packet. Fixes: 15a756b63734 ("net/mlx5: fix possible NULL dereference in Rx path") Cc: stable@dpdk.org Signed-off-by: Jiawei Zhu <17826875952@163.com> --- drivers/net/mlx5/mlx5_rxtx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 2e4b87c..e3ce9fd 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1480,6 +1480,9 @@ enum mlx5_txcmp_code { rte_mbuf_raw_free(pkt); pkt = rep; } + rq_ci >>= sges_n; + ++rq_ci; + rq_ci <<= sges_n; break; } if (!pkt) { -- 1.8.3.1