Blame man/man8/tc-taprio.8

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 Service 3880ab
time and scheduling events.
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 Service 3880ab
Specifies different modes for taprio. Currently, only txtime-assist is
Packit Service 3880ab
supported which can be enabled by setting it to 0x1. In this mode, taprio will
Packit Service 3880ab
set the transmit timestamp depending on the interval in which the packet needs
Packit Service 3880ab
to be 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 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 Service 3880ab
.SH AUTHORS
Packit Service 3880ab
Vinicius Costa Gomes <vinicius.gomes@intel.com>