Skip to content

mlxsw: Control the order of blocks in ACL region

Petr Machata netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyApplied 5/5

Patches in v1 All 5 applied

#Subject and filesSizeRepliesApplied
1/5mlxsw: Mark high entropy key blocksdrivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.c+15 -60 repliesApplied
2/5mlxsw: core_acl_flex_keys: Add a bitmap to save which blocks are chosendrivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c+12 -00 repliesApplied
3/5mlxsw: core_acl_flex_keys: Save chosen elements per blockdrivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c+5 -10 repliesApplied
4/5mlxsw: core_acl_flex_keys: Save chosen elements in all blocks per searchdrivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c+8 -10 repliesApplied
5/5mlxsw: core_acl_flex_keys: Fill blocks with high entropy firstdrivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c+32 -50 repliesApplied

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIdo SchimmelSimon Horman
SeriesR-b
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/5] mlxsw: Control the order of blocks in ACL region

Amit Cohen writes:

For 12 key blocks in the A-TCAM, rules are split into two records, which constitute two lookups. The two records are linked using a "large entry key ID".

Due to a Spectrum-4 hardware issue, KVD entries that correspond to key blocks 0 to 5 of 12 key blocks will be placed in the same KVD pipe if they only differ in their "large entry key ID", as it is ignored. This results in a reduced scale, we can insert less than 20k filters and get an error:

    $ tc -b flower.batch
    RTNETLINK answers: Input/output error
    We have an error talking to the kernel

To reduce the probability of this issue, we can place key blocks with high entropy in blocks 0 to 5. The idea is to place blocks that are often changed in blocks 0 to 5, for example, key blocks that match on IPv4 addresses or the LSBs of IPv6 addresses. Such placement will reduce the probability of these blocks to be same.

Mark several blocks with 'high_entropy' flag and place them in blocks 0 to 5. Note that the list of the blocks is just a suggestion, I will verify it with architects.

Currently, there is a one loop that chooses which blocks should be used for a given list of elements and fills the blocks - when a block is chosen, it fills it in the region. To be able to control the order of the blocks, separate between searching blocks and filling them. Several pre-changes are required.

Patch set overview:
Patch #1 marks several blocks with 'high_entropy' flag.
Patches #2-#4 prepare the code for filling blocks at the end of the search. Patch #5 changes the loop to just choose the blocks and fill the blocks at the end.

Amit Cohen (5):
mlxsw: Mark high entropy key blocks
mlxsw: core_acl_flex_keys: Add a bitmap to save which blocks are
chosen
mlxsw: core_acl_flex_keys: Save chosen elements per block
mlxsw: core_acl_flex_keys: Save chosen elements in all blocks per
search
mlxsw: core_acl_flex_keys: Fill blocks with high entropy first

 .../mellanox/mlxsw/core_acl_flex_keys.c       | 64 +++++++++++++++++--
 .../mellanox/mlxsw/core_acl_flex_keys.h       |  9 +++
 .../mellanox/mlxsw/spectrum_acl_flex_keys.c   | 12 ++--
 3 files changed, 72 insertions(+), 13 deletions(-)
Signature · 1 line
2.41.0