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 B09ECA0C57; Mon, 1 Nov 2021 14:28:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEF8341123; Mon, 1 Nov 2021 14:28:46 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60051.outbound.protection.outlook.com [40.107.6.51]) by mails.dpdk.org (Postfix) with ESMTP id 51BC9410E8 for ; Mon, 1 Nov 2021 14:28:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HYyrQc82VRjpH90Dt/+R93Jhc2SHXSYf7bhaUBKscurFY1SIyjgaiPXRgcc5/avItlSSJ77jd2I9F60HvpuV/I3fq6gdUETzedCy1AACGgvz8E3ldcnwT44/sP1DXs1r9iRAzlGwQWxpZpAwV65xYTYre0RUIRUCaCbbT6qQH8SnzggQ1Vo+b9a8Qm7JqGOjWSf4H0my2cv8ZGqZ+btQ8YFP/xnXZDWiT0qGstsMoI856KIZkhb++NSzEiTzDV8asqQtn6PUKwDiCYt8EZBwTQENsZ4b3Vu5f6DhRf8En9V3nrhb0wGhpxKYoVp0IaPJc6FquyvUneYT/rbITrG//A== 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=WS5BQSAz4PISyKStQrJSG2cgkufoPhGRAXwCEKq8pJaMW6PHrjXgliVjbvCC2SueunugAqw59Ej/Bk3FJqWguDcFgA9CxzvOKA1NpF65Cx2qG3xHBVbvadV5gAX3Ei2EB8mXHkE+iJ8RMiCtrpmp0QPkz1ryTNaiv3wirbpVsfcAJKgrMl1RNn0JXU12lGl102Y0c9g5rmw6OOPOsc6XB7RPMLPPycsBSMwxRSx1ATKPYlAFCxasmkI4J3YaAaQ1AjBPniGe4FarizF6Ib/t2ZpnK5BjqbBwd28W8yqyV7PQyR9l1E/uOOiZ9Jqrj9X6wuClWEJSP1lgO9le8Mcxzg== 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=e2/em3peDjlEN4Rnp0CG0bzpTNYCo3zsoE+zswKPWNe6s6pzofMH54OeQYzYBxPshqQMCn29VGARYBv4bh3nMWnbSR3rKjITn1l8R14h1Lm6rjwiR5VIsbSgQhQFVFBTVgRW8p/+JTfSWEsYESPoxBS443tgRFuI0CKBNPX3dYs= Received: from SV0P279CA0064.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:14::15) by VI1PR07MB5070.eurprd07.prod.outlook.com (2603:10a6:803:93::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.9; Mon, 1 Nov 2021 13:28:42 +0000 Received: from HE1EUR02FT063.eop-EUR02.prod.protection.outlook.com (2603:10a6:f10:14:cafe::c3) by SV0P279CA0064.outlook.office365.com (2603:10a6:f10:14::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Mon, 1 Nov 2021 13:28:42 +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 HE1EUR02FT063.mail.protection.outlook.com (10.152.11.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4649.14 via Frontend Transport; Mon, 1 Nov 2021 13:28:41 +0000 Received: from ESESSMB504.ericsson.se (153.88.183.165) 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.2242.12; Mon, 1 Nov 2021 14:28:41 +0100 Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESSMB504.ericsson.se (153.88.183.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Mon, 1 Nov 2021 14:28:40 +0100 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.188) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Mon, 1 Nov 2021 14:28:40 +0100 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id F06E06014A; Mon, 1 Nov 2021 14:28:40 +0100 (CET) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: , , , CC: , , , , , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Mon, 1 Nov 2021 14:28:36 +0100 Message-ID: <20211101132836.7595-3-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211101132836.7595-1-mattias.ronnblom@ericsson.com> References: <20211101132836.7595-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: e433e47d-5a7b-40fd-eb88-08d99d3b8596 X-MS-TrafficTypeDiagnostic: VI1PR07MB5070: 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: MiR7yQTW9/LPwWK2GFktXV03us2znaUIn+lpuGmQntE7PLawrNgylCKr3J75N/qM9j/lx4zMLB3mzleqbCdmo1MBbRO21eXdRrzuYkg6QaPcEvDXO3lPkf64pTKzbkgiXh/xZg6lhPm/6hdm5Mw1dTIQGTLNrsuG3H6Ig2+Xi1qeg0KzJR+f7Hh86way/r8xMp6Q11CbRcF+j3nRHdurSne0o8u7bNw6LdWeFlAuW96k2QMHGaWT5MoPHHUnUAja0egDPEOxBhPG2nq+7CTvDeq83SrE2QB17UCi8W15nlfZkKvQ689COyrYOX9u3x0nD3u9I8MEVdj3gWETarHcQXTUVjigo4Zfo+XImE43WJYQWOXkEL+Vv8IgSraXj0n7OPO0mTWeNVxmOKmv2XB2Xm9elbcTTulOqW9qwoch8j3Axn9EBeF7YmUc4v8zjcQ94C3mWnpELr5ifk7ArOtN0/+2BJbcL8mas5bZ4HDQUtOsGiqt9uJzhxU9seoFkQJ8Vely1BDnRtmVkdgApX5P7Jie+/xwW0ff6xBy7tdfvg4wZCqxcb7eR6gNIHvrY0td3UGFeXnZj69XXFIWYh5es8GgvirIfReaqvG2/c0VH/PhrVJ4aCM50pn6KKOJVNpL1sD/E65K4ILGgfTc68yiE6Yx4W2cwKAIHmxQqbvFIA7LIP3noQfy84iilI1O9+ylw6i8ZMNiuM5R5us3NQNIvw== 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)(36840700001)(46966006)(4326008)(107886003)(70206006)(6666004)(70586007)(54906003)(336012)(508600001)(26005)(6266002)(7416002)(2616005)(82310400003)(110136005)(186003)(8676002)(36756003)(86362001)(47076005)(7636003)(36860700001)(356005)(5660300002)(83380400001)(1076003)(8936002)(2906002)(82960400001)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 13:28:41.9197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e433e47d-5a7b-40fd-eb88-08d99d3b8596 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: HE1EUR02FT063.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB5070 Subject: [dpdk-dev] [PATCH v2 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