€•9;Œ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/infiniband/user_verbs”Œ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/infiniband/user_verbs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/infiniband/user_verbs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/infiniband/user_verbs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/infiniband/user_verbs”Œ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/infiniband/user_verbs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒUserspace verbs access”h]”hŒUserspace verbs access”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒC/var/lib/git/docbuild/linux/Documentation/infiniband/user_verbs.rst”h KubhŒ block_quote”“”)”}”(hXyThe ib_uverbs module, built by enabling CONFIG_INFINIBAND_USER_VERBS, enables direct userspace access to IB hardware via "verbs," as described in chapter 11 of the InfiniBand Architecture Specification. To use the verbs, the libibverbs library, available from https://github.com/linux-rdma/rdma-core, is required. libibverbs contains a device-independent API for using the ib_uverbs interface. libibverbs also requires appropriate device-dependent kernel and userspace driver for your InfiniBand hardware. For example, to use a Mellanox HCA, you will need the ib_mthca kernel module and the libmthca userspace driver be installed. ”h]”(hŒ paragraph”“”)”}”(hŒÊThe ib_uverbs module, built by enabling CONFIG_INFINIBAND_USER_VERBS, enables direct userspace access to IB hardware via "verbs," as described in chapter 11 of the InfiniBand Architecture Specification.”h]”hŒÎThe ib_uverbs module, built by enabling CONFIG_INFINIBAND_USER_VERBS, enables direct userspace access to IB hardware via “verbs,†as described in chapter 11 of the InfiniBand Architecture Specification.”…””}”(hh¿hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h Khh¹ubh¾)”}”(hX¬To use the verbs, the libibverbs library, available from https://github.com/linux-rdma/rdma-core, is required. libibverbs contains a device-independent API for using the ib_uverbs interface. libibverbs also requires appropriate device-dependent kernel and userspace driver for your InfiniBand hardware. For example, to use a Mellanox HCA, you will need the ib_mthca kernel module and the libmthca userspace driver be installed.”h]”(hŒ9To use the verbs, the libibverbs library, available from ”…””}”(hhÍhžhhŸNh NubhŒ reference”“”)”}”(hŒ'https://github.com/linux-rdma/rdma-core”h]”hŒ'https://github.com/linux-rdma/rdma-core”…””}”(hh×hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”hÙuh1hÕhhÍubhXL, is required. libibverbs contains a device-independent API for using the ib_uverbs interface. libibverbs also requires appropriate device-dependent kernel and userspace driver for your InfiniBand hardware. For example, to use a Mellanox HCA, you will need the ib_mthca kernel module and the libmthca userspace driver be installed.”…””}”(hhÍhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h K hh¹ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒUser-kernel communication”h]”hŒUser-kernel communication”…””}”(hhùhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhöhžhhŸh¶h Kubh¸)”}”(hX‹Userspace communicates with the kernel for slow path, resource management operations via the /dev/infiniband/uverbsN character devices. Fast path operations are typically performed by writing directly to hardware registers mmap()ed into userspace, with no system call or context switch into the kernel. Commands are sent to the kernel via write()s on these device files. The ABI is defined in drivers/infiniband/include/ib_user_verbs.h. The structs for commands that require a response from the kernel contain a 64-bit field used to pass a pointer to an output buffer. Status is returned to userspace as the return value of the write() system call. ”h]”(h¾)”}”(hX/Userspace communicates with the kernel for slow path, resource management operations via the /dev/infiniband/uverbsN character devices. Fast path operations are typically performed by writing directly to hardware registers mmap()ed into userspace, with no system call or context switch into the kernel.”h]”hX/Userspace communicates with the kernel for slow path, resource management operations via the /dev/infiniband/uverbsN character devices. Fast path operations are typically performed by writing directly to hardware registers mmap()ed into userspace, with no system call or context switch into the kernel.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h Khjubh¾)”}”(hXYCommands are sent to the kernel via write()s on these device files. The ABI is defined in drivers/infiniband/include/ib_user_verbs.h. The structs for commands that require a response from the kernel contain a 64-bit field used to pass a pointer to an output buffer. Status is returned to userspace as the return value of the write() system call.”h]”hXYCommands are sent to the kernel via write()s on these device files. The ABI is defined in drivers/infiniband/include/ib_user_verbs.h. The structs for commands that require a response from the kernel contain a 64-bit field used to pass a pointer to an output buffer. Status is returned to userspace as the return value of the write() system call.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h Khjubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khhöhžhubeh}”(h]”Œuser-kernel-communication”ah ]”h"]”Œuser-kernel communication”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒResource management”h]”hŒResource management”…””}”(hj8hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj5hžhhŸh¶h K"ubh¸)”}”(hX;Since creation and destruction of all IB resources is done by commands passed through a file descriptor, the kernel can keep track of which resources are attached to a given userspace context. The ib_uverbs module maintains idr tables that are used to translate between kernel pointers and opaque userspace handles, so that kernel pointers are never exposed to userspace and userspace cannot trick the kernel into following a bogus pointer. This also allows the kernel to clean up when a process exits and prevent one process from touching another process's resources. ”h]”(h¾)”}”(hX¹Since creation and destruction of all IB resources is done by commands passed through a file descriptor, the kernel can keep track of which resources are attached to a given userspace context. The ib_uverbs module maintains idr tables that are used to translate between kernel pointers and opaque userspace handles, so that kernel pointers are never exposed to userspace and userspace cannot trick the kernel into following a bogus pointer.”h]”hX¹Since creation and destruction of all IB resources is done by commands passed through a file descriptor, the kernel can keep track of which resources are attached to a given userspace context. The ib_uverbs module maintains idr tables that are used to translate between kernel pointers and opaque userspace handles, so that kernel pointers are never exposed to userspace and userspace cannot trick the kernel into following a bogus pointer.”…””}”(hjJhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h K$hjFubh¾)”}”(hŒThis also allows the kernel to clean up when a process exits and prevent one process from touching another process's resources.”h]”hŒThis also allows the kernel to clean up when a process exits and prevent one process from touching another process’s resources.”…””}”(hjXhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h K,hjFubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K$hj5hžhubeh}”(h]”Œresource-management”ah ]”h"]”Œresource management”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K"ubh¢)”}”(hhh]”(h§)”}”(hŒMemory pinning”h]”hŒMemory pinning”…””}”(hjwhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjthžhhŸh¶h K0ubh¸)”}”(hX7Direct userspace I/O requires that memory regions that are potential I/O targets be kept resident at the same physical address. The ib_uverbs module manages pinning and unpinning memory regions via get_user_pages() and put_page() calls. It also accounts for the amount of memory pinned in the process's pinned_vm, and checks that unprivileged processes do not exceed their RLIMIT_MEMLOCK limit. Pages that are pinned multiple times are counted each time they are pinned, so the value of pinned_vm may be an overestimate of the number of pages pinned by a process. ”h]”(h¾)”}”(hXŒDirect userspace I/O requires that memory regions that are potential I/O targets be kept resident at the same physical address. The ib_uverbs module manages pinning and unpinning memory regions via get_user_pages() and put_page() calls. It also accounts for the amount of memory pinned in the process's pinned_vm, and checks that unprivileged processes do not exceed their RLIMIT_MEMLOCK limit.”h]”hXŽDirect userspace I/O requires that memory regions that are potential I/O targets be kept resident at the same physical address. The ib_uverbs module manages pinning and unpinning memory regions via get_user_pages() and put_page() calls. It also accounts for the amount of memory pinned in the process’s pinned_vm, and checks that unprivileged processes do not exceed their RLIMIT_MEMLOCK limit.”…””}”(hj‰hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h K2hj…ubh¾)”}”(hŒ¨Pages that are pinned multiple times are counted each time they are pinned, so the value of pinned_vm may be an overestimate of the number of pages pinned by a process.”h]”hŒ¨Pages that are pinned multiple times are counted each time they are pinned, so the value of pinned_vm may be an overestimate of the number of pages pinned by a process.”…””}”(hj—hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h K9hj…ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K2hjthžhubeh}”(h]”Œmemory-pinning”ah ]”h"]”Œmemory pinning”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K0ubh¢)”}”(hhh]”(h§)”}”(hŒ /dev files”h]”hŒ /dev files”…””}”(hj¶hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj³hžhhŸh¶h K>ubh¸)”}”(hXTo create the appropriate character device files automatically with udev, a rule like:: KERNEL=="uverbs*", NAME="infiniband/%k" can be used. This will create device nodes named:: /dev/infiniband/uverbs0 and so on. Since the InfiniBand userspace verbs should be safe for use by non-privileged processes, it may be useful to add an appropriate MODE or GROUP to the udev rule.”h]”(h¾)”}”(hŒWTo create the appropriate character device files automatically with udev, a rule like::”h]”hŒVTo create the appropriate character device files automatically with udev, a rule like:”…””}”(hjÈhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h K@hjÄubhŒ literal_block”“”)”}”(hŒ'KERNEL=="uverbs*", NAME="infiniband/%k"”h]”hŒ'KERNEL=="uverbs*", NAME="infiniband/%k"”…””}”hjØsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jÖhŸh¶h KChjÄubh¾)”}”(hŒ3can be used. This will create device nodes named::”h]”hŒ2can be used. This will create device nodes named:”…””}”(hjèhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h KEhjÄubj×)”}”(hŒ/dev/infiniband/uverbs0”h]”hŒ/dev/infiniband/uverbs0”…””}”hjösbah}”(h]”h ]”h"]”h$]”h&]”jæjçuh1jÖhŸh¶h KGhjÄubh¾)”}”(hŒ«and so on. Since the InfiniBand userspace verbs should be safe for use by non-privileged processes, it may be useful to add an appropriate MODE or GROUP to the udev rule.”h]”hŒ«and so on. Since the InfiniBand userspace verbs should be safe for use by non-privileged processes, it may be useful to add an appropriate MODE or GROUP to the udev rule.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hŸh¶h KIhjÄubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K@hj³hžhubeh}”(h]”Œ dev-files”ah ]”h"]”Œ /dev files”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K>ubeh}”(h]”Œuserspace-verbs-access”ah ]”h"]”Œuserspace verbs access”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”jKŒ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"j2j/jqjnj°j­jjuŒ nametypes”}”(j%‰j2‰jq‰j°‰j‰uh}”(j"h£j/höjnj5j­jtjj³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.