]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/tc-taprio.8
tc: taprio: Update documentation
[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
95time and scheduling events.
96
97.TP
98sched-entry
99.br
100There may multiple
101.B sched-entry
102parameters in a single schedule. Each one has the
103
104sched-entry <command> <gatemask> <interval>
105
106format. The only supported <command> is "S", which
107means "SetGateStates", following the IEEE 802.1Q-2018 definition
108(Table 8-7). <gate mask> is a bitmask where each bit is a associated
109with a traffic class, so bit 0 (the least significant bit) being "on"
110means that traffic class 0 is "active" for that schedule entry.
111<interval> is a time duration, in nanoseconds, that specifies for how
112long that state defined by <command> and <gate mask> should be held
113before moving to the next entry.
114
a794d052
VP
115.TP
116flags
117.br
118Specifies different modes for taprio. Currently, only txtime-assist is
119supported which can be enabled by setting it to 0x1. In this mode, taprio will
120set the transmit timestamp depending on the interval in which the packet needs
121to be transmitted. It will then utililize the
122.BR etf(8)
123qdisc to sort and transmit the packets at the right time. The second example
124can be used as a reference to configure this mode.
125
126.TP
127txtime-delay
128.br
129This parameter is specific to the txtime offload mode. It specifies the maximum
130time a packet might take to reach the network card from the taprio qdisc. The
131value should always be greater than the delta specified in the
132.BR etf(8)
133qdisc.
134
579acb4b
VCG
135.SH EXAMPLES
136
137The following example shows how an traffic schedule with three traffic
138classes ("num_tc 3"), which are separated different traffic classes,
139we are going to call these TC 0, TC 1 and TC 2. We could read the
140"map" parameter below as: traffic with priority 3 is classified as TC
1410, priority 2 is classified as TC 1 and the rest is classified as TC
1422.
143
144The schedule will start at instant 1528743495910289987 using the
145reference CLOCK_TAI. The schedule is composed of three entries each of
146300us duration.
147
148.EX
149# tc qdisc replace dev eth0 parent root handle 100 taprio \\
150 num_tc 3 \\
151 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\
152 queues 1@0 1@1 2@2 \\
153 base-time 1528743495910289987 \\
154 sched-entry S 01 300000 \\
155 sched-entry S 02 300000 \\
156 sched-entry S 04 300000 \\
157 clockid CLOCK_TAI
158.EE
159
a794d052
VP
160Following is an example to enable the txtime offload mode in taprio. See
161.BR etf(8)
162for more information about configuring the ETF qdisc.
163
164.EX
165# tc qdisc replace dev eth0 parent root handle 100 taprio \\
166 num_tc 3 \\
167 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\
168 queues 1@0 1@0 1@0 \\
169 base-time 1528743495910289987 \\
170 sched-entry S 01 300000 \\
171 sched-entry S 02 300000 \\
172 sched-entry S 04 400000 \\
173 flags 0x1 \\
174 txtime-delay 200000 \\
175 clockid CLOCK_TAI
176
177# tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \\
178 offload delta 200000 clockid CLOCK_TAI
179.EE
579acb4b
VCG
180
181.SH AUTHORS
182Vinicius Costa Gomes <vinicius.gomes@intel.com>