1MQPRIO(8) Linux MQPRIO(8)
2
3
4
6 MQPRIO - Multiqueue Priority Qdisc (Offloaded Hardware QOS)
7
9 tc qdisc ... dev dev ( parent classid | root) [ handle major: ] mqprio
10 [ numtc tcs ] [ map P0 P1 P2... ] [ queues count1@offset1 count2@off‐
11 set2 ... ] [ hw 1|0 ] [ mode dcb|channel] ] [ shaper dcb| [ bw_rlimit
12 min_rate min_rate1 min_rate2 ... max_rate max_rate1 max_rate2 ... ]]
13
14
15
17 The MQPRIO qdisc is a simple queuing discipline that allows mapping
18 traffic flows to hardware queue ranges using priorities and a config‐
19 urable priority to traffic class mapping. A traffic class in this con‐
20 text is a set of contiguous qdisc classes which map 1:1 to a set of
21 hardware exposed queues.
22
23 By default the qdisc allocates a pfifo qdisc (packet limited first in,
24 first out queue) per TX queue exposed by the lower layer device. Other
25 queuing disciplines may be added subsequently. Packets are enqueued
26 using the map parameter and hashed across the indicated queues in the
27 offset and count. By default these parameters are configured by the
28 hardware driver to match the hardware QOS structures.
29
30 Channel mode supports full offload of the mqprio options, the traffic
31 classes, the queue configurations and QOS attributes to the hardware.
32 Enabled hardware can provide hardware QOS with the ability to steer
33 traffic flows to designated traffic classes provided by this qdisc.
34 Hardware based QOS is configured using the shaper parameter. bw_rlimit
35 with minimum and maximum bandwidth rates can be used for setting trans‐
36 mission rates on each traffic class. Also further qdiscs may be added
37 to the classes of MQPRIO to create more complex configurations.
38
39
41 On creation with 'tc qdisc add', eight traffic classes are created map‐
42 ping priorities 0..7 to traffic classes 0..7 and priorities greater
43 than 7 to traffic class 0. This requires base driver support and the
44 creation will fail on devices that do not support hardware QOS schemes.
45
46 These defaults can be overridden using the qdisc parameters. Providing
47 the 'hw 0' flag allows software to run without hardware coordination.
48
49 If hardware coordination is being used and arguments are provided that
50 the hardware can not support then an error is returned. For many users
51 hardware defaults should work reasonably well.
52
53 As one specific example numerous Ethernet cards support the 802.1Q link
54 strict priority transmission selection algorithm (TSA). MQPRIO enabled
55 hardware in conjunction with the classification methods below can pro‐
56 vide hardware offloaded support for this TSA.
57
58
60 Multiple methods are available to set the SKB priority which MQPRIO
61 uses to select which traffic class to enqueue the packet.
62
63 From user space
64 A process with sufficient privileges can encode the destination
65 class directly with SO_PRIORITY, see socket(7).
66
67 with iptables/nftables
68 An iptables/nftables rule can be created to match traffic flows
69 and set the priority. iptables(8)
70
71 with net_prio cgroups
72 The net_prio cgroup can be used to set the priority of all sock‐
73 ets belong to an application. See kernel and cgroup documenta‐
74 tion for details.
75
76
78 num_tc Number of traffic classes to use. Up to 16 classes supported.
79
80
81 map The priority to traffic class map. Maps priorities 0..15 to a
82 specified traffic class.
83
84
85 queues Provide count and offset of queue range for each traffic class.
86 In the format, count@offset. Queue ranges for each traffic
87 classes cannot overlap and must be a contiguous range of queues.
88
89
90 hw Set to 1 to support hardware offload. Set to 0 to configure user
91 specified values in software only.
92
93
94 mode Set to channel for full use of the mqprio options. Use dcb to
95 offload only TC values and use hardware QOS defaults. Supported
96 with 'hw' set to 1 only.
97
98
99 shaper Use bw_rlimit to set bandwidth rate limits for a traffic class.
100 Use dcb for hardware QOS defaults. Supported with 'hw' set to 1
101 only.
102
103
104 min_rate
105 Minimum value of bandwidth rate limit for a traffic class.
106
107
108 max_rate
109 Maximum value of bandwidth rate limit for a traffic class.
110
111
112
114 John Fastabend, <john.r.fastabend@intel.com>
115
116
117
118iproute2 24 Sept 2013 MQPRIO(8)