Skip to contentSkip to conversation

man: tc-mqprio: extend prio-tc-queue mapping with examples

PATCH Applied Péter Antal 4 participants 10 messages Feb 20, 2023 – Mar 4, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 man: tc-mqprio: extend prio-tc-queue mapping with examples

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

---
 man/man8/tc-mqprio.8 | 96 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
man/man8/tc-mqprio.8 +96 -0
index 4b9e942e..16ecb9a1 100644
@@ -98,6 +98,7 @@ belong to an application. See kernel and cgroup documentation for details.
 .TP
 num_tc
 Number of traffic classes to use. Up to 16 classes supported.
+You cannot have more classes than queues
 
 .TP
 map
@@ -119,6 +120,8 @@ Set to
 to support hardware offload. Set to
 .B 0
 to configure user specified values in software only.
+The default value of this parameter is
+.B 1
 
 .TP
 mode
@@ -146,5 +149,98 @@ max_rate
 Maximum value of bandwidth rate limit for a traffic class.
 
 
+.SH EXAMPLE
+
+The following example shows how to attach priorities to 4 traffic classes ("num_tc 4"),
+and then how to pair these traffic classes with 4 hardware queues with mqprio,
+with hardware coordination ("hw 1", or does not specified, because 1 is the default value).
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,
+tc2 is mapped to q2, and tc3 is mapped q3.
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 4 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \
+              queues 1@0 1@1 1@2 1@3 \
+              hw 1
+.EE
+
+The next example shows how to attach priorities to 3 traffic classes ("num_tc 3"),
+and how to pair these traffic classes with 4 queues,
+without hardware coordination ("hw 0").
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,
+tc2 and is mapped to q2 and q3, where the queue selection between these
+two queues is somewhat randomly decided.
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 3 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \
+              queues 1@0 1@1 2@2 \
+              hw 0
+.EE
+
+
+In both cases from above the priority values from 0 to 3 (prio0-3) are
+mapped to tc0, prio4-7 are mapped to tc1, and the
+prio8-11 are mapped to tc2 ("map" attribute). The last four priority values
+(prio12-15) are mapped in different ways in the two examples.
+They are mapped to tc3 in the first example and mapped to tc2 in the second example.
+The values of these two examples are the following:
+
+ ┌────┬────┬───────┐  ┌────┬────┬────────┐
+ │Prio│ tc │ queue │  │Prio│ tc │  queue │
+ ├────┼────┼───────┤  ├────┼────┼────────┤
+ │  0 │  0 │     0 │  │  0 │  0 │      0 │
+ │  1 │  0 │     0 │  │  1 │  0 │      0 │
+ │  2 │  0 │     0 │  │  2 │  0 │      0 │
+ │  3 │  0 │     0 │  │  3 │  0 │      0 │
+ │  4 │  1 │     1 │  │  4 │  1 │      1 │
+ │  5 │  1 │     1 │  │  5 │  1 │      1 │
+ │  6 │  1 │     1 │  │  6 │  1 │      1 │
+ │  7 │  1 │     1 │  │  7 │  1 │      1 │
+ │  8 │  2 │     2 │  │  8 │  2 │ 2 or 3 │
+ │  9 │  2 │     2 │  │  9 │  2 │ 2 or 3 │
+ │ 10 │  2 │     2 │  │ 10 │  2 │ 2 or 3 │
+ │ 11 │  2 │     2 │  │ 11 │  2 │ 2 or 3 │
+ │ 12 │  3 │     3 │  │ 12 │  2 │ 2 or 3 │
+ │ 13 │  3 │     3 │  │ 13 │  2 │ 2 or 3 │
+ │ 14 │  3 │     3 │  │ 14 │  2 │ 2 or 3 │
+ │ 15 │  3 │     3 │  │ 15 │  2 │ 2 or 3 │
+ └────┴────┴───────┘  └────┴────┴────────┘
+       example1             example2
+
+
+Another example of queue mapping is the following.
+There are 5 traffic classes, and there are 8 hardware queues.
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 5 \
+              map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \
+              queues 1@0 2@1 1@3 1@4 3@5
+.EE
+
+The value mapping is the following for this example:
+
+        ┌───────┐
+ tc0────┤Queue 0│◄────1@0
+        ├───────┤
+      ┌─┤Queue 1│◄────2@1
+ tc1──┤ ├───────┤
+      └─┤Queue 2│
+        ├───────┤
+ tc2────┤Queue 3│◄────1@3
+        ├───────┤
+ tc3────┤Queue 4│◄────1@4
+        ├───────┤
+      ┌─┤Queue 5│◄────3@5
+      │ ├───────┤
+ tc4──┼─┤Queue 6│
+      │ ├───────┤
+      └─┤Queue 7│
+        └───────┘
+
+
 .SH AUTHORS
 John Fastabend, <[email protected]>
Signature · 1 line
2.34.1
#1 lore raw

Hi!

Quoted 2 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

Thank you Péter for doing this! The same principles however applies to tc-taprio as well so it would be nice to see a v2 with those included too.

Quoted 22 lines

---
 man/man8/tc-mqprio.8 | 96
++++++++++++++++++++++++++++++++++++++++++++

 1 file changed, 96 insertions(+)
man/man8/tc-mqprio.8 +0 -0
index 4b9e942e..16ecb9a1 100644
@@ -98,6 +98,7 @@ belong to an application. See kernel and cgroup

documentation for details.
 .TP
 num_tc
 Number of traffic classes to use. Up to 16 classes supported. +You cannot have more classes than queues

 .TP
 map

man/man8/tc-mqprio.8 +0 -0
@@ -119,6 +120,8 @@ Set to
Quoted 5 lines

 to support hardware offload. Set to
 .B 0
 to configure user specified values in software only. +The default value of this parameter is
+.B 1

It especially important when applied to multi TX queue veth. Vladimir already addressed this in kernel UAPI to give more expressive error message:
https://lore.kernel.org/netdev/[email protected]/T/#u

But knowing the default parameter from the manpage is still a good addition IMO.

Quoted 110 lines


 .TP
 mode

man/man8/tc-mqprio.8 +0 -0
@@ -146,5 +149,98 @@ max_rate

 Maximum value of bandwidth rate limit for a traffic class.

+.SH EXAMPLE

man/man8/tc-mqprio.8 +2 -0
+
+The following example shows how to attach priorities to 4 traffic

classes ("num_tc 4"),
+and then how to pair these traffic classes with 4 hardware queues with mqprio,
+with hardware coordination ("hw 1", or does not specified, because 1 is the default value).
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,

man/man8/tc-mqprio.8 +11 -0
+tc2 is mapped to q2, and tc3 is mapped q3.
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 4 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \
+              queues 1@0 1@1 1@2 1@3 \
+              hw 1
+.EE
+
+The next example shows how to attach priorities to 3 traffic classes

("num_tc 3"),

man/man8/tc-mqprio.8 +3 -0
+and how to pair these traffic classes with 4 queues,
+without hardware coordination ("hw 0").
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is

mapped to q1,
+tc2 and is mapped to q2 and q3, where the queue selection between these

man/man8/tc-mqprio.8 +12 -0
+two queues is somewhat randomly decided.
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 3 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \
+              queues 1@0 1@1 2@2 \
+              hw 0
+.EE
+
+
+In both cases from above the priority values from 0 to 3 (prio0-3)

are

man/man8/tc-mqprio.8 +2 -0
+mapped to tc0, prio4-7 are mapped to tc1, and the
+prio8-11 are mapped to tc2 ("map" attribute). The last four priority

values

man/man8/tc-mqprio.8 +2 -0
+(prio12-15) are mapped in different ways in the two examples.
+They are mapped to tc3 in the first example and mapped to tc2 in the

second example.

man/man8/tc-mqprio.8 +56 -0
+The values of these two examples are the following:
+
+ ┌────┬────┬───────┐  ┌────┬────┬────────┐
+ │Prio│ tc │ queue │  │Prio│ tc │  queue │
+ ├────┼────┼───────┤  ├────┼────┼────────┤
+ │  0 │  0 │     0 │  │  0 │  0 │      0 │
+ │  1 │  0 │     0 │  │  1 │  0 │      0 │
+ │  2 │  0 │     0 │  │  2 │  0 │      0 │
+ │  3 │  0 │     0 │  │  3 │  0 │      0 │
+ │  4 │  1 │     1 │  │  4 │  1 │      1 │
+ │  5 │  1 │     1 │  │  5 │  1 │      1 │
+ │  6 │  1 │     1 │  │  6 │  1 │      1 │
+ │  7 │  1 │     1 │  │  7 │  1 │      1 │
+ │  8 │  2 │     2 │  │  8 │  2 │ 2 or 3 │
+ │  9 │  2 │     2 │  │  9 │  2 │ 2 or 3 │
+ │ 10 │  2 │     2 │  │ 10 │  2 │ 2 or 3 │
+ │ 11 │  2 │     2 │  │ 11 │  2 │ 2 or 3 │
+ │ 12 │  3 │     3 │  │ 12 │  2 │ 2 or 3 │
+ │ 13 │  3 │     3 │  │ 13 │  2 │ 2 or 3 │
+ │ 14 │  3 │     3 │  │ 14 │  2 │ 2 or 3 │
+ │ 15 │  3 │     3 │  │ 15 │  2 │ 2 or 3 │
+ └────┴────┴───────┘  └────┴────┴────────┘
+       example1             example2
+
+
+Another example of queue mapping is the following.
+There are 5 traffic classes, and there are 8 hardware queues.
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 5 \
+              map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \
+              queues 1@0 2@1 1@3 1@4 3@5
+.EE
+
+The value mapping is the following for this example:
+
+        ┌───────┐
+ tc0────┤Queue 0│◄────1@0
+        ├───────┤
+      ┌─┤Queue 1│◄────2@1
+ tc1──┤ ├───────┤
+      └─┤Queue 2│
+        ├───────┤
+ tc2────┤Queue 3│◄────1@3
+        ├───────┤
+ tc3────┤Queue 4│◄────1@4
+        ├───────┤
+      ┌─┤Queue 5│◄────3@5
+      │ ├───────┤
+ tc4──┼─┤Queue 6│
+      │ ├───────┤
+      └─┤Queue 7│
+        └───────┘
+
+
Quoted 2 lines

 .SH AUTHORS
 John Fastabend, <[email protected]>

Best,
Ferenc

#2 lore raw
Quoted 9 lines · Ferenc Fejes

Hi!

Quoted 2 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

Thank you Péter for doing this! The same principles however applies to tc-taprio as well so it would be nice to see a v2 with those included too.

I think that the well-established phrase "See mqprio(8) for more details." will do just fine.

#3 lore raw
In reply to Péter Antal

Hi Péter,

Quoted 6 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

---

I think it's great that you are doing this. However, with all due respect, this conflicts with the man page restructuring I am already doing for the frame preemption work. Do you mind if I fix up some things and I pick your patch up, and submit it as part of my series? I have some comments below.

man/man8/tc-mqprio.8 belong to an application. See kernel and cgroup documentation for details. · line 101

Quoted 12 lines
 man/man8/tc-mqprio.8 | 96 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
man/man8/tc-mqprio.8 +1 -0
index 4b9e942e..16ecb9a1 100644
@@ -98,6 +98,7 @@ belong to an application. See kernel and cgroup documentation for details.
 .TP
 num_tc
 Number of traffic classes to use. Up to 16 classes supported.
+You cannot have more classes than queues

More impersonal: "There cannot be more traffic classes than TX queues".

Quoted 13 lines
man/man8/tc-mqprio.8 +2 -0
 .TP
 map
@@ -119,6 +120,8 @@ Set to
 to support hardware offload. Set to
 .B 0
 to configure user specified values in software only.
+The default value of this parameter is
+.B 1
 
 .TP
 mode

man/man8/tc-mqprio.8 max_rate · line 155

Quoted 7 lines
man/man8/tc-mqprio.8 +4 -0
@@ -146,5 +149,98 @@ max_rate
 Maximum value of bandwidth rate limit for a traffic class.
 
 
+.SH EXAMPLE
+
+The following example shows how to attach priorities to 4 traffic classes ("num_tc 4"),
+and then how to pair these traffic classes with 4 hardware queues with mqprio,

"with mqprio" is understated I think, this is the mqprio man page

man/man8/tc-mqprio.8 max_rate · line 156

Quoted 1 line
man/man8/tc-mqprio.8 +1 -0
+with hardware coordination ("hw 1", or does not specified, because 1 is the default value).

Just leave it at that, "hw 1".

man/man8/tc-mqprio.8 max_rate · line 158

Quoted 2 lines
man/man8/tc-mqprio.8 +2 -0
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,
+tc2 is mapped to q2, and tc3 is mapped q3.

Would prefer saying TC0, TXQ0 etc if you don't mind.

Quoted 5 lines
man/man8/tc-mqprio.8 +5 -0
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 4 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \

man/man8/tc-mqprio.8 max_rate · line 173

Quoted 10 lines
man/man8/tc-mqprio.8 +10 -0
+              queues 1@0 1@1 1@2 1@3 \
+              hw 1
+.EE
+
+The next example shows how to attach priorities to 3 traffic classes ("num_tc 3"),
+and how to pair these traffic classes with 4 queues,
+without hardware coordination ("hw 0").
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,
+tc2 and is mapped to q2 and q3, where the queue selection between these
+two queues is somewhat randomly decided.

Would rather say that packets are hashed arbitrarily between TXQ3 and TXQ4, which have the same scheduling priority.

We should probably clarify what "hardware coordination" means, exactly. Without hardware coordination, the device driver is not notified of the number of traffic classes and their mapping to TXQs. The device is not expected to prioritize between traffic classes without hardware coordination.

We should also probably clarify that with hardware coordination, the device driver can install a different TXQ configuration than requested, and that the default TC to TXQ mapping is:

TC 0: 0 queues @ offset 0
TC 1: 0 queues @ offset 0
...
TC N: 0 queues @ offset 0

Should also probably clarify that there is a default prio:tc map of:

.prio_tc_map = { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 1, 1, 3, 3, 3, 3 },

hmm... you gave me more work than I was intending to do :)

Quoted 28 lines
man/man8/tc-mqprio.8 +28 -0
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 3 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \
+              queues 1@0 1@1 2@2 \
+              hw 0
+.EE
+
+
+In both cases from above the priority values from 0 to 3 (prio0-3) are
+mapped to tc0, prio4-7 are mapped to tc1, and the
+prio8-11 are mapped to tc2 ("map" attribute). The last four priority values
+(prio12-15) are mapped in different ways in the two examples.
+They are mapped to tc3 in the first example and mapped to tc2 in the second example.
+The values of these two examples are the following:
+
+ ┌────┬────┬───────┐  ┌────┬────┬────────┐
+ │Prio│ tc │ queue │  │Prio│ tc │  queue │
+ ├────┼────┼───────┤  ├────┼────┼────────┤
+ │  0 │  0 │     0 │  │  0 │  0 │      0 │
+ │  1 │  0 │     0 │  │  1 │  0 │      0 │
+ │  2 │  0 │     0 │  │  2 │  0 │      0 │
+ │  3 │  0 │     0 │  │  3 │  0 │      0 │
+ │  4 │  1 │     1 │  │  4 │  1 │      1 │
+ │  5 │  1 │     1 │  │  5 │  1 │      1 │
+ │  6 │  1 │     1 │  │  6 │  1 │      1 │
+ │  7 │  1 │     1 │  │  7 │  1 │      1 │

man/man8/tc-mqprio.8 max_rate · line 211

Quoted 10 lines
man/man8/tc-mqprio.8 +10 -0
+ │  8 │  2 │     2 │  │  8 │  2 │ 2 or 3 │
+ │  9 │  2 │     2 │  │  9 │  2 │ 2 or 3 │
+ │ 10 │  2 │     2 │  │ 10 │  2 │ 2 or 3 │
+ │ 11 │  2 │     2 │  │ 11 │  2 │ 2 or 3 │
+ │ 12 │  3 │     3 │  │ 12 │  2 │ 2 or 3 │
+ │ 13 │  3 │     3 │  │ 13 │  2 │ 2 or 3 │
+ │ 14 │  3 │     3 │  │ 14 │  2 │ 2 or 3 │
+ │ 15 │  3 │     3 │  │ 15 │  2 │ 2 or 3 │
+ └────┴────┴───────┘  └────┴────┴────────┘
+       example1             example2

What would you say if we didn't put the 2 examples side by side, but kept them separately? Also, I get the feeling that the verbiage above the tables is a bit too much. Having the tables is already good enough.

man/man8/tc-mqprio.8 max_rate · line 215

Quoted 3 lines
man/man8/tc-mqprio.8 +3 -0
+
+Another example of queue mapping is the following.
+There are 5 traffic classes, and there are 8 hardware queues.

I think for maintainability, the examples should be fairly independent, because they might be moved around in the future. This story-like "the following example" -> "the next example" -> "another example" doesn't really work.

man/man8/tc-mqprio.8 max_rate · line 221

Quoted 5 lines
man/man8/tc-mqprio.8 +5 -0
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 5 \
+              map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \
+              queues 1@0 2@1 1@3 1@4 3@5

The formatting here and everywhere doesn't look very well when viewed with "man -l man/man8/tc-mqprio.8". If you look at tc-taprio.8, it uses "\\" to render properly. If you don't mind, I'll do that here too.

Quoted 28 lines
man/man8/tc-mqprio.8 +23 -0
+.EE
+
+The value mapping is the following for this example:
+
+        ┌───────┐
+ tc0────┤Queue 0│◄────1@0
+        ├───────┤
+      ┌─┤Queue 1│◄────2@1
+ tc1──┤ ├───────┤
+      └─┤Queue 2│
+        ├───────┤
+ tc2────┤Queue 3│◄────1@3
+        ├───────┤
+ tc3────┤Queue 4│◄────1@4
+        ├───────┤
+      ┌─┤Queue 5│◄────3@5
+      │ ├───────┤
+ tc4──┼─┤Queue 6│
+      │ ├───────┤
+      └─┤Queue 7│
+        └───────┘
+
+
 .SH AUTHORS
 John Fastabend, <[email protected]>
Signature · 1 line
2.34.1
#4 lore raw

Hi Vladimir,

Vladimir Oltean <[email protected]> ezt írta (időpont: 2023. febr. 20., H, 16:29):

Quoted 7 lines

Hi Péter,

Quoted 3 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

Quoted 8 lines
Quoted 3 lines

---

I think it's great that you are doing this. However, with all due respect, this conflicts with the man page restructuring I am already doing for the frame preemption work. Do you mind if I fix up some things and I pick your patch up, and submit it as part of my series? I have some comments below.

That's all right, thank you for doing this, just please carry my signoff as co-developer if possible.
I agree with most of your suggestions.

Quoted 58 lines

man/man8/tc-mqprio.8 belong to an application. See kernel and cgroup documentation for details. · line 101

Quoted 13 lines
 man/man8/tc-mqprio.8 | 96 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
man/man8/tc-mqprio.8 +1 -0
index 4b9e942e..16ecb9a1 100644
@@ -98,6 +98,7 @@ belong to an application. See kernel and cgroup documentation for details.
 .TP
 num_tc
 Number of traffic classes to use. Up to 16 classes supported.
+You cannot have more classes than queues

More impersonal: "There cannot be more traffic classes than TX queues".

Quoted 13 lines
man/man8/tc-mqprio.8 +2 -0
 .TP
 map
@@ -119,6 +120,8 @@ Set to
 to support hardware offload. Set to
 .B 0
 to configure user specified values in software only.
+The default value of this parameter is
+.B 1
 
 .TP
 mode

man/man8/tc-mqprio.8 max_rate · line 155

Quoted 7 lines
man/man8/tc-mqprio.8 +4 -0
@@ -146,5 +149,98 @@ max_rate
 Maximum value of bandwidth rate limit for a traffic class.
 
 
+.SH EXAMPLE
+
+The following example shows how to attach priorities to 4 traffic classes ("num_tc 4"),
+and then how to pair these traffic classes with 4 hardware queues with mqprio,

"with mqprio" is understated I think, this is the mqprio man page

man/man8/tc-mqprio.8 max_rate · line 156

Quoted 1 line
man/man8/tc-mqprio.8 +1 -0
+with hardware coordination ("hw 1", or does not specified, because 1 is the default value).

Just leave it at that, "hw 1".

man/man8/tc-mqprio.8 max_rate · line 158

Quoted 2 lines
man/man8/tc-mqprio.8 +2 -0
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,
+tc2 is mapped to q2, and tc3 is mapped q3.

Would prefer saying TC0, TXQ0 etc if you don't mind.

Quoted 10 lines
man/man8/tc-mqprio.8 +10 -0
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 4 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \
+              queues 1@0 1@1 1@2 1@3 \
+              hw 1
+.EE
+
+The next example shows how to attach priorities to 3 traffic classes ("num_tc 3"),
Quoted 8 lines

man/man8/tc-mqprio.8 max_rate · line 173

Quoted 5 lines
man/man8/tc-mqprio.8 +5 -0
+and how to pair these traffic classes with 4 queues,
+without hardware coordination ("hw 0").
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,
+tc2 and is mapped to q2 and q3, where the queue selection between these
+two queues is somewhat randomly decided.

Would rather say that packets are hashed arbitrarily between TXQ3 and TXQ4, which have the same scheduling priority.

If I understand it correctly, this depends on the "hw" parameter. So if the driver handles this (hw 1), then it may prioritize a queue over another,
even if they have the same priority.

Quoted 7 lines

We should probably clarify what "hardware coordination" means, exactly. Without hardware coordination, the device driver is not notified of the number of traffic classes and their mapping to TXQs. The device is not expected to prioritize between traffic classes without hardware coordination.

Quoted 9 lines

We should also probably clarify that with hardware coordination, the device driver can install a different TXQ configuration than requested, and that the default TC to TXQ mapping is:

TC 0: 0 queues @ offset 0
TC 1: 0 queues @ offset 0
...
TC N: 0 queues @ offset 0

First time I see hardware coordination in this manual is the hw parameter, so I think we should clarify this there.

Quoted 5 lines

Should also probably clarify that there is a default prio:tc map of:

.prio_tc_map = { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 1, 1, 3, 3, 3, 3 },

hmm... you gave me more work than I was intending to do :)

Sorry about that :)

Quoted 83 lines
Quoted 29 lines
man/man8/tc-mqprio.8 +28 -0
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 3 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \
+              queues 1@0 1@1 2@2 \
+              hw 0
+.EE
+
+
+In both cases from above the priority values from 0 to 3 (prio0-3) are
+mapped to tc0, prio4-7 are mapped to tc1, and the
+prio8-11 are mapped to tc2 ("map" attribute). The last four priority values
+(prio12-15) are mapped in different ways in the two examples.
+They are mapped to tc3 in the first example and mapped to tc2 in the second example.
+The values of these two examples are the following:
+
+ ┌────┬────┬───────┐  ┌────┬────┬────────┐
+ │Prio│ tc │ queue │  │Prio│ tc │  queue │
+ ├────┼────┼───────┤  ├────┼────┼────────┤
+ │  0 │  0 │     0 │  │  0 │  0 │      0 │
+ │  1 │  0 │     0 │  │  1 │  0 │      0 │
+ │  2 │  0 │     0 │  │  2 │  0 │      0 │
+ │  3 │  0 │     0 │  │  3 │  0 │      0 │
+ │  4 │  1 │     1 │  │  4 │  1 │      1 │
+ │  5 │  1 │     1 │  │  5 │  1 │      1 │
+ │  6 │  1 │     1 │  │  6 │  1 │      1 │
+ │  7 │  1 │     1 │  │  7 │  1 │      1 │

man/man8/tc-mqprio.8 max_rate · line 211

Quoted 10 lines
man/man8/tc-mqprio.8 +10 -0
+ │  8 │  2 │     2 │  │  8 │  2 │ 2 or 3 │
+ │  9 │  2 │     2 │  │  9 │  2 │ 2 or 3 │
+ │ 10 │  2 │     2 │  │ 10 │  2 │ 2 or 3 │
+ │ 11 │  2 │     2 │  │ 11 │  2 │ 2 or 3 │
+ │ 12 │  3 │     3 │  │ 12 │  2 │ 2 or 3 │
+ │ 13 │  3 │     3 │  │ 13 │  2 │ 2 or 3 │
+ │ 14 │  3 │     3 │  │ 14 │  2 │ 2 or 3 │
+ │ 15 │  3 │     3 │  │ 15 │  2 │ 2 or 3 │
+ └────┴────┴───────┘  └────┴────┴────────┘
+       example1             example2

What would you say if we didn't put the 2 examples side by side, but kept them separately? Also, I get the feeling that the verbiage above the tables is a bit too much. Having the tables is already good enough.

man/man8/tc-mqprio.8 max_rate · line 215

Quoted 3 lines
man/man8/tc-mqprio.8 +3 -0
+
+Another example of queue mapping is the following.
+There are 5 traffic classes, and there are 8 hardware queues.

I think for maintainability, the examples should be fairly independent, because they might be moved around in the future. This story-like "the following example" -> "the next example" -> "another example" doesn't really work.

man/man8/tc-mqprio.8 max_rate · line 221

Quoted 5 lines
man/man8/tc-mqprio.8 +5 -0
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 5 \
+              map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \
+              queues 1@0 2@1 1@3 1@4 3@5

The formatting here and everywhere doesn't look very well when viewed with "man -l man/man8/tc-mqprio.8". If you look at tc-taprio.8, it uses "\\" to render properly. If you don't mind, I'll do that here too.

Quoted 20 lines
man/man8/tc-mqprio.8 +20 -0
+.EE
+
+The value mapping is the following for this example:
+
+        ┌───────┐
+ tc0────┤Queue 0│◄────1@0
+        ├───────┤
+      ┌─┤Queue 1│◄────2@1
+ tc1──┤ ├───────┤
+      └─┤Queue 2│
+        ├───────┤
+ tc2────┤Queue 3│◄────1@3
+        ├───────┤
+ tc3────┤Queue 4│◄────1@4
+        ├───────┤
+      ┌─┤Queue 5│◄────3@5
+      │ ├───────┤
+ tc4──┼─┤Queue 6│
+      │ ├───────┤
+      └─┤Queue 7│
Quoted 8 lines
Quoted 8 lines
man/man8/tc-mqprio.8 +3 -1
+        └───────┘
+
+
 .SH AUTHORS
 John Fastabend, <[email protected]>
--

2.34.1

Best,
Peter

#5 lore raw

Hi Vladimir!

Quoted 24 lines · Péter Antal

Hi Vladimir,

Vladimir Oltean <[email protected]> ezt írta (időpont: 2023. febr. 20., H, 16:29):

Quoted 11 lines

Hi Péter,

Quoted 6 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

---

Quoted 8 lines

I think it's great that you are doing this. However, with all due respect,
this conflicts with the man page restructuring I am already doing for the
frame preemption work. Do you mind if I fix up some things and I pick your
patch up, and submit it as part of my series? I have some comments below.

Quoted 58 lines

That's all right, thank you for doing this, just please carry my signoff as co-developer if possible.
I agree with most of your suggestions.

Quoted 54 lines
Quoted 10 lines

 man/man8/tc-mqprio.8 | 96
++++++++++++++++++++++++++++++++++++++++++++

 1 file changed, 96 insertions(+)
man/man8/tc-mqprio.8 +0 -0
index 4b9e942e..16ecb9a1 100644
@@ -98,6 +98,7 @@ belong to an application. See kernel and cgroup
Quoted 5 lines

documentation for details.
 .TP
 num_tc
 Number of traffic classes to use. Up to 16 classes supported. +You cannot have more classes than queues

More impersonal: "There cannot be more traffic classes than TX queues".

Quoted 19 lines

 .TP
 map

man/man8/tc-mqprio.8 +0 -0
@@ -119,6 +120,8 @@ Set to

 to support hardware offload. Set to
 .B 0
 to configure user specified values in software only. +The default value of this parameter is
+.B 1

 .TP
 mode

man/man8/tc-mqprio.8 +0 -0
@@ -146,5 +149,98 @@ max_rate

 Maximum value of bandwidth rate limit for a traffic class.

+.SH EXAMPLE

man/man8/tc-mqprio.8 +2 -0
+
+The following example shows how to attach priorities to 4
Quoted 3 lines

traffic classes ("num_tc 4"),
+and then how to pair these traffic classes with 4 hardware queues with mqprio,

"with mqprio" is understated I think, this is the mqprio man page

Quoted 2 lines

+with hardware coordination ("hw 1", or does not specified, because 1 is the default value).

Just leave it at that, "hw 1".

Quoted 3 lines

+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1,
+tc2 is mapped to q2, and tc3 is mapped q3.

Would prefer saying TC0, TXQ0 etc if you don't mind.

+1, also taprio's manpage using capitals too, but with a space between TC and the index like "TC 0". Great think if they would harmonize.

Quoted 55 lines
Quoted 15 lines
Quoted 15 lines
man/man8/tc-mqprio.8 +10 -0
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 4 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \
+              queues 1@0 1@1 1@2 1@3 \
+              hw 1
+.EE
+
+The next example shows how to attach priorities to 3 traffic

classes ("num_tc 3"),

man/man8/tc-mqprio.8 +3 -0
+and how to pair these traffic classes with 4 queues,
+without hardware coordination ("hw 0").
+Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is
Quoted 8 lines
Quoted 4 lines

mapped to q1,
+tc2 and is mapped to q2 and q3, where the queue selection between these
+two queues is somewhat randomly decided.

Would rather say that packets are hashed arbitrarily between TXQ3 and
TXQ4, which have the same scheduling priority.

If I understand it correctly, this depends on the "hw" parameter. So if the driver handles this (hw 1), then it may prioritize a queue over another,
even if they have the same priority.

Quoted 16 lines

We should probably clarify what "hardware coordination" means, exactly.
Without hardware coordination, the device driver is not notified of the
number of traffic classes and their mapping to TXQs. The device is not
expected to prioritize between traffic classes without hardware coordination.

We should also probably clarify that with hardware coordination, the
device driver can install a different TXQ configuration than requested,
and that the default TC to TXQ mapping is:

Quoted 5 lines

TC 0: 0 queues @ offset 0
TC 1: 0 queues @ offset 0
...
TC N: 0 queues @ offset 0

First time I see hardware coordination in this manual is the hw parameter,
so I think we should clarify this there.

Quoted 58 lines
Quoted 6 lines

Should also probably clarify that there is a default prio:tc map of:

.prio_tc_map = { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 1, 1, 3, 3, 3, 3 },

hmm... you gave me more work than I was intending to do :)

Sorry about that :)

Quoted 49 lines
Quoted 32 lines
man/man8/tc-mqprio.8 +11 -0
+
+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 3 \
+              map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \
+              queues 1@0 1@1 2@2 \
+              hw 0
+.EE
+
+
+In both cases from above the priority values from 0 to 3 (prio0-

3) are

man/man8/tc-mqprio.8 +2 -0
+mapped to tc0, prio4-7 are mapped to tc1, and the
+prio8-11 are mapped to tc2 ("map" attribute). The last four

priority values

man/man8/tc-mqprio.8 +2 -0
+(prio12-15) are mapped in different ways in the two examples.
+They are mapped to tc3 in the first example and mapped to tc2 in

the second example.

man/man8/tc-mqprio.8 +13 -0
+The values of these two examples are the following:
+
+ ┌────┬────┬───────┐  ┌────┬────┬────────┐
+ │Prio│ tc │ queue │  │Prio│ tc │  queue │
+ ├────┼────┼───────┤  ├────┼────┼────────┤
+ │  0 │  0 │     0 │  │  0 │  0 │      0 │
+ │  1 │  0 │     0 │  │  1 │  0 │      0 │
+ │  2 │  0 │     0 │  │  2 │  0 │      0 │
+ │  3 │  0 │     0 │  │  3 │  0 │      0 │
+ │  4 │  1 │     1 │  │  4 │  1 │      1 │
+ │  5 │  1 │     1 │  │  5 │  1 │      1 │
+ │  6 │  1 │     1 │  │  6 │  1 │      1 │
+ │  7 │  1 │     1 │  │  7 │  1 │      1 │

man/man8/tc-mqprio.8 max_rate · line 211

Quoted 10 lines
man/man8/tc-mqprio.8 +10 -0
+ │  8 │  2 │     2 │  │  8 │  2 │ 2 or 3 │
+ │  9 │  2 │     2 │  │  9 │  2 │ 2 or 3 │
+ │ 10 │  2 │     2 │  │ 10 │  2 │ 2 or 3 │
+ │ 11 │  2 │     2 │  │ 11 │  2 │ 2 or 3 │
+ │ 12 │  3 │     3 │  │ 12 │  2 │ 2 or 3 │
+ │ 13 │  3 │     3 │  │ 13 │  2 │ 2 or 3 │
+ │ 14 │  3 │     3 │  │ 14 │  2 │ 2 or 3 │
+ │ 15 │  3 │     3 │  │ 15 │  2 │ 2 or 3 │
+ └────┴────┴───────┘  └────┴────┴────────┘
+       example1             example2

What would you say if we didn't put the 2 examples side by side, but
kept them separately? Also, I get the feeling that the verbiage above
the tables is a bit too much. Having the tables is already good enough.

I think thats just saving some space and not to scare the mqprio manpage reader even more :-)
But yes, having tables itself good enough.

Quoted 10 lines
Quoted 10 lines

man/man8/tc-mqprio.8 max_rate · line 215

Quoted 4 lines
man/man8/tc-mqprio.8 +3 -0
+
+Another example of queue mapping is the following.
+There are 5 traffic classes, and there are 8 hardware queues.

I think for maintainability, the examples should be fairly independent,
because they might be moved around in the future. This story-like "the following example" -> "the next example" -> "another example" doesn't really work.

Yes, if you carry this forward in your patches I think just better to omit the storytelling. Péter probably ACK it too.

Quoted 36 lines
Quoted 36 lines
Quoted 6 lines

+.EX
+# tc qdisc add dev eth0 root mqprio \
+              num_tc 5 \
+              map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \
+              queues 1@0 2@1 1@3 1@4 3@5

The formatting here and everywhere doesn't look very well when viewed
with "man -l man/man8/tc-mqprio.8". If you look at tc-taprio.8, it uses
"\\" to render properly. If you don't mind, I'll do that here too.

Quoted 23 lines

+.EE

man/man8/tc-mqprio.8 +22 -0
+
+The value mapping is the following for this example:
+
+        ┌───────┐
+ tc0────┤Queue 0│◄────1@0
+        ├───────┤
+      ┌─┤Queue 1│◄────2@1
+ tc1──┤ ├───────┤
+      └─┤Queue 2│
+        ├───────┤
+ tc2────┤Queue 3│◄────1@3
+        ├───────┤
+ tc3────┤Queue 4│◄────1@4
+        ├───────┤
+      ┌─┤Queue 5│◄────3@5
+      │ ├───────┤
+ tc4──┼─┤Queue 6│
+      │ ├───────┤
+      └─┤Queue 7│
+        └───────┘
+
+
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

 .SH AUTHORS
 John Fastabend, <[email protected]>
--
2.34.1

Best,
Peter

Best,
Ferenc

#6 lore raw
In reply to Péter Antal
Quoted 15 lines · Péter Antal

Hi Vladimir,

Vladimir Oltean <[email protected]> ezt írta (időpont: 2023. febr. 20., H, 16:29):

Quoted 11 lines

Hi Péter,

Quoted 6 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

---

Quoted 7 lines
Quoted 4 lines

I think it's great that you are doing this. However, with all due respect, this conflicts with the man page restructuring I am already doing for the frame preemption work. Do you mind if I fix up some things and I pick your patch up, and submit it as part of my series? I have some comments below.

That's all right, thank you for doing this, just please carry my signoff as co-developer if possible.

Absolutely, this is implied.

Quoted 1 line

I agree with most of your suggestions.

I've applied your changes on top of mine. Can you and Ferenc please review the end result? I'll take a small break of a couple of hours, and continue working on this when I come back.

$ cat man/man8/tc-mqprio.8
.TH MQPRIO 8 "24 Sept 2013" "iproute2" "Linux"
.SH NAME
MQPRIO \- Multiqueue Priority Qdisc (Offloaded Hardware QOS)
.SH SYNOPSIS
.B tc qdisc ... dev
dev (
.B parent
classid | root) [
.B handle
major: ]
.B mqprio
.ti +8
[
.B num_tc
tcs ] [
.B map
P0 P1 P2... ] [
.B queues
count1@offset1 count2@offset2 ... ]
.ti +8
[
.B hw
1|0 ] [
.B mode
dcb|channel ] [
.B shaper
dcb|bw_rlimit ]
.ti +8
[
.B min_rate
min_rate1 min_rate2 ... ] [
.B max_rate
max_rate1 max_rate2 ... ]
.ti +8
[
.B fp
FP0 FP1 FP2 ... ]

.SH DESCRIPTION
The MQPRIO qdisc is a simple queuing discipline that allows mapping traffic flows to hardware queue ranges using priorities and a configurable priority to traffic class mapping. A traffic class in this context is a set of contiguous qdisc classes which map 1:1 to a set of hardware exposed queues.

By default the qdisc allocates a pfifo qdisc (packet limited first in, first out queue) per TX queue exposed by the lower layer device. Other queuing disciplines may be added subsequently. Packets are enqueued using the .B map
parameter and hashed across the indicated queues in the
.B offset
and
.B count.
By default these parameters are configured by the hardware driver to match the hardware QOS structures.

.B Channel
mode supports full offload of the mqprio options, the traffic classes, the queue configurations and QOS attributes to the hardware. Enabled hardware can provide hardware QOS with the ability to steer traffic flows to designated traffic classes provided by this qdisc. Hardware based QOS is configured using the .B shaper
parameter.
.B bw_rlimit
with minimum and maximum bandwidth rates can be used for setting transmission rates on each traffic class. Also further qdiscs may be added to the classes of MQPRIO to create more complex configurations.

.SH ALGORITHM
On creation with 'tc qdisc add', eight traffic classes are created mapping priorities 0..7 to traffic classes 0..7 and priorities greater than 7 to traffic class 0. This requires base driver support and the creation will fail on devices that do not support hardware QOS schemes.

These defaults can be overridden using the qdisc parameters. Providing the 'hw 0' flag allows software to run without hardware coordination.

If hardware coordination is being used and arguments are provided that the hardware can not support then an error is returned. For many users hardware defaults should work reasonably well.

As one specific example numerous Ethernet cards support the 802.1Q link strict priority transmission selection algorithm (TSA). MQPRIO enabled hardware in conjunction with the classification methods below can provide hardware offloaded support for this TSA.

.SH CLASSIFICATION
Multiple methods are available to set the SKB priority which MQPRIO uses to select which traffic class to enqueue the packet.
.TP
From user space
A process with sufficient privileges can encode the destination class directly with SO_PRIORITY, see
.BR socket(7).
.TP
with iptables/nftables
An iptables/nftables rule can be created to match traffic flows and set the priority.
.BR iptables(8)
.TP
with net_prio cgroups
The net_prio cgroup can be used to set the priority of all sockets belong to an application. See kernel and cgroup documentation for details.

.SH QDISC PARAMETERS
.TP
num_tc
Number of traffic classes to use. Up to 16 classes supported. There cannot be more traffic classes than TX queues.

.TP
map
The priority to traffic class map. Maps priorities 0..15 to a specified traffic class. The default value for this argument is

  ┌────┬────┐
  │Prio│ tc │
  ├────┼────┤
  │  0 │  0 │
  │  1 │  1 │
  │  2 │  2 │
  │  3 │  3 │
  │  4 │  4 │
  │  5 │  5 │
  │  6 │  6 │
  │  7 │  7 │
  │  8 │  0 │
  │  9 │  1 │
  │ 10 │  1 │
  │ 11 │  1 │
  │ 12 │  3 │
  │ 13 │  3 │
  │ 14 │  3 │
  │ 15 │  3 │
  └────┴────┘

.TP
queues
Provide count and offset of queue range for each traffic class. In the format,
.B count@offset.
Without hardware coordination, queue ranges for each traffic classes cannot overlap and must be a contiguous range of queues. With hardware coordination, the device driver may apply a different queue configuration than requested, and the requested queue configuration may overlap (but the one which is applied may not). The default value for this argument is:

  ┌────┬───────┬────────┐
  │ tc │ count │ offset │
  ├────┼───────┼────────┤
  │  0 │    0  │    0   │
  │  1 │    0  │    0   │
  │  2 │    0  │    0   │
  │  3 │    0  │    0   │
  │  4 │    0  │    0   │
  │  5 │    0  │    0   │
  │  6 │    0  │    0   │
  │  7 │    0  │    0   │
  │  8 │    0  │    0   │
  │  9 │    0  │    0   │
  │ 10 │    0  │    0   │
  │ 11 │    0  │    0   │
  │ 12 │    0  │    0   │
  │ 13 │    0  │    0   │
  │ 14 │    0  │    0   │
  │ 15 │    0  │    0   │
  └────┴───────┴────────┘

.TP
hw
Set to
.B 1
to support hardware offload. Set to
.B 0
to configure user specified values in software only.
Without hardware coordination, the device driver is not notified of the number of traffic classes and their mapping to TXQs. The device is not expected to prioritize between traffic classes without hardware coordination. The default value of this parameter is
.B 1.

.TP
mode
Set to
.B channel
for full use of the mqprio options. Use
.B dcb
to offload only TC values and use hardware QOS defaults. Supported with 'hw' set to 1 only.

.TP
shaper
Use
.B bw_rlimit
to set bandwidth rate limits for a traffic class. Use .B dcb
for hardware QOS defaults. Supported with 'hw' set to 1 only.

.TP
min_rate
Minimum value of bandwidth rate limit for a traffic class. Supported only when the
.B 'shaper'
argument is set to
.B 'bw_rlimit'.

.TP
max_rate
Maximum value of bandwidth rate limit for a traffic class. Supported only when the
.B 'shaper'
argument is set to
.B 'bw_rlimit'.

.TP
fp
Selects whether traffic classes are express (deliver packets via the eMAC) or preemptible (deliver packets via the pMAC), according to IEEE 802.1Q-2018 clause 6.7.2 Frame preemption. Takes the form of an array (one element per traffic class) with values being
.B 'E'
(for express) or
.B 'P'
(for preemptible).

Multiple priorities which map to the same traffic class, as well as multiple TXQs which map to the same traffic class, must have the same FP attributes. To interpret the FP as an attribute per priority, the
.B 'map'
argument can be used for translation. To interpret FP as an attribute per TXQ, the
.B 'queues'
argument can be used for translation.

Traffic classes are express by default. The argument is supported only with .B 'hw'
set to 1. Preemptible traffic classes are accepted only if the device has a MAC Merge layer configurable through
.BR ethtool(8).

.SH SEE ALSO
.BR ethtool(8)

.SH EXAMPLE

The following example shows how to attach priorities to 4 traffic classes ('num_tc 4'), and how to pair these traffic classes with 4 hardware queues, with hardware coordination ('hw 1'), according to the following configuration.

  ┌────┬────┬───────┐
  │Prio│ tc │ queue │
  ├────┼────┼───────┤
  │  0 │  0 │     0 │
  │  1 │  0 │     0 │
  │  2 │  0 │     0 │
  │  3 │  0 │     0 │
  │  4 │  1 │     1 │
  │  5 │  1 │     1 │
  │  6 │  1 │     1 │
  │  7 │  1 │     1 │
  │  8 │  2 │     2 │
  │  9 │  2 │     2 │
  │ 10 │  2 │     2 │
  │ 11 │  2 │     2 │
  │ 12 │  3 │     3 │
  │ 13 │  3 │     3 │
  │ 14 │  3 │     3 │
  │ 15 │  3 │     3 │
  └────┴────┴───────┘

Traffic class 0 (TC0) is mapped to hardware queue 0 (TXQ0), TC1 is mapped to TXQ1, TC2 is mapped to TXQ2, and TC3 to TXQ3.

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 4 \\
        map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \\
        queues 1@0 1@1 1@2 1@3 \\
        hw 1
.EE

The following example shows how to attach priorities to 3 traffic classes ('num_tc 3'), and how to pair these traffic classes with 4 queues, without hardware coordination ('hw 0'), according to the following configuration:

  ┌────┬────┬────────┐
  │Prio│ tc │  queue │
  ├────┼────┼────────┤
  │  0 │  0 │      0 │
  │  1 │  0 │      0 │
  │  2 │  0 │      0 │
  │  3 │  0 │      0 │
  │  4 │  1 │      1 │
  │  5 │  1 │      1 │
  │  6 │  1 │      1 │
  │  7 │  1 │      1 │
  │  8 │  2 │ 2 or 3 │
  │  9 │  2 │ 2 or 3 │
  │ 10 │  2 │ 2 or 3 │
  │ 11 │  2 │ 2 or 3 │
  │ 12 │  2 │ 2 or 3 │
  │ 13 │  2 │ 2 or 3 │
  │ 14 │  2 │ 2 or 3 │
  │ 15 │  2 │ 2 or 3 │
  └────┴────┴────────┘

TC0 is mapped to hardware TXQ0, TC1 to TXQ1, and TC2 is mapped to TXQ2 and TXQ3, where the queue selection between these two queues is arbitrary.

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 3 \\
        map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \\
        queues 1@0 1@1 2@2 \\
        hw 0
.EE

In the following example, there are 8 hardware queues mapped to 5 traffic classes according to the configuration below:

        ┌───────┐
 tc0────┤Queue 0│◄────1@0
        ├───────┤
      ┌─┤Queue 1│◄────2@1
 tc1──┤ ├───────┤
      └─┤Queue 2│
        ├───────┤
 tc2────┤Queue 3│◄────1@3
        ├───────┤
 tc3────┤Queue 4│◄────1@4
        ├───────┤
      ┌─┤Queue 5│◄────3@5
      │ ├───────┤
 tc4──┼─┤Queue 6│
      │ ├───────┤
      └─┤Queue 7│
        └───────┘

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 5 \\
        map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \\
        queues 1@0 2@1 1@3 1@4 3@5
.EE

.SH AUTHORS
John Fastabend, <[email protected]>

Acked-by
#7 lore raw

Hi Vladimir!

Quoted 427 lines · Vladimir Oltean
Quoted 24 lines · Péter Antal

Hi Vladimir,

Vladimir Oltean <[email protected]> ezt írta (időpont: 2023. febr. 20., H, 16:29):

Quoted 11 lines

Hi Péter,

Quoted 6 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

---

Quoted 8 lines

I think it's great that you are doing this. However, with all due respect,
this conflicts with the man page restructuring I am already doing for the
frame preemption work. Do you mind if I fix up some things and I pick your
patch up, and submit it as part of my series? I have some comments below.

Quoted 2 lines

That's all right, thank you for doing this, just please carry my signoff as co-developer if possible.

Absolutely, this is implied.

Quoted 1 line

I agree with most of your suggestions.

I've applied your changes on top of mine. Can you and Ferenc please review the end result? I'll take a small break of a couple of hours, and continue working on this when I come back.

$ cat man/man8/tc-mqprio.8
.TH MQPRIO 8 "24 Sept 2013" "iproute2" "Linux"
.SH NAME
MQPRIO \- Multiqueue Priority Qdisc (Offloaded Hardware QOS)
.SH SYNOPSIS
.B tc qdisc ... dev
dev (
.B parent
classid | root) [
.B handle
major: ]
.B mqprio
.ti +8
[
.B num_tc
tcs ] [
.B map
P0 P1 P2... ] [
.B queues
count1@offset1 count2@offset2 ... ]
.ti +8
[
.B hw
1|0 ] [
.B mode
dcb|channel ] [
.B shaper
dcb|bw_rlimit ]
.ti +8
[
.B min_rate
min_rate1 min_rate2 ... ] [
.B max_rate
max_rate1 max_rate2 ... ]
.ti +8
[
.B fp
FP0 FP1 FP2 ... ]

.SH DESCRIPTION
The MQPRIO qdisc is a simple queuing discipline that allows mapping traffic flows to hardware queue ranges using priorities and a configurable
priority to traffic class mapping. A traffic class in this context is a set of contiguous qdisc classes which map 1:1 to a set of hardware exposed queues.

By default the qdisc allocates a pfifo qdisc (packet limited first in, first
out queue) per TX queue exposed by the lower layer device. Other queuing
disciplines may be added subsequently. Packets are enqueued using the .B map
parameter and hashed across the indicated queues in the
.B offset
and
.B count.
By default these parameters are configured by the hardware driver to match the hardware QOS structures.

.B Channel
mode supports full offload of the mqprio options, the traffic classes, the queue
configurations and QOS attributes to the hardware. Enabled hardware can provide
hardware QOS with the ability to steer traffic flows to designated traffic
classes provided by this qdisc. Hardware based QOS is configured using the
.B shaper
parameter.
.B bw_rlimit
with minimum and maximum bandwidth rates can be used for setting transmission rates on each traffic class. Also further qdiscs may be added
to the classes of MQPRIO to create more complex configurations.

.SH ALGORITHM
On creation with 'tc qdisc add', eight traffic classes are created mapping
priorities 0..7 to traffic classes 0..7 and priorities greater than 7 to
traffic class 0. This requires base driver support and the creation will
fail on devices that do not support hardware QOS schemes.

These defaults can be overridden using the qdisc parameters. Providing
the 'hw 0' flag allows software to run without hardware coordination.

If hardware coordination is being used and arguments are provided that
the hardware can not support then an error is returned. For many users
hardware defaults should work reasonably well.

As one specific example numerous Ethernet cards support the 802.1Q link strict priority transmission selection algorithm (TSA). MQPRIO enabled hardware in conjunction with the classification methods below can provide hardware offloaded support for this TSA.

.SH CLASSIFICATION
Multiple methods are available to set the SKB priority which MQPRIO uses to select which traffic class to enqueue the packet. .TP
From user space
A process with sufficient privileges can encode the destination class directly with SO_PRIORITY, see
.BR socket(7).
.TP
with iptables/nftables
An iptables/nftables rule can be created to match traffic flows and set the priority.
.BR iptables(8)
.TP
with net_prio cgroups
The net_prio cgroup can be used to set the priority of all sockets belong to an application. See kernel and cgroup documentation for details.

.SH QDISC PARAMETERS
.TP
num_tc
Number of traffic classes to use. Up to 16 classes supported. There cannot be more traffic classes than TX queues.

.TP
map
The priority to traffic class map. Maps priorities 0..15 to a specified
traffic class. The default value for this argument is

  ┌────┬────┐
  │Prio│ tc │
  ├────┼────┤
  │  0 │  0 │
  │  1 │  1 │
  │  2 │  2 │
  │  3 │  3 │
  │  4 │  4 │
  │  5 │  5 │
  │  6 │  6 │
  │  7 │  7 │
  │  8 │  0 │
  │  9 │  1 │
  │ 10 │  1 │
  │ 11 │  1 │
  │ 12 │  3 │
  │ 13 │  3 │
  │ 14 │  3 │
  │ 15 │  3 │
  └────┴────┘

.TP
queues
Provide count and offset of queue range for each traffic class. In the
format,
.B count@offset.
Without hardware coordination, queue ranges for each traffic classes cannot
overlap and must be a contiguous range of queues. With hardware coordination,
the device driver may apply a different queue configuration than requested,
and the requested queue configuration may overlap (but the one which is applied
may not). The default value for this argument is:

  ┌────┬───────┬────────┐
  │ tc │ count │ offset │
  ├────┼───────┼────────┤
  │  0 │    0  │    0   │
  │  1 │    0  │    0   │
  │  2 │    0  │    0   │
  │  3 │    0  │    0   │
  │  4 │    0  │    0   │
  │  5 │    0  │    0   │
  │  6 │    0  │    0   │
  │  7 │    0  │    0   │
  │  8 │    0  │    0   │
  │  9 │    0  │    0   │
  │ 10 │    0  │    0   │
  │ 11 │    0  │    0   │
  │ 12 │    0  │    0   │
  │ 13 │    0  │    0   │
  │ 14 │    0  │    0   │
  │ 15 │    0  │    0   │
  └────┴───────┴────────┘

.TP
hw
Set to
.B 1
to support hardware offload. Set to
.B 0
to configure user specified values in software only. Without hardware coordination, the device driver is not notified of the number
of traffic classes and their mapping to TXQs. The device is not expected to
prioritize between traffic classes without hardware coordination. The default value of this parameter is
.B 1.

.TP
mode
Set to
.B channel
for full use of the mqprio options. Use
.B dcb
to offload only TC values and use hardware QOS defaults. Supported with 'hw'
set to 1 only.

.TP
shaper
Use
.B bw_rlimit
to set bandwidth rate limits for a traffic class. Use .B dcb
for hardware QOS defaults. Supported with 'hw' set to 1 only.

.TP
min_rate
Minimum value of bandwidth rate limit for a traffic class. Supported only when
the
.B 'shaper'
argument is set to
.B 'bw_rlimit'.

.TP
max_rate
Maximum value of bandwidth rate limit for a traffic class. Supported only when
the
.B 'shaper'
argument is set to
.B 'bw_rlimit'.

.TP
fp
Selects whether traffic classes are express (deliver packets via the eMAC) or
preemptible (deliver packets via the pMAC), according to IEEE 802.1Q- 2018
clause 6.7.2 Frame preemption. Takes the form of an array (one element per
traffic class) with values being
.B 'E'
(for express) or
.B 'P'
(for preemptible).

Multiple priorities which map to the same traffic class, as well as multiple
TXQs which map to the same traffic class, must have the same FP attributes.
To interpret the FP as an attribute per priority, the
.B 'map'
argument can be used for translation. To interpret FP as an attribute per TXQ,
the
.B 'queues'
argument can be used for translation.

Traffic classes are express by default. The argument is supported only with
.B 'hw'
set to 1. Preemptible traffic classes are accepted only if the device has a MAC
Merge layer configurable through
.BR ethtool(8).

.SH SEE ALSO
.BR ethtool(8)

.SH EXAMPLE

The following example shows how to attach priorities to 4 traffic classes
('num_tc 4'), and how to pair these traffic classes with 4 hardware queues,
with hardware coordination ('hw 1'), according to the following configuration.

  ┌────┬────┬───────┐
  │Prio│ tc │ queue │
  ├────┼────┼───────┤
  │  0 │  0 │     0 │
  │  1 │  0 │     0 │
  │  2 │  0 │     0 │
  │  3 │  0 │     0 │
  │  4 │  1 │     1 │
  │  5 │  1 │     1 │
  │  6 │  1 │     1 │
  │  7 │  1 │     1 │
  │  8 │  2 │     2 │
  │  9 │  2 │     2 │
  │ 10 │  2 │     2 │
  │ 11 │  2 │     2 │
  │ 12 │  3 │     3 │
  │ 13 │  3 │     3 │
  │ 14 │  3 │     3 │
  │ 15 │  3 │     3 │
  └────┴────┴───────┘

Traffic class 0 (TC0) is mapped to hardware queue 0 (TXQ0), TC1 is mapped to
TXQ1, TC2 is mapped to TXQ2, and TC3 to TXQ3.

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 4 \\
        map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \\
        queues 1@0 1@1 1@2 1@3 \\
        hw 1
.EE

The following example shows how to attach priorities to 3 traffic classes
('num_tc 3'), and how to pair these traffic classes with 4 queues, without
hardware coordination ('hw 0'), according to the following configuration:

  ┌────┬────┬────────┐
  │Prio│ tc │  queue │
  ├────┼────┼────────┤
  │  0 │  0 │      0 │
  │  1 │  0 │      0 │
  │  2 │  0 │      0 │
  │  3 │  0 │      0 │
  │  4 │  1 │      1 │
  │  5 │  1 │      1 │
  │  6 │  1 │      1 │
  │  7 │  1 │      1 │
  │  8 │  2 │ 2 or 3 │
  │  9 │  2 │ 2 or 3 │
  │ 10 │  2 │ 2 or 3 │
  │ 11 │  2 │ 2 or 3 │
  │ 12 │  2 │ 2 or 3 │
  │ 13 │  2 │ 2 or 3 │
  │ 14 │  2 │ 2 or 3 │
  │ 15 │  2 │ 2 or 3 │
  └────┴────┴────────┘

TC0 is mapped to hardware TXQ0, TC1 to TXQ1, and TC2 is mapped to TXQ2 and
TXQ3, where the queue selection between these two queues is arbitrary.

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 3 \\
        map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \\
        queues 1@0 1@1 2@2 \\
        hw 0
.EE

In the following example, there are 8 hardware queues mapped to 5 traffic
classes according to the configuration below:

        ┌───────┐
 tc0────┤Queue 0│◄────1@0
        ├───────┤
      ┌─┤Queue 1│◄────2@1
 tc1──┤ ├───────┤
      └─┤Queue 2│
        ├───────┤
 tc2────┤Queue 3│◄────1@3
        ├───────┤
 tc3────┤Queue 4│◄────1@4
        ├───────┤
      ┌─┤Queue 5│◄────3@5
      │ ├───────┤
 tc4──┼─┤Queue 6│
      │ ├───────┤
      └─┤Queue 7│
        └───────┘

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 5 \\
        map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \\
        queues 1@0 2@1 1@3 1@4 3@5
.EE
Quoted 2 lines

.SH AUTHORS
John Fastabend, <[email protected]>

LGTM!

Thank you!
Ferenc

author Acked-by
#8 lore raw
In reply to Vladimir Oltean

Hi

Vladimir Oltean <[email protected]> ezt írta (időpont: 2023. febr. 20., H, 17:18):

Quoted 193 lines · Péter Antal
Quoted 15 lines

Hi Vladimir,

Vladimir Oltean <[email protected]> ezt írta (időpont: 2023. febr. 20., H, 16:29):

Quoted 11 lines

Hi Péter,

Quoted 6 lines · Péter Antal

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

---

Quoted 7 lines
Quoted 4 lines

I think it's great that you are doing this. However, with all due respect, this conflicts with the man page restructuring I am already doing for the frame preemption work. Do you mind if I fix up some things and I pick your patch up, and submit it as part of my series? I have some comments below.

That's all right, thank you for doing this, just please carry my signoff as co-developer if possible.

Absolutely, this is implied.

Quoted 1 line

I agree with most of your suggestions.

I've applied your changes on top of mine. Can you and Ferenc please review the end result? I'll take a small break of a couple of hours, and continue working on this when I come back.

$ cat man/man8/tc-mqprio.8
.TH MQPRIO 8 "24 Sept 2013" "iproute2" "Linux"
.SH NAME
MQPRIO \- Multiqueue Priority Qdisc (Offloaded Hardware QOS)
.SH SYNOPSIS
.B tc qdisc ... dev
dev (
.B parent
classid | root) [
.B handle
major: ]
.B mqprio
.ti +8
[
.B num_tc
tcs ] [
.B map
P0 P1 P2... ] [
.B queues
count1@offset1 count2@offset2 ... ]
.ti +8
[
.B hw
1|0 ] [
.B mode
dcb|channel ] [
.B shaper
dcb|bw_rlimit ]
.ti +8
[
.B min_rate
min_rate1 min_rate2 ... ] [
.B max_rate
max_rate1 max_rate2 ... ]
.ti +8
[
.B fp
FP0 FP1 FP2 ... ]

.SH DESCRIPTION
The MQPRIO qdisc is a simple queuing discipline that allows mapping traffic flows to hardware queue ranges using priorities and a configurable priority to traffic class mapping. A traffic class in this context is a set of contiguous qdisc classes which map 1:1 to a set of hardware exposed queues.

By default the qdisc allocates a pfifo qdisc (packet limited first in, first out queue) per TX queue exposed by the lower layer device. Other queuing disciplines may be added subsequently. Packets are enqueued using the .B map
parameter and hashed across the indicated queues in the
.B offset
and
.B count.
By default these parameters are configured by the hardware driver to match the hardware QOS structures.

.B Channel
mode supports full offload of the mqprio options, the traffic classes, the queue configurations and QOS attributes to the hardware. Enabled hardware can provide hardware QOS with the ability to steer traffic flows to designated traffic classes provided by this qdisc. Hardware based QOS is configured using the .B shaper
parameter.
.B bw_rlimit
with minimum and maximum bandwidth rates can be used for setting transmission rates on each traffic class. Also further qdiscs may be added to the classes of MQPRIO to create more complex configurations.

.SH ALGORITHM
On creation with 'tc qdisc add', eight traffic classes are created mapping priorities 0..7 to traffic classes 0..7 and priorities greater than 7 to traffic class 0. This requires base driver support and the creation will fail on devices that do not support hardware QOS schemes.

These defaults can be overridden using the qdisc parameters. Providing the 'hw 0' flag allows software to run without hardware coordination.

If hardware coordination is being used and arguments are provided that the hardware can not support then an error is returned. For many users hardware defaults should work reasonably well.

As one specific example numerous Ethernet cards support the 802.1Q link strict priority transmission selection algorithm (TSA). MQPRIO enabled hardware in conjunction with the classification methods below can provide hardware offloaded support for this TSA.

.SH CLASSIFICATION
Multiple methods are available to set the SKB priority which MQPRIO uses to select which traffic class to enqueue the packet.
.TP
From user space
A process with sufficient privileges can encode the destination class directly with SO_PRIORITY, see
.BR socket(7).
.TP
with iptables/nftables
An iptables/nftables rule can be created to match traffic flows and set the priority.
.BR iptables(8)
.TP
with net_prio cgroups
The net_prio cgroup can be used to set the priority of all sockets belong to an application. See kernel and cgroup documentation for details.

.SH QDISC PARAMETERS
.TP
num_tc
Number of traffic classes to use. Up to 16 classes supported. There cannot be more traffic classes than TX queues.

.TP
map
The priority to traffic class map. Maps priorities 0..15 to a specified traffic class. The default value for this argument is

  ┌────┬────┐
  │Prio│ tc │
  ├────┼────┤
  │  0 │  0 │
  │  1 │  1 │
  │  2 │  2 │
  │  3 │  3 │
  │  4 │  4 │
  │  5 │  5 │
  │  6 │  6 │
  │  7 │  7 │
  │  8 │  0 │
  │  9 │  1 │
  │ 10 │  1 │
  │ 11 │  1 │
  │ 12 │  3 │
  │ 13 │  3 │
  │ 14 │  3 │
  │ 15 │  3 │
  └────┴────┘

.TP
queues
Provide count and offset of queue range for each traffic class. In the format,
.B count@offset.
Without hardware coordination, queue ranges for each traffic classes cannot overlap and must be a contiguous range of queues. With hardware coordination, the device driver may apply a different queue configuration than requested, and the requested queue configuration may overlap (but the one which is applied may not). The default value for this argument is:

  ┌────┬───────┬────────┐
  │ tc │ count │ offset │
  ├────┼───────┼────────┤
  │  0 │    0  │    0   │
  │  1 │    0  │    0   │
  │  2 │    0  │    0   │
  │  3 │    0  │    0   │
  │  4 │    0  │    0   │
  │  5 │    0  │    0   │
  │  6 │    0  │    0   │
  │  7 │    0  │    0   │
  │  8 │    0  │    0   │
Quoted 9 lines
  │  9 │    0  │    0   │
  │ 10 │    0  │    0   │
  │ 11 │    0  │    0   │
  │ 12 │    0  │    0   │
  │ 13 │    0  │    0   │
  │ 14 │    0  │    0   │
  │ 15 │    0  │    0   │
  └────┴───────┴────────┘

Maybe this default table is obvious, and stating that "by default the traffic classes are mapped to 0@0" could be enough.
But feel free to ignore this.

Quoted 178 lines

.TP
hw
Set to
.B 1
to support hardware offload. Set to
.B 0
to configure user specified values in software only.
Without hardware coordination, the device driver is not notified of the number of traffic classes and their mapping to TXQs. The device is not expected to prioritize between traffic classes without hardware coordination. The default value of this parameter is
.B 1.

.TP
mode
Set to
.B channel
for full use of the mqprio options. Use
.B dcb
to offload only TC values and use hardware QOS defaults. Supported with 'hw' set to 1 only.

.TP
shaper
Use
.B bw_rlimit
to set bandwidth rate limits for a traffic class. Use .B dcb
for hardware QOS defaults. Supported with 'hw' set to 1 only.

.TP
min_rate
Minimum value of bandwidth rate limit for a traffic class. Supported only when the
.B 'shaper'
argument is set to
.B 'bw_rlimit'.

.TP
max_rate
Maximum value of bandwidth rate limit for a traffic class. Supported only when the
.B 'shaper'
argument is set to
.B 'bw_rlimit'.

.TP
fp
Selects whether traffic classes are express (deliver packets via the eMAC) or preemptible (deliver packets via the pMAC), according to IEEE 802.1Q-2018 clause 6.7.2 Frame preemption. Takes the form of an array (one element per traffic class) with values being
.B 'E'
(for express) or
.B 'P'
(for preemptible).

Multiple priorities which map to the same traffic class, as well as multiple TXQs which map to the same traffic class, must have the same FP attributes. To interpret the FP as an attribute per priority, the
.B 'map'
argument can be used for translation. To interpret FP as an attribute per TXQ, the
.B 'queues'
argument can be used for translation.

Traffic classes are express by default. The argument is supported only with .B 'hw'
set to 1. Preemptible traffic classes are accepted only if the device has a MAC Merge layer configurable through
.BR ethtool(8).

.SH SEE ALSO
.BR ethtool(8)

.SH EXAMPLE

The following example shows how to attach priorities to 4 traffic classes ('num_tc 4'), and how to pair these traffic classes with 4 hardware queues, with hardware coordination ('hw 1'), according to the following configuration.

  ┌────┬────┬───────┐
  │Prio│ tc │ queue │
  ├────┼────┼───────┤
  │  0 │  0 │     0 │
  │  1 │  0 │     0 │
  │  2 │  0 │     0 │
  │  3 │  0 │     0 │
  │  4 │  1 │     1 │
  │  5 │  1 │     1 │
  │  6 │  1 │     1 │
  │  7 │  1 │     1 │
  │  8 │  2 │     2 │
  │  9 │  2 │     2 │
  │ 10 │  2 │     2 │
  │ 11 │  2 │     2 │
  │ 12 │  3 │     3 │
  │ 13 │  3 │     3 │
  │ 14 │  3 │     3 │
  │ 15 │  3 │     3 │
  └────┴────┴───────┘

Traffic class 0 (TC0) is mapped to hardware queue 0 (TXQ0), TC1 is mapped to TXQ1, TC2 is mapped to TXQ2, and TC3 to TXQ3.

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 4 \\
        map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \\
        queues 1@0 1@1 1@2 1@3 \\
        hw 1
.EE

The following example shows how to attach priorities to 3 traffic classes ('num_tc 3'), and how to pair these traffic classes with 4 queues, without hardware coordination ('hw 0'), according to the following configuration:

  ┌────┬────┬────────┐
  │Prio│ tc │  queue │
  ├────┼────┼────────┤
  │  0 │  0 │      0 │
  │  1 │  0 │      0 │
  │  2 │  0 │      0 │
  │  3 │  0 │      0 │
  │  4 │  1 │      1 │
  │  5 │  1 │      1 │
  │  6 │  1 │      1 │
  │  7 │  1 │      1 │
  │  8 │  2 │ 2 or 3 │
  │  9 │  2 │ 2 or 3 │
  │ 10 │  2 │ 2 or 3 │
  │ 11 │  2 │ 2 or 3 │
  │ 12 │  2 │ 2 or 3 │
  │ 13 │  2 │ 2 or 3 │
  │ 14 │  2 │ 2 or 3 │
  │ 15 │  2 │ 2 or 3 │
  └────┴────┴────────┘

TC0 is mapped to hardware TXQ0, TC1 to TXQ1, and TC2 is mapped to TXQ2 and TXQ3, where the queue selection between these two queues is arbitrary.

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 3 \\
        map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \\
        queues 1@0 1@1 2@2 \\
        hw 0
.EE

In the following example, there are 8 hardware queues mapped to 5 traffic classes according to the configuration below:

        ┌───────┐
 tc0────┤Queue 0│◄────1@0
        ├───────┤
      ┌─┤Queue 1│◄────2@1
 tc1──┤ ├───────┤
      └─┤Queue 2│
        ├───────┤
 tc2────┤Queue 3│◄────1@3
        ├───────┤
 tc3────┤Queue 4│◄────1@4
        ├───────┤
      ┌─┤Queue 5│◄────3@5
      │ ├───────┤
 tc4──┼─┤Queue 6│
      │ ├───────┤
      └─┤Queue 7│
        └───────┘

.EX

# tc qdisc add dev eth0 root mqprio \\
        num_tc 5 \\
        map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \\
        queues 1@0 2@1 1@3 1@4 3@5
.EE
Quoted 2 lines

.SH AUTHORS
John Fastabend, <[email protected]>

Aside from that LGTM!

Thanks!
Péter

#9 lore raw
In reply to Péter Antal
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 8 lines · On Mon, 20 Feb 2023 16:05:48 +0100 you wrote:

The current mqprio manual is not detailed about queue mapping and priorities, this patch adds some examples to it.

---
 man/man8/tc-mqprio.8 | 96 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

Here is the summary with links:
- [iproute2] man: tc-mqprio: extend prio-tc-queue mapping with examples

    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=ce4068f22db4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html