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
17

DESCRIPTION

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

PARAMETERS

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

EXAMPLES

112       The following example shows how an traffic schedule with three  traffic
113       classes ("num_tc 3"), which are separated different traffic classes, we
114       are going to call these TC 0, TC 1 and TC 2. We could  read  the  "map"
115       parameter below as: traffic with priority 3 is classified as TC 0, pri‐
116       ority 2 is classified as TC 1 and the rest is classified as TC 2.
117
118       The schedule will start at instant 1528743495910289987 using the refer‐
119       ence CLOCK_TAI. The schedule is composed of three entries each of 300us
120       duration.
121
122       # tc qdisc replace dev eth0 parent root handle 100 taprio \
123                     num_tc 3 \
124                     map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
125                     queues 1@0 1@1 2@2 \
126                     base-time 1528743495910289987 \
127                     sched-entry S 01 300000 \
128                     sched-entry S 02 300000 \
129                     sched-entry S 04 300000 \
130                     clockid CLOCK_TAI
131
132       Following is an example to enable the txtime offload  mode  in  taprio.
133       See etf(8) for more information about configuring the ETF qdisc.
134
135       # tc qdisc replace dev eth0 parent root handle 100 taprio \
136                     num_tc 3 \
137                     map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
138                     queues 1@0 1@0 1@0 \
139                     base-time 1528743495910289987 \
140                     sched-entry S 01 300000 \
141                     sched-entry S 02 300000 \
142                     sched-entry S 04 400000 \
143                     flags 0x1 \
144                     txtime-delay 200000 \
145                     clockid CLOCK_TAI
146
147       # tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \
148                     offload delta 200000 clockid CLOCK_TAI
149
150       The  following is a schedule in full offload mode. The base-time is 200
151       ns and the cycle-time is implicitly calculated as the sum of all sched-
152       entry  durations  (i.e.  20  us + 20 us + 60 us = 100 us). Although the
153       base-time is in the past, the hardware will start executing the  sched‐
154       ule  at  a  PTP  time equal to the smallest integer multiple of 100 us,
155       plus 200 ns, that is larger than the NIC's current PTP time.
156
157       # tc qdisc add dev eth0 parent root taprio \
158                     num_tc 8 \
159                     map 0 1 2 3 4 5 6 7 \
160                     queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \
161                     base-time 200 \
162                     sched-entry S 80 20000 \
163                     sched-entry S a0 20000 \
164                     sched-entry S df 60000 \
165                     flags 0x2
166
167

AUTHORS

169       Vinicius Costa Gomes <vinicius.gomes@intel.com>
170
171
172
173iproute2                         25 Sept 2018                        TAPRIO(8)
Impressum