From patchwork Mon Oct 10 14:54:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 117814 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AD92BA0544; Mon, 10 Oct 2022 16:58:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6485142BE7; Mon, 10 Oct 2022 16:58:06 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2043.outbound.protection.outlook.com [40.107.21.43]) by mails.dpdk.org (Postfix) with ESMTP id 8668D42BE1 for ; Mon, 10 Oct 2022 16:58:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S5KA76Be0AOTZsCLNuxTKRix4OoM+tdxLAnnGMtUULUzdbXWgowk9PPcOwi6Lxf2Ub4GTBnkEw0cBmlmAgiI/r+lI0jwGBbqNl8CJZEt7J9ftg3QZGYwHKUGnY/Jyi2oCsZ6dahfJ6dsRB09+ERhmi9kxlaVlMCFU74SQ6tqK4FXeRD3BJTZ2WUd/EXp9hGc8wmcuFDcjaNT7t1qIFEoPFvcIn3G62I7eyiY058m9PhCwdEGNRUKjskM01SBFQr3GNeSIZ19B0Hay/ZMNsygJNcGLZ0q9TW+ZXS3KaxUpP1zbkeMdoOlNV2yorBnlwvZFGHC3+7GwB++ZlXGw70Vsg== 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=6fkn4zBsygBRdgEYFyJoegksBMqYcnKMgmAUOxEvvKE=; b=aShLTseKtCeLBJmXm5vrn9xibbVbofS+OXhz/p9e5AwVZVJaMA3VIo4qUHtbShlDxYLRHEI9MiFrdLPjAG+Vw54GWg50kM6xeg8yWZwvpsKhFJ+3daYdMSp0fFrtFCZeghUzPzz3wVyXZ4PpALxh2uUHQMxYu/RjBbU0TI/UL6sJqKEv6EPv6wMFgTO26ZpjSbUIlV7M4A3qt+xADHtCWBZ77U5lPq+avO7W4Shc1HOSCNQhVxOfZ5tVq34sm6Uq70ICPm5cC4YdReFWKjQEHQmCGNEKuG+syxqM5oIiNXVnqg/iEYTi7TLtKyD7ZA6EUG93gwBoy+Ctb8F7VQcjfQ== 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=6fkn4zBsygBRdgEYFyJoegksBMqYcnKMgmAUOxEvvKE=; b=NeS/KlF+Mtubn0oJT9htxci30zEoLPy8gE+yNqefrdiFn954djG7/WgUf5AK7imbnFNy7tvJ9TazWiktnrvck4bj03XXfabkelTbT1e59bVeGJqfgf8GIN9p9M23VwRmSM2F3onMlrzd3zLVqoxcM1LflsWQRqDKlDAcM9Wxw0o= Received: from AM5PR1001CA0012.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::25) by DBBPR07MB7420.eurprd07.prod.outlook.com (2603:10a6:10:1e4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.15; Mon, 10 Oct 2022 14:58:04 +0000 Received: from AM5EUR02FT069.eop-EUR02.prod.protection.outlook.com (2603:10a6:206:2:cafe::59) by AM5PR1001CA0012.outlook.office365.com (2603:10a6:206:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Mon, 10 Oct 2022 14:58:04 +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 AM5EUR02FT069.mail.protection.outlook.com (10.152.8.227) 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:58:04 +0000 Received: from ESESBMB501.ericsson.se (153.88.183.168) by ESESSMR503.ericsson.se (153.88.183.112) 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:59 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.184) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Mon, 10 Oct 2022 16:57:58 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id EE6E3380061; Mon, 10 Oct 2022 16:57:58 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Jay Jayatheerthan , Erik Gabriel Carrillo , Abhinandan Gujjar , Jerin Jacob CC: , Harry van Haaren , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH 4/4] eventdev: have timer adapter appropriately report idle Date: Mon, 10 Oct 2022 16:54:06 +0200 Message-ID: <20221010145406.118880-5-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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5EUR02FT069:EE_|DBBPR07MB7420:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c976230-2464-4140-6e19-08daaacfd577 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yg1WKh/qP2m/gSyo5GjHyZWaDf1czq2kLuT0AAOaOYOs4NXdZnkq7AHdZnst11RTUpD2099xZyiT5nxHpJCoG+IsnkB1edYw1glTnnyj8q0t2Tv8J2f3Sa1LSdPPaBTlFWnj3h7JXQp2k69HiKFwuoV01WlyHYimGEu7vnjp/UTr0liCMUJhNkIMs2ki1ptDTgW1ZrZInr0t4QtPrnhJV3E8mH3sFRHrE5dRQtkgFI9rl4qql/LADYFE2O9D2Zgj5E8hC25gAJQ9NfE82WKERODz1VKVbTi2TAWUs4jRr71BV0O1Nof7aGcqoC4P6ZMDytSIkAjTSz4k9n7lmiWGlcInoeAG/5nBvLdYZ0FCYjvrzDh+DgSRl11h/e/jzeqppB2ezguO5gIHrhMMD2eAnIIXaozys8cFWHO8Fv1LrjAtmE5K6Ahp2OHNyrXCE4Q8ErWAn5THqvQua7SstCsedVmdpFqGfX3X4gScUJSgDPec4qstqli5WPGdSnaiJq46sd9H2kLVktJMbgjAneRu2acxemfjqe1sfydMx8OKc/IDp5G15CALiXqbiMY2a7v+lOS5gb7OZnMd8lkhBn5tFWPuvnVqTlWwLK55A8J0Xffs6fzNgfy3n5dADx5MeW1MTdOJnYirvjS8hZa3spxMkFpwY70d2JnKiC5U5ayQxTgmoEZEsGutDIFYJ086VOkcgZf07EhYJGsWBezvrBEHn12AOSgJs+Y17Lfy7UA8c971oq+YJ756IpQJeV6zgW+o4RJbOPOnmeaSUfSpojuGag== 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)(136003)(346002)(396003)(39860400002)(376002)(451199015)(46966006)(36840700001)(40470700004)(40480700001)(86362001)(36756003)(4326008)(40460700003)(316002)(70206006)(70586007)(8676002)(7636003)(36860700001)(110136005)(356005)(82740400003)(6666004)(107886003)(83380400001)(478600001)(6266002)(26005)(5660300002)(186003)(1076003)(82960400001)(2616005)(54906003)(2906002)(82310400005)(8936002)(47076005)(336012)(66574015)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 14:58:04.2047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c976230-2464-4140-6e19-08daaacfd577 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: AM5EUR02FT069.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7420 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 Timer Adapter's service function to report as idle (i.e., return -EAGAIN) in case no timer events were enqueued to the event device. Signed-off-by: Mattias Rönnblom Acked-by: Erik Gabriel Carrillo --- lib/eventdev/rte_event_timer_adapter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 1731770b5e..a0f14bf861 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -785,6 +785,7 @@ swtim_service_func(void *arg) struct swtim *sw = swtim_pmd_priv(adapter); uint16_t nb_evs_flushed = 0; uint16_t nb_evs_invalid = 0; + const uint64_t prior_enq_count = sw->stats.ev_enq_count; if (swtim_did_tick(sw)) { rte_timer_alt_manage(sw->timer_data_id, @@ -811,7 +812,7 @@ swtim_service_func(void *arg) rte_event_maintain(adapter->data->event_dev_id, adapter->data->event_port_id, 0); - return 0; + return prior_enq_count == sw->stats.ev_enq_count ? -EAGAIN : 0; } /* The adapter initialization function rounds the mempool size up to the next