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 A8A2642C6A; Fri, 9 Jun 2023 09:15:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89D1040EDB; Fri, 9 Jun 2023 09:15:08 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2070.outbound.protection.outlook.com [40.107.20.70]) by mails.dpdk.org (Postfix) with ESMTP id 2FC4F40A84 for ; Fri, 9 Jun 2023 09:15:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=maBCfkCok2xtoqfJ/pAdxGhLlAdkjDR1UM3FiRMJdnK9CpC5iTdlpKfvtMbWPqJoZH4KQiLhfjYA9BpDsqupJY0+wBevUewAHLCMQKJ/LhAEFyuwXyJD1iVkTsyb542yIArvlg5GuKkg1uHIet95Zcg//J7mpQLJXn7NcIp7ofKSGgBuHfUCwh5DSeZVfEJh81zkjOH0XQPVFxeVI1Sl9reTdAzleACFrSHWxHYWEFHA87UgPyWhRs9xOjEQEaIRPWpnROfB8scXBUQEjbMm2t2MkO+ctAOSPtgq1TuvptsgGiJrwSIGm4XV1QpWNUB1FGngAlCFc9mhQFJUZlJC8g== 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=uAkeaRIcT+HULz2cG/yzM3HEIL6PsPPh7TvKLMe/dGY=; b=A+85CNLLvVHsnVYE7+tqTxhTuWZfzeaNgfCRQREr0LYX/2iGX9/UgGXE1SlqE8lfKck0scGgTgiMK2znMr97zOiEYkuGqNqhy2WtQUOHyexHk+FoFmehCA3ms2cMGAkViFDC2GMTwC1oTn30rPs9SMpIiYkIy+HGTaRLWsR11z3mu/hbOY0sjqe8mipX3jbpBThVDNw7cJ3JnlkbF50dN28yhRYeLELICJPY/EwuverR/GzW3swjBAr32BjdSG1B65LzunNbmAYmsRNpAyE2fwB5s1OiMecyo5ozwE4qX6JFQ+mbr8pGG4ShF3pI599DHl8O96VlEF63+NnNiLYLnQ== 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=uAkeaRIcT+HULz2cG/yzM3HEIL6PsPPh7TvKLMe/dGY=; b=KOJ/CbbPNtDpUqYgSIPAYmJKPqreTBlDrVFWYPtLZM7oT4U0K8xHM+TMlcSz8Qog2/MPbapnmZxUl/Hbl9v9QE7UttQu9qiqDeg+dDm06EKrPgVbDr26XMnfWjt3wjCRBYvh4efVK9SB0D3bn8sHft0ya/kuMwBL+CcJzq72L+c= Received: from FR0P281CA0062.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::23) by DB8PR07MB6315.eurprd07.prod.outlook.com (2603:10a6:10:141::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.38; Fri, 9 Jun 2023 07:15:05 +0000 Received: from VI1EUR02FT007.eop-EUR02.prod.protection.outlook.com (2603:10a6:d10:49:cafe::61) by FR0P281CA0062.outlook.office365.com (2603:10a6:d10:49::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.14 via Frontend Transport; Fri, 9 Jun 2023 07:15:04 +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 VI1EUR02FT007.mail.protection.outlook.com (10.13.60.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6477.26 via Frontend Transport; Fri, 9 Jun 2023 07:15:05 +0000 Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESSMB501.ericsson.se (153.88.183.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 9 Jun 2023 09:15:04 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.187) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 9 Jun 2023 09:15:04 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id CB1A91C006A; Fri, 9 Jun 2023 09:15:04 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: Jerin Jacob , , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [RFC v4 0/3] Add event dispatcher Date: Fri, 9 Jun 2023 09:08:23 +0200 Message-ID: <20230609070826.149336-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522091628.96236-2-mattias.ronnblom@ericsson.com> References: <20230522091628.96236-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: VI1EUR02FT007:EE_|DB8PR07MB6315:EE_ X-MS-Office365-Filtering-Correlation-Id: 229a9080-5d8b-4547-0309-08db68b94007 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ujm/riSHC+BJ43f1/Xj23Eq7XkMR5sbAMtfXim+y0bEibU0W4b2V7s2diBNddwQghgxsSAvip67sm1p3fzUV+QVzML4Toam6gx8ZxxoWEbUc/2e8zNjfc+SGCf3rouhzPWZGv+76j/sSqsDjZVA2AYFAAKL0hW8OUrxHJphaxuGdWx3AjwHnAJVRhZn0i2JOjTQwmJkQ8/A7JBhbLFjRJXbWRH+/vn4I9D1lc7qIxldHtFEBgWR1OFRA3Arv6MhMFzR3u/53TdZpuwmAr5OCsd993G5mEMvbx9ueGRHEYOdOc/v9hVCmsalTefi/pZZgrhX39jyRsaJx22d1ygsfoBvYAb1MFFj2hUHlVpHWdETZb4RgG73glWw8XXbSaskfCspVnLWq/vWUHgjDZTOhF03DevfSDHewxYhShO5rXqnF9Kjqc5jq9dFXa2nYXiRzSi09PaZuCeg4GlVDJvWfwTfr/2UQz7ztYVrbtFA7MqDjCIcmVquoNC0lnk2ipSO7qK4kuZA3X8WjisYP8Y113uRVbYAMzR0eLyCRWCEC0nFSpvu1HAe4mm83jYKfQu+kVPGszUa4a8DZuDwVWha9qKWRrM75lwR0c+mkw0XJ4nETfbzZIuHBw7baKeMX/2v5shxbkeLf95h7stTGGS/vMqNeEahlIPMwqQQzkI8zw2zmm/nUorJtsAlCj17G+cZKkAECRGJhCo1KXWH0e6v9L5vaugv8U0MgIpvRdyBd1n14/DiAxyyMv5VMXkpbrzmxPfWmjS/kQ1j0fmj2wxIMjicaPG5Mm5H17dKg56febY0= 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:(13230028)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(2616005)(6266002)(478600001)(186003)(86362001)(66574015)(47076005)(336012)(36860700001)(26005)(1076003)(107886003)(40460700003)(316002)(36756003)(4326008)(70586007)(70206006)(6916009)(82960400001)(5660300002)(82740400003)(7636003)(356005)(6666004)(40480700001)(41300700001)(8676002)(82310400005)(8936002)(2906002)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2023 07:15:05.4247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 229a9080-5d8b-4547-0309-08db68b94007 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: VI1EUR02FT007.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR07MB6315 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 event dispatcher is to decouple different parts of an application (e.g., processing pipeline stages), sharing the same underlying event device. The event 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 event dispatcher relies on application-supplied matching callback functions to decide where to deliver events. An event 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 event 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 event dispatcher adds some overhead, experience suggests that the net effect on the application (both syntetic 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 active handlers. The event dispatcher does not support runtime reconfiguration. Outstanding questions: o Consider adding possibility to express simple match functions (e..queue_id == 7) without a match callback. o Consider allowing the application setting the process callback to NULL, signalling to the dispatcher that processing will occur already at the time of the match call. May provide some slight performance benefits for applications where the average number of events supplied per process function call is very small. Mattias Rönnblom (3): eventdev: introduce event dispatcher test: add event dispatcher test suite doc: add event dispatcher programming guide app/test/meson.build | 1 + app/test/test_event_dispatcher.c | 814 +++++++++++++++++++++ doc/api/doxy-api-index.md | 1 + doc/guides/prog_guide/event_dispatcher.rst | 443 +++++++++++ doc/guides/prog_guide/index.rst | 1 + lib/eventdev/meson.build | 2 + lib/eventdev/rte_event_dispatcher.c | 770 +++++++++++++++++++ lib/eventdev/rte_event_dispatcher.h | 448 ++++++++++++ lib/eventdev/version.map | 13 + 9 files changed, 2493 insertions(+) create mode 100644 app/test/test_event_dispatcher.c create mode 100644 doc/guides/prog_guide/event_dispatcher.rst create mode 100644 lib/eventdev/rte_event_dispatcher.c create mode 100644 lib/eventdev/rte_event_dispatcher.h -- 2.34.1