Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/tc-testing: Create tests to exercise ets classes active list misplacements

Add a test case for a bug fixed by Jamal [1] and for scenario where an
ets drr class is inserted into the active list twice.

- Try to delete ets drr class' qdisc while still keeping it in the
active list
- Try to add ets class to the active list twice

[1] https://lore.kernel.org/netdev/20251128151919.576920-1-jhs@mojatatu.com/

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/20251208190125.1868423-2-victor@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Victor Nogueira and committed by
Jakub Kicinski
5914428e b1e125ae

+78
+78
tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
··· 1033 1033 "teardown": [ 1034 1034 "$TC qdisc del dev $DUMMY handle 1: root" 1035 1035 ] 1036 + }, 1037 + { 1038 + "id": "6e4f", 1039 + "name": "Try to delete ets drr class' qdisc while still keeping it in the active list", 1040 + "category": [ 1041 + "qdisc", 1042 + "ets", 1043 + "tbf" 1044 + ], 1045 + "plugins": { 1046 + "requires": [ 1047 + "nsPlugin", 1048 + "scapyPlugin" 1049 + ] 1050 + }, 1051 + "setup": [ 1052 + "$IP link set dev $DUMMY up || true", 1053 + "$IP addr add 10.10.11.10/24 dev $DUMMY || true", 1054 + "$TC qdisc add dev $DUMMY root handle 1: ets bands 2 strict 1", 1055 + "$TC qdisc add dev $DUMMY parent 1:2 handle 20: tbf rate 8bit burst 100b latency 1s", 1056 + "$TC filter add dev $DUMMY parent 1: basic classid 1:2", 1057 + "ping -c2 -W0.01 -s 56 -I $DUMMY 10.10.11.11 || true", 1058 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 2 strict 2", 1059 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 1 strict 1" 1060 + ], 1061 + "cmdUnderTest": "ping -c1 -W0.01 -s 56 -I $DUMMY 10.10.11.11", 1062 + "expExitCode": "1", 1063 + "verifyCmd": "$TC -s -j qdisc ls dev $DUMMY root", 1064 + "matchJSON": [ 1065 + { 1066 + "kind": "ets", 1067 + "handle": "1:", 1068 + "bytes": 196, 1069 + "packets": 2 1070 + } 1071 + ], 1072 + "teardown": [ 1073 + "$TC qdisc del dev $DUMMY root handle 1:" 1074 + ] 1075 + }, 1076 + { 1077 + "id": "0b8f", 1078 + "name": "Try to add ets class to the active list twice", 1079 + "category": [ 1080 + "qdisc", 1081 + "ets", 1082 + "tbf" 1083 + ], 1084 + "plugins": { 1085 + "requires": [ 1086 + "nsPlugin", 1087 + "scapyPlugin" 1088 + ] 1089 + }, 1090 + "setup": [ 1091 + "$IP link set dev $DUMMY up || true", 1092 + "$IP addr add 10.10.11.10/24 dev $DUMMY || true", 1093 + "$TC qdisc add dev $DUMMY root handle 1: ets bands 2 strict 1", 1094 + "$TC qdisc add dev $DUMMY parent 1:2 handle 20: tbf rate 8bit burst 100b latency 1s", 1095 + "$TC filter add dev $DUMMY parent 1: basic classid 1:2", 1096 + "ping -c2 -W0.01 -s 56 -I $DUMMY 10.10.11.11 || true", 1097 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 2 strict 2", 1098 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 2 strict 1" 1099 + ], 1100 + "cmdUnderTest": "ping -c1 -W0.01 -s 56 -I $DUMMY 10.10.11.11", 1101 + "expExitCode": "1", 1102 + "verifyCmd": "$TC -s -j qdisc ls dev $DUMMY root", 1103 + "matchJSON": [ 1104 + { 1105 + "kind": "ets", 1106 + "handle": "1:", 1107 + "bytes": 98, 1108 + "packets": 1 1109 + } 1110 + ], 1111 + "teardown": [ 1112 + "$TC qdisc del dev $DUMMY root handle 1:" 1113 + ] 1036 1114 } 1037 1115 ]