mlxsw: core_acl_flex_keys: Fill blocks with high entropy first
authorAmit Cohen <amcohen@nvidia.com>
Tue, 3 Oct 2023 11:25:30 +0000 (13:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Oct 2023 10:08:07 +0000 (11:08 +0100)
commitc01e24936d16fcdac20849e2a71f52a631a995c5
tree04a3eabe3bc942c983f08e68cc74720ef9c96f00
parent900f4285bbc2661e330036ee0fae046c7b79036b
mlxsw: core_acl_flex_keys: Fill blocks with high entropy first

The previous patches prepared the code to allow separating between
choosing blocks and filling blocks.

Do not add blocks as part of the loop that chooses them. When all the
required blocks are set in the bitmap 'chosen_blocks_bm', start filling
blocks. Iterate over the bitmap twice - first add only blocks that are
marked with 'high_entropy' flag. Then, fill the rest of the blocks.

The idea is to place key blocks with high entropy in blocks 0 to 5. See
more details in previous patches.

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