]> www.infradead.org Git - users/dwmw2/linux.git/commit
mlxsw: spectrum_acl: Limit priority value
authorNir Dotan <nird@mellanox.com>
Mon, 10 Dec 2018 07:11:44 +0000 (07:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:18 +0000 (20:02 +0100)
commit92430df6f8fbb7c47d70302e8ac92cd9dc68f14d
tree9090c730abfbbbb2a10397447eb3dfb2786b7b8a
parent87888d7b1f6640bce73baac4fe410fcc19aca95f
mlxsw: spectrum_acl: Limit priority value

[ Upstream commit d7263ab35be25505ab57ebecd93cbc5dba8be717 ]

In Spectrum-2, higher priority value wins and priority valid values are in
the range of {1,cap_kvd_size-1}. mlxsw_sp_acl_tcam_priority_get converts
from lower-bound priorities alike tc flower to Spectrum-2 HW range. Up
until now tc flower did not provide priority 0 or reached the maximal
value, however multicast routing does provide priority 0.

Therefore, Change mlxsw_sp_acl_tcam_priority_get to verify priority is in
the correct range. Make sure priority is never set to zero and never
exceeds the maximal allowed value.

Signed-off-by: Nir Dotan <nird@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c