mlxsw: core_acl_flex_keys: Add a bitmap to save which blocks are chosen
authorAmit Cohen <amcohen@nvidia.com>
Tue, 3 Oct 2023 11:25:27 +0000 (13:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Oct 2023 10:08:06 +0000 (11:08 +0100)
commit0a67b7a0ec36bda6ce2898016415b36d3b85dca8
tree2773e8eaed371bb282db5d1fcb577866c2a6acbc
parentcad6431b867507779c41b00baaf18382467ef0a0
mlxsw: core_acl_flex_keys: Add a bitmap to save which blocks are chosen

Currently, mlxsw_afk_picker() chooses which blocks will be used for a
given list of elements, and fills the blocks during the searching - when a
key block is found with most hits, it adds it and removes the elements from
the count of hits. This should be changed as we want to be able to choose
which blocks will be placed in blocks 0 to 5.

To separate between choosing blocks and filling blocks, several pre-changes
are required. The indexes of the chosen blocks should be saved, so then
the relevant blocks will be filled at the end of search.

Allocate a bitmap for chosen blocks, when a block is found with most
hits, set the relevant bit in the bitmap. This bitmap will be used in a
following patch.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c