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 35D7941D8C for ; Mon, 27 Feb 2023 08:02:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30601410D3; Mon, 27 Feb 2023 08:02:57 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2073.outbound.protection.outlook.com [40.107.237.73]) by mails.dpdk.org (Postfix) with ESMTP id 3DEF840A84 for ; Mon, 27 Feb 2023 08:02:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R8269ISytFSb6h/8+c//5Z4HIBkX5KtgxOcUGSJpJWMXv45OJZtvVSKfFHtlc/si6n6+q4zuEMDqoYOXpgsEn2dEyWkvspkjK1aYhjsfzZGsig3isOgdNhvyjdOFJ/fu6niwz5w2GkbSPUJ4Bqupo9q7UzIXTe3oxNYrHm4loeHycE5BTgLOfTy18QUoej1dAQQKXjzDPZOhIPldp83gpMpEDlToFaAhng8zRmcB0tizLa/38D/xYAJ1YQ6AtXLHy76qi2UNUOfwMSA2UR2OXzG3Ncxph/n1r2c0/0ebOmN2PcpKoC1MXIVabDGNQKJ2nF/n7lgO00FRa2vJzffSAw== 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=ZG8CgfqN8LBfz5baZYa49wyMeXwcQph74Kt/UWkPx9g=; b=IhDaDOWkZAi2aiPo344AMB1Ikeig1gSirMb55AD6ZjyTb9JkZcNGCjEvoq0dakJL3PExFHjqzrbKlObTKUyW9KiJVEqcUMMzw7EEDd9yWnAWw65JzVmxnHLshuwkpIYKXKAXFkJFDpXkDr6wmFeEiHsq6CA6AnkvmKT8IbH2cFeJUJsJZ2AV+Cq8xdPstruv14jQ/04Cjw8cmkB9dbfo+ThQ2g4nY6idM7Vn0tf6RbhuJDBG+8LcIq7j+XnKhV4YE6+9ySBNiCXG1ypXKL3AqDEUHsOI1MHKhBJuTf+4CttYr3E9uf2/N6f0ywW6QfvENbCywoUOCpVSbK659FUy5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=ZG8CgfqN8LBfz5baZYa49wyMeXwcQph74Kt/UWkPx9g=; b=hlYNk6kbBhJtYvwWw5CV6HqTENopI6T7WArP30SlLWCyZ3oVYsvt03RIeL53Yru9kdnHnt8ZWijhL1QPB7U6noyyo5caXy9MAsNGDLSWy6tmCucQGiLh4qnXFZRTprmY3Rm4htd0auekYFQnfETlQ9h9Ih3JuFAXmvQHFtgbPQMAmgP6PZIKdWpDP8BEA6udc2kO9R7qSZnmGz4k6+aJn3BbgOYl7lnIAeINJl85z09jEFopTMipjyYpcwPlvOt99KNo4/TfcGnwD3v/QWrkj9Hesmf+Gq+CjORVEMgD6VB1ghKBgQveHtwoT21jxzsg+U72Fv8avsiuI5jj8MiYmA== Received: from BL0PR02CA0113.namprd02.prod.outlook.com (2603:10b6:208:35::18) by CH2PR12MB4133.namprd12.prod.outlook.com (2603:10b6:610:7a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 07:02:53 +0000 Received: from BL02EPF000108E8.namprd05.prod.outlook.com (2603:10b6:208:35:cafe::53) by BL0PR02CA0113.outlook.office365.com (2603:10b6:208:35::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:02:53 +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 BL02EPF000108E8.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:02:52 +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.986.36; Sun, 26 Feb 2023 23:02:38 -0800 Received: from nvidia.com (10.126.230.37) 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.986.37; Sun, 26 Feb 2023 23:02:36 -0800 From: Xueming Li To: Ganapati Kundapura CC: Abhinandan Gujjar , dpdk stable Subject: patch 'eventdev/crypto: fix overflow in circular buffer' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:58:42 +0800 Message-ID: <20230227070107.15664-14-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] 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: BL02EPF000108E8:EE_|CH2PR12MB4133:EE_ X-MS-Office365-Filtering-Correlation-Id: ac79b9f7-6f66-4815-dace-08db1890a551 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8CEN9gpMi5nqCwDlw6JE0tT4a1OT8IV8U31qLJDbcqFkiWd6Y5LGuQu19B/AYVEYlxL8/siLpGzKXXKrGLNRYGFgq1mw2SGfXEtMPNqnEg1eyO9a4d6AFQ2qy8WZB0YpZa49Y7yXi3KXwSCUGDEo+60DMB+ffu9Yz4cyZBJpLrSb8pVSkXsHxPzJnxA+5GJOSYWwo+tVho7IpV0oaOKWlQ5nfSoiVnYcGn7OmbQeoNKcZQoxgnvJaVUtN7uYJcn1Ai6QqujimGfVFspxXZ1bWPOSQ7XBDyZv48D6PoWxmlJFFTema2ZD/VbTwV8pIW5iP1Y/I5U0K5Q+glHXMyC6jasP+7lGRnBV3pAJ2G9XlXr34p7Tyg1FnbZ9lQp+Gu/XdjW0b4W9rJbtldhHjcgGmv4QVq9275xdfnFJ9TeXTnMNOYBGSuXMmCP3uzS3fuxBsJCl64TCqD4+V2QwGUvdcc0olgQUyfH0SInSHIdd4NCPSlNVrbqpUF3b4Cfl4tsGW911v/7dkuXEe0hGrAuS7bWYfsWed8tzUg7pfvX1U8x/NWFXZorQeTGkmD/7WhlyKX6/G4hC6UwTrGa6X8GW0cdV2ld6DxuxpD4qEAftKANAjctZQ56SahuwSRn2/rLhn80zV6EvWmqmpiUnIkMcv+/LzSVXiGhBEtsE8cmMgYUeEzdCrINOMM2b5PPe1zkYnDiZn0WCkKHAjVOoU8q+TI0/vXRd+RpLBVw/xxdJl5sK5bicmdnuQ7Mj5/zBOQ9+5LUhDV3i0vH168945ZFvi3IqSqXXKoIAOquh5wS9lxc= X-Forefront-Antispam-Report: CIP:216.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:(13230025)(4636009)(346002)(39860400002)(136003)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(478600001)(7696005)(966005)(40460700003)(2616005)(47076005)(336012)(426003)(1076003)(54906003)(6286002)(16526019)(186003)(53546011)(26005)(316002)(6666004)(70206006)(70586007)(83380400001)(6916009)(8676002)(4326008)(41300700001)(356005)(5660300002)(8936002)(55016003)(7636003)(36860700001)(82740400003)(36756003)(86362001)(82310400005)(40480700001)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:02:52.8987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac79b9f7-6f66-4815-dace-08db1890a551 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: BL02EPF000108E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4133 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 22.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 03/01/23. 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=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=ddaec3cd54de2c4e71fca83e4afd98138f447b2b Thanks. Xueming Li --- >From ddaec3cd54de2c4e71fca83e4afd98138f447b2b Mon Sep 17 00:00:00 2001 From: Ganapati Kundapura Date: Wed, 7 Dec 2022 00:49:44 -0600 Subject: [PATCH] eventdev/crypto: fix overflow in circular buffer Cc: Xueming Li [ upstream commit f442c040017aa221778aa558cc111bd3c8c8f71b ] In case of crypto enqueue failures, even though back pressure flag is set to stop further dequeue from eventdev, the current logic does not stop dequeueing events for max_nb events. This is fixed by checking the back pressure just before dequeuing events from event device. Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation") Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- lib/eventdev/rte_event_crypto_adapter.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 535b087e0d..f3940b915f 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -585,14 +585,15 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter, if (adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) return 0; - if (unlikely(adapter->stop_enq_to_cryptodev)) { - nb_enqueued += eca_crypto_enq_flush(adapter); + for (nb_enq = 0; nb_enq < max_enq; nb_enq += n) { - if (unlikely(adapter->stop_enq_to_cryptodev)) - goto skip_event_dequeue_burst; - } + if (unlikely(adapter->stop_enq_to_cryptodev)) { + nb_enqueued += eca_crypto_enq_flush(adapter); + + if (unlikely(adapter->stop_enq_to_cryptodev)) + break; + } - for (nb_enq = 0; nb_enq < max_enq; nb_enq += n) { stats->event_poll_count++; n = rte_event_dequeue_burst(event_dev_id, event_port_id, ev, BATCH_SIZE, 0); @@ -603,8 +604,6 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter, nb_enqueued += eca_enq_to_cryptodev(adapter, ev, n); } -skip_event_dequeue_burst: - if ((++adapter->transmit_loop_count & (CRYPTO_ENQ_FLUSH_THRESHOLD - 1)) == 0) { nb_enqueued += eca_crypto_enq_flush(adapter); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:41.469232900 +0800 +++ 0015-eventdev-crypto-fix-overflow-in-circular-buffer.patch 2023-02-27 14:08:40.729237000 +0800 @@ -1 +1 @@ -From f442c040017aa221778aa558cc111bd3c8c8f71b Mon Sep 17 00:00:00 2001 +From ddaec3cd54de2c4e71fca83e4afd98138f447b2b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit f442c040017aa221778aa558cc111bd3c8c8f71b ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index c08984b8cf..31b825570f 100644 +index 535b087e0d..f3940b915f 100644 @@ -26 +28 @@ -@@ -573,14 +573,15 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter, +@@ -585,14 +585,15 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter, @@ -48 +50 @@ -@@ -591,8 +592,6 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter, +@@ -603,8 +604,6 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter,