|
Packit Service |
3880ab |
.TH TAPRIO 8 "25 Sept 2018" "iproute2" "Linux"
|
|
Packit Service |
3880ab |
.SH NAME
|
|
Packit Service |
3880ab |
TAPRIO \- Time Aware Priority Shaper
|
|
Packit Service |
3880ab |
.SH SYNOPSIS
|
|
Packit Service |
3880ab |
.B tc qdisc ... dev
|
|
Packit Service |
3880ab |
dev
|
|
Packit Service |
3880ab |
.B parent
|
|
Packit Service |
3880ab |
classid
|
|
Packit Service |
3880ab |
.B [ handle
|
|
Packit Service |
3880ab |
major:
|
|
Packit Service |
3880ab |
.B ] taprio num_tc
|
|
Packit Service |
3880ab |
tcs
|
|
Packit Service |
3880ab |
.ti +8
|
|
Packit Service |
3880ab |
.B map
|
|
Packit Service |
3880ab |
P0 P1 P2 ...
|
|
Packit Service |
3880ab |
.B queues
|
|
Packit Service |
3880ab |
count1@offset1 count2@offset2 ...
|
|
Packit Service |
3880ab |
.ti +8
|
|
Packit Service |
3880ab |
.B base-time
|
|
Packit Service |
3880ab |
base-time
|
|
Packit Service |
3880ab |
.B clockid
|
|
Packit Service |
3880ab |
clockid
|
|
Packit Service |
3880ab |
.ti +8
|
|
Packit Service |
3880ab |
.B sched-entry
|
|
Packit Service |
3880ab |
<command 1> <gate mask 1> <interval 1>
|
|
Packit Service |
3880ab |
.ti +8
|
|
Packit Service |
3880ab |
.B sched-entry
|
|
Packit Service |
3880ab |
<command 2> <gate mask 2> <interval 2>
|
|
Packit Service |
3880ab |
.ti +8
|
|
Packit Service |
3880ab |
.B sched-entry
|
|
Packit Service |
3880ab |
<command 3> <gate mask 3> <interval 3>
|
|
Packit Service |
3880ab |
.ti +8
|
|
Packit Service |
3880ab |
.B sched-entry
|
|
Packit Service |
3880ab |
<command N> <gate mask N> <interval N>
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH DESCRIPTION
|
|
Packit Service |
3880ab |
The TAPRIO qdisc implements a simplified version of the scheduling
|
|
Packit Service |
3880ab |
state machine defined by IEEE 802.1Q-2018 Section 8.6.9, which allows
|
|
Packit Service |
3880ab |
configuration of a sequence of gate states, where each gate state
|
|
Packit Service |
3880ab |
allows outgoing traffic for a subset (potentially empty) of traffic
|
|
Packit Service |
3880ab |
classes.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
How traffic is mapped to different hardware queues is similar to
|
|
Packit Service |
3880ab |
.BR mqprio(8)
|
|
Packit Service |
3880ab |
and so the
|
|
Packit Service |
3880ab |
.B map
|
|
Packit Service |
3880ab |
and
|
|
Packit Service |
3880ab |
.B queues
|
|
Packit Service |
3880ab |
parameters have the same meaning.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
The other parameters specify the schedule, and at what point in time
|
|
Packit Service |
3880ab |
it should start (it can behave as the schedule started in the past).
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH PARAMETERS
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
num_tc
|
|
Packit Service |
3880ab |
.BR
|
|
Packit Service |
3880ab |
Number of traffic classes to use. Up to 16 classes supported.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
map
|
|
Packit Service |
3880ab |
.br
|
|
Packit Service |
3880ab |
The priority to traffic class map. Maps priorities 0..15 to a specified
|
|
Packit Service |
3880ab |
traffic class. See
|
|
Packit Service |
3880ab |
.BR mqprio(8)
|
|
Packit Service |
3880ab |
for more details.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
queues
|
|
Packit Service |
3880ab |
.br
|
|
Packit Service |
3880ab |
Provide count and offset of queue range for each traffic class. In the
|
|
Packit Service |
3880ab |
format,
|
|
Packit Service |
3880ab |
.B count@offset.
|
|
Packit Service |
3880ab |
Queue ranges for each traffic classes cannot overlap and must be a
|
|
Packit Service |
3880ab |
contiguous range of queues.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
base-time
|
|
Packit Service |
3880ab |
.br
|
|
Packit Service |
3880ab |
Specifies the instant in nanoseconds, using the reference of
|
|
Packit Service |
3880ab |
.B clockid,
|
|
Packit Service |
3880ab |
defining the time when the schedule starts. If 'base-time' is a time
|
|
Packit Service |
3880ab |
in the past, the schedule will start at
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
base-time + (N * cycle-time)
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
where N is the smallest integer so the resulting time is greater than
|
|
Packit Service |
3880ab |
"now", and "cycle-time" is the sum of all the intervals of the entries
|
|
Packit Service |
3880ab |
in the schedule;
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
clockid
|
|
Packit Service |
3880ab |
.br
|
|
Packit Service |
3880ab |
Specifies the clock to be used by qdisc's internal timer for measuring
|
|
Packit Bot |
867fae |
time and scheduling events. This argument must be omitted when using the
|
|
Packit Bot |
867fae |
full-offload feature (flags 0x2), since in that case, the clockid is
|
|
Packit Bot |
867fae |
implicitly /dev/ptpN (where N is given by
|
|
Packit Bot |
867fae |
.B ethtool -T eth0 | grep 'PTP Hardware Clock'
|
|
Packit Bot |
867fae |
), and therefore not necessarily synchronized with the system's CLOCK_TAI.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
sched-entry
|
|
Packit Service |
3880ab |
.br
|
|
Packit Service |
3880ab |
There may multiple
|
|
Packit Service |
3880ab |
.B sched-entry
|
|
Packit Service |
3880ab |
parameters in a single schedule. Each one has the
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
sched-entry <command> <gatemask> <interval>
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
format. The only supported <command> is "S", which
|
|
Packit Service |
3880ab |
means "SetGateStates", following the IEEE 802.1Q-2018 definition
|
|
Packit Service |
3880ab |
(Table 8-7). <gate mask> is a bitmask where each bit is a associated
|
|
Packit Service |
3880ab |
with a traffic class, so bit 0 (the least significant bit) being "on"
|
|
Packit Service |
3880ab |
means that traffic class 0 is "active" for that schedule entry.
|
|
Packit Service |
3880ab |
<interval> is a time duration, in nanoseconds, that specifies for how
|
|
Packit Service |
3880ab |
long that state defined by <command> and <gate mask> should be held
|
|
Packit Service |
3880ab |
before moving to the next entry.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
flags
|
|
Packit Service |
3880ab |
.br
|
|
Packit Bot |
867fae |
This is a bit mask which specifies different modes for taprio.
|
|
Packit Bot |
867fae |
.RS
|
|
Packit Bot |
867fae |
.TP
|
|
Packit Bot |
867fae |
.I 0x1
|
|
Packit Bot |
867fae |
Enables the txtime-assist feature. In this mode, taprio will set the transmit
|
|
Packit Bot |
867fae |
timestamp depending on the interval in which the packet needs to be
|
|
Packit Bot |
867fae |
transmitted. It will then utililize the
|
|
Packit Service |
3880ab |
.BR etf(8)
|
|
Packit Service |
3880ab |
qdisc to sort and transmit the packets at the right time. The second example
|
|
Packit Service |
3880ab |
can be used as a reference to configure this mode.
|
|
Packit Bot |
867fae |
.TP
|
|
Packit Bot |
867fae |
.I 0x2
|
|
Packit Bot |
867fae |
Enables the full-offload feature. In this mode, taprio will pass the gate
|
|
Packit Bot |
867fae |
control list to the NIC which will execute it cyclically in hardware.
|
|
Packit Bot |
867fae |
When using full-offload, there is no need to specify the
|
|
Packit Bot |
867fae |
.B clockid
|
|
Packit Bot |
867fae |
argument.
|
|
Packit Bot |
867fae |
|
|
Packit Bot |
867fae |
The txtime-assist and full-offload features are mutually exclusive, i.e.
|
|
Packit Bot |
867fae |
setting flags to 0x3 is invalid.
|
|
Packit Bot |
867fae |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
txtime-delay
|
|
Packit Service |
3880ab |
.br
|
|
Packit Service |
3880ab |
This parameter is specific to the txtime offload mode. It specifies the maximum
|
|
Packit Service |
3880ab |
time a packet might take to reach the network card from the taprio qdisc. The
|
|
Packit Service |
3880ab |
value should always be greater than the delta specified in the
|
|
Packit Service |
3880ab |
.BR etf(8)
|
|
Packit Service |
3880ab |
qdisc.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH EXAMPLES
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
The following example shows how an traffic schedule with three traffic
|
|
Packit Service |
3880ab |
classes ("num_tc 3"), which are separated different traffic classes,
|
|
Packit Service |
3880ab |
we are going to call these TC 0, TC 1 and TC 2. We could read the
|
|
Packit Service |
3880ab |
"map" parameter below as: traffic with priority 3 is classified as TC
|
|
Packit Service |
3880ab |
0, priority 2 is classified as TC 1 and the rest is classified as TC
|
|
Packit Service |
3880ab |
2.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
The schedule will start at instant 1528743495910289987 using the
|
|
Packit Service |
3880ab |
reference CLOCK_TAI. The schedule is composed of three entries each of
|
|
Packit Service |
3880ab |
300us duration.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.EX
|
|
Packit Service |
3880ab |
# tc qdisc replace dev eth0 parent root handle 100 taprio \\
|
|
Packit Service |
3880ab |
num_tc 3 \\
|
|
Packit Service |
3880ab |
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\
|
|
Packit Service |
3880ab |
queues 1@0 1@1 2@2 \\
|
|
Packit Service |
3880ab |
base-time 1528743495910289987 \\
|
|
Packit Service |
3880ab |
sched-entry S 01 300000 \\
|
|
Packit Service |
3880ab |
sched-entry S 02 300000 \\
|
|
Packit Service |
3880ab |
sched-entry S 04 300000 \\
|
|
Packit Service |
3880ab |
clockid CLOCK_TAI
|
|
Packit Service |
3880ab |
.EE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
Following is an example to enable the txtime offload mode in taprio. See
|
|
Packit Service |
3880ab |
.BR etf(8)
|
|
Packit Service |
3880ab |
for more information about configuring the ETF qdisc.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.EX
|
|
Packit Service |
3880ab |
# tc qdisc replace dev eth0 parent root handle 100 taprio \\
|
|
Packit Service |
3880ab |
num_tc 3 \\
|
|
Packit Service |
3880ab |
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\
|
|
Packit Service |
3880ab |
queues 1@0 1@0 1@0 \\
|
|
Packit Service |
3880ab |
base-time 1528743495910289987 \\
|
|
Packit Service |
3880ab |
sched-entry S 01 300000 \\
|
|
Packit Service |
3880ab |
sched-entry S 02 300000 \\
|
|
Packit Service |
3880ab |
sched-entry S 04 400000 \\
|
|
Packit Service |
3880ab |
flags 0x1 \\
|
|
Packit Service |
3880ab |
txtime-delay 200000 \\
|
|
Packit Service |
3880ab |
clockid CLOCK_TAI
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
# tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \\
|
|
Packit Service |
3880ab |
offload delta 200000 clockid CLOCK_TAI
|
|
Packit Service |
3880ab |
.EE
|
|
Packit Service |
3880ab |
|
|
Packit Bot |
867fae |
The following is a schedule in full offload mode. The
|
|
Packit Bot |
867fae |
.B base-time
|
|
Packit Bot |
867fae |
is 200 ns and the
|
|
Packit Bot |
867fae |
.B cycle-time
|
|
Packit Bot |
867fae |
is implicitly calculated as the sum of all
|
|
Packit Bot |
867fae |
.B sched-entry
|
|
Packit Bot |
867fae |
durations (i.e. 20 us + 20 us + 60 us = 100 us). Although the base-time is in
|
|
Packit Bot |
867fae |
the past, the hardware will start executing the schedule at a PTP time equal to
|
|
Packit Bot |
867fae |
the smallest integer multiple of 100 us, plus 200 ns, that is larger than the
|
|
Packit Bot |
867fae |
NIC's current PTP time.
|
|
Packit Bot |
867fae |
|
|
Packit Bot |
867fae |
.EX
|
|
Packit Bot |
867fae |
# tc qdisc add dev eth0 parent root taprio \\
|
|
Packit Bot |
867fae |
num_tc 8 \\
|
|
Packit Bot |
867fae |
map 0 1 2 3 4 5 6 7 \\
|
|
Packit Bot |
867fae |
queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \\
|
|
Packit Bot |
867fae |
base-time 200 \\
|
|
Packit Bot |
867fae |
sched-entry S 80 20000 \\
|
|
Packit Bot |
867fae |
sched-entry S a0 20000 \\
|
|
Packit Bot |
867fae |
sched-entry S df 60000 \\
|
|
Packit Bot |
867fae |
flags 0x2
|
|
Packit Bot |
867fae |
.EE
|
|
Packit Bot |
867fae |
|
|
Packit Service |
3880ab |
.SH AUTHORS
|
|
Packit Service |
3880ab |
Vinicius Costa Gomes <vinicius.gomes@intel.com>
|