From: Raslan Darawsheh <rasland@nvidia.com>
To: Dariusz Sosnowski <dsosnowski@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH 0/9] net/mlx5: lazily allocate HWS actions
Date: Mon, 2 Mar 2026 13:22:22 +0200 [thread overview]
Message-ID: <4293b0b4-9f2f-4bab-840a-dbc05e95f95c@nvidia.com> (raw)
In-Reply-To: <20260225115918.233843-1-dsosnowski@nvidia.com>
Hi,
On 25/02/2026 1:59 PM, Dariusz Sosnowski wrote:
> In mlx5 PMD, HWS flow engine is configured either:
>
> - implicitly on port start or
> - explicitly on rte_flow_configure().
>
> As part of flow engine configuration, PMD allocates a set of global
> HWS action objects. These are used to implement flow actions such as:
>
> - DROP
> - MARK and FLAG (HWS tag action)
> - OF_PUSH_VLAN
> - OF_POP_VLAN
> - SEND_TO_KERNEL
> - NAT64
> - PORT_REPRESENTOR (HWS default miss action).
>
> These actions can be allocated once, for each flow domain,
> and parametrized on runtime.
> Allocation of these actions requires allocation of STCs,
> HW objects used to set up HW actions.
> These STCs are allocated in bulk to reduce amount of syscalls needed.
>
> In case of global actions listed above, these STCs were allocated always
> even if none of the related flow actions were used by the application.
> This caused unnecessary system memory usage which could reach 4 MB per port.
> On systems with multiple VFs/SFs, memory usage could reach couple of GBs.
>
> This patchset addresses that by introducing lazy allocation of these actions:
>
> - Patch 1 - Redefines mlx5dr_action_mh_pattern to use rte_be64_t instead of __be64.
> This is to prevent compilation issues when mlx5dr.h is included in new files.
> - Patch 2 - Add helpers for translating HWS flow table type to HWS action flags
> used on allocation to simplify logic added in follow up patches.
> - Patch 3 - Introduces dedicated internal interface for lazily allocating
> HWS actions. Drop action is handled first.
> - Patch 4-9 - Each patch adjusts one action type to use lazy allocation.
>
> Dariusz Sosnowski (9):
> net/mlx5: use DPDK be64 type in modify header pattern
> net/mlx5/hws: add table type to action flags conversion
> net/mlx5: lazily allocate drop HWS action
> net/mlx5: lazily allocate tag HWS action
> net/mlx5: lazily allocate HWS pop VLAN action
> net/mlx5: lazily allocate HWS push VLAN action
> net/mlx5: lazily allocate HWS send to kernel action
> net/mlx5: lazily allocate HWS NAT64 action
> net/mlx5: lazily allocate HWS default miss action
>
> drivers/net/mlx5/hws/mlx5dr.h | 19 +-
> drivers/net/mlx5/hws/mlx5dr_action.c | 26 +-
> drivers/net/mlx5/hws/mlx5dr_pat_arg.c | 20 +-
> drivers/net/mlx5/hws/mlx5dr_pat_arg.h | 8 +-
> drivers/net/mlx5/hws/mlx5dr_table.c | 75 +++
> drivers/net/mlx5/meson.build | 1 +
> drivers/net/mlx5/mlx5.h | 21 +-
> drivers/net/mlx5/mlx5_flow.h | 1 +
> drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
> drivers/net/mlx5/mlx5_flow_hw.c | 557 ++++++---------------
> drivers/net/mlx5/mlx5_hws_global_actions.c | 273 ++++++++++
> drivers/net/mlx5/mlx5_hws_global_actions.h | 71 +++
> 12 files changed, 611 insertions(+), 463 deletions(-)
> create mode 100644 drivers/net/mlx5/mlx5_hws_global_actions.c
> create mode 100644 drivers/net/mlx5/mlx5_hws_global_actions.h
>
> --
> 2.47.3
>
Series applied to next-net-mlx,
Kindest regards
Raslan Darawsheh
prev parent reply other threads:[~2026-03-02 11:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 11:59 [PATCH 0/9] net/mlx5: lazily allocate HWS actions Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 1/9] net/mlx5: use DPDK be64 type in modify header pattern Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 2/9] net/mlx5/hws: add table type to action flags conversion Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 3/9] net/mlx5: lazily allocate drop HWS action Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 4/9] net/mlx5: lazily allocate tag " Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 5/9] net/mlx5: lazily allocate HWS pop VLAN action Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 6/9] net/mlx5: lazily allocate HWS push " Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 7/9] net/mlx5: lazily allocate HWS send to kernel action Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 8/9] net/mlx5: lazily allocate HWS NAT64 action Dariusz Sosnowski
2026-02-25 11:59 ` [PATCH 9/9] net/mlx5: lazily allocate HWS default miss action Dariusz Sosnowski
2026-03-02 11:22 ` Raslan Darawsheh [this message]
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=4293b0b4-9f2f-4bab-840a-dbc05e95f95c@nvidia.com \
--to=rasland@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@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