selftests: fix flower parent qdisc
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: a7df4870d7
("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>
This commit is contained in:
Родитель
38152ea37d
Коммит
0531b0357b
|
@ -32,7 +32,7 @@
|
||||||
"setup": [
|
"setup": [
|
||||||
"$TC qdisc add dev $DEV2 ingress"
|
"$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",
|
"expExitCode": "0",
|
||||||
"verifyCmd": "$TC filter show dev $DEV2 ingress",
|
"verifyCmd": "$TC filter show dev $DEV2 ingress",
|
||||||
"matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff",
|
"matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff",
|
||||||
|
@ -77,9 +77,9 @@
|
||||||
},
|
},
|
||||||
"setup": [
|
"setup": [
|
||||||
"$TC qdisc add dev $DEV2 ingress",
|
"$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",
|
"expExitCode": "2",
|
||||||
"verifyCmd": "$TC -s filter show dev $DEV2 ingress",
|
"verifyCmd": "$TC -s filter show dev $DEV2 ingress",
|
||||||
"matchPattern": "filter protocol ip pref 1 flower chain 0 handle",
|
"matchPattern": "filter protocol ip pref 1 flower chain 0 handle",
|
||||||
|
|
|
@ -72,21 +72,21 @@ mac_prefix = args.mac_prefix
|
||||||
|
|
||||||
def format_add_filter(device, prio, handle, skip, src_mac, dst_mac,
|
def format_add_filter(device, prio, handle, skip, src_mac, dst_mac,
|
||||||
share_action):
|
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(
|
" flower {} src_mac {} dst_mac {} action drop {}".format(
|
||||||
device, prio, handle, skip, src_mac, dst_mac, share_action))
|
device, prio, handle, skip, src_mac, dst_mac, share_action))
|
||||||
|
|
||||||
|
|
||||||
def format_rep_filter(device, prio, handle, skip, src_mac, dst_mac,
|
def format_rep_filter(device, prio, handle, skip, src_mac, dst_mac,
|
||||||
share_action):
|
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(
|
" flower {} src_mac {} dst_mac {} action drop {}".format(
|
||||||
device, prio, handle, skip, src_mac, dst_mac, share_action))
|
device, prio, handle, skip, src_mac, dst_mac, share_action))
|
||||||
|
|
||||||
|
|
||||||
def format_del_filter(device, prio, handle, skip, src_mac, dst_mac,
|
def format_del_filter(device, prio, handle, skip, src_mac, dst_mac,
|
||||||
share_action):
|
share_action):
|
||||||
return ("filter del dev {} {} protocol ip parent ffff: handle {} "
|
return ("filter del dev {} {} protocol ip ingress handle {} "
|
||||||
"flower".format(device, prio, handle))
|
"flower".format(device, prio, handle))
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче