]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/mlx5: HWS, Implement action STE pool
authorVlad Dogaru <vdogaru@nvidia.com>
Thu, 10 Apr 2025 19:17:38 +0000 (22:17 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Apr 2025 00:29:16 +0000 (17:29 -0700)
commit983d01b2ce0ac688bb42489f33a29a02274366d5
treeef96355a9214c60cbba166b8dd8f092c9804f9c7
parenta68334f9750f41fc36990840090ef9dbee1e2c7e
net/mlx5: HWS, Implement action STE pool

Implement a per-queue pool of action STEs that match STEs can link to,
regardless of matcher.

The code relies on hints to optimize whether a given rule is added to
rx-only, tx-only or both. Correspondingly, action STEs need to be added
to different RTC for ingress or egress paths. For rx-and-tx rules, the
current rule implementation dictates that the offsets for a given rule
must be the same in both RTCs.

To avoid wasting STEs, each action STE pool element holds 3 pools:
rx-only, tx-only, and rx-and-tx, corresponding to the possible values of
the pool optimization enum. The implementation then chooses at rule
creation / update which of these elements to allocate from.

Each element holds multiple action STE tables, which wrap an RTC, an STE
range, the logic to buddy-allocate offsets from the range, and an STC
that allows match STEs to point to this table. When allocating offsets
from an element, we iterate through available action STE tables and, if
needed, create a new table.

Similar to the previous implementation, this iteration does not free any
resources. This is implemented in a subsequent patch.

Signed-off-by: Vlad Dogaru <vdogaru@nvidia.com>
Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Link: https://patch.msgid.link/1744312662-356571-9-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.h [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.h
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/internal.h
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.h