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 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=20R=C3=B6nnblom?= To: , , , CC: , , , , , , , , =?UTF-8?q?Mattias=20R=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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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); +} -- 2.25.1