{"id":3153,"date":"2022-12-20T16:43:38","date_gmt":"2022-12-20T19:43:38","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/mqprio-man8\/"},"modified":"2022-12-20T16:43:38","modified_gmt":"2022-12-20T19:43:38","slug":"mqprio-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/mqprio-man8\/","title":{"rendered":"MQPRIO (man8)"},"content":{"rendered":"<h1 align=\"center\">MQPRIO<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#ALGORITHM\">ALGORITHM<\/a><br \/> <a href=\"#CLASSIFICATION\">CLASSIFICATION<\/a><br \/> <a href=\"#QDISC PARAMETERS\">QDISC PARAMETERS<\/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\">MQPRIO \u2212 Multiqueue Priority Qdisc (Offloaded Hardware QOS)<\/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>| root) [ handle<\/b> major: <b>] mqprio [ num_tc<\/b> tcs <b>] [ map<\/b> P0 P1 P2&#8230; <b>] [ queues<\/b> count1@offset1 count2@offset2 &#8230; <b>] [ hw<\/b> 1|0 <b>] [ mode<\/b> dcb|channel] <b>] [ shaper<\/b> dcb| <b>[ bw_rlimit min_rate<\/b> min_rate1 min_rate2 &#8230; <b>max_rate<\/b> max_rate1 max_rate2 &#8230; <b>]]<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The MQPRIO qdisc is a simple queuing discipline that allows mapping traffic flows to hardware queue ranges using priorities and a configurable priority to traffic class mapping. A traffic class in this context is a set of contiguous qdisc classes which map 1:1 to a set of hardware exposed queues.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">By default the qdisc allocates a pfifo qdisc (packet limited first in, first out queue) per TX queue exposed by the lower layer device. Other queuing disciplines may be added subsequently. Packets are enqueued using the <b>map<\/b> parameter and hashed across the indicated queues in the <b>offset<\/b> and <b>count.<\/b> By default these parameters are configured by the hardware driver to match the hardware QOS structures.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Channel<\/b> mode supports full offload of the mqprio options, the traffic classes, the queue configurations and QOS attributes to the hardware. Enabled hardware can provide hardware QOS with the ability to steer traffic flows to designated traffic classes provided by this qdisc. Hardware based QOS is configured using the <b>shaper<\/b> parameter. <b>bw_rlimit<\/b> with minimum and maximum bandwidth rates can be used for setting transmission rates on each traffic class. Also further qdiscs may be added to the classes of MQPRIO to create more complex configurations.<\/p>\n<h2>ALGORITHM <a name=\"ALGORITHM\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">On creation with \u2019tc qdisc add\u2019, eight traffic classes are created mapping priorities 0..7 to traffic classes 0..7 and priorities greater than 7 to traffic class 0. This requires base driver support and the creation will fail on devices that do not support hardware QOS schemes.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">These defaults can be overridden using the qdisc parameters. Providing the \u2019hw 0\u2019 flag allows software to run without hardware coordination.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If hardware coordination is being used and arguments are provided that the hardware can not support then an error is returned. For many users hardware defaults should work reasonably well.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">As one specific example numerous Ethernet cards support the 802.1Q link strict priority transmission selection algorithm (TSA). MQPRIO enabled hardware in conjunction with the classification methods below can provide hardware offloaded support for this TSA.<\/p>\n<h2>CLASSIFICATION <a name=\"CLASSIFICATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Multiple methods are available to set the SKB priority which MQPRIO uses to select which traffic class to enqueue the packet. <br \/> From user space<\/p>\n<p style=\"margin-left:22%;\">A process with sufficient privileges can encode the destination class directly with SO_PRIORITY, see <b>socket(7).<\/b><\/p>\n<p style=\"margin-left:11%;\">with iptables\/nftables<\/p>\n<p style=\"margin-left:22%;\">An iptables\/nftables rule can be created to match traffic flows and set the priority. <b>iptables(8)<\/b><\/p>\n<p style=\"margin-left:11%;\">with net_prio cgroups<\/p>\n<p style=\"margin-left:22%;\">The net_prio cgroup can be used to set the priority of all sockets belong to an application. See kernel and cgroup documentation for details.<\/p>\n<h2>QDISC PARAMETERS <a name=\"QDISC 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.<\/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<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p>hw<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Set to <b>1<\/b> to support hardware offload. Set to <b>0<\/b> to configure user specified values in software only.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p>mode<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Set to <b>channel<\/b> for full use of the mqprio options. Use <b>dcb<\/b> to offload only TC values and use hardware QOS defaults. Supported with \u2019hw\u2019 set to 1 only.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p>shaper<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Use <b>bw_rlimit<\/b> to set bandwidth rate limits for a traffic class. Use <b>dcb<\/b> for hardware QOS defaults. Supported with \u2019hw\u2019 set to 1 only.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\">min_rate<\/p>\n<p style=\"margin-left:22%;\">Minimum value of bandwidth rate limit for a traffic class.<\/p>\n<p style=\"margin-left:11%;\">max_rate<\/p>\n<p style=\"margin-left:22%;\">Maximum value of bandwidth rate limit for a traffic class.<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">John Fastabend, <john.r.fastabend@intel.com><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  MQPRIO \u2212 Multiqueue Priority Qdisc (Offloaded Hardware QOS) <\/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,297],"class_list":["post-3153","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tc-mqprio"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3153","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=3153"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3153\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}