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 0F80342614; Fri, 22 Sep 2023 09:43:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DAFDC402B9; Fri, 22 Sep 2023 09:43:57 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2088.outbound.protection.outlook.com [40.107.8.88]) by mails.dpdk.org (Postfix) with ESMTP id 2B13840151; Fri, 22 Sep 2023 09:43:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EuDrrMt+v1OFlMLgdZR4sVaFl/DRW8dfslB7gxqWBsM4yXFneimHkaaFFeHXpMsNW9tiFrGYw8eEv+RrJhsko5C1s3suphj4zagxO2xZelFRJyO5W+jlcSSBW7hjSsvDGKaLhyxXL5iBA6SzdlMPoiDB/uKbFEEG8mKCT+O52nefeSph93pozwX00JWfcx2xlCfmzsGA5o+DaL5fv2SESWBd7WgZT95TNNWN0CzT7QgnlfWbYN9NsrgsV8QrbxUcKPbxtGG7eTtNIf0lwgUPSL5J5EG2osWHpouZZxXvVlrWG8GyRgXyovqBL6NDaTsdWER1PuTcnCSTpwmvQX4nJw== 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=bSNT3pgdRo3VIJOWyc6XPyiimW1uFdkWY/W6EKq0J6A=; b=kuL1Y3j4oRHYM0Z96ZpsZf5KWBIKniJZbyX70QbbHdPlkTBbw+2BZaH84792OQn/vsa/FRq4Qa/pU7JkSze4JTXmRhJoNYFdYJyeqFxx5JabhKCYt7TDQtkaxGmcxA7GbMGlneGfkkHaWFaB/hC0jSuCSSWRp/FhKi/YDjzNPAm6c/xjx2iNXC2fL6oD2GseZWy7Hu3+0tInHQuzw+shphfXKlb5+dPQ7nOQNjRRSM/L4m8PmdnC7Ah/6Gc16Rpc6Ip13i1KOCphO/SDV+Rz2hEsjiUbRFEZaMP+n0sRBGY8KBQpsz6qDKf9B4xaTS4pdyxkuoq09aTFKO0TJlYzXw== 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=bSNT3pgdRo3VIJOWyc6XPyiimW1uFdkWY/W6EKq0J6A=; b=GTT44jm6eIF/dkk3SbVG7g1R64FE1442KT24cBPgeI29btlT2RXIhPioOlfa1seIAJUlg8IfDMfy5nSV9J/cBoucE6xqXluTkjr5nwenrOpiAe/xe8Zuo5jPa7PovGRapklLAUsvnHD4nlb86Qsck9OvHRPwnUGFeOkCzofn4n8= Received: from AM6PR02CA0006.eurprd02.prod.outlook.com (2603:10a6:20b:6e::19) by PA4PR07MB7469.eurprd07.prod.outlook.com (2603:10a6:102:c3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Fri, 22 Sep 2023 07:43:54 +0000 Received: from AM2PEPF0001C716.eurprd05.prod.outlook.com (2603:10a6:20b:6e:cafe::69) by AM6PR02CA0006.outlook.office365.com (2603:10a6:20b:6e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.32 via Frontend Transport; Fri, 22 Sep 2023 07:43:54 +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 AM2PEPF0001C716.mail.protection.outlook.com (10.167.16.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6792.20 via Frontend Transport; Fri, 22 Sep 2023 07:43:54 +0000 Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESSMB505.ericsson.se (153.88.183.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.32; Fri, 22 Sep 2023 09:43:53 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.188) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 22 Sep 2023 09:43:53 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 776FD1C006A; Fri, 22 Sep 2023 09:43:53 +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 v4 0/3] Add dispatcher library Date: Fri, 22 Sep 2023 09:38:22 +0200 Message-ID: <20230922073825.351453-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230904130313.327809-2-mattias.ronnblom@ericsson.com> References: <20230904130313.327809-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: AM2PEPF0001C716:EE_|PA4PR07MB7469:EE_ X-MS-Office365-Filtering-Correlation-Id: 89d4f035-b802-4bf6-3531-08dbbb3fabc0 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: 8Yh/TnyDJUD3fcaWyp+gaa0r6qhM/tKJ+bOyKPC+lc+wEY/pp7Sf5vKi+1Vf7RJWRupNpNNyPzK5YUmyMSN1SDHu6G6us/XuOX36fKRCvCBr1zDddm3mvnjGUyfgVH7t00i/huATN/zwnnOzEeYZ0fODTZR/gfYfQCCetjAYMN8UVXlJqzjbZ/Xffb7frZ19oS1zfAGxuIgaxfxCnP2qo6ToMP+3WytMcS8NHh+hGvMy8nPED77bxbIVUz+PEqw/YUVEh93Va05+GbGzR29IvLDPbPVdu1DT406x6rjHsHB0ScoaD9Y3B+DkiQUEcwVQUH5LqOFhJgqeXNpG5CN3DmGmeQQ3T4f/WQ6VqSpbxuN03LG799PjvczxOnXAv28yzrRU5iFWx5YHwsjgIY7TgGrRrkJPmc1qt3/fXNS684abl+rxJPZMxVWKFlJveq4D12WZ73Qb7PPwGoJLRYWLClacKeKsr67/KRS8SYAkizf/C9SLoYdVooR2PqYZq+Dlq2nwvAAas/OmjQ5GVkPOHIRIE8I/sQ1RhaAeTvlHTBVBQy3bkv7ZBIY9D8KseDZpdgNXABs6gm5THF26Hpp35/9SV3vrx78Ty9azWu/+dA+0YB1PWviKBGL6yYBvdnkkRYJdezeaE0n1CmZwigMux+Q6o3bF5ik934N/hpwxpSyFSkfvasaPbGjwfjuRdDKfmvToCwFjBk5TYXQvzquKZQ9W7vCn9ZTzgOF3p8OqgsYvFOzx7SoQ/AneMBRemcxLnIVf24Aw41j+PwZIoPEwSq8aiHriI4CsXPR1hL1POf8OL+tA60yz9+GfJNwtW5IJ4U38EIudeWzD4Wj2DjUXLQ== 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)(346002)(376002)(136003)(39860400002)(82310400011)(230921699003)(186009)(1800799009)(451199024)(40470700004)(36840700001)(46966006)(26005)(4326008)(40460700003)(7416002)(478600001)(2616005)(83380400001)(8676002)(36860700001)(6916009)(336012)(41300700001)(107886003)(6266002)(1076003)(47076005)(316002)(54906003)(70206006)(5660300002)(8936002)(2906002)(66574015)(82740400003)(6666004)(70586007)(86362001)(36756003)(356005)(82960400001)(40480700001)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 07:43:54.1266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89d4f035-b802-4bf6-3531-08dbbb3fabc0 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: AM2PEPF0001C716.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB7469 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 | 5 + app/test/meson.build | 1 + app/test/test_dispatcher.c | 1054 ++++++++++++++++++++++ doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + doc/guides/prog_guide/dispatcher_lib.rst | 434 +++++++++ doc/guides/prog_guide/index.rst | 1 + lib/dispatcher/meson.build | 17 + lib/dispatcher/rte_dispatcher.c | 798 ++++++++++++++++ lib/dispatcher/rte_dispatcher.h | 484 ++++++++++ lib/dispatcher/version.map | 20 + lib/meson.build | 2 + 12 files changed, 2818 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