1TAPRIO(8)                            Linux                           TAPRIO(8)
2
3
4

NAME

6       TAPRIO - Time Aware Priority Shaper
7

SYNOPSIS

9       tc qdisc ... dev dev parent classid [ handle major: ] taprio num_tc tcs
10               map P0 P1 P2 ...  queues count1@offset1 count2@offset2 ...
11               base-time base-time clockid clockid
12               sched-entry <command 1> <gate mask 1> <interval 1>
13               sched-entry <command 2> <gate mask 2> <interval 2>
14               sched-entry <command 3> <gate mask 3> <interval 3>
15               sched-entry <command N> <gate mask N> <interval N>
16               [  max-sdu  <queueMaxSDU[TC  0]>  <queueMaxSDU[TC  1]>  <queue‐
17       MaxSDU[TC N]> ]
18               [ fp <adminStatus[TC 0]>  <adminStatus[TC  1]>  <adminStatus[TC
19       N]> ]
20
21

DESCRIPTION

23       The  TAPRIO  qdisc  implements  a  simplified version of the scheduling
24       state machine defined by IEEE 802.1Q-2018 Section 8.6.9,  which  allows
25       configuration  of  a sequence of gate states, where each gate state al‐
26       lows outgoing traffic for  a  subset  (potentially  empty)  of  traffic
27       classes.
28
29       How  traffic  is  mapped  to  different  hardware  queues is similar to
30       mqprio(8) and so the map and queues parameters have the same meaning.
31
32       The other parameters specify the schedule, and at what point in time it
33       should start (it can behave as the schedule started in the past).
34
35

PARAMETERS

37       num_tc  Number of traffic classes to use. Up to 16 classes supported.
38
39
40       map
41              The  priority  to  traffic class map. Maps priorities 0..15 to a
42              specified traffic class. See mqprio(8) for more details.
43
44
45       queues
46              Provide count and offset of queue range for each traffic  class.
47              In  the  format,  count@offset.   Queue  ranges for each traffic
48              classes cannot overlap and must be a contiguous range of queues.
49
50
51       base-time
52              Specifies the instant in nanoseconds,  using  the  reference  of
53              clockid,  defining  the time when the schedule starts. If 'base-
54              time' is a time in the past, the schedule will start at
55
56              base-time + (N * cycle-time)
57
58              where N is the smallest integer so the resulting time is greater
59              than  "now", and "cycle-time" is the sum of all the intervals of
60              the entries in the schedule;
61
62
63       clockid
64              Specifies the clock to be used by  qdisc's  internal  timer  for
65              measuring  time  and  scheduling  events.  This argument must be
66              omitted when using the full-offload feature (flags  0x2),  since
67              in  that  case,  the clockid is implicitly /dev/ptpN (where N is
68              given by ethtool -T eth0 | grep  'PTP  Hardware  Clock'  ),  and
69              therefore   not   necessarily  synchronized  with  the  system's
70              CLOCK_TAI.
71
72
73       sched-entry
74              There may multiple sched-entry parameters in a single  schedule.
75              Each one has the
76
77              sched-entry <command> <gatemask> <interval>
78
79              format.  The  only supported <command> is "S", which means "Set‐
80              GateStates", following the IEEE  802.1Q-2018  definition  (Table
81              8-7).  <gate  mask>  is a bitmask where each bit is a associated
82              with a traffic class, so bit 0 (the least significant bit) being
83              "on"  means  that  traffic class 0 is "active" for that schedule
84              entry.  <interval> is a  time  duration,  in  nanoseconds,  that
85              specifies for how long that state defined by <command> and <gate
86              mask> should be held before moving to the next entry.
87
88
89       flags
90              This is a bit mask which specifies different modes for taprio.
91
92              0x1    Enables the txtime-assist feature. In this  mode,  taprio
93                     will set the transmit timestamp depending on the interval
94                     in which the packet needs to be transmitted. It will then
95                     utililize the etf(8) qdisc to sort and transmit the pack‐
96                     ets at the right time. The second example can be used  as
97                     a reference to configure this mode.
98
99              0x2    Enables  the  full-offload  feature. In this mode, taprio
100                     will pass the gate control list to the NIC which will ex‐
101                     ecute  it  cyclically  in hardware.  When using full-off‐
102                     load, there is no need to specify the clockid argument.
103
104                     The txtime-assist and full-offload features are  mutually
105                     exclusive, i.e.  setting flags to 0x3 is invalid.
106
107
108       txtime-delay
109              This parameter is specific to the txtime offload mode. It speci‐
110              fies the maximum time a packet might take to reach  the  network
111              card  from  the taprio qdisc. The value should always be greater
112              than the delta specified in the etf(8) qdisc.
113
114
115       max-sdu
116              Specifies an array containing at most 16 elements, one per traf‐
117              fic  class, which corresponds to the queueMaxSDU table from IEEE
118              802.1Q-2018. Each array element represents the maximum  L2  pay‐
119              load size that can egress that traffic class.  Elements that are
120              not filled in default to 0. The value 0 means that  the  traffic
121              class can send packets up to the port's maximum MTU in size.
122
123
124       fp
125              Selects  whether traffic classes are express or preemptible. See
126              tc-mqprio(8) for details.
127
128

EXAMPLES

130       The following example shows how an traffic schedule with three  traffic
131       classes ("num_tc 3"), which are separated different traffic classes, we
132       are going to call these TC 0, TC 1 and TC 2. We could  read  the  "map"
133       parameter below as: traffic with priority 3 is classified as TC 0, pri‐
134       ority 2 is classified as TC 1 and the rest is classified as TC 2.
135
136       The schedule will start at instant 1528743495910289987 using the refer‐
137       ence CLOCK_TAI. The schedule is composed of three entries each of 300us
138       duration.
139
140       # tc qdisc replace dev eth0 parent root handle 100 stab overhead 24 taprio \
141                     num_tc 3 \
142                     map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
143                     queues 1@0 1@1 2@2 \
144                     base-time 1528743495910289987 \
145                     sched-entry S 01 300000 \
146                     sched-entry S 02 300000 \
147                     sched-entry S 04 300000 \
148                     clockid CLOCK_TAI
149
150       Following is an example to enable the txtime offload  mode  in  taprio.
151       See etf(8) for more information about configuring the ETF qdisc.
152
153       # tc qdisc replace dev eth0 parent root handle 100 stab overhead 24 taprio \
154                     num_tc 3 \
155                     map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
156                     queues 1@0 1@0 1@0 \
157                     base-time 1528743495910289987 \
158                     sched-entry S 01 300000 \
159                     sched-entry S 02 300000 \
160                     sched-entry S 04 400000 \
161                     flags 0x1 \
162                     txtime-delay 200000 \
163                     clockid CLOCK_TAI
164
165       # tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \
166                     offload delta 200000 clockid CLOCK_TAI
167
168       The  following is a schedule in full offload mode. The base-time is 200
169       ns and the cycle-time is implicitly calculated as the sum of all sched-
170       entry  durations  (i.e.  20  us + 20 us + 60 us = 100 us). Although the
171       base-time is in the past, the hardware will start executing the  sched‐
172       ule  at  a  PTP  time equal to the smallest integer multiple of 100 us,
173       plus 200 ns, that is larger than the NIC's current PTP time.  In  addi‐
174       tion, the MTU for traffic class 5 is limited to 200 octets, so that the
175       interference this creates upon traffic class 7 during the  time  window
176       when  their  gates are both open is bounded. The interference is deter‐
177       mined by the transmit time of the max SDU, plus the L2  header  length,
178       plus  the  L1  overhead (determined from the size table specified using
179       tc-stab(8)).
180
181       # tc qdisc add dev eth0 parent root stab overhead 24 taprio \
182                     num_tc 8 \
183                     map 0 1 2 3 4 5 6 7 \
184                     queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \
185                     max-sdu 0 0 0 0 0 200 0 0 \
186                     base-time 200 \
187                     sched-entry S 80 20000 \
188                     sched-entry S a0 20000 \
189                     sched-entry S 5f 60000 \
190                     flags 0x2
191
192

SEE ALSO

194       tc-stab(8)
195
196

AUTHORS

198       Vinicius Costa Gomes <vinicius.gomes@intel.com>
199
200
201
202iproute2                         25 Sept 2018                        TAPRIO(8)
Impressum