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