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 16ADDA034F for ; Wed, 10 Nov 2021 07:33:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 116B340683; Wed, 10 Nov 2021 07:33:24 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2040.outbound.protection.outlook.com [40.107.96.40]) by mails.dpdk.org (Postfix) with ESMTP id 7332140142 for ; Wed, 10 Nov 2021 07:33:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fRdIPXwNCn7brqInh7T7L4JTxu6/+IKKy7d/2mIx+Nh+4n6yzogRdxE8fGc0bbK9vp0N8XMPg+m3TalaF793frh2B0Yrf7bJEs7sv1iKNq1nSy/yO8PtPSTmitAYwOnSYwk81Sn635uCiveyeMA1cYqSpG5K080y5eP9ahtEVE2nsKdI5A4ZQcFLwEuE8TO02qBCRjXiWMJP6WkjjBgtAja9yybA5jq+IV+Du/bKFh/tuvZsCouBWwCpUyXX1hVytoRJmf0kvtRdAsGub4dS/cyYfIxetxsSwDqZhadjdJMMryHRdH45o2ebstgZZuFTrBsZDytu8HtFmssHpK+qlg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v8GSpFqRn9wVCGAtykeHtELheit0wjdlUnXVl40Wnk0=; b=BKzpBTTyL7+K/sR4OaLdQTulw4S00kQJD1Ii7oarVQSNG8TIgCp+AA5URRjrtQQAuTxU/hSsnNrFf/gdlfVuXl2UG3wAtKy6lycAUNP9AP/7aaLI+OKKSHDsJ4BuDl5CyrX5W76w6CB9g7g4erPLUzB5xSmJMBi3Pl6zOj0s3q19oGOOmhiaP3HaS+RG6gXAi4bzZEIu9SB63s3CB2FO8PZmx9cLe2i/l1hjXytx9AGbUq0GYYIJKQPV4lf+voJVJlVG6HyJ4wlORvSyFBVFsiiRllUHfDsonn1UtydmIMImg78rzp7rFgyvD3wNtOnb3I78Z8ehlqokdESJsnpCfw== 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=quarantine sp=quarantine 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=v8GSpFqRn9wVCGAtykeHtELheit0wjdlUnXVl40Wnk0=; b=o15ydknKWTVq7cVMUM9QBXMoBnEYNKnRRQDwD3eodoQGrV3mZR2xPnXfQt4EQtGoiA9CZtLyaMWKokSL9drTx/rvRax0vQv2q6StXpkHPkQ73B22sy7dBfSxFUCj1wXfRsfDUf3m13TjH8ipyd5AF2lT1SixM2DlUjDY8He08+GQ6XQT7Uq65w4fqNtfZ6f8LiM2VNsQ1e6JQNWT6ZCW8Jk6twpjSZTEzoYF3Rv+Slk71frxWCRIXFwkg00Ayxn0QtAmKfpDDIPFzzUvDJP5NfMVAkagiLkD/Vw2cBSN2SCFUoyRl4680xGcItATwrLQNVXjeeUiM5z6xt9hmrAqNQ== Received: from DM6PR13CA0070.namprd13.prod.outlook.com (2603:10b6:5:134::47) by BL1PR12MB5030.namprd12.prod.outlook.com (2603:10b6:208:313::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Wed, 10 Nov 2021 06:33:20 +0000 Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::b0) by DM6PR13CA0070.outlook.office365.com (2603:10b6:5:134::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.7 via Frontend Transport; Wed, 10 Nov 2021 06:33: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 DM6NAM11FT053.mail.protection.outlook.com (10.13.173.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:33:20 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:33:17 +0000 From: Xueming Li To: Alexander Kozyrev CC: Luca Boccassi , Viacheslav Ovsiienko , dpdk stable Date: Wed, 10 Nov 2021 14:28:12 +0800 Message-ID: <20211110063216.2744012-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 872542bb-144e-4978-f4d8-08d9a413fcce X-MS-TrafficTypeDiagnostic: BL1PR12MB5030: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1YeoQNd4aVz1iC+m9LedHv8cu3DxFNvG18jn7jyq3ARe6sbt+/BbMWu7jLqKmbNZ9wmKO26DpwsGLzgSIL8z4hiuQ1s/eC+/cGNZ3/QcbuPsVdgMN6qRuSuJHsVPghBHUqQ+aYbS5pp71ZOhj9MddmrKHxcdwiQDu1+MZ+KGs+mE7o5qaaWavpKqp1xsdovc3dZPwWgNHWiG0LPNj8FOy8XHnOJXFuRFNrq1lhQoddfppOgJJl0NKGg2qXckEKzaskQQz5QQQGlIZlfgOg65zY/1trndACO/8Qx2+ZlIpzejt3tjjMvZX0sH0Fys2SFAPIdvVE67bgEvFJH3vOpSpevrM7CUU8QL097G3plJw1F4iWjoC6Tn4xEO77uMAFMRGnf5G8DHJZQFpT/9LNVKcd/3ucxJ4QKsWH2OZVA8FZ4SDEqo9X2bqKAFMA7my+balVqfhzNX6Fzv40bH3m4jSWMU/4+emxMrffj6dAp1VR9EBhLgLwNT1wk39u/TXtCHg3pqCQP0BU1ZRw974iOpyz3p6ljY8wic0fYLYKb4LBDcRHWCvWxyOVeGFGIFSPfmr8L0+461qKFfpFPSboVe2W52JdVnavdWqY4SshQaiQ1ZdprlQD/Sh/+puFK9gR68cPwvdIT3HV5ZH4++hNBt5+WuJ7zMs5ecSCmRuOqOIQ2J8UBPXqvAQ1Q4GGVGFFOWoQnmfjvd1RpyB+up2Ka+5mCTDALQAcCHkzTqE0oHeEDrYuGj1EAs/7e8FBcfNy2TovadU+8Ly29/6EHWA1aY2sM92/mb5p2PeGS12kBXL4vOZS2FkJ36wP7hOcGstypVZ7x4ggOk/LBhBNyD5ke5fw== 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)(46966006)(36840700001)(36756003)(37006003)(966005)(54906003)(426003)(316002)(336012)(16526019)(70206006)(26005)(53546011)(186003)(2906002)(508600001)(4326008)(5660300002)(7696005)(8936002)(2616005)(83380400001)(70586007)(55016002)(82310400003)(6862004)(86362001)(356005)(1076003)(6286002)(47076005)(36860700001)(6666004)(4001150100001)(7636003)(8676002)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:33:20.1391 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 872542bb-144e-4978-f4d8-08d9a413fcce 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: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5030 Subject: [dpdk-stable] patch 'net/mlx5: fix mbuf replenishment check for zipped CQE' has been queued to stable release 20.11.4 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/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/f50cec54fd7ac0ba16ac15580c1e60b501aeb53b Thanks. Xueming Li --- >From f50cec54fd7ac0ba16ac15580c1e60b501aeb53b Mon Sep 17 00:00:00 2001 From: Alexander Kozyrev Date: Wed, 4 Aug 2021 09:23:16 +0300 Subject: [PATCH] net/mlx5: fix mbuf replenishment check for zipped CQE Cc: Xueming Li [ upstream commit 828274b70ad10bc1ae54c4b4b446e7f42f181521 ] A core dump is being generated with the following call stack: 0 _mm256_storeu_si256 (__A=..., __P=0x80) 1 rte_mov32 (src=0x2299c9140 "", dst=0x80) 2 rte_memcpy_aligned (n=60, src=0x2299c9140, dst=0x80) 3 rte_memcpy (n=60, src=0x2299c9140, dst=0x80) 4 mprq_buf_to_pkt (strd_cnt=1, strd_idx=0, buf=0x2299c8a00, len=60, pkt=0x18345f0c0, rxq=0x18345ef40) 5 rxq_copy_mprq_mbuf_v (rxq=0x18345ef40, pkts=0x7f76e0ff6d18, pkts_n=5) 6 rxq_burst_mprq_v (rxq=0x18345ef40, pkts=0x7f76e0ff6d18, pkts_n=46, err=0x7f76e0ff6a28, no_cq=0x7f76e0ff6a27) 7 mlx5_rx_burst_mprq_vec (dpdk_rxq=0x18345ef40, pkts=0x7f76e0ff6a88, pkts_n=128) 8 rte_eth_rx_burst (nb_pkts=128, rx_pkts=0x7f76e0ff6a88, queue_id=, port_id=) This crash is caused by an attempt to copy previously uncompressed CQEs into non-allocated mbufs. There is a check to make sure we only use allocated mbufs in the rxq_burst_mprq_v() function, but it is done only before the main processing loop. Leftovers of compressed CQEs session are handled before that loop and may lead to the mbufs overflow as seen. Move the check for replenished mbufs up to protect uncompressed CQEs session leftovers from accessing non-allocated mbufs after the mlx5_rx_mprq_replenish_bulk_mbuf() function is invoked. Bugzilla ID: 746 Fixes: 0f20acbf5eda ("net/mlx5: implement vectorized MPRQ burst") Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx_vec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c index b8b555690e..1536a462dc 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec.c +++ b/drivers/net/mlx5/mlx5_rxtx_vec.c @@ -442,6 +442,8 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, rte_prefetch0(cq + 3); pkts_n = RTE_MIN(pkts_n, MLX5_VPMD_RX_MAX_BURST); mlx5_rx_mprq_replenish_bulk_mbuf(rxq); + /* Not to move past the allocated mbufs. */ + pkts_n = RTE_MIN(pkts_n, rxq->elts_ci - rxq->rq_pi); /* See if there're unreturned mbufs from compressed CQE. */ rcvd_pkt = rxq->decompressed; if (rcvd_pkt > 0) { @@ -457,8 +459,6 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, /* Not to cross queue end. */ pkts_n = RTE_MIN(pkts_n, elts_n - elts_idx); pkts_n = RTE_MIN(pkts_n, q_n - cq_idx); - /* Not to move past the allocated mbufs. */ - pkts_n = RTE_MIN(pkts_n, rxq->elts_ci - rxq->rq_pi); if (!pkts_n) { *no_cq = !cp_pkt; return cp_pkt; -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:02.487895876 +0800 +++ 0008-net-mlx5-fix-mbuf-replenishment-check-for-zipped-CQE.patch 2021-11-10 14:17:01.740747155 +0800 @@ -1 +1 @@ -From 828274b70ad10bc1ae54c4b4b446e7f42f181521 Mon Sep 17 00:00:00 2001 +From f50cec54fd7ac0ba16ac15580c1e60b501aeb53b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 828274b70ad10bc1ae54c4b4b446e7f42f181521 ] @@ -33 +35,0 @@ -Cc: stable@dpdk.org @@ -42 +44 @@ -index e1b6d5422a..ecd273e00a 100644 +index b8b555690e..1536a462dc 100644 @@ -45 +47 @@ -@@ -448,6 +448,8 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, +@@ -442,6 +442,8 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, @@ -54 +56 @@ -@@ -463,8 +465,6 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, +@@ -457,8 +459,6 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,