{"id":2840,"date":"2022-12-20T15:17:27","date_gmt":"2022-12-20T18:17:27","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/taprio-man8\/"},"modified":"2022-12-20T15:17:27","modified_gmt":"2022-12-20T18:17:27","slug":"taprio-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/taprio-man8\/","title":{"rendered":"TAPRIO (man8)"},"content":{"rendered":"<h1 align=\"center\">TAPRIO<\/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\">TAPRIO \u2212 Time Aware Priority Shaper<\/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>] taprio num_tc<\/b> tcs <b><br \/> map<\/b> P0 P1 P2 &#8230; <b>queues<\/b> count1@offset1 count2@offset2 &#8230; <b><br \/> base-time<\/b> base-time <b>clockid<\/b> clockid <b><br \/> sched-entry<\/b> <command 1> <gate mask 1> <interval 1> <b><br \/> sched-entry<\/b> <command 2> <gate mask 2> <interval 2> <b><br \/> sched-entry<\/b> <command 3> <gate mask 3> <interval 3> <b><br \/> sched-entry<\/b> <command N> <gate mask N> <interval N><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The TAPRIO qdisc implements a simplified version of the scheduling state machine defined by IEEE 802.1Q-2018 Section 8.6.9, which allows configuration of a sequence of gate states, where each gate state allows outgoing traffic for a subset (potentially empty) of traffic classes.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">How traffic is mapped to different hardware queues is similar to <b>mqprio(8)<\/b> and so the <b>map<\/b> and <b>queues<\/b> parameters have the same meaning.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The other parameters specify the schedule, and at what point in time it should start (it can behave as the schedule started in the past).<\/p>\n<h2>PARAMETERS <a name=\"PARAMETERS\"><\/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\">num_tc<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">Number of traffic classes to use. Up to 16 classes supported.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p>map<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>The priority to traffic class map. Maps priorities 0..15 to a specified traffic class. See <b>mqprio(8)<\/b> for more details.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p>queues<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Provide count and offset of queue range for each traffic class. In the format, <b>count@offset.<\/b> Queue ranges for each traffic classes cannot overlap and must be a contiguous range of queues.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\">base-time<\/p>\n<p style=\"margin-left:22%;\">Specifies the instant in nanoseconds, using the reference of <b>clockid,<\/b> defining the time when the schedule starts. If \u2019base-time\u2019 is a time in the past, the schedule will start at<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">base-time + (N bodies manpages.csv script_extrae_body.sh script.sh usr cycle-time)<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">where N is the smallest integer so the resulting time is greater than &#8220;now&#8221;, and &#8220;cycle-time&#8221; is the sum of all the intervals of the entries in the schedule;<\/p>\n<p style=\"margin-left:11%;\">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. This argument must be omitted when using the full-offload feature (flags 0x2), since in that case, the clockid is implicitly \/dev\/ptpN (where N is given by <b>ethtool -T eth0 | grep \u2019PTP Hardware Clock\u2019<\/b> ), and therefore not necessarily synchronized with the system\u2019s CLOCK_TAI.<\/p>\n<p style=\"margin-left:11%;\">sched-entry<\/p>\n<p style=\"margin-left:22%;\">There may multiple <b>sched-entry<\/b> parameters in a single schedule. Each one has the<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">sched-entry <command> <gatemask> <interval><\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">format. The only supported <command> is &#8220;S&#8221;, which means &#8220;SetGateStates&#8221;, following the IEEE 802.1Q-2018 definition (Table 8-7). <gate mask> is a bitmask where each bit is a associated with a traffic class, so bit 0 (the least significant bit) being &#8220;on&#8221; means that traffic class 0 is &#8220;active&#8221; for that schedule entry. <interval> is a time duration, in nanoseconds, that specifies for how long that state defined by <command> and <gate mask> should be held before moving to the next entry.<\/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>flags<\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>This is a bit mask which specifies different modes for taprio.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%;\"><i>0x1<\/i><\/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=\"4%\"><\/td>\n<td width=\"6%\"><\/td>\n<td width=\"68%\">\n<p style=\"margin-top: 1em\">Enables the txtime-assist feature. In this mode, taprio will set the transmit timestamp depending on the interval in which the packet needs to be transmitted. It will then utililize the <b>etf(8)<\/b> qdisc to sort and transmit the packets at the right time. The second example can be used as a reference to configure this mode.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"4%\">\n<p><i>0x2<\/i><\/p>\n<\/td>\n<td width=\"6%\"><\/td>\n<td width=\"68%\">\n<p>Enables the full-offload feature. In this mode, taprio will pass the gate control list to the NIC which will execute it cyclically in hardware. When using full-offload, there is no need to specify the <b>clockid<\/b> argument.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:32%; margin-top: 1em\">The txtime-assist and full-offload features are mutually exclusive, i.e. setting flags to 0x3 is invalid.<\/p>\n<p style=\"margin-left:11%;\">txtime-delay<\/p>\n<p style=\"margin-left:22%;\">This parameter is specific to the txtime offload mode. It specifies the maximum time a packet might take to reach the network card from the taprio qdisc. The value should always be greater than the delta specified in the <b>etf(8)<\/b> qdisc.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following example shows how an traffic schedule with three traffic classes (&#8220;num_tc 3&#8221;), which are separated different traffic classes, we are going to call these TC 0, TC 1 and TC 2. We could read the &#8220;map&#8221; parameter below as: traffic with priority 3 is classified as TC 0, priority 2 is classified as TC 1 and the rest is classified as TC 2.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The schedule will start at instant 1528743495910289987 using the reference CLOCK_TAI. The schedule is composed of three entries each of 300us duration.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"># tc qdisc replace dev eth0 parent root handle 100 taprio  <br \/> num_tc 3  <br \/> map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2  <br \/> queues 1@0 1@1 2@2  <br \/> base-time 1528743495910289987  <br \/> sched-entry S 01 300000  <br \/> sched-entry S 02 300000  <br \/> sched-entry S 04 300000  <br \/> clockid CLOCK_TAI<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Following is an example to enable the txtime offload mode in taprio. See <b>etf(8)<\/b> for more information about configuring the ETF qdisc.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"># tc qdisc replace dev eth0 parent root handle 100 taprio  <br \/> num_tc 3  <br \/> map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2  <br \/> queues 1@0 1@0 1@0  <br \/> base-time 1528743495910289987  <br \/> sched-entry S 01 300000  <br \/> sched-entry S 02 300000  <br \/> sched-entry S 04 400000  <br \/> flags 0x1  <br \/> txtime-delay 200000  <br \/> clockid CLOCK_TAI<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"># tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check  <br \/> offload delta 200000 clockid CLOCK_TAI<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The following is a schedule in full offload mode. The <b>base-time<\/b> is 200 ns and the <b>cycle-time<\/b> is implicitly calculated as the sum of all <b>sched-entry<\/b> durations (i.e. 20 us + 20 us + 60 us = 100 us). Although the base-time is in the past, the hardware will start executing the schedule at a PTP time equal to the smallest integer multiple of 100 us, plus 200 ns, that is larger than the NIC\u2019s current PTP time.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"># tc qdisc add dev eth0 parent root taprio  <br \/> num_tc 8  <br \/> map 0 1 2 3 4 5 6 7  <br \/> queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7  <br \/> base-time 200  <br \/> sched-entry S 80 20000  <br \/> sched-entry S a0 20000  <br \/> sched-entry S df 60000  <br \/> flags 0x2<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Vinicius Costa Gomes <vinicius.gomes@intel.com><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  TAPRIO \u2212 Time Aware Priority Shaper <\/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,190],"class_list":["post-2840","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tc-taprio"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2840","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=2840"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2840\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=2840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=2840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=2840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}