Skip to content

Commit c958014

Browse files
committed
test: drop the mqprio branches from the QoS tests
No port renders mqprio any more. The traffic class test expects the offload capability to follow the ets qdisc's offloaded flag, and the scheduling tests skip a switch port whose driver did not take the scheduler, since the fabric forwards past a software one. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent cbfaf93 commit c958014

7 files changed

Lines changed: 19 additions & 29 deletions

File tree

‎test/case/interfaces/qos_factory_default/test.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ def default_table():
8484
if not qdisc:
8585
return False
8686
opts = qdisc.get("options", {})
87-
if qdisc["kind"] == "mqprio":
88-
return opts.get("map", [])[:8] == TABLE_8_5[num_tc]
8987
if qdisc["kind"] == "ets":
9088
return (opts.get("bands") == num_tc and opts.get("strict") == num_tc and
9189
opts.get("priomap", [])[:8] == [num_tc - 1 - tc for tc in TABLE_8_5[num_tc]])

‎test/case/interfaces/qos_mixed_selection/test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def prio_map(num_tc):
5151

5252
uevent = tgtssh.runsh(f"cat /sys/class/net/{td1}/uevent").stdout
5353
if "DEVTYPE=dsa" in uevent.split() and \
54-
(qos.root_qdisc(tgtssh, td1) or {}).get("kind") == "mqprio":
55-
print("switch fabric queues by the class map but keeps its own scheduler, skipping")
54+
"transmission-selection" not in qos.offload(target, td1):
55+
print("switch fabric forwards past a scheduler its driver does not offload, skipping")
5656
test.skip()
5757

5858
with test.step("Bridge the two ports, trust DSCP on ingress, EF strict above AF21 and CS1 at 2:1"):

‎test/case/interfaces/qos_strict_priority/test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def prio_map(num_tc, entries):
6060

6161
uevent = tgtssh.runsh(f"cat /sys/class/net/{td1}/uevent").stdout
6262
if "DEVTYPE=dsa" in uevent.split() and \
63-
(qos.root_qdisc(tgtssh, td1) or {}).get("kind") == "mqprio":
64-
print("switch fabric queues by the class map but keeps its own scheduler, skipping")
63+
"transmission-selection" not in qos.offload(target, td1):
64+
print("switch fabric forwards past a scheduler its driver does not offload, skipping")
6565
test.skip()
6666

6767
with test.step("Bridge the two ports, trust DSCP on ingress, priority 0 on the top class"):

‎test/case/interfaces/qos_traffic_class/test.adoc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ ifdef::topdoc[:imagesdir: {topdoc}../../test/case/interfaces/qos_traffic_class]
66

77
Configure a custom priority to traffic class map on a port with the two
88
lowest classes sharing 67:33 and the rest strict priority, and verify the
9-
root qdisc reflects it. A driver with mqprio offload shows an offloaded
10-
mqprio with the same map; otherwise the kernel runs an ets qdisc with the
11-
strict bands first, the shares as quanta of one frame per percent, and
12-
the priomap inverted as 802.1Q numbering requires.
9+
root qdisc reflects it: an ets qdisc with the strict bands first, the
10+
shares as quanta of one frame per percent, and the priomap inverted as
11+
802.1Q numbering requires. A driver that offloads it marks the qdisc
12+
offloaded.
1313

1414
The port's class count comes from its transmit queues, or eight for a
1515
single-queue port. Switching the table to the ieee-sr preset must put

‎test/case/interfaces/qos_traffic_class/test.py‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
55
Configure a custom priority to traffic class map on a port with the two
66
lowest classes sharing 67:33 and the rest strict priority, and verify the
7-
root qdisc reflects it. A driver with mqprio offload shows an offloaded
8-
mqprio with the same map; otherwise the kernel runs an ets qdisc with the
9-
strict bands first, the shares as quanta of one frame per percent, and
10-
the priomap inverted as 802.1Q numbering requires.
7+
root qdisc reflects it: an ets qdisc with the strict bands first, the
8+
shares as quanta of one frame per percent, and the priomap inverted as
9+
802.1Q numbering requires. A driver that offloads it marks the qdisc
10+
offloaded.
1111
1212
The port's class count comes from its transmit queues, or eight for a
1313
single-queue port. Switching the table to the ieee-sr preset must put
@@ -69,8 +69,6 @@ def qdisc_matches(qdisc, num_tc, prio_map, strict, quanta):
6969
if not qdisc:
7070
return False
7171
opts = qdisc.get("options", {})
72-
if qdisc["kind"] == "mqprio":
73-
return opts.get("map", [])[:8] == prio_map
7472
if qdisc["kind"] == "ets":
7573
return (opts.get("bands") == num_tc and opts.get("strict") == strict
7674
and opts.get("quanta", []) == quanta
@@ -122,9 +120,9 @@ def qdisc_matches(qdisc, num_tc, prio_map, strict, quanta):
122120
print(json.dumps(root_qdisc(tgtssh, port)))
123121

124122
with test.step("Verify the offload capability matches the qdisc"):
125-
kind = root_qdisc(tgtssh, port)["kind"]
123+
taken = root_qdisc(tgtssh, port).get("offloaded", False)
126124
until(lambda: ("transmission-selection" in capabilities(target, port).get("offload", []))
127-
== (kind == "mqprio"))
125+
== taken)
128126

129127
with test.step("Switch to the ieee-sr preset and verify SR classes on top"):
130128
target.delete_xpath(qos_xpath(port, "/egress"))

‎test/case/interfaces/qos_weighted_sharing/test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def prio_map(num_tc):
5656

5757
uevent = tgtssh.runsh(f"cat /sys/class/net/{td1}/uevent").stdout
5858
if "DEVTYPE=dsa" in uevent.split() and \
59-
(qos.root_qdisc(tgtssh, td1) or {}).get("kind") == "mqprio":
60-
print("switch fabric queues by the class map but keeps its own scheduler, skipping")
59+
"transmission-selection" not in qos.offload(target, td1):
60+
print("switch fabric forwards past a scheduler its driver does not offload, skipping")
6161
test.skip()
6262

6363
with test.step("Bridge the two ports, trust DSCP on ingress, EF and CS1 in two weighted classes"):

‎test/infamy/qos.py‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
and traffic marked the way the tests need it.
44
55
Traffic class numbering follows IEEE 802.1Q: class 0 is the lowest. The
6-
tc ets qdisc numbers its bands the other way and mqprio has classes of
7-
its own, so everything here talks in traffic classes and hides both.
6+
tc ets qdisc numbers its bands the other way, so everything here talks
7+
in traffic classes and hides that.
88
"""
99
import json
1010
import re
@@ -35,8 +35,6 @@
3535
STRICT = "ieee802-dot1q-types:strict-priority"
3636
ETS = "ieee802-dot1q-types:enhanced-transmission-selection"
3737

38-
# mqprio addresses its traffic classes from this minor number upwards
39-
MQPRIO_TC_BASE = 0xffe0
4038
ETS_QUANTUM_UNIT = 1514 # one frame per percent of bandwidth, as rendered
4139

4240

@@ -86,7 +84,7 @@ def root_qdisc(ssh, port):
8684

8785

8886
def scheduler(ssh, port):
89-
"""The ets or mqprio qdisc: the root, or the child of a tbf root"""
87+
"""The ets qdisc: the root, or the child of a tbf root"""
9088
root = root_qdisc(ssh, port)
9189
if root and root["kind"] == "tbf":
9290
for qdisc in qdiscs(ssh, port):
@@ -105,8 +103,6 @@ def scheduler_matches(qdisc, num_tc, prio_map, strict=None, quanta=None):
105103
if not qdisc:
106104
return False
107105
opts = qdisc.get("options", {})
108-
if qdisc["kind"] == "mqprio":
109-
return opts.get("map", [])[:8] == list(prio_map)
110106
if qdisc["kind"] == "ets":
111107
if opts.get("bands") != num_tc:
112108
return False
@@ -134,8 +130,6 @@ def tc_of(kind, handle):
134130
minor = int(handle.split(":")[1], 16)
135131
if kind == "ets":
136132
return num_tc - minor # band 0, minor 1, is the top class
137-
if kind == "mqprio" and minor >= MQPRIO_TC_BASE:
138-
return minor - MQPRIO_TC_BASE
139133
return None
140134

141135
if out.startswith("["):

0 commit comments

Comments
 (0)