All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhengchao Shao <shaozhengchao@huawei.com>
To: <netdev@vger.kernel.org>, <cake@lists.bufferbloat.net>,
	<linux-kselftest@vger.kernel.org>, <jhs@mojatatu.com>,
	<xiyou.wangcong@gmail.com>, <jiri@resnulli.us>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <toke@toke.dk>, <vinicius.gomes@intel.com>,
	<stephen@networkplumber.org>, <shuah@kernel.org>,
	<victor@mojatatu.com>
Cc: <zhijianx.li@intel.com>, <weiyongjun1@huawei.com>,
	<yuehaibing@huawei.com>, <shaozhengchao@huawei.com>
Subject: [PATCH net-next 11/18] selftests/tc-testings: add selftests for mqprio qdisc
Date: Fri, 16 Sep 2022 11:05:37 +0800	[thread overview]
Message-ID: <20220916030544.228274-12-shaozhengchao@huawei.com> (raw)
In-Reply-To: <20220916030544.228274-1-shaozhengchao@huawei.com>

Test 9903: Add mqprio Qdisc to multi-queue device (8 queues)
Test 453a: Delete nonexistent mqprio Qdisc
Test 5294: Delete mqprio Qdisc twice
Test 45a9: Add mqprio Qdisc to single-queue device
Test 2ba9: Show mqprio class

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 .../tc-testing/tc-tests/qdiscs/mqprio.json    | 114 ++++++++++++++++++
 1 file changed, 114 insertions(+)
 create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/mqprio.json

diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mqprio.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mqprio.json
new file mode 100644
index 000000000000..eb598658161c
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mqprio.json
@@ -0,0 +1,114 @@
+[
+    {
+        "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": "5294",
+        "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"
+        ]
+    }
+]
-- 
2.17.1


  parent reply	other threads:[~2022-09-16  3:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  3:05 [PATCH net-next 00/18] refactor duplicate codes in the qdisc class walk function Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 01/18] net/sched: sch_api: add helper for tc qdisc walker stats dump Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 02/18] net/sched: use tc_qdisc_stats_dump() in qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 03/18] selftests/tc-testings: add selftests for cake qdisc Zhengchao Shao
2022-09-16 20:32   ` Victor Nogueira
2022-09-17  1:48     ` shaozhengchao
2022-09-16  3:05 ` [PATCH net-next 04/18] selftests/tc-testings: add selftests for cbq qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 05/18] selftests/tc-testings: add selftests for cbs qdisc Zhengchao Shao
2022-09-16 20:36   ` Victor Nogueira
2022-09-16  3:05 ` [PATCH net-next 06/18] selftests/tc-testings: add selftests for drr qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 07/18] selftests/tc-testings: add selftests for dsmark qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 08/18] selftests/tc-testings: add selftests for fq_codel qdisc Zhengchao Shao
2022-09-16 20:38   ` Victor Nogueira
2022-09-16  3:05 ` [PATCH net-next 09/18] selftests/tc-testings: add selftests for hfsc qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 10/18] selftests/tc-testings: add selftests for htb qdisc Zhengchao Shao
2022-09-16  3:05 ` Zhengchao Shao [this message]
2022-09-16  3:05 ` [PATCH net-next 12/18] selftests/tc-testings: add selftests for multiq qdisc Zhengchao Shao
2022-09-16 20:40   ` Victor Nogueira
2022-09-16  3:05 ` [PATCH net-next 13/18] selftests/tc-testings: add selftests for netem qdisc Zhengchao Shao
2022-09-16 20:44   ` Victor Nogueira
2022-09-16  3:05 ` [PATCH net-next 14/18] selftests/tc-testings: add selftests for qfq qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 15/18] selftests/tc-testings: add show class case for ingress qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 16/18] selftests/tc-testings: add show class case for mq qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 17/18] selftests/tc-testings: add show class case for prio qdisc Zhengchao Shao
2022-09-16  3:05 ` [PATCH net-next 18/18] selftests/tc-testings: add show class case for red qdisc Zhengchao Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220916030544.228274-12-shaozhengchao@huawei.com \
    --to=shaozhengchao@huawei.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=toke@toke.dk \
    --cc=victor@mojatatu.com \
    --cc=vinicius.gomes@intel.com \
    --cc=weiyongjun1@huawei.com \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yuehaibing@huawei.com \
    --cc=zhijianx.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.