1actions in tc(8) Linux actions in tc(8)
2
3
4
6 actions - independently defined actions in tc
7
9 tc [ TC_OPTIONS ] actions add | change | replace ACTSPEC
10
11 tc [ TC_OPTIONS ] actions get | delete ACTISPEC
12
13 tc [ TC_OPTIONS ] actions flush ACTNAMESPEC
14
15 tc [ TC_OPTIONS ] actions ls | list ACTNAMESPEC [ ACTFILTER ]
16
17 ACTSPEC := action ACTDETAIL [ INDEXSPEC ] [ COOKIESPEC ] [
18 FLAGS ] [ HWSTATSSPEC ] [ CONTROL ] [ SKIPSPEC ]
19
20 ACTISPEC := ACTNAMESPEC INDEXSPEC
21
22 ACTNAMESPEC := action ACTNAME
23
24 INDEXSPEC := index INDEX
25
26 ACTFILTER := since MSTIME
27
28 COOKIESPEC := cookie COOKIE
29
30 FLAGS := no_percpu
31
32 HWSTATSSPEC := hw_stats { immediate | delayed | disabled }
33
34 ACTDETAIL := ACTNAME ACTPARAMS
35
36 ACTNAME may be any valid action type: gact, mirred, bpf, conn‐
37 mark, csum, police, etc.
38
39 MSTIME Time since last update.
40
41 CONTROL := { reclassify | pipe | drop | continue | ok }
42
43 SKIPSPEC := { skip_sw | skip_hw }
44
45 TC_OPTIONS These are the options that are specific to tc and
46 not only the options. Refer to tc(8) for more information.
47
48
50 The actions object in tc allows a user to define actions independently
51 of a classifier (filter). These actions can then be assigned to one or
52 more filters, with any packets matching the classifier's criteria hav‐
53 ing that action performed on them.
54
55 Each action type (mirred, police, etc.) will have its own table to
56 store all created actions.
57
58
60 add Create a new action in that action's table.
61
62
63 change
64 replace
65 Make modifications to an existing action.
66
67 get Display the action with the specified index value. When combined
68 with the -s option for tc, display the statistics for that ac‐
69 tion.
70
71 delete Delete the action with the specified index value. If the action
72 is already associated with a classifier, it does not delete the
73 classifier.
74
75 ls
76 list List all the actions in the specified table. When combined with
77 the -s option for tc, display the statistics for all actions in
78 the specified table. When combined with the option since allows
79 doing a millisecond time-filter since the last time an action
80 was used in the datapath.
81
82 flush Delete all actions stored in the specified table.
83
84
86 Note that these options are available to all action types.
87
88 index INDEX
89 Specify the table index value of an action. INDEX is a 32-bit
90 value that is unique to the specific type of action referenced.
91
92 For add, change, and replace operations, the index is optional.
93 When adding a new action, specifying an index value will assign
94 the action to that index unless that index value has already
95 been assigned. Omitting the index value for an add operation
96 will cause the kernel to assign a value to the new action.
97
98 For get and delete operations, the index is required to identify
99 the specific action to be displayed or deleted.
100
101
102 cookie COOKIE
103 In addition to the specific action, mark the matching packet
104 with the value specified by COOKIE. The COOKIE is a 128-bit
105 value that will not be interpreted by the kernel whatsoever. As
106 such, it can be used as a correlating value for maintaining user
107 state. The value to be stored is completely arbitrary and does
108 not require a specific format. It is stored inside the action
109 structure itself.
110
111
112 FLAGS Action-specific flags. Currently, the only supported flag is
113 no_percpu which indicates that action is expected to have mini‐
114 mal software data-path traffic and doesn't need to allocate stat
115 counters with percpu allocator. This option is intended to be
116 used by hardware-offloaded actions.
117
118
119 hw_stats HW_STATS
120 Specifies the type of HW stats of new action. If omitted, any
121 stats counter type is going to be used, according to driver and
122 its resources. The HW_STATS indicates the type. Any of the fol‐
123 lowing are valid:
124
125 immediate
126 Means that in dump, user gets the current HW stats state
127 from the device queried at the dump time.
128
129 delayed
130 Means that in dump, user gets HW stats that might be out
131 of date for some time, maybe couple of seconds. This is
132 the case when driver polls stats updates periodically or
133 when it gets async stats update from the device.
134
135 disabled
136 No HW stats are going to be available in dump.
137
138
139 since MSTIME
140 When dumping large number of actions, a millisecond time-filter
141 can be specified MSTIME. The MSTIME is a millisecond count
142 since last time a packet hit the action. As an example specify‐
143 ing "since 20000" implies to dump all actions that have seen
144 packets in the last 20 seconds. This option is useful when the
145 kernel has a large number of actions and you are only interested
146 in recently used actions.
147
148
149 CONTROL
150 The CONTROL indicates how tc should proceed after executing the
151 action. Any of the following are valid:
152
153 reclassify
154 Restart the classifiction by jumping back to the first
155 filter attached to the action's parent.
156
157 pipe Continue with the next action. This is the default con‐
158 trol.
159
160 drop Drop the packed without running any further actions.
161
162 continue
163 Continue the classification with the next filter.
164
165 pass Return to the calling qdisc for packet processing, and
166 end classification of this packet.
167
168
169 SKIPSPEC
170 The SKIPSPEC indicates how tc should proceed when executing the
171 action. Any of the following are valid:
172
173 skip_sw
174 Do not process action by software. If hardware has no
175 offload support for this action, operation will fail.
176
177 skip_hw
178 Do not process action by hardware.
179
180
182 tc(8), tc-bpf(8), tc-connmark(8), tc-csum(8), tc-ife(8), tc-mirred(8),
183 tc-nat(8), tc-pedit(8), tc-police(8), tc-simple(8), tc-skbedit(8), tc-
184 skbmod(8), tc-tunnel_key(8), tc-vlan(8), tc-xt(8)
185
186
187
188iproute2 1 Aug 2017 actions in tc(8)