# man > tc-actions(8)

_actions_ _in_ [_tc_(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown)                                Linux                               _actions_ _in_ [_tc_(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown)

## NAME
       actions - independently defined actions in tc

## SYNOPSIS
       **tc **[ _TC_OPTIONS_ ] **actions add **| **change **| **replace _**ACTSPEC_

       **tc **[ _TC_OPTIONS_ ] **actions get **| **delete _**ACTISPEC_

       **tc **[ _TC_OPTIONS_ ] **actions flush _**ACTNAMESPEC_

       **tc **[ _TC_OPTIONS_ ] **actions ls **| **list _**ACTNAMESPEC_ [ _ACTFILTER_ ]

               _ACTSPEC_  := **action _**ACTDETAIL_ [ _INDEXSPEC_ ] [ _COOKIESPEC_ ] [ _FLAGS_ ] [ _HWSTATSSPEC_ ] [
               _CONTROL_ ] [ _SKIPSPEC_ ]

               _ACTISPEC_ := _ACTNAMESPEC_ _INDEXSPEC_

               _ACTNAMESPEC_ := **action **ACTNAME

               _INDEXSPEC_ := **index _**INDEX_

               _ACTFILTER_ := **since _**MSTIME_

               _COOKIESPEC_ := **cookie _**COOKIE_

               _FLAGS_ := _no_percpu_

               _HWSTATSSPEC_ := **hw_stats **{ _immediate_ | _delayed_ | _disabled_ }

               _ACTDETAIL_ := _ACTNAME_ _ACTPARAMS_

               _ACTNAME_ may be any valid action type: gact, mirred, bpf, connmark, csum, police, etc.

               _MSTIME_ Time since last update.

               _CONTROL_ := { _reclassify_ | _pipe_ | _drop_ | _continue_ | _ok_ }

               _SKIPSPEC_ := { _skip_sw_ | _skip_hw_ }

               _TC_OPTIONS_ These are the options that are specific to **tc **and not  only  the  options.
               Refer to [**tc(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown) **for more information.


## DESCRIPTION
       The  **actions **object in **tc **allows a user to define actions independently of a classifier (fil‐
       ter). 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.

       Each action type (mirred, police, etc.) will have its own table to store all created actions.


## OPERATIONS
       **add    **Create a new action in that action's table.


### change
### replace
              Make modifications to an existing action.

       **get    **Display  the  action  with the specified index value. When combined with the **-s **option
              for **tc**, display the statistics for that action.

       **delete **Delete the action with the specified index value. If the action is already  associated
              with a classifier, it does not delete the classifier.

       **ls**
       **list   **List  all the actions in the specified table. When combined with the **-s **option for **tc**,
              display the statistics for all actions in the specified table.  When combined with the
              option **since **allows doing a millisecond time-filter since the last time an action  was
              used in the datapath.

       **flush  **Delete all actions stored in the specified table.


## ACTION OPTIONS
       Note that these options are available to all action types.

       **index _**INDEX_
              Specify the table index value of an action.  _INDEX_ is a 32-bit value that is unique to
              the specific type of action referenced.

              For **add**, **change**, and **replace **operations, the index is **optional.  **When adding a new ac‐
              tion, 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.

              For **get **and **delete **operations, the index is **required **to identify the  specific  action
              to be displayed or deleted.


       **cookie _**COOKIE_
              In  addition to the specific action, mark the matching packet with the value specified
              by _COOKIE_.  The _COOKIE_ 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.


       _FLAGS_  Action-specific flags. Currently, the only supported flag is _no_percpu_ 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.


       **hw_stats _**HW_STATS_
              Specifies  the  type  of HW stats of new action. If omitted, any stats counter type is
              going to be used, according to driver and its resources.  The _HW_STATS_  indicates  the
              type. Any of the following are valid:

              **immediate**
                     Means  that  in  dump,  user  gets  the  current HW stats state from the device
                     queried at the dump time.

              **delayed**
                     Means that in dump, user gets HW stats that might be out of date for some time,
                     maybe couple of seconds. This is the case when driver polls stats updates peri‐
                     odically or when it gets async stats update from the device.

              **disabled**
                     No HW stats are going to be available in dump.


       **since _**MSTIME_
              When dumping large number of actions,  a  millisecond  time-filter  can  be  specified
              _MSTIME_.   The  _MSTIME_  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 num‐
              ber of actions and you are only interested in recently used actions.


       _CONTROL_
              The  _CONTROL_  indicates  how  **tc **should proceed after executing the action. Any of the
              following are valid:

              **reclassify**
                     Restart the classifiction by jumping back to the first filter attached  to  the
                     action's parent.

              **pipe   **Continue with the next action. This is the default control.

              **drop   **Drop the packed without running any further actions.

              **continue**
                     Continue the classification with the next filter.

              **pass   **Return  to  the  calling qdisc for packet processing, and end classification of
                     this packet.


       _SKIPSPEC_
              The _SKIPSPEC_ indicates how **tc **should proceed when executing the  action.  Any  of  the
              following are valid:

              **skip_sw**
                     Do  not process action by software. If hardware has no offload support for this
                     action, operation will fail.

              **skip_hw**
                     Do not process action by hardware.


## SEE ALSO
       [**tc**(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown),  [**tc-bpf**(8)](https://www.chedong.com/phpMan.php/man/tc-bpf/8/markdown),  [**tc-connmark**(8)](https://www.chedong.com/phpMan.php/man/tc-connmark/8/markdown),  [**tc-csum**(8)](https://www.chedong.com/phpMan.php/man/tc-csum/8/markdown),  [**tc-ife**(8)](https://www.chedong.com/phpMan.php/man/tc-ife/8/markdown),  [**tc-mirred**(8)](https://www.chedong.com/phpMan.php/man/tc-mirred/8/markdown),  [**tc-nat**(8)](https://www.chedong.com/phpMan.php/man/tc-nat/8/markdown),   **tc-**
       [**pedit**(8)](https://www.chedong.com/phpMan.php/man/pedit/8/markdown),  [**tc-police**(8)](https://www.chedong.com/phpMan.php/man/tc-police/8/markdown),  [**tc-simple**(8)](https://www.chedong.com/phpMan.php/man/tc-simple/8/markdown),  [**tc-skbedit**(8)](https://www.chedong.com/phpMan.php/man/tc-skbedit/8/markdown),  [**tc-skbmod**(8)](https://www.chedong.com/phpMan.php/man/tc-skbmod/8/markdown),  [**tc-tunnel_key**(8)](https://www.chedong.com/phpMan.php/man/tc-tunnelkey/8/markdown), **tc-**
       [**vlan**(8)](https://www.chedong.com/phpMan.php/man/vlan/8/markdown), [**tc-xt**(8)](https://www.chedong.com/phpMan.php/man/tc-xt/8/markdown)

iproute2                                     1 Aug 2017                             _actions_ _in_ [_tc_(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown)
