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 6A98742364;
	Thu, 12 Oct 2023 10:55:54 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 1DF99402AE;
	Thu, 12 Oct 2023 10:55:54 +0200 (CEST)
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on2050.outbound.protection.outlook.com [40.107.15.50])
 by mails.dpdk.org (Postfix) with ESMTP id 3AC1C4028C;
 Thu, 12 Oct 2023 10:55:52 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ckXmIhXR0yxTHlQHEq+7K8DRCgW1RKbpGc8IRh08oytkXVEF6ygGuPnc7bq1R7mhT6p6IMc2Wah2lNvMFwjrhcAugUFQvUhavWBgCeirmxSfaSplyV+lZ8blm8hH7c1ZwbYfWs6CKghM34IptojJBpNPs5Tf57m0N+GNBS2pP90kzLyHKWVxQCk49tK3f6pyhhLy9I4AQG8m0KMTrAqjPXh/Df1vNroyDF5+1qd/hVZe/p/FAdIdxXb0r2cNruFTzU5raTZy6XYbMGEv6YmYpwIB5a5wOa/Jq9umJt2ieRoh0fjSKVC/JqOhG5MnURdINfM85E+ZvV/OxCXaf5gAmw==
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=06Rel3GTsX6LvoCNRR8W34f6KLzrlD5c/TZaJZ+ku0s=;
 b=jNgYLhA3/FNQvdsKjxpjiLdbsSPfEp7Hvxoa/Z3etCNuCEaX8kAU/Bib2zkeA9ZSHgWeIdTVLhyY9XK8madtWMG3dG+iGa+XsbU3il0Yew2vnBQaqah2aR0q09VfQREeVdWERg8ztLrLIpsQJ6UjZ+/E/y6fvgBJQbIle2nmjUojdciX2ECNe5Q/mq54zJhwURhk7rvNBzqRMmBblwlZNS8X/78MYQ4XuhzOwlF4u4qAbJQNoQs5zBiSjjBnaMPrQQlpptX39ylESZgkEMshtK1GKQCIkgFqThYuLcOOZ2UqTUmwa5zKecA1C6n8mG3fQktGhitaMhjL677Fs81W8g==
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=06Rel3GTsX6LvoCNRR8W34f6KLzrlD5c/TZaJZ+ku0s=;
 b=qPb38Bv4VFaJUnvFRnY+2igV5Eh1HWPwTp/9g+hZ2dUjicaQk9Fh3/+n1CN7JOvGAB4EBEkKSpOJiKurKTj/5guntzRPXa+Z2D4M9Jiw4YjcSK3qzO9gBTUK8sj6CRG/OIaQvK2zNsheYeWdPenKG0BB9Fgmb+ujvhU6DKo40qc=
Received: from AM6P195CA0019.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::32)
 by PAWPR07MB9950.eurprd07.prod.outlook.com (2603:10a6:102:38e::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.43; Thu, 12 Oct
 2023 08:55:50 +0000
Received: from AMS0EPF00000197.eurprd05.prod.outlook.com
 (2603:10a6:209:81:cafe::65) by AM6P195CA0019.outlook.office365.com
 (2603:10a6:209:81::32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.29 via Frontend
 Transport; Thu, 12 Oct 2023 08:55:50 +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
 AMS0EPF00000197.mail.protection.outlook.com (10.167.16.219) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id
 15.20.6838.22 via Frontend Transport; Thu, 12 Oct 2023 08:55:50 +0000
Received: from SESSMR604.ericsson.se (100.87.178.32) by ESESSMB503.ericsson.se
 (153.88.183.191) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.32; Thu, 12
 Oct 2023 10:55:49 +0200
Received: from ESESSMB505.ericsson.se (153.88.183.42) by SESSMR604.ericsson.se
 (100.87.178.96) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.2.1118.26; Thu, 12 Oct
 2023 10:55:49 +0200
Received: from seliicinfr00049.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; Thu, 12 Oct 2023 10:55:48 +0200
Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])
 by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id
 28A9E380061; Thu, 12 Oct 2023 10:55:49 +0200 (CEST)
From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>
To: <dev@dpdk.org>, <david.marchand@redhat.com>
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 v8 0/3] Add dispatcher library
Date: Thu, 12 Oct 2023 10:50:28 +0200
Message-ID: <20231012085031.444483-1-mattias.ronnblom@ericsson.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20231011071700.442795-2-mattias.ronnblom@ericsson.com>
References: <20231011071700.442795-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: AMS0EPF00000197:EE_|PAWPR07MB9950:EE_
X-MS-Office365-Filtering-Correlation-Id: db666476-6081-48d0-c921-08dbcb0108a4
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: GwXkAfPsKoT9W39veNcF6/WL5ZBzal17DqVV2Rp+44lDuiuSRh1Q95ySZYf+NI2rUhnKpVd7ZNJvuhAq6OqHAIrwNXhh2YCM08iPm/eMXGA1LeIwkuBZ2B1bZine+LvVrnb3HY6Y913wrGBRf85Eu1xEGt8PdSjcxFuzviMqOTh4kPjwgPlaM5pyt9ImWVS6mN6UH8SymhZifzQRpOvA4/ROh0ZCjnmGykOtSbcSKO8ZS4nPVz9xulneyMn6Go6JzvVcltjIZEQGAFtol/ANY/JuaaHhVUOPcwdHFm5z1gISkEvjv4RimU26lTqV1LRT4IA25ymtglyxAmQN0QNe7t3O5GwGUhHkdfhcpUFxywD+s73ffLOddo4OD7VAOQp0nOcwmYlQTHXPVC5xaSgnKd73hhwENsVEbLDP2Bg8biuqCjwcU+AycF9B+C76GU71TzSpqOXMmeHuSOCfXoFZ4h4OYcDYDldCBlisEg3pJGu6AVNTkOkNXdVOIBScco2pvSRPbm6MfrWEGMztLWOaWXHqYHyYxHyMFN2fHy7mr41e2vuviY03kPY5uydQnRHCCImezuvqhtXIKa/DlIOrs631AZLeZBjIhDQ2ZDazVug+AGnCd9qBbrqVxEDrraM96V/fTlUF1JbNawJZzJcE1MeMISQljrs0pxklesL5lReuwlP20oI5dNVaqnj4bJuQS2Q25w4HQh1LcnOdr6i9x98iyrCCRnlUGVNxwmPTGVoUTzdLcII3gIBjZ9H9+LwbB7NP/uuZOGuB/DHuGOYeUR+ze3B8CDnqyO9Bf5JShmoBGr8KwAPr+Oybw6YQQ/AB7zwE82YlSrO9RaRt7xc3i09emgmmN1tizaN43+N/dSg=
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)(346002)(376002)(39860400002)(136003)(396003)(230922051799003)(82310400011)(64100799003)(451199024)(1800799009)(186009)(40470700004)(36840700001)(46966006)(40460700003)(107886003)(1076003)(2616005)(6666004)(82740400003)(7636003)(356005)(82960400001)(36756003)(86362001)(36860700001)(47076005)(26005)(6266002)(336012)(66574015)(40480700001)(83380400001)(7416002)(70586007)(70206006)(110136005)(54906003)(41300700001)(316002)(2906002)(8936002)(5660300002)(8676002)(4326008)(478600001)(2101003);
 DIR:OUT; SFP:1101; 
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 08:55:50.1917 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: db666476-6081-48d0-c921-08dbcb0108a4
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: AMS0EPF00000197.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR07MB9950
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                              |    6 +
 app/test/meson.build                     |    1 +
 app/test/test_dispatcher.c               | 1056 ++++++++++++++++++++++
 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          |  694 ++++++++++++++
 lib/dispatcher/rte_dispatcher.h          |  458 ++++++++++
 lib/dispatcher/version.map               |   20 +
 lib/meson.build                          |    2 +
 13 files changed, 2691 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