Skip to content

Commit 5cba412

Browse files
vbnogueiraPaolo Abeni
authored andcommitted
selftests/tc-testing: Test case exercising potential mirred redirect deadlock
Add a test case that reproduces deadlock scenario where the user has a drr qdisc attached to root and has a mirred action that redirects to self on egress Signed-off-by: Victor Nogueira <victor@mojatatu.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://patch.msgid.link/20251210162255.1057663-2-jhs@mojatatu.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 1d85625 commit 5cba412

File tree

1 file changed

+46
-0
lines changed
  • tools/testing/selftests/tc-testing/tc-tests/actions

1 file changed

+46
-0
lines changed

tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,5 +1052,51 @@
10521052
"$TC qdisc del dev $DEV1 ingress_block 21 clsact",
10531053
"$TC actions flush action mirred"
10541054
]
1055+
},
1056+
{
1057+
"id": "7eba",
1058+
"name": "Redirect multiport: dummy egress -> dummy egress (Loop)",
1059+
"category": [
1060+
"filter",
1061+
"mirred"
1062+
],
1063+
"plugins": {
1064+
"requires": [
1065+
"nsPlugin"
1066+
]
1067+
},
1068+
"setup": [
1069+
"$IP link set dev $DUMMY up || true",
1070+
"$IP addr add 10.10.10.10/24 dev $DUMMY || true",
1071+
"$TC qdisc add dev $DUMMY handle 1: root drr",
1072+
"$TC filter add dev $DUMMY parent 1: protocol ip prio 10 matchall action mirred egress redirect dev $DUMMY index 1"
1073+
],
1074+
"cmdUnderTest": "ping -c1 -W0.01 -I $DUMMY 10.10.10.1",
1075+
"expExitCode": "1",
1076+
"verifyCmd": "$TC -j -s actions get action mirred index 1",
1077+
"matchJSON": [
1078+
{
1079+
"total acts": 0
1080+
},
1081+
{
1082+
"actions": [
1083+
{
1084+
"order": 1,
1085+
"kind": "mirred",
1086+
"mirred_action": "redirect",
1087+
"direction": "egress",
1088+
"index": 1,
1089+
"stats": {
1090+
"packets": 1,
1091+
"overlimits": 1
1092+
},
1093+
"not_in_hw": true
1094+
}
1095+
]
1096+
}
1097+
],
1098+
"teardown": [
1099+
"$TC qdisc del dev $DUMMY root"
1100+
]
10551101
}
10561102
]

0 commit comments

Comments
 (0)