net/mlx5: HWS, added backward-compatible API handling
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Wed, 19 Jun 2024 23:43:36 +0000 (02:43 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 9 Sep 2024 18:10:06 +0000 (11:10 -0700)
commit2111bb970c787b16b002dc726c1d296ce87a00fb
tree46b5f03437d0ab4e0773730b98488ada1741d56c
parentc61afff94373641695cc81999e9bb10408ea84d5
net/mlx5: HWS, added backward-compatible API handling

Added implementation of backward-compatible (BWC) steering API.
Native HWS API is very different from SWS API:
 - SWS is synchronous (rule creation/deletion API call returns when
   the rule is created/deleted), while HWS is asynchronous (it
   requires polling for completion in order to know when the rule
   creation/deletion happened)
 - SWS manages its own memory (it allocates/frees all the needed
   memory for steering rules, while HWS requires the rules memory
   to be allocated/freed outside the API

In order to make HWS fit the existing fs-core steering API paradigm,
this patch adds implementation of backward-compatible (BWC) steering
API that has the bahaviour similar to SWS: among others, it encompasses
all the rules' memory management and completion polling, presenting
the usual synchronous API for the upper layer.

A user that wishes to utilize the full speed potential of HWS can
call the HWS async API and have rule insertion/deletion batching,
lower memory management overhead, and lower CPU utilization.
Such approach will be taken by the future Connection Tracking.

Note that BWC steering doesn't support yet rules that require more
than one match STE - complex rules.
This support will be added later on.

Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.h [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.h [new file with mode: 0644]