Blame man/man8/tc-actions.8

Packit d3f73b
.TH "actions in tc" 8 "1 Aug 2017" "iproute2" "Linux"
Packit d3f73b
Packit d3f73b
.SH NAME
Packit d3f73b
actions \- independently defined actions in tc
Packit d3f73b
.SH SYNOPSIS
Packit d3f73b
.B tc
Packit d3f73b
[
Packit d3f73b
.I TC_OPTIONS
Packit d3f73b
]
Packit d3f73b
.B actions
Packit d3f73b
.BR add " | " change " | " replace
Packit d3f73b
.I ACTSPEC
Packit d3f73b
Packit d3f73b
.B tc
Packit d3f73b
[
Packit d3f73b
.I TC_OPTIONS
Packit d3f73b
]
Packit d3f73b
.B actions
Packit d3f73b
.BR get " | " delete
Packit d3f73b
.I ACTISPEC
Packit d3f73b
Packit d3f73b
.B tc
Packit d3f73b
[
Packit d3f73b
.I TC_OPTIONS
Packit d3f73b
]
Packit d3f73b
.B actions flush
Packit d3f73b
.I ACTNAMESPEC
Packit d3f73b
Packit d3f73b
.B tc
Packit d3f73b
[
Packit d3f73b
.I TC_OPTIONS
Packit d3f73b
]
Packit d3f73b
.B actions
Packit d3f73b
.BR ls " | " list
Packit d3f73b
.I ACTNAMESPEC
Packit d3f73b
[
Packit d3f73b
.I ACTFILTER
Packit d3f73b
]
Packit d3f73b
Packit d3f73b
.in +8
Packit d3f73b
.I ACTSPEC
Packit d3f73b
:=
Packit d3f73b
.B action
Packit d3f73b
.I ACTDETAIL
Packit d3f73b
[
Packit d3f73b
.I INDEXSPEC
Packit d3f73b
] [
Packit d3f73b
.I COOKIESPEC
Packit d3f73b
] [
Packit Service 3ca16c
.I FLAGS
Packit Service 3ca16c
] [
Packit d3f73b
.I CONTROL
Packit d3f73b
]
Packit d3f73b
Packit d3f73b
.I ACTISPEC
Packit d3f73b
:=
Packit d3f73b
.I ACTNAMESPEC INDEXSPEC
Packit d3f73b
Packit d3f73b
.I ACTNAMESPEC
Packit d3f73b
:=
Packit d3f73b
.B action
Packit d3f73b
ACTNAME
Packit d3f73b
Packit d3f73b
.I INDEXSPEC
Packit d3f73b
:=
Packit d3f73b
.BI index " INDEX"
Packit d3f73b
Packit d3f73b
.I ACTFILTER
Packit d3f73b
:=
Packit d3f73b
.BI since " MSTIME"
Packit d3f73b
Packit d3f73b
.I COOKIESPEC
Packit d3f73b
:=
Packit d3f73b
.BI cookie " COOKIE"
Packit d3f73b
Packit Service 3ca16c
.I FLAGS
Packit Service 3ca16c
:=
Packit Service 3ca16c
.I no_percpu
Packit Service 3ca16c
Packit d3f73b
.I ACTDETAIL
Packit d3f73b
:=
Packit d3f73b
.I ACTNAME ACTPARAMS
Packit d3f73b
Packit d3f73b
.I ACTNAME
Packit d3f73b
may be any valid action type: gact, mirred, bpf, connmark, csum, police, etc.
Packit d3f73b
Packit d3f73b
.I MSTIME
Packit d3f73b
Time since last update.
Packit d3f73b
Packit d3f73b
.I CONTROL
Packit d3f73b
:= {
Packit d3f73b
.IR reclassify " | " pipe " | " drop " | " continue " | " ok
Packit d3f73b
}
Packit d3f73b
Packit d3f73b
.I TC_OPTIONS
Packit d3f73b
These are the options that are specific to
Packit d3f73b
.B tc
Packit d3f73b
and not only the options. Refer to
Packit d3f73b
.BR tc(8)
Packit d3f73b
for more information.
Packit d3f73b
.in
Packit d3f73b
Packit d3f73b
.SH DESCRIPTION
Packit d3f73b
Packit d3f73b
The
Packit d3f73b
.B actions
Packit d3f73b
object in
Packit d3f73b
.B tc
Packit d3f73b
allows a user to define actions independently of a classifier (filter). These
Packit d3f73b
actions can then be assigned to one or more filters, with any
Packit d3f73b
packets matching the classifier's criteria having that action performed
Packit d3f73b
on them.
Packit d3f73b
Packit d3f73b
Each action type (mirred, police, etc.) will have its own table to store
Packit d3f73b
all created actions.
Packit d3f73b
Packit d3f73b
.SH OPERATIONS
Packit d3f73b
.TP
Packit d3f73b
.B add
Packit d3f73b
Create a new action in that action's table.
Packit d3f73b
Packit d3f73b
.TP
Packit d3f73b
.B change
Packit d3f73b
.TQ
Packit d3f73b
.B replace
Packit d3f73b
Make modifications to an existing action.
Packit d3f73b
.TP
Packit d3f73b
.B get
Packit d3f73b
Display the action with the specified index value. When combined with the
Packit d3f73b
.B -s
Packit d3f73b
option for
Packit d3f73b
.BR tc ","
Packit d3f73b
display the statistics for that action.
Packit d3f73b
.TP
Packit d3f73b
.B delete
Packit d3f73b
Delete the action with the specified index value. If the action is already
Packit d3f73b
associated with a classifier, it does not delete the classifier.
Packit d3f73b
.TP
Packit d3f73b
.B ls
Packit d3f73b
.TQ
Packit d3f73b
.B list
Packit d3f73b
List all the actions in the specified table. When combined with the
Packit d3f73b
.B -s
Packit d3f73b
option for
Packit d3f73b
.BR tc ","
Packit d3f73b
display the statistics for all actions in the specified table.
Packit d3f73b
When combined with the option
Packit d3f73b
.B since
Packit d3f73b
allows doing a millisecond time-filter since the last time an
Packit d3f73b
action was used in the datapath.
Packit d3f73b
.TP
Packit d3f73b
.B flush
Packit d3f73b
Delete all actions stored in the specified table.
Packit d3f73b
Packit d3f73b
.SH ACTION OPTIONS
Packit d3f73b
Note that these options are available to all action types.
Packit d3f73b
.TP
Packit d3f73b
.BI index " INDEX"
Packit d3f73b
Specify the table index value of an action.
Packit d3f73b
.I INDEX
Packit d3f73b
is a 32-bit value that is unique to the specific type of action referenced.
Packit d3f73b
Packit d3f73b
.RS
Packit d3f73b
For
Packit d3f73b
.BR add ", " change ", and"
Packit d3f73b
.B replace
Packit d3f73b
operations, the index is
Packit d3f73b
.BR optional.
Packit d3f73b
When adding a new action,
Packit d3f73b
specifying an index value will assign the action to that index unless that
Packit d3f73b
index value has already been assigned. Omitting the index value for an add
Packit d3f73b
operation will cause the kernel to assign a value to the new action.
Packit d3f73b
.RE
Packit d3f73b
Packit d3f73b
.RS
Packit d3f73b
For
Packit d3f73b
.BR get " and " delete
Packit d3f73b
operations, the index is
Packit d3f73b
.B required
Packit d3f73b
to identify the specific action to be displayed or deleted.
Packit d3f73b
.RE
Packit d3f73b
Packit d3f73b
.TP
Packit d3f73b
.BI cookie " COOKIE"
Packit d3f73b
In addition to the specific action, mark the matching packet with the value
Packit d3f73b
specified by
Packit d3f73b
.IR COOKIE "."
Packit d3f73b
The
Packit d3f73b
.I COOKIE
Packit d3f73b
is a 128-bit value that will not be interpreted by the kernel whatsoever.
Packit d3f73b
As such, it can be used as a correlating value for maintaining user state.
Packit d3f73b
The value to be stored is completely arbitrary and does not require a specific
Packit d3f73b
format. It is stored inside the action structure itself.
Packit d3f73b
Packit d3f73b
.TP
Packit Service 3ca16c
.I FLAGS
Packit Service 3ca16c
Action-specific flags. Currently, the only supported flag is
Packit Service 3ca16c
.I no_percpu
Packit Service 3ca16c
which indicates that action is expected to have minimal software data-path
Packit Service 3ca16c
traffic and doesn't need to allocate stat counters with percpu allocator.
Packit Service 3ca16c
This option is intended to be used by hardware-offloaded actions.
Packit Service 3ca16c
Packit Service 3ca16c
.TP
Packit d3f73b
.BI since " MSTIME"
Packit d3f73b
When dumping large number of actions, a millisecond time-filter can be
Packit d3f73b
specified
Packit d3f73b
.IR MSTIME "."
Packit d3f73b
The
Packit d3f73b
.I MSTIME
Packit d3f73b
is a millisecond count since last time a packet hit the action.
Packit d3f73b
As an example specifying "since 20000" implies to dump all actions
Packit d3f73b
that have seen packets in the last 20 seconds. This option is useful
Packit d3f73b
when the kernel has a large number of actions and you are only interested
Packit d3f73b
in recently used actions.
Packit d3f73b
Packit d3f73b
.TP
Packit d3f73b
.I CONTROL
Packit d3f73b
The
Packit d3f73b
.I CONTROL
Packit d3f73b
indicates how
Packit d3f73b
.B tc
Packit d3f73b
should proceed after executing the action. Any of the following are valid:
Packit d3f73b
.RS
Packit d3f73b
.TP
Packit d3f73b
.B reclassify
Packit d3f73b
Restart the classifiction by jumping back to the first filter attached to
Packit d3f73b
the action's parent.
Packit d3f73b
.TP
Packit d3f73b
.B pipe
Packit d3f73b
Continue with the next action. This is the default control.
Packit d3f73b
.TP
Packit d3f73b
.B drop
Packit d3f73b
Drop the packed without running any further actions.
Packit d3f73b
.TP
Packit d3f73b
.B continue
Packit d3f73b
Continue the classification with the next filter.
Packit d3f73b
.TP
Packit d3f73b
.B pass
Packit d3f73b
Return to the calling qdisc for packet processing, and end classification of
Packit d3f73b
this packet.
Packit d3f73b
.RE
Packit d3f73b
Packit d3f73b
.SH SEE ALSO
Packit d3f73b
.BR tc (8),
Packit d3f73b
.BR tc-bpf (8),
Packit d3f73b
.BR tc-connmark (8),
Packit d3f73b
.BR tc-csum (8),
Packit d3f73b
.BR tc-ife (8),
Packit d3f73b
.BR tc-mirred (8),
Packit d3f73b
.BR tc-nat (8),
Packit d3f73b
.BR tc-pedit (8),
Packit d3f73b
.BR tc-police (8),
Packit d3f73b
.BR tc-simple (8),
Packit d3f73b
.BR tc-skbedit (8),
Packit d3f73b
.BR tc-skbmod (8),
Packit d3f73b
.BR tc-tunnel_key (8),
Packit d3f73b
.BR tc-vlan (8),
Packit d3f73b
.BR tc-xt (8)