Commit 3f5b606d authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'refactor-duplicate-codes-in-the-qdisc-class-walk-function'

Zhengchao Shao says:

====================
refactor duplicate codes in the qdisc class walk function

The walk implementation of most qdisc class modules is basically the
same. That is, the values of count and skip are checked first. If count
is greater than or equal to skip, the registered fn function is
executed. Otherwise, increase the value of count. So the code can be
refactored.

The walk function is invoked during dump. Therefore, test cases related
 to the tdc filter need to be added.
====================

Link: https://lore.kernel.org/r/20220921024040.385296-1-shaozhengchao@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents a2c2a4dd d3f83254
......@@ -222,4 +222,17 @@ static inline struct tc_skb_cb *tc_skb_cb(const struct sk_buff *skb)
return cb;
}
static inline bool tc_qdisc_stats_dump(struct Qdisc *sch,
unsigned long cl,
struct qdisc_walker *arg)
{
if (arg->count >= arg->skip && arg->fn(sch, cl, arg) < 0) {
arg->stop = 1;
return false;
}
arg->count++;
return true;
}
#endif
......@@ -354,12 +354,8 @@ static void atm_tc_walk(struct Qdisc *sch, struct qdisc_walker *walker)
if (walker->stop)
return;
list_for_each_entry(flow, &p->flows, list) {
if (walker->count >= walker->skip &&
walker->fn(sch, (unsigned long)flow, walker) < 0) {
walker->stop = 1;
if (!tc_qdisc_stats_dump(sch, (unsigned long)flow, walker))
break;
}
walker->count++;
}
}
......
......@@ -3061,16 +3061,13 @@ static void cake_walk(struct Qdisc *sch, struct qdisc_walker *arg)
struct cake_tin_data *b = &q->tins[q->tin_order[i]];
for (j = 0; j < CAKE_QUEUES; j++) {
if (list_empty(&b->flows[j].flowchain) ||
arg->count < arg->skip) {
if (list_empty(&b->flows[j].flowchain)) {
arg->count++;
continue;
}
if (arg->fn(sch, i * CAKE_QUEUES + j + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, i * CAKE_QUEUES + j + 1,
arg))
break;
}
arg->count++;
}
}
}
......
......@@ -1676,15 +1676,8 @@ static void cbq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
for (h = 0; h < q->clhash.hashsize; h++) {
hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
return;
}
arg->count++;
}
}
}
......
......@@ -520,13 +520,7 @@ static unsigned long cbs_find(struct Qdisc *sch, u32 classid)
static void cbs_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
if (!walker->stop) {
if (walker->count >= walker->skip) {
if (walker->fn(sch, 1, walker) < 0) {
walker->stop = 1;
return;
}
}
walker->count++;
tc_qdisc_stats_dump(sch, 1, walker);
}
}
......
......@@ -284,15 +284,8 @@ static void drr_walk(struct Qdisc *sch, struct qdisc_walker *arg)
for (i = 0; i < q->clhash.hashsize; i++) {
hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
return;
}
arg->count++;
}
}
}
......
......@@ -176,16 +176,12 @@ static void dsmark_walk(struct Qdisc *sch, struct qdisc_walker *walker)
return;
for (i = 0; i < p->indices; i++) {
if (p->mv[i].mask == 0xff && !p->mv[i].value)
goto ignore;
if (walker->count >= walker->skip) {
if (walker->fn(sch, i + 1, walker) < 0) {
walker->stop = 1;
break;
}
if (p->mv[i].mask == 0xff && !p->mv[i].value) {
walker->count++;
continue;
}
ignore:
walker->count++;
if (!tc_qdisc_stats_dump(sch, i + 1, walker))
break;
}
}
......
......@@ -341,15 +341,8 @@ static void ets_qdisc_walk(struct Qdisc *sch, struct qdisc_walker *arg)
return;
for (i = 0; i < q->nbands; i++) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, i + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, i + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -673,16 +673,12 @@ static void fq_codel_walk(struct Qdisc *sch, struct qdisc_walker *arg)
return;
for (i = 0; i < q->flows_cnt; i++) {
if (list_empty(&q->flows[i].flowchain) ||
arg->count < arg->skip) {
if (list_empty(&q->flows[i].flowchain)) {
arg->count++;
continue;
}
if (arg->fn(sch, i + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, i + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -1349,15 +1349,8 @@ hfsc_walk(struct Qdisc *sch, struct qdisc_walker *arg)
for (i = 0; i < q->clhash.hashsize; i++) {
hlist_for_each_entry(cl, &q->clhash.hash[i],
cl_common.hnode) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
return;
}
arg->count++;
}
}
}
......
......@@ -2119,15 +2119,8 @@ static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)
for (i = 0; i < q->clhash.hashsize; i++) {
hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
return;
}
arg->count++;
}
}
}
......
......@@ -247,11 +247,8 @@ static void mq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
arg->count = arg->skip;
for (ntx = arg->skip; ntx < dev->num_tx_queues; ntx++) {
if (arg->fn(sch, ntx + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, ntx + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -558,11 +558,8 @@ static void mqprio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
/* Walk hierarchy with a virtual class per tc */
arg->count = arg->skip;
for (ntx = arg->skip; ntx < netdev_get_num_tc(dev); ntx++) {
if (arg->fn(sch, ntx + TC_H_MIN_PRIORITY, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, ntx + TC_H_MIN_PRIORITY, arg))
return;
}
arg->count++;
}
/* Pad the values and skip over unused traffic classes */
......
......@@ -353,15 +353,8 @@ static void multiq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
return;
for (band = 0; band < q->bands; band++) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, band + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, band + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -1251,12 +1251,8 @@ static unsigned long netem_find(struct Qdisc *sch, u32 classid)
static void netem_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
if (!walker->stop) {
if (walker->count >= walker->skip)
if (walker->fn(sch, 1, walker) < 0) {
walker->stop = 1;
return;
}
walker->count++;
if (!tc_qdisc_stats_dump(sch, 1, walker))
return;
}
}
......
......@@ -376,15 +376,8 @@ static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
return;
for (prio = 0; prio < q->bands; prio++) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, prio + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, prio + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -659,15 +659,8 @@ static void qfq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
for (i = 0; i < q->clhash.hashsize; i++) {
hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
return;
}
arg->count++;
}
}
}
......
......@@ -516,12 +516,7 @@ static unsigned long red_find(struct Qdisc *sch, u32 classid)
static void red_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
if (!walker->stop) {
if (walker->count >= walker->skip)
if (walker->fn(sch, 1, walker) < 0) {
walker->stop = 1;
return;
}
walker->count++;
tc_qdisc_stats_dump(sch, 1, walker);
}
}
......
......@@ -659,12 +659,7 @@ static int sfb_delete(struct Qdisc *sch, unsigned long cl,
static void sfb_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
if (!walker->stop) {
if (walker->count >= walker->skip)
if (walker->fn(sch, 1, walker) < 0) {
walker->stop = 1;
return;
}
walker->count++;
tc_qdisc_stats_dump(sch, 1, walker);
}
}
......
......@@ -888,16 +888,12 @@ static void sfq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
return;
for (i = 0; i < q->divisor; i++) {
if (q->ht[i] == SFQ_EMPTY_SLOT ||
arg->count < arg->skip) {
if (q->ht[i] == SFQ_EMPTY_SLOT) {
arg->count++;
continue;
}
if (arg->fn(sch, i + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, i + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -265,15 +265,8 @@ static void skbprio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
return;
for (i = 0; i < SKBPRIO_MAX_PRIORITY; i++) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, i + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, i + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -1953,11 +1953,8 @@ static void taprio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
arg->count = arg->skip;
for (ntx = arg->skip; ntx < dev->num_tx_queues; ntx++) {
if (arg->fn(sch, ntx + 1, arg) < 0) {
arg->stop = 1;
if (!tc_qdisc_stats_dump(sch, ntx + 1, arg))
break;
}
arg->count++;
}
}
......
......@@ -580,12 +580,7 @@ static unsigned long tbf_find(struct Qdisc *sch, u32 classid)
static void tbf_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
if (!walker->stop) {
if (walker->count >= walker->skip)
if (walker->fn(sch, 1, walker) < 0) {
walker->stop = 1;
return;
}
walker->count++;
tc_qdisc_stats_dump(sch, 1, walker);
}
}
......
This diff is collapsed.
[
{
"id": "3460",
"name": "Create CBQ with default setting",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbq 1: root refcnt [0-9]+ rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "0592",
"name": "Create CBQ with mpu",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000 mpu 1000",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbq 1: root refcnt [0-9]+ rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "4684",
"name": "Create CBQ with valid cell num",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000 cell 128",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbq 1: root refcnt [0-9]+ rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "4345",
"name": "Create CBQ with invalid cell num",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000 cell 100",
"expExitCode": "1",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbq 1: root refcnt [0-9]+ rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "4525",
"name": "Create CBQ with valid ewma",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000 ewma 16",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbq 1: root refcnt [0-9]+ rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "6784",
"name": "Create CBQ with invalid ewma",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000 ewma 128",
"expExitCode": "1",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbq 1: root refcnt [0-9]+ rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "5468",
"name": "Delete CBQ with handle",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000"
],
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbq 1: root refcnt [0-9]+ rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "492a",
"name": "Show CBQ class",
"category": [
"qdisc",
"cbq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbq bandwidth 10000 avpkt 9000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class cbq 1: root rate 10Kbit \\(bounded,isolated\\) prio no-transmit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]
[
{
"id": "1820",
"name": "Create CBS with default setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbs",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 0 locredit 0 sendslope 0 idleslope 0 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "1532",
"name": "Create CBS with hicredit setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbs hicredit 64",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 64 locredit 0 sendslope 0 idleslope 0 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "2078",
"name": "Create CBS with locredit setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbs locredit 10",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 0 locredit 10 sendslope 0 idleslope 0 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "9271",
"name": "Create CBS with sendslope setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbs sendslope 888",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 0 locredit 0 sendslope 888 idleslope 0 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "0482",
"name": "Create CBS with idleslope setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbs idleslope 666",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 0 locredit 0 sendslope 0 idleslope 666 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "e8f3",
"name": "Create CBS with multiple setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbs hicredit 10 locredit 75 sendslope 2 idleslope 666",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 10 locredit 75 sendslope 2 idleslope 666 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "23c9",
"name": "Replace CBS with sendslope setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root cbs idleslope 666"
],
"cmdUnderTest": "$TC qdisc replace dev $DUMMY handle 1: root cbs sendslope 10",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 0 locredit 0 sendslope 10 idleslope 0 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "a07a",
"name": "Change CBS with idleslope setting",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root cbs idleslope 666"
],
"cmdUnderTest": "$TC qdisc change dev $DUMMY handle 1: root cbs idleslope 1",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 0 locredit 0 sendslope 0 idleslope 1 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "43b3",
"name": "Delete CBS with handle",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root cbs idleslope 666"
],
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc cbs 1: root refcnt [0-9]+ hicredit 0 locredit 0 sendslope 0 idleslope 1 offload 0.*qdisc pfifo 0: parent 1: limit 1000p",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "9472",
"name": "Show CBS class",
"category": [
"qdisc",
"cbs"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root cbs",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class cbs 1:[0-9]+ parent 1:",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]
[
{
"id": "0385",
"name": "Create DRR with default setting",
"category": [
"qdisc",
"drr"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root drr",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc drr 1: root refcnt [0-9]+",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "2375",
"name": "Delete DRR with handle",
"category": [
"qdisc",
"drr"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root drr"
],
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc drr 1: root refcnt [0-9]+",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "3092",
"name": "Show DRR class",
"category": [
"qdisc",
"drr"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root drr",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class drr 1:",
"matchCount": "0",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]
[
{
"id": "6345",
"name": "Create DSMARK with default setting",
"category": [
"qdisc",
"dsmark"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root dsmark indices 1024",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc dsmark 1: root refcnt [0-9]+ indices 0x0400",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "3462",
"name": "Create DSMARK with default_index setting",
"category": [
"qdisc",
"dsmark"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root dsmark indices 1024 default_index 512",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc dsmark 1: root refcnt [0-9]+ indices 0x0400 default_index 0x0200",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "ca95",
"name": "Create DSMARK with set_tc_index flag",
"category": [
"qdisc",
"dsmark"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root dsmark indices 1024 set_tc_index",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc dsmark 1: root refcnt [0-9]+ indices 0x0400 set_tc_index",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "a950",
"name": "Create DSMARK with multiple setting",
"category": [
"qdisc",
"dsmark"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root dsmark indices 1024 default_index 1024 set_tc_index",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc dsmark 1: root refcnt [0-9]+ indices 0x0400 default_index 0x0400 set_tc_index",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "4092",
"name": "Delete DSMARK with handle",
"category": [
"qdisc",
"dsmark"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root dsmark indices 1024 default_index 1024"
],
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc dsmark 1: root refcnt [0-9]+ indices 0x0400",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "5930",
"name": "Show DSMARK class",
"category": [
"qdisc",
"dsmark"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root dsmark indices 1024",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class dsmark 1:",
"matchCount": "0",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]
[
{
"id": "3254",
"name": "Create HFSC with default setting",
"category": [
"qdisc",
"hfsc"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root hfsc",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc hfsc 1: root refcnt [0-9]+",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "0289",
"name": "Create HFSC with class sc and ul rate setting",
"category": [
"qdisc",
"hfsc"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc sc rate 20000 ul rate 10000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 20Kbit ul m1 0bit d 0us m2 10Kbit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "846a",
"name": "Create HFSC with class sc umax and dmax setting",
"category": [
"qdisc",
"hfsc"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc sc umax 1540 dmax 5ms rate 10000 ul rate 10000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class hfsc 1:1 parent 1: sc m1 2464Kbit d 5ms m2 10Kbit ul m1 0bit d 0us m2 10Kbit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "5413",
"name": "Create HFSC with class rt and ls rate setting",
"category": [
"qdisc",
"hfsc"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc rt rate 20000 ls rate 10000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class hfsc 1:1 parent 1: rt m1 0bit d 0us m2 20Kbit ls m1 0bit d 0us m2 10Kbit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "9312",
"name": "Create HFSC with class rt umax and dmax setting",
"category": [
"qdisc",
"hfsc"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc rt umax 1540 dmax 5ms rate 10000 ls rate 10000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class hfsc 1:1 parent 1: rt m1 2464Kbit d 5ms m2 10Kbit ls m1 0bit d 0us m2 10Kbit",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "6931",
"name": "Delete HFSC with handle",
"category": [
"qdisc",
"hfsc"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
],
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc hfsc 1: root refcnt [0-9]+",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "8436",
"name": "Show HFSC class",
"category": [
"qdisc",
"hfsc"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root hfsc",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class hfsc 1: root",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]
[
{
"id": "0904",
"name": "Create HTB with default setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root htb",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc htb 1: root refcnt [0-9]+ r2q 10 default 0 direct_packets_stat.*direct_qlen",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "3906",
"name": "Create HTB with default-N setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root htb default 10",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc htb 1: root refcnt [0-9]+ r2q 10 default 0x10 direct_packets_stat.* direct_qlen",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "8492",
"name": "Create HTB with r2q setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root htb r2q 5",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc htb 1: root refcnt [0-9]+ r2q 5 default 0 direct_packets_stat.*direct_qlen",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "9502",
"name": "Create HTB with direct_qlen setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root htb direct_qlen 1024",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc htb 1: root refcnt [0-9]+ r2q 10 default 0 direct_packets_stat.*direct_qlen 1024",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "b924",
"name": "Create HTB with class rate and burst setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 20kbit burst 1000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class htb 1:1 root prio 0 rate 20Kbit ceil 20Kbit burst 1000b cburst 1600b",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "4359",
"name": "Create HTB with class mpu setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 20Kbit mpu 64",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class htb 1:1 root prio 0 rate 20Kbit ceil 20Kbit burst 1600b cburst 1600b",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "9048",
"name": "Create HTB with class prio setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 20Kbit prio 1",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class htb 1:1 root prio 1 rate 20Kbit ceil 20Kbit burst 1600b cburst 1600b",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "4994",
"name": "Create HTB with class ceil setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 20Kbit ceil 10Kbit",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class htb 1:1 root prio 0 rate 20Kbit ceil 10Kbit burst 1600b cburst 1600b",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "9523",
"name": "Create HTB with class cburst setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 20Kbit cburst 2000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class htb 1:1 root prio 0 rate 20Kbit ceil 20Kbit burst 1600b cburst 2000b",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "5353",
"name": "Create HTB with class mtu setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 20Kbit mtu 2048",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class htb 1:1 root prio 0 rate 20Kbit ceil 20Kbit burst 2Kb cburst 2Kb",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "346a",
"name": "Create HTB with class quantum setting",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 20Kbit quantum 2048",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class htb 1:1 root prio 0 rate 20Kbit ceil 20Kbit burst 1600b cburst 1600b",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "303a",
"name": "Delete HTB with handle",
"category": [
"qdisc",
"htb"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root htb r2q 5"
],
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc htb 1: root refcnt [0-9]+",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
}
]
......@@ -98,5 +98,25 @@
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "0521",
"name": "Show ingress class",
"category": [
"qdisc",
"ingress"
],
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY ingress",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class ingress",
"matchCount": "0",
"teardown": [
"$TC qdisc del dev $DUMMY ingress",
"$IP link del dev $DUMMY type dummy"
]
}
]
......@@ -133,5 +133,27 @@
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
}
},
{
"id": "1023",
"name": "Show mq class",
"category": [
"qdisc",
"mq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 4\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: mq",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $ETH",
"matchPattern": "class mq 1:[0-9]+ root",
"matchCount": "4",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
}
]
[
{
"id": "9903",
"name": "Add mqprio Qdisc to multi-queue device (8 queues)",
"category": [
"qdisc",
"mqprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: mqprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 hw 0",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc mqprio 1: root tc 8 map 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0.*queues:\\(0:0\\) \\(1:1\\) \\(2:2\\) \\(3:3\\) \\(4:4\\) \\(5:5\\) \\(6:6\\) \\(7:7\\)",
"matchCount": "1",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "453a",
"name": "Delete nonexistent mqprio Qdisc",
"category": [
"qdisc",
"mqprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 4\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc del dev $ETH root handle 1: mqprio",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc mqprio 1: root",
"matchCount": "0",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "5292",
"name": "Delete mqprio Qdisc twice",
"category": [
"qdisc",
"mqprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
"$TC qdisc add dev $ETH root handle 1: mqprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 hw 0",
"$TC qdisc del dev $ETH root handle 1:"
],
"cmdUnderTest": "$TC qdisc del dev $ETH root handle 1:",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc mqprio 1: root",
"matchCount": "0",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "45a9",
"name": "Add mqprio Qdisc to single-queue device",
"category": [
"qdisc",
"mqprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: mqprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 hw 0",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc mqprio 1: root",
"matchCount": "0",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "2ba9",
"name": "Show mqprio class",
"category": [
"qdisc",
"mqprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: mqprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 hw 0",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $ETH",
"matchPattern": "class mqprio 1:",
"matchCount": "16",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
}
]
[
{
"id": "20ba",
"name": "Add multiq Qdisc to multi-queue device (8 queues)",
"category": [
"qdisc",
"multiq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: multiq",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc multiq 1: root refcnt [0-9]+ bands 8",
"matchCount": "1",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "4301",
"name": "List multiq Class",
"category": [
"qdisc",
"multiq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: multiq",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $ETH",
"matchPattern": "class multiq 1:[0-9]+ parent 1:",
"matchCount": "8",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "7832",
"name": "Delete nonexistent multiq Qdisc",
"category": [
"qdisc",
"multiq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 4\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc del dev $ETH root handle 1: multiq",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc multiq 1: root",
"matchCount": "0",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "2891",
"name": "Delete multiq Qdisc twice",
"category": [
"qdisc",
"multiq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
"$TC qdisc add dev $ETH root handle 1: multiq",
"$TC qdisc del dev $ETH root handle 1:"
],
"cmdUnderTest": "$TC qdisc del dev $ETH root handle 1:",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc mqprio 1: root",
"matchCount": "0",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
},
{
"id": "1329",
"name": "Add multiq Qdisc to single-queue device",
"category": [
"qdisc",
"multiq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"echo \"1 1\" > /sys/bus/netdevsim/new_device"
],
"cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: multiq",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $ETH",
"matchPattern": "qdisc multiq 1: root",
"matchCount": "0",
"teardown": [
"echo \"1\" > /sys/bus/netdevsim/del_device"
]
}
]
This diff is collapsed.
......@@ -272,5 +272,25 @@
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "2410",
"name": "Show prio class",
"category": [
"qdisc",
"prio"
],
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root prio",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class prio 1:[0-9]+ parent 1:",
"matchCount": "3",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root prio",
"$IP link del dev $DUMMY type dummy"
]
}
]
[
{
"id": "0582",
"name": "Create QFQ with default setting",
"category": [
"qdisc",
"qfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root qfq",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc qfq 1: root refcnt [0-9]+",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "c9a3",
"name": "Create QFQ with class weight setting",
"category": [
"qdisc",
"qfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root qfq"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 qfq weight 100",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class qfq 1:1 root weight 100 maxpkt",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "8452",
"name": "Create QFQ with class maxpkt setting",
"category": [
"qdisc",
"qfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root qfq"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 qfq maxpkt 2000",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class qfq 1:1 root weight 1 maxpkt 2000",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "d920",
"name": "Create QFQ with multiple class setting",
"category": [
"qdisc",
"qfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root qfq",
"$TC class add dev $DUMMY parent 1: classid 1:1 qfq weight 100"
],
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:2 qfq weight 200",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class qfq 1:[0-9]+ root weight [0-9]+00 maxpkt",
"matchCount": "2",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "0548",
"name": "Delete QFQ with handle",
"category": [
"qdisc",
"qfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root qfq",
"$TC class add dev $DUMMY parent 1: classid 1:1 qfq weight 100"
],
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "qdisc qfq 1: root refcnt [0-9]+",
"matchCount": "0",
"teardown": [
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "5901",
"name": "Show QFQ class",
"category": [
"qdisc",
"qfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root qfq",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class qfq 1:",
"matchCount": "0",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]
......@@ -181,5 +181,28 @@
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "290a",
"name": "Show RED class",
"category": [
"qdisc",
"red"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root red limit 1M avpkt 1500 min 100K max 300K",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class red 1:[0-9]+ parent 1:",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment