{"id":3327,"date":"2022-12-20T17:02:21","date_gmt":"2022-12-20T20:02:21","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/actions-in-tc-man8\/"},"modified":"2022-12-20T17:02:21","modified_gmt":"2022-12-20T20:02:21","slug":"actions-in-tc-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/actions-in-tc-man8\/","title":{"rendered":"actions in tc (man8)"},"content":{"rendered":"<h1 align=\"center\">actions in tc<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPERATIONS\">OPERATIONS<\/a><br \/> <a href=\"#ACTION OPTIONS\">ACTION OPTIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">actions \u2212 independently defined actions in tc<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc<\/b> [ <i>TC_OPTIONS<\/i> ] <b>actions add<\/b> | <b>change<\/b> | <b>replace<\/b> <i>ACTSPEC<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc<\/b> [ <i>TC_OPTIONS<\/i> ] <b>actions get<\/b> | <b>delete<\/b> <i>ACTISPEC<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc<\/b> [ <i>TC_OPTIONS<\/i> ] <b>actions flush<\/b> <i>ACTNAMESPEC<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc<\/b> [ <i>TC_OPTIONS<\/i> ] <b>actions ls<\/b> | <b>list<\/b> <i>ACTNAMESPEC<\/i> [ <i>ACTFILTER<\/i> ]<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>ACTSPEC<\/i> := <b>action<\/b> <i>ACTDETAIL<\/i> [ <i>INDEXSPEC<\/i> ] [ <i>COOKIESPEC<\/i> ] [ <i>FLAGS<\/i> ] [ <i>HWSTATSSPEC<\/i> ] [ <i>CONTROL<\/i> ]<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>ACTISPEC<\/i> := <i>ACTNAMESPEC INDEXSPEC<\/i><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>ACTNAMESPEC<\/i> := <b>action<\/b> ACTNAME<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>INDEXSPEC<\/i> := <b>index<\/b> <i>INDEX<\/i><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>ACTFILTER<\/i> := <b>since<\/b> <i>MSTIME<\/i><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>COOKIESPEC<\/i> := <b>cookie<\/b> <i>COOKIE<\/i><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>FLAGS<\/i> := <i>no_percpu<\/i><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>HWSTATSSPEC<\/i> := <b>hw_stats<\/b> { <i>immediate<\/i> | <i>delayed<\/i> | <i>disabled<\/i> }<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>ACTDETAIL<\/i> := <i>ACTNAME ACTPARAMS<\/i><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>ACTNAME<\/i> may be any valid action type: gact, mirred, bpf, connmark, csum, police, etc.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>MSTIME<\/i> Time since last update.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>CONTROL<\/i> := { <i>reclassify<\/i> | <i>pipe<\/i> | <i>drop<\/i> | <i>continue<\/i> | <i>ok<\/i> }<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>TC_OPTIONS<\/i> These are the options that are specific to <b>tc<\/b> and not only the options. Refer to <b>tc(8)<\/b> for more information.<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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\u2019s criteria having that action performed on them.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Each action type (mirred, police, etc.) will have its own table to store all created actions.<\/p>\n<h2>OPERATIONS <a name=\"OPERATIONS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>add<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"66%\">\n<p style=\"margin-top: 1em\">Create a new action in that action\u2019s table.<\/p>\n<\/td>\n<td width=\"12%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>change<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"66%\"><\/td>\n<td width=\"12%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>replace<\/b><\/p>\n<p style=\"margin-left:22%;\">Make modifications to an existing action.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>get<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>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.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>delete<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Delete the action with the specified index value. If the action is already associated with a classifier, it does not delete the classifier.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>ls<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>list<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>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.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>flush<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Delete all actions stored in the specified table.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>ACTION OPTIONS <a name=\"ACTION OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that these options are available to all action types. <b><br \/> index<\/b> <i>INDEX<\/i><\/p>\n<p style=\"margin-left:22%;\">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>\n<p style=\"margin-left:22%; margin-top: 1em\">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.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">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.<\/p>\n<p style=\"margin-left:11%;\"><b>cookie<\/b> <i>COOKIE<\/i><\/p>\n<p style=\"margin-left:22%;\">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>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><i>FLAGS<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>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\u2019t need to allocate stat counters with percpu allocator. This option is intended to be used by hardware-offloaded actions.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>hw_stats<\/b> <i>HW_STATS<\/i><\/p>\n<p style=\"margin-left:22%;\">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 <i>HW_STATS<\/i> indicates the type. Any of the following are valid: <b><br \/> immediate<\/b><\/p>\n<p style=\"margin-left:32%;\">Means that in dump, user gets the current HW stats state from the device queried at the dump time.<\/p>\n<p style=\"margin-left:22%;\"><b>delayed<\/b><\/p>\n<p style=\"margin-left:32%;\">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 periodically or when it gets async stats update from the device.<\/p>\n<p style=\"margin-left:22%;\"><b>disabled<\/b><\/p>\n<p style=\"margin-left:32%;\">No HW stats are going to be available in dump.<\/p>\n<p style=\"margin-left:11%;\"><b>since<\/b> <i>MSTIME<\/i><\/p>\n<p style=\"margin-left:22%;\">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 &#8220;since 20000&#8221; 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>\n<p style=\"margin-left:11%;\"><i>CONTROL<\/i><\/p>\n<p style=\"margin-left:22%;\">The <i>CONTROL<\/i> indicates how <b>tc<\/b> should proceed after executing the action. Any of the following are valid: <b><br \/> reclassify<\/b><\/p>\n<p style=\"margin-left:32%;\">Restart the classifiction by jumping back to the first filter attached to the action\u2019s parent.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"6%\">\n<p><b>pipe<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"68%\">\n<p>Continue with the next action. This is the default control.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"6%\">\n<p><b>drop<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"68%\">\n<p>Drop the packed without running any further actions.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%;\"><b>continue<\/b><\/p>\n<p style=\"margin-left:32%;\">Continue the classification with the next filter.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"6%\">\n<p><b>pass<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"68%\">\n<p>Return to the calling qdisc for packet processing, and end classification of this packet.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc<\/b>(8), <b>tc-bpf<\/b>(8), <b>tc-connmark<\/b>(8), <b>tc-csum<\/b>(8), <b>tc-ife<\/b>(8), <b>tc-mirred<\/b>(8), <b>tc-nat<\/b>(8), <b>tc-pedit<\/b>(8), <b>tc-police<\/b>(8), <b>tc-simple<\/b>(8), <b>tc-skbedit<\/b>(8), <b>tc-skbmod<\/b>(8), <b>tc-tunnel_key<\/b>(8), <b>tc-vlan<\/b>(8), <b>tc-xt<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  actions \u2212 independently defined actions in tc <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,457],"class_list":["post-3327","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tc-actions"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3327"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3327\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}