Man page - tc-mqprio(8)
Packages contains this manual
- rdma-monitor(8)
- devlink-rate(8)
- dcb-app(8)
- tc-prio(8)
- ip-netconf(8)
- tc-tunnel_key(8)
- tc-ets(8)
- arpd(8)
- tc-mqprio(8)
- ip-mptcp(8)
- ss(8)
- tc(8)
- vdpa(8)
- ip-tcp_metrics(8)
- rdma(8)
- devlink-region(8)
- ip(8)
- bridge(8)
- ip-link(8)
- tc-drr(8)
- genl(8)
- ip-addrlabel(8)
- ip-rule(8)
- dcb-pfc(8)
- ip-stats(8)
- tc-choke(8)
- tc-skbprio(8)
- tc-simple(8)
- tc-stab(8)
- routel(8)
- rtmon(8)
- tc-actions(8)
- ip-l2tp(8)
- tc-cgroup(8)
- tc-basic(8)
- ip-address(8)
- devlink-resource(8)
- tc-flower(8)
- rdma-link(8)
- dcb-apptrust(8)
- devlink-port(8)
- tc-route(8)
- rtstat(8)
- ip-sr(8)
- tc-red(8)
- dcb-ets(8)
- devlink-health(8)
- lnstat(8)
- tc-flow(8)
- tc-tbf(8)
- vdpa-mgmtdev(8)
- tipc-link(8)
- tc-skbedit(8)
- tipc-media(8)
- dcb-maxrate(8)
- tc-mpls(8)
- devlink(8)
- tc-sfb(8)
- ip-maddress(8)
- tc-fq(8)
- tc-pfifo(8)
- rtacct(8)
- tipc(8)
- tc-hfsc(7)
- tc-taprio(8)
- tc-nat(8)
- tc-connmark(8)
- ip-token(8)
- ip-tunnel(8)
- tipc-node(8)
- ip-nexthop(8)
- rdma-resource(8)
- ip-gue(8)
- tc-sfq(8)
- tc-htb(8)
- tc-skbmod(8)
- dcb-buffer(8)
- tipc-bearer(8)
- dcb-rewr(8)
- tc-ematch(8)
- tc-pedit(8)
- tc-police(8)
- ip-mroute(8)
- devlink-sb(8)
- dcb-dcbx(8)
- tipc-nametable(8)
- tc-fq_codel(8)
- devlink-dpipe(8)
- devlink-trap(8)
- rdma-system(8)
- ctstat(8)
- tc-sample(8)
- tc-csum(8)
- libnetlink(3)
- ip-ioam(8)
- ip-neighbour(8)
- tc-netem(8)
- tc-pfifo_fast(8)
- tc-bfifo(8)
- tc-etf(8)
- tc-cake(8)
- devlink-monitor(8)
- tipc-socket(8)
- tc-fq_pie(8)
- tc-pie(8)
- tc-u32(8)
- tc-mirred(8)
- tc-hfsc(8)
- vdpa-dev(8)
- tc-cbs(8)
- tc-codel(8)
- tc-fw(8)
- tc-bpf(8)
- ip-route(8)
- ip-netns(8)
- tc-ctinfo(8)
- ip-fou(8)
- ip-xfrm(8)
- tc-gate(8)
- tc-ct(8)
- tipc-peer(8)
- ip-macsec(8)
- tc-matchall(8)
- nstat(8)
- ip-monitor(8)
- rdma-dev(8)
- tc-gact(8)
- ip-vrf(8)
- ip-ntable(8)
- tc-ife(8)
- tc-vlan(8)
- rdma-statistic(8)
- dcb(8)
- devlink-lc(8)
- devlink-dev(8)
apt-get install iproute2
Manual
MQPRIO
NAMESYNOPSIS
DESCRIPTION
ALGORITHM
CLASSIFICATION
QDISC PARAMETERS
SEE ALSO
EXAMPLE
AUTHORS
NAME
MQPRIO - Multiqueue Priority Qdisc (Offloaded Hardware QOS)
SYNOPSIS
tc qdisc ...
dev
dev (
parent
classid | root) [
handle
major: ]
mqprio
[
num_tc
tcs ] [
map
P0 P1 P2... ] [
queues
count1@offset1 count2@offset2 ... ]
[
hw
1|0 ] [
mode
dcb|channel ] [
shaper
dcb|bw_rlimit ]
[
min_rate
min_rate1 min_rate2 ... ] [
max_rate
max_rate1 max_rate2 ... ]
[
fp
FP0 FP1 FP2 ... ]
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 map parameter and hashed across the indicated queues in the offset and count. By default these parameters are configured by the hardware driver to match the hardware QOS structures.
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 shaper parameter. 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.
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.
CLASSIFICATION
Multiple methods
are available to set the SKB priority which MQPRIO uses to
select which traffic class to enqueue the packet.
From user space
A process with sufficient privileges can encode the destination class directly with SO_PRIORITY, see socket(7).
with iptables/nftables
An iptables/nftables rule can be created to match traffic flows and set the priority. iptables(8)
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.
QDISC PARAMETERS
|
num_tc |
Number of traffic classes to use. Up to 16 classes supported. You cannot have more classes than queues |
||
|
map |
The priority to traffic class map. Maps priorities 0..15 to a specified traffic class. |
||
|
queues |
Provide count and offset of queue range for each traffic class. In the format, count@offset. Queue ranges for each traffic classes cannot overlap and must be a contiguous range of queues. |
||
|
hw |
Set to 1 to support hardware offload. Set to 0 to configure user specified values in software only. The default value of this parameter is 1 |
||
|
mode |
Set to channel for full use of the mqprio options. Use dcb to offload only TC values and use hardware QOS defaults. Supported with βhwβ set to 1 only. |
||
|
shaper |
Use bw_rlimit to set bandwidth rate limits for a traffic class. Use dcb for hardware QOS defaults. Supported with βhwβ set to 1 only. |
min_rate
Minimum value of bandwidth rate limit for a traffic class. Supported only when the βshaperβ argument is set to βbw_rlimitβ.
max_rate
Maximum value of bandwidth rate limit for a traffic class. Supported only when the βshaperβ argument is set to βbw_rlimitβ.
|
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 βEβ (for express) or β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 βmapβ argument can be used for translation. To interpret FP as an attribute per TXQ, the βqueuesβ argument can be used for translation.
Traffic classes are express by default. The argument is supported only with βhwβ set to 1. Preemptible traffic classes are accepted only if the device has a MAC Merge layer configurable through ethtool(8).
SEE ALSO
ethtool(8)
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.
# 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
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.
# 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
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.
# 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 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β
βββββββββ
AUTHORS
John Fastabend, <john.r.fastabend@intel.com>