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 B5FF1A0A0E for ; Mon, 10 May 2021 18:07:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B08574003E; Mon, 10 May 2021 18:07:23 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by mails.dpdk.org (Postfix) with ESMTP id 11AB24003E for ; Mon, 10 May 2021 18:07:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n9hrP4kugkfsfWQzfE1A4/QIliHeS8XEsKNfw+9JT6tAZ55jvVmRF2Wl3YY2r7fkL88NYFNJQyN9OFrDdjAEgbjRWiBnQAhR8Qv8rUwza2XgKFuuGSqzJcFhehwNhH67rSecAh9YMU6hjaKsqkSRJSclLPPnNc/k+NfHTMzDvKbZkObI90v6MAoPz7yumGzvCY1qAVSwomIKwS9BuEZVF7vmsjTKGEkhqDeG26TRSd3IaqjkfJLMG8onoSq/IRXJOD1LpD0eOgTVA1m0rZlq+q1zZcscJJu3gCSXBKiAm2lloDa3pD/dtAwylPJ6shadi6Sa6rQ3iEHFSNRl8wrkyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9VpoQ7X2QHYRTXRnKMNP/Ss6Shg0fodnqUdZQV8BKO0=; b=PmYBBTTl1Ip0tIXegQr9K4LgQNIkLnPZbBBxD5/S+G9+3vTkZBSIue/Q1K/96moZb+9DSFAzsqF/brkDb9osBZHcuj46arBaK9AlMy17cihf1TzxVK2PAFIBuu5tv3G11qhjuuQCk7WgZDFrE9YQzQQUUsbotx4K+Ll2Cv+fNuiAP96ipJHrNNoDDEdm0Z8GhyNpMlyf2gMMUW27Vi4YGjcKtC/R6cALfa0fRxhpbVOiaoS9G8A6Zv6mFWe3IxQF06fktSHRGldjgPy7hJKlEBRfEStE3YWiQ3ajS0b8d5pszWTyKhtIgqYajvlkFk0TniHnLijaOW6cSOttO4H1RA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9VpoQ7X2QHYRTXRnKMNP/Ss6Shg0fodnqUdZQV8BKO0=; b=dcg4MzwvXMvYST8EQ0HUzLg8Hag2VDFws1Q6XCU3FDZm16+GGchJycA/itVQIQEYOqFTCooa+wl8YDjaocmsT9PPZ1C2h/qRDTSGGCV30JlKX2sJbMkRrMBarfYd2DSt5+OZ/CmjrNFuLMdF10Zk01n3C5HY8pwPIq8exikZEGy7oTZiFZxmhWs+9VtnG1HQFUf1U7sLsQYWQCZwtJ6Zub6798mAV+Sm3bkf5fdbOf8r/VBHAVJ18wK4jzibMiqCbU223QsUHbOOI8CKywT87s4gvzODcwN4dRBDWCYbXdYlsX18Hg3TrvxEx25F8NoSdowaWPwQUnTYtfbxHMB4VA== Received: from BN6PR14CA0026.namprd14.prod.outlook.com (2603:10b6:404:13f::12) by SN6PR12MB2781.namprd12.prod.outlook.com (2603:10b6:805:67::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 16:07:20 +0000 Received: from BN8NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:404:13f:cafe::b1) by BN6PR14CA0026.outlook.office365.com (2603:10b6:404:13f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:07:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT037.mail.protection.outlook.com (10.13.177.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:07:20 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:07:18 +0000 From: Xueming Li To: Jiawei Zhu CC: Luca Boccassi , Viacheslav Ovsiienko , dpdk stable Date: Mon, 10 May 2021 23:59:50 +0800 Message-ID: <20210510160258.30982-41-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 532a79d6-251d-4353-1fc1-08d913cdb0ac X-MS-TrafficTypeDiagnostic: SN6PR12MB2781: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3pgG8TnhtXVtpqa5jjisdvEVCBPtJpeLpbHIoLYtLIKzYO4/AP3jyVUMpSCyHGYyhahW9JCIqjFBIJV+DMIv6pwqPQNZ/vGgeUZod6cBqs6MFIAKmCVtBXVoeQiDRY25aXdweBtoFXaTUL7fjZgL4zExg4taRkEUXVaKYNcseT4os7vZxrjsqTpF/bqUXp6mc4y6RqZ+ro+JLi1tdtpHxdYonpRCMkyAD+M7eGkpTi2ug2aU/kKvIhk86kHgmf9Qdqs9EF7z4DoIH9LFFXlvTisP03xmHWe100RiJ+JfpG2nGd9O8RFbL5QuIiAzw61vIpINJBYPRcIyxQcu39WyRJFzesGnqeqGsumRmYHxjG7pXHT/dAkc+2b9VVitFRDL8dSjoCLsp0n5YFPbYss4LkOkvXfLUDo0sWaZ+VRNFa6ZsoV59CtiTiOCspw4qsBfvfmSh8STqwrDk7Sok9vHMIEcAFdQCrBXV37FD4vIrPftCLVL0lDOaQ1zOmSCzd9ijmA6X5XkhD9IC1Vsb0uN2DN8ySPbpI43QIyl/KtN1ZhywAe+EHEbmJ8HG7fD1wM/fFt/ceQQ82mF6FCXJaphuxHSL/BP735dizl8KPA6mwvc7LGC0x/grYwlPnrDr79E8qm4QD9HFVMxPW753CwVVj8wMcZllbhDnYBc9UWNVeJkZVzrr+/ykT7eZnXD/9RGUMu5/lvkYp8jOz9qJM3mWTkIGg9cWQyIff3STUypR09aHhAdgVliyoo8Q+EzGIjiFehzSz73hlhWMBgCUkES5Q== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(376002)(396003)(346002)(39860400002)(36840700001)(46966006)(16526019)(336012)(7636003)(186003)(26005)(426003)(478600001)(4326008)(86362001)(966005)(6916009)(6666004)(356005)(2906002)(47076005)(316002)(82310400003)(5660300002)(55016002)(36756003)(70586007)(8676002)(1076003)(8936002)(7696005)(36860700001)(36906005)(53546011)(2616005)(70206006)(54906003)(82740400003)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:07:20.1080 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 532a79d6-251d-4353-1fc1-08d913cdb0ac X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2781 Subject: [dpdk-stable] patch 'net/mlx5: fix Rx segmented packets on mbuf starvation' has been queued to stable release 20.11.2 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" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/6f1a03c53ef11381577d7f9c8216c9ec4da7fb63 Thanks. Xueming Li --- >From 6f1a03c53ef11381577d7f9c8216c9ec4da7fb63 Mon Sep 17 00:00:00 2001 From: Jiawei Zhu Date: Mon, 1 Mar 2021 12:19:50 -0500 Subject: [PATCH] net/mlx5: fix Rx segmented packets on mbuf starvation Cc: Luca Boccassi [ upstream commit c9678e49feef4e423ebd917c7670fee238f4c2bb ] The issue occurred if mbuf starvation happened in the middle of segmented packet reception. In such a situation, after release the segments of packet being received, code did not advance the consumer index to the next stride. This caused the receiving of the wrong segmented packet data. The possible error scenario: - we assume segs_n is 4 and we are receiving 4 segments of multi-segment packet. - we fail to allocate mbuf while receiving the 3rd segment, and this frees the mbufs of the packet chain we have built. There are the 1st and 2nd segments in the chain. - the 1st and the 2nd segments of this stride of Rx queue are filled up (in elts array) with the new allocated mbufs and their data are random (the 3rd and 4th segments still contain the valid data of the packet though). - on the next iteration of stride processing we get the wrong two segments of the multi-segment packet. Hence, we should skip these mbufs in the stride and we should advance the consumer index on loop exit. Fixes: 15a756b63734 ("net/mlx5: fix possible NULL dereference in Rx path") Signed-off-by: Jiawei Zhu Acked-by: Viacheslav Ovsiienko --- 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 d12d746c2f..fac823ba64 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1430,6 +1430,9 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) rte_mbuf_raw_free(pkt); pkt = rep; } + rq_ci >>= sges_n; + ++rq_ci; + rq_ci <<= sges_n; break; } if (!pkt) { -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:27.754244800 +0800 +++ 0042-net-mlx5-fix-Rx-segmented-packets-on-mbuf-starvation.patch 2021-05-10 23:59:26.380000000 +0800 @@ -1 +1 @@ -From c9678e49feef4e423ebd917c7670fee238f4c2bb Mon Sep 17 00:00:00 2001 +From 6f1a03c53ef11381577d7f9c8216c9ec4da7fb63 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit c9678e49feef4e423ebd917c7670fee238f4c2bb ] @@ -30 +32,0 @@ -Cc: stable@dpdk.org @@ -39 +41 @@ -index 2e4b87c3e5..e3ce9fd224 100644 +index d12d746c2f..fac823ba64 100644 @@ -42 +44 @@ -@@ -1480,6 +1480,9 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) +@@ -1430,6 +1430,9 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)