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 74F0C424F0;
	Mon,  4 Sep 2023 15:09:00 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 542CD402BC;
	Mon,  4 Sep 2023 15:09:00 +0200 (CEST)
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2049.outbound.protection.outlook.com [40.107.247.49])
 by mails.dpdk.org (Postfix) with ESMTP id 75B2D400EF;
 Mon,  4 Sep 2023 15:08:59 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fnhL3uhwqwwQAkxUjC0sc4u7m+05X3bamQCPxiVAohHBcpNS5UbR3G5KwK2HR02kFBx+S8isLwVdKEkN/0qU8uX5aQTPgLNlGNnh6CQNFs9XRpYFsC9Aeepdy+Pbo9kNc3hIYoHZHrfrBP0ZASJuJrPCggjmxax4KKt88tmj4lER6GmpSxr/dWwH+ULp3wLLjnlW9Ce7Iguv7LsjoHkNnXOPhg+dlZoFetoq4OTXStkaK7P+hz3eGtIKjfUME3ukCmEDKaX6N+4GcdPKvUt0R9cP0GrTeSVGc99P5/QIV7hfh3mLGprCasXB1x43RlfLmJyLWjG9d8jQgVXB8bYFDA==
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=p538qCXrpfbd8cixt2++Puh0P5E4UMn9nx18rab+gAI=;
 b=jcfWGJ+rqyrLEsVBS2ASDkHtBa0TkjaNzz8/s5ViNzbFLQOyYLlya4a5xYmqCRTX1ptx6na8UUHckD7du2GGpPM3Ttv+5bX14HDLnOVvnUOFqV7VMwhQKO0FONGHr8ZAH3H1CMW07P8mOeXNW6i1DLEwftfK4zuPr3L/6PoFSTw7bE/rmOiL91OMnDwWC5D/0idUgmgS+osKGyDPmLKwp2eTy8E3GBQH3ojill0ExRSIJn3AAXyK3tG8Y9TIkmE/gP0E/UbNkdAuTjh5x80Y6PYw6w6nUxRjqhJm57QEwAMKJWqNAR+RqNdVaDnI1o0kkk2lGV2YeJCw6V/oNGw2Cw==
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=p538qCXrpfbd8cixt2++Puh0P5E4UMn9nx18rab+gAI=;
 b=ee2XrxW9+YhQDAoIDTKCBbgUvjz/aA1XUF1h60MZHmRct4x53VEpW9QiFHXX6H/nPsWrFoMMgRAxxtzll/SaRQWq/EMgipepqIYssmw20NuCqeRqjrBocP/w4R+MDTkJ3pTixz/tlzPc2YE5Zk3RVfdW2l9cUiRBQum48iFkh8Q=
Received: from AS9PR05CA0247.eurprd05.prod.outlook.com (2603:10a6:20b:493::11)
 by AM0PR07MB6276.eurprd07.prod.outlook.com (2603:10a6:20b:15c::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.32; Mon, 4 Sep
 2023 13:08:58 +0000
Received: from AM4PEPF00027A69.eurprd04.prod.outlook.com
 (2603:10a6:20b:493:cafe::77) by AS9PR05CA0247.outlook.office365.com
 (2603:10a6:20b:493::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.32 via Frontend
 Transport; Mon, 4 Sep 2023 13:08:58 +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
 AM4PEPF00027A69.mail.protection.outlook.com (10.167.16.87) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id
 15.20.6768.25 via Frontend Transport; Mon, 4 Sep 2023 13:08:58 +0000
Received: from ESESSMB503.ericsson.se (153.88.183.164) by
 ESESSMB504.ericsson.se (153.88.183.192) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id
 15.1.2507.32; Mon, 4 Sep 2023 15:08:57 +0200
Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by
 smtp.internal.ericsson.com (153.88.183.191) with Microsoft SMTP Server id
 15.1.2507.32 via Frontend Transport; Mon, 4 Sep 2023 15:08:57 +0200
Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])
 by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id
 3FC7C380061; Mon,  4 Sep 2023 15:08:57 +0200 (CEST)
From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>
To: <dev@dpdk.org>
CC: Jerin Jacob <jerinj@marvell.com>, <techboard@dpdk.org>,
 <harry.van.haaren@intel.com>, <hofors@lysator.liu.se>, Peter Nilsson
 <peter.j.nilsson@ericsson.com>, Heng Wang <heng.wang@ericsson.com>, "Naga
 Harish K S V" <s.v.naga.harish.k@intel.com>, Pavan Nikhilesh
 <pbhagavatula@marvell.com>, Gujjar Abhinandan S
 <abhinandan.gujjar@intel.com>, Erik Gabriel Carrillo
 <erik.g.carrillo@intel.com>, Shijith Thotton <sthotton@marvell.com>, "Hemant
 Agrawal" <hemant.agrawal@nxp.com>, Sachin Saxena <sachin.saxena@oss.nxp.com>, 
 Liang Ma <liangma@liangbit.com>, Peter Mccarthy <peter.mccarthy@intel.com>,
 Zhirun Yan <zhirun.yan@intel.com>, =?UTF-8?q?Mattias=20R=C3=B6nnblom?=
 <mattias.ronnblom@ericsson.com>
Subject: [PATCH v3 0/3] Add dispatcher library
Date: Mon, 4 Sep 2023 15:03:10 +0200
Message-ID: <20230904130313.327809-1-mattias.ronnblom@ericsson.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230616074041.159675-2-mattias.ronnblom@ericsson.com>
References: <20230616074041.159675-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: AM4PEPF00027A69:EE_|AM0PR07MB6276:EE_
X-MS-Office365-Filtering-Correlation-Id: e33713e2-cb95-46d8-ea19-08dbad4819c3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: 2xfFjRiwzksiTdyrz5OoKE7kVMsgHfGc76D4oz2CHPMfXqRTaw5npqeIdfVeSWmhtGa2Iyl70738yQSWk6mwYZUgaIOScuxv5MVZt1KuMSm8aYlq+uGX4TfBDqBml+9NPATupDvfNnQKwr87q3vQDCyoeS/2qWd3K75VRn/Fali1K9DsffbuhugGqaf1ClMJH6hT33cDnC5aeIYcDlUqg0C2NG8iAh2NF89VLhMKV50mtPiPr76Hg0IXZHXgc3NV1fj8RzEgjD3VV4CpyYIpW/7RR/W/LLSJV9VSohooWgQOWDM+hcWXA3JoERfw5Yj44Sa2eHgiTq2CxRyMizRVdmDp0RI2c+vvUU4knf3bZbeuAMJVPonar3vtx1FEfNI7/SZm7FJK+xr1a+xTQDWmOq64H4WZi68rEv4VfX8SnyUkyEFuYJFkSz0GKicUSkFWpdyETecfGr/65e5DBMxfohyOAl2M5iCR/zXghDb3uHHAybSjheg5O7ArrX/vAnUvJX8Tyt267vnV1h7s9/IhjmX2xS+2N2hBSzPfbcImD/4dspyrsG7JR0EiAV2MG/9bkf+jJAhuufTFr0LlNNeI+4WXl4q9KMnKQbpw9MCPdlsx+10n9XlV1PQxw1hCO50jhTyeDiJI2/DRyzDVxmCFxEVuZaqMMWVcef2THVqoaIEeJBGWzRDfteaOL9ECoeC1d7Lpl6DWhRHZMKt5Q0d12U/dId2EZb8wuU1fZf0IxTuNEdIIcckdfcgqFZMtMV4+hFboknrMMQFQayzx663CTMc9H5B3XWTmc3iyvht7biM=
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)(451199024)(186009)(1800799009)(82310400011)(46966006)(36840700001)(40470700004)(6916009)(2906002)(36756003)(86362001)(54906003)(316002)(70206006)(70586007)(40480700001)(5660300002)(8676002)(4326008)(8936002)(41300700001)(40460700003)(107886003)(47076005)(66574015)(336012)(2616005)(83380400001)(26005)(1076003)(6266002)(36860700001)(7416002)(478600001)(356005)(7636003)(82740400003)(6666004)(82960400001);
 DIR:OUT; SFP:1101; 
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2023 13:08:58.4108 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e33713e2-cb95-46d8-ea19-08dbad4819c3
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: AM4PEPF00027A69.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB6276
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 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          |  791 ++++++++++++++++
 lib/dispatcher/rte_dispatcher.h          |  480 ++++++++++
 lib/dispatcher/version.map               |   20 +
 lib/meson.build                          |    2 +
 12 files changed, 2807 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