mlxsw: Add 'ipv4_5' flex key
authorAmit Cohen <amcohen@nvidia.com>
Tue, 19 Sep 2023 15:42:54 +0000 (17:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Sep 2023 07:26:29 +0000 (08:26 +0100)
commitc2f3e10ac4ebf23e177226b9b4d297bfe2fb6b20
tree6002dfcb5c2686ec7911c1b0c6898105b8e01f6e
parent84c19e655b29fb31d416d00f2f0290d6397b8eef
mlxsw: Add 'ipv4_5' flex key

Currently virtual router ID element is broken to two sub-elements -
'VIRT_ROUTER_LSB' and 'VIRT_ROUTER_MSB'. It was broken as this field is
broken in 'ipv4_4' flex key which is used for IPv4 in Spectrum < 4.
For Spectrum-4, we use 'ipv4_4b' flex key which contains one field for
virtual router, this key is not supported in older ASICs.

Add 'ipv4_5' flex key which is supported in all ASICs and contains one
field for virtual router. Then there is no reason to use 'VIRT_ROUTER_LSB'
and 'VIRT_ROUTER_MSB', remove them and add one element 'VIRT_ROUTER' for
this field.

The motivation is to get rid of 'ipv4_4' flex key, as it might be chosen
for IPv6 multicast forwarding region. This will not allow the improvement
in a following patch. See more details in the cover letter and 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
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h
drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.c