From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <dsosnowski@nvidia.com>, <rasland@nvidia.com>
Subject: [PATCH 0/4] [25.11] net/mlx5: add driver event and steering toggle APIs
Date: Tue, 26 Aug 2025 14:45:51 +0300 [thread overview]
Message-ID: <20250826114556.10068-1-mkashani@nvidia.com> (raw)
mlx5 PMD is a bifurcated driver, which means that instead of communicating with HW directly
using UIO or VFIO, the driver uses existing kernel and userspace APIs for that purpose.
mlx5 PMD requires that `mlx5_core`, `mlx5_ib` and `ib_uverbs` kernel modules are loaded,
and that NIC is bound to `mlx5_core` driver.
Kernel bypass is achieved through rdma-core library
which exposes required functionalities e.g.,
mapping memory to the device, FW access for setting up Rx and Tx queues
(through mlx5dv_devx_* interfaces) and flow rule offloading.
One benefit of such architecture is that it allows libraries and applications
to build additional features on top of DPDK, utilizing rdma-core directly.
For example it is possible to implement additional flow rule offloads.
This can be achieved by creating an IBV (IB Verbs) context and PD (protection domain)
through rdma-core and sharing it with mlx5 PMD through `cmd_fd` and `pd_handle` device arguments
provided during probing [1].
mlx5 PMD will then create all necessary resources for DPDK using imported context and PD.
What is missing for that approach to work, is that
external libraries and applications are not aware of HW identifiers of Rx and Tx queues
(returned from mlx5dv_devx_* APIs) created by DPDK through imported context and PD.
Knowledge of these identifiers is crucial for correct flow rule offload.
This patchset proposes the introduction of the following private PMD APIs
to address the above use case:
1. mlx5 PMD driver events
2. mlx5 PMD steering toggle
mlx5 PMD driver events, exposed through `rte_pmd_mlx5_driver_event_cb_register/unregister()` functions,
allow libraries and applications to register a custom callback.
This callback will be called whenever mlx5 PMD creates or destroys an Rx/Tx queue.
All necessary HW identifiers along with corresponding DPDK port and queue
indexes will be passed as parameters.
mlx5 PMD steering toggle, exposed through `rte_pmd_mlx5_driver_disable/enable_steering()` functions,
allow libraries and applications to disable/enable flow rule offloading provided by mlx5 PMD.
This is added to support use cases where library/application needs full control of flow rule offloading.
Library/application will use data provided through driver events API to configure flow rules by itself.
When flow rule offloading is disabled, DPDK flow API will return ENOSYS for mlx5 PMD.
Patches:
- Patch 1 - Add mlx5 PMD driver events private API
- Patches 2-3 - Minor clean ups in mlx5 PMD which make introduction of
steering toggle private API easier.
- Patch 4 - Add mlx5 PMD steering toggle private API
[1]: https://doc.dpdk.org/guides/platform/mlx5.html#device-arguments
Dariusz Sosnowski (4):
net/mlx5: add driver event callbacks
net/mlx5: move eCPRI release function to flex
net/mlx5: rework Rx queue mark flag functions
net/mlx5: add steering toggle API
drivers/net/mlx5/meson.build | 1 +
drivers/net/mlx5/mlx5.c | 18 --
drivers/net/mlx5/mlx5.h | 1 +
drivers/net/mlx5/mlx5_devx.c | 17 ++
drivers/net/mlx5/mlx5_driver_event.c | 300 +++++++++++++++++++++++++++
drivers/net/mlx5/mlx5_driver_event.h | 18 ++
drivers/net/mlx5/mlx5_flow.c | 199 +++++++++++++++++-
drivers/net/mlx5/mlx5_flow.h | 7 +-
drivers/net/mlx5/mlx5_flow_flex.c | 18 ++
drivers/net/mlx5/mlx5_trigger.c | 30 +++
drivers/net/mlx5/rte_pmd_mlx5.h | 192 +++++++++++++++++
11 files changed, 772 insertions(+), 29 deletions(-)
create mode 100644 drivers/net/mlx5/mlx5_driver_event.c
create mode 100644 drivers/net/mlx5/mlx5_driver_event.h
--
2.21.0
next reply other threads:[~2025-08-26 11:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 11:45 Maayan Kashani [this message]
2025-08-26 11:45 ` [PATCH 1/4] net/mlx5: add driver event callbacks Maayan Kashani
2025-08-26 11:45 ` [PATCH 2/4] net/mlx5: move eCPRI release function to flex Maayan Kashani
2025-08-26 11:45 ` [PATCH 3/4] net/mlx5: rework Rx queue mark flag functions Maayan Kashani
2025-08-26 11:45 ` [PATCH 4/4] net/mlx5: add steering toggle API Maayan Kashani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250826114556.10068-1-mkashani@nvidia.com \
--to=mkashani@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=rasland@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).