407 lines
7.4 KiB
HTML
407 lines
7.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of actions in tc</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>actions in tc</H1>
|
|
Section: Linux (8)<BR>Updated: 1 Aug 2017<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<P>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
actions - independently defined actions in tc
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>tc</B>
|
|
|
|
[
|
|
<I>TC_OPTIONS</I>
|
|
|
|
]
|
|
<B>actions</B>
|
|
|
|
<B>add</B> | <B>change</B> | <B>replace</B>
|
|
|
|
<I>ACTSPEC</I>
|
|
|
|
<P>
|
|
<B>tc</B>
|
|
|
|
[
|
|
<I>TC_OPTIONS</I>
|
|
|
|
]
|
|
<B>actions</B>
|
|
|
|
<B>get</B> | <B>delete</B>
|
|
|
|
<I>ACTISPEC</I>
|
|
|
|
<P>
|
|
<B>tc</B>
|
|
|
|
[
|
|
<I>TC_OPTIONS</I>
|
|
|
|
]
|
|
<B>actions flush</B>
|
|
|
|
<I>ACTNAMESPEC</I>
|
|
|
|
<P>
|
|
<B>tc</B>
|
|
|
|
[
|
|
<I>TC_OPTIONS</I>
|
|
|
|
]
|
|
<B>actions</B>
|
|
|
|
<B>ls</B> | <B>list</B>
|
|
|
|
<I>ACTNAMESPEC</I>
|
|
|
|
[
|
|
<I>ACTFILTER</I>
|
|
|
|
]
|
|
<P>
|
|
|
|
<I>ACTSPEC</I>
|
|
|
|
:=
|
|
<B>action</B>
|
|
|
|
<I>ACTDETAIL</I>
|
|
|
|
[
|
|
<I>INDEXSPEC</I>
|
|
|
|
] [
|
|
<I>COOKIESPEC</I>
|
|
|
|
] [
|
|
<I>FLAGS</I>
|
|
|
|
] [
|
|
<I>CONTROL</I>
|
|
|
|
]
|
|
<P>
|
|
<I>ACTISPEC</I>
|
|
|
|
:=
|
|
<I>ACTNAMESPEC INDEXSPEC</I>
|
|
|
|
<P>
|
|
<I>ACTNAMESPEC</I>
|
|
|
|
:=
|
|
<B>action</B>
|
|
|
|
ACTNAME
|
|
<P>
|
|
<I>INDEXSPEC</I>
|
|
|
|
:=
|
|
<B>index</B><I> INDEX</I>
|
|
|
|
<P>
|
|
<I>ACTFILTER</I>
|
|
|
|
:=
|
|
<B>since</B><I> MSTIME</I>
|
|
|
|
<P>
|
|
<I>COOKIESPEC</I>
|
|
|
|
:=
|
|
<B>cookie</B><I> COOKIE</I>
|
|
|
|
<P>
|
|
<I>FLAGS</I>
|
|
|
|
:=
|
|
<I>no_percpu</I>
|
|
|
|
<P>
|
|
<I>ACTDETAIL</I>
|
|
|
|
:=
|
|
<I>ACTNAME ACTPARAMS</I>
|
|
|
|
<P>
|
|
<I>ACTNAME</I>
|
|
|
|
may be any valid action type: gact, mirred, bpf, connmark, csum, police, etc.
|
|
<P>
|
|
<I>MSTIME</I>
|
|
|
|
Time since last update.
|
|
<P>
|
|
<I>CONTROL</I>
|
|
|
|
:= {
|
|
<I>reclassify</I> | <I>pipe</I> | <I>drop</I> | <I>continue</I> | <I>ok</I>
|
|
|
|
}
|
|
<P>
|
|
<I>TC_OPTIONS</I>
|
|
|
|
These are the options that are specific to
|
|
<B>tc</B>
|
|
|
|
and not only the options. Refer to
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A>(8)</B>
|
|
|
|
for more information.
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
The
|
|
<B>actions</B>
|
|
|
|
object in
|
|
<B>tc</B>
|
|
|
|
allows a user to define actions independently of a classifier (filter). These
|
|
actions can then be assigned to one or more filters, with any
|
|
packets matching the classifier's criteria having that action performed
|
|
on them.
|
|
<P>
|
|
Each action type (mirred, police, etc.) will have its own table to store
|
|
all created actions.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPERATIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>add</B>
|
|
|
|
<DD>
|
|
Create a new action in that action's table.
|
|
<P>
|
|
<DT id="2"><B>change</B>
|
|
|
|
<DD>
|
|
|
|
<B>replace</B>
|
|
|
|
Make modifications to an existing action.
|
|
<DT id="3"><B>get</B>
|
|
|
|
<DD>
|
|
Display the action with the specified index value. When combined with the
|
|
<B>-s</B>
|
|
|
|
option for
|
|
<B>tc</B>,
|
|
|
|
display the statistics for that action.
|
|
<DT id="4"><B>delete</B>
|
|
|
|
<DD>
|
|
Delete the action with the specified index value. If the action is already
|
|
associated with a classifier, it does not delete the classifier.
|
|
<DT id="5"><B>ls</B>
|
|
|
|
<DD>
|
|
|
|
<B>list</B>
|
|
|
|
List all the actions in the specified table. When combined with the
|
|
<B>-s</B>
|
|
|
|
option for
|
|
<B>tc</B>,
|
|
|
|
display the statistics for all actions in the specified table.
|
|
When combined with the option
|
|
<B>since</B>
|
|
|
|
allows doing a millisecond time-filter since the last time an
|
|
action was used in the datapath.
|
|
<DT id="6"><B>flush</B>
|
|
|
|
<DD>
|
|
Delete all actions stored in the specified table.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ACTION OPTIONS</H2>
|
|
|
|
Note that these options are available to all action types.
|
|
<DL COMPACT>
|
|
<DT id="7"><B>index</B><I> INDEX</I>
|
|
|
|
<DD>
|
|
Specify the table index value of an action.
|
|
<I>INDEX</I>
|
|
|
|
is a 32-bit value that is unique to the specific type of action referenced.
|
|
<P>
|
|
<DL COMPACT><DT id="8"><DD>
|
|
For
|
|
<B>add</B>, <B>change</B>, and
|
|
|
|
<B>replace</B>
|
|
|
|
operations, the index is
|
|
<B>optional.</B>
|
|
|
|
When adding a new action,
|
|
specifying an index value will assign the action to that index unless that
|
|
index value has already been assigned. Omitting the index value for an add
|
|
operation will cause the kernel to assign a value to the new action.
|
|
</DL>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="9"><DD>
|
|
For
|
|
<B>get</B> and <B>delete</B>
|
|
|
|
operations, the index is
|
|
<B>required</B>
|
|
|
|
to identify the specific action to be displayed or deleted.
|
|
</DL>
|
|
|
|
<P>
|
|
<DT id="10"><B>cookie</B><I> COOKIE</I>
|
|
|
|
<DD>
|
|
In addition to the specific action, mark the matching packet with the value
|
|
specified by
|
|
<I>COOKIE</I>.
|
|
|
|
The
|
|
<I>COOKIE</I>
|
|
|
|
is a 128-bit value that will not be interpreted by the kernel whatsoever.
|
|
As such, it can be used as a correlating value for maintaining user state.
|
|
The value to be stored is completely arbitrary and does not require a specific
|
|
format. It is stored inside the action structure itself.
|
|
<P>
|
|
<DT id="11"><I>FLAGS</I>
|
|
|
|
<DD>
|
|
Action-specific flags. Currently, the only supported flag is
|
|
<I>no_percpu</I>
|
|
|
|
which indicates that action is expected to have minimal software data-path
|
|
traffic and doesn't need to allocate stat counters with percpu allocator.
|
|
This option is intended to be used by hardware-offloaded actions.
|
|
<P>
|
|
<DT id="12"><B>since</B><I> MSTIME</I>
|
|
|
|
<DD>
|
|
When dumping large number of actions, a millisecond time-filter can be
|
|
specified
|
|
<I>MSTIME</I>.
|
|
|
|
The
|
|
<I>MSTIME</I>
|
|
|
|
is a millisecond count since last time a packet hit the action.
|
|
As an example specifying "since 20000" implies to dump all actions
|
|
that have seen packets in the last 20 seconds. This option is useful
|
|
when the kernel has a large number of actions and you are only interested
|
|
in recently used actions.
|
|
<P>
|
|
<DT id="13"><I>CONTROL</I>
|
|
|
|
<DD>
|
|
The
|
|
<I>CONTROL</I>
|
|
|
|
indicates how
|
|
<B>tc</B>
|
|
|
|
should proceed after executing the action. Any of the following are valid:
|
|
<DL COMPACT><DT id="14"><DD>
|
|
<DL COMPACT>
|
|
<DT id="15"><B>reclassify</B>
|
|
|
|
<DD>
|
|
Restart the classifiction by jumping back to the first filter attached to
|
|
the action's parent.
|
|
<DT id="16"><B>pipe</B>
|
|
|
|
<DD>
|
|
Continue with the next action. This is the default control.
|
|
<DT id="17"><B>drop</B>
|
|
|
|
<DD>
|
|
Drop the packed without running any further actions.
|
|
<DT id="18"><B>continue</B>
|
|
|
|
<DD>
|
|
Continue the classification with the next filter.
|
|
<DT id="19"><B>pass</B>
|
|
|
|
<DD>
|
|
Return to the calling qdisc for packet processing, and end classification of
|
|
this packet.
|
|
</DL>
|
|
</DL>
|
|
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-bpf">tc-bpf</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-connmark">tc-connmark</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-csum">tc-csum</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-ife">tc-ife</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-mirred">tc-mirred</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-nat">tc-nat</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-pedit">tc-pedit</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-police">tc-police</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-simple">tc-simple</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-skbedit">tc-skbedit</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-skbmod">tc-skbmod</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-tunnel_key">tc-tunnel_key</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-vlan">tc-vlan</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-xt">tc-xt</A></B>(8)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="20"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="21"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="22"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="23"><A HREF="#lbAE">OPERATIONS</A><DD>
|
|
<DT id="24"><A HREF="#lbAF">ACTION OPTIONS</A><DD>
|
|
<DT id="25"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:17 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|