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 464BFA0544; Mon, 10 Oct 2022 16:58:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D05E42BD5; Mon, 10 Oct 2022 16:58:01 +0200 (CEST) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2062.outbound.protection.outlook.com [40.107.247.62]) by mails.dpdk.org (Postfix) with ESMTP id A8C7642BC9 for ; Mon, 10 Oct 2022 16:57:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yx1prc2lhKQLSeQ/dJpXi6eeBn8vcJ6MyLRLuys6WmZhh0NNFNEv8nbKBZiI3SrtJ1mTT4CD9BzC3Eepnb34ZD+8Q4OGn2HJw09UXOtIKAwHLfCMHGLjPNqjQBV4Pu29ADfZfm8oiPjk0VTV7D5Da13IEfNER1M8StgRq5nUWuJ5gFRRHgLvIm2mRlzNaco36Z4Y/EbqpyIv5LT7pHwHVjBUH/Wl0Ag1U423+eHf1IOi4Q81n5cyC+/3ynuKGv/NJluQOzgbsfDsXU1FiRqlcUmiZEkcQ+OQ7snw4q6J+87gvidbP41A8DieMj+bZIgTaXqVJfhG97s/ti5krzDxkw== 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=vwyS+INZyEVHlVHd0R2EjK3SCfjbSkM8fwFisS3nrdI=; b=BHCII1uYrs0WF+0URajWpjOKmVzylIesI5vJvSQr5iDX1ocs+AhQ+hgaAZnsAD0ISjE94IbDj/5PNfFNHfxzXMQDcBN812OQJ0I8g6edDId/1gKpK2YpYW8/mooUQYrrzGOAQ8dNHmS7Juc+S3am7+gPUFFVnfMeeLaZwbbbQa65H4KFWYZdEWaxg8e0T/CjZPSmx0AP0GIH6i0pU+EVZa3ZwGTErUyKjwzl14LqokTy62O11w+IXMOg4tzNf5plx1pRchLoS410LjapnQnMAfPIupbityIszb3XkEUVz3exKBqCy+Gmffj2Rn29F3ZF1zfptDZPm5/DTyevgYsvkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vwyS+INZyEVHlVHd0R2EjK3SCfjbSkM8fwFisS3nrdI=; b=VXso8p/MauqK4hx3cTIe8CqsLKfS6kIiRF/BSeEQl/fr7E/1lUg27a0jc7z8JV/oy44OfY2fJQ/OcNBXzACQ8nibPNCmLJz1Hs4L0mbBa2mBHcjQYPySlIehaQcVgsIpUvXA4dMw1aozZNWRlZzTsXOM6lluufEH2lrxBIWvvco= Received: from AM5PR0701CA0059.eurprd07.prod.outlook.com (2603:10a6:203:2::21) by AS4PR07MB8684.eurprd07.prod.outlook.com (2603:10a6:20b:4f2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.14; Mon, 10 Oct 2022 14:57:58 +0000 Received: from AM5EUR02FT037.eop-EUR02.prod.protection.outlook.com (2603:10a6:203:2:cafe::63) by AM5PR0701CA0059.outlook.office365.com (2603:10a6:203:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Mon, 10 Oct 2022 14:57:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by AM5EUR02FT037.mail.protection.outlook.com (10.152.8.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5709.10 via Frontend Transport; Mon, 10 Oct 2022 14:57:58 +0000 Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESSMR501.ericsson.se (153.88.183.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.31; Mon, 10 Oct 2022 16:57:57 +0200 Received: from ESESSMB504.ericsson.se (153.88.183.165) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.31; Mon, 10 Oct 2022 16:57:57 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.192) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Mon, 10 Oct 2022 16:57:56 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 3ADD3380061; Mon, 10 Oct 2022 16:57:57 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: Jay Jayatheerthan , Erik Gabriel Carrillo , Abhinandan Gujjar , Jerin Jacob CC: , Harry van Haaren , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH 1/4] eventdev: have crypto adapter appropriately report idle Date: Mon, 10 Oct 2022 16:54:03 +0200 Message-ID: <20221010145406.118880-2-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221010145406.118880-1-mattias.ronnblom@ericsson.com> References: <20221010145406.118880-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5EUR02FT037:EE_|AS4PR07MB8684:EE_ X-MS-Office365-Filtering-Correlation-Id: 74776df5-2f69-4b28-8de5-08daaacfd214 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9flSYVx0uB8VjtNj/Wg1p7syi1WIx0EfKYKohD2xPCY9GLWkm8MJuTzAmWCuMYuWbuY6b7+wg/VvCRU56SGzGaaIiiqNt+rQ1gmE2nlc8t/kbYM/nhpagwGO1B32VYtLZJAoZeR3K039TExnrluOZwShIPGhGygPLyVj6LX6Lg9XW1k03EXjEHq7chDU/68qcS8CzOLhekiEP3kSRD4uI7I7jHnpbbl33XetytJ9mKacT+zHThjTgNhZw0yAWzU0BfptaSKoV92dT2v+bVi9Z6Ya/qK9Zze2g1TjZwI5yiSrFOkoTNl++PHHF4Y7Hs+x1wNdVDsRu89qe+e6dgNUFNLkDCUcZTtIY2GHcUtkSak5f4OzEeUffnyNyu26S8DYouEhO/UwxAb1bmLCo4rsPHLw1DtApz5htF90JtVVdh84hQoU6miwAQEqUEvIjo4b+ivr0Kf5RFrzwruw6U2pj7qrJfnaYGp4SUui+86IoRKfGg2vxOfppPjhHKX0vM5BjoSyLcbIZqQNv3UM5rMc8pNqFHx8/fdrzgJODWXY2Cvx+oUxZpX8D2zBTUwR/rGmpwjf8VSXbi/lDCq2kT3XB/9HAMcVqHfjunlLJ7AePuES3xFl0ktquX9pmn8YgB7B/Ft4K9iKjPDj6BDmHOc6wSiIkBi/8MS+zbF2mAUmDRwdyw8oNwLrHbLBWI7hT6w1tX5l6RuHx7Zcpl14xjBqoYVU+B+QJu4G3fc6hW4duwynraOuHpjbL0Bb2OGIXE5LhLe5iYcq5RbcG/PszB6qPA== X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199015)(36840700001)(40470700004)(46966006)(478600001)(26005)(2906002)(110136005)(107886003)(6266002)(6666004)(316002)(36756003)(83380400001)(36860700001)(86362001)(2616005)(336012)(40460700003)(186003)(5660300002)(82310400005)(356005)(7636003)(1076003)(47076005)(54906003)(66574015)(8676002)(70206006)(70586007)(4326008)(8936002)(82740400003)(82960400001)(41300700001)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 14:57:58.5236 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74776df5-2f69-4b28-8de5-08daaacfd214 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR02FT037.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR07MB8684 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Update the event crypto adapter's service function to report as idle (i.e., return -EAGAIN) in case no crypto operations were performed. Signed-off-by: Mattias Rönnblom --- lib/eventdev/rte_event_crypto_adapter.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index a11cbcf4f3..59777726f6 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -771,7 +771,7 @@ eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter, return nb_deq; } -static void +static int eca_crypto_adapter_run(struct event_crypto_adapter *adapter, unsigned int max_ops) { @@ -791,22 +791,26 @@ eca_crypto_adapter_run(struct event_crypto_adapter *adapter, } - if (ops_left == max_ops) + if (ops_left == max_ops) { rte_event_maintain(adapter->eventdev_id, adapter->event_port_id, 0); + return -EAGAIN; + } else + return 0; } static int eca_service_func(void *args) { struct event_crypto_adapter *adapter = args; + int ret; if (rte_spinlock_trylock(&adapter->lock) == 0) return 0; - eca_crypto_adapter_run(adapter, adapter->max_nb); + ret = eca_crypto_adapter_run(adapter, adapter->max_nb); rte_spinlock_unlock(&adapter->lock); - return 0; + return ret; } static int -- 2.34.1