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 490ADA0547; Tue, 26 Oct 2021 19:32:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2971B41124; Tue, 26 Oct 2021 19:32:13 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10077.outbound.protection.outlook.com [40.107.1.77]) by mails.dpdk.org (Postfix) with ESMTP id 9B013410F5 for ; Tue, 26 Oct 2021 19:32:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwNYZR8uRui/GULMHAZS0OY4pp+ybcZAqLzW5vkaBr183J4HyjI0JfVJ7Pxmt8Rxl5N+/OjFjtQmNA3OuoYWA0ONbGAJaK5XaiE23qjg3P9VaT1gbfifGz+n/Dub4kx/zbLVa4m0G0Djtjsk09AV2QkVn6FOw+0CKITS9SIvhRYuN7LU7pQq3C5zYD2SoWuEdG/Kep4U1FptDLOiT5Jmpp7tuID8Nq7eIElmSTmpQc2AV1rEpGzyCywhO5eky8bdHiklPiV/kJvCbywji81435rm664TS2fJt16yqdQ+Pd+akd0/BPGwbCVsO/6Ts7ukRi9/sWRgBh/tNXEjnBTBDQ== 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=Ss565+3plHpkyG+/CRM/UX85Ud//HyJVjd9GirY6lu0=; b=gSXC2nDvoBH98T1fndbOZo3cNY7HCSPRpPtbYMwvObnFWge2t6gC/w2EL7hr66TzjfCKL5KPieVPfyA90Tqjgabr52gmnjhGuyodxVmvAQo6gK3gAdMT8gklC1R9cvJjh2NsG4VqWc5CNCmI8rhtRFGDQUNLMDtzHDWJFdUrmzpiSUYHaDbEPXvmeSAGhg4AI42/dWU8VtcVfnFr1hXBNtDNrBae8USon0pHOpc2VZdFwmA1FH3qkZDTMDtVB+HGFwcR2EPfjfGxtJmQ6EO61cq3xcD/ZPs72Hf+R/JBI+EqHgR6TH0/S8tNJnHetzXwOPDkwhU7+aaF/W1JyBvAyA== 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=Ss565+3plHpkyG+/CRM/UX85Ud//HyJVjd9GirY6lu0=; b=rwXlp2rj8VgqOyud9ALBky04uljKQeB0pZqj50gyA86EmC9h4LbK8vmlATk1HxReTD5msTJsVWGEJJ428YZVX6V+61xozlpvMdmniKIQcwYAKYduVLIKUBb0hOQLlSqQzS82DuCDZ/olyIfVSxfnNRTIP08YniQtLtFbJT+LebQ= Received: from AM7PR02CA0022.eurprd02.prod.outlook.com (2603:10a6:20b:100::32) by DB6PR0701MB2918.eurprd07.prod.outlook.com (2603:10a6:4:71::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.10; Tue, 26 Oct 2021 17:32:09 +0000 Received: from AM5EUR02FT031.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:100:cafe::6f) by AM7PR02CA0022.outlook.office365.com (2603:10a6:20b:100::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18 via Frontend Transport; Tue, 26 Oct 2021 17:32:09 +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; Received: from oa.msg.ericsson.com (192.176.1.74) by AM5EUR02FT031.mail.protection.outlook.com (10.152.8.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4628.18 via Frontend Transport; Tue, 26 Oct 2021 17:32:08 +0000 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESSMR506.ericsson.se (153.88.183.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Tue, 26 Oct 2021 19:32:07 +0200 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.186) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Tue, 26 Oct 2021 19:32:08 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id 131DB601E6; Tue, 26 Oct 2021 19:32:08 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: , , , CC: , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Tue, 26 Oct 2021 19:31:48 +0200 Message-ID: <20211026173148.19399-3-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211026173148.19399-1-mattias.ronnblom@ericsson.com> References: <3e8c8bab-783d-d132-a836-51bd4d5533bb@ericsson.com> <20211026173148.19399-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-Office365-Filtering-Correlation-Id: 41477c9d-963f-4ae3-ee1a-08d998a68996 X-MS-TrafficTypeDiagnostic: DB6PR0701MB2918: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lu05upL+38HHs5tREtmtJf7UZuMnwn9mx4yEDCkKyCNK/BJuBduoUkxmOGNy0YG405mrLo1OcOSfoj8kEk6hsvMFfy2hkKMGhH1CtEjYH07Aiq2V/PBOWqGC3IACEWJpAea3TSeG6ilBpY4Wxpt/Ih8A/UVkuoAladBO5xBVq/t1yywcU9Vd0tPeo31YaMc2qcRHHDPoXfG0r6YkxHadqhJZRkRMZ+AlXH2xUtZXVhObuh7Lp4MZnlkShO3NKYdYW7ckw0Bxtj7RDtL76wzIRkAhlp+hAMbnHQdh6zOLKdFdyDaOHt3lpUc1yTW4iayCj2SQk6JGDQi0Zl37eSYZSDK5wbq42/H1LT/RXq4h3dc3R6JSz8t6WQdx5bFIesOeUEcTD23SOgQPfifNvITfaY2OvozbZ9TzVFoOxYD73NTdScZkQsCJYOEjuXArD4DfLxct0n7zkuTstiUe/DvSxs9Sh07XtikF6AL54awHQS72eHbj7tPHAfKe798imsnTkl4KkGvR5BB4tZv/6qArkzQPkeFSDg7dg/wjkC5FmyNoOc/57N7ibpnktXbWUqiZscOZjeK3aimqL08SfpN025uaqagpnUANhNem1MQZjOZ6a0VochttA8NDg+F1McGJkls8ZLsUdChIvPL67wKUuLUUcQLmo+Sz94mcgc3ZqRo3VbSAw3Lkh9Ouv2eGLRpjpmEA/dvhhW2ifOqPAfPtMQ== 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:(4636009)(46966006)(36840700001)(83380400001)(356005)(5660300002)(336012)(70586007)(6666004)(47076005)(316002)(7636003)(54906003)(36756003)(107886003)(82310400003)(70206006)(6266002)(2616005)(2906002)(82960400001)(110136005)(26005)(8936002)(186003)(4326008)(86362001)(8676002)(36860700001)(508600001)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2021 17:32:08.9389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41477c9d-963f-4ae3-ee1a-08d998a68996 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: AM5EUR02FT031.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0701MB2918 Subject: [dpdk-dev] [PATCH 3/3] eventdev: have adapters support device maintenance 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 Sender: "dev" Introduce support for event devices requiring calls to rte_event_maintain() in the Ethernet RX, Timer and Crypto Eventdev adapters. RFC v2: - For simplicity, the timer adapter now unconditionally calls rte_event_maintain(). - The RX adapter now only calls rte_event_maintain() when it has not enqueued any events. Signed-off-by: Mattias Rönnblom Tested-by: Richard Eklycke --- lib/eventdev/rte_event_crypto_adapter.c | 16 +++++++++++----- lib/eventdev/rte_event_eth_rx_adapter.c | 9 +++++++-- lib/eventdev/rte_event_timer_adapter.c | 3 +++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index ae1151fb75..a6bd48da81 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -630,19 +630,25 @@ static void eca_crypto_adapter_run(struct event_crypto_adapter *adapter, unsigned int max_ops) { - while (max_ops) { + unsigned int ops_left = max_ops; + + while (ops_left > 0) { unsigned int e_cnt, d_cnt; - e_cnt = eca_crypto_adapter_deq_run(adapter, max_ops); - max_ops -= RTE_MIN(max_ops, e_cnt); + e_cnt = eca_crypto_adapter_deq_run(adapter, ops_left); + ops_left -= RTE_MIN(ops_left, e_cnt); - d_cnt = eca_crypto_adapter_enq_run(adapter, max_ops); - max_ops -= RTE_MIN(max_ops, d_cnt); + d_cnt = eca_crypto_adapter_enq_run(adapter, ops_left); + ops_left -= RTE_MIN(ops_left, d_cnt); if (e_cnt == 0 && d_cnt == 0) break; } + + if (ops_left == max_ops) + rte_event_maintain(adapter->eventdev_id, + adapter->event_port_id); } static int diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index a175c61551..adf20f8b0c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -992,6 +992,7 @@ rxa_eth_rx(struct event_eth_rx_adapter *rx_adapter, uint16_t port_id, &rx_adapter->stats; uint16_t n; uint32_t nb_rx = 0; + uint32_t nb_flushed = 0; if (rxq_empty) *rxq_empty = 0; @@ -1000,7 +1001,7 @@ rxa_eth_rx(struct event_eth_rx_adapter *rx_adapter, uint16_t port_id, */ while (rxa_pkt_buf_available(buf)) { if (buf->count >= BATCH_SIZE) - rxa_flush_event_buffer(rx_adapter, buf); + nb_flushed += rxa_flush_event_buffer(rx_adapter, buf); stats->rx_poll_count++; n = rte_eth_rx_burst(port_id, queue_id, mbufs, BATCH_SIZE); @@ -1016,7 +1017,11 @@ rxa_eth_rx(struct event_eth_rx_adapter *rx_adapter, uint16_t port_id, } if (buf->count > 0) - rxa_flush_event_buffer(rx_adapter, buf); + nb_flushed += rxa_flush_event_buffer(rx_adapter, buf); + + if (nb_flushed == 0) + rte_event_maintain(rx_adapter->eventdev_id, + rx_adapter->event_port_id); return nb_rx; } diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 0e21b7c475..a89cf8b978 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -786,6 +786,9 @@ swtim_service_func(void *arg) sw->stats.adapter_tick_count++; } + rte_event_maintain(adapter->data->event_dev_id, + adapter->data->event_port_id); + return 0; } -- 2.25.1