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 DC4DA45CE3 for ; Mon, 11 Nov 2024 07:30:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5BD24067A; Mon, 11 Nov 2024 07:30:38 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2047.outbound.protection.outlook.com [40.107.94.47]) by mails.dpdk.org (Postfix) with ESMTP id 868284067A for ; Mon, 11 Nov 2024 07:30:36 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FJQb6Tk4lcVFUY4xSJy9Q8coC7pm5jUE+DT1UMQVuYX1J+qucakKHDwzzWlnRDJK8KeamM2eMikp9ki6Sula9KGgvstK3NUDVkDA+0MZ79I2I0jINy0gwl13paiEc95O8ConTzOcEcwQwnRIsnHk1mQHsWTYDTg09nm0dZBLlQXMpkeS+z7eMwbPbiJ+JjkasRm6HWi+oxZDYPTQhsJigq8jlddTmyhICFcXs0xYphmy5ljITdlxOdqAYhJWlFpaMnqwsB4bYKr4LSrZV/9v96vH2/5yYEnlGajZTXM0QtKRFjW0xoZRrD4RrI3QsxmF6kyPR273z8M0Y2N1NEvLhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=8aw8lJIWojxkOc0d8IpafA+/q0aP6jRrQehUZAPX/S0=; b=vcCtxePZfdEt9mg6JNYAhHm4+ll+wPjg2PDGWyX0KzbXKfBKPkTObu0aCOfsMz6gW8GyHyKRswiI3Qd1hXeMdt6xPE8IE9E/gFfm0D9JE1hlfoqzgHOTgD/8DLnAFM2d9YRbeAvZIbQWI3Omk4xfbDb/gNu0ANyBRgjM4Xq25oZAX6TTcojRCDRlHUF7w6hXpbGTBRb7C2cVv2vE1nbo4N2CKfEdey8NOJ7oDzXW/YyNWA2182B00j6S35hKcpAqKuKeDlSh0HiRejRxb1W2WKB43y86NKczUhsaudhwJZnx27r2xG5R8CgBIrD6GwxdTPPzMBe7Nf1V0loqNKWamA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=8aw8lJIWojxkOc0d8IpafA+/q0aP6jRrQehUZAPX/S0=; b=QtYyKITb27yqoy2ZA7l9dZjc7iSJ3b6mdrJLHGOVhPrdGnVjSBFtnFikj38wKd1fkMg3Ww2haruPgTCdj1nwWKbASVPk8ODIZ9zC+B6Vw7bVSTPx9o/eYgrNimzLK61tQClvCXEtq8wG9mauP/LbGbeI+6Yb9caDHtjt125eZVqOvskRb2VDUgmALcis3jFga+pt6YeZ1b6YIeDudFY+C4qPyER0Tcwow5MBHZ4PrEY2VOulqSVALqAmK1eJR4KAAWBgsXFxATpJwux/7YoJQ1449fkPXrD/28wmIP5Bxk4R7jMbAP6h6GFFcBiUIgx/b4Rr4h3uF9mjVr6IvMRZAw== Received: from BN6PR17CA0048.namprd17.prod.outlook.com (2603:10b6:405:75::37) by IA0PR12MB8983.namprd12.prod.outlook.com (2603:10b6:208:490::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 06:30:32 +0000 Received: from BN2PEPF000055DC.namprd21.prod.outlook.com (2603:10b6:405:75:cafe::54) by BN6PR17CA0048.outlook.office365.com (2603:10b6:405:75::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Mon, 11 Nov 2024 06:30:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN2PEPF000055DC.mail.protection.outlook.com (10.167.245.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.1 via Frontend Transport; Mon, 11 Nov 2024 06:30:32 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:30:15 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:30:13 -0800 From: Xueming Li To: Tejasree Kondoj CC: , Akhil Goyal , dpdk stable Subject: patch 'examples/ipsec-secgw: fix dequeue count from cryptodev' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:26:58 +0800 Message-ID: <20241111062847.216344-13-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055DC:EE_|IA0PR12MB8983:EE_ X-MS-Office365-Filtering-Correlation-Id: 6afd2549-c565-48f6-66a9-08dd021a57f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?kisyIVNWY0Ltvyju6zr97+krNM70eD1ZpHDu9/uJ8187Pybc9Tx5KhbwOkdR?= =?us-ascii?Q?9IC+WrvV6Nk8tGjRZdW4Bn5GxDumAvCqs1QOv/aJy+aHUbnQ15Q1aPWsOGOh?= =?us-ascii?Q?nuLFNcLmnObmVQIpgSWZvQSX3rk32+a7QFazjk6+n/kFxpUnIBrxKF40xmwv?= =?us-ascii?Q?7DOKWcj3r6l0Kz6xzBm00YXiaekNQvmI7rCwGfEoyvs/n4ioAsZdoJ6hOuFe?= =?us-ascii?Q?YPNPln8YB/945EajUA0mCIO+F8jNygd9msnL9DKekPyMksDHI7cU7yvpsoRv?= =?us-ascii?Q?yEMOrjs/Tc8fzMKaWT/ILv/BMVUeSJ64D3/cxT5cVH8unvNBcRgBZ5lT/cRe?= =?us-ascii?Q?sMoJv4y4dpRbPs2nxCIs/6Fvl7fHzJoiLpF2jH0nuZldKqERDpLKgONaFPwz?= =?us-ascii?Q?3ld/gwol2olfQpVDaipOpDPCSc4PA5VdaKqJ6H6tTrKwJlraOBcATQGdm5Pk?= =?us-ascii?Q?VrLebTYmWnJ9+103hrLGnJel2sNoCYQJtbBVnBtFpNeM4O4oQHC9ou23I8/n?= =?us-ascii?Q?j5ZY9/71BTDisuXY3BAZaQ4QD9jKvInz5/jWA/eJ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.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:30:32.2619 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6afd2549-c565-48f6-66a9-08dd021a57f4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DC.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8983 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 Hi, FYI, your patch has been queued to stable release 23.11.3 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/30/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e3875312dbf74eeec02d8460ae4dd2f35bc2b464 Thanks. Xueming Li --- >From e3875312dbf74eeec02d8460ae4dd2f35bc2b464 Mon Sep 17 00:00:00 2001 From: Tejasree Kondoj Date: Fri, 13 Sep 2024 12:37:26 +0530 Subject: [PATCH] examples/ipsec-secgw: fix dequeue count from cryptodev Cc: Xueming Li [ upstream commit 88948ff31f57618a74c8985c59e332676995b438 ] Setting dequeue packet count to max of MAX_PKT_BURST size instead of MAX_PKTS. Dequeue from cryptodev is called with MAX_PKTS but routing functions allocate hop/dst_ip arrays of size MAX_PKT_BURST. This can corrupt stack causing stack smashing error when more than MAX_PKT_BURST packets are returned from cryptodev. Fixes: a2b445b810ac ("examples/ipsec-secgw: allow larger burst size for vectors") Signed-off-by: Tejasree Kondoj Acked-by: Akhil Goyal --- examples/ipsec-secgw/ipsec-secgw.c | 6 ++++-- examples/ipsec-secgw/ipsec_process.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 761b9cf396..5e77d9d2ce 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -626,12 +626,13 @@ drain_inbound_crypto_queues(const struct lcore_conf *qconf, uint32_t n; struct ipsec_traffic trf; unsigned int lcoreid = rte_lcore_id(); + const int nb_pkts = RTE_DIM(trf.ipsec.pkts); if (app_sa_prm.enable == 0) { /* dequeue packets from crypto-queue */ n = ipsec_inbound_cqp_dequeue(ctx, trf.ipsec.pkts, - RTE_DIM(trf.ipsec.pkts)); + RTE_MIN(MAX_PKT_BURST, nb_pkts)); trf.ip4.num = 0; trf.ip6.num = 0; @@ -663,12 +664,13 @@ drain_outbound_crypto_queues(const struct lcore_conf *qconf, { uint32_t n; struct ipsec_traffic trf; + const int nb_pkts = RTE_DIM(trf.ipsec.pkts); if (app_sa_prm.enable == 0) { /* dequeue packets from crypto-queue */ n = ipsec_outbound_cqp_dequeue(ctx, trf.ipsec.pkts, - RTE_DIM(trf.ipsec.pkts)); + RTE_MIN(MAX_PKT_BURST, nb_pkts)); trf.ip4.num = 0; trf.ip6.num = 0; diff --git a/examples/ipsec-secgw/ipsec_process.c b/examples/ipsec-secgw/ipsec_process.c index b0cece3ad1..1a64a4b49f 100644 --- a/examples/ipsec-secgw/ipsec_process.c +++ b/examples/ipsec-secgw/ipsec_process.c @@ -336,6 +336,7 @@ ipsec_cqp_process(struct ipsec_ctx *ctx, struct ipsec_traffic *trf) struct rte_ipsec_session *ss; struct traffic_type *out; struct rte_ipsec_group *pg; + const int nb_cops = RTE_DIM(trf->ipsec.pkts); struct rte_crypto_op *cop[RTE_DIM(trf->ipsec.pkts)]; struct rte_ipsec_group grp[RTE_DIM(trf->ipsec.pkts)]; @@ -345,7 +346,7 @@ ipsec_cqp_process(struct ipsec_ctx *ctx, struct ipsec_traffic *trf) out = &trf->ipsec; /* dequeue completed crypto-ops */ - n = ctx_dequeue(ctx, cop, RTE_DIM(cop)); + n = ctx_dequeue(ctx, cop, RTE_MIN(MAX_PKT_BURST, nb_cops)); if (n == 0) return; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.037734621 +0800 +++ 0012-examples-ipsec-secgw-fix-dequeue-count-from-cryptode.patch 2024-11-11 14:23:05.032192841 +0800 @@ -1 +1 @@ -From 88948ff31f57618a74c8985c59e332676995b438 Mon Sep 17 00:00:00 2001 +From e3875312dbf74eeec02d8460ae4dd2f35bc2b464 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 88948ff31f57618a74c8985c59e332676995b438 ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -26 +28 @@ -index e98ad2572e..063cc8768e 100644 +index 761b9cf396..5e77d9d2ce 100644 @@ -60 +62 @@ -index ddbe30745b..5080e810e0 100644 +index b0cece3ad1..1a64a4b49f 100644