Skip to content
Snippets Groups Projects
Commit 73af53d8 authored by Alexandre Ferrieux's avatar Alexandre Ferrieux Committed by Jakub Kicinski
Browse files

net: sched: cls_u32: Fix u32's systematic failure to free IDR entries for hnodes.


To generate hnode handles (in gen_new_htid()), u32 uses IDR and
encodes the returned small integer into a structured 32-bit
word. Unfortunately, at disposal time, the needed decoding
is not done. As a result, idr_remove() fails, and the IDR
fills up. Since its size is 2048, the following script ends up
with "Filter already exists":

  tc filter add dev myve $FILTER1
  tc filter add dev myve $FILTER2
  for i in {1..2048}
  do
    echo $i
    tc filter del dev myve $FILTER2
    tc filter add dev myve $FILTER2
  done

This patch adds the missing decoding logic for handles that
deserve it.

Fixes: e7614370 ("net_sched: use idr to allocate u32 filter handles")
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarAlexandre Ferrieux <alexandre.ferrieux@orange.com>
Tested-by: default avatarVictor Nogueira <victor@mojatatu.com>
Link: https://patch.msgid.link/20241110172836.331319-1-alexandre.ferrieux@orange.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2b99b253
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment