]> git.baikalelectronics.ru Git - kernel.git/commit
net: lan966x: Fix port police support using tc-matchall
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Tue, 28 Feb 2023 20:47:42 +0000 (21:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:23 +0000 (08:50 +0100)
commit70b7a2b13aae05e751eadb638674afcda07173ea
tree4d6f12793647c7e4a758a814c589130a44b8a941
parent3cb66df1ace958fe38201eb5a538555dee669696
net: lan966x: Fix port police support using tc-matchall

[ Upstream commit e906f8551fcb756e35b7847e1bfac3f8cd4c0a9a ]

When the police was removed from the port, then it was trying to
remove the police from the police id and not from the actual
police index.
The police id represents the id of the police and police index
represents the position in HW where the police is situated.
The port police id can be any number while the port police index
is a number based on the port chip port.
Fix this by deleting the police from HW that is situated at the
police index and not police id.

Fixes: 15b8f3a8fe54 ("net: lan966x: Add port police support using tc-matchall")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_police.c