]> git.proxmox.com Git - mirror_iproute2.git/blob - man/man8/tc-actions.8
bridge: mdb: add support for source address
[mirror_iproute2.git] / man / man8 / tc-actions.8
1 .TH "actions in tc" 8 "1 Aug 2017" "iproute2" "Linux"
2
3 .SH NAME
4 actions \- independently defined actions in tc
5 .SH SYNOPSIS
6 .B tc
7 [
8 .I TC_OPTIONS
9 ]
10 .B actions
11 .BR add " | " change " | " replace
12 .I ACTSPEC
13
14 .B tc
15 [
16 .I TC_OPTIONS
17 ]
18 .B actions
19 .BR get " | " delete
20 .I ACTISPEC
21
22 .B tc
23 [
24 .I TC_OPTIONS
25 ]
26 .B actions flush
27 .I ACTNAMESPEC
28
29 .B tc
30 [
31 .I TC_OPTIONS
32 ]
33 .B actions
34 .BR ls " | " list
35 .I ACTNAMESPEC
36 [
37 .I ACTFILTER
38 ]
39
40 .in +8
41 .I ACTSPEC
42 :=
43 .B action
44 .I ACTDETAIL
45 [
46 .I INDEXSPEC
47 ] [
48 .I COOKIESPEC
49 ] [
50 .I FLAGS
51 ] [
52 .I HWSTATSSPEC
53 ] [
54 .I CONTROL
55 ]
56
57 .I ACTISPEC
58 :=
59 .I ACTNAMESPEC INDEXSPEC
60
61 .I ACTNAMESPEC
62 :=
63 .B action
64 ACTNAME
65
66 .I INDEXSPEC
67 :=
68 .BI index " INDEX"
69
70 .I ACTFILTER
71 :=
72 .BI since " MSTIME"
73
74 .I COOKIESPEC
75 :=
76 .BI cookie " COOKIE"
77
78 .I FLAGS
79 :=
80 .I no_percpu
81
82 .I HWSTATSSPEC
83 :=
84 .BR hw_stats " {"
85 .IR immediate " | " delayed " | " disabled " }"
86
87 .I ACTDETAIL
88 :=
89 .I ACTNAME ACTPARAMS
90
91 .I ACTNAME
92 may be any valid action type: gact, mirred, bpf, connmark, csum, police, etc.
93
94 .I MSTIME
95 Time since last update.
96
97 .I CONTROL
98 := {
99 .IR reclassify " | " pipe " | " drop " | " continue " | " ok
100 }
101
102 .I TC_OPTIONS
103 These are the options that are specific to
104 .B tc
105 and not only the options. Refer to
106 .BR tc(8)
107 for more information.
108 .in
109
110 .SH DESCRIPTION
111
112 The
113 .B actions
114 object in
115 .B tc
116 allows a user to define actions independently of a classifier (filter). These
117 actions can then be assigned to one or more filters, with any
118 packets matching the classifier's criteria having that action performed
119 on them.
120
121 Each action type (mirred, police, etc.) will have its own table to store
122 all created actions.
123
124 .SH OPERATIONS
125 .TP
126 .B add
127 Create a new action in that action's table.
128
129 .TP
130 .B change
131 .TQ
132 .B replace
133 Make modifications to an existing action.
134 .TP
135 .B get
136 Display the action with the specified index value. When combined with the
137 .B -s
138 option for
139 .BR tc ","
140 display the statistics for that action.
141 .TP
142 .B delete
143 Delete the action with the specified index value. If the action is already
144 associated with a classifier, it does not delete the classifier.
145 .TP
146 .B ls
147 .TQ
148 .B list
149 List all the actions in the specified table. When combined with the
150 .B -s
151 option for
152 .BR tc ","
153 display the statistics for all actions in the specified table.
154 When combined with the option
155 .B since
156 allows doing a millisecond time-filter since the last time an
157 action was used in the datapath.
158 .TP
159 .B flush
160 Delete all actions stored in the specified table.
161
162 .SH ACTION OPTIONS
163 Note that these options are available to all action types.
164 .TP
165 .BI index " INDEX"
166 Specify the table index value of an action.
167 .I INDEX
168 is a 32-bit value that is unique to the specific type of action referenced.
169
170 .RS
171 For
172 .BR add ", " change ", and"
173 .B replace
174 operations, the index is
175 .BR optional.
176 When adding a new action,
177 specifying an index value will assign the action to that index unless that
178 index value has already been assigned. Omitting the index value for an add
179 operation will cause the kernel to assign a value to the new action.
180 .RE
181
182 .RS
183 For
184 .BR get " and " delete
185 operations, the index is
186 .B required
187 to identify the specific action to be displayed or deleted.
188 .RE
189
190 .TP
191 .BI cookie " COOKIE"
192 In addition to the specific action, mark the matching packet with the value
193 specified by
194 .IR COOKIE "."
195 The
196 .I COOKIE
197 is a 128-bit value that will not be interpreted by the kernel whatsoever.
198 As such, it can be used as a correlating value for maintaining user state.
199 The value to be stored is completely arbitrary and does not require a specific
200 format. It is stored inside the action structure itself.
201
202 .TP
203 .I FLAGS
204 Action-specific flags. Currently, the only supported flag is
205 .I no_percpu
206 which indicates that action is expected to have minimal software data-path
207 traffic and doesn't need to allocate stat counters with percpu allocator.
208 This option is intended to be used by hardware-offloaded actions.
209
210 .TP
211 .BI hw_stats " HW_STATS"
212 Specifies the type of HW stats of new action. If omitted, any stats counter type
213 is going to be used, according to driver and its resources.
214 The
215 .I HW_STATS
216 indicates the type. Any of the following are valid:
217 .RS
218 .TP
219 .B immediate
220 Means that in dump, user gets the current HW stats state from the device
221 queried at the dump time.
222 .TP
223 .B delayed
224 Means that in dump, user gets HW stats that might be out of date for
225 some time, maybe couple of seconds. This is the case when driver polls
226 stats updates periodically or when it gets async stats update
227 from the device.
228 .TP
229 .B disabled
230 No HW stats are going to be available in dump.
231 .RE
232
233 .TP
234 .BI since " MSTIME"
235 When dumping large number of actions, a millisecond time-filter can be
236 specified
237 .IR MSTIME "."
238 The
239 .I MSTIME
240 is a millisecond count since last time a packet hit the action.
241 As an example specifying "since 20000" implies to dump all actions
242 that have seen packets in the last 20 seconds. This option is useful
243 when the kernel has a large number of actions and you are only interested
244 in recently used actions.
245
246 .TP
247 .I CONTROL
248 The
249 .I CONTROL
250 indicates how
251 .B tc
252 should proceed after executing the action. Any of the following are valid:
253 .RS
254 .TP
255 .B reclassify
256 Restart the classifiction by jumping back to the first filter attached to
257 the action's parent.
258 .TP
259 .B pipe
260 Continue with the next action. This is the default control.
261 .TP
262 .B drop
263 Drop the packed without running any further actions.
264 .TP
265 .B continue
266 Continue the classification with the next filter.
267 .TP
268 .B pass
269 Return to the calling qdisc for packet processing, and end classification of
270 this packet.
271 .RE
272
273 .SH SEE ALSO
274 .BR tc (8),
275 .BR tc-bpf (8),
276 .BR tc-connmark (8),
277 .BR tc-csum (8),
278 .BR tc-ife (8),
279 .BR tc-mirred (8),
280 .BR tc-nat (8),
281 .BR tc-pedit (8),
282 .BR tc-police (8),
283 .BR tc-simple (8),
284 .BR tc-skbedit (8),
285 .BR tc-skbmod (8),
286 .BR tc-tunnel_key (8),
287 .BR tc-vlan (8),
288 .BR tc-xt (8)