linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: fix flower parent qdisc
@ 2020-05-13 17:57 Vlad Buslov
  2020-05-13 18:35 ` Cong Wang
  2020-05-13 19:57 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Vlad Buslov @ 2020-05-13 17:57 UTC (permalink / raw)
  To: linux-kselftest
  Cc: shuah, davem, xiyou.wangcong, jhs, dcaratti, marcelo.leitner,
	Vlad Buslov

Flower tests used to create ingress filter with specified parent qdisc
"parent ffff:" but dump them on "ingress". With recent commit that fixed
tcm_parent handling in dump those are not considered same parent anymore,
which causes iproute2 tc to emit additional "parent ffff:" in first line of
filter dump output. The change in output causes filter match in tests to
fail.

Prevent parent qdisc output when dumping filters in flower tests by always
correctly specifying "ingress" parent both when creating and dumping
filters.

Fixes: a7df4870d79b ("net_sched: fix tcm_parent in tc filter dump")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
---
 .../selftests/tc-testing/tc-tests/filters/tests.json        | 6 +++---
 tools/testing/selftests/tc-testing/tdc_batch.py             | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
index 8877f7b2b809..12aa4bc1f6a0 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
@@ -32,7 +32,7 @@
         "setup": [
             "$TC qdisc add dev $DEV2 ingress"
         ],
-        "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 parent ffff: handle 0xffffffff flower action ok",
+        "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress handle 0xffffffff flower action ok",
         "expExitCode": "0",
         "verifyCmd": "$TC filter show dev $DEV2 ingress",
         "matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff",
@@ -77,9 +77,9 @@
         },
         "setup": [
             "$TC qdisc add dev $DEV2 ingress",
-            "$TC filter add dev $DEV2 protocol ip prio 1 parent ffff: flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop"
+            "$TC filter add dev $DEV2 protocol ip prio 1 ingress flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop"
         ],
-        "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip prio 1 parent ffff: flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop",
+        "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip prio 1 ingress flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop",
         "expExitCode": "2",
         "verifyCmd": "$TC -s filter show dev $DEV2 ingress",
         "matchPattern": "filter protocol ip pref 1 flower chain 0 handle",
diff --git a/tools/testing/selftests/tc-testing/tdc_batch.py b/tools/testing/selftests/tc-testing/tdc_batch.py
index 6a2bd2cf528e..995f66ce43eb 100755
--- a/tools/testing/selftests/tc-testing/tdc_batch.py
+++ b/tools/testing/selftests/tc-testing/tdc_batch.py
@@ -72,21 +72,21 @@ mac_prefix = args.mac_prefix
 
 def format_add_filter(device, prio, handle, skip, src_mac, dst_mac,
                       share_action):
-    return ("filter add dev {} {} protocol ip parent ffff: handle {} "
+    return ("filter add dev {} {} protocol ip ingress handle {} "
             " flower {} src_mac {} dst_mac {} action drop {}".format(
                 device, prio, handle, skip, src_mac, dst_mac, share_action))
 
 
 def format_rep_filter(device, prio, handle, skip, src_mac, dst_mac,
                       share_action):
-    return ("filter replace dev {} {} protocol ip parent ffff: handle {} "
+    return ("filter replace dev {} {} protocol ip ingress handle {} "
             " flower {} src_mac {} dst_mac {} action drop {}".format(
                 device, prio, handle, skip, src_mac, dst_mac, share_action))
 
 
 def format_del_filter(device, prio, handle, skip, src_mac, dst_mac,
                       share_action):
-    return ("filter del dev {} {} protocol ip parent ffff: handle {} "
+    return ("filter del dev {} {} protocol ip ingress handle {} "
             "flower".format(device, prio, handle))
 
 
-- 
2.21.0


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

* Re: [PATCH net-next] selftests: fix flower parent qdisc
  2020-05-13 17:57 [PATCH net-next] selftests: fix flower parent qdisc Vlad Buslov
@ 2020-05-13 18:35 ` Cong Wang
  2020-05-14  6:30   ` Vlad Buslov
  2020-05-13 19:57 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Cong Wang @ 2020-05-13 18:35 UTC (permalink / raw)
  To: Vlad Buslov
  Cc: open list:KERNEL SELFTEST FRAMEWORK, Shuah Khan, David Miller,
	Jamal Hadi Salim, Davide Caratti, Marcelo Ricardo Leitner

On Wed, May 13, 2020 at 10:58 AM Vlad Buslov <vladbu@mellanox.com> wrote:
>
> Flower tests used to create ingress filter with specified parent qdisc
> "parent ffff:" but dump them on "ingress". With recent commit that fixed
> tcm_parent handling in dump those are not considered same parent anymore,
> which causes iproute2 tc to emit additional "parent ffff:" in first line of
> filter dump output. The change in output causes filter match in tests to
> fail.

My commit simply restores the old behavior prior to 4.15, so are you
saying these tests never work correctly on kernels <= 4.15? If so,
they must be fixed no matter of my commit, right?

Thanks.

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

* Re: [PATCH net-next] selftests: fix flower parent qdisc
  2020-05-13 17:57 [PATCH net-next] selftests: fix flower parent qdisc Vlad Buslov
  2020-05-13 18:35 ` Cong Wang
@ 2020-05-13 19:57 ` David Miller
  2020-05-14  6:30   ` Vlad Buslov
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2020-05-13 19:57 UTC (permalink / raw)
  To: vladbu
  Cc: linux-kselftest, shuah, xiyou.wangcong, jhs, dcaratti, marcelo.leitner


You put "net-next" in your subject line but failed to include
netdev in the CC: list.

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

* Re: [PATCH net-next] selftests: fix flower parent qdisc
  2020-05-13 18:35 ` Cong Wang
@ 2020-05-14  6:30   ` Vlad Buslov
  0 siblings, 0 replies; 5+ messages in thread
From: Vlad Buslov @ 2020-05-14  6:30 UTC (permalink / raw)
  To: Cong Wang
  Cc: Vlad Buslov, open list:KERNEL SELFTEST FRAMEWORK, Shuah Khan,
	David Miller, Jamal Hadi Salim, Davide Caratti,
	Marcelo Ricardo Leitner


On Wed 13 May 2020 at 21:35, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Wed, May 13, 2020 at 10:58 AM Vlad Buslov <vladbu@mellanox.com> wrote:
>>
>> Flower tests used to create ingress filter with specified parent qdisc
>> "parent ffff:" but dump them on "ingress". With recent commit that fixed
>> tcm_parent handling in dump those are not considered same parent anymore,
>> which causes iproute2 tc to emit additional "parent ffff:" in first line of
>> filter dump output. The change in output causes filter match in tests to
>> fail.
>
> My commit simply restores the old behavior prior to 4.15, so are you
> saying these tests never work correctly on kernels <= 4.15? If so,
> they must be fixed no matter of my commit, right?
>
> Thanks.

I think all of these tests are newer than 4.15.

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

* Re: [PATCH net-next] selftests: fix flower parent qdisc
  2020-05-13 19:57 ` David Miller
@ 2020-05-14  6:30   ` Vlad Buslov
  0 siblings, 0 replies; 5+ messages in thread
From: Vlad Buslov @ 2020-05-14  6:30 UTC (permalink / raw)
  To: David Miller
  Cc: vladbu, linux-kselftest, shuah, xiyou.wangcong, jhs, dcaratti,
	marcelo.leitner


On Wed 13 May 2020 at 22:57, David Miller <davem@davemloft.net> wrote:
> You put "net-next" in your subject line but failed to include
> netdev in the CC: list.

Sorry. Will resend with proper distribution.


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

end of thread, other threads:[~2020-05-14  6:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 17:57 [PATCH net-next] selftests: fix flower parent qdisc Vlad Buslov
2020-05-13 18:35 ` Cong Wang
2020-05-14  6:30   ` Vlad Buslov
2020-05-13 19:57 ` David Miller
2020-05-14  6:30   ` Vlad Buslov

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).