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 6F0E342340; Mon, 9 Oct 2023 20:22:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1200402B1; Mon, 9 Oct 2023 20:22:34 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2071.outbound.protection.outlook.com [40.107.15.71]) by mails.dpdk.org (Postfix) with ESMTP id BE7FC4026B; Mon, 9 Oct 2023 20:22:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kuPjg+aHQm7+Lk3xvdWeE2oUc8KmnmZX65BH9XxWqinRE4wdeBH6gDQVAG+8GrN8kUsG2+JHZVokhT9ZhHyU0GXGqfUCeYSWwJz7W4v8vZCYK3Jw40GXp7/HXT10AtbIKDUz4CVrxP7r7f6R+Pk8WWfrzNbjLPJIwH70BrkxeoSCfCEx63wzWDCXJuQ2S3b1zsgBqbG2dZ/GWq1nqqlq7jyD5tOoOOpeK66+mebTEkZQuR/Q62A6tySNCngo06B08JDkipQzS+OVc9NLd/FmTmiA9AfSNxTYHFwMxNlys0vbnpiHlHOpxUct6cGx1hSc3V/mO+yuNKfrFUBR6EIcew== 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=Yt9uCBouChPg6sBnN8p6CWuTSGoVn2ir/FEAjf9Vjao=; b=OK6Wc3ySNrSVfJcypjDC8Ci3L4thP/cb6kHPqyrtEldc83Z/LK8aiEK5iuejiud/BZnDtxwN8wRFoLvnkLZ232PFzMje2eCFtKlf5HS3pfZUTrhDv6ix1ZXFLUZ62G/uefd05E9VlIHbgUjwRdxwMdJQYFTfsmGm6omTcHR4lQpWGjos0Mu/M2rGlE34T9F46SgUeM/MhVn8OhZoC9g/wqjgi3Rhp2YLsJ0RKQpgSbaH/goNzNIMh6JtGZ3Vl6UJjCeprLf17nNqYdYI/IFPym7hOVQga8owpX9TvjCweaUOBNM+y0KYv0Ua0qBZgSA4nQ17htTdWK5gE8Cre1jn3A== 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=Yt9uCBouChPg6sBnN8p6CWuTSGoVn2ir/FEAjf9Vjao=; b=aXRaYv+gVazpIyu6uJkXdOtcFhxTRQC2eJ4Eere41i7wsnvlEJlVni6PixDNopkuu21l2qTwc6aK0qfJkZTsXjbVx921m8nBtXuPjaIfQyGfLRfulXRj8vceLErMVE6be7wtvbpscc1/TaOVMpJ281pR+b/8Kc1+LsPJ3CKo8kk= Received: from AM6PR0502CA0037.eurprd05.prod.outlook.com (2603:10a6:20b:56::14) by PR3PR07MB6971.eurprd07.prod.outlook.com (2603:10a6:102:5e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 18:22:31 +0000 Received: from AM2PEPF0001C709.eurprd05.prod.outlook.com (2603:10a6:20b:56:cafe::e5) by AM6PR0502CA0037.outlook.office365.com (2603:10a6:20b:56::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36 via Frontend Transport; Mon, 9 Oct 2023 18:22:31 +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 AM2PEPF0001C709.mail.protection.outlook.com (10.167.16.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 18:22:31 +0000 Received: from SESSMR601.ericsson.se (100.87.178.26) by ESESBMB501.ericsson.se (153.88.183.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.32; Mon, 9 Oct 2023 20:22:30 +0200 Received: from ESESSMB505.ericsson.se (153.88.183.42) by SESSMR601.ericsson.se (100.87.178.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.2.1118.26; Mon, 9 Oct 2023 20:22:30 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.193) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Mon, 9 Oct 2023 20:22:30 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 8FD5F1C006A; Mon, 9 Oct 2023 20:22:30 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: , CC: Jerin Jacob , , , , Peter Nilsson , Heng Wang , "Naga Harish K S V" , Pavan Nikhilesh , Gujjar Abhinandan S , Erik Gabriel Carrillo , Shijith Thotton , "Hemant Agrawal" , Sachin Saxena , Liang Ma , Peter Mccarthy , Zhirun Yan , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH v6 0/3] Add dispatcher library Date: Mon, 9 Oct 2023 20:17:08 +0200 Message-ID: <20231009181711.440865-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928073056.359356-2-mattias.ronnblom@ericsson.com> References: <20230928073056.359356-2-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: AM2PEPF0001C709:EE_|PR3PR07MB6971:EE_ X-MS-Office365-Filtering-Correlation-Id: c6d9132d-de1b-42c4-56e6-08dbc8f4b39a X-LD-Processed: 92e84ceb-fbfd-47ab-be52-080c6b87953f,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EgfRFqsR7I+K8QzquUmivUesGj6w+P/QDT7jjsO9zMBO9qgiX6EpSb1Zr0IUn5phojgSwoXDExDfrFJaSxczZhZzNmihv1nu6ScdtoerS67t3QChjXHffvZLryOiReuTBtq9p7L5np3CpOoCAu6HwUxWEwUEJj0R2ks9olEP5KjCgwPosAE2me4tqgC/hVnfqJ6iYabmB4n9SREwm7vNGt9I0tnLEeASWewVB/hF7UD6e/YbraMy4Ku2BdXQbQGQUi0nWA88220/ZB36QKChpV9vXT8YKLZ3E+6UCcUfE6OAQhMTol/c0pR0h1yiQCACDDEDRjHa36v2b8xNd4CkiztDnlsvAaqUd/c9pxphool9usR/cZigr3DO3cN1U11tAKQyZaGXxZ67MOMKvf7cbiogoARBuJfAwrsVBlPv3o8EuvJArwgzbfn2TmxKQGHa+jp0MCelScjWIcUMTU5mcOKDfmBNxgFuGLZcUDx2VzFxNkrv594YAX8ALd5kHmfsbjGZfyoMpo/jeziaHLSV2VQO50vh4+sCsVPohTMKTwDBPpTHeBYjiWwTND6lOY4cgt8wuPjkwz1TJZYbQQgFZxqLT15NW8dGxUu5efDse8ReEyGpMOrxc+Mm1hiFYcsB2g52tbs1tc5f6wXw9nGn/ili0tSxhrkyNW3/VmfhUsmVE+vvMfuVUEbZxHJI01AE6KnPMltDlNhrnItHiH6MiCL/pJJLq6X30Us+obRn4Nm6ikWRbdbkX8GbJLqZ8GQxyUf9fzjDqi8yUInkw0vw5PShDVxYs6eeuhd87j4d4dmuBKeLtriG3pvslIfhvZ8ZSJuCUvDpJHfbXcKE/h+uMryaV2Jj9ruXkmwMuswls9g= 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:(13230031)(4636009)(396003)(376002)(136003)(39860400002)(346002)(230922051799003)(82310400011)(451199024)(64100799003)(1800799009)(186009)(46966006)(40470700004)(36840700001)(40460700003)(6266002)(336012)(2616005)(26005)(1076003)(8936002)(36860700001)(8676002)(478600001)(6666004)(66574015)(47076005)(7416002)(107886003)(83380400001)(4326008)(2906002)(54906003)(70586007)(70206006)(110136005)(41300700001)(316002)(5660300002)(82960400001)(7636003)(36756003)(82740400003)(40480700001)(86362001)(356005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 18:22:31.3244 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6d9132d-de1b-42c4-56e6-08dbc8f4b39a 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: AM2PEPF0001C709.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR07MB6971 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 The purpose of the dispatcher library is to decouple different parts of an eventdev-based application (e.g., processing pipeline stages), sharing the same underlying event device. The dispatcher replaces the conditional logic (often, a switch statement) that typically follows an event device dequeue operation, where events are dispatched to different parts of the application based on event meta data, such as the queue id or scheduling type. The concept is similar to a UNIX file descriptor event loop library. Instead of tying callback functions to fds as for example libevent does, the dispatcher relies on application-supplied matching callback functions to decide where to deliver events. A dispatcher is configured to dequeue events from a specific event device, and ties into the service core framework, to do its (and the application's) work. The dispatcher provides a convenient way for an eventdev-based application to use service cores for application-level processing, and thus for sharing those cores with other DPDK services. Although the dispatcher adds some overhead, experience suggests that the net effect on the application (both synthetic benchmarks and more real-world applications) may well be positive. This is primarily due to clustering (see programming guide) reducing cache misses. Benchmarking indicates that the overhead is ~10 cc/event (on a large core), with a handful of often-used handlers. The dispatcher does not support run-time reconfiguration. The use of the dispatcher library is optional, and an eventdev-based application may still opt to access the event device using direct eventdev API calls, or by some other means. Mattias Rönnblom (3): lib: introduce dispatcher library test: add dispatcher test suite doc: add dispatcher programming guide MAINTAINERS | 6 + app/test/meson.build | 1 + app/test/test_dispatcher.c | 1045 ++++++++++++++++++++++ doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + doc/guides/prog_guide/dispatcher_lib.rst | 433 +++++++++ doc/guides/prog_guide/index.rst | 1 + doc/guides/rel_notes/release_23_11.rst | 5 + lib/dispatcher/meson.build | 13 + lib/dispatcher/rte_dispatcher.c | 691 ++++++++++++++ lib/dispatcher/rte_dispatcher.h | 466 ++++++++++ lib/dispatcher/version.map | 20 + lib/meson.build | 2 + 13 files changed, 2685 insertions(+) create mode 100644 app/test/test_dispatcher.c create mode 100644 doc/guides/prog_guide/dispatcher_lib.rst create mode 100644 lib/dispatcher/meson.build create mode 100644 lib/dispatcher/rte_dispatcher.c create mode 100644 lib/dispatcher/rte_dispatcher.h create mode 100644 lib/dispatcher/version.map -- 2.34.1