€• WŒ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/netmem”Œ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/netmem”Œ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/netmem”Œ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/netmem”Œ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/netmem”Œ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/netmem”Œ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/netmem”Œ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³Œ?/var/lib/git/docbuild/linux/Documentation/networking/netmem.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ"Netmem Support for Network Drivers”h]”hŒ"Netmem Support for Network Drivers”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)”}”(hXThis document outlines the requirements for network drivers to support netmem, an abstract memory type that enables features like device memory TCP. By supporting netmem, drivers can work with various underlying memory types with little to no modification.”h]”hXThis document outlines the requirements for network drivers to support netmem, an abstract memory type that enables features like device memory TCP. By supporting netmem, drivers can work with various underlying memory types with little to no modification.”…””}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)”}”(hŒBenefits of Netmem :”h]”hŒBenefits of Netmem :”…””}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ¢Flexibility: Netmem can be backed by different memory types (e.g., struct page, DMA-buf), allowing drivers to support various use cases such as device memory TCP.”h]”hÞ)”}”(hŒ¢Flexibility: Netmem can be backed by different memory types (e.g., struct page, DMA-buf), allowing drivers to support various use cases such as device memory TCP.”h]”hŒ¢Flexibility: Netmem can be backed by different memory types (e.g., struct page, DMA-buf), allowing drivers to support various use cases such as device memory TCP.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhýh²hh³hÇh´Nubj)”}”(hŒZFuture-proof: Drivers with netmem support are ready for upcoming features that rely on it.”h]”hÞ)”}”(hŒZFuture-proof: Drivers with netmem support are ready for upcoming features that rely on it.”h]”hŒZFuture-proof: Drivers with netmem support are ready for upcoming features that rely on it.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhýh²hh³hÇh´Nubj)”}”(hŒtSimplified Development: Drivers interact with a consistent API, regardless of the underlying memory implementation. ”h]”hÞ)”}”(hŒsSimplified Development: Drivers interact with a consistent API, regardless of the underlying memory implementation.”h]”hŒsSimplified Development: Drivers interact with a consistent API, regardless of the underlying memory implementation.”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj2ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhýh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1hûh³hÇh´KhhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒDriver RX Requirements”h]”hŒDriver RX Requirements”…””}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjRh²hh³hÇh´KubhŒenumerated_list”“”)”}”(hhh]”(j)”}”(hŒ#The driver must support page_pool. ”h]”hÞ)”}”(hŒ"The driver must support page_pool.”h]”hŒ"The driver must support page_pool.”…””}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjhubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjeh²hh³hÇh´Nubj)”}”(hŒ;The driver must support the tcp-data-split ethtool option. ”h]”hÞ)”}”(hŒ:The driver must support the tcp-data-split ethtool option.”h]”hŒ:The driver must support the tcp-data-split ethtool option.”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjeh²hh³hÇh´Nubj)”}”(hX¤The driver must use the page_pool netmem APIs for payload memory. The netmem APIs currently 1-to-1 correspond with page APIs. Conversion to netmem should be achievable by switching the page APIs to netmem APIs and tracking memory via netmem_refs in the driver rather than struct page * : - page_pool_alloc -> page_pool_alloc_netmem - page_pool_get_dma_addr -> page_pool_get_dma_addr_netmem - page_pool_put_page -> page_pool_put_netmem Not all page APIs have netmem equivalents at the moment. If your driver relies on a missing netmem API, feel free to add and propose to netdev@, or reach out to the maintainers and/or almasrymina@google.com for help adding the netmem API. ”h]”(hÞ)”}”(hXThe driver must use the page_pool netmem APIs for payload memory. The netmem APIs currently 1-to-1 correspond with page APIs. Conversion to netmem should be achievable by switching the page APIs to netmem APIs and tracking memory via netmem_refs in the driver rather than struct page * :”h]”hXThe driver must use the page_pool netmem APIs for payload memory. The netmem APIs currently 1-to-1 correspond with page APIs. Conversion to netmem should be achievable by switching the page APIs to netmem APIs and tracking memory via netmem_refs in the driver rather than struct page * :”…””}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj˜ubhü)”}”(hhh]”(j)”}”(hŒ)page_pool_alloc -> page_pool_alloc_netmem”h]”hÞ)”}”(hj¯h]”hŒ)page_pool_alloc -> page_pool_alloc_netmem”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K"hj­ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjªubj)”}”(hŒ7page_pool_get_dma_addr -> page_pool_get_dma_addr_netmem”h]”hÞ)”}”(hjÆh]”hŒ7page_pool_get_dma_addr -> page_pool_get_dma_addr_netmem”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K#hjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjªubj)”}”(hŒ+page_pool_put_page -> page_pool_put_netmem ”h]”hÞ)”}”(hŒ*page_pool_put_page -> page_pool_put_netmem”h]”hŒ*page_pool_put_page -> page_pool_put_netmem”…””}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K$hjÛubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjªubeh}”(h]”h ]”h"]”h$]”h&]”jPŒ-”uh1hûh³hÇh´K"hj˜ubhÞ)”}”(hŒîNot all page APIs have netmem equivalents at the moment. If your driver relies on a missing netmem API, feel free to add and propose to netdev@, or reach out to the maintainers and/or almasrymina@google.com for help adding the netmem API.”h]”(hŒ¸Not all page APIs have netmem equivalents at the moment. If your driver relies on a missing netmem API, feel free to add and propose to netdev@, or reach out to the maintainers and/or ”…””}”(hjúh²hh³Nh´NubhŒ reference”“”)”}”(hŒalmasrymina@google.com”h]”hŒalmasrymina@google.com”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:almasrymina@google.com”uh1jhjúubhŒ for help adding the netmem API.”…””}”(hjúh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K&hj˜ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjeh²hh³hÇh´Nubj)”}”(hXThe driver must use the following PP_FLAGS: - PP_FLAG_DMA_MAP: netmem is not dma-mappable by the driver. The driver must delegate the dma mapping to the page_pool, which knows when dma-mapping is (or is not) appropriate. - PP_FLAG_DMA_SYNC_DEV: netmem dma addr is not necessarily dma-syncable by the driver. The driver must delegate the dma syncing to the page_pool, which knows when dma-syncing is (or is not) appropriate. - PP_FLAG_ALLOW_UNREADABLE_NETMEM. The driver must specify this flag iff tcp-data-split is enabled. ”h]”(hÞ)”}”(hŒ+The driver must use the following PP_FLAGS:”h]”hŒ+The driver must use the following PP_FLAGS:”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K+hj$ubhü)”}”(hhh]”(j)”}”(hŒ®PP_FLAG_DMA_MAP: netmem is not dma-mappable by the driver. The driver must delegate the dma mapping to the page_pool, which knows when dma-mapping is (or is not) appropriate.”h]”hÞ)”}”(hŒ®PP_FLAG_DMA_MAP: netmem is not dma-mappable by the driver. The driver must delegate the dma mapping to the page_pool, which knows when dma-mapping is (or is not) appropriate.”h]”hŒ®PP_FLAG_DMA_MAP: netmem is not dma-mappable by the driver. The driver must delegate the dma mapping to the page_pool, which knows when dma-mapping is (or is not) appropriate.”…””}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K-hj9ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj6ubj)”}”(hŒÈPP_FLAG_DMA_SYNC_DEV: netmem dma addr is not necessarily dma-syncable by the driver. The driver must delegate the dma syncing to the page_pool, which knows when dma-syncing is (or is not) appropriate.”h]”hÞ)”}”(hŒÈPP_FLAG_DMA_SYNC_DEV: netmem dma addr is not necessarily dma-syncable by the driver. The driver must delegate the dma syncing to the page_pool, which knows when dma-syncing is (or is not) appropriate.”h]”hŒÈPP_FLAG_DMA_SYNC_DEV: netmem dma addr is not necessarily dma-syncable by the driver. The driver must delegate the dma syncing to the page_pool, which knows when dma-syncing is (or is not) appropriate.”…””}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K0hjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj6ubj)”}”(hŒbPP_FLAG_ALLOW_UNREADABLE_NETMEM. The driver must specify this flag iff tcp-data-split is enabled. ”h]”hÞ)”}”(hŒaPP_FLAG_ALLOW_UNREADABLE_NETMEM. The driver must specify this flag iff tcp-data-split is enabled.”h]”hŒaPP_FLAG_ALLOW_UNREADABLE_NETMEM. The driver must specify this flag iff tcp-data-split is enabled.”…””}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K3hjiubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj6ubeh}”(h]”h ]”h"]”h$]”h&]”jPjùuh1hûh³hÇh´K-hj$ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjeh²hh³Nh´Nubj)”}”(hXlThe driver must not assume the netmem is readable and/or backed by pages. The netmem returned by the page_pool may be unreadable, in which case netmem_address() will return NULL. The driver must correctly handle unreadable netmem, i.e. don't attempt to handle its contents when netmem_address() is NULL. Ideally, drivers should not have to check the underlying netmem type via helpers like netmem_is_net_iov() or convert the netmem to any of its underlying types via netmem_to_page() or netmem_to_net_iov(). In most cases, netmem or page_pool helpers that abstract this complexity are provided (and more can be added). ”h]”(hÞ)”}”(hX/The driver must not assume the netmem is readable and/or backed by pages. The netmem returned by the page_pool may be unreadable, in which case netmem_address() will return NULL. The driver must correctly handle unreadable netmem, i.e. don't attempt to handle its contents when netmem_address() is NULL.”h]”hX1The driver must not assume the netmem is readable and/or backed by pages. The netmem returned by the page_pool may be unreadable, in which case netmem_address() will return NULL. The driver must correctly handle unreadable netmem, i.e. don’t attempt to handle its contents when netmem_address() is NULL.”…””}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K6hjubhÞ)”}”(hX:Ideally, drivers should not have to check the underlying netmem type via helpers like netmem_is_net_iov() or convert the netmem to any of its underlying types via netmem_to_page() or netmem_to_net_iov(). In most cases, netmem or page_pool helpers that abstract this complexity are provided (and more can be added).”h]”hX:Ideally, drivers should not have to check the underlying netmem type via helpers like netmem_is_net_iov() or convert the netmem to any of its underlying types via netmem_to_page() or netmem_to_net_iov(). In most cases, netmem or page_pool helpers that abstract this complexity are provided (and more can be added).”…””}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Knetmem_tx = true`”h]”hÞ)”}”(hjTh]”(hŒ)Driver should declare support by setting ”…””}”(hjVh²hh³Nh´NubhŒtitle_reference”“”)”}”(hŒ`netdev->netmem_tx = true`”h]”hŒnetdev->netmem_tx = true”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j]hjVubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KbhjRubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jéjêjëhjìjíuh1jchjöh²hh³hÇh´KTubeh}”(h]”Œdriver-tx-requirements”ah ]”h"]”Œdriver tx requirements”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KRubeh}”(h]”Œ"netmem-support-for-network-drivers”ah ]”h"]”Œ"netmem support for network drivers”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ðj„juŒ nametypes”}”(jŒ‰jó‰j„‰uh}”(j‰hÊjðjRjjöuŒ 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.