From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E69C342CBC;
	Wed, 14 Jun 2023 19:31:47 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id BCA9D40FDF;
	Wed, 14 Jun 2023 19:31:47 +0200 (CEST)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2069.outbound.protection.outlook.com [40.107.20.69])
 by mails.dpdk.org (Postfix) with ESMTP id B9A9F40E0F
 for <dev@dpdk.org>; Wed, 14 Jun 2023 19:31:46 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZDkmHS2CO6ucBMXuDTPpO38QPovyy0LehboE+CL7wAEnw0BKyDYwG62hSMimQSEpB7/BpTYbDBTxvvyYxxUmdlk28s2wmV3NvDqlx/FbXMYmurtOnshMqiT3+U9kC9E4If2oseAp4NTSnv5dJ8xesTaGfeZ2y9t2e1iu0Uw/YglLcGGklvgHXjSbaiZKcQ9GQmgg6hbqurSvHfz8QI/kOyJCxxIL4stnljGSAObxTy8ClwFuk+Vrx2sBJQx77XpzCyiqDCSVNEHaOLiDHzYJcMvA2F4C3LgFxiN97xV14pHBG50K/I4AvqNkLmkx+Pic71WXl5OH/JdqeE7DJW7NjA==
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=Os0cMe+L3xRGQ73A10JEib478Bmqeg8CXSI98+Yk9uA=;
 b=awQU5Dvfjs6G+kM6a1lwS9ap68zaWzx8hAhuJbaS2+5Kh+Vwh0NPYeh8vtW87KQXHU7MEb3TJ4S0CwPQvxbvRWt6KNPNVJN924LxJLyVyfBVjkRvMh+nK6cKw33IXf7BtDA+lToTPnDHLahrhPaZNk0OfB0OT+2OoKgYdDCl4amtvWLtQcqeCy1X+JTRw2NOZVRgqByk7Rke7RgF5i3rPuNSohcZm1qb+Xj5UtgUaHMOee5qNHJIxdXR2mRErOQZwSucrK0LUGKqAJTT1tqGgNVbhIUU42nQH231kDmUrlMqy1mwbaZUH/xTzJLD8JW4lPK+zCH0dLDD1a0DFv6Yjw==
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=Os0cMe+L3xRGQ73A10JEib478Bmqeg8CXSI98+Yk9uA=;
 b=C53SaHg3OZOv2m6qNcH0JnF4DGY1ssJrf3k/TGoEK+RdJCSyMR4bY62GypL98+GbsP2KlWBBKQ1srk+xzg2fADVXJWb3lqICzRlqCvMNfI4l3G8ON0g8gHXBSA0npfDifoP/s5mpH7TFlkiA3DFah3fGmSkBTzCg34Q+Rl8oabc=
Received: from FR2P281CA0063.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:93::19)
 by AM8PR07MB8247.eurprd07.prod.outlook.com (2603:10a6:20b:326::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.29; Wed, 14 Jun
 2023 17:31:45 +0000
Received: from VI1EUR02FT033.eop-EUR02.prod.protection.outlook.com
 (2603:10a6:d10:93:cafe::dc) by FR2P281CA0063.outlook.office365.com
 (2603:10a6:d10:93::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25 via Frontend
 Transport; Wed, 14 Jun 2023 17:31:45 +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
 VI1EUR02FT033.mail.protection.outlook.com (10.13.61.54) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id
 15.20.6500.25 via Frontend Transport; Wed, 14 Jun 2023 17:31:44 +0000
Received: from ESESSMB502.ericsson.se (153.88.183.163) by
 ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id
 15.1.2507.23; Wed, 14 Jun 2023 19:31:42 +0200
Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by
 smtp.internal.ericsson.com (153.88.183.190) with Microsoft SMTP Server id
 15.1.2507.23 via Frontend Transport; Wed, 14 Jun 2023 19:31:42 +0200
Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])
 by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id
 BFD411C006A; Wed, 14 Jun 2023 19:31:42 +0200 (CEST)
From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>
To: <jerinj@marvell.com>
CC: Jerin Jacob <jerinjacobk@gmail.com>, <hofors@lysator.liu.se>,
 <dev@dpdk.org>, <harry.van.haaren@intel.com>, <peter.j.nilsson@ericsson.com>, 
 Stephen Hemminger <stephen@networkplumber.org>, Heng Wang
 <heng.wang@ericsson.com>, =?UTF-8?q?Mattias=20R=C3=B6nnblom?=
 <mattias.ronnblom@ericsson.com>
Subject: [PATCH 0/3] Add event dispatcher
Date: Wed, 14 Jun 2023 19:25:24 +0200
Message-ID: <20230614172527.157664-1-mattias.ronnblom@ericsson.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230609070826.149336-2-mattias.ronnblom@ericsson.com>
References: <20230609070826.149336-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: VI1EUR02FT033:EE_|AM8PR07MB8247:EE_
X-MS-Office365-Filtering-Correlation-Id: 50fe44cb-675d-4721-efb2-08db6cfd3955
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: ygdP5Hm9gawcqDeaxzyu0qw9jHPV0G/COlMw3ctfSe/8kG29VRzK2c5AgRDDWmtaWJZAiKJkGa9bzCY+szN9Ecr/R6W/Ejc36FKemoJlKvRLu+kVOe6JSb9163zbJZPUcgnRgsRP0/iQdo+e2yMsBHzI3hsGv+xpRcZ4026aWQ6u35YL4XovzEI6lqCcZ8EUaMnAg6h4n8Kc8NjtB1230M7fGH8Zd+E/LmdHfVXTsjHKjTi3IRxSOY+5pVU76py8QRAgBtKax6ZcY0J/0KxuRG+RugauXwrILose2SgwYo5mE3Jlv96xGcIBTlYzF7TlOfQYglUiVrqQgPdCOA3jEHa7KIqauiBY7D7/DxDXjQUWG3m2t517FAlMx3buFaRCCs8X9ub7bEbcinfgrtygnsxv0dKxQ2tZw9rdWEwtDucUEUYDws6Nzo8OaTvjGCykIaxDJI3JHoSdayQHElFZRObR39kgnARQNiOVwIhLE/5o95hv34RVCt6eLLvcX4iDSJgAu54DamLkaJH8fVVujspk/5nZG0h9Xq4pHvXi6RAuXQ3WWPUVtgbOgQaxPPR+OJuG1TbWwB6wMREzZk8sHZVPKoziA6l0LfWOjAF2GDNEgcPXx+HjNx7xlv2BNqm1GgSyETlfJ1mVQISP3Er6nmIRy8k0Z8d5+16xPJzrxgyG9S3WY5fHGoPWS68306uNfZhvHTbiEUo6zoMSEP71eK3Jmk5Mxd3Oqx0Thjre3XjgQQAr+Wnexn0BtHSO/5RAQjBCiLA/2OgEy0eEvn7lfDRO4R8nRaDn/lxyQEFkLp4=
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)(39860400002)(346002)(451199021)(36840700001)(46966006)(40470700004)(26005)(1076003)(356005)(7636003)(82960400001)(82740400003)(107886003)(2616005)(36756003)(40460700003)(6266002)(86362001)(186003)(40480700001)(82310400005)(36860700001)(66574015)(47076005)(5660300002)(6666004)(2906002)(54906003)(41300700001)(478600001)(8676002)(8936002)(4326008)(6916009)(70206006)(70586007)(316002)(336012);
 DIR:OUT; SFP:1101; 
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2023 17:31:44.6734 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 50fe44cb-675d-4721-efb2-08db6cfd3955
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: VI1EUR02FT033.eop-EUR02.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8247
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=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 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 active handlers.

The event dispatcher does not support run-time reconfiguration.

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           | 861 +++++++++++++++++++++
 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, 2540 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