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