1TAPRIO(8) Linux TAPRIO(8)
2
3
4
6 TAPRIO - Time Aware Priority Shaper
7
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
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
22 allows 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
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.
62
63
64 sched-entry
65 There may multiple sched-entry parameters in a single schedule.
66 Each one has the
67
68 sched-entry <command> <gatemask> <interval>
69
70 format. The only supported <command> is "S", which means "Set‐
71 GateStates", following the IEEE 802.1Q-2018 definition (Table
72 8-7). <gate mask> is a bitmask where each bit is a associated
73 with a traffic class, so bit 0 (the least significant bit) being
74 "on" means that traffic class 0 is "active" for that schedule
75 entry. <interval> is a time duration, in nanoseconds, that
76 specifies for how long that state defined by <command> and <gate
77 mask> should be held before moving to the next entry.
78
79
80 flags
81 Specifies different modes for taprio. Currently, only txtime-
82 assist is supported which can be enabled by setting it to 0x1.
83 In this mode, taprio will set the transmit timestamp depending
84 on the interval in which the packet needs to be transmitted. It
85 will then utililize the etf(8) qdisc to sort and transmit the
86 packets at the right time. The second example can be used as a
87 reference to configure this mode.
88
89
90 txtime-delay
91 This parameter is specific to the txtime offload mode. It speci‐
92 fies the maximum time a packet might take to reach the network
93 card from the taprio qdisc. The value should always be greater
94 than the delta specified in the etf(8) qdisc.
95
96
98 The following example shows how an traffic schedule with three traffic
99 classes ("num_tc 3"), which are separated different traffic classes, we
100 are going to call these TC 0, TC 1 and TC 2. We could read the "map"
101 parameter below as: traffic with priority 3 is classified as TC 0, pri‐
102 ority 2 is classified as TC 1 and the rest is classified as TC 2.
103
104 The schedule will start at instant 1528743495910289987 using the refer‐
105 ence CLOCK_TAI. The schedule is composed of three entries each of 300us
106 duration.
107
108 # tc qdisc replace dev eth0 parent root handle 100 taprio \
109 num_tc 3 \
110 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
111 queues 1@0 1@1 2@2 \
112 base-time 1528743495910289987 \
113 sched-entry S 01 300000 \
114 sched-entry S 02 300000 \
115 sched-entry S 04 300000 \
116 clockid CLOCK_TAI
117
118 Following is an example to enable the txtime offload mode in taprio.
119 See etf(8) for more information about configuring the ETF qdisc.
120
121 # tc qdisc replace dev eth0 parent root handle 100 taprio \
122 num_tc 3 \
123 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
124 queues 1@0 1@0 1@0 \
125 base-time 1528743495910289987 \
126 sched-entry S 01 300000 \
127 sched-entry S 02 300000 \
128 sched-entry S 04 400000 \
129 flags 0x1 \
130 txtime-delay 200000 \
131 clockid CLOCK_TAI
132
133 # tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \
134 offload delta 200000 clockid CLOCK_TAI
135
136
138 Vinicius Costa Gomes <vinicius.gomes@intel.com>
139
140
141
142iproute2 25 Sept 2018 TAPRIO(8)