]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/mlx5: HWS, Refactor pool implementation
authorVlad Dogaru <vdogaru@nvidia.com>
Thu, 10 Apr 2025 19:17:34 +0000 (22:17 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Apr 2025 00:29:15 +0000 (17:29 -0700)
commitd171ce3d988868bed9dc3c9eeb8428f87dd9ac85
tree0e1b9b4c269a077060c2acddd7a8623ac7615452
parent38956bea7349ce75c1519b57c27cd97580b4c822
net/mlx5: HWS, Refactor pool implementation

Refactor the pool implementation to remove unused flags and clarify its
usage. A pool represents a single range of STEs or STCs which are
allocated at pool creation time.

Pools are used under three patterns:

1. STCs are allocated one at a time from a global pool using a bitmap
   based implementation.

2. Action STEs are allocated in power-of-two blocks using a buddy
   algorithm.

3. Match STEs do not use allocation, since insertion into these tables
   is based on hashes or direct addressing. In such cases we use a pool
   only to create the STE range.

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-5-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.h