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 BCBA243E57 for ; Sat, 13 Apr 2024 14:51:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6F1540294; Sat, 13 Apr 2024 14:51:14 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2067.outbound.protection.outlook.com [40.107.102.67]) by mails.dpdk.org (Postfix) with ESMTP id 6DDB5400D6 for ; Sat, 13 Apr 2024 14:51:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LtYM5AdxwC2R3THDCZaxycjpo1Ym++49RPWcp/WbrXoT0au5HF6UrdIaeOWvRVroCJsijnBVakC9oMgvW9Pt15gTw+2z0UgeuUF8ddQJ+U0VkqLQVH8UDLtGoS92mWsf10+8Mt0owaI0uV4izyEWNRjtOcpyw2VGvIjFvhnwFOtu0YHFc6nJrT5k9Z1y7SuspxhLp8o+4vCc75hWE/ei65r+0hNDVPuXIcLkE+E65UmtV0wj97Y6QUbVUUoyke+KOnap2ssagYnaG1f0gi3nyPvdmwBL91H27Fqu+lnGU4honjyHAGORa1Y7/6lrlpewJY/E8d50iNJsq15wjKPERw== 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=+Ka56w6r1Fz3Uoj0tJT7RjE5d6jPRbX7wKqmtIZ+oiE=; b=IEPpcqZT7KyXOUq0O2RftOe6vNtjf0OulrsCM9OVdRdf2YGFuFxM0yvc6nuhI7ehZvCdhfTXCgE0jAQKvRAy+74E/6NsNcfGsKjt0idOO4RN7cfIalQzqA+4rGlZ1idU2bYKlcJJUgT+sTi30cVy6EniN7afgbFlPeKx80R35upscL0Gei5HBVwZUYH3/xbWP/mTQJX5jSIrqjA4JVzY2Yvn5OVpmp4irNiNWaTekycFKcZ0t5MLHA0kW3Fiqj5T/ySJSeX9A3X6PFZfrvIz9mofdsuuN27JKZTyNmm6cbnr6GT0fHLWWSewGLkV8g7h+a+V4WfNDQ4U5F5a4cl3Jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.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=+Ka56w6r1Fz3Uoj0tJT7RjE5d6jPRbX7wKqmtIZ+oiE=; b=DwI4jj2MNQy1rIejH1JARaX8mcnqSlJqs0kXveDo85v06OxNIBxco/d0i9MmmnDy5Sgx8vzvrnn6po7wAr7lru7VyOjqozRyVy7xQLjuD1yIWrV6LTnADou3c/cdego5wu3OG9pc92JAoHlc/H23uJaCd/9o2k6XI6ZO7H/9PWDpDf1YVTjNkZIklI8hBUjviAWeNnIPiKxiQvd9WqP+4f00e3hsIm4JX/BKxDA7kGxd0dcbPFSYe5eJ1M93cyxI6v+kSjaIJGW8pazmo1/Yat26L6BnPnuVQQBJaXq6NQ/EPeqxGq7CC/TN9DAg4TYgxbupJLH2CXgmO1x9a0RENA== Received: from MN2PR13CA0020.namprd13.prod.outlook.com (2603:10b6:208:160::33) by DS7PR12MB6007.namprd12.prod.outlook.com (2603:10b6:8:7e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Sat, 13 Apr 2024 12:51:10 +0000 Received: from BL02EPF00021F6E.namprd02.prod.outlook.com (2603:10b6:208:160:cafe::16) by MN2PR13CA0020.outlook.office365.com (2603:10b6:208:160::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.16 via Frontend Transport; Sat, 13 Apr 2024 12:51:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF00021F6E.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:51:10 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 13 Apr 2024 05:50:57 -0700 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.1258.12; Sat, 13 Apr 2024 05:50:56 -0700 From: Xueming Li To: Ganapati Kundapura CC: Abhinandan Gujjar , dpdk stable Subject: patch 'eventdev/crypto: fix enqueueing' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:48:07 +0800 Message-ID: <20240413125005.725659-7-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F6E:EE_|DS7PR12MB6007:EE_ X-MS-Office365-Filtering-Correlation-Id: ff09c563-7071-41df-f47a-08dc5bb864c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ml3Ru0PD26YFhvcxnSY85UUXj4N4W0Vl3TrZfLi6b46T66LalYJ85mOD1wZtBoK0jgZI8jfig+3bsKhCqJE506xHBYWQjmL2NWocGH54is8tdtJ1tHOWvoZaXn7JHZHf85lt06P89ecsoXvnrPHjxulBYlxHJCYvkc1/8g6nABq0Vl78BMbaQnOKR3mYCfkxT7PaltZtdsP1Mu4Nsr0rL+cseTmXbQkDjKnQJpekaFlNMJY6UdhH7YJr2kjwQBmHmC2+zTQLX0CaDldvSP60zDUDNg6cG2s/t/arlLPrivbBJ/FZBo57UlnrbFRnjQ2/RjPtg2maGB5a6IxC/inHgo/OhpVI89/DGV31CNSDV7/Opk0lUnczPIXP8NIrEbgJhx7MEY0Q1UgXS3HK1ZZq0OVXPSDZotNxAFWY24vvyBiSIUVQsXq/ibeXuflsAMoKRrdB5U1q1qvIlHxKkSYhZ89XSTydeHPFKyo1LXGgwzlGJ1c8j6N4be1DVUIiyYGGj4wK2oev1dorj5PzyJe0fPiDH/I5BKLRgOUtavksQmj8Vt45ygT6ZWn5axZ8/5wPgA0L/LCQiS1iZxtAo/Qkj8mkic7XyNlggJMdSFxuuRDl80eccaPGVZm81GrORirsru6r3WncNaTI9yY23j2LDvxdZBKKQqhj158eQODta/J2VEH5B2TLK6XgrLnVEoN0dAEfRvQqX7mUjfEi9XndFn0FK4YHBiB0c3nO1BqcbiO4kiXRMbWx7QM2eJkKcubV X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(1800799015)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:51:10.0803 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff09c563-7071-41df-f47a-08dc5bb864c9 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F6E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6007 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/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=b2cd908926f9d8d9046e850dc0ca2a6494ef724b Thanks. Xueming Li --- >From b2cd908926f9d8d9046e850dc0ca2a6494ef724b Mon Sep 17 00:00:00 2001 From: Ganapati Kundapura Date: Wed, 28 Feb 2024 04:39:19 -0600 Subject: [PATCH] eventdev/crypto: fix enqueueing Cc: Xueming Li [ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ] When tail pointer of circular buffer rolls over as the circular buffer becomes full, crypto adapter is enqueueing ops beyond the size of the circular buffer leading to segfault due to invalid ops access. Fixed by enqueueing ops from head pointer to (size-head) number of ops when circular buffer becomes full and the remaining ops will be flushed in next iteration. Fixes: 6c3c888656fc ("eventdev/crypto: fix circular buffer full case") Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- lib/eventdev/rte_event_crypto_adapter.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index d46595d190..9903f96695 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -245,20 +245,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp, struct rte_crypto_op **ops = bufp->op_buffer; if (*tailp > *headp) + /* Flush ops from head pointer to (tail - head) OPs */ n = *tailp - *headp; else if (*tailp < *headp) + /* Circ buffer - Rollover. + * Flush OPs from head to max size of buffer. + * Rest of the OPs will be flushed in next iteration. + */ n = bufp->size - *headp; else { /* head == tail case */ /* when head == tail, * circ buff is either full(tail pointer roll over) or empty */ if (bufp->count != 0) { - /* circ buffer is full */ - n = bufp->count; + /* Circ buffer - FULL. + * Flush OPs from head to max size of buffer. + * Rest of the OPS will be flushed in next iteration. + */ + n = bufp->size - *headp; } else { - /* circ buffer is empty */ + /* Circ buffer - Empty */ *nb_ops_flushed = 0; - return 0; /* buffer empty */ + return 0; } } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:05.411943791 +0800 +++ 0007-eventdev-crypto-fix-enqueueing.patch 2024-04-13 20:43:04.907754049 +0800 @@ -1 +1 @@ -From f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 Mon Sep 17 00:00:00 2001 +From b2cd908926f9d8d9046e850dc0ca2a6494ef724b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org