Skip to content

Commit 019d932

Browse files
vladimirolteankuba-moo
authored andcommitted
net: mscc: ocelot: fix VCAP filters remaining active after being deleted
When ocelot_flower.c calls ocelot_vcap_filter_add(), the filter has a given filter->id.cookie. This filter is added to the block->rules list. However, when ocelot_flower.c calls ocelot_vcap_block_find_filter_by_id() which passes the cookie as argument, the filter is never found by filter->id.cookie when searching through the block->rules list. This is unsurprising, since the filter->id.cookie is an unsigned long, but the cookie argument provided to ocelot_vcap_block_find_filter_by_id() is a signed int, and the comparison fails. Fixes: 50c6cc5 ("net: mscc: ocelot: store a namespaced VCAP filter ID") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20210930125330.2078625-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 560ee19 commit 019d932

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/net/ethernet/mscc/ocelot_vcap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,8 @@ ocelot_vcap_block_find_filter_by_index(struct ocelot_vcap_block *block,
998998
}
999999

10001000
struct ocelot_vcap_filter *
1001-
ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int cookie,
1002-
bool tc_offload)
1001+
ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block,
1002+
unsigned long cookie, bool tc_offload)
10031003
{
10041004
struct ocelot_vcap_filter *filter;
10051005

include/soc/mscc/ocelot_vcap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ int ocelot_vcap_filter_add(struct ocelot *ocelot,
694694
int ocelot_vcap_filter_del(struct ocelot *ocelot,
695695
struct ocelot_vcap_filter *rule);
696696
struct ocelot_vcap_filter *
697-
ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int id,
698-
bool tc_offload);
697+
ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block,
698+
unsigned long cookie, bool tc_offload);
699699

700700
#endif /* _OCELOT_VCAP_H_ */

0 commit comments

Comments
 (0)