Debian Codegraph @

upstream/opensuse-leap-16-1/man8/tc-taprio.8

raw
1 .TH TAPRIO 8 "25 Sept 2018" "iproute2" "Linux"
2 .SH NAME
3 TAPRIO \- Time Aware Priority Shaper
4 .SH SYNOPSIS
5 .B tc qdisc ... dev
6 dev
7 .B parent
8 classid
9 .B [ handle
10 major:
11 .B ] taprio num_tc
12 tcs
13 .ti +8
14 .B map
15 P0 P1 P2 ...
16 .B queues
17 count1@offset1 count2@offset2 ...
18 .ti +8
19 .B base-time
20 base-time
21 .B clockid
22 clockid
23 .ti +8
24 .B sched-entry
25 <command 1> <gate mask 1> <interval 1>
26 .ti +8
27 .B sched-entry
28 <command 2> <gate mask 2> <interval 2>
29 .ti +8
30 .B sched-entry
31 <command 3> <gate mask 3> <interval 3>
32 .ti +8
33 .B sched-entry
34 <command N> <gate mask N> <interval N>
35 .ti +8
36 [
37 .B max-sdu
38 <queueMaxSDU[TC 0]> <queueMaxSDU[TC 1]> <queueMaxSDU[TC N]> ]
39 .ti +8
40 [
41 .B fp
42 <adminStatus[TC 0]> <adminStatus[TC 1]> <adminStatus[TC N]> ]
43
44 .SH DESCRIPTION
45 The TAPRIO qdisc implements a simplified version of the scheduling
46 state machine defined by IEEE 802.1Q-2018 Section 8.6.9, which allows
47 configuration of a sequence of gate states, where each gate state
48 allows outgoing traffic for a subset (potentially empty) of traffic
49 classes.
50
51 How traffic is mapped to different hardware queues is similar to
52 .BR mqprio(8)
53 and so the
54 .B map
55 and
56 .B queues
57 parameters have the same meaning.
58
59 The other parameters specify the schedule, and at what point in time
60 it should start (it can behave as the schedule started in the past).
61
62 .SH PARAMETERS
63 .TP
64 num_tc
65 .BR
66 Number of traffic classes to use. Up to 16 classes supported.
67
68 .TP
69 map
70 .br
71 The priority to traffic class map. Maps priorities 0..15 to a specified
72 traffic class. See
73 .BR mqprio(8)
74 for more details.
75
76 .TP
77 queues
78 .br
79 Provide count and offset of queue range for each traffic class. In the
80 format,
81 .B count@offset.
82 Queue ranges for each traffic classes cannot overlap and must be a
83 contiguous range of queues.
84
85 .TP
86 base-time
87 .br
88 Specifies the instant in nanoseconds, using the reference of
89 .B clockid,
90 defining the time when the schedule starts. If 'base-time' is a time
91 in the past, the schedule will start at
92
93 base-time + (N * cycle-time)
94
95 where N is the smallest integer so the resulting time is greater than
96 "now", and "cycle-time" is the sum of all the intervals of the entries
97 in the schedule;
98
99 .TP
100 clockid
101 .br
102 Specifies the clock to be used by qdisc's internal timer for measuring
103 time and scheduling events. This argument must be omitted when using the
104 full-offload feature (flags 0x2), since in that case, the clockid is
105 implicitly /dev/ptpN (where N is given by
106 .B ethtool -T eth0 | grep 'PTP Hardware Clock'
107 ), and therefore not necessarily synchronized with the system's CLOCK_TAI.
108
109 .TP
110 sched-entry
111 .br
112 There may multiple
113 .B sched-entry
114 parameters in a single schedule. Each one has the
115
116 sched-entry <command> <gatemask> <interval>
117
118 format. The only supported <command> is "S", which
119 means "SetGateStates", following the IEEE 802.1Q-2018 definition
120 (Table 8-7). <gate mask> is a bitmask where each bit is a associated
121 with a traffic class, so bit 0 (the least significant bit) being "on"
122 means that traffic class 0 is "active" for that schedule entry.
123 <interval> is a time duration, in nanoseconds, that specifies for how
124 long that state defined by <command> and <gate mask> should be held
125 before moving to the next entry.
126
127 .TP
128 flags
129 .br
130 This is a bit mask which specifies different modes for taprio.
131 .RS
132 .TP
133 .I 0x1
134 Enables the txtime-assist feature. In this mode, taprio will set the transmit
135 timestamp depending on the interval in which the packet needs to be
136 transmitted. It will then utililize the
137 .BR etf(8)
138 qdisc to sort and transmit the packets at the right time. The second example
139 can be used as a reference to configure this mode.
140 .TP
141 .I 0x2
142 Enables the full-offload feature. In this mode, taprio will pass the gate
143 control list to the NIC which will execute it cyclically in hardware.
144 When using full-offload, there is no need to specify the
145 .B clockid
146 argument.
147
148 The txtime-assist and full-offload features are mutually exclusive, i.e.
149 setting flags to 0x3 is invalid.
150 .RE
151
152 .TP
153 txtime-delay
154 .br
155 This parameter is specific to the txtime offload mode. It specifies the maximum
156 time a packet might take to reach the network card from the taprio qdisc. The
157 value should always be greater than the delta specified in the
158 .BR etf(8)
159 qdisc.
160
161 .TP
162 max-sdu
163 .br
164 Specifies an array containing at most 16 elements, one per traffic class, which
165 corresponds to the queueMaxSDU table from IEEE 802.1Q-2018. Each array element
166 represents the maximum L2 payload size that can egress that traffic class.
167 Elements that are not filled in default to 0. The value 0 means that the
168 traffic class can send packets up to the port's maximum MTU in size.
169
170 .TP
171 fp
172 .br
173 Selects whether traffic classes are express or preemptible. See
174 .BR tc-mqprio(8)
175 for details.
176
177 .SH EXAMPLES
178
179 The following example shows how an traffic schedule with three traffic
180 classes ("num_tc 3"), which are separated different traffic classes,
181 we are going to call these TC 0, TC 1 and TC 2. We could read the
182 "map" parameter below as: traffic with priority 3 is classified as TC
183 0, priority 2 is classified as TC 1 and the rest is classified as TC
184 2.
185
186 The schedule will start at instant 1528743495910289987 using the
187 reference CLOCK_TAI. The schedule is composed of three entries each of
188 300us duration.
189
190 .EX
191 # tc qdisc replace dev eth0 parent root handle 100 stab overhead 24 taprio \\
192 num_tc 3 \\
193 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\
194 queues 1@0 1@1 2@2 \\
195 base-time 1528743495910289987 \\
196 sched-entry S 01 300000 \\
197 sched-entry S 02 300000 \\
198 sched-entry S 04 300000 \\
199 clockid CLOCK_TAI
200 .EE
201
202 Following is an example to enable the txtime offload mode in taprio. See
203 .BR etf(8)
204 for more information about configuring the ETF qdisc.
205
206 .EX
207 # tc qdisc replace dev eth0 parent root handle 100 stab overhead 24 taprio \\
208 num_tc 3 \\
209 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\
210 queues 1@0 1@0 1@0 \\
211 base-time 1528743495910289987 \\
212 sched-entry S 01 300000 \\
213 sched-entry S 02 300000 \\
214 sched-entry S 04 400000 \\
215 flags 0x1 \\
216 txtime-delay 200000 \\
217 clockid CLOCK_TAI
218
219 # tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \\
220 offload delta 200000 clockid CLOCK_TAI
221 .EE
222
223 The following is a schedule in full offload mode. The
224 .B base-time
225 is 200 ns and the
226 .B cycle-time
227 is implicitly calculated as the sum of all
228 .B sched-entry
229 durations (i.e. 20 us + 20 us + 60 us = 100 us). Although the base-time is in
230 the past, the hardware will start executing the schedule at a PTP time equal to
231 the smallest integer multiple of 100 us, plus 200 ns, that is larger than the
232 NIC's current PTP time. In addition, the MTU for traffic class 5 is limited to
233 200 octets, so that the interference this creates upon traffic class 7 during
234 the time window when their gates are both open is bounded. The interference is
235 determined by the transmit time of the max SDU, plus the L2 header length, plus
236 the L1 overhead (determined from the size table specified using
237 .BR tc-stab(8)).
238
239 .EX
240 # tc qdisc add dev eth0 parent root stab overhead 24 taprio \\
241 num_tc 8 \\
242 map 0 1 2 3 4 5 6 7 \\
243 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \\
244 max-sdu 0 0 0 0 0 200 0 0 \\
245 base-time 200 \\
246 sched-entry S 80 20000 \\
247 sched-entry S a0 20000 \\
248 sched-entry S 5f 60000 \\
249 flags 0x2
250 .EE
251
252 .SH SEE ALSO
253 .BR tc-stab(8)
254
255 .SH AUTHORS
256 Vinicius Costa Gomes <[email protected]>