From patchwork Mon Nov 1 13:28:34 2021 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: 103346 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 5791CA0C57; Mon, 1 Nov 2021 14:28:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3EB54111D; Mon, 1 Nov 2021 14:28:45 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60085.outbound.protection.outlook.com [40.107.6.85]) by mails.dpdk.org (Postfix) with ESMTP id 224BC40DF6 for ; Mon, 1 Nov 2021 14:28:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g3WmOUV4yuxAptttEBqgRywLGwPc9kd68Z9nghb8IyxsU2OYmD8YIyEvAuOKrjlvMeQ9DiYaDPROic0rLiiE/pF2SesvEsP0IL+6KCzMM161stFhzlGtpugxjo9Tn2AC1xk8z0xN4NYsUsKzIy5i++X9zQ0pHYyZpDSD3fIxxDTe5jKklxdjWN+cGFMlSNjuhnp+le93NuZvwLCEVrHqA+LPfXjaIR2ANe+EkAC7RqTR/HdLfFyolLmhPFAaN0jSBbEuqqANULxgBe1u94QWCZ7axsmcwVnDq8vG6v4ryrN0HRe3BizObjtMvcJDgDgSv8v/y3NJbF7Cb5crKYW4bg== 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=gLu2X7zaEkP5ZQKsLpzilclAcJg3B/j+j1DB2YdI18M=; b=RJR1EwkHv61gVovDb2vsZ9xs+05JmmpKNBdTrlmbpPkcTHKEUWYuHdbS/JrWxAx4jg4A0i8rQ4jTYNi2E2etU3tMIlByVUs0XfKuwB1G1ccOe7+aW60A8lbpw0QzM+wV+LQI18SS1ZH3A8oBnFnyTWawO8dnXDrGZNpjzZpQt6dTqEi9Rm5p32nPtHRs64TyE4cL5j3omnMD+Xws9iqKazQ0OIF79r/cIV3LT0U+hOrOohrOYBMhREq5q15vtB+Ul0FYGxA4aNTRAFX6TKAvOEtIfpYqNK4gjRK5Ri73Afbm0tMd7o1kAiRmLRknRWZdiHpUoRZFfC6/Ay5VVLjTVg== 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=gLu2X7zaEkP5ZQKsLpzilclAcJg3B/j+j1DB2YdI18M=; b=UgMstoPxak6qo29iT/hPibY6gt8xoDGTu1llUmOFk+N+1perWC350uN6MY1QO0DnnewoOFgCNLNGL0z0+kbEHnq3UYHoh5ZgEqZ6dmM3R8HxrWu49dxPURatkofdW/5VevRmw4toYoNaatWsUsWhyGx4uJhYegaukLgIGf7aDig= Received: from SV0P279CA0015.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:11::20) by DB6PR0701MB2438.eurprd07.prod.outlook.com (2603:10a6:4:5b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.4; Mon, 1 Nov 2021 13:28:40 +0000 Received: from HE1EUR02FT054.eop-EUR02.prod.protection.outlook.com (2603:10a6:f10:11:cafe::38) by SV0P279CA0015.outlook.office365.com (2603:10a6:f10:11::20) 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:40 +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 HE1EUR02FT054.mail.protection.outlook.com (10.152.11.84) 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:40 +0000 Received: from ESESSMB501.ericsson.se (153.88.183.162) 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; Mon, 1 Nov 2021 14:28:38 +0100 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.189) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Mon, 1 Nov 2021 14:28:38 +0100 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id 890F06014A; Mon, 1 Nov 2021 14:28:38 +0100 (CET) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: , , , CC: , , , , , , , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Date: Mon, 1 Nov 2021 14:28:34 +0100 Message-ID: <20211101132836.7595-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57a0804c-820a-4751-c5b3-08d99d3b847f X-MS-TrafficTypeDiagnostic: DB6PR0701MB2438: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hWsVHQ0TypyMELLDt6uST6paWg1EsuI2GYp4l1SHyy3qbfO7MW8r1OaqX0kUx1D6GF7/xRd+iUJurW1yUnmzepxoSKi7z5MEHKk+6xVfN6yQ1q0QdeamabmYzU4sKZREkonCjb6X/7lHqlMCx3UfzU4cbtNBUFMNpyCo8mHIhp0qYAFqJzxKSwk01mhmRNlnHsnIOrVtHpHAa0ZGsQx9al9K0Y++ghIhpdbtBhrkxiECdGNK192jbix1oscpU6gbwm3YRgH8yauXKdhk80Aup6IJnByGxBZ8Ch5qoBQfiT3WIDckJOwgo7BYb5MmnwYNEwItM8w0KjeBtDd8KLOj98T4dT2Kswy41os2fZ+9HMM1Ch9jNFD/TxQd/aWE1wPWPjdFYXCzgPOuqVtQhZ7hHBacfRslE2afpnrYR8urDRCdJR5Ymqvfq8Yp6nI1SgglqNh+JtGvO+2aqi5ddKpIENoNnZvQ0jRTz7gg5w3ALQHNpJHvuH8WA3UP5S0bW6e1A6V1JKkanZZiPT0tSu0R0B8DUd9MmhckEI9I/XHbMSjpbIYsxqMa5h60fcMFUd8KQGWOrh1Ls2celoub7HzSsAL5NtoW1F4yfKUexkjQQCLAdsvTjYelC57EabQ7KiLSP92g6aCbCrqdvr/68chflAyPXx+QwCrtGJtFrfU8VYsJxvZWs6hg6fIMNma9SF4xZ3q0tEK/QjnrLUUQrhldwA== 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)(336012)(70586007)(107886003)(82960400001)(356005)(2616005)(1076003)(26005)(6266002)(7636003)(70206006)(66574015)(4326008)(36756003)(54906003)(7416002)(5660300002)(82310400003)(6666004)(8676002)(2906002)(86362001)(110136005)(316002)(186003)(83380400001)(508600001)(47076005)(8936002)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 13:28:40.0873 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57a0804c-820a-4751-c5b3-08d99d3b847f 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: HE1EUR02FT054.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0701MB2438 Subject: [dpdk-dev] [PATCH v2 1/3] eventdev: allow for event devices requiring 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" Extend Eventdev API to allow for event devices which require various forms of internal processing to happen, even when events are not enqueued to or dequeued from a port. PATCH v2: - Mark rte_event_maintain() experimental. - Make clear it's the thread that owns the port that needs to call rte_event_maintain(). - Make clear rte_event_maintain() may be called also during periods when enqueue/dequeue operations *are* performed. PATCH v1: - Adapt to the move of fastpath function pointers out of rte_eventdev struct - Attempt to clarify how often the application is expected to call rte_event_maintain() - Add trace point RFC v2: - Change rte_event_maintain() return type to be consistent with the documentation. - Remove unused typedef from eventdev_pmd.h. Signed-off-by: Mattias Rönnblom Tested-by: Richard Eklycke Tested-by: Liron Himi --- lib/eventdev/eventdev_pmd.h | 2 + lib/eventdev/eventdev_private.c | 9 ++++ lib/eventdev/eventdev_trace_points.c | 3 ++ lib/eventdev/rte_eventdev.h | 70 ++++++++++++++++++++++++++++ lib/eventdev/rte_eventdev_core.h | 5 ++ lib/eventdev/rte_eventdev_trace_fp.h | 7 +++ 6 files changed, 96 insertions(+) diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index d009e24309..82a5c4db33 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -164,6 +164,8 @@ struct rte_eventdev { /**< Pointer to PMD dequeue function. */ event_dequeue_burst_t dequeue_burst; /**< Pointer to PMD dequeue burst function. */ + event_maintain_t maintain; + /**< Pointer to PMD port maintenance function. */ event_tx_adapter_enqueue_t txa_enqueue_same_dest; /**< Pointer to PMD eth Tx adapter burst enqueue function with * events destined to same Eth port & Tx queue. diff --git a/lib/eventdev/eventdev_private.c b/lib/eventdev/eventdev_private.c index 9084833847..6395c21dce 100644 --- a/lib/eventdev/eventdev_private.c +++ b/lib/eventdev/eventdev_private.c @@ -44,6 +44,13 @@ dummy_event_dequeue_burst(__rte_unused void *port, return 0; } +static void +dummy_event_maintain(__rte_unused void *port) +{ + RTE_EDEV_LOG_ERR( + "maintenance requested for unconfigured event device"); +} + static uint16_t dummy_event_tx_adapter_enqueue(__rte_unused void *port, __rte_unused struct rte_event ev[], @@ -85,6 +92,7 @@ event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op) .enqueue_forward_burst = dummy_event_enqueue_burst, .dequeue = dummy_event_dequeue, .dequeue_burst = dummy_event_dequeue_burst, + .maintain = dummy_event_maintain, .txa_enqueue = dummy_event_tx_adapter_enqueue, .txa_enqueue_same_dest = dummy_event_tx_adapter_enqueue_same_dest, @@ -105,6 +113,7 @@ event_dev_fp_ops_set(struct rte_event_fp_ops *fp_op, fp_op->enqueue_forward_burst = dev->enqueue_forward_burst; fp_op->dequeue = dev->dequeue; fp_op->dequeue_burst = dev->dequeue_burst; + fp_op->maintain = dev->maintain; fp_op->txa_enqueue = dev->txa_enqueue; fp_op->txa_enqueue_same_dest = dev->txa_enqueue_same_dest; fp_op->ca_enqueue = dev->ca_enqueue; diff --git a/lib/eventdev/eventdev_trace_points.c b/lib/eventdev/eventdev_trace_points.c index 237d9383fd..de6b1f4417 100644 --- a/lib/eventdev/eventdev_trace_points.c +++ b/lib/eventdev/eventdev_trace_points.c @@ -37,6 +37,9 @@ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_enq_burst, RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_deq_burst, lib.eventdev.deq.burst) +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_maintain, + lib.eventdev.maintain) + /* Eventdev Rx adapter trace points */ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_create, lib.eventdev.rx.adapter.create) diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index 0abed56bef..3a2ec2230a 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -299,6 +299,15 @@ struct rte_event; * the content of this field is implementation dependent. */ +#define RTE_EVENT_DEV_CAP_REQUIRES_MAINT (1ULL << 10) +/**< Event device requires calls to rte_event_maintain() during + * periods when neither rte_event_dequeue_burst() nor + * rte_event_enqueue_burst() are called on a port. This will allow the + * event device to perform internal processing, such as flushing + * buffered events, return credits to a global pool, or process + * signaling related to load balancing. + */ + /* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 /**< Highest priority expressed across eventdev subsystem @@ -2063,6 +2072,67 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], timeout_ticks); } +/** + * Maintain an event device. + * + * This function is only relevant for event devices which have the + * RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag set. Such devices require an + * application thread using a particular port to periodically call + * rte_event_maintain() on that port during periods which it is + * neither attempting to enqueue events to nor dequeue events from the + * port. rte_event_maintain() is a low-overhead function and should be + * called at a high rate (e.g., in the application's poll loop). + * + * No port may be left unmaintained. + * + * At the application thread's convenience, rte_event_maintain() may + * (but is not required to) be called even during periods when enqueue + * or dequeue functions are being called, at the cost of a slight + * increase in overhead. + * + * rte_event_maintain() may be called on event devices which haven't + * set RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag, in which case it is a + * no-operation. + * + * @param dev_id + * The identifier of the device. + * @param port_id + * The identifier of the event port. + * @return + * - 0 on success. + * - -EINVAL if *dev_id* or *port_id* is invalid + * + * @see RTE_EVENT_DEV_CAP_REQUIRES_MAINT + */ +__rte_experimental +static inline int +rte_event_maintain(uint8_t dev_id, uint8_t port_id) +{ + const struct rte_event_fp_ops *fp_ops; + void *port; + + fp_ops = &rte_event_fp_ops[dev_id]; + port = fp_ops->data[port_id]; +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG + if (dev_id >= RTE_EVENT_MAX_DEVS || + port_id >= RTE_EVENT_MAX_PORTS_PER_DEV) { + rte_errno = EINVAL; + return 0; + } + + if (port == NULL) { + rte_errno = EINVAL; + return 0; + } +#endif + rte_eventdev_trace_maintain(dev_id, port_id); + + if (fp_ops->maintain != NULL) + fp_ops->maintain(port); + + return 0; +} + #ifdef __cplusplus } #endif diff --git a/lib/eventdev/rte_eventdev_core.h b/lib/eventdev/rte_eventdev_core.h index 61d5ebdc44..61fa65cab3 100644 --- a/lib/eventdev/rte_eventdev_core.h +++ b/lib/eventdev/rte_eventdev_core.h @@ -29,6 +29,9 @@ typedef uint16_t (*event_dequeue_burst_t)(void *port, struct rte_event ev[], uint64_t timeout_ticks); /**< @internal Dequeue burst of events from port of a device */ +typedef void (*event_maintain_t)(void *port); +/**< @internal Maintains a port */ + typedef uint16_t (*event_tx_adapter_enqueue_t)(void *port, struct rte_event ev[], uint16_t nb_events); @@ -54,6 +57,8 @@ struct rte_event_fp_ops { /**< PMD dequeue function. */ event_dequeue_burst_t dequeue_burst; /**< PMD dequeue burst function. */ + event_maintain_t maintain; + /**< PMD port maintenance function. */ event_tx_adapter_enqueue_t txa_enqueue; /**< PMD Tx adapter enqueue function. */ event_tx_adapter_enqueue_t txa_enqueue_same_dest; diff --git a/lib/eventdev/rte_eventdev_trace_fp.h b/lib/eventdev/rte_eventdev_trace_fp.h index 5639e0b83a..c5a79a14d8 100644 --- a/lib/eventdev/rte_eventdev_trace_fp.h +++ b/lib/eventdev/rte_eventdev_trace_fp.h @@ -38,6 +38,13 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_ptr(enq_mode_cb); ) +RTE_TRACE_POINT_FP( + rte_eventdev_trace_maintain, + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id), + rte_trace_point_emit_u8(dev_id); + rte_trace_point_emit_u8(port_id); +) + RTE_TRACE_POINT_FP( rte_eventdev_trace_eth_tx_adapter_enqueue, RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table, From patchwork Mon Nov 1 13:28:35 2021 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: 103345 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 779E2A0C57; Mon, 1 Nov 2021 14:28:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3335040E28; Mon, 1 Nov 2021 14:28:44 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130051.outbound.protection.outlook.com [40.107.13.51]) by mails.dpdk.org (Postfix) with ESMTP id 5887540DF6 for ; Mon, 1 Nov 2021 14:28:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UBk9fxj1cje7tPzGRI6XdgFqMd/NmbFwZYhAOVPit/WAyD8srWNA2rBhJyE8eGHw7zHeLLUW0sU4WTyF9YCsODbn86Hq8U2kWyXrm+neAb3TlBhfflT4CR9psKCPKlJleEJtiM0/09p8DV8UnS7RFujt08W0okCpSYgWgzB7hRGk8srz6sVyfJZqJOwK1SY3N8ZPYkZrdRAgOh6Uw48d6KzyBn5mSJRiDdPaAdD0FeAfffhPBTdS43tMn4YLMKFqdo1StVaS8KZ6u92tArEb6zbCb8P29Pv25vEWOHcAEzD1Wavxvo/z+le8pSd1d6awAfO+ATS8p5kvhz8YbfnlCw== 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=95gdRS7ub7SkUGq9CoB+mcGYc4WJVTaic84SWsa4wT8=; b=VMdFaZ6WTUrHSanbOY6XYOxcqAIEItDS87kLepJqcggUPQlwvKFEgySI+/DIxzmqxFOMy9TlvnS4NQbwBIHMEjQu6AAUdPDJM5vyZX2qy0qZC9Xh60zgkOOALs5nNZy+QQufvQOICjkOLcOgawXBA6BbOvT0PECi5a9LVv5Tg6fqzdEmAZFgOQGso8ofFI8Mh+sfOCBHojEdR9xUwqeuvU1rFOZkWnZWFkzTw9sTmyMWfp+F0cQHBs1x2IPNxK7ZB17wa4l8NajAUYM0mAovpg0Dwr3Wh0wP7CJVaIxiorLyC/cYmlsxb1WkR4HjQ1dK9EVsqTe2gHseXIvVxtKuSg== 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=95gdRS7ub7SkUGq9CoB+mcGYc4WJVTaic84SWsa4wT8=; b=soiPhU1JmCEMYinfysUQflSOcYwEmYc2x62h7SOaSR8pOw6b2VgubGFAIiiLLG45JnbSpInLMYZ5rrjyDRwOZUIrFE0+7UF3Uz5NuPKsufLC8gHMBQPk0oG9ye9PJ2zUOswUveUKLOYyHRzMuObgPWc9zXtK2PkGtoO8eQ09hkc= Received: from AM6PR08CA0044.eurprd08.prod.outlook.com (2603:10a6:20b:c0::32) by AS8PR07MB7285.eurprd07.prod.outlook.com (2603:10a6:20b:252::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.4; Mon, 1 Nov 2021 13:28:41 +0000 Received: from AM5EUR02FT023.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:c0:cafe::35) by AM6PR08CA0044.outlook.office365.com (2603:10a6:20b:c0::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Mon, 1 Nov 2021 13:28:41 +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 AM5EUR02FT023.mail.protection.outlook.com (10.152.8.166) 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:40 +0000 Received: from ESESSMB503.ericsson.se (153.88.183.164) 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 14:28:40 +0100 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.191) 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 529836014A; Mon, 1 Nov 2021 14:28:40 +0100 (CET) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: , , , CC: , , , , , , , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Date: Mon, 1 Nov 2021 14:28:35 +0100 Message-ID: <20211101132836.7595-2-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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 921a92a0-4611-42b9-dd9f-08d99d3b84ea X-MS-TrafficTypeDiagnostic: AS8PR07MB7285: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +x7Rj85Mqig2tlFOp834RWgbKI3WngQVs9N1/f1o9qQsMSpVmeZPQOUD3OMQ/JTd3SABDt0w6Har+S92Sun2bw6MkiQCwpwpMS502LPaaJe+4e4wFiPSjrRuw/G5z52oxaHctaoBgzxtSUGsNhzz3uUDps7nZeyyC7KU6JCt4Tn/7qSMaW75AwecugV7uYXlLU72Pl+kp57AW+q6mVh1Pr8bFv6GmBnJlHnGo8uPNY1bSu+pqB6rD+1wgXWnn5cg95CD9rPoQ8H3SthsIO1YPa37ir2TqRZK6HROHBIem6WANGC2YZxjCHvpBix21VVqovwDRAONRU+CzVupW2rK1BF6BywmzU1jxXbb7KuS85sLImCUJ+D3yA3/FohcgHh7MaC3weRJM2dMUDSDY98eBwQ9OD8qEFcRqf2JmRxh+n8aIFhlc9zAi8dCIp90hxjDsK5sklPKFtSzetL7n+NzlQVqPXzX33Ze4vK3ZBIg91OB8mWtJq8Wxvck4RFsJD4gizUzMg4ELxKvRc4uUiwhvPtoV6v0udypTog8HoSqbs55LBQ+3+yxXYpScJ+P4RTrDSWru7v97dXj/Y4RbQsKHeK+twQqmppBQyV4F9SvrI2irmNOd77UV2okxY1fwzI46YjHobYWvMPR+p2yqcZwL07XpSWRIKsuh8r0qiIiSg940Ri1nOlWZIRQt3pzUESLc5xkGFyUZDNKErRIQQ69SA== 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)(110136005)(6266002)(54906003)(316002)(4326008)(83380400001)(508600001)(36860700001)(36756003)(66574015)(2906002)(82310400003)(7636003)(107886003)(356005)(86362001)(5660300002)(82960400001)(186003)(6666004)(7416002)(336012)(70206006)(70586007)(26005)(47076005)(2616005)(8676002)(8936002)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 13:28:40.7692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 921a92a0-4611-42b9-dd9f-08d99d3b84ea 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: AM5EUR02FT023.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7285 Subject: [dpdk-dev] [PATCH v2 2/3] event/dsw: make use of eventdev maintenance facility 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" Set the RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag, and perform DSW background tasks on rte_event_maintain() calls. PATCH v2: - Update DSW documentation. RFC v2: - Have dsw_event_maintain() occasionally flush the port output buffers. Signed-off-by: Mattias Rönnblom Tested-by: Richard Eklycke Tested-by: Liron Himi --- doc/guides/eventdevs/dsw.rst | 25 ++++++++++++++----------- drivers/event/dsw/dsw_evdev.c | 4 +++- drivers/event/dsw/dsw_evdev.h | 1 + drivers/event/dsw/dsw_event.c | 9 +++++++++ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/doc/guides/eventdevs/dsw.rst b/doc/guides/eventdevs/dsw.rst index 6653f501c1..af6ca714a2 100644 --- a/doc/guides/eventdevs/dsw.rst +++ b/doc/guides/eventdevs/dsw.rst @@ -40,20 +40,20 @@ Example: Limitations ----------- -Unattended Ports +Port Maintenance ~~~~~~~~~~~~~~~~ -The distributed software eventdev uses an internal signaling schema -between the ports to achieve load balancing. In order for this to -work, the application must perform enqueue and/or dequeue operations -on all ports. +The distributed software eventdev uses an internal signaling scheme +between the ports to achieve load balancing. Therefor, it sets the +``RTE_EVENT_DEV_CAP_REQUIRES_MAINT`` flag. -Producer-only ports which currently have no events to enqueue should -periodically call rte_event_enqueue_burst() with a zero-sized burst. +During periods when the application thread using a particular port is +neither attempting to enqueue nor to dequeue events, it must +repeatedly call rte_event_maintain() on that port. -Ports left unattended for longer periods of time will prevent load -balancing, and also cause traffic interruptions on the flows which -are in the process of being migrated. +Ports left unmaintained for long periods of time will prevent load +balancing and cause traffic interruptions on flows which are in the +process of being migrated. Output Buffering ~~~~~~~~~~~~~~~~ @@ -66,9 +66,12 @@ In case no more events are enqueued on a port with buffered events, these events will be sent after the application has performed a number of enqueue and/or dequeue operations. -For explicit flushing, an application may call +To explicitly flush a port's output buffer, an application may call rte_event_enqueue_burst() with a zero-sized burst. +Repeated calls to rte_event_maintain() will also flush the output +buffers. + Priorities ~~~~~~~~~~ diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c index 0652d83ad6..5ff8fcc6a9 100644 --- a/drivers/event/dsw/dsw_evdev.c +++ b/drivers/event/dsw/dsw_evdev.c @@ -222,7 +222,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused, RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED| RTE_EVENT_DEV_CAP_NONSEQ_MODE| RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT| - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID + RTE_EVENT_DEV_CAP_CARRY_FLOW_ID| + RTE_EVENT_DEV_CAP_REQUIRES_MAINT }; } @@ -441,6 +442,7 @@ dsw_probe(struct rte_vdev_device *vdev) dev->enqueue_forward_burst = dsw_event_enqueue_forward_burst; dev->dequeue = dsw_event_dequeue; dev->dequeue_burst = dsw_event_dequeue_burst; + dev->maintain = dsw_event_maintain; if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h index 631daea55c..31af4ede0f 100644 --- a/drivers/event/dsw/dsw_evdev.h +++ b/drivers/event/dsw/dsw_evdev.h @@ -271,6 +271,7 @@ uint16_t dsw_event_enqueue_forward_burst(void *port, uint16_t dsw_event_dequeue(void *port, struct rte_event *ev, uint64_t wait); uint16_t dsw_event_dequeue_burst(void *port, struct rte_event *events, uint16_t num, uint64_t wait); +void dsw_event_maintain(void *port); int dsw_xstats_get_names(const struct rte_eventdev *dev, enum rte_event_dev_xstats_mode mode, diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c index 1f09816945..f16d9d463b 100644 --- a/drivers/event/dsw/dsw_event.c +++ b/drivers/event/dsw/dsw_event.c @@ -1400,3 +1400,12 @@ dsw_event_dequeue_burst(void *port, struct rte_event *events, uint16_t num, return dequeued; } + +void dsw_event_maintain(void *port) +{ + struct dsw_port *source_port = port; + struct dsw_evdev *dsw = source_port->dsw; + + dsw_port_note_op(source_port, 0); + dsw_port_bg_process(dsw, source_port); +} From patchwork Mon Nov 1 13:28:36 2021 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: 103347 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 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_R=C3=B6nnblom?= To: , , , CC: , , , , , , , , =?utf-8?q?Mattias_R=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 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; }