Skip to content

net/mlx5: lazily allocate HWS actions

Dariusz Sosnowski dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9net/mlx5: use DPDK be64 type in modify header patterndrivers/net/mlx5/hws/mlx5dr.h drivers/net/mlx5/hws/mlx5dr_action.c drivers/net/mlx5/hws/mlx5dr_pat_arg.c +4 more+32 -330 replies
2/9net/mlx5/hws: add table type to action flags conversiondrivers/net/mlx5/hws/mlx5dr.h drivers/net/mlx5/hws/mlx5dr_table.c+91 -00 replies
3/9net/mlx5: lazily allocate drop HWS actiondrivers/net/mlx5/meson.build drivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow_hw.c +2 more+123 -170 replies
4/9net/mlx5: lazily allocate tag HWS actiondrivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow_hw.c drivers/net/mlx5/mlx5_hws_global_actions.c +1 more+100 -460 replies
5/9net/mlx5: lazily allocate HWS pop VLAN actiondrivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow_hw.c drivers/net/mlx5/mlx5_hws_global_actions.c +1 more+36 -110 replies
6/9net/mlx5: lazily allocate HWS push VLAN actiondrivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow_hw.c drivers/net/mlx5/mlx5_hws_global_actions.c +1 more+36 -690 replies
7/9net/mlx5: lazily allocate HWS send to kernel actiondrivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow_hw.c drivers/net/mlx5/mlx5_hws_global_actions.c +1 more+66 -900 replies
8/9net/mlx5: lazily allocate HWS NAT64 actiondrivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow.h drivers/net/mlx5/mlx5_flow_hw.c +2 more+94 -1800 replies
9/9net/mlx5: lazily allocate HWS default miss actiondrivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow_hw.c drivers/net/mlx5/mlx5_hws_global_actions.c +1 more+61 -450 replies

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchOri Kam
1/9A-b
2/9A-b
3/9A-b
4/9A-b
5/9A-b
6/9A-b
7/9A-b
8/9A-b
9/9A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] net/mlx5: lazily allocate HWS actions

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