€•Œ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/napi”Œ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/napi”Œ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/napi”Œ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/napi”Œ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/napi”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/pt_BR/networking/napi”Œ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/napi”Œ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Œ7SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)”h]”hŒ7SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ=/var/lib/git/docbuild/linux/Documentation/networking/napi.rst”h´KubhŒtarget”“”)�”}”(hŒ .. _napi:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œnapi”uh1hÈh´Khhh²hh³hÇubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒNAPI”h]”hŒNAPI”…”�”}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hŒˆNAPI is the event handling mechanism used by the Linux networking stack. The name NAPI no longer stands for anything in particular [#]_.”h]”(hŒƒNAPI is the event handling mechanism used by the Linux networking stack. The name NAPI no longer stands for anything in particular ”…”�”}”(hhíh²hh³Nh´NubhŒfootnote_reference”“”)�”}”(hŒ[#]_”h]”hŒ1”…”�”}”(hh÷h²hh³Nh´Nubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”Œauto”KhÔŒid3”Œdocname”Œnetworking/napi”uh1hõhhíŒresolved”KubhŒ.”…”�”}”(hhíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K hhØh²hubhì)�”}”(hXIn basic operation the device notifies the host about new events via an interrupt. The host then schedules a NAPI instance to process the events. The device may also be polled for events via NAPI without receiving interrupts first (:ref:`busy polling`).”h]”(hŒèIn basic operation the device notifies the host about new events via an interrupt. The host then schedules a NAPI instance to process the events. The device may also be polled for events via NAPI without receiving interrupts first (”…”�”}”(hjh²hh³Nh´Nubh)�”}”(hŒ:ref:`busy polling`”h]”hŒinline”“”)�”}”(hjh]”hŒ busy polling”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j!hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j.Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œpoll”uh1hh³hÇh´K hjubhŒ).”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K hhØh²hubhì)�”}”(hŒžNAPI processing usually happens in the software interrupt context, but there is an option to use :ref:`separate kernel threads` for NAPI processing.”h]”(hŒaNAPI processing usually happens in the software interrupt context, but there is an option to use ”…”�”}”(hjKh²hh³Nh´Nubh)�”}”(hŒ(:ref:`separate kernel threads`”h]”j")�”}”(hjUh]”hŒseparate kernel threads”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”(j-Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j!hjSubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jaŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj?Œthreaded”uh1hh³hÇh´KhjKubhŒ for NAPI processing.”…”�”}”(hjKh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubhì)�”}”(hŒuAll in all NAPI abstracts away from the drivers the context and configuration of event (packet Rx and Tx) processing.”h]”hŒuAll in all NAPI abstracts away from the drivers the context and configuration of event (packet Rx and Tx) processing.”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Driver API”h]”hŒ Driver API”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj‹h²hh³hÇh´Kubhì)�”}”(hX:The two most important elements of NAPI are the struct napi_struct and the associated poll method. struct napi_struct holds the state of the NAPI instance while the method is the driver-specific event handler. The method will typically free Tx packets that have been transmitted and process newly received packets.”h]”hX:The two most important elements of NAPI are the struct napi_struct and the associated poll method. struct napi_struct holds the state of the NAPI instance while the method is the driver-specific event handler. The method will typically free Tx packets that have been transmitted and process newly received packets.”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Khj‹h²hubhÉ)�”}”(hŒ .. _drv_ctrl:”h]”h}”(h]”h ]”h"]”h$]”h&]”hÔŒdrv-ctrl”uh1hÈh´K"hj‹h²hh³hÇubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Control API”h]”hŒ Control API”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjµh²hh³hÇh´K%ubhì)�”}”(hŒýnetif_napi_add() and netif_napi_del() add/remove a NAPI instance from the system. The instances are attached to the netdevice passed as argument (and will be deleted automatically when netdevice is unregistered). Instances are added in a disabled state.”h]”hŒýnetif_napi_add() and netif_napi_del() add/remove a NAPI instance from the system. The instances are attached to the netdevice passed as argument (and will be deleted automatically when netdevice is unregistered). Instances are added in a disabled state.”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K'hjµh²hubhì)�”}”(hŒÛnapi_enable() and napi_disable() manage the disabled state. A disabled NAPI can't be scheduled and its poll method is guaranteed to not be invoked. napi_disable() waits for ownership of the NAPI instance to be released.”h]”hŒÝnapi_enable() and napi_disable() manage the disabled state. A disabled NAPI can’t be scheduled and its poll method is guaranteed to not be invoked. napi_disable() waits for ownership of the NAPI instance to be released.”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K,hjµh²hubhì)�”}”(hXMThe control APIs are not idempotent. Control API calls are safe against concurrent use of datapath APIs but an incorrect sequence of control API calls may result in crashes, deadlocks, or race conditions. For example, calling napi_disable() multiple times in a row will hang waiting for ownership of the NAPI instance to be released.”h]”hXMThe control APIs are not idempotent. Control API calls are safe against concurrent use of datapath APIs but an incorrect sequence of control API calls may result in crashes, deadlocks, or race conditions. For example, calling napi_disable() multiple times in a row will hang waiting for ownership of the NAPI instance to be released.”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K1hjµh²hubhì)�”}”(hŒ…Drivers using the netdev instance lock may need to use the ``_locked()`` variants of the control APIs when that lock is already held.”h]”(hŒ;Drivers using the netdev instance lock may need to use the ”…”�”}”(hjðh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ ``_locked()``”h]”hŒ _locked()”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjðubhŒ= variants of the control APIs when that lock is already held.”…”�”}”(hjðh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K7hjµh²hubeh}”(h]”(Œ control-api”j´eh ]”h"]”(Œ control api”Œdrv_ctrl”eh$]”h&]”uh1hÖhj‹h²hh³hÇh´K%Œexpect_referenced_by_name”}”jjªsŒexpect_referenced_by_id”}”j´jªsubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Datapath API”h]”hŒ Datapath API”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjh²hh³hÇh´K;ubhì)�”}”(hŒðnapi_schedule() is the basic method of scheduling a NAPI poll. Drivers should call this function in their interrupt handler (see :ref:`drv_sched` for more info). A successful call to napi_schedule() will take ownership of the NAPI instance.”h]”(hŒ�napi_schedule() is the basic method of scheduling a NAPI poll. Drivers should call this function in their interrupt handler (see ”…”�”}”(hj0h²hh³Nh´Nubh)�”}”(hŒ:ref:`drv_sched`”h]”j")�”}”(hj:h]”hŒ drv_sched”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”(j-Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j!hj8ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jFŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj?Œ drv_sched”uh1hh³hÇh´K=hj0ubhŒ_ for more info). A successful call to napi_schedule() will take ownership of the NAPI instance.”…”�”}”(hj0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K=hjh²hubhì)�”}”(hX9Later, after NAPI is scheduled, the driver's poll method will be called to process the events/packets. The method takes a ``budget`` argument - drivers can process completions for any number of Tx packets but should only process up to ``budget`` number of Rx packets. Rx processing is usually much more expensive.”h]”(hŒ|Later, after NAPI is scheduled, the driver’s poll method will be called to process the events/packets. The method takes a ”…”�”}”(hjbh²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjbubhŒg argument - drivers can process completions for any number of Tx packets but should only process up to ”…”�”}”(hjbh²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjbubhŒD number of Rx packets. Rx processing is usually much more expensive.”…”�”}”(hjbh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KBhjh²hubhì)�”}”(hXOIn other words for Rx processing the ``budget`` argument limits how many packets driver can process in a single poll. Rx specific APIs like page pool or XDP cannot be used at all when ``budget`` is 0. skb Tx processing should happen regardless of the ``budget``, but if the argument is 0 driver cannot call any XDP (or page pool) APIs.”h]”(hŒ%In other words for Rx processing the ”…”�”}”(hj”h²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj”ubhŒ‰ argument limits how many packets driver can process in a single poll. Rx specific APIs like page pool or XDP cannot be used at all when ”…”�”}”(hj”h²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj”ubhŒ9 is 0. skb Tx processing should happen regardless of the ”…”�”}”(hj”h²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj”ubhŒJ, but if the argument is 0 driver cannot call any XDP (or page pool) APIs.”…”�”}”(hj”h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KHhjh²hubhŒwarning”“”)�”}”(hŒkThe ``budget`` argument may be 0 if core tries to only process skb Tx completions and no Rx or XDP packets.”h]”hì)�”}”(hŒkThe ``budget`` argument may be 0 if core tries to only process skb Tx completions and no Rx or XDP packets.”h]”(hŒThe ”…”�”}”(hjÞh²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÞubhŒ] argument may be 0 if core tries to only process skb Tx completions and no Rx or XDP packets.”…”�”}”(hjÞh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KPhjÚubah}”(h]”h ]”h"]”h$]”h&]”uh1jØhjh²hh³hÇh´Nubhì)�”}”(hXThe poll method returns the amount of work done. If the driver still has outstanding work to do (e.g. ``budget`` was exhausted) the poll method should return exactly ``budget``. In that case, the NAPI instance will be serviced/polled again (without the need to be scheduled).”h]”(hŒfThe poll method returns the amount of work done. If the driver still has outstanding work to do (e.g. ”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒ6 was exhausted) the poll method should return exactly ”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒc. In that case, the NAPI instance will be serviced/polled again (without the need to be scheduled).”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KShjh²hubhì)�”}”(hŒÊIf event processing has been completed (all outstanding packets processed) the poll method should call napi_complete_done() before returning. napi_complete_done() releases the ownership of the instance.”h]”hŒÊIf event processing has been completed (all outstanding packets processed) the poll method should call napi_complete_done() before returning. napi_complete_done() releases the ownership of the instance.”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KYhjh²hubjÙ)�”}”(hXJThe case of finishing all events and using exactly ``budget`` must be handled carefully. There is no way to report this (rare) condition to the stack, so the driver must either not call napi_complete_done() and wait to be called again, or return ``budget - 1``. If the ``budget`` is 0 napi_complete_done() should never be called.”h]”(hì)�”}”(hXThe case of finishing all events and using exactly ``budget`` must be handled carefully. There is no way to report this (rare) condition to the stack, so the driver must either not call napi_complete_done() and wait to be called again, or return ``budget - 1``.”h]”(hŒ3The case of finishing all events and using exactly ”…”�”}”(hjHh²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjHubhŒ¹ must be handled carefully. There is no way to report this (rare) condition to the stack, so the driver must either not call napi_complete_done() and wait to be called again, or return ”…”�”}”(hjHh²hh³Nh´Nubjù)�”}”(hŒ``budget - 1``”h]”hŒ budget - 1”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjHubhŒ.”…”�”}”(hjHh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K`hjDubhì)�”}”(hŒCIf the ``budget`` is 0 napi_complete_done() should never be called.”h]”(hŒIf the ”…”�”}”(hjzh²hh³Nh´Nubjù)�”}”(hŒ ``budget``”h]”hŒbudget”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjzubhŒ2 is 0 napi_complete_done() should never be called.”…”�”}”(hjzh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KfhjDubeh}”(h]”h ]”h"]”h$]”h&]”uh1jØhjh²hh³hÇh´Nubeh}”(h]”Œ datapath-api”ah ]”h"]”Œ datapath api”ah$]”h&]”uh1hÖhj‹h²hh³hÇh´K;ubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Call sequence”h]”hŒ Call sequence”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj¨h²hh³hÇh´Kiubhì)�”}”(hX@Drivers should not make assumptions about the exact sequencing of calls. The poll method may be called without the driver scheduling the instance (unless the instance is disabled). Similarly, it's not guaranteed that the poll method will be called, even if napi_schedule() succeeded (e.g. if the instance gets disabled).”h]”hXBDrivers should not make assumptions about the exact sequencing of calls. The poll method may be called without the driver scheduling the instance (unless the instance is disabled). Similarly, it’s not guaranteed that the poll method will be called, even if napi_schedule() succeeded (e.g. if the instance gets disabled).”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kkhj¨h²hubhì)�”}”(hX(As mentioned in the :ref:`drv_ctrl` section - napi_disable() and subsequent calls to the poll method only wait for the ownership of the instance to be released, not for the poll method to exit. This means that drivers should avoid accessing any data structures after calling napi_complete_done().”h]”(hŒAs mentioned in the ”…”�”}”(hjÇh²hh³Nh´Nubh)�”}”(hŒ:ref:`drv_ctrl`”h]”j")�”}”(hjÑh]”hŒdrv_ctrl”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”(j-Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j!hjÏubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jÝŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj?Œdrv_ctrl”uh1hh³hÇh´KqhjÇubhX section - napi_disable() and subsequent calls to the poll method only wait for the ownership of the instance to be released, not for the poll method to exit. This means that drivers should avoid accessing any data structures after calling napi_complete_done().”…”�”}”(hjÇh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kqhj¨h²hubhÉ)�”}”(hŒ.. _drv_sched:”h]”h}”(h]”h ]”h"]”h$]”h&]”hÔŒ drv-sched”uh1hÈh´Kwhj¨h²hh³hÇubeh}”(h]”Œ call-sequence”ah ]”h"]”Œ call sequence”ah$]”h&]”uh1hÖhj‹h²hh³hÇh´Kiubh×)�”}”(hhh]”(hÜ)�”}”(hŒScheduling and IRQ masking”h]”hŒScheduling and IRQ masking”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj h²hh³hÇh´Kzubhì)�”}”(hŒ’Drivers should keep the interrupts masked after scheduling the NAPI instance - until NAPI polling finishes any further interrupts are unnecessary.”h]”hŒ’Drivers should keep the interrupts masked after scheduling the NAPI instance - until NAPI polling finishes any further interrupts are unnecessary.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K|hj h²hubhì)�”}”(hŒ©Drivers which have to mask the interrupts explicitly (as opposed to IRQ being auto-masked by the device) should use the napi_schedule_prep() and __napi_schedule() calls:”h]”hŒ©Drivers which have to mask the interrupts explicitly (as opposed to IRQ being auto-masked by the device) should use the napi_schedule_prep() and __napi_schedule() calls:”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K€hj h²hubhŒ literal_block”“”)�”}”(hŒ•if (napi_schedule_prep(&v->napi)) { mydrv_mask_rxtx_irq(v->idx); /* schedule after masking to avoid races */ __napi_schedule(&v->napi); }”h]”hŒ•if (napi_schedule_prep(&v->napi)) { mydrv_mask_rxtx_irq(v->idx); /* schedule after masking to avoid races */ __napi_schedule(&v->napi); }”…”�”}”hj;sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1j9h³hÇh´K„hj h²hubhì)�”}”(hŒLIRQ should only be unmasked after a successful call to napi_complete_done():”h]”hŒLIRQ should only be unmasked after a successful call to napi_complete_done():”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KŒhj h²hubj:)�”}”(hŒ€if (budget && napi_complete_done(&v->napi, work_done)) { mydrv_unmask_rxtx_irq(v->idx); return min(work_done, budget - 1); }”h]”hŒ€if (budget && napi_complete_done(&v->napi, work_done)) { mydrv_unmask_rxtx_irq(v->idx); return min(work_done, budget - 1); }”…”�”}”hj\sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJjKjL}”uh1j9h³hÇh´KŽhj h²hubhì)�”}”(hXnapi_schedule_irqoff() is a variant of napi_schedule() which takes advantage of guarantees given by being invoked in IRQ context (no need to mask interrupts). napi_schedule_irqoff() will fall back to napi_schedule() if IRQs are threaded (such as if ``PREEMPT_RT`` is enabled).”h]”(hŒùnapi_schedule_irqoff() is a variant of napi_schedule() which takes advantage of guarantees given by being invoked in IRQ context (no need to mask interrupts). napi_schedule_irqoff() will fall back to napi_schedule() if IRQs are threaded (such as if ”…”�”}”(hjkh²hh³Nh´Nubjù)�”}”(hŒ``PREEMPT_RT``”h]”hŒ PREEMPT_RT”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjkubhŒ is enabled).”…”�”}”(hjkh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K•hj h²hubeh}”(h]”(Œscheduling-and-irq-masking”jeh ]”h"]”(Œscheduling and irq masking”Œ drv_sched”eh$]”h&]”uh1hÖhj‹h²hh³hÇh´Kzj}”j‘jùsj}”jjùsubh×)�”}”(hhh]”(hÜ)�”}”(hŒInstance to queue mapping”h]”hŒInstance to queue mapping”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj–h²hh³hÇh´K›ubhì)�”}”(hXPModern devices have multiple NAPI instances (struct napi_struct) per interface. There is no strong requirement on how the instances are mapped to queues and interrupts. NAPI is primarily a polling/processing abstraction without specific user-facing semantics. That said, most networking devices end up using NAPI in fairly similar ways.”h]”hXPModern devices have multiple NAPI instances (struct napi_struct) per interface. There is no strong requirement on how the instances are mapped to queues and interrupts. NAPI is primarily a polling/processing abstraction without specific user-facing semantics. That said, most networking devices end up using NAPI in fairly similar ways.”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K�hj–h²hubhì)�”}”(hŒ‚NAPI instances most often correspond 1:1:1 to interrupts and queue pairs (queue pair is a set of a single Rx and single Tx queue).”h]”hŒ‚NAPI instances most often correspond 1:1:1 to interrupts and queue pairs (queue pair is a set of a single Rx and single Tx queue).”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K£hj–h²hubhì)�”}”(hXIn less common cases a NAPI instance may be used for multiple queues or Rx and Tx queues can be serviced by separate NAPI instances on a single core. Regardless of the queue assignment, however, there is usually still a 1:1 mapping between NAPI instances and interrupts.”h]”hXIn less common cases a NAPI instance may be used for multiple queues or Rx and Tx queues can be serviced by separate NAPI instances on a single core. Regardless of the queue assignment, however, there is usually still a 1:1 mapping between NAPI instances and interrupts.”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K¦hj–h²hubhì)�”}”(hX¨It's worth noting that the ethtool API uses a "channel" terminology where each channel can be either ``rx``, ``tx`` or ``combined``. It's not clear what constitutes a channel; the recommended interpretation is to understand a channel as an IRQ/NAPI which services queues of a given type. For example, a configuration of 1 ``rx``, 1 ``tx`` and 1 ``combined`` channel is expected to utilize 3 interrupts, 2 Rx and 2 Tx queues.”h]”(hŒkIt’s worth noting that the ethtool API uses a “channelâ€� terminology where each channel can be either ”…”�”}”(hjÑh²hh³Nh´Nubjù)�”}”(hŒ``rx``”h]”hŒrx”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÑubhŒ, ”…”�”}”(hjÑh²hh³Nh´Nubjù)�”}”(hŒ``tx``”h]”hŒtx”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÑubhŒ or ”…”�”}”(hjÑh²hh³Nh´Nubjù)�”}”(hŒ ``combined``”h]”hŒcombined”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÑubhŒÁ. It’s not clear what constitutes a channel; the recommended interpretation is to understand a channel as an IRQ/NAPI which services queues of a given type. For example, a configuration of 1 ”…”�”}”(hjÑh²hh³Nh´Nubjù)�”}”(hŒ``rx``”h]”hŒrx”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÑubhŒ, 1 ”…”�”}”(hjÑh²hh³Nh´Nubjù)�”}”(hŒ``tx``”h]”hŒtx”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÑubhŒ and 1 ”…”�”}”(hjÑh²hh³Nh´Nubjù)�”}”(hŒ ``combined``”h]”hŒcombined”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÑubhŒC channel is expected to utilize 3 interrupts, 2 Rx and 2 Tx queues.”…”�”}”(hjÑh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K«hj–h²hubeh}”(h]”Œinstance-to-queue-mapping”ah ]”h"]”Œinstance to queue mapping”ah$]”h&]”uh1hÖhj‹h²hh³hÇh´K›ubh×)�”}”(hhh]”(hÜ)�”}”(hŒPersistent NAPI config”h]”hŒPersistent NAPI config”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjSh²hh³hÇh´K³ubhì)�”}”(hXbDrivers often allocate and free NAPI instances dynamically. This leads to loss of NAPI-related user configuration each time NAPI instances are reallocated. The netif_napi_add_config() API prevents this loss of configuration by associating each NAPI instance with a persistent NAPI configuration based on a driver defined index value, like a queue number.”h]”hXbDrivers often allocate and free NAPI instances dynamically. This leads to loss of NAPI-related user configuration each time NAPI instances are reallocated. The netif_napi_add_config() API prevents this loss of configuration by associating each NAPI instance with a persistent NAPI configuration based on a driver defined index value, like a queue number.”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KµhjSh²hubhì)�”}”(hŒÐUsing this API allows for persistent NAPI IDs (among other settings), which can be beneficial to userspace programs using ``SO_INCOMING_NAPI_ID``. See the sections below for other NAPI configuration settings.”h]”(hŒzUsing this API allows for persistent NAPI IDs (among other settings), which can be beneficial to userspace programs using ”…”�”}”(hjrh²hh³Nh´Nubjù)�”}”(hŒ``SO_INCOMING_NAPI_ID``”h]”hŒSO_INCOMING_NAPI_ID”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjrubhŒ?. See the sections below for other NAPI configuration settings.”…”�”}”(hjrh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K»hjSh²hubhì)�”}”(hŒDDrivers should try to use netif_napi_add_config() whenever possible.”h]”hŒDDrivers should try to use netif_napi_add_config() whenever possible.”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K¿hjSh²hubeh}”(h]”Œpersistent-napi-config”ah ]”h"]”Œpersistent napi config”ah$]”h&]”uh1hÖhj‹h²hh³hÇh´K³ubeh}”(h]”Œ driver-api”ah ]”h"]”Œ driver api”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kubh×)�”}”(hhh]”(hÜ)�”}”(hŒUser API”h]”hŒUser API”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj°h²hh³hÇh´KÂubhì)�”}”(hŒ®User interactions with NAPI depend on NAPI instance ID. The instance IDs are visible to the user through the ``SO_INCOMING_NAPI_ID`` socket option and the netdev Netlink API.”h]”(hŒmUser interactions with NAPI depend on NAPI instance ID. The instance IDs are visible to the user through the ”…”�”}”(hjÁh²hh³Nh´Nubjù)�”}”(hŒ``SO_INCOMING_NAPI_ID``”h]”hŒSO_INCOMING_NAPI_ID”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÁubhŒ* socket option and the netdev Netlink API.”…”�”}”(hjÁh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÄhj°h²hubhì)�”}”(hŒÕUsers can query NAPI IDs for a device or device queue using netlink. This can be done programmatically in a user application or by using a script included in the kernel source tree: ``tools/net/ynl/pyynl/cli.py``.”h]”(hŒ¶Users can query NAPI IDs for a device or device queue using netlink. This can be done programmatically in a user application or by using a script included in the kernel source tree: ”…”�”}”(hjáh²hh³Nh´Nubjù)�”}”(hŒ``tools/net/ynl/pyynl/cli.py``”h]”hŒtools/net/ynl/pyynl/cli.py”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjáubhŒ.”…”�”}”(hjáh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÈhj°h²hubhì)�”}”(hŒnFor example, using the script to dump all of the queues for a device (which will reveal each queue's NAPI ID):”h]”hŒpFor example, using the script to dump all of the queues for a device (which will reveal each queue’s NAPI ID):”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÌhj°h²hubj:)�”}”(hŒ¦$ kernel-source/tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get \ --json='{"ifindex": 2}'”h]”hŒ¦$ kernel-source/tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get \ --json='{"ifindex": 2}'”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJŒbash”jL}”uh1j9h³hÇh´KÏhj°h²hubhì)�”}”(hŒhSee ``Documentation/netlink/specs/netdev.yaml`` for more details on available operations and attributes.”h]”(hŒSee ”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ+``Documentation/netlink/specs/netdev.yaml``”h]”hŒ'Documentation/netlink/specs/netdev.yaml”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒ9 for more details on available operations and attributes.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÖhj°h²hubh×)�”}”(hhh]”(hÜ)�”}”(hŒSoftware IRQ coalescing”h]”hŒSoftware IRQ coalescing”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj?h²hh³hÇh´KÚubhì)�”}”(hŒËNAPI does not perform any explicit event coalescing by default. In most scenarios batching happens due to IRQ coalescing which is done by the device. There are cases where software coalescing is helpful.”h]”hŒËNAPI does not perform any explicit event coalescing by default. In most scenarios batching happens due to IRQ coalescing which is done by the device. There are cases where software coalescing is helpful.”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÜhj?h²hubhì)�”}”(hXtNAPI can be configured to arm a repoll timer instead of unmasking the hardware interrupts as soon as all packets are processed. The ``gro_flush_timeout`` sysfs configuration of the netdevice is reused to control the delay of the timer, while ``napi_defer_hard_irqs`` controls the number of consecutive empty polls before NAPI gives up and goes back to using hardware IRQs.”h]”(hŒ„NAPI can be configured to arm a repoll timer instead of unmasking the hardware interrupts as soon as all packets are processed. The ”…”�”}”(hj^h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj^ubhŒY sysfs configuration of the netdevice is reused to control the delay of the timer, while ”…”�”}”(hj^h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj^ubhŒj controls the number of consecutive empty polls before NAPI gives up and goes back to using hardware IRQs.”…”�”}”(hj^h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kàhj?h²hubhì)�”}”(hX The above parameters can also be set on a per-NAPI basis using netlink via netdev-genl. When used with netlink and configured on a per-NAPI basis, the parameters mentioned above use hyphens instead of underscores: ``gro-flush-timeout`` and ``napi-defer-hard-irqs``.”h]”(hŒÖThe above parameters can also be set on a per-NAPI basis using netlink via netdev-genl. When used with netlink and configured on a per-NAPI basis, the parameters mentioned above use hyphens instead of underscores: ”…”�”}”(hj�h²hh³Nh´Nubjù)�”}”(hŒ``gro-flush-timeout``”h]”hŒgro-flush-timeout”…”�”}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj�ubhŒ and ”…”�”}”(hj�h²hh³Nh´Nubjù)�”}”(hŒ``napi-defer-hard-irqs``”h]”hŒnapi-defer-hard-irqs”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj�ubhŒ.”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kçhj?h²hubhì)�”}”(hŒ¢Per-NAPI configuration can be done programmatically in a user application or by using a script included in the kernel source tree: ``tools/net/ynl/pyynl/cli.py``.”h]”(hŒƒPer-NAPI configuration can be done programmatically in a user application or by using a script included in the kernel source tree: ”…”�”}”(hjÂh²hh³Nh´Nubjù)�”}”(hŒ``tools/net/ynl/pyynl/cli.py``”h]”hŒtools/net/ynl/pyynl/cli.py”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÂubhŒ.”…”�”}”(hjÂh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kìhj?h²hubhì)�”}”(hŒFor example, using the script:”h]”hŒFor example, using the script:”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kðhj?h²hubj:)�”}”(hŒú$ kernel-source/tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --do napi-set \ --json='{"id": 345, "defer-hard-irqs": 111, "gro-flush-timeout": 11111}'”h]”hŒú$ kernel-source/tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --do napi-set \ --json='{"id": 345, "defer-hard-irqs": 111, "gro-flush-timeout": 11111}'”…”�”}”hjðsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJŒbash”jL}”uh1j9h³hÇh´Kòhj?h²hubhì)�”}”(hŒ�Similarly, the parameter ``irq-suspend-timeout`` can be set using netlink via netdev-genl. There is no global sysfs parameter for this value.”h]”(hŒSimilarly, the parameter ”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒ] can be set using netlink via netdev-genl. There is no global sysfs parameter for this value.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kûhj?h²hubhì)�”}”(hŒà``irq-suspend-timeout`` is used to determine how long an application can completely suspend IRQs. It is used in combination with SO_PREFER_BUSY_POLL, which can be set on a per-epoll context basis with ``EPIOCSPARAMS`` ioctl.”h]”(jù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒ² is used to determine how long an application can completely suspend IRQs. It is used in combination with SO_PREFER_BUSY_POLL, which can be set on a per-epoll context basis with ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``EPIOCSPARAMS``”h]”hŒ EPIOCSPARAMS”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒ ioctl.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kþhj?h²hubhÉ)�”}”(hŒ .. _poll:”h]”h}”(h]”h ]”h"]”h$]”h&]”hÔŒpoll”uh1hÈh´Mhj?h²hh³hÇubeh}”(h]”Œsoftware-irq-coalescing”ah ]”h"]”Œsoftware irq coalescing”ah$]”h&]”uh1hÖhj°h²hh³hÇh´KÚubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Busy polling”h]”hŒ Busy polling”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjah²hh³hÇh´Mubhì)�”}”(hŒîBusy polling allows a user process to check for incoming packets before the device interrupt fires. As is the case with any busy polling it trades off CPU cycles for lower latency (production uses of NAPI busy polling are not well known).”h]”hŒîBusy polling allows a user process to check for incoming packets before the device interrupt fires. As is the case with any busy polling it trades off CPU cycles for lower latency (production uses of NAPI busy polling are not well known).”…”�”}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhjah²hubhì)�”}”(hXhBusy polling is enabled by either setting ``SO_BUSY_POLL`` on selected sockets or using the global ``net.core.busy_poll`` and ``net.core.busy_read`` sysctls. An io_uring API for NAPI busy polling also exists. Threaded polling of NAPI also has a mode to busy poll for packets (:ref:`threaded busy polling`) using the NAPI processing kthread.”h]”(hŒ*Busy polling is enabled by either setting ”…”�”}”(hj€h²hh³Nh´Nubjù)�”}”(hŒ``SO_BUSY_POLL``”h]”hŒ SO_BUSY_POLL”…”�”}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj€ubhŒ) on selected sockets or using the global ”…”�”}”(hj€h²hh³Nh´Nubjù)�”}”(hŒ``net.core.busy_poll``”h]”hŒnet.core.busy_poll”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj€ubhŒ and ”…”�”}”(hj€h²hh³Nh´Nubjù)�”}”(hŒ``net.core.busy_read``”h]”hŒnet.core.busy_read”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj€ubhŒ€ sysctls. An io_uring API for NAPI busy polling also exists. Threaded polling of NAPI also has a mode to busy poll for packets (”…”�”}”(hj€h²hh³Nh´Nubh)�”}”(hŒ0:ref:`threaded busy polling`”h]”j")�”}”(hjÀh]”hŒthreaded busy polling”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”(j-Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j!hj¾ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jÌŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj?Œthreaded_busy_poll”uh1hh³hÇh´M hj€ubhŒ$) using the NAPI processing kthread.”…”�”}”(hj€h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M hjah²hubeh}”(h]”(Œ busy-polling”jXeh ]”h"]”(Œ busy polling”Œpoll”eh$]”h&]”uh1hÖhj°h²hh³hÇh´Mj}”jîjNsj}”jXjNsubh×)�”}”(hhh]”(hÜ)�”}”(hŒepoll-based busy polling”h]”hŒepoll-based busy polling”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjóh²hh³hÇh´Mubhì)�”}”(hŒßIt is possible to trigger packet processing directly from calls to ``epoll_wait``. In order to use this feature, a user application must ensure all file descriptors which are added to an epoll context have the same NAPI ID.”h]”(hŒCIt is possible to trigger packet processing directly from calls to ”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ``epoll_wait``”h]”hŒ epoll_wait”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒŽ. In order to use this feature, a user application must ensure all file descriptors which are added to an epoll context have the same NAPI ID.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhjóh²hubhì)�”}”(hXrIf the application uses a dedicated acceptor thread, the application can obtain the NAPI ID of the incoming connection using SO_INCOMING_NAPI_ID and then distribute that file descriptor to a worker thread. The worker thread would add the file descriptor to its epoll context. This would ensure each worker thread has an epoll context with FDs that have the same NAPI ID.”h]”hXrIf the application uses a dedicated acceptor thread, the application can obtain the NAPI ID of the incoming connection using SO_INCOMING_NAPI_ID and then distribute that file descriptor to a worker thread. The worker thread would add the file descriptor to its epoll context. This would ensure each worker thread has an epoll context with FDs that have the same NAPI ID.”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhjóh²hubhì)�”}”(hX,Alternatively, if the application uses SO_REUSEPORT, a bpf or ebpf program can be inserted to distribute incoming connections to threads such that each thread is only given incoming connections with the same NAPI ID. Care must be taken to carefully handle cases where a system may have multiple NICs.”h]”hX,Alternatively, if the application uses SO_REUSEPORT, a bpf or ebpf program can be inserted to distribute incoming connections to threads such that each thread is only given incoming connections with the same NAPI ID. Care must be taken to carefully handle cases where a system may have multiple NICs.”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M hjóh²hubhì)�”}”(hŒ7In order to enable busy polling, there are two choices:”h]”hŒ7In order to enable busy polling, there are two choices:”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M%hjóh²hubhŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hX*``/proc/sys/net/core/busy_poll`` can be set with a time in useconds to busy loop waiting for events. This is a system-wide setting and will cause all epoll-based applications to busy poll when they call epoll_wait. This may not be desirable as many applications may not have the need to busy poll. ”h]”hì)�”}”(hX)``/proc/sys/net/core/busy_poll`` can be set with a time in useconds to busy loop waiting for events. This is a system-wide setting and will cause all epoll-based applications to busy poll when they call epoll_wait. This may not be desirable as many applications may not have the need to busy poll.”h]”(jù)�”}”(hŒ ``/proc/sys/net/core/busy_poll``”h]”hŒ/proc/sys/net/core/busy_poll”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjYubhX  can be set with a time in useconds to busy loop waiting for events. This is a system-wide setting and will cause all epoll-based applications to busy poll when they call epoll_wait. This may not be desirable as many applications may not have the need to busy poll.”…”�”}”(hjYh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M'hjUubah}”(h]”h ]”h"]”h$]”h&]”uh1jShjPh²hh³hÇh´NubjT)�”}”(hŒÓApplications using recent kernels can issue an ioctl on the epoll context file descriptor to set (``EPIOCSPARAMS``) or get (``EPIOCGPARAMS``) ``struct epoll_params``:, which user programs can define as follows: ”h]”hì)�”}”(hŒÒApplications using recent kernels can issue an ioctl on the epoll context file descriptor to set (``EPIOCSPARAMS``) or get (``EPIOCGPARAMS``) ``struct epoll_params``:, which user programs can define as follows:”h]”(hŒbApplications using recent kernels can issue an ioctl on the epoll context file descriptor to set (”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ``EPIOCSPARAMS``”h]”hŒ EPIOCSPARAMS”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒ ) or get (”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ``EPIOCGPARAMS``”h]”hŒ EPIOCGPARAMS”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒ) ”…”�”}”(hjh²hh³Nh´Nubjù)�”}”(hŒ``struct epoll_params``”h]”hŒstruct epoll_params”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjubhŒ-:, which user programs can define as follows:”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M,hj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShjPh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jNhjóh²hh³hÇh´M'ubj:)�”}”(hŒ¸struct epoll_params { uint32_t busy_poll_usecs; uint16_t busy_poll_budget; uint8_t prefer_busy_poll; /* pad the struct to a multiple of 64bits */ uint8_t __pad; };”h]”hŒ¸struct epoll_params { uint32_t busy_poll_usecs; uint16_t busy_poll_budget; uint8_t prefer_busy_poll; /* pad the struct to a multiple of 64bits */ uint8_t __pad; };”…”�”}”hjÔsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJjKjL}”uh1j9h³hÇh´M0hjóh²hubeh}”(h]”Œepoll-based-busy-polling”ah ]”h"]”Œepoll-based busy polling”ah$]”h&]”uh1hÖhj°h²hh³hÇh´Mubh×)�”}”(hhh]”(hÜ)�”}”(hŒIRQ mitigation”h]”hŒIRQ mitigation”…”�”}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjëh²hh³hÇh´M<ubhì)�”}”(hŒzWhile busy polling is supposed to be used by low latency applications, a similar mechanism can be used for IRQ mitigation.”h]”hŒzWhile busy polling is supposed to be used by low latency applications, a similar mechanism can be used for IRQ mitigation.”…”�”}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M>hjëh²hubhì)�”}”(hŒäVery high request-per-second applications (especially routing/forwarding applications and especially applications using AF_XDP sockets) may not want to be interrupted until they finish processing a request or a batch of packets.”h]”hŒäVery high request-per-second applications (especially routing/forwarding applications and especially applications using AF_XDP sockets) may not want to be interrupted until they finish processing a request or a batch of packets.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MAhjëh²hubhì)�”}”(hX=Such applications can pledge to the kernel that they will perform a busy polling operation periodically, and the driver should keep the device IRQs permanently masked. This mode is enabled by using the ``SO_PREFER_BUSY_POLL`` socket option. To avoid system misbehavior the pledge is revoked if ``gro_flush_timeout`` passes without any busy poll call. For epoll-based busy polling applications, the ``prefer_busy_poll`` field of ``struct epoll_params`` can be set to 1 and the ``EPIOCSPARAMS`` ioctl can be issued to enable this mode. See the above section for more details.”h]”(hŒÊSuch applications can pledge to the kernel that they will perform a busy polling operation periodically, and the driver should keep the device IRQs permanently masked. This mode is enabled by using the ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``SO_PREFER_BUSY_POLL``”h]”hŒSO_PREFER_BUSY_POLL”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒE socket option. To avoid system misbehavior the pledge is revoked if ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hj2 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒS passes without any busy poll call. For epoll-based busy polling applications, the ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``prefer_busy_poll``”h]”hŒprefer_busy_poll”…”�”}”(hjD h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒ field of ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``struct epoll_params``”h]”hŒstruct epoll_params”…”�”}”(hjV h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒ can be set to 1 and the ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``EPIOCSPARAMS``”h]”hŒ EPIOCSPARAMS”…”�”}”(hjh h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒQ ioctl can be issued to enable this mode. See the above section for more details.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MFhjëh²hubhì)�”}”(hXÿThe NAPI budget for busy polling is lower than the default (which makes sense given the low latency intention of normal busy polling). This is not the case with IRQ mitigation, however, so the budget can be adjusted with the ``SO_BUSY_POLL_BUDGET`` socket option. For epoll-based busy polling applications, the ``busy_poll_budget`` field can be adjusted to the desired value in ``struct epoll_params`` and set on a specific epoll context using the ``EPIOCSPARAMS`` ioctl. See the above section for more details.”h]”(hŒáThe NAPI budget for busy polling is lower than the default (which makes sense given the low latency intention of normal busy polling). This is not the case with IRQ mitigation, however, so the budget can be adjusted with the ”…”�”}”(hj€ h²hh³Nh´Nubjù)�”}”(hŒ``SO_BUSY_POLL_BUDGET``”h]”hŒSO_BUSY_POLL_BUDGET”…”�”}”(hjˆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj€ ubhŒ? socket option. For epoll-based busy polling applications, the ”…”�”}”(hj€ h²hh³Nh´Nubjù)�”}”(hŒ``busy_poll_budget``”h]”hŒbusy_poll_budget”…”�”}”(hjš h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj€ ubhŒ/ field can be adjusted to the desired value in ”…”�”}”(hj€ h²hh³Nh´Nubjù)�”}”(hŒ``struct epoll_params``”h]”hŒstruct epoll_params”…”�”}”(hj¬ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj€ ubhŒ/ and set on a specific epoll context using the ”…”�”}”(hj€ h²hh³Nh´Nubjù)�”}”(hŒ``EPIOCSPARAMS``”h]”hŒ EPIOCSPARAMS”…”�”}”(hj¾ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj€ ubhŒ/ ioctl. See the above section for more details.”…”�”}”(hj€ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MOhjëh²hubhì)�”}”(hX?It is important to note that choosing a large value for ``gro_flush_timeout`` will defer IRQs to allow for better batch processing, but will induce latency when the system is not fully loaded. Choosing a small value for ``gro_flush_timeout`` can cause interference of the user application which is attempting to busy poll by device IRQs and softirq processing. This value should be chosen carefully with these tradeoffs in mind. epoll-based busy polling applications may be able to mitigate how much user processing happens by choosing an appropriate value for ``maxevents``.”h]”(hŒ8It is important to note that choosing a large value for ”…”�”}”(hjÖ h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjÞ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÖ ubhŒ� will defer IRQs to allow for better batch processing, but will induce latency when the system is not fully loaded. Choosing a small value for ”…”�”}”(hjÖ h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjð h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÖ ubhX@ can cause interference of the user application which is attempting to busy poll by device IRQs and softirq processing. This value should be chosen carefully with these tradeoffs in mind. epoll-based busy polling applications may be able to mitigate how much user processing happens by choosing an appropriate value for ”…”�”}”(hjÖ h²hh³Nh´Nubjù)�”}”(hŒ ``maxevents``”h]”hŒ maxevents”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÖ ubhŒ.”…”�”}”(hjÖ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MWhjëh²hubhì)�”}”(hŒdUsers may want to consider an alternate approach, IRQ suspension, to help deal with these tradeoffs.”h]”hŒdUsers may want to consider an alternate approach, IRQ suspension, to help deal with these tradeoffs.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M`hjëh²hubeh}”(h]”Œirq-mitigation”ah ]”h"]”Œirq mitigation”ah$]”h&]”uh1hÖhj°h²hh³hÇh´M<ubh×)�”}”(hhh]”(hÜ)�”}”(hŒIRQ suspension”h]”hŒIRQ suspension”…”�”}”(hj3 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj0 h²hh³hÇh´Mdubhì)�”}”(hŒiIRQ suspension is a mechanism wherein device IRQs are masked while epoll triggers NAPI packet processing.”h]”hŒiIRQ suspension is a mechanism wherein device IRQs are masked while epoll triggers NAPI packet processing.”…”�”}”(hjA h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mfhj0 h²hubhì)�”}”(hXCWhile application calls to epoll_wait successfully retrieve events, the kernel will defer the IRQ suspension timer. If the kernel does not retrieve any events while busy polling (for example, because network traffic levels subsided), IRQ suspension is disabled and the IRQ mitigation strategies described above are engaged.”h]”hXCWhile application calls to epoll_wait successfully retrieve events, the kernel will defer the IRQ suspension timer. If the kernel does not retrieve any events while busy polling (for example, because network traffic levels subsided), IRQ suspension is disabled and the IRQ mitigation strategies described above are engaged.”…”�”}”(hjO h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mihj0 h²hubhì)�”}”(hŒPThis allows users to balance CPU consumption with network processing efficiency.”h]”hŒPThis allows users to balance CPU consumption with network processing efficiency.”…”�”}”(hj] h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mohj0 h²hubhì)�”}”(hŒTo use this mechanism:”h]”hŒTo use this mechanism:”…”�”}”(hjk h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mrhj0 h²hubhŒ block_quote”“”)�”}”(hXó1. The per-NAPI config parameter ``irq-suspend-timeout`` should be set to the maximum time (in nanoseconds) the application can have its IRQs suspended. This is done using netlink, as described above. This timeout serves as a safety mechanism to restart IRQ driver interrupt processing if the application has stalled. This value should be chosen so that it covers the amount of time the user application needs to process data from its call to epoll_wait, noting that applications can control how much data they retrieve by setting ``maxevents`` when calling epoll_wait. 2. The sysfs parameter or per-NAPI config parameters ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` can be set to low values. They will be used to defer IRQs after busy poll has found no data. 3. The ``prefer_busy_poll`` flag must be set to true. This can be done using the ``EPIOCSPARAMS`` ioctl as described above. 4. The application uses epoll as described above to trigger NAPI packet processing. ”h]”jO)�”}”(hhh]”(jT)�”}”(hX7The per-NAPI config parameter ``irq-suspend-timeout`` should be set to the maximum time (in nanoseconds) the application can have its IRQs suspended. This is done using netlink, as described above. This timeout serves as a safety mechanism to restart IRQ driver interrupt processing if the application has stalled. This value should be chosen so that it covers the amount of time the user application needs to process data from its call to epoll_wait, noting that applications can control how much data they retrieve by setting ``maxevents`` when calling epoll_wait. ”h]”hì)�”}”(hX6The per-NAPI config parameter ``irq-suspend-timeout`` should be set to the maximum time (in nanoseconds) the application can have its IRQs suspended. This is done using netlink, as described above. This timeout serves as a safety mechanism to restart IRQ driver interrupt processing if the application has stalled. This value should be chosen so that it covers the amount of time the user application needs to process data from its call to epoll_wait, noting that applications can control how much data they retrieve by setting ``maxevents`` when calling epoll_wait.”h]”(hŒThe per-NAPI config parameter ”…”�”}”(hj† h²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hjŽ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj† ubhXÛ should be set to the maximum time (in nanoseconds) the application can have its IRQs suspended. This is done using netlink, as described above. This timeout serves as a safety mechanism to restart IRQ driver interrupt processing if the application has stalled. This value should be chosen so that it covers the amount of time the user application needs to process data from its call to epoll_wait, noting that applications can control how much data they retrieve by setting ”…”�”}”(hj† h²hh³Nh´Nubjù)�”}”(hŒ ``maxevents``”h]”hŒ maxevents”…”�”}”(hj  h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj† ubhŒ when calling epoll_wait.”…”�”}”(hj† h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mthj‚ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShj ubjT)�”}”(hŒÂThe sysfs parameter or per-NAPI config parameters ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` can be set to low values. They will be used to defer IRQs after busy poll has found no data. ”h]”hì)�”}”(hŒÁThe sysfs parameter or per-NAPI config parameters ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` can be set to low values. They will be used to defer IRQs after busy poll has found no data.”h]”(hŒ2The sysfs parameter or per-NAPI config parameters ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjÊ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒ and ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hjÜ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒ] can be set to low values. They will be used to defer IRQs after busy poll has found no data.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M}hj¾ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShj ubjT)�”}”(hŒyThe ``prefer_busy_poll`` flag must be set to true. This can be done using the ``EPIOCSPARAMS`` ioctl as described above. ”h]”hì)�”}”(hŒxThe ``prefer_busy_poll`` flag must be set to true. This can be done using the ``EPIOCSPARAMS`` ioctl as described above.”h]”(hŒThe ”…”�”}”(hjþ h²hh³Nh´Nubjù)�”}”(hŒ``prefer_busy_poll``”h]”hŒprefer_busy_poll”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjþ ubhŒ6 flag must be set to true. This can be done using the ”…”�”}”(hjþ h²hh³Nh´Nubjù)�”}”(hŒ``EPIOCSPARAMS``”h]”hŒ EPIOCSPARAMS”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjþ ubhŒ ioctl as described above.”…”�”}”(hjþ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M�hjú ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShj ubjT)�”}”(hŒQThe application uses epoll as described above to trigger NAPI packet processing. ”h]”hì)�”}”(hŒPThe application uses epoll as described above to trigger NAPI packet processing.”h]”hŒPThe application uses epoll as described above to trigger NAPI packet processing.”…”�”}”(hj: h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M„hj6 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShj ubeh}”(h]”h ]”h"]”h$]”h&]”jÏjÐjÑhjÒjÓuh1jNhj{ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jy h³hÇh´Mthj0 h²hubhì)�”}”(hŒÙAs mentioned above, as long as subsequent calls to epoll_wait return events to userland, the ``irq-suspend-timeout`` is deferred and IRQs are disabled. This allows the application to process data without interference.”h]”(hŒ]As mentioned above, as long as subsequent calls to epoll_wait return events to userland, the ”…”�”}”(hjZ h²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hjb h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjZ ubhŒe is deferred and IRQs are disabled. This allows the application to process data without interference.”…”�”}”(hjZ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M‡hj0 h²hubhì)�”}”(hŒÀOnce a call to epoll_wait results in no events being found, IRQ suspension is automatically disabled and the ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` mitigation mechanisms take over.”h]”(hŒmOnce a call to epoll_wait results in no events being found, IRQ suspension is automatically disabled and the ”…”�”}”(hjz h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hj‚ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjz ubhŒ and ”…”�”}”(hjz h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hj” h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjz ubhŒ! mitigation mechanisms take over.”…”�”}”(hjz h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M‹hj0 h²hubhì)�”}”(hŒËIt is expected that ``irq-suspend-timeout`` will be set to a value much larger than ``gro_flush_timeout`` as ``irq-suspend-timeout`` should suspend IRQs for the duration of one userland processing cycle.”h]”(hŒIt is expected that ”…”�”}”(hj¬ h²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hj´ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj¬ ubhŒ) will be set to a value much larger than ”…”�”}”(hj¬ h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjÆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj¬ ubhŒ as ”…”�”}”(hj¬ h²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hjØ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj¬ ubhŒG should suspend IRQs for the duration of one userland processing cycle.”…”�”}”(hj¬ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M�hj0 h²hubhì)�”}”(hŒ–While it is not strictly necessary to use ``napi_defer_hard_irqs`` and ``gro_flush_timeout`` to use IRQ suspension, their use is strongly recommended.”h]”(hŒ*While it is not strictly necessary to use ”…”�”}”(hjð h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hjø h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjð ubhŒ and ”…”�”}”(hjð h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjð ubhŒ: to use IRQ suspension, their use is strongly recommended.”…”�”}”(hjð h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M“hj0 h²hubhì)�”}”(hXMIRQ suspension causes the system to alternate between polling mode and irq-driven packet delivery. During busy periods, ``irq-suspend-timeout`` overrides ``gro_flush_timeout`` and keeps the system busy polling, but when epoll finds no events, the setting of ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` determine the next step.”h]”(hŒxIRQ suspension causes the system to alternate between polling mode and irq-driven packet delivery. During busy periods, ”…”�”}”(hj" h²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hj* h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj" ubhŒ overrides ”…”�”}”(hj" h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hj< h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj" ubhŒS and keeps the system busy polling, but when epoll finds no events, the setting of ”…”�”}”(hj" h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjN h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj" ubhŒ and ”…”�”}”(hj" h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hj` h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj" ubhŒ determine the next step.”…”�”}”(hj" h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M—hj0 h²hubhì)�”}”(hŒVThere are essentially three possible loops for network processing and packet delivery:”h]”hŒVThere are essentially three possible loops for network processing and packet delivery:”…”�”}”(hjx h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M�hj0 h²hubjO)�”}”(hhh]”(jT)�”}”(hŒ9hardirq -> softirq -> napi poll; basic interrupt delivery”h]”hì)�”}”(hj‹ h]”hŒ9hardirq -> softirq -> napi poll; basic interrupt delivery”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M hj‰ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShj† h²hh³hÇh´NubjT)�”}”(hŒ6timer -> softirq -> napi poll; deferred irq processing”h]”hì)�”}”(hj¢ h]”hŒ6timer -> softirq -> napi poll; deferred irq processing”…”�”}”(hj¤ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M¡hj  ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShj† h²hh³hÇh´NubjT)�”}”(hŒ.epoll -> busy-poll -> napi poll; busy looping ”h]”hì)�”}”(hŒ-epoll -> busy-poll -> napi poll; busy looping”h]”hŒ-epoll -> busy-poll -> napi poll; busy looping”…”�”}”(hj» h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M¢hj· ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShj† h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÏjÐjÑhjÒŒ)”uh1jNhj0 h²hh³hÇh´M ubhì)�”}”(hŒcLoop 2 can take control from Loop 1, if ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` are set.”h]”(hŒ(Loop 2 can take control from Loop 1, if ”…”�”}”(hjÖ h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjÞ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÖ ubhŒ and ”…”�”}”(hjÖ h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hjð h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÖ ubhŒ are set.”…”�”}”(hjÖ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M¤hj0 h²hubhì)�”}”(hŒsIf ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` are set, Loops 2 and 3 "wrestle" with each other for control.”h]”(hŒIf ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒ and ”…”�”}”(hj h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hj" h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj ubhŒB are set, Loops 2 and 3 “wrestleâ€� with each other for control.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M§hj0 h²hubhì)�”}”(hŒˆDuring busy periods, ``irq-suspend-timeout`` is used as timer in Loop 2, which essentially tilts network processing in favour of Loop 3.”h]”(hŒDuring busy periods, ”…”�”}”(hj: h²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hjB h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhj: ubhŒ\ is used as timer in Loop 2, which essentially tilts network processing in favour of Loop 3.”…”�”}”(hj: h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mªhj0 h²hubhì)�”}”(hŒjIf ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` are not set, Loop 3 cannot take control from Loop 1.”h]”(hŒIf ”…”�”}”(hjZ h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hjb h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjZ ubhŒ and ”…”�”}”(hjZ h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hjt h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjZ ubhŒ5 are not set, Loop 3 cannot take control from Loop 1.”…”�”}”(hjZ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M­hj0 h²hubhì)�”}”(hŒ¸Therefore, setting ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` is the recommended usage, because otherwise setting ``irq-suspend-timeout`` might not have any discernible effect.”h]”(hŒTherefore, setting ”…”�”}”(hjŒ h²hh³Nh´Nubjù)�”}”(hŒ``gro_flush_timeout``”h]”hŒgro_flush_timeout”…”�”}”(hj” h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjŒ ubhŒ and ”…”�”}”(hjŒ h²hh³Nh´Nubjù)�”}”(hŒ``napi_defer_hard_irqs``”h]”hŒnapi_defer_hard_irqs”…”�”}”(hj¦ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjŒ ubhŒ5 is the recommended usage, because otherwise setting ”…”�”•J0}”(hjŒ h²hh³Nh´Nubjù)�”}”(hŒ``irq-suspend-timeout``”h]”hŒirq-suspend-timeout”…”�”}”(hj¸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjŒ ubhŒ' might not have any discernible effect.”…”�”}”(hjŒ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M°hj0 h²hubhÉ)�”}”(hŒ.. _threaded_busy_poll:”h]”h}”(h]”h ]”h"]”h$]”h&]”hÔŒthreaded-busy-poll”uh1hÈh´M´hj0 h²hh³hÇubeh}”(h]”Œirq-suspension”ah ]”h"]”Œirq suspension”ah$]”h&]”uh1hÖhj°h²hh³hÇh´Mdubh×)�”}”(hhh]”(hÜ)�”}”(hŒThreaded NAPI busy polling”h]”hŒThreaded NAPI busy polling”…”�”}”(hjæ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjã h²hh³hÇh´M·ubhì)�”}”(hŒ¦Threaded NAPI busy polling extends threaded NAPI and adds support to do continuous busy polling of the NAPI. This can be useful for forwarding or AF_XDP applications.”h]”hŒ¦Threaded NAPI busy polling extends threaded NAPI and adds support to do continuous busy polling of the NAPI. This can be useful for forwarding or AF_XDP applications.”…”�”}”(hjô h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M¹hjã h²hubhì)�”}”(hŒOThreaded NAPI busy polling can be enabled on per NIC queue basis using Netlink.”h]”hŒOThreaded NAPI busy polling can be enabled on per NIC queue basis using Netlink.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M½hjã h²hubhì)�”}”(hŒ(For example, using the following script:”h]”hŒ(For example, using the following script:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M¿hjã h²hubj:)�”}”(hŒ\$ ynl --family netdev --do napi-set \ --json='{"id": 66, "threaded": "busy-poll"}'”h]”hŒ\$ ynl --family netdev --do napi-set \ --json='{"id": 66, "threaded": "busy-poll"}'”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJŒbash”jL}”uh1j9h³hÇh´MÁhjã h²hubhì)�”}”(hŒ>The kernel will create a kthread that busy polls on this NAPI.”h]”hŒ>The kernel will create a kthread that busy polls on this NAPI.”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MÆhjã h²hubhì)�”}”(hŒÙThe user may elect to set the CPU affinity of this kthread to an unused CPU core to improve how often the NAPI is polled at the expense of wasted CPU cycles. Note that this will keep the CPU core busy with 100% usage.”h]”hŒÙThe user may elect to set the CPU affinity of this kthread to an unused CPU core to improve how often the NAPI is polled at the expense of wasted CPU cycles. Note that this will keep the CPU core busy with 100% usage.”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MÈhjã h²hubhì)�”}”(hŒ‘Once threaded busy polling is enabled for a NAPI, PID of the kthread can be retrieved using Netlink so the affinity of the kthread can be set up.”h]”hŒ‘Once threaded busy polling is enabled for a NAPI, PID of the kthread can be retrieved using Netlink so the affinity of the kthread can be set up.”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MÌhjã h²hubhì)�”}”(hŒ?For example, the following script can be used to fetch the PID:”h]”hŒ?For example, the following script can be used to fetch the PID:”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MÏhjã h²hubj:)�”}”(hŒ7$ ynl --family netdev --do napi-get --json='{"id": 66}'”h]”hŒ7$ ynl --family netdev --do napi-get --json='{"id": 66}'”…”�”}”hjfsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJŒbash”jL}”uh1j9h³hÇh´MÑhjã h²hubhì)�”}”(hŒmThis will output something like following, the pid `258` is the PID of the kthread that is polling this NAPI.”h]”(hŒ3This will output something like following, the pid ”…”�”}”(hjvh²hh³Nh´NubhŒtitle_reference”“”)�”}”(hŒ`258`”h]”hŒ258”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j~hjvubhŒ5 is the PID of the kthread that is polling this NAPI.”…”�”}”(hjvh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MÕhjã h²hubj:)�”}”(hŒ™$ {'defer-hard-irqs': 0, 'gro-flush-timeout': 0, 'id': 66, 'ifindex': 2, 'irq-suspend-timeout': 0, 'pid': 258, 'threaded': 'busy-poll'}”h]”hŒ™$ {'defer-hard-irqs': 0, 'gro-flush-timeout': 0, 'id': 66, 'ifindex': 2, 'irq-suspend-timeout': 0, 'pid': 258, 'threaded': 'busy-poll'}”…”�”}”hj˜sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJŒbash”jL}”uh1j9h³hÇh´MØhjã h²hubhÉ)�”}”(hŒ .. _threaded:”h]”h}”(h]”h ]”h"]”h$]”h&]”hÔŒthreaded”uh1hÈh´Mâhjã h²hh³hÇubeh}”(h]”(Œthreaded-napi-busy-polling”jÚ eh ]”h"]”(Œthreaded napi busy polling”Œthreaded_busy_poll”eh$]”h&]”uh1hÖhj°h²hh³hÇh´M·j}”j¹jÐ sj}”jÚ jÐ subh×)�”}”(hhh]”(hÜ)�”}”(hŒ Threaded NAPI”h]”hŒ Threaded NAPI”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj¾h²hh³hÇh´Måubhì)�”}”(hŒÞThreaded NAPI is an operating mode that uses dedicated kernel threads rather than software IRQ context for NAPI processing. Each threaded NAPI instance will spawn a separate thread (called ``napi/${ifc-name}-${napi-id}``).”h]”(hŒ½Threaded NAPI is an operating mode that uses dedicated kernel threads rather than software IRQ context for NAPI processing. Each threaded NAPI instance will spawn a separate thread (called ”…”�”}”(hjÏh²hh³Nh´Nubjù)�”}”(hŒ``napi/${ifc-name}-${napi-id}``”h]”hŒnapi/${ifc-name}-${napi-id}”…”�”}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjÏubhŒ).”…”�”}”(hjÏh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mçhj¾h²hubhì)�”}”(hX?It is recommended to pin each kernel thread to a single CPU, the same CPU as the CPU which services the interrupt. Note that the mapping between IRQs and NAPI instances may not be trivial (and is driver dependent). The NAPI instance IDs will be assigned in the opposite order than the process IDs of the kernel threads.”h]”hX?It is recommended to pin each kernel thread to a single CPU, the same CPU as the CPU which services the interrupt. Note that the mapping between IRQs and NAPI instances may not be trivial (and is driver dependent). The NAPI instance IDs will be assigned in the opposite order than the process IDs of the kernel threads.”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mìhj¾h²hubhì)�”}”(hŒ¤Threaded NAPI is controlled by writing 0/1 to the ``threaded`` file in netdev's sysfs directory. It can also be enabled for a specific NAPI using netlink interface.”h]”(hŒ2Threaded NAPI is controlled by writing 0/1 to the ”…”�”}”(hjýh²hh³Nh´Nubjù)�”}”(hŒ ``threaded``”h]”hŒthreaded”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jøhjýubhŒh file in netdev’s sysfs directory. It can also be enabled for a specific NAPI using netlink interface.”…”�”}”(hjýh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mòhj¾h²hubhì)�”}”(hŒFor example, using the script:”h]”hŒFor example, using the script:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Möhj¾h²hubj:)�”}”(hŒF$ ynl --family netdev --do napi-set --json='{"id": 66, "threaded": 1}'”h]”hŒF$ ynl --family netdev --do napi-set --json='{"id": 66, "threaded": 1}'”…”�”}”hj+sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjI‰jJŒbash”jL}”uh1j9h³hÇh´Møhj¾h²hubhŒrubric”“”)�”}”(hŒ Footnotes”h]”hŒ Footnotes”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj¾h²hh³hÇh´MýubhŒfootnote”“”)�”}”(hŒ8NAPI was originally referred to as New API in 2.4 Linux.”h]”(hŒlabel”“”)�”}”(hhh]”hŒ1”…”�”}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jQhjMh²hh³Nh´Nubhì)�”}”(hjOh]”hŒ8NAPI was originally referred to as New API in 2.4 Linux.”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MþhjMubeh}”(h]”jah ]”h"]”Œ1”ah$]”h&]”jajKjj uh1jKh³hÇh´Mþhj¾h²hubeh}”(h]”(Œ threaded-napi”j²eh ]”h"]”(Œ threaded napi”Œthreaded”eh$]”h&]”uh1hÖhj°h²hh³hÇh´Måj}”jzj¨sj}”j²j¨subeh}”(h]”Œuser-api”ah ]”h"]”Œuser api”ah$]”h&]”uh1hÖhhØh²hh³hÇh´KÂubeh}”(h]”(hÕŒid1”eh ]”h"]”Œnapi”ah$]”Œnapi”ah&]”uh1hÖhhh²hh³hÇh´KŒ referenced”Kj}”jŒhÊsj}”hÕhÊsubeh}”(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”}”(hÕ]”hÊaj´]”jªaj]”jùajX]”jNajÚ ]”jÐ aj²]”j¨aj]”h÷auŒnameids”}”(jŒhÕj­jªjj´jjj¥j¢j jj‘jj�j�jPjMj¥j¢j„j�j^j[jîjXjíjêjèjåj- j* jà jÝ j¹jÚ j¸jµjzj²jyjvjqjuŒ nametypes”}”(jŒˆj­‰jˆj‰j¥‰j ‰j‘ˆj�‰jP‰j¥‰j„‰j^‰jîˆjí‰jè‰j- ‰jà ‰j¹ˆj¸‰jzˆjy‰jqˆuh}”(hÕhØj‰hØjh÷jªj‹j´jµjjµj¢jjj¨jj j�j jMj–j¢jSj�j°j[j?jXjajêjajåjój* jëjÝ j0 jÚ jã jµjã j²j¾jvj¾jjMuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”jMaŒautofootnote_refs”]”h÷aŒsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jÄKs…”R”Œparse_messages”]”hŒsystem_message”“”)�”}”(hhh]”hì)�”}”(hŒ'Duplicate implicit target name: "napi".”h]”hŒ+Duplicate implicit target name: “napiâ€�.”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëhj!ubah}”(h]”h ]”h"]”h$]”h&]”j‰aŒlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1jhhØh²hh³hÇh´KubaŒtransform_messages”]”(j )�”}”(hhh]”hì)�”}”(hhh]”hŒ*Hyperlink target "napi" is not referenced.”…”�”}”hjBsbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhj?ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j:Œsource”hÇŒline”Kuh1jubj )�”}”(hhh]”hì)�”}”(hhh]”hŒ.Hyperlink target "drv-ctrl" is not referenced.”…”�”}”hj\sbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhjYubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j:Œsource”hÇŒline”K"uh1jubj )�”}”(hhh]”hì)�”}”(hhh]”hŒ/Hyperlink target "drv-sched" is not referenced.”…”�”}”hjvsbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhjsubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j:Œsource”hÇŒline”Kwuh1jubj )�”}”(hhh]”hì)�”}”(hhh]”hŒ*Hyperlink target "poll" is not referenced.”…”�”}”hj�sbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhj�ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j:Œsource”hÇŒline”Muh1jubj )�”}”(hhh]”hì)�”}”(hhh]”hŒ8Hyperlink target "threaded-busy-poll" is not referenced.”…”�”}”hjªsbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhj§ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j:Œsource”hÇŒline”M´uh1jubj )�”}”(hhh]”hì)�”}”(hhh]”hŒ.Hyperlink target "threaded" is not referenced.”…”�”}”hjÄsbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhjÁubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j:Œsource”hÇŒline”Mâuh1jubeŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.