]>
Commit | Line | Data |
---|---|---|
579acb4b VCG |
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 | ||
36 | .SH DESCRIPTION | |
37 | The TAPRIO qdisc implements a simplified version of the scheduling | |
38 | state machine defined by IEEE 802.1Q-2018 Section 8.6.9, which allows | |
39 | configuration of a sequence of gate states, where each gate state | |
40 | allows outgoing traffic for a subset (potentially empty) of traffic | |
41 | classes. | |
42 | ||
43 | How traffic is mapped to different hardware queues is similar to | |
44 | .BR mqprio(8) | |
45 | and so the | |
46 | .B map | |
47 | and | |
8242808c | 48 | .B queues |
579acb4b VCG |
49 | parameters have the same meaning. |
50 | ||
51 | The other parameters specify the schedule, and at what point in time | |
52 | it should start (it can behave as the schedule started in the past). | |
53 | ||
54 | .SH PARAMETERS | |
55 | .TP | |
56 | num_tc | |
57 | .BR | |
58 | Number of traffic classes to use. Up to 16 classes supported. | |
59 | ||
60 | .TP | |
61 | map | |
62 | .br | |
63 | The priority to traffic class map. Maps priorities 0..15 to a specified | |
64 | traffic class. See | |
65 | .BR mqprio(8) | |
66 | for more details. | |
67 | ||
68 | .TP | |
69 | queues | |
70 | .br | |
71 | Provide count and offset of queue range for each traffic class. In the | |
72 | format, | |
73 | .B count@offset. | |
74 | Queue ranges for each traffic classes cannot overlap and must be a | |
75 | contiguous range of queues. | |
76 | ||
77 | .TP | |
78 | base-time | |
79 | .br | |
80 | Specifies the instant in nanoseconds, using the reference of | |
81 | .B clockid, | |
82 | defining the time when the schedule starts. If 'base-time' is a time | |
83 | in the past, the schedule will start at | |
84 | ||
85 | base-time + (N * cycle-time) | |
86 | ||
87 | where N is the smallest integer so the resulting time is greater than | |
88 | "now", and "cycle-time" is the sum of all the intervals of the entries | |
89 | in the schedule; | |
90 | ||
91 | .TP | |
92 | clockid | |
93 | .br | |
94 | Specifies the clock to be used by qdisc's internal timer for measuring | |
4712a461 VO |
95 | time and scheduling events. This argument must be omitted when using the |
96 | full-offload feature (flags 0x2), since in that case, the clockid is | |
97 | implicitly /dev/ptpN (where N is given by | |
98 | .B ethtool -T eth0 | grep 'PTP Hardware Clock' | |
99 | ), and therefore not necessarily synchronized with the system's CLOCK_TAI. | |
579acb4b VCG |
100 | |
101 | .TP | |
102 | sched-entry | |
103 | .br | |
104 | There may multiple | |
105 | .B sched-entry | |
106 | parameters in a single schedule. Each one has the | |
107 | ||
108 | sched-entry <command> <gatemask> <interval> | |
109 | ||
110 | format. The only supported <command> is "S", which | |
111 | means "SetGateStates", following the IEEE 802.1Q-2018 definition | |
112 | (Table 8-7). <gate mask> is a bitmask where each bit is a associated | |
113 | with a traffic class, so bit 0 (the least significant bit) being "on" | |
114 | means that traffic class 0 is "active" for that schedule entry. | |
115 | <interval> is a time duration, in nanoseconds, that specifies for how | |
116 | long that state defined by <command> and <gate mask> should be held | |
117 | before moving to the next entry. | |
118 | ||
a794d052 VP |
119 | .TP |
120 | flags | |
121 | .br | |
4712a461 VO |
122 | This is a bit mask which specifies different modes for taprio. |
123 | .RS | |
124 | .TP | |
125 | .I 0x1 | |
126 | Enables the txtime-assist feature. In this mode, taprio will set the transmit | |
127 | timestamp depending on the interval in which the packet needs to be | |
128 | transmitted. It will then utililize the | |
a794d052 VP |
129 | .BR etf(8) |
130 | qdisc to sort and transmit the packets at the right time. The second example | |
131 | can be used as a reference to configure this mode. | |
4712a461 VO |
132 | .TP |
133 | .I 0x2 | |
134 | Enables the full-offload feature. In this mode, taprio will pass the gate | |
135 | control list to the NIC which will execute it cyclically in hardware. | |
136 | When using full-offload, there is no need to specify the | |
137 | .B clockid | |
138 | argument. | |
139 | ||
140 | The txtime-assist and full-offload features are mutually exclusive, i.e. | |
141 | setting flags to 0x3 is invalid. | |
142 | .RE | |
a794d052 VP |
143 | |
144 | .TP | |
145 | txtime-delay | |
146 | .br | |
147 | This parameter is specific to the txtime offload mode. It specifies the maximum | |
148 | time a packet might take to reach the network card from the taprio qdisc. The | |
149 | value should always be greater than the delta specified in the | |
150 | .BR etf(8) | |
151 | qdisc. | |
152 | ||
579acb4b VCG |
153 | .SH EXAMPLES |
154 | ||
155 | The following example shows how an traffic schedule with three traffic | |
156 | classes ("num_tc 3"), which are separated different traffic classes, | |
157 | we are going to call these TC 0, TC 1 and TC 2. We could read the | |
158 | "map" parameter below as: traffic with priority 3 is classified as TC | |
159 | 0, priority 2 is classified as TC 1 and the rest is classified as TC | |
160 | 2. | |
161 | ||
162 | The schedule will start at instant 1528743495910289987 using the | |
163 | reference CLOCK_TAI. The schedule is composed of three entries each of | |
164 | 300us duration. | |
165 | ||
166 | .EX | |
167 | # tc qdisc replace dev eth0 parent root handle 100 taprio \\ | |
168 | num_tc 3 \\ | |
169 | map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\ | |
170 | queues 1@0 1@1 2@2 \\ | |
171 | base-time 1528743495910289987 \\ | |
172 | sched-entry S 01 300000 \\ | |
173 | sched-entry S 02 300000 \\ | |
174 | sched-entry S 04 300000 \\ | |
175 | clockid CLOCK_TAI | |
176 | .EE | |
177 | ||
a794d052 VP |
178 | Following is an example to enable the txtime offload mode in taprio. See |
179 | .BR etf(8) | |
180 | for more information about configuring the ETF qdisc. | |
181 | ||
182 | .EX | |
183 | # tc qdisc replace dev eth0 parent root handle 100 taprio \\ | |
184 | num_tc 3 \\ | |
185 | map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\ | |
186 | queues 1@0 1@0 1@0 \\ | |
187 | base-time 1528743495910289987 \\ | |
188 | sched-entry S 01 300000 \\ | |
189 | sched-entry S 02 300000 \\ | |
190 | sched-entry S 04 400000 \\ | |
191 | flags 0x1 \\ | |
192 | txtime-delay 200000 \\ | |
193 | clockid CLOCK_TAI | |
194 | ||
195 | # tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \\ | |
196 | offload delta 200000 clockid CLOCK_TAI | |
197 | .EE | |
579acb4b | 198 | |
4712a461 VO |
199 | The following is a schedule in full offload mode. The |
200 | .B base-time | |
201 | is 200 ns and the | |
202 | .B cycle-time | |
203 | is implicitly calculated as the sum of all | |
204 | .B sched-entry | |
205 | durations (i.e. 20 us + 20 us + 60 us = 100 us). Although the base-time is in | |
206 | the past, the hardware will start executing the schedule at a PTP time equal to | |
207 | the smallest integer multiple of 100 us, plus 200 ns, that is larger than the | |
208 | NIC's current PTP time. | |
209 | ||
210 | .EX | |
211 | # tc qdisc add dev eth0 parent root taprio \\ | |
212 | num_tc 8 \\ | |
213 | map 0 1 2 3 4 5 6 7 \\ | |
214 | queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \\ | |
215 | base-time 200 \\ | |
216 | sched-entry S 80 20000 \\ | |
217 | sched-entry S a0 20000 \\ | |
218 | sched-entry S df 60000 \\ | |
219 | flags 0x2 | |
220 | .EE | |
221 | ||
579acb4b VCG |
222 | .SH AUTHORS |
223 | Vinicius Costa Gomes <vinicius.gomes@intel.com> |