Commit 73af53d
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: e761437 ("net_sched: use idr to allocate u32 filter handles")
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com>
Tested-by: Victor Nogueira <victor@mojatatu.com>
Link: https://patch.msgid.link/20241110172836.331319-1-alexandre.ferrieux@orange.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 2b99b25 commit 73af53d
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
95 | 105 | | |
96 | 106 | | |
97 | 107 | | |
| |||
310 | 320 | | |
311 | 321 | | |
312 | 322 | | |
313 | | - | |
| 323 | + | |
314 | 324 | | |
315 | 325 | | |
316 | 326 | | |
| |||
360 | 370 | | |
361 | 371 | | |
362 | 372 | | |
363 | | - | |
| 373 | + | |
364 | 374 | | |
365 | 375 | | |
366 | 376 | | |
| |||
612 | 622 | | |
613 | 623 | | |
614 | 624 | | |
615 | | - | |
| 625 | + | |
616 | 626 | | |
617 | 627 | | |
618 | 628 | | |
| |||
989 | 999 | | |
990 | 1000 | | |
991 | 1001 | | |
992 | | - | |
| 1002 | + | |
993 | 1003 | | |
994 | 1004 | | |
995 | 1005 | | |
| |||
0 commit comments