{"id":3303,"date":"2022-12-20T17:02:17","date_gmt":"2022-12-20T20:02:17","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/etf-man8\/"},"modified":"2022-12-20T17:02:17","modified_gmt":"2022-12-20T20:02:17","slug":"etf-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/etf-man8\/","title":{"rendered":"ETF (man8)"},"content":{"rendered":"<h1 align=\"center\">ETF<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#PARAMETERS\">PARAMETERS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">ETF \u2212 Earliest TxTime First (ETF) Qdisc<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc qdisc &#8230; dev<\/b> dev <b>parent<\/b> classid <b>[ handle<\/b> major: <b>] etf clockid<\/b> clockid <b>[ delta<\/b> delta_nsecs <b>] [ deadline_mode ] [ offload ]<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The ETF (Earliest TxTime First) qdisc allows applications to control the instant when a packet should be dequeued from the traffic control layer into the netdevice. If <b>offload<\/b> is configured and supported by the network interface card, the it will also control when packets leave the network controller.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">ETF achieves that by buffering packets until a configurable time before their transmission time (i.e. txtime, or deadline), which can be configured through the <b>delta<\/b> option.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The qdisc uses a rb-tree internally so packets are always \u2019ordered\u2019 by their txtime and will be dequeued following the (next) earliest txtime first.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">It relies on the SO_TXTIME socket option and the SCM_TXTIME CMSG in each packet field to configure the behavior of time dependent sockets: the clockid to be used as a reference, if the expected mode of txtime for that socket is deadline or strict mode, and if packet drops should be reported on the socket\u2019s error queue. See <b>socket(7)<\/b> for more information.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The etf qdisc will drop any packets with a txtime in the past, or if a packet expires while waiting for being dequeued.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This queueing discipline is intended to be used by TSN (Time Sensitive Networking) applications, and it exposes a traffic shaping functionality that is commonly documented as &#8220;Launch Time&#8221; or &#8220;Time-Based Scheduling&#8221; by vendors and the documentation of network interface controllers.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">ETF is meant to be installed under another qdisc that maps packet flows to traffic classes, one example is <b>mqprio(8).<\/b><\/p>\n<h2>PARAMETERS <a name=\"PARAMETERS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">clockid<\/p>\n<p style=\"margin-left:22%;\">Specifies the clock to be used by qdisc\u2019s internal timer for measuring time and scheduling events. The qdisc expects that packets passing through it to be using this same <b>clockid<\/b> as the reference of their txtime timestamps. It will drop packets coming from sockets that do not comply with that.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">For more information about time and clocks on Linux, please refer to <b>time(7)<\/b> and <b>clock_gettime(3).<\/b><\/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>delta<\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>After enqueueing or dequeueing a packet, the qdisc will schedule its next wake-up time for the next txtime minus this delta value. This means <b>delta<\/b> can be used as a fudge factor for the scheduler latency of a system. This value must be specified in nanoseconds. The default value is 0 nanoseconds.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\">deadline_mode<\/p>\n<p style=\"margin-left:22%;\">When <b>deadline_mode<\/b> is set, the qdisc will handle txtime with a different semantics, changed from a \u2019strict\u2019 transmission time to a deadline. In practice, this means during the dequeue flow <b>etf(8)<\/b> will set the txtime of the packet being dequeued to \u2019now\u2019. The default is for this option to be disabled.<\/p>\n<p style=\"margin-left:11%;\">offload<\/p>\n<p style=\"margin-left:22%;\">When <b>offload<\/b> is set, <b>etf(8)<\/b> will try to configure the network interface so time-based transmission arbitration is enabled in the controller. This feature is commonly referred to as &#8220;Launch Time&#8221; or &#8220;Time-Based Scheduling&#8221; by the documentation of network interface controllers. The default is for this option to be disabled.<\/p>\n<p style=\"margin-left:11%;\">skip_sock_check<\/p>\n<p style=\"margin-left:22%;\"><b>etf(8)<\/b> currently drops any packet which does not have a socket associated with it or if the socket does not have SO_TXTIME socket option set. But, this will not work if the launchtime is set by another entity inside the kernel (e.g. some other Qdisc). Setting the skip_sock_check will skip checking for a socket associated with the packet.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">ETF is used to enforce a Quality of Service. It controls when each packets should be dequeued and transmitted, and can be used for limiting the data rate of a traffic class. To separate packets into traffic classes the user may choose <b>mqprio(8),<\/b> and configure it like this:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"># tc qdisc add dev eth0 handle 100: parent root mqprio num_tc 3 <\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\">\n<p>map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 <\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\">\n<p>queues 1@0 1@1 2@2 <\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\">\n<p>hw 0<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">To replace the current queueing discipline by ETF in traffic class number 0, issue:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"># tc qdisc replace dev eth0 parent 100:1 etf <\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"92%\">\n<p>clockid CLOCK_TAI delta 300000 offload<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">With the options above, etf will be configured to use CLOCK_TAI as its clockid_t, will schedule packets for 300 us before their txtime, and will enable the functionality on that in the network interface card. Deadline mode will not be configured for this mode.<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> <br \/> Vinicius Costa Gomes <vinicius.gomes@intel.com><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  ETF \u2212 Earliest TxTime First (ETF) Qdisc <\/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,435],"class_list":["post-3303","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tc-etf"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3303","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=3303"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3303\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}