netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: tc-testing: add one test for flushing explicitly created chain
@ 2023-06-17  3:20 renmingshuai
  2023-06-17  8:01 ` shaozhengchao
  0 siblings, 1 reply; 3+ messages in thread
From: renmingshuai @ 2023-06-17  3:20 UTC (permalink / raw)
  To: pctammela, vladbu, netdev, linux-kernel, jhs, xiyou.wangcong,
	jiri, davem, edumazet, kuba, pabeni
  Cc: liaichun, caowangbao, yanan, liubo335

Add the test for additional reference to chains that are explicitly created
 by RTM_NEWCHAIN message

commit c9a82bec02c3 ("net/sched: cls_api: Fix lockup on flushing explicitly
 created chain")
Signed-off-by: Mingshuai Ren <renmingshuai@huawei.com>
---
 .../tc-testing/tc-tests/infra/filter.json     | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 tools/testing/selftests/tc-testing/tc-tests/infra/filter.json

diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json b/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
new file mode 100644
index 000000000000..c4c778e83da2
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
@@ -0,0 +1,25 @@
+[
+    {
+        "id": "c2b4",
+        "name": "soft lockup alarm will be not generated after delete the prio 0 filter of the chain",
+        "category": [
+            "filter",
+            "chain"
+        ],
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true",
+            "$TC qdisc add dev $DUMMY root handle 1: htb default 1",
+            "$TC chain add dev $DUMMY",
+            "$TC filter del dev $DUMMY chain 0 parent 1: prio 0"
+        ],
+        "cmdUnderTest": "$TC filter add dev $DUMMY chain 0 parent 1:",
+        "expExitCode": "2",
+        "verifyCmd": "$TC chain ls dev $DUMMY",
+        "matchPattern": "chain parent 1: chain 0",
+        "matchCount": "1",
+        "teardown": [
+            "$TC qdisc del dev $DUMMY root handle 1: htb default 1",
+            "$IP link del dev $DUMMY type dummy"
+        ]
+    }
+]
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: tc-testing: add one test for flushing explicitly created chain
  2023-06-17  3:20 [PATCH] selftests: tc-testing: add one test for flushing explicitly created chain renmingshuai
@ 2023-06-17  8:01 ` shaozhengchao
  2023-06-20  2:01   ` renmingshuai
  0 siblings, 1 reply; 3+ messages in thread
From: shaozhengchao @ 2023-06-17  8:01 UTC (permalink / raw)
  To: renmingshuai, pctammela, vladbu, netdev, linux-kernel, jhs,
	xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni
  Cc: liaichun, caowangbao, yanan, liubo335


Hi renmingshuai:
On 2023/6/17 11:20, renmingshuai wrote:
> Add the test for additional reference to chains that are explicitly created
>   by RTM_NEWCHAIN message
> 
> commit c9a82bec02c3 ("net/sched: cls_api: Fix lockup on flushing explicitly
>   created chain")
> Signed-off-by: Mingshuai Ren <renmingshuai@huawei.com>
> ---
>   .../tc-testing/tc-tests/infra/filter.json     | 25 +++++++++++++++++++
>   1 file changed, 25 insertions(+)
>   create mode 100644 tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
> 
> diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json b/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
> new file mode 100644
> index 000000000000..c4c778e83da2
> --- /dev/null
> +++ b/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
> @@ -0,0 +1,25 @@
> +[
> +    {
> +        "id": "c2b4",
> +        "name": "soft lockup alarm will be not generated after delete the prio 0 filter of the chain",
	 "Delete the prio 0 filter of chain" looks better. And adding
  test result in comment also will be better.

Zhengchao Shao
> +        "category": [
> +            "filter",
> +            "chain"
> +        ],
> +        "setup": [
> +            "$IP link add dev $DUMMY type dummy || /bin/true",
> +            "$TC qdisc add dev $DUMMY root handle 1: htb default 1",
> +            "$TC chain add dev $DUMMY",
> +            "$TC filter del dev $DUMMY chain 0 parent 1: prio 0"
> +        ],
> +        "cmdUnderTest": "$TC filter add dev $DUMMY chain 0 parent 1:",
> +        "expExitCode": "2",
> +        "verifyCmd": "$TC chain ls dev $DUMMY",
> +        "matchPattern": "chain parent 1: chain 0",
> +        "matchCount": "1",
> +        "teardown": [
> +            "$TC qdisc del dev $DUMMY root handle 1: htb default 1",
> +            "$IP link del dev $DUMMY type dummy"
> +        ]
> +    }
> +]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: tc-testing: add one test for flushing explicitly created chain
  2023-06-17  8:01 ` shaozhengchao
@ 2023-06-20  2:01   ` renmingshuai
  0 siblings, 0 replies; 3+ messages in thread
From: renmingshuai @ 2023-06-20  2:01 UTC (permalink / raw)
  To: shaozhengchao
  Cc: caowangbao, davem, edumazet, jhs, jiri, kuba, liaichun,
	linux-kernel, liubo335, netdev, pabeni, pctammela, renmingshuai,
	vladbu, xiyou.wangcong, yanan

>Hi renmingshuai:
>On 2023/6/17 11:20, renmingshuai wrote:
>> Add the test for additional reference to chains that are explicitly created
>>   by RTM_NEWCHAIN message
>> 
>> commit c9a82bec02c3 ("net/sched: cls_api: Fix lockup on flushing explicitly
>>   created chain")
>> Signed-off-by: Mingshuai Ren <renmingshuai@huawei.com>
>> ---
>>   .../tc-testing/tc-tests/infra/filter.json     | 25 +++++++++++++++++++
>>   1 file changed, 25 insertions(+)
>>   create mode 100644 tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
>> 
>> diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json b/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
>> new file mode 100644
>> index 000000000000..c4c778e83da2
>> --- /dev/null
>> +++ b/tools/testing/selftests/tc-testing/tc-tests/infra/filter.json
>> @@ -0,0 +1,25 @@
>> +[
>> +    {
>> +        "id": "c2b4",
>> +        "name": "soft lockup alarm will be not generated after delete the prio 0 filter of the chain",
>	 "Delete the prio 0 filter of chain" looks better. And adding
>  test result in comment also will be better.
>
>Zhengchao Shao
Thanks for your advice, and I have add the test result in comment.
https://lore.kernel.org/netdev/20230620014939.2034054-1-renmingshuai@huawei.com/T/#u
The original name can describe the purpose of adding the test case, which would be better.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-20  2:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-17  3:20 [PATCH] selftests: tc-testing: add one test for flushing explicitly created chain renmingshuai
2023-06-17  8:01 ` shaozhengchao
2023-06-20  2:01   ` renmingshuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).