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 32EA1A0548; Mon, 1 Nov 2021 19:40:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49B9D4111D; Mon, 1 Nov 2021 19:40:33 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2055.outbound.protection.outlook.com [40.107.22.55]) by mails.dpdk.org (Postfix) with ESMTP id 7E57340DF6 for ; Mon, 1 Nov 2021 19:40:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hHkxwFI8ej2VG/ZiGB8x2HWvtrwhu08qThOBrUmpeWg2zMCB07bcg6BG6/PtEQhCgREnGISLZKtgVBjb5aJ5IxKiMcy187A8MWOl1/1KL9ZpwvUUNSxVVs3Si8f0433eZxo34Y3qvTLmjdOkBOnl9WarzKRXIt7oDqs5aDSMN+HUk1fvil0IkAIhxnQiIJUiaoSpiaGmaWqlvNJUyDiTAvvDDl1pJ1NXkMenBHbFI4qNxnxdnd5imudK8E7gFmGwlQUhq53QNPrCmETnbhGF0FSdfyp33N1XSDB5e188hc5bZ6YWIS+eY7fcLwryia2jbAE5ZAtiMiI6WeHkN7N3qw== 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=D7LLPHy9gvp1FWwUaI54bwOy44BUJLq32Q4V/qh3RaM=; b=EzDT+K1nJvYk/JTJBU3S9Hu58d5vdWaTo8eC2L90uQuzbe1NA2p5/NjRNE67Bv2DXCcwCOdjto8Y5m6E7V1dTjaZXsqScgR+1ZyMbjFNSzEfn06Go0ptG9QASrA3gdD80UEqVLyOnyedmRK/6qiblTqOzP5omAvTcDynZDRHK8QLa3+qSjEIvZ9kryypqcSnIHR6ojJ+csIYl7/6SYPfC05z2cjjG80XVPmnLEQm7yJ0PNeTLDQjVBHZe6Au7mf+jk7D2VaaoyuJTM5WIhdjCpULX8DRxkprGwOuW+uhN4PALJBIYfK7GLK0qfVIXn6+3CvJ8aYMrVHUXc6psaPI4A== 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=D7LLPHy9gvp1FWwUaI54bwOy44BUJLq32Q4V/qh3RaM=; b=IQOz+VbVXvfL+cqFgUyBenaLQg/hTtYx45C/b3UlzeHiTTC/zfswr9JT2doP1q48bW9lyseMvA+K4mN2Usc7U5sFqwJ1OVLcrglSz68in6ZzYHo+v7lyK2UdWOzMVAGZwqX8poqLDVHChJd5PgCin3wjSigoqE746R1hvKFqTis= Received: from SV0P279CA0018.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:11::23) by VI1PR07MB3375.eurprd07.prod.outlook.com (2603:10a6:802:23::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.5; Mon, 1 Nov 2021 18:40:30 +0000 Received: from HE1EUR02FT027.eop-EUR02.prod.protection.outlook.com (2603:10a6:f10:11:cafe::4c) by SV0P279CA0018.outlook.office365.com (2603:10a6:f10:11::23) 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 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 HE1EUR02FT027.mail.protection.outlook.com (10.152.10.72) 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 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 19:40:27 +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 19:40:27 +0100 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id B9BCF6014A; Mon, 1 Nov 2021 19:40:27 +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:15 +0100 Message-ID: <20211101184016.8073-2-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: 7706599e-4174-46f3-a53a-08d99d671428 X-MS-TrafficTypeDiagnostic: VI1PR07MB3375: 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: EVK263gtWhZ0MTIJEsCkiLUufTByyJiDtNH0qp3ljWVSlfUUfJ14WpX5zEV1/PbF/rNXzW/0j4dfcX+OUUI6j+wEXdPQZROg6Ansx+xGjvxXztXULyfAuf0HcrgOis/Wp5FfwSX+P9zfYHCVxsu1YDRrQFuU03TaZZcUGCaz9oF+MTos9BLw57+bT5bxr2UIqUMUcfBJYIQiSLs2jgJAWo4EJVhk8BKKhEq4HpJ3ebxc5BfNBjeQ4wm1yBiejUBvksz1u/FGLPaJFgZJGBV3Ux71xLzn3Aw7uN6XJUWl8oK33WauMrm4B2D/nH3AUs/n7cLuHcUTPwTo52iDZPtAZpJ7JCEa342KTjLUbagDDYWTsmQKQfx60D4N/maoPQvfDbjtGP8z2gdnurRKUDgfk77uaV/cYCNPVJ9E/K+IZZDGesMDVEmEkutyZCWIIUzVIuf7mGeWg7GZE9KIDNRpAVlghl8vJUI2daQuKMHU4GrTDY6YD0xhRB7DAOdFcDvdIN/nYhbJYOQlQNBck4gK2GX6sDuqOguNkkcwbltStaMfVuwXaS8nKQLwpO4UtMN1yR0dv5qqEeDMdewYY/df+ZS+6Z6zFVnJb4TR2qW0O5H8naR1DhXVe3R6I/NV8AotaGkWCDTko9J0mdTj8jZH7ekyuZOnPHsTdq1xAgGxpYYckDgsrgTLuZUKRd2wXO4U+9tSwnx8laqTsyRraaQM7w== 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)(36756003)(82310400003)(1076003)(70206006)(70586007)(5660300002)(6666004)(82960400001)(8676002)(83380400001)(36860700001)(26005)(4326008)(356005)(336012)(2906002)(66574015)(7416002)(316002)(54906003)(107886003)(2616005)(47076005)(110136005)(7636003)(86362001)(508600001)(8936002)(6266002)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 18:40:29.4696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7706599e-4174-46f3-a53a-08d99d671428 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: HE1EUR02FT027.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB3375 Subject: [dpdk-dev] [PATCH v3 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 v3: - Add support for output buffer flushing by means of the new rte_event_maintain() op parameter, and RTE_EVENT_DEV_MAINT_OP_FLUSH. 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 | 27 +++++++++++++++------------ drivers/event/dsw/dsw_evdev.c | 4 +++- drivers/event/dsw/dsw_evdev.h | 1 + drivers/event/dsw/dsw_event.c | 12 ++++++++++++ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/doc/guides/eventdevs/dsw.rst b/doc/guides/eventdevs/dsw.rst index 6653f501c1..18f7e9588f 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. Therefore, 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,8 +66,11 @@ 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 -rte_event_enqueue_burst() with a zero-sized burst. +To immediately flush a port's output buffer, an application may call +rte_event_maintain() with op set to ``RTE_EVENT_DEV_MAINT_OP_FLUSH``. + +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..e64ae26f6e 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 op); 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..c6ed470286 100644 --- a/drivers/event/dsw/dsw_event.c +++ b/drivers/event/dsw/dsw_event.c @@ -1400,3 +1400,15 @@ dsw_event_dequeue_burst(void *port, struct rte_event *events, uint16_t num, return dequeued; } + +void dsw_event_maintain(void *port, int op) +{ + 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); + + if (op & RTE_EVENT_DEV_MAINT_OP_FLUSH) + dsw_port_flush_out_buffers(dsw, source_port); +} -- 2.25.1