€•W6Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ)/translations/zh_CN/networking/multiqueue”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/zh_TW/networking/multiqueue”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/networking/multiqueue”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/networking/multiqueue”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/networking/multiqueue”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/sp_SP/networking/multiqueue”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒC/var/lib/git/docbuild/linux/Documentation/networking/multiqueue.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ+HOWTO for multiqueue network device support”h]”hŒ+HOWTO for multiqueue network device support”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒGSection 1: Base driver requirements for implementing multiqueue support”h]”hŒGSection 1: Base driver requirements for implementing multiqueue support”…””}”(hhÌhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÉhžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒ,Intro: Kernel support for multiqueue devices”h]”hŒ,Intro: Kernel support for multiqueue devices”…””}”(hhÝhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÚhžhhŸh³h K ubhŒ paragraph”“”)”}”(hŒ8Kernel support for multiqueue devices is always present.”h]”hŒ8Kernel support for multiqueue devices is always present.”…””}”(hhíhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h K hhÚhžhubhì)”}”(hX/Base drivers are required to use the new alloc_etherdev_mq() or alloc_netdev_mq() functions to allocate the subqueues for the device. The underlying kernel API will take care of the allocation and deallocation of the subqueue memory, as well as netdev configuration of where the queues exist in memory.”h]”hX/Base drivers are required to use the new alloc_etherdev_mq() or alloc_netdev_mq() functions to allocate the subqueues for the device. The underlying kernel API will take care of the allocation and deallocation of the subqueue memory, as well as netdev configuration of where the queues exist in memory.”…””}”(hhûhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h KhhÚhžhubhì)”}”(hXqThe base driver will also need to manage the queues as it does the global netdev->queue_lock today. Therefore base drivers should use the netif_{start|stop|wake}_subqueue() functions to manage each queue while the device is still operational. netdev->queue_lock is still used when the device comes online or when it's completely shut down (unregister_netdev(), etc.).”h]”hXsThe base driver will also need to manage the queues as it does the global netdev->queue_lock today. Therefore base drivers should use the netif_{start|stop|wake}_subqueue() functions to manage each queue while the device is still operational. netdev->queue_lock is still used when the device comes online or when it’s completely shut down (unregister_netdev(), etc.).”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h KhhÚhžhubeh}”(h]”Œ+intro-kernel-support-for-multiqueue-devices”ah ]”h"]”Œ,intro: kernel support for multiqueue devices”ah$]”h&]”uh1h´hhÉhžhhŸh³h K ubeh}”(h]”ŒFsection-1-base-driver-requirements-for-implementing-multiqueue-support”ah ]”h"]”ŒGsection 1: base driver requirements for implementing multiqueue support”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒ/Section 2: Qdisc support for multiqueue devices”h]”hŒ/Section 2: Qdisc support for multiqueue devices”…””}”(hj*hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj'hžhhŸh³h Kubhì)”}”(hXÃCurrently two qdiscs are optimized for multiqueue devices. The first is the default pfifo_fast qdisc. This qdisc supports one qdisc per hardware queue. A new round-robin qdisc, sch_multiq also supports multiple hardware queues. The qdisc is responsible for classifying the skb's and then directing the skb's to bands and queues based on the value in skb->queue_mapping. Use this field in the base driver to determine which queue to send the skb to.”h]”hXÇCurrently two qdiscs are optimized for multiqueue devices. The first is the default pfifo_fast qdisc. This qdisc supports one qdisc per hardware queue. A new round-robin qdisc, sch_multiq also supports multiple hardware queues. The qdisc is responsible for classifying the skb’s and then directing the skb’s to bands and queues based on the value in skb->queue_mapping. Use this field in the base driver to determine which queue to send the skb to.”…””}”(hj8hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h Khj'hžhubhì)”}”(hŒÚsch_multiq has been added for hardware that wishes to avoid head-of-line blocking. It will cycle though the bands and verify that the hardware queue associated with the band is not stopped prior to dequeuing a packet.”h]”hŒÚsch_multiq has been added for hardware that wishes to avoid head-of-line blocking. It will cycle though the bands and verify that the hardware queue associated with the band is not stopped prior to dequeuing a packet.”…””}”(hjFhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h K&hj'hžhubhì)”}”(hŒ×On qdisc load, the number of bands is based on the number of queues on the hardware. Once the association is made, any skb with skb->queue_mapping set, will be queued to the band associated with the hardware queue.”h]”hŒ×On qdisc load, the number of bands is based on the number of queues on the hardware. Once the association is made, any skb with skb->queue_mapping set, will be queued to the band associated with the hardware queue.”…””}”(hjThžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h K*hj'hžhubeh}”(h]”Œ.section-2-qdisc-support-for-multiqueue-devices”ah ]”h"]”Œ/section 2: qdisc support for multiqueue devices”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒ:Section 3: Brief howto using MULTIQ for multiqueue devices”h]”hŒ:Section 3: Brief howto using MULTIQ for multiqueue devices”…””}”(hjmhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjjhžhhŸh³h K0ubhì)”}”(hŒÇThe userspace command 'tc,' part of the iproute2 package, is used to configure qdiscs. To add the MULTIQ qdisc to your network device, assuming the device is called eth0, run the following command::”h]”hŒÊThe userspace command ‘tc,’ part of the iproute2 package, is used to configure qdiscs. To add the MULTIQ qdisc to your network device, assuming the device is called eth0, run the following command:”…””}”(hj{hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h K2hjjhžhubhŒ literal_block”“”)”}”(hŒ-# tc qdisc add dev eth0 root handle 1: multiq”h]”hŒ-# tc qdisc add dev eth0 root handle 1: multiq”…””}”hj‹sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j‰hŸh³h K6hjjhžhubhì)”}”(hŒÁThe qdisc will allocate the number of bands to equal the number of queues that the device reports, and bring the qdisc online. Assuming eth0 has 4 Tx queues, the band mapping would look like::”h]”hŒÀThe qdisc will allocate the number of bands to equal the number of queues that the device reports, and bring the qdisc online. Assuming eth0 has 4 Tx queues, the band mapping would look like:”…””}”(hj™hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h K8hjjhžhubjŠ)”}”(hŒGband 0 => queue 0 band 1 => queue 1 band 2 => queue 2 band 3 => queue 3”h]”hŒGband 0 => queue 0 band 1 => queue 1 band 2 => queue 2 band 3 => queue 3”…””}”hj§sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j‰hŸh³h Kselect_queue() if you have it defined.”h]”hŒ”Traffic will begin flowing through each queue based on either the simple_tx_hash function or based on netdev->select_queue() if you have it defined.”…””}”(hjµhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h KAhjjhžhubhì)”}”(hX The behavior of tc filters remains the same. However a new tc action, skbedit, has been added. Assuming you wanted to route all traffic to a specific host, for example 192.168.0.3, through a specific queue you could use this action and establish a filter such as::”h]”hX The behavior of tc filters remains the same. However a new tc action, skbedit, has been added. Assuming you wanted to route all traffic to a specific host, for example 192.168.0.3, through a specific queue you could use this action and establish a filter such as:”…””}”(hjÃhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h KDhjjhžhubjŠ)”}”(hŒƒtc filter add dev eth0 parent 1: protocol ip prio 1 u32 \ match ip dst 192.168.0.3 \ action skbedit queue_mapping 3”h]”hŒƒtc filter add dev eth0 parent 1: protocol ip prio 1 u32 \ match ip dst 192.168.0.3 \ action skbedit queue_mapping 3”…””}”hjÑsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j‰hŸh³h KIhjjhžhubhŒ field_list”“”)”}”(hhh]”(hŒfield”“”)”}”(hhh]”(hŒ field_name”“”)”}”(hŒAuthor”h]”hŒAuthor”…””}”(hjëhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jéhjæhŸh³h KubhŒ field_body”“”)”}”(hŒ-Alexander Duyck ”h]”hì)”}”(hjýh]”(hŒAlexander Duyck <”…””}”(hjÿhžhhŸNh NubhŒ reference”“”)”}”(hŒalexander.h.duyck@intel.com”h]”hŒalexander.h.duyck@intel.com”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ"mailto:alexander.h.duyck@intel.com”uh1jhjÿubhŒ>”…””}”(hjÿhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h KMhjûubah}”(h]”h ]”h"]”h$]”h&]”uh1jùhjæubeh}”(h]”h ]”h"]”h$]”h&]”uh1jähŸh³h KMhjáhžhubjå)”}”(hhh]”(jê)”}”(hŒOriginal Author”h]”hŒOriginal Author”…””}”(hj1hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jéhj.hŸh³h Kubjú)”}”(hŒ9Peter P. Waskiewicz Jr. ”h]”hì)”}”(hjAh]”(hŒPeter P. Waskiewicz Jr. <”…””}”(hjChžhhŸNh Nubj)”}”(hŒpeter.p.waskiewicz.jr@intel.com”h]”hŒpeter.p.waskiewicz.jr@intel.com”…””}”(hjJhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ&mailto:peter.p.waskiewicz.jr@intel.com”uh1jhjCubhŒ>”…””}”(hjChžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëhŸh³h KNhj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1jùhj.ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jähŸh³h KNhjáhžhubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjjhžhhŸh³h KMubeh}”(h]”Œ9section-3-brief-howto-using-multiq-for-multiqueue-devices”ah ]”h"]”Œ:section 3: brief howto using multiq for multiqueue devices”ah$]”h&]”uh1h´hh¶hžhhŸh³h K0ubeh}”(h]”Œ+howto-for-multiqueue-network-device-support”ah ]”h"]”Œ+howto for multiqueue network device support”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j©Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jƒj€j$j!jjjgjdj{jxuŒ nametypes”}”(jƒ‰j$‰j‰jg‰j{‰uh}”(j€h¶j!hÉjhÚjdj'jxjjuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.