]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/tc-taprio.8
vdpa: add .gitignore
[mirror_iproute2.git] / man / man8 / tc-taprio.8
CommitLineData
579acb4b
VCG
1.TH TAPRIO 8 "25 Sept 2018" "iproute2" "Linux"
2.SH NAME
3TAPRIO \- Time Aware Priority Shaper
4.SH SYNOPSIS
5.B tc qdisc ... dev
6dev
7.B parent
8classid
9.B [ handle
10major:
11.B ] taprio num_tc
12tcs
13.ti +8
14.B map
15P0 P1 P2 ...
16.B queues
17count1@offset1 count2@offset2 ...
18.ti +8
19.B base-time
20base-time
21.B clockid
22clockid
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
37The TAPRIO qdisc implements a simplified version of the scheduling
38state machine defined by IEEE 802.1Q-2018 Section 8.6.9, which allows
39configuration of a sequence of gate states, where each gate state
40allows outgoing traffic for a subset (potentially empty) of traffic
41classes.
42
43How traffic is mapped to different hardware queues is similar to
44.BR mqprio(8)
45and so the
46.B map
47and
8242808c 48.B queues
579acb4b
VCG
49parameters have the same meaning.
50
51The other parameters specify the schedule, and at what point in time
52it should start (it can behave as the schedule started in the past).
53
54.SH PARAMETERS
55.TP
56num_tc
57.BR
58Number of traffic classes to use. Up to 16 classes supported.
59
60.TP
61map
62.br
63The priority to traffic class map. Maps priorities 0..15 to a specified
64traffic class. See
65.BR mqprio(8)
66for more details.
67
68.TP
69queues
70.br
71Provide count and offset of queue range for each traffic class. In the
72format,
73.B count@offset.
74Queue ranges for each traffic classes cannot overlap and must be a
75contiguous range of queues.
76
77.TP
78base-time
79.br
80Specifies the instant in nanoseconds, using the reference of
81.B clockid,
82defining the time when the schedule starts. If 'base-time' is a time
83in the past, the schedule will start at
84
85base-time + (N * cycle-time)
86
87where 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
89in the schedule;
90
91.TP
92clockid
93.br
94Specifies the clock to be used by qdisc's internal timer for measuring
4712a461
VO
95time and scheduling events. This argument must be omitted when using the
96full-offload feature (flags 0x2), since in that case, the clockid is
97implicitly /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
102sched-entry
103.br
104There may multiple
105.B sched-entry
106parameters in a single schedule. Each one has the
107
108sched-entry <command> <gatemask> <interval>
109
110format. The only supported <command> is "S", which
111means "SetGateStates", following the IEEE 802.1Q-2018 definition
112(Table 8-7). <gate mask> is a bitmask where each bit is a associated
113with a traffic class, so bit 0 (the least significant bit) being "on"
114means that traffic class 0 is "active" for that schedule entry.
115<interval> is a time duration, in nanoseconds, that specifies for how
116long that state defined by <command> and <gate mask> should be held
117before moving to the next entry.
118
a794d052
VP
119.TP
120flags
121.br
4712a461
VO
122This is a bit mask which specifies different modes for taprio.
123.RS
124.TP
125.I 0x1
126Enables the txtime-assist feature. In this mode, taprio will set the transmit
127timestamp depending on the interval in which the packet needs to be
128transmitted. It will then utililize the
a794d052
VP
129.BR etf(8)
130qdisc to sort and transmit the packets at the right time. The second example
131can be used as a reference to configure this mode.
4712a461
VO
132.TP
133.I 0x2
134Enables the full-offload feature. In this mode, taprio will pass the gate
135control list to the NIC which will execute it cyclically in hardware.
136When using full-offload, there is no need to specify the
137.B clockid
138argument.
139
140The txtime-assist and full-offload features are mutually exclusive, i.e.
141setting flags to 0x3 is invalid.
142.RE
a794d052
VP
143
144.TP
145txtime-delay
146.br
147This parameter is specific to the txtime offload mode. It specifies the maximum
148time a packet might take to reach the network card from the taprio qdisc. The
149value should always be greater than the delta specified in the
150.BR etf(8)
151qdisc.
152
579acb4b
VCG
153.SH EXAMPLES
154
155The following example shows how an traffic schedule with three traffic
156classes ("num_tc 3"), which are separated different traffic classes,
157we 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
1590, priority 2 is classified as TC 1 and the rest is classified as TC
1602.
161
162The schedule will start at instant 1528743495910289987 using the
163reference CLOCK_TAI. The schedule is composed of three entries each of
164300us 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
178Following is an example to enable the txtime offload mode in taprio. See
179.BR etf(8)
180for 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
199The following is a schedule in full offload mode. The
200.B base-time
201is 200 ns and the
202.B cycle-time
203is implicitly calculated as the sum of all
204.B sched-entry
205durations (i.e. 20 us + 20 us + 60 us = 100 us). Although the base-time is in
206the past, the hardware will start executing the schedule at a PTP time equal to
207the smallest integer multiple of 100 us, plus 200 ns, that is larger than the
208NIC'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
223Vinicius Costa Gomes <vinicius.gomes@intel.com>