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 51729A0544; Mon, 10 Oct 2022 16:58:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57A3B42BE4; Mon, 10 Oct 2022 16:58:13 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70045.outbound.protection.outlook.com [40.107.7.45]) by mails.dpdk.org (Postfix) with ESMTP id 97D0242BE2 for ; Mon, 10 Oct 2022 16:58:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CVjxrgjz5UVOboPAXcHq9fim9C9VakZgE6bnMrjED4cEk/l2uXijniKyhLCjFn1WkfQ04vh7cSGkBMhksM6nWY3T+sz1mxhF1PzvLB2KbdP49wceDzaDNS39LxmaidPh49nusUE0LtWa/r7j9iAOfdb6+1xF3QhbGO4EMwWTTjnU1oguNN1d45abPqCfPZTh6Q88pfWn75KzUGkC7/5D1LZ8ozCi5auz1dblleXFrZsdwrwJvxtizCgGP10iecezScuIsV3oT0HEW4Bc/pQBwzWIVAkeyy7oY6vQveOEIUxB+ezPCaO7yWtJHOH8CBUGgQ4+15jDB7/ODrZJEOMNyA== 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=cs8ioAWRmAKStblYW7xcW4AtvBDJrxHQKygqAj3WjUU=; b=fopDGKc4sI3hZgE1vxTtx51N+JMjb5nz2CMscxI8aj5nA5QXcJ8S+CVfmH0aWrCkt9nYZ/jfFmmvA1UmqAcLf5uVV2QXrz4asTk5C1fMZHe1G3Cc+kWPzbiEgE14EElAJm5stgDyJfmieKP0kfUfQ1rjDtCZcrFyZ8CK9U5SGAeYioY6kzULuZ0KjxIjfNU6a5gpHvaIaNhzeH4L3KcCwSDJQqWEHh0Vzxq9B5MATlAxGHNf1aq7g4viOkDA4OYsNGh2z+xNBKGnonkiO5hgvBfKNxZW4vzxuqDRc38d54ltzTact4qICBDJ8lsNGtKtmYscttpeD14G2FCshYiCPQ== 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=cs8ioAWRmAKStblYW7xcW4AtvBDJrxHQKygqAj3WjUU=; b=SO/eHWsRtNtDJuSnljSjCK6EqBM6JDnHoU8PQgrBAOzh6dcBBI2KDQe+sh4/HE5Ojqm4xgvTemUoGxnhbHNWm1ZyGrxkW45U4U5Mr+4V2hV7IVqU4TrM9Ztmo5/IWjrPZbQEoOeleTpFzP0EHTRm0a8IYyDJZWbxGMuDtuotVrw= Received: from FR3P281CA0101.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::10) by AS8PR07MB9235.eurprd07.prod.outlook.com (2603:10a6:20b:5ec::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.9; Mon, 10 Oct 2022 14:58:11 +0000 Received: from VE1EUR02FT040.eop-EUR02.prod.protection.outlook.com (2603:10a6:d10:a1:cafe::f6) by FR3P281CA0101.outlook.office365.com (2603:10a6:d10:a1::10) 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:58:10 +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 VE1EUR02FT040.mail.protection.outlook.com (10.152.13.217) 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:10 +0000 Received: from ESESSMB503.ericsson.se (153.88.183.164) by ESESSMR502.ericsson.se (153.88.183.110) 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:58 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.191) 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 6897A380061; Mon, 10 Oct 2022 16:57:58 +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 3/4] eventdev: have ethernet Tx adapter appropriately report idle Date: Mon, 10 Oct 2022 16:54:05 +0200 Message-ID: <20221010145406.118880-4-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: VE1EUR02FT040:EE_|AS8PR07MB9235:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f78034c-af5c-4729-474b-08daaacfd959 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w5wRa2klZSKvNKXfPsgAJmF+1mcjBJRwGDGdbOOgro7e8A0E1RCVibzk/30jl5u0/rxFYTDN0QzmATUeuYSScLDi9XqwTnaRyTnEeZYtNke5EoVPPfRKkz0BQG4hZjNH5ETwyVrXj/fZqpTuZqzd+S6ab/qOTOrBbuZnhBRK4uqgFx2OIEVZzi9WyVoRWgZwuvtllOQzsIYuU9JuuCSvhGRNk8KDieDqiRJamsfwPhC6jS2Gm4N069pjHJeEnSecTjOM1dJoihe1BnY9jUTaDPqQTEJLeBFrRnC8t49BbuoPXBbhXbMvJKBVXYVpK0cItqtpbhFp9olgoH7Jq1D5OYRH43347X+D8VcSWvAavGPihjFPUMY0ps26b7YWVBsggS9VNr9WhNAUJZ9yerKTRL9l0xr/j+Vv3XpBUfR/vWHQW6r+D0dbl2JBZAFwRTBq0J79U0kpnr954J5yc+WGML0Zppc9bla+iptqUP5azNSoriv+kpTgJEdMrdxQVx/V4IXR1hYcxHVAaNDwwe14ZaCNu/60i/vrsc2hBGha+fICzj/JhqcwexEOpa7/7JPTWzxb5dpKpak09GLOQVnmJIkyfZQUGuOug3MVkEsozxlEZnWsIhenoDyHMn3/xqIBoiF/ndLLgY8VFY117Oo5i8M6oWt7A00I7BLZhJsKirMEOIv+HVtQPC+3tldp+9pabcmN4jfveLNbt6qy3R3mofiwkt/Ddo3Pck658uYgLxaSB6GofPrSWLJpqXoHtue+Wb9f7cQwe8nMx3xzHLxEAQ== 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)(346002)(376002)(136003)(451199015)(40470700004)(36840700001)(46966006)(4326008)(82960400001)(82740400003)(82310400005)(36860700001)(7636003)(356005)(40460700003)(26005)(2616005)(1076003)(41300700001)(8936002)(478600001)(186003)(110136005)(36756003)(2906002)(316002)(40480700001)(107886003)(54906003)(336012)(86362001)(47076005)(83380400001)(70586007)(6266002)(66574015)(6666004)(5660300002)(70206006)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 14:58:10.7180 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f78034c-af5c-4729-474b-08daaacfd959 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: VE1EUR02FT040.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB9235 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 Ethernet Tx Adapter's service function to report as idle (i.e., return -EAGAIN) in case no events were dequeued from the event device and no Ethernet frames were sent out on the wire. Signed-off-by: Mattias Rönnblom --- lib/eventdev/rte_event_eth_tx_adapter.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 7f7d86f683..c2a848103b 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -639,6 +639,7 @@ txa_service_func(void *args) struct txa_service_data *txa = args; uint8_t dev_id; uint8_t port; + int ret = -EAGAIN; uint16_t n; uint32_t nb_tx, max_nb_tx; struct rte_event ev[TXA_BATCH_SIZE]; @@ -648,10 +649,10 @@ txa_service_func(void *args) port = txa->port_id; if (txa->nb_queues == 0) - return 0; + return ret; if (!rte_spinlock_trylock(&txa->tx_lock)) - return 0; + return ret; for (nb_tx = 0; nb_tx < max_nb_tx; nb_tx += n) { @@ -659,6 +660,7 @@ txa_service_func(void *args) if (!n) break; txa_service_tx(txa, ev, n); + ret = 0; } if ((txa->loop_cnt++ & (TXA_FLUSH_THRESHOLD - 1)) == 0) { @@ -692,10 +694,13 @@ txa_service_func(void *args) } } - txa->stats.tx_packets += nb_tx; + if (likely(nb_tx > 0)) { + txa->stats.tx_packets += nb_tx; + ret = 0; + } } rte_spinlock_unlock(&txa->tx_lock); - return 0; + return ret; } static int -- 2.34.1