public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH 0/9] net/mlx5: lazily allocate HWS actions
@ 2026-02-25 11:59 Dariusz Sosnowski
  2026-02-25 11:59 ` [PATCH 1/9] net/mlx5: use DPDK be64 type in modify header pattern Dariusz Sosnowski
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Dariusz Sosnowski @ 2026-02-25 11:59 UTC (permalink / raw)
  To: Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad
  Cc: dev, Raslan Darawsheh

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-02 11:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 0/9] net/mlx5: lazily allocate HWS actions Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox