[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM0EoMkiA0hMRcHhS=LCFFrFu5+ameW=3nvvg8_2n_Krvog5vw@mail.gmail.com>
Date: Wed, 13 Nov 2024 09:18:41 -0500
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Alexandre Ferrieux <alexandre.ferrieux@...il.com>
Cc: edumazet@...gle.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
horms@...nel.org, alexandre.ferrieux@...nge.com, netdev@...r.kernel.org
Subject: Re: [PATCH net] net: sched: u32: Add test case for systematic hnode
IDR leaks
On Wed, Nov 13, 2024 at 5:04 AM Alexandre Ferrieux
<alexandre.ferrieux@...il.com> wrote:
>
> Add a tdc test case to exercise the just-fixed systematic leak of
> IDR entries in u32 hnode disposal. Given the IDR in question is
> confined to the range [1..0x7FF], it is sufficient to create/delete
> the same filter 2048 times to fill it up and get a nonzero exit
> status from "tc filter add".
>
> Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@...nge.com>
Acked-by: Jamal Hadi Salim <jhs@...atatu.com>
cheers,
jamal
> ---
> .../tc-testing/tc-tests/filters/u32.json | 24 +++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json b/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json
> index 24bd0c2a3014..b2ca9d4e991b 100644
> --- a/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json
> +++ b/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json
> @@ -329,5 +329,29 @@
> "teardown": [
> "$TC qdisc del dev $DEV1 parent root drr"
> ]
> + },
> + {
> + "id": "1234",
> + "name": "Exercise IDR leaks by creating/deleting a filter many (2048) times",
> + "category": [
> + "filter",
> + "u32"
> + ],
> + "plugins": {
> + "requires": "nsPlugin"
> + },
> + "setup": [
> + "$TC qdisc add dev $DEV1 parent root handle 10: drr",
> + "$TC filter add dev $DEV1 parent 10:0 protocol ip prio 2 u32 match ip src 0.0.0.2/32 action drop",
> + "$TC filter add dev $DEV1 parent 10:0 protocol ip prio 3 u32 match ip src 0.0.0.3/32 action drop"
> + ],
> + "cmdUnderTest": "bash -c 'for i in {1..2048} ;do echo filter delete dev $DEV1 pref 3;echo filter add dev $DEV1 parent 10:0 protocol ip prio 3 u32 match ip src 0.0.0.3/32 action drop;done | $TC -b -'",
> + "expExitCode": "0",
> + "verifyCmd": "$TC filter show dev $DEV1",
> + "matchPattern": "protocol ip pref 3 u32",
> + "matchCount": "3",
> + "teardown": [
> + "$TC qdisc del dev $DEV1 parent root drr"
> + ]
> }
> ]
> --
> 2.30.2
>
Powered by blists - more mailing lists