€•¼GŒ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Œ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.”…””}”(hhòhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khhîubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhhéhžhhŸh³h Nubhí)”}”(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.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhhéhžhhŸh³h Nubhí)”}”(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.”…””}”(hj"hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhhéhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1hçhŸh³h Khh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒDriver Requirements”h]”hŒDriver Requirements”…””}”(hjAhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj>hžhhŸh³h KubhŒenumerated_list”“”)”}”(hhh]”(hí)”}”(hŒ#The driver must support page_pool. ”h]”hÊ)”}”(hŒ"The driver must support page_pool.”h]”hŒ"The driver must support page_pool.”…””}”(hjXhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhjTubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhjQhžhhŸh³h Nubhí)”}”(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.”…””}”(hjphžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khjlubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhjQhžhhŸh³h Nubhí)”}”(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]”(hí)”}”(hŒ)page_pool_alloc -> page_pool_alloc_netmem”h]”hÊ)”}”(hj›h]”hŒ)page_pool_alloc -> page_pool_alloc_netmem”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K"hj™ubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhj–ubhí)”}”(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&]”uh1hìhj–ubhí)”}”(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&]”uh1hìhj–ubeh}”(h]”h ]”h"]”h$]”h&]”j<Œ-”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”…””}”(hjðhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:almasrymina@google.com”uh1jîhjæ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&]”uh1hìhjQhžhhŸh³h Nubhí)”}”(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:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K+hjubhè)”}”(hhh]”(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Ê)”}”(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-hj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhj"ubhí)”}”(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.”…””}”(hjAhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K0hj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhj"ubhí)”}”(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.”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K3hjUubah}”(h]”h ]”h"]”h$]”h&]”uh1hìhj"ubeh}”(h]”h ]”h"]”h$]”h&]”j<jåuh1hçhŸh³h K-hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hìhjQhžhhŸNh Nubhí)”}”(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 K6hjyubhÊ)”}”(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 KhžhhŸh³h Kubeh}”(h]”Œdriver-requirements”ah ]”h"]”Œdriver requirements”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubeh}”(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ÜuŒ nametypes”}”(jç‰j߉uh}”(jäh¶jÜj>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.