diff mbox series

[net] net: sched: u32: Add test case for systematic hnode IDR leaks

Message ID 20241113100428.360460-1-alexandre.ferrieux@orange.com (mailing list archive)
State Accepted
Commit ca34aceb322bfcd6ab498884f1805ee12f983259
Delegated to: Netdev Maintainers
Headers show
Series [net] net: sched: u32: Add test case for systematic hnode IDR leaks | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success Errors and warnings before: 0 (+0) this patch: 0 (+0)
netdev/cc_maintainers warning 4 maintainers not CCed: kuba@kernel.org pctammela@mojatatu.com linux-kselftest@vger.kernel.org shuah@kernel.org
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch warning WARNING: From:/Signed-off-by: email address mismatch: 'From: Alexandre Ferrieux <alexandre.ferrieux@gmail.com>' != 'Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com>'
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-14--03-00 (tests: 782)

Commit Message

Alexandre Ferrieux Nov. 13, 2024, 10:04 a.m. UTC
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@orange.com>
---
 .../tc-testing/tc-tests/filters/u32.json      | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Jamal Hadi Salim Nov. 13, 2024, 2:18 p.m. UTC | #1
On Wed, Nov 13, 2024 at 5:04 AM Alexandre Ferrieux
<alexandre.ferrieux@gmail.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@orange.com>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.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
>
Victor Nogueira Nov. 13, 2024, 3:07 p.m. UTC | #2
On 13/11/2024 07:04, Alexandre Ferrieux 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@orange.com>

Reviewed-by: Victor Nogueira <victor@mojatatu.com>
patchwork-bot+netdevbpf@kernel.org Nov. 14, 2024, 10:50 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 13 Nov 2024 11:04:28 +0100 you 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@orange.com>
> 
> [...]

Here is the summary with links:
  - [net] net: sched: u32: Add test case for systematic hnode IDR leaks
    https://git.kernel.org/netdev/net/c/ca34aceb322b

You are awesome, thank you!
diff mbox series

Patch

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"
+        ]
     }
 ]