Skip to content

Commit d5e7105

Browse files
w1ldptrgregkh
authored andcommitted
selftests: fix flower parent qdisc
[ Upstream commit 0531b03 ] 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: a7df487 ("net_sched: fix tcm_parent in tc filter dump") Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 012fa49 commit d5e7105

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎tools/testing/selftests/tc-testing/tc-tests/filters/tests.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"setup": [
3333
"$TC qdisc add dev $DEV2 ingress"
3434
],
35-
"cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 parent ffff: handle 0xffffffff flower action ok",
35+
"cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress handle 0xffffffff flower action ok",
3636
"expExitCode": "0",
3737
"verifyCmd": "$TC filter show dev $DEV2 ingress",
3838
"matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff",
@@ -77,9 +77,9 @@
7777
},
7878
"setup": [
7979
"$TC qdisc add dev $DEV2 ingress",
80-
"$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"
80+
"$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"
8181
],
82-
"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",
82+
"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",
8383
"expExitCode": "2",
8484
"verifyCmd": "$TC -s filter show dev $DEV2 ingress",
8585
"matchPattern": "filter protocol ip pref 1 flower chain 0 handle",

‎tools/testing/selftests/tc-testing/tdc_batch.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,21 @@
7272

7373
def format_add_filter(device, prio, handle, skip, src_mac, dst_mac,
7474
share_action):
75-
return ("filter add dev {} {} protocol ip parent ffff: handle {} "
75+
return ("filter add dev {} {} protocol ip ingress handle {} "
7676
" flower {} src_mac {} dst_mac {} action drop {}".format(
7777
device, prio, handle, skip, src_mac, dst_mac, share_action))
7878

7979

8080
def format_rep_filter(device, prio, handle, skip, src_mac, dst_mac,
8181
share_action):
82-
return ("filter replace dev {} {} protocol ip parent ffff: handle {} "
82+
return ("filter replace dev {} {} protocol ip ingress handle {} "
8383
" flower {} src_mac {} dst_mac {} action drop {}".format(
8484
device, prio, handle, skip, src_mac, dst_mac, share_action))
8585

8686

8787
def format_del_filter(device, prio, handle, skip, src_mac, dst_mac,
8888
share_action):
89-
return ("filter del dev {} {} protocol ip parent ffff: handle {} "
89+
return ("filter del dev {} {} protocol ip ingress handle {} "
9090
"flower".format(device, prio, handle))
9191

9292

0 commit comments

Comments
 (0)