Skip to content

Commit 81563d8

Browse files
HoratiuVulturdavem330
authored andcommitted
net: lan966x: Fix port police support using tc-matchall
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: 5390334 ("net: lan966x: Add port police support using tc-matchall") Signed-off-by: Horatiu Vultur <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dfd2f0e commit 81563d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/microchip/lan966x/lan966x_police.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ int lan966x_police_port_del(struct lan966x_port *port,
194194
return -EINVAL;
195195
}
196196

197-
err = lan966x_police_del(port, port->tc.police_id);
197+
err = lan966x_police_del(port, POL_IDX_PORT + port->chip_port);
198198
if (err) {
199199
NL_SET_ERR_MSG_MOD(extack,
200200
"Failed to add policer to port");

0 commit comments

Comments
 (0)