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