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 B7F6BA0548; Mon, 1 Nov 2021 19:40:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FE2A41121; Mon, 1 Nov 2021 19:40:34 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40070.outbound.protection.outlook.com [40.107.4.70]) by mails.dpdk.org (Postfix) with ESMTP id B224B41100 for ; Mon, 1 Nov 2021 19:40:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WK+4krPOmqpK4Pn12ilStxiY9QlHhxLyi3amRjkORFJ/EK5Z5MG0WPY9+t/b9KVWCVX7LywjsXwl/i5pbSPWc6U49u3KdeKL2vUCo0T9NY1tDgyEw9dmw3LGS9Mt1VmH1HHuDpPSvFvb3+1fRnLDNrryrqqruBv5zgTnLj3xpdamYrrjLu60gfIL07wNkRhrxCNDaztzpGj4fKdXtbsPVV6UWgAJj9kv/rHlzPkE+CeGPYVUmcm/ro+iwQnGXkqYghXHFbeq9GhPJQS/hLVMt61E3D+QdUwcFExXANYQSDOvYsizkc1jB0ku7OpVKkQOx8hNBmGBIw7zcctt2xDJQg== 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=C/zs2U6ZkEsz4E1IYN+JWi7vv+gAVq9yF5U8F7aSSSU=; b=gNrY6iUFkN9AHMmuXg5LOC3GV/nwmCZxTMejOFPMpvd9bhMu2kbq6gUa2pmEnAxyhLOYn9BSpJyvyF5X26DkU8iZnG4U6KUYbdhP1n6earXK79FgpRaIezeA2ny17Dbw6HZ5UnblkuFju8KCdacMOz7XKk95Y4k++l/yP3EXta6NiBjEKv2cn60FOPdJGskfoQcKswvPio5GSTNopmtsRYxTS3YqGMXNBHfGBGwHV4CIZvvDMw5G5jtKOWa+mXsIMrKPgynEcnluYdDhD2zh1iasE/XEQ/pFxI4ZUPV5DTd6KQQGuqJ8edTwuec9GueiaIEv6jF1gctLLMrql+DYPA== 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=C/zs2U6ZkEsz4E1IYN+JWi7vv+gAVq9yF5U8F7aSSSU=; b=ErWsGcKRTarF+ZqEIvWWFVrKlz9FYS4m/On4v0tJD3eq5qSJNYH1jjaiL+LthAhPxzHq7UpEXpTIXwoCBeuSPN5q9Fxx3AH4Z539h2RA03rvYPMyVZZI65fDgYKVa/8DWkXLvdP13FI143HoBbwWxtul1Gys62DFBgvgzFfpmf8= Received: from SV0P279CA0028.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:12::15) by VI1PR0701MB2624.eurprd07.prod.outlook.com (2603:10a6:801:5::9) 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 18:40:30 +0000 Received: from HE1EUR02FT028.eop-EUR02.prod.protection.outlook.com (2603:10a6:f10:12:cafe::ab) by SV0P279CA0028.outlook.office365.com (2603:10a6:f10:12::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17 via Frontend Transport; Mon, 1 Nov 2021 18:40:30 +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 HE1EUR02FT028.mail.protection.outlook.com (10.152.10.102) 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 18:40:29 +0000 Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESBMR506.ericsson.se (153.88.183.202) 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 19:40:28 +0100 Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESBMB505.ericsson.se (153.88.183.172) 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 19:40:28 +0100 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.190) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Mon, 1 Nov 2021 19:40:28 +0100 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id 591E26014A; Mon, 1 Nov 2021 19:40:28 +0100 (CET) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: , , , CC: , , , , , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Mon, 1 Nov 2021 19:40:16 +0100 Message-ID: <20211101184016.8073-3-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211101184016.8073-1-mattias.ronnblom@ericsson.com> References: <3a6d30ca-3335-ee06-c0a9-8f2b0ade2c40@ericsson.com> <20211101184016.8073-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: 3e857640-0e5d-427c-3c2d-08d99d671437 X-MS-TrafficTypeDiagnostic: VI1PR0701MB2624: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zygce18LhHaR7kqUUYHx1KoP3HNDAqtZL+UAtj8B6Vg2V1Qqo1ukIazxKXRlbJ3JFMI794NPnfknsTiHx23qdsm4j/4iDr/yDoScMlPxY4bNh6oXwIUU907wWEzgMmuxTYIG6fIBKi2+JqdU8jACoohZ3lSLpB06KVxcb9ygW+EHj2evzFCRUOgFuN3N1qrBg6JxbWRUt2zimjnTq01GIoBOb4mREm7Jyts2gnUU8B9CeLlTzf1yL9OjQxZ0v5U/CZQRqIEgoJ/tKmI52QOFSrirstQVBbwHwOTSbI/+z7oCjD9PqPySUPXgKrMRQUTVskdY7DQm+kH+z73R8f6qf1zXQ3n1PVEoeHUdnVHJUVZUTaoJBsWH2OciQXwn87dlw2NhE8p/Ym08x2fb7Mv3K4/WxCEfDG4MV8lvPSDgyCJ5qpyczfvTW9h2kqC0k1gcPK4q3D/DjM57pPdBMh8M6AHT/2bJFP3x5S9MwBM9o14Zg36EUYfCnsvnO2z02f713C90FcwnnQXHw1VxB+ttumuhWxuv3h97qFZf6IqZI15vx944AURoNSOHjv8bHl1pGd1mVAJ1qwV7oj4ET9B0zKFd96o7GXbbfOgC6gk43CmIMWkhFtWczUPt5BvShnKsLhEvNYGIl873OVEDcyGx9y1hCQ3BWtFPzM/6Y/f8d+XcFeSDRN/VbUTgtww3jhcKyLguAJIqwCZqn+p3t91OUQ== 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)(2616005)(83380400001)(7636003)(1076003)(186003)(86362001)(508600001)(36756003)(82310400003)(4326008)(70586007)(356005)(82960400001)(8676002)(70206006)(5660300002)(316002)(336012)(54906003)(36860700001)(2906002)(8936002)(26005)(6666004)(110136005)(6266002)(7416002)(107886003)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 18:40:29.5732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e857640-0e5d-427c-3c2d-08d99d671437 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: HE1EUR02FT028.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB2624 Subject: [dpdk-dev] [PATCH v3 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. PATCH v3: - Set the new 'op' rte_event_maintain() parameter to zero. 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..d84080355d 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, 0); } static int diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index a175c61551..d3af469aec 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, 0); return nb_rx; } diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 0e21b7c475..e5572e2add 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, 0); + return 0; } -- 2.25.1