Blame man/man8/tc-actions.8

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