├── AUTHORS ├── COPYING ├── ChangeLog ├── Makefile.am ├── Makefile.in ├── README ├── aclocal.m4 ├── autogen.sh ├── autom4te.cache ├── output.0 ├── output.1 ├── requests ├── traces.0 └── traces.1 ├── config.h.in ├── config ├── .gitignore ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 ├── lt~obsolete.m4 └── test-driver ├── configure ├── configure.ac ├── debian ├── changelog ├── compat ├── control ├── copyright ├── ibverbs-utils.install ├── libibverbs-dev.install ├── libibverbs-dev.links ├── libibverbs1.install ├── libibverbs1.postinst ├── rules ├── source │ └── format └── watch ├── examples ├── .gitignore ├── asyncwatch.c ├── cc_pingpong.c ├── cc_pingpong.h ├── dc.h ├── dcini.c ├── dctgt.c ├── device_list.c ├── devinfo.c ├── get_clock.c ├── get_clock.h ├── intf.c ├── pingpong.c ├── pingpong.h ├── polldcinfo.c ├── rc_pingpong.c ├── shared_mr.c ├── srq_pingpong.c ├── task_pingpong.c ├── uc_pingpong.c ├── ud_pingpong.c ├── umr_rc.c └── xsrq_pingpong.c ├── include └── infiniband │ ├── arch.h │ ├── driver.h │ ├── driver_exp.h │ ├── kern-abi.h │ ├── kern-abi_exp.h │ ├── marshall.h │ ├── ofa_verbs.h │ ├── opcode.h │ ├── peer_ops.h │ ├── sa-kern-abi.h │ ├── sa.h │ ├── verbs.h │ └── verbs_exp.h ├── libibverbs.spec ├── libibverbs.spec.in ├── man ├── ibv_alloc_mw.3 ├── ibv_alloc_pd.3 ├── ibv_asyncwatch.1 ├── ibv_attach_mcast.3 ├── ibv_bind_mw.3 ├── ibv_cc_pingpong.1 ├── ibv_create_ah.3 ├── ibv_create_ah_from_wc.3 ├── ibv_create_comp_channel.3 ├── ibv_create_cq.3 ├── ibv_create_flow.3 ├── ibv_create_qp.3 ├── ibv_create_qp_ex.3 ├── ibv_create_srq.3 ├── ibv_create_srq_ex.3 ├── ibv_devices.1 ├── ibv_devinfo.1 ├── ibv_event_type_str.3 ├── ibv_exp_alloc_dm.3 ├── ibv_exp_alloc_ec_calc.3 ├── ibv_exp_alloc_mkey_list_memory.3 ├── ibv_exp_bind_mw.3 ├── ibv_exp_cqe_ts_to_ns.3 ├── ibv_exp_create_cq.3 ├── ibv_exp_create_dct.3 ├── ibv_exp_create_flow.3 ├── ibv_exp_create_mr.3 ├── ibv_exp_create_qp.3 ├── ibv_exp_create_res_domain.3 ├── ibv_exp_create_rwq_ind_table.3 ├── ibv_exp_create_srq.3 ├── ibv_exp_create_wq.3 ├── ibv_exp_dealloc_mkey_list_memory.3 ├── ibv_exp_ec_decode_async.3 ├── ibv_exp_ec_encode_async.3 ├── ibv_exp_ec_update_async.3 ├── ibv_exp_get_provider_func.3 ├── ibv_exp_modify_cq.3 ├── ibv_exp_modify_qp.3 ├── ibv_exp_modify_wq.3 ├── ibv_exp_open_device.3 ├── ibv_exp_peer_commit_qp.3 ├── ibv_exp_poll_cq.3 ├── ibv_exp_post_send.3 ├── ibv_exp_post_srq_ops.3 ├── ibv_exp_post_task.3 ├── ibv_exp_prefetch_mr.3 ├── ibv_exp_query_dct.3 ├── ibv_exp_query_device.3 ├── ibv_exp_query_gid_attr.3 ├── ibv_exp_query_intf.3 ├── ibv_exp_query_mkey.3 ├── ibv_exp_query_values.3 ├── ibv_exp_reg_mr.3 ├── ibv_exp_reg_shared_mr.3 ├── ibv_exp_rereg_mr.3 ├── ibv_fork_init.3 ├── ibv_get_async_event.3 ├── ibv_get_cq_event.3 ├── ibv_get_device_guid.3 ├── ibv_get_device_list.3 ├── ibv_get_device_name.3 ├── ibv_get_srq_num.3 ├── ibv_inc_rkey.3 ├── ibv_intf.1 ├── ibv_modify_qp.3 ├── ibv_modify_srq.3 ├── ibv_open_device.3 ├── ibv_open_qp.3 ├── ibv_open_xrcd.3 ├── ibv_poll_cq.3 ├── ibv_post_recv.3 ├── ibv_post_send.3 ├── ibv_post_srq_recv.3 ├── ibv_query_device.3 ├── ibv_query_device_ex.3 ├── ibv_query_gid.3 ├── ibv_query_pkey.3 ├── ibv_query_port.3 ├── ibv_query_qp.3 ├── ibv_query_srq.3 ├── ibv_rate_to_mbps.3 ├── ibv_rate_to_mult.3 ├── ibv_rc_pingpong.1 ├── ibv_reg_mr.3 ├── ibv_req_notify_cq.3 ├── ibv_rereg_mr.3 ├── ibv_resize_cq.3 ├── ibv_shared_mr.1 ├── ibv_srq_pingpong.1 ├── ibv_task_pingpong.1 ├── ibv_uc_pingpong.1 ├── ibv_ud_pingpong.1 ├── peer_direct.7 └── verbs.7 ├── src ├── .gitignore ├── cmd.c ├── cmd_exp.c ├── compat-1_0.c ├── device.c ├── enum_strs.c ├── ibverbs.h ├── init.c ├── libibverbs.map ├── marshall.c ├── memory.c ├── neigh.c ├── neigh.h ├── sysfs.c └── verbs.c ├── tests ├── api │ ├── gtest_cd.h │ ├── gtest_cd_tc1.cc │ ├── gtest_cd_tc2.cc │ ├── gtest_cd_tc3.cc │ ├── gtest_cd_tc4.cc │ ├── gtest_cd_tc5.cc │ ├── gtest_cd_tc6.cc │ ├── gtest_cd_tc7.cc │ ├── gtest_cd_tc8.cc │ └── gtest_init.cc ├── cmn │ ├── gtest_cmn.cc │ └── gtest_cmn.h ├── gtest │ ├── gtest-all.cc │ └── gtest.h └── gtest_main.cc └── util └── util.h /AUTHORS: -------------------------------------------------------------------------------- 1 | Roland Dreier 2 | Dotan Barak 3 | Sean Hefty 4 | Michael S. Tsirkin 5 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh -exE 2 | 3 | aclocal -I config 4 | libtoolize --force --copy 5 | autoheader 6 | automake --foreign --add-missing --copy 7 | autoconf 8 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the `dl' library (-ldl). */ 10 | #undef HAVE_LIBDL 11 | 12 | /* Define to 1 if you have the `nl' library (-lnl). */ 13 | #undef HAVE_LIBNL 14 | 15 | /* Use libnl-1 */ 16 | #undef HAVE_LIBNL1 17 | 18 | /* Use libnl-3.0 */ 19 | #undef HAVE_LIBNL3 20 | 21 | /* Use libnl-3.2.15-21 */ 22 | #undef HAVE_LIBNL3_BUG 23 | 24 | /* Define to 1 if you have the `pthread' library (-lpthread). */ 25 | #undef HAVE_LIBPTHREAD 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_MEMORY_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STDINT_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STDLIB_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_STRINGS_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_STRING_H 41 | 42 | /* assembler has .symver support */ 43 | #undef HAVE_SYMVER_SUPPORT 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_SYS_STAT_H 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_SYS_TYPES_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_UNISTD_H 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #undef HAVE_VALGRIND_MEMCHECK_H 56 | 57 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 58 | #undef LT_OBJDIR 59 | 60 | /* Define to 1 to disable resovle neigh annotations. */ 61 | #undef NRESOLVE_NEIGH 62 | 63 | /* Define to 1 to disable Valgrind annotations. */ 64 | #undef NVALGRIND 65 | 66 | /* Name of package */ 67 | #undef PACKAGE 68 | 69 | /* Define to the address where bug reports for this package should be sent. */ 70 | #undef PACKAGE_BUGREPORT 71 | 72 | /* Define to the full name of this package. */ 73 | #undef PACKAGE_NAME 74 | 75 | /* Define to the full name and version of this package. */ 76 | #undef PACKAGE_STRING 77 | 78 | /* Define to the one symbol short name of this package. */ 79 | #undef PACKAGE_TARNAME 80 | 81 | /* Define to the home page for this package. */ 82 | #undef PACKAGE_URL 83 | 84 | /* Define to the version of this package. */ 85 | #undef PACKAGE_VERSION 86 | 87 | /* Define to 1 if you have the ANSI C header files. */ 88 | #undef STDC_HEADERS 89 | 90 | /* Enable extensions on AIX 3, Interix. */ 91 | #ifndef _ALL_SOURCE 92 | # undef _ALL_SOURCE 93 | #endif 94 | /* Enable GNU extensions on systems that have them. */ 95 | #ifndef _GNU_SOURCE 96 | # undef _GNU_SOURCE 97 | #endif 98 | /* Enable threading extensions on Solaris. */ 99 | #ifndef _POSIX_PTHREAD_SEMANTICS 100 | # undef _POSIX_PTHREAD_SEMANTICS 101 | #endif 102 | /* Enable extensions on HP NonStop. */ 103 | #ifndef _TANDEM_SOURCE 104 | # undef _TANDEM_SOURCE 105 | #endif 106 | /* Enable general extensions on Solaris. */ 107 | #ifndef __EXTENSIONS__ 108 | # undef __EXTENSIONS__ 109 | #endif 110 | 111 | 112 | /* Version number of package */ 113 | #undef VERSION 114 | 115 | /* Define to 1 if on MINIX. */ 116 | #undef _MINIX 117 | 118 | /* Define to 2 if the system does not provide POSIX.1 features except with 119 | this defined. */ 120 | #undef _POSIX_1_SOURCE 121 | 122 | /* Define to 1 if you need to in order for `stat' and other things to work. */ 123 | #undef _POSIX_SOURCE 124 | 125 | /* Define to empty if `const' does not conform to ANSI C. */ 126 | #undef const 127 | -------------------------------------------------------------------------------- /config/.gitignore: -------------------------------------------------------------------------------- 1 | mkinstalldirs 2 | depcomp 3 | compile 4 | missing 5 | config.guess 6 | config.sub 7 | ltmain.sh 8 | install-sh 9 | -------------------------------------------------------------------------------- /config/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 4179 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) 16 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.6' 20 | macro_revision='2.4.6' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | 3 | AC_PREREQ(2.57) 4 | AC_INIT(libibverbs, 41mlnx1, linux-rdma@vger.kernel.org) 5 | AC_CONFIG_SRCDIR([src/ibverbs.h]) 6 | AC_CONFIG_AUX_DIR(config) 7 | AC_CONFIG_MACRO_DIR(config) 8 | AC_CONFIG_HEADER(config.h) 9 | AM_INIT_AUTOMAKE([1.10 foreign tar-ustar silent-rules subdir-objects]) 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 11 | 12 | dnl Checks for programs 13 | AC_PROG_CC 14 | AC_PROG_CXX 15 | AC_GNU_SOURCE 16 | AC_PROG_LN_S 17 | AC_PROG_LIBTOOL 18 | 19 | LT_INIT 20 | 21 | ########################## 22 | # Enable support for valgrind 23 | # 24 | AC_ARG_WITH([valgrind], 25 | AC_HELP_STRING([--with-valgrind], 26 | [Enable Valgrind annotations (small runtime overhead, default NO)])) 27 | if test x$with_valgrind = x || test x$with_valgrind = xno; then 28 | want_valgrind=no 29 | AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.]) 30 | else 31 | want_valgrind=yes 32 | if test -d $with_valgrind; then 33 | CPPFLAGS="$CPPFLAGS -I$with_valgrind/include" 34 | fi 35 | fi 36 | 37 | AC_ARG_WITH([resolve-neigh], 38 | AC_HELP_STRING([--with-resolve-neigh], 39 | [Enable neighbour resolution in Ethernet (default YES)])) 40 | have_libnl=no 41 | if test x$with_resolve_neigh = x || test x$with_resolve_neigh = xyes; then 42 | PKG_CHECK_MODULES([LIBNL],[libnl-3.0],[ 43 | have_libnl=yes 44 | AC_DEFINE([HAVE_LIBNL3], [1], [Use libnl-3.0]) 45 | AC_DEFINE([HAVE_LIBNL], [1], [Use libnl]) 46 | PKG_CHECK_MODULES([LIBNL_ROUTE3], [libnl-route-3.0]) 47 | LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE3_CFLAGS" 48 | LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE3_LIBS"], [:] 49 | ); 50 | 51 | PKG_CHECK_MODULES([LIBNL3_BUG], [libnl-3.0 >= 3.2.15 libnl-3.0 < 3.2.22], 52 | [AC_DEFINE([HAVE_LIBNL3_BUG], [1], [Use libnl-3.2.15-21])], [:]) 53 | 54 | if test "$have_libnl" = no; then 55 | PKG_CHECK_MODULES([LIBNL], [libnl-1], [have_libnl=yes 56 | AC_DEFINE([HAVE_LIBNL1], [1], [Use libnl-1]) 57 | AC_DEFINE([HAVE_LIBNL], [1], [Use libnl]) 58 | AC_CHECK_LIB(nl, rtnl_link_vlan_get_id, [], 59 | AC_MSG_ERROR([rtnl_link_vlan_get_id not found. libibverbs requires libnl.])) 60 | ],[ 61 | AC_MSG_ERROR([libibverbs requires libnl.]) 62 | ]) 63 | fi 64 | else 65 | AC_DEFINE([NRESOLVE_NEIGH], 1, [Define to 1 to disable resovle neigh annotations.]) 66 | fi 67 | AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"]) 68 | AC_SUBST([LIBNL_CFLAGS]) 69 | AC_SUBST([LIBNL_LIBS]) 70 | AM_CONDITIONAL(NO_RESOLVE_NEIGH, test x$with_resolve_neigh = xno) 71 | 72 | dnl Checks for libraries 73 | AC_CHECK_LIB(dl, dlsym, [], 74 | AC_MSG_ERROR([dlsym() not found. libibverbs requires libdl.])) 75 | AC_CHECK_LIB(pthread, pthread_mutex_init, [], 76 | AC_MSG_ERROR([pthread_mutex_init() not found. libibverbs requires libpthread.])) 77 | 78 | dnl Checks for header files. 79 | AC_HEADER_STDC 80 | 81 | if test x$want_valgrind = xyes; then 82 | AC_CHECK_HEADER(valgrind/memcheck.h, 83 | [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1, 84 | [Define to 1 if you have the header file.])], 85 | [if test $want_valgrind = yes; then 86 | AC_MSG_ERROR([Valgrind memcheck support requested, but not found.]) 87 | fi]) 88 | fi 89 | 90 | dnl Checks for typedefs, structures, and compiler characteristics. 91 | AC_C_CONST 92 | 93 | AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script, 94 | [if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then 95 | ac_cv_version_script=yes 96 | else 97 | ac_cv_version_script=no 98 | fi]) 99 | 100 | if test $ac_cv_version_script = yes; then 101 | LIBIBVERBS_VERSION_SCRIPT='-Wl,--version-script=$(srcdir)/src/libibverbs.map' 102 | else 103 | LIBIBVERBS_VERSION_SCRIPT= 104 | fi 105 | AC_SUBST(LIBIBVERBS_VERSION_SCRIPT) 106 | 107 | AC_CACHE_CHECK(for .symver assembler support, ac_cv_asm_symver_support, 108 | [AC_TRY_COMPILE(, [asm("symbol:\n.symver symbol, api@ABI\n");], 109 | ac_cv_asm_symver_support=yes, 110 | ac_cv_asm_symver_support=no)]) 111 | if test $ac_cv_asm_symver_support = yes; then 112 | AC_DEFINE([HAVE_SYMVER_SUPPORT], 1, [assembler has .symver support]) 113 | fi 114 | 115 | AC_CONFIG_FILES([Makefile libibverbs.spec]) 116 | AC_OUTPUT 117 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: libibverbs 2 | Priority: extra 3 | Maintainer: Roland Dreier 4 | DM-Upload-Allowed: yes 5 | Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.13.19) 6 | Standards-Version: 3.9.2 7 | Section: libs 8 | Homepage: http://www.openfabrics.org/ 9 | 10 | Package: libibverbs1 11 | Section: libs 12 | Architecture: any 13 | Depends: ${shlibs:Depends}, ${misc:Depends}, adduser 14 | Description: Library for direct userspace use of RDMA (InfiniBand/iWARP) 15 | libibverbs is a library that allows userspace processes to use RDMA 16 | "verbs" as described in the InfiniBand Architecture Specification and 17 | the RDMA Protocol Verbs Specification. iWARP ethernet NICs support 18 | RDMA over hardware-offloaded TCP/IP, while InfiniBand is a 19 | high-throughput, low-latency networking technology. InfiniBand host 20 | channel adapters (HCAs) and iWARP NICs commonly support direct 21 | hardware access from userspace (kernel bypass), and libibverbs 22 | supports this when available. 23 | . 24 | For this library to be useful, a device-specific plug-in module 25 | should also be installed. 26 | . 27 | This package contains the shared library. 28 | 29 | Package: libibverbs-dev 30 | Section: libdevel 31 | Architecture: any 32 | Depends: ${misc:Depends}, libibverbs1 (= ${binary:Version}) 33 | Description: Development files for the libibverbs library 34 | libibverbs is a library that allows userspace processes to use RDMA 35 | "verbs" as described in the InfiniBand Architecture Specification and 36 | the RDMA Protocol Verbs Specification. iWARP ethernet NICs support 37 | RDMA over hardware-offloaded TCP/IP, while InfiniBand is a 38 | high-throughput, low-latency networking technology. InfiniBand host 39 | channel adapters (HCAs) and iWARP NICs commonly support direct 40 | hardware access from userspace (kernel bypass), and libibverbs 41 | supports this when available. 42 | . 43 | This package is needed to compile programs against libibverbs1. 44 | It contains the header files and static libraries (optionally) 45 | needed for compiling. 46 | 47 | Package: libibverbs1-dbg 48 | Section: debug 49 | Priority: extra 50 | Architecture: any 51 | Depends: ${misc:Depends}, libibverbs1 (= ${binary:Version}) 52 | Description: Debugging symbols for the libibverbs library 53 | libibverbs is a library that allows userspace processes to use RDMA 54 | "verbs" as described in the InfiniBand Architecture Specification and 55 | the RDMA Protocol Verbs Specification. iWARP ethernet NICs support 56 | RDMA over hardware-offloaded TCP/IP, while InfiniBand is a 57 | high-throughput, low-latency networking technology. InfiniBand host 58 | channel adapters (HCAs) and iWARP NICs commonly support direct 59 | hardware access from userspace (kernel bypass), and libibverbs 60 | supports this when available. 61 | . 62 | This package contains the debugging symbols associated with 63 | libibverbs1. They will automatically be used by gdb for debugging 64 | libibverbs-related issues. 65 | 66 | Package: ibverbs-utils 67 | Section: net 68 | Architecture: any 69 | Depends: ${shlibs:Depends}, ${misc:Depends} 70 | Description: Examples for the libibverbs library 71 | libibverbs is a library that allows userspace processes to use RDMA 72 | "verbs" as described in the InfiniBand Architecture Specification and 73 | the RDMA Protocol Verbs Specification. iWARP ethernet NICs support 74 | RDMA over hardware-offloaded TCP/IP, while InfiniBand is a 75 | high-throughput, low-latency networking technology. InfiniBand host 76 | channel adapters (HCAs) and iWARP NICs commonly support direct 77 | hardware access from userspace (kernel bypass), and libibverbs 78 | supports this when available. 79 | . 80 | This package contains useful libibverbs1 example programs such as 81 | ibv_devinfo, which displays information about InfiniBand devices. 82 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Initial Debianization: 2 | This package was debianized by Roland Dreier on 3 | Mon, 25 Apr 2005 10:21:08 -0700. 4 | 5 | Source: 6 | It was downloaded from the OpenIB web site at 7 | 8 | 9 | Authors: 10 | Roland Dreier 11 | Dotan Barak 12 | Sean Hefty 13 | Michael S. Tsirkin 14 | 15 | Portions are copyrighted by: 16 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 17 | * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. 18 | * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved. 19 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. 20 | * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. 21 | * Copyright (c) 2005 Voltaire, Inc. All rights reserved. 22 | 23 | libibverbs is licensed under a choice of one of two licenses. You may 24 | choose to be licensed under the terms of the GNU General Public 25 | License (GPL) Version 2, available from the file 26 | /usr/share/common-licenses/GPL-2 on your Debian system, or the 27 | OpenIB.org BSD license below: 28 | 29 | Redistribution and use in source and binary forms, with or 30 | without modification, are permitted provided that the following 31 | conditions are met: 32 | 33 | - Redistributions of source code must retain the above 34 | copyright notice, this list of conditions and the following 35 | disclaimer. 36 | 37 | - Redistributions in binary form must reproduce the above 38 | copyright notice, this list of conditions and the following 39 | disclaimer in the documentation and/or other materials 40 | provided with the distribution. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 43 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 44 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 45 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 46 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 47 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 48 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | -------------------------------------------------------------------------------- /debian/ibverbs-utils.install: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man/man1 3 | -------------------------------------------------------------------------------- /debian/libibverbs-dev.install: -------------------------------------------------------------------------------- 1 | usr/include 2 | usr/lib/libibverbs*.a 3 | usr/lib/libibverbs*.so 4 | usr/share/man/man3 5 | -------------------------------------------------------------------------------- /debian/libibverbs-dev.links: -------------------------------------------------------------------------------- 1 | usr/share/man/man3/ibv_get_async_event.3 usr/share/man/man3/ibv_ack_async_event.3 2 | usr/share/man/man3/ibv_get_cq_event.3 usr/share/man/man3/ibv_ack_cq_events.3 3 | usr/share/man/man3/ibv_open_device.3 usr/share/man/man3/ibv_close_device.3 4 | usr/share/man/man3/ibv_alloc_pd.3 usr/share/man/man3/ibv_dealloc_pd.3 5 | usr/share/man/man3/ibv_reg_mr.3 usr/share/man/man3/ibv_dereg_mr.3 6 | usr/share/man/man3/ibv_create_ah.3 usr/share/man/man3/ibv_destroy_ah.3 7 | usr/share/man/man3/ibv_create_comp_channel.3 usr/share/man/man3/ibv_destroy_comp_channel.3 8 | usr/share/man/man3/ibv_create_cq.3 usr/share/man/man3/ibv_destroy_cq.3 9 | usr/share/man/man3/ibv_create_qp.3 usr/share/man/man3/ibv_destroy_qp.3 10 | usr/share/man/man3/ibv_create_srq.3 usr/share/man/man3/ibv_destroy_srq.3 11 | usr/share/man/man3/ibv_attach_mcast.3 usr/share/man/man3/ibv_detach_mcast.3 12 | usr/share/man/man3/ibv_get_device_list.3 usr/share/man/man3/ibv_free_device_list.3 13 | usr/share/man/man3/ibv_create_ah_from_wc.3 usr/share/man/man3/ibv_init_ah_from_wc.3 14 | usr/share/man/man3/ibv_rate_to_mult.3 usr/share/man/man3/mult_to_ibv_rate.3 15 | usr/share/man/man3/ibv_event_type_str.3 usr/share/man/man3/ibv_node_type_str.3 16 | usr/share/man/man3/ibv_event_type_str.3 usr/share/man/man3/ibv_port_state_str.3 17 | -------------------------------------------------------------------------------- /debian/libibverbs1.install: -------------------------------------------------------------------------------- 1 | usr/lib/libibverbs*.so.* 2 | -------------------------------------------------------------------------------- /debian/libibverbs1.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for libibverbs1 3 | 4 | set -e 5 | 6 | if [ "$1" = configure ]; then 7 | getent group rdma > /dev/null 2>&1 || addgroup --system --quiet rdma 8 | fi 9 | 10 | #DEBHELPER# 11 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- mode: makefile; coding: utf-8 -*- 3 | 4 | %: 5 | dh $@ 6 | 7 | override_dh_strip: 8 | dh_strip --dbg-package=libibverbs1-dbg 9 | 10 | override_dh_makeshlibs: 11 | dh_makeshlibs -V 'libibverbs1 (>= 1.1.2)' 12 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | opts="uversionmangle=s/-rc/~rc/" \ 3 | http://www.openfabrics.org/downloads/verbs/libibverbs-(.+)\.tar\.gz 4 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | .dirstamp 2 | ibv_asyncwatch 3 | ibv_devices 4 | ibv_devinfo 5 | ibv_rc_pingpong 6 | ibv_srq_pingpong 7 | ibv_uc_pingpong 8 | ibv_ud_pingpong 9 | .libs 10 | -------------------------------------------------------------------------------- /examples/dc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Mellanox Technologies. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | 33 | #ifndef __DC_H 34 | #define __DC_H 35 | 36 | #include 37 | #include 38 | 39 | struct pingpong_dest { 40 | int lid; 41 | int rsn; 42 | uint64_t dckey; 43 | }; 44 | 45 | /* DCTN LID DCT KEY */ 46 | #define MSG_FORMAT "000000:0000:0000000000000000" 47 | 48 | static inline int to_ib_mtu(int mtu, enum ibv_mtu *ibmtu) 49 | { 50 | switch (mtu) { 51 | case 256: 52 | *ibmtu = IBV_MTU_256; 53 | return 0; 54 | case 512: 55 | *ibmtu = IBV_MTU_512; 56 | return 0; 57 | case 1024: 58 | *ibmtu = IBV_MTU_1024; 59 | return 0; 60 | case 2048: 61 | *ibmtu = IBV_MTU_2048; 62 | return 0; 63 | case 4096: 64 | *ibmtu = IBV_MTU_4096; 65 | return 0; 66 | default: 67 | return -1; 68 | } 69 | } 70 | 71 | #endif /* __DC_H */ 72 | 73 | -------------------------------------------------------------------------------- /examples/device_list.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | 33 | #if HAVE_CONFIG_H 34 | # include 35 | #endif /* HAVE_CONFIG_H */ 36 | 37 | #include 38 | 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | int main(int argc, char *argv[]) 46 | { 47 | struct ibv_device **dev_list; 48 | int num_devices, i; 49 | 50 | dev_list = ibv_get_device_list(&num_devices); 51 | if (!dev_list) { 52 | perror("Failed to get IB devices list"); 53 | return 1; 54 | } 55 | 56 | printf(" %-16s\t node GUID\n", "device"); 57 | printf(" %-16s\t----------------\n", "------"); 58 | 59 | for (i = 0; i < num_devices; ++i) { 60 | printf(" %-16s\t%016llx\n", 61 | ibv_get_device_name(dev_list[i]), 62 | (unsigned long long) ntohll(ibv_get_device_guid(dev_list[i]))); 63 | } 64 | 65 | ibv_free_device_list(dev_list); 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /examples/get_clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | * 32 | * 33 | * Author: Michael S. Tsirkin 34 | */ 35 | 36 | #ifndef GET_CLOCK_H 37 | #define GET_CLOCK_H 38 | 39 | #if defined(__x86_64__) || defined(__i386__) 40 | /* Note: only x86 CPUs which have rdtsc instruction are supported. */ 41 | typedef unsigned long long cycles_t; 42 | static inline cycles_t get_cycles(void) 43 | { 44 | unsigned low, high; 45 | unsigned long long val; 46 | 47 | asm volatile ("rdtsc" : "=a" (low), "=d" (high)); 48 | val = high; 49 | val = (val << 32) | low; 50 | return val; 51 | } 52 | #elif defined(__PPC__) || defined(__PPC64__) 53 | /* Note: only PPC CPUs which have mftb instruction are supported. */ 54 | /* PPC64 has mftb */ 55 | typedef unsigned long cycles_t; 56 | static inline cycles_t get_cycles(void) 57 | { 58 | cycles_t ret; 59 | 60 | asm volatile ("mftb %0" : "=r" (ret) : ); 61 | return ret; 62 | } 63 | #elif defined(__ia64__) 64 | /* Itanium2 and up has ar.itc (Itanium1 has errata) */ 65 | typedef unsigned long cycles_t; 66 | static inline cycles_t get_cycles(void) 67 | { 68 | cycles_t ret; 69 | 70 | asm volatile ("mov %0=ar.itc" : "=r" (ret)); 71 | return ret; 72 | } 73 | #elif defined(__s390x__) 74 | typedef unsigned long long cycles_t; 75 | static inline cycles_t get_cycles(void) 76 | { 77 | cycles_t clk; 78 | 79 | asm volatile("stck %0" : "=Q" (clk) : : "cc"); 80 | return clk >> 2; 81 | } 82 | #elif defined(__sparc__) && defined(__arch64__) 83 | typedef unsigned long long cycles_t; 84 | static inline cycles_t get_cycles(void) 85 | { 86 | cycles_t v; 87 | 88 | asm volatile ("rd %%tick, %0" : "=r" (v) : ); 89 | return v; 90 | } 91 | #elif defined(__aarch64__) 92 | 93 | typedef unsigned long cycles_t; 94 | static inline cycles_t get_cycles(void) 95 | { 96 | cycles_t cval; 97 | 98 | asm volatile("isb" : : : "memory"); 99 | asm volatile("mrs %0, cntvct_el0" : "=r" (cval)); 100 | return cval; 101 | } 102 | 103 | #else 104 | #warning get_cycles not implemented for this architecture: attempt asm/timex.h 105 | #include 106 | #endif 107 | 108 | extern double get_cpu_mhz(int); 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /examples/pingpong.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Cisco Systems. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | 33 | #include "pingpong.h" 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | enum ibv_mtu pp_mtu_to_enum(int mtu) 40 | { 41 | switch (mtu) { 42 | case 256: return IBV_MTU_256; 43 | case 512: return IBV_MTU_512; 44 | case 1024: return IBV_MTU_1024; 45 | case 2048: return IBV_MTU_2048; 46 | case 4096: return IBV_MTU_4096; 47 | default: return -1; 48 | } 49 | } 50 | 51 | uint16_t pp_get_local_lid(struct ibv_context *context, int port) 52 | { 53 | struct ibv_port_attr attr; 54 | 55 | if (ibv_query_port(context, port, &attr)) 56 | return 0; 57 | 58 | return attr.lid; 59 | } 60 | 61 | int pp_get_port_info(struct ibv_context *context, int port, 62 | struct ibv_port_attr *attr) 63 | { 64 | return ibv_query_port(context, port, attr); 65 | } 66 | 67 | void wire_gid_to_gid(const char *wgid, union ibv_gid *gid) 68 | { 69 | char tmp[9]; 70 | uint32_t v32; 71 | uint32_t *raw = (uint32_t *)gid->raw; 72 | int i; 73 | 74 | for (tmp[8] = 0, i = 0; i < 4; ++i) { 75 | memcpy(tmp, wgid + i * 8, 8); 76 | sscanf(tmp, "%x", &v32); 77 | raw[i] = ntohl(v32); 78 | } 79 | } 80 | 81 | void gid_to_wire_gid(const union ibv_gid *gid, char wgid[]) 82 | { 83 | int i; 84 | uint32_t *raw = (uint32_t *)gid->raw; 85 | 86 | for (i = 0; i < 4; ++i) 87 | sprintf(&wgid[i * 8], "%08x", 88 | htonl(raw[i])); 89 | } 90 | -------------------------------------------------------------------------------- /examples/pingpong.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Cisco Systems. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | 33 | #ifndef IBV_PINGPONG_H 34 | #define IBV_PINGPONG_H 35 | 36 | #include 37 | #include 38 | 39 | enum ibv_mtu pp_mtu_to_enum(int mtu); 40 | uint16_t pp_get_local_lid(struct ibv_context *context, int port); 41 | int pp_get_port_info(struct ibv_context *context, int port, 42 | struct ibv_port_attr *attr); 43 | void wire_gid_to_gid(const char *wgid, union ibv_gid *gid); 44 | void gid_to_wire_gid(const union ibv_gid *gid, char wgid[]); 45 | 46 | #endif /* IBV_PINGPONG_H */ 47 | -------------------------------------------------------------------------------- /include/infiniband/marshall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Intel Corporation. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | 33 | #ifndef INFINIBAND_MARSHALL_H 34 | #define INFINIBAND_MARSHALL_H 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #ifdef __cplusplus 42 | # define BEGIN_C_DECLS extern "C" { 43 | # define END_C_DECLS } 44 | #else /* !__cplusplus */ 45 | # define BEGIN_C_DECLS 46 | # define END_C_DECLS 47 | #endif /* __cplusplus */ 48 | 49 | BEGIN_C_DECLS 50 | 51 | void ibv_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, 52 | struct ibv_kern_qp_attr *src); 53 | 54 | void ibv_copy_ah_attr_from_kern(struct ibv_ah_attr *dst, 55 | struct ibv_kern_ah_attr *src); 56 | 57 | void ibv_copy_path_rec_from_kern(struct ibv_sa_path_rec *dst, 58 | struct ibv_kern_path_rec *src); 59 | 60 | void ibv_copy_path_rec_to_kern(struct ibv_kern_path_rec *dst, 61 | struct ibv_sa_path_rec *src); 62 | 63 | END_C_DECLS 64 | 65 | #endif /* INFINIBAND_MARSHALL_H */ 66 | -------------------------------------------------------------------------------- /include/infiniband/sa-kern-abi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Intel Corporation. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | 33 | #ifndef INFINIBAND_SA_KERN_ABI_H 34 | #define INFINIBAND_SA_KERN_ABI_H 35 | 36 | #include 37 | 38 | /* 39 | * Obsolete, deprecated names. Will be removed in libibverbs 1.1. 40 | */ 41 | #define ib_kern_path_rec ibv_kern_path_rec 42 | 43 | struct ibv_kern_path_rec { 44 | __u8 dgid[16]; 45 | __u8 sgid[16]; 46 | __u16 dlid; 47 | __u16 slid; 48 | __u32 raw_traffic; 49 | __u32 flow_label; 50 | __u32 reversible; 51 | __u32 mtu; 52 | __u16 pkey; 53 | __u8 hop_limit; 54 | __u8 traffic_class; 55 | __u8 numb_path; 56 | __u8 sl; 57 | __u8 mtu_selector; 58 | __u8 rate_selector; 59 | __u8 rate; 60 | __u8 packet_life_time_selector; 61 | __u8 packet_life_time; 62 | __u8 preference; 63 | }; 64 | 65 | #endif /* INFINIBAND_SA_KERN_ABI_H */ 66 | -------------------------------------------------------------------------------- /man/ibv_alloc_mw.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_ALLOC_MW 3 2016-02-02 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_alloc_mw, ibv_dealloc_mw \- allocate or deallocate a memory window (MW) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_mw *ibv_alloc_mw(struct ibv_pd " "*pd" , 11 | .BI " enum ibv_mw_type " "type"); 12 | .sp 13 | .BI "int ibv_dealloc_mw(struct ibv_mw " "*mw" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_alloc_mw() 17 | allocates a memory window (MW) associated with the protection domain 18 | .I pd\fR. 19 | The MW's type (1 or 2A/2B) is 20 | .I type\fR. 21 | .PP 22 | The MW is created not bound. For it to be useful, the MW must be bound, through either ibv_bind_mw (type 1) or a special WR (type 2). 23 | Once bound, the memory window allows RDMA (remote) access to a subset of the MR to which it was bound, 24 | until invalidated by: ibv_bind_mw verb with zero length for type 1, 25 | IBV_WR_LOCAL_INV/IBV_WR_SEND_WITH_INV WR opcode for type 2, deallocation. 26 | .PP 27 | .B ibv_dealloc_mw() 28 | Unbinds in case was previously bound and deallocates the MW 29 | .I mw\fR. 30 | .SH "RETURN VALUE" 31 | .B ibv_alloc_mw() 32 | returns a pointer to the allocated MW, or NULL if the request fails. 33 | The remote key (\fBR_Key\fR) 34 | field 35 | .B rkey 36 | is used by remote processes to perform Atomic and RDMA operations. This key will be changed during bind operations. The remote process places this 37 | .B rkey 38 | as the rkey field of struct ibv_send_wr passed to the ibv_post_send function. 39 | .PP 40 | .B ibv_dealloc_mw() 41 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 42 | .SH "NOTES" 43 | .B ibv_dereg_mr() 44 | fails if any memory window is still bound to this MR. 45 | .SH "SEE ALSO" 46 | .BR ibv_alloc_pd (3), 47 | .BR ibv_post_send (3), 48 | .BR ibv_bind_mw (3), 49 | .BR ibv_reg_mr (3), 50 | .SH "AUTHORS" 51 | .TP 52 | Majd Dibbiny 53 | .TP 54 | Yishai Hadas 55 | -------------------------------------------------------------------------------- /man/ibv_alloc_pd.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_ALLOC_PD 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_alloc_pd, ibv_dealloc_pd \- allocate or deallocate a protection domain (PDs) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_pd *ibv_alloc_pd(struct ibv_context " "*context" ); 11 | .sp 12 | .BI "int ibv_dealloc_pd(struct ibv_pd " "*pd" ); 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_alloc_pd() 16 | allocates a PD for the RDMA device context 17 | .I context\fR. 18 | .PP 19 | .B ibv_dealloc_pd() 20 | deallocates the PD 21 | .I pd\fR. 22 | .SH "RETURN VALUE" 23 | .B ibv_alloc_pd() 24 | returns a pointer to the allocated PD, or NULL if the request fails. 25 | .PP 26 | .B ibv_dealloc_pd() 27 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 28 | .SH "NOTES" 29 | .B ibv_dealloc_pd() 30 | may fail if any other resource is still associated with the PD being 31 | freed. 32 | .SH "SEE ALSO" 33 | .BR ibv_reg_mr (3), 34 | .BR ibv_create_srq (3), 35 | .BR ibv_create_qp (3), 36 | .BR ibv_create_ah (3), 37 | .BR ibv_create_ah_from_wc (3) 38 | .SH "AUTHORS" 39 | .TP 40 | Dotan Barak 41 | -------------------------------------------------------------------------------- /man/ibv_asyncwatch.1: -------------------------------------------------------------------------------- 1 | .TH IBV_ASYNCWATCH 1 "August 30, 2005" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_asyncwatch \- display asynchronous events 5 | 6 | .SH SYNOPSIS 7 | .B ibv_asyncwatch 8 | 9 | .SH DESCRIPTION 10 | .PP 11 | Display asynchronous events forwarded to userspace for an RDMA device. 12 | 13 | .SH AUTHORS 14 | .TP 15 | Roland Dreier 16 | .RI < rolandd@cisco.com > 17 | -------------------------------------------------------------------------------- /man/ibv_attach_mcast.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_ATTACH_MCAST 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_attach_mcast, ibv_detach_mcast \- attach and detach a queue pair 6 | (QPs) to/from a multicast group 7 | .SH "SYNOPSIS" 8 | .nf 9 | .B #include 10 | .sp 11 | .BI "int ibv_attach_mcast(struct ibv_qp " "*qp" ", const union ibv_gid " "*gid" ", 12 | .BI " uint16_t " "lid" "); 13 | .sp 14 | .BI "int ibv_detach_mcast(struct ibv_qp " "*qp" ", const union ibv_gid " "*gid" ", 15 | .BI " uint16_t " "lid" "); 16 | .fi 17 | .SH "DESCRIPTION" 18 | .B ibv_attach_mcast() 19 | attaches the QP 20 | .I qp 21 | to the multicast group having MGID 22 | .I gid 23 | and MLID 24 | .I lid\fR. 25 | .PP 26 | .B ibv_detach_mcast() 27 | detaches the QP 28 | .I qp 29 | to the multicast group having MGID 30 | .I gid 31 | and MLID 32 | .I lid\fR. 33 | .SH "RETURN VALUE" 34 | .B ibv_attach_mcast() 35 | and 36 | .B ibv_detach_mcast() 37 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 38 | .SH "NOTES" 39 | Only QPs of Transport Service Type 40 | .BR IBV_QPT_UD 41 | may be attached to multicast groups. 42 | .PP 43 | If a QP is attached to the same multicast group multiple times, the QP will still receive a single copy of a multicast message. 44 | .PP 45 | In order to receive multicast messages, a join request for the 46 | multicast group must be sent to the subnet administrator (SA), so that 47 | the fabric's multicast routing is configured to deliver messages to 48 | the local port. 49 | .SH "SEE ALSO" 50 | .BR ibv_create_qp (3) 51 | .SH "AUTHORS" 52 | .TP 53 | Dotan Barak 54 | -------------------------------------------------------------------------------- /man/ibv_bind_mw.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_BIND_MW 3 2016-02-02 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_bind_mw \- post a request to bind a type 1 memory window to a memory region 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_bind_mw(struct ibv_qp " "*qp" ", struct ibv_mw " "*mw" ", 11 | .BI " struct ibv_mw_bind " "*mw_bind" "); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_bind_mw() 15 | posts to the queue pair 16 | .I qp 17 | a request to bind the memory window 18 | .I mw 19 | according to the details in 20 | .I mw_bind\fR. 21 | .PP 22 | The argument 23 | .I mw_bind 24 | is an ibv_mw_bind struct, as defined in . 25 | .PP 26 | .nf 27 | struct ibv_mw_bind { 28 | .in +8 29 | uint64_t wr_id; /* User defined WR ID */ 30 | int send_flags; /* Use ibv_send_flags */ 31 | struct ibv_mw_bind_info bind_info; /* MW bind information */ 32 | .in -8 33 | } 34 | .fi 35 | .PP 36 | .nf 37 | struct ibv_mw_bind_info { 38 | .in +8 39 | struct ibv_mr *mr; /* The MR to bind the MW to */ 40 | uint64_t addr; /* The address the MW should start at */ 41 | uint64_t length; /* The length (in bytes) the MW should span */ 42 | int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */ 43 | .in -8 44 | }; 45 | .fi 46 | .PP 47 | The QP Transport Service Type must be either UC, RC or XRC_SEND for bind operations. 48 | .PP 49 | The attribute send_flags describes the properties of the \s-1WR\s0. It is either 0 or the bitwise \s-1OR\s0 of one or more of the following flags: 50 | .PP 51 | .TP 52 | .B IBV_SEND_FENCE \fR Set the fence indicator. 53 | .TP 54 | .B IBV_SEND_SIGNALED \fR Set the completion notification indicator. Relevant only if QP was created with sq_sig_all=0 55 | .PP 56 | The mw_access_flags define the allowed access to the MW after the bind 57 | completes successfully. It is either 0 or the bitwise \s-1OR\s0 of one 58 | or more of the following flags: 59 | .TP 60 | .B IBV_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access. Requires local write access to the MR. 61 | .TP 62 | .B IBV_ACCESS_REMOTE_READ\fR Enable Remote Read Access 63 | .TP 64 | .B IBV_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported). Requires local write access to the MR. 65 | .TP 66 | .B IBV_ACCESS_ZERO_BASED\fR If set, the address set on the 'remote_addr' field on the WR will be an offset from the MW's start address. 67 | .SH "RETURN VALUE" 68 | .B ibv_bind_mw() 69 | returns 0 on success, or the value of errno on failure (which 70 | indicates the failure reason). In case of a success, the R_key of the 71 | memory window after the bind is returned in the mw_bind->mw->rkey field. 72 | .SH "NOTES" 73 | The bind does not complete when the function return - it is merely 74 | posted to the QP. The user should keep a copy of the old R_key, and 75 | fix the mw structure if the subsequent CQE for the bind operation 76 | indicates a failure. The user may safely send the R_key using a send 77 | request on the same QP, (based on QP ordering rules: a send after a bind 78 | request on the same QP are always ordered), but must not transfer it to the 79 | remote in any other manner before reading a successful CQE. 80 | .PP 81 | Note that for type 2 MW, one should directly post bind WR to the QP, 82 | using ibv_post_send. 83 | .SH "SEE ALSO" 84 | .BR ibv_alloc_mw (3), 85 | .BR ibv_post_send (3), 86 | .BR ibv_poll_cq (3) 87 | .BR ibv_reg_mr (3), 88 | .SH "AUTHORS" 89 | .TP 90 | Majd Dibbiny 91 | .TP 92 | Yishai Hadas 93 | -------------------------------------------------------------------------------- /man/ibv_cc_pingpong.1: -------------------------------------------------------------------------------- 1 | .TH IBV_CC_PINGPONG 1 2013-03-10 "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_cc_pingpong \- ping-pong test demonstrates using of WAIT and CALC work requests. 5 | 6 | .SH SYNOPSIS 7 | .B ibv_cc_pingpong 8 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 9 | [\-n iters] [\-l sl] [\-e] [\-m mtu] 10 | [\-c calc] [\-t op_type] [\-o operands] [\-w wait] 11 | \fBHOSTNAME\fR 12 | 13 | .B ibv_cc_pingpong 14 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 15 | [\-n iters] [\-l sl] [\-e] [\-m mtu] 16 | [\-c calc] [\-t op_type] [\-o operands] [\-w wait] 17 | 18 | .SH DESCRIPTION 19 | .PP 20 | Run a simple ping-pong test over InfiniBand via the reliable 21 | connected (RC) transport using WAIT on CQ work request 22 | and CALC work request. 23 | 24 | .SH OPTIONS 25 | 26 | .PP 27 | .TP 28 | \fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR 29 | use TCP port \fIPORT\fR for initial synchronization (default 18515) 30 | .TP 31 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 32 | use IB device \fIDEVICE\fR (default first device found) 33 | .TP 34 | \fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR 35 | use IB port \fIPORT\fR (default port 1) 36 | .TP 37 | \fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR 38 | ping-pong messages of size \fISIZE\fR (default 4096) 39 | .TP 40 | \fB\-r\fR, \fB\-\-rx\-depth\fR=\fIDEPTH\fR 41 | post \fIDEPTH\fR receives at a time (default 1000) 42 | .TP 43 | \fB\-n\fR, \fB\-\-iters\fR=\fIITERS\fR 44 | perform \fIITERS\fR message exchanges (default 1000) 45 | .TP 46 | \fB\-l\fR, \fB\-\-sl\fR=\fISL\fR 47 | use \fISL\fR as the service level value of the QP (default 0) 48 | .TP 49 | \fB\-e\fR, \fB\-\-events\fR 50 | sleep while waiting for work completion events (default is to poll for 51 | completions) 52 | .TP 53 | \fB\-m\fR, \fB\-\-mtu\fR=\fISIZE\fR 54 | path MTU (default 4096) 55 | .TP 56 | \fB\-c\fR, \fB\-\-calc\fR=\fIOPERATION\fR 57 | calc operation 58 | .TP 59 | \fB\-t\fR, \fB\-\-op_type\fR=\fITYPE\fR 60 | calc operands type 61 | .TP 62 | \fB\-o\fR, \fB\-\-operands\fR=\fIO1,O2...\fR 63 | comma separated list of operands 64 | .TP 65 | \fB\-w\fR, \fB\-\-wait_cq\fR=\fIWAIT\fR 66 | wait for enties on CQ 67 | .TP 68 | \fB\-g\fR, \fB\-\-gid-index\fR=\fIGID_INDEX\fR 69 | gid index to use 70 | .TP 71 | \fB\-G\fR, \fB\-\-dgid\fR=\fIDGID\fR 72 | remote GID. Mandatory if gid index is given 73 | 74 | .SH SEE ALSO 75 | .BR ibv_uc_pingpong (1), 76 | .BR ibv_ud_pingpong (1), 77 | .BR ibv_srq_pingpong (1) 78 | 79 | .SH AUTHORS 80 | .TP 81 | Igor Ivanov 82 | .RI < Igor.Ivanov@itseez.com > 83 | .TP 84 | Roland Dreier 85 | .RI < rolandd@cisco.com > 86 | -------------------------------------------------------------------------------- /man/ibv_create_ah.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_AH 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_create_ah, ibv_destroy_ah \- create or destroy an address handle (AH) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_ah *ibv_create_ah(struct ibv_pd " "*pd" ", 11 | .BI " struct ibv_ah_attr " "*attr" "); 12 | .sp 13 | .BI "int ibv_destroy_ah(struct ibv_ah " "*ah" "); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_create_ah() 17 | creates an address handle (AH) associated with the protection domain 18 | .I pd\fR. 19 | The argument 20 | .I attr 21 | is an ibv_ah_attr struct, as defined in . 22 | .PP 23 | .nf 24 | struct ibv_ah_attr { 25 | .in +8 26 | struct ibv_global_route grh; /* Global Routing Header (GRH) attributes */ 27 | uint16_t dlid; /* Destination LID */ 28 | uint8_t sl; /* Service Level */ 29 | uint8_t src_path_bits; /* Source path bits */ 30 | uint8_t static_rate; /* Maximum static rate */ 31 | uint8_t is_global; /* GRH attributes are valid */ 32 | uint8_t port_num; /* Physical port number */ 33 | .in -8 34 | }; 35 | .sp 36 | .nf 37 | struct ibv_global_route { 38 | .in +8 39 | union ibv_gid dgid; /* Destination GID or MGID */ 40 | uint32_t flow_label; /* Flow label */ 41 | uint8_t sgid_index; /* Source GID index */ 42 | uint8_t hop_limit; /* Hop limit */ 43 | uint8_t traffic_class; /* Traffic class */ 44 | .in -8 45 | }; 46 | .fi 47 | .sp 48 | .PP 49 | .B ibv_destroy_ah() 50 | destroys the AH 51 | .I ah\fR. 52 | .SH "RETURN VALUE" 53 | .B ibv_create_ah() 54 | returns a pointer to the created AH, or NULL if the request fails. 55 | .PP 56 | .B ibv_destroy_ah() 57 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 58 | .SH "SEE ALSO" 59 | .BR ibv_alloc_pd (3), 60 | .BR ibv_init_ah_from_wc (3), 61 | .BR ibv_create_ah_from_wc (3) 62 | .SH "AUTHORS" 63 | .TP 64 | Dotan Barak 65 | -------------------------------------------------------------------------------- /man/ibv_create_ah_from_wc.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_AH_FROM_WC 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_init_ah_from_wc, ibv_create_ah_from_wc \- initialize or create an 6 | address handle (AH) from a work completion 7 | .SH "SYNOPSIS" 8 | .nf 9 | .B #include 10 | .sp 11 | .BI "int ibv_init_ah_from_wc(struct ibv_context " "*context" ", uint8_t " "port_num" , 12 | .BI " struct ibv_wc " "*wc" ", struct ibv_grh " "*grh" , 13 | .BI " struct ibv_ah_attr " "*ah_attr" ); 14 | .sp 15 | .BI "struct ibv_ah *ibv_create_ah_from_wc(struct ibv_pd " "*pd" , 16 | .BI " struct ibv_wc " "*wc" , 17 | .BI " struct ibv_grh " "*grh" , 18 | .BI " uint8_t " "port_num" ); 19 | .fi 20 | .SH "DESCRIPTION" 21 | .B ibv_init_ah_from_wc() 22 | initializes the address handle (AH) attribute structure 23 | .I ah_attr 24 | for the RDMA device context 25 | .I context 26 | using the port number 27 | .I port_num\fR, 28 | using attributes from the work completion 29 | .I wc 30 | and the Global Routing Header (GRH) structure 31 | .I grh\fR. 32 | .PP 33 | .B ibv_create_ah_from_wc() 34 | creates an AH associated with the protection domain 35 | .I pd 36 | using the port number 37 | .I port_num\fR, 38 | using attributes from the work completion 39 | .I wc 40 | and the Global Routing Header (GRH) structure 41 | .I grh\fR. 42 | .SH "RETURN VALUE" 43 | .B ibv_init_ah_from_wc() 44 | returns 0 on success, and \-1 on error. 45 | .PP 46 | .B ibv_create_ah_from_wc() 47 | returns a pointer to the created AH, or NULL if the request fails. 48 | .SH "NOTES" 49 | The filled structure 50 | .I ah_attr 51 | returned from 52 | .B ibv_init_ah_from_wc() 53 | can be used to create a new AH using 54 | .B ibv_create_ah()\fR. 55 | .SH "SEE ALSO" 56 | .BR ibv_open_device (3), 57 | .BR ibv_alloc_pd (3), 58 | .BR ibv_create_ah (3), 59 | .BR ibv_destroy_ah (3), 60 | .BR ibv_poll_cq (3) 61 | .SH "AUTHORS" 62 | .TP 63 | Dotan Barak 64 | -------------------------------------------------------------------------------- /man/ibv_create_comp_channel.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_COMP_CHANNEL 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_create_comp_channel, ibv_destroy_comp_channel \- create or 6 | destroy a completion event channel 7 | .SH "SYNOPSIS" 8 | .nf 9 | .B #include 10 | .sp 11 | .BI "struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context 12 | .BI " " "*context" ); 13 | .sp 14 | .BI "int ibv_destroy_comp_channel(struct ibv_comp_channel " "*channel" ); 15 | .fi 16 | .SH "DESCRIPTION" 17 | .B ibv_create_comp_channel() 18 | creates a completion event channel for the RDMA device context 19 | .I context\fR. 20 | .PP 21 | .B ibv_destroy_comp_channel() 22 | destroys the completion event channel 23 | .I channel\fR. 24 | .SH "RETURN VALUE" 25 | .B ibv_create_comp_channel() 26 | returns a pointer to the created completion event channel, or NULL if the request fails. 27 | .PP 28 | .B ibv_destroy_comp_channel() 29 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 30 | .SH "NOTES" 31 | A "completion channel" is an abstraction introduced by libibverbs that 32 | does not exist in the InfiniBand Architecture verbs specification or 33 | RDMA Protocol Verbs Specification. A completion channel is 34 | essentially file descriptor that is used to deliver completion 35 | notifications to a userspace process. When a completion event is 36 | generated for a completion queue (CQ), the event is delivered via the 37 | completion channel attached to that CQ. This may be useful to steer 38 | completion events to different threads by using multiple completion 39 | channels. 40 | .PP 41 | .B ibv_destroy_comp_channel() 42 | fails if any CQs are still associated with the completion event 43 | channel being destroyed. 44 | .SH "SEE ALSO" 45 | .BR ibv_open_device (3), 46 | .BR ibv_create_cq (3), 47 | .BR ibv_get_cq_event (3) 48 | .SH "AUTHORS" 49 | .TP 50 | Dotan Barak 51 | -------------------------------------------------------------------------------- /man/ibv_create_cq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_CQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_create_cq, ibv_destroy_cq \- create or destroy a completion queue (CQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_cq *ibv_create_cq(struct ibv_context " "*context" ", int " "cqe" , 11 | .BI " void " "*cq_context" , 12 | .BI " struct ibv_comp_channel " "*channel" , 13 | .BI " int " "comp_vector" ); 14 | .sp 15 | .BI "int ibv_destroy_cq(struct ibv_cq " "*cq" ); 16 | .fi 17 | .SH "DESCRIPTION" 18 | .B ibv_create_cq() 19 | creates a completion queue (CQ) with at least 20 | .I cqe 21 | entries for the RDMA device context 22 | .I context\fR. 23 | The pointer 24 | .I cq_context 25 | will be used to set user context pointer of the CQ structure. The argument 26 | .I channel 27 | is optional; if not NULL, the completion channel 28 | .I channel 29 | will be used to return completion events. The CQ will use the 30 | completion vector 31 | .I comp_vector 32 | for signaling completion events; it must be at least zero and less than 33 | .I context\fR->num_comp_vectors. 34 | .PP 35 | .B ibv_destroy_cq() 36 | destroys the CQ 37 | .I cq\fR. 38 | .SH "RETURN VALUE" 39 | .B ibv_create_cq() 40 | returns a pointer to the CQ, or NULL if the request fails. 41 | .PP 42 | .B ibv_destroy_cq() 43 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 44 | .SH "NOTES" 45 | .B ibv_create_cq() 46 | may create a CQ with size greater than or equal to the requested 47 | size. Check the cqe attribute in the returned CQ for the actual size. 48 | .PP 49 | .B ibv_destroy_cq() 50 | fails if any queue pair is still associated with this CQ. 51 | .SH "SEE ALSO" 52 | .BR ibv_resize_cq (3), 53 | .BR ibv_req_notify_cq (3), 54 | .BR ibv_ack_cq_events (3), 55 | .BR ibv_create_qp (3) 56 | .SH "AUTHORS" 57 | .TP 58 | Dotan Barak 59 | -------------------------------------------------------------------------------- /man/ibv_create_qp.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_QP 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_create_qp, ibv_destroy_qp \- create or destroy a queue pair (QP) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_qp *ibv_create_qp(struct ibv_pd " "*pd" , 11 | .BI " struct ibv_qp_init_attr " "*qp_init_attr" ); 12 | .sp 13 | .BI "int ibv_destroy_qp(struct ibv_qp " "*qp" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_create_qp() 17 | creates a queue pair (QP) associated with the protection domain 18 | .I pd\fR. 19 | The argument 20 | .I qp_init_attr 21 | is an ibv_qp_init_attr struct, as defined in . 22 | .PP 23 | .nf 24 | struct ibv_qp_init_attr { 25 | .in +8 26 | void *qp_context; /* Associated context of the QP */ 27 | struct ibv_cq *send_cq; /* CQ to be associated with the Send Queue (SQ) */ 28 | struct ibv_cq *recv_cq; /* CQ to be associated with the Receive Queue (RQ) */ 29 | struct ibv_srq *srq; /* SRQ handle if QP is to be associated with an SRQ, otherwise NULL */ 30 | struct ibv_qp_cap cap; /* QP capabilities */ 31 | enum ibv_qp_type qp_type; /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_UC, IBV_QPT_UD or IBV_QPT_RAW_PACKET */ 32 | int sq_sig_all; /* If set, each Work Request (WR) submitted to the SQ generates a completion entry */ 33 | .in -8 34 | }; 35 | .sp 36 | .nf 37 | struct ibv_qp_cap { 38 | .in +8 39 | uint32_t max_send_wr; /* Requested max number of outstanding WRs in the SQ */ 40 | uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */ 41 | uint32_t max_send_sge; /* Requested max number of scatter/gather (s/g) elements in a WR in the SQ */ 42 | uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the SQ */ 43 | uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */ 44 | .in -8 45 | }; 46 | .fi 47 | .PP 48 | The function 49 | .B ibv_create_qp() 50 | will update the 51 | .I qp_init_attr\fB\fR->cap 52 | struct with the actual \s-1QP\s0 values of the QP that was created; 53 | the values will be greater than or equal to the values requested. 54 | .PP 55 | .B ibv_destroy_qp() 56 | destroys the QP 57 | .I qp\fR. 58 | .SH "RETURN VALUE" 59 | .B ibv_create_qp() 60 | returns a pointer to the created QP, or NULL if the request fails. 61 | Check the QP number (\fBqp_num\fR) in the returned QP. 62 | .PP 63 | .B ibv_destroy_qp() 64 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 65 | .SH "NOTES" 66 | .PP 67 | The attributes max_recv_wr and max_recv_sge are ignored by 68 | .B ibv_create_qp() 69 | if the QP is to be associated with an SRQ. 70 | .PP 71 | .B ibv_destroy_qp() 72 | fails if the QP is attached to a multicast group. 73 | .SH "SEE ALSO" 74 | .BR ibv_alloc_pd (3), 75 | .BR ibv_modify_qp (3), 76 | .BR ibv_query_qp (3) 77 | .SH "AUTHORS" 78 | .TP 79 | Dotan Barak 80 | -------------------------------------------------------------------------------- /man/ibv_create_qp_ex.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_QP_EX 3 2014-04-27 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_create_qp_ex, ibv_destroy_qp \- create or destroy a queue pair (QP) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_qp *ibv_create_qp_ex(struct ibv_context " "*context" , 11 | .BI " struct ibv_qp_init_attr_ex " "*qp_init_attr_ex" ); 12 | .sp 13 | .BI "int ibv_destroy_qp(struct ibv_qp " "*qp" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_create_qp_ex() 17 | creates a queue pair (QP) associated with the protection domain 18 | .I pd\fR. 19 | The argument 20 | .I qp_init_attr_ex 21 | is an ibv_qp_init_attr_ex struct, as defined in . 22 | .PP 23 | .nf 24 | struct ibv_qp_init_attr_ex { 25 | .in +8 26 | void *qp_context; /* Associated context of the QP */ 27 | struct ibv_cq *send_cq; /* CQ to be associated with the Send Queue (SQ) */ 28 | struct ibv_cq *recv_cq; /* CQ to be associated with the Receive Queue (RQ) */ 29 | struct ibv_srq *srq; /* SRQ handle if QP is to be associated with an SRQ, otherwise NULL */ 30 | struct ibv_qp_cap cap; /* QP capabilities */ 31 | enum ibv_qp_type qp_type; /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_UC, IBV_QPT_UD or IBV_QPT_RAW_PACKET */ 32 | int sq_sig_all; /* If set, each Work Request (WR) submitted to the SQ generates a completion entry */ 33 | uint32_t comp_mask; /* Identifies valid fields */ 34 | struct ibv_pd *pd; /* PD to be associated with the QP */ 35 | struct ibv_xrcd *xrcd; /* XRC domain to be associated with the target QP */ 36 | .in -8 37 | }; 38 | .sp 39 | .nf 40 | struct ibv_qp_cap { 41 | .in +8 42 | uint32_t max_send_wr; /* Requested max number of outstanding WRs in the SQ */ 43 | uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */ 44 | uint32_t max_send_sge; /* Requested max number of scatter/gather (s/g) elements in a WR in the SQ */ 45 | uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the SQ */ 46 | uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */ 47 | .in -8 48 | }; 49 | .fi 50 | .PP 51 | The function 52 | .B ibv_create_qp_ex() 53 | will update the 54 | .I qp_init_attr_ex\fB\fR->cap 55 | struct with the actual \s-1QP\s0 values of the QP that was created; 56 | the values will be greater than or equal to the values requested. 57 | .PP 58 | .B ibv_destroy_qp() 59 | destroys the QP 60 | .I qp\fR. 61 | .SH "RETURN VALUE" 62 | .B ibv_create_qp_ex() 63 | returns a pointer to the created QP, or NULL if the request fails. 64 | Check the QP number (\fBqp_num\fR) in the returned QP. 65 | .PP 66 | .B ibv_destroy_qp() 67 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 68 | .SH "NOTES" 69 | .PP 70 | The attributes max_recv_wr and max_recv_sge are ignored by 71 | .B ibv_create_qp_ex() 72 | if the QP is to be associated with an SRQ. 73 | .PP 74 | .B ibv_destroy_qp() 75 | fails if the QP is attached to a multicast group. 76 | .SH "SEE ALSO" 77 | .BR ibv_alloc_pd (3), 78 | .BR ibv_modify_qp (3), 79 | .BR ibv_query_qp (3) 80 | .SH "AUTHORS" 81 | .TP 82 | Yishai Hadas 83 | .TP 84 | Majd Dibbiny 85 | .TP 86 | Moshe Lazer 87 | -------------------------------------------------------------------------------- /man/ibv_create_srq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_SRQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_create_srq, ibv_destroy_srq \- create or destroy a shared receive queue (SRQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_srq *ibv_create_srq(struct ibv_pd " "*pd" ", struct " 11 | .BI " ibv_srq_init_attr " "*srq_init_attr" ); 12 | .sp 13 | .BI "int ibv_destroy_srq(struct ibv_srq " "*srq" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_create_srq() 17 | creates a shared receive queue (SRQ) associated with the protection domain 18 | .I pd\fR. 19 | The argument 20 | .I srq_init_attr 21 | is an ibv_srq_init_attr struct, as defined in . 22 | .PP 23 | .nf 24 | struct ibv_srq_init_attr { 25 | .in +8 26 | void *srq_context; /* Associated context of the SRQ */ 27 | struct ibv_srq_attr attr; /* SRQ attributes */ 28 | .in -8 29 | }; 30 | .sp 31 | .nf 32 | struct ibv_srq_attr { 33 | .in +8 34 | uint32_t max_wr; /* Requested max number of outstanding work requests (WRs) in the SRQ */ 35 | uint32_t max_sge; /* Requested max number of scatter elements per WR */ 36 | uint32_t srq_limit; /* The limit value of the SRQ (irrelevant for ibv_create_srq) */ 37 | .in -8 38 | }; 39 | .fi 40 | .PP 41 | The function 42 | .B ibv_create_srq() 43 | will update the 44 | .I srq_init_attr 45 | struct with the original values of the SRQ that was created; the 46 | values of max_wr and max_sge will be greater than or equal to the 47 | values requested. 48 | .PP 49 | .B ibv_destroy_srq() 50 | destroys the SRQ 51 | .I srq\fR. 52 | .SH "RETURN VALUE" 53 | .B ibv_create_srq() 54 | returns a pointer to the created SRQ, or NULL if the request fails. 55 | .PP 56 | .B ibv_destroy_srq() 57 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 58 | .SH "NOTES" 59 | .B ibv_destroy_srq() 60 | fails if any queue pair is still associated with this SRQ. 61 | .SH "SEE ALSO" 62 | .BR ibv_alloc_pd (3), 63 | .BR ibv_modify_srq (3), 64 | .BR ibv_query_srq (3) 65 | .SH "AUTHORS" 66 | .TP 67 | Dotan Barak 68 | -------------------------------------------------------------------------------- /man/ibv_create_srq_ex.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_CREATE_SRQ_EX 3 2013-06-26 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_create_srq_ex, ibv_destroy_srq \- create or destroy a shared receive queue (SRQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_srq *ibv_create_srq_ex(struct ibv_context " "*context" ", struct " 11 | .BI " ibv_srq_init_attr_ex " "*srq_init_attr_ex" ); 12 | .sp 13 | .BI "int ibv_destroy_srq(struct ibv_srq " "*srq" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_create_srq_ex() 17 | creates a shared receive queue (SRQ) supporting both basic and xrc modes. 18 | The argument 19 | .I srq_init_attr_ex 20 | is an ibv_srq_init_attr_ex struct, as defined in . 21 | .PP 22 | .nf 23 | struct ibv_srq_init_attr_ex { 24 | .in +8 25 | void *srq_context; /* Associated context of the SRQ */ 26 | struct ibv_srq_attr attr; /* SRQ attributes */ 27 | uint32_t comp_mask; /* Identifies valid fields */ 28 | enum ibv_srq_type srq_type; /* Basic / XRC */ 29 | struct ibv_pd *pd; /* PD associated with the SRQ */ 30 | struct ibv_xrcd *xrcd; /* XRC domain to associate with the SRQ */ 31 | struct ibv_cq *cq; /* CQ to associate with the SRQ for XRC mode */ 32 | .in -8 33 | }; 34 | .sp 35 | .nf 36 | struct ibv_srq_attr { 37 | .in +8 38 | uint32_t max_wr; /* Requested max number of outstanding work requests (WRs) in the SRQ */ 39 | uint32_t max_sge; /* Requested max number of scatter elements per WR */ 40 | uint32_t srq_limit; /* The limit value of the SRQ */ 41 | .in -8 42 | }; 43 | .fi 44 | .PP 45 | The function 46 | .B ibv_create_srq_ex() 47 | will update the 48 | .I srq_init_attr_ex 49 | struct with the original values of the SRQ that was created; the 50 | values of max_wr and max_sge will be greater than or equal to the 51 | values requested. 52 | .PP 53 | .B ibv_destroy_srq() 54 | destroys the SRQ 55 | .I srq\fR. 56 | .SH "RETURN VALUE" 57 | .B ibv_create_srq_ex() 58 | returns a pointer to the created SRQ, or NULL if the request fails. 59 | .PP 60 | .B ibv_destroy_srq() 61 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 62 | .SH "NOTES" 63 | .B ibv_destroy_srq() 64 | fails if any queue pair is still associated with this SRQ. 65 | .SH "SEE ALSO" 66 | .BR ibv_alloc_pd (3), 67 | .BR ibv_modify_srq (3), 68 | .BR ibv_query_srq (3) 69 | .SH "AUTHORS" 70 | .TP 71 | Yishai Hadas 72 | -------------------------------------------------------------------------------- /man/ibv_devices.1: -------------------------------------------------------------------------------- 1 | .TH IBV_DEVICES 1 "August 30, 2005" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_devices \- list RDMA devices 5 | 6 | .SH SYNOPSIS 7 | .B ibv_devices 8 | 9 | .SH DESCRIPTION 10 | .PP 11 | List RDMA devices available for use from userspace. 12 | 13 | .SH SEE ALSO 14 | .BR ibv_devinfo (1) 15 | 16 | .SH AUTHORS 17 | .TP 18 | Roland Dreier 19 | .RI < rolandd@cisco.com > 20 | -------------------------------------------------------------------------------- /man/ibv_devinfo.1: -------------------------------------------------------------------------------- 1 | .TH IBV_DEVINFO 1 "August 30, 2005" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_devinfo \- query RDMA devices 5 | 6 | .SH SYNOPSIS 7 | .B ibv_devinfo 8 | [\-d device] [\-i port] [\-l] [\-v] 9 | 10 | .SH DESCRIPTION 11 | .PP 12 | Print information about RDMA devices available for use from userspace. 13 | 14 | .SH OPTIONS 15 | 16 | .PP 17 | .TP 18 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 19 | use IB device \fIDEVICE\fR (default first device found) 20 | 21 | \fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR 22 | query port \fIPORT\fR (default all ports) 23 | 24 | \fB\-l\fR, \fB\-\-list\fR 25 | only list names of RDMA devices 26 | 27 | \fB\-v\fR, \fB\-\-verbose\fR 28 | print all available information about RDMA devices 29 | 30 | .SH SEE ALSO 31 | .BR ibv_devices (1) 32 | 33 | .SH AUTHORS 34 | .TP 35 | Dotan Barak 36 | .RI < dotanba@gmail.com > 37 | .TP 38 | Roland Dreier 39 | .RI < rolandd@cisco.com > 40 | -------------------------------------------------------------------------------- /man/ibv_event_type_str.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EVENT_TYPE_STR 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | .nf 6 | ibv_event_type_str \- Return string describing event_type enum value 7 | .sp 8 | ibv_node_type_str \- Return string describing node_type enum value 9 | .sp 10 | ibv_port_state_str \- Return string describing port_state enum value 11 | .SH "SYNOPSIS" 12 | .nf 13 | .B #include 14 | .sp 15 | .BI "const char *ibv_event_type_str(enum ibv_event_type " "event_type"); 16 | .sp 17 | .BI "const char *ibv_node_type_str(enum ibv_node_type " "node_type"); 18 | .sp 19 | .BI "const char *ibv_port_state_str(enum ibv_port_state " "port_state"); 20 | .fi 21 | .SH "DESCRIPTION" 22 | .B ibv_node_type_str() 23 | returns a string describing the node type enum value 24 | .IR node_type . 25 | .PP 26 | .B ibv_port_state_str() 27 | returns a string describing the port state enum value 28 | .IR port_state . 29 | .PP 30 | .B ibv_event_type_str() 31 | returns a string describing the event type enum value 32 | .IR event_type . 33 | .SH "RETURN VALUE" 34 | These functions return a constant string that describes the enum value 35 | passed as their argument. 36 | .SH "AUTHOR" 37 | .TP 38 | Roland Dreier 39 | .RI < rolandd@cisco.com > 40 | 41 | -------------------------------------------------------------------------------- /man/ibv_exp_alloc_dm.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_ALLOC_DM 3 2017-07-25 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_alloc_dm, ibv_exp_free_dm, ibv_exp_memcpy_dm \- allocate or free a device memory buffer (DMs) and perform memory copy to or 6 | from it 7 | .SH "SYNOPSIS" 8 | .nf 9 | .B #include 10 | .sp 11 | .BI "struct ibv_exp_dm *ibv_exp_alloc_dm(struct ibv_context " "*context", 12 | .BI " struct ibv_alloc_dm_attr " "*attr"); 13 | .sp 14 | .BI "int ibv_exp_free_dm(struct ibv_exp_dm " "*dm"); 15 | .sp 16 | .BI "int ibv_exp_memcpy_dm(struct ibv_exp_dm " "*dm", 17 | .BI " struct ibv_memcpy_dm_attr " "*attr"); 18 | .fi 19 | .SH "DESCRIPTION" 20 | .B ibv_exp_alloc_dm() 21 | allocates a device memory buffer for the RDMA device context 22 | .I context\fR. 23 | The argument 24 | .I attr 25 | is a pointer to an ibv_exp_alloc_dm_attr struct, as defined in . 26 | .PP 27 | .B ibv_exp_free_dm() 28 | free the device memory buffer 29 | .I dm\fR. 30 | .PP 31 | .B ibv_exp_memcpy_dm() 32 | Copy to/from device memory buffer 33 | .I dm 34 | from/to a host memory buffer. 35 | The argument 36 | .I attr 37 | is a pointer to an ibv_exp_memcpy_dm_attr struct, as define in . 38 | .nf 39 | 40 | struct ibv_exp_alloc_dm_attr { 41 | .in +8 42 | size_t length; /* Length of desired device memory buffer *. 43 | uint32_t comp_mask; /* Compatibility mask that defines which of the following variables are valid */ 44 | .in -8 45 | }; 46 | 47 | struct ibv_exp_memcpy_dm_attr { 48 | .in +8 49 | enum ibv_exp_dm_memcpy_dir memcpy_dir; /* Copy type and direction */ 50 | void *host_addr; /* Host memory address pointer. */ 51 | uint64_t dm_offset; /* Offset within the allocated device memory buffer to start the copy operation from. */ 52 | size_t length; /* The length, in bytes, to copy. */ 53 | uint32_t comp_mask; /* Compatibility mask that defines which of the following variables are valid */ 54 | .in -8 55 | }; 56 | 57 | enum ibv_exp_dm_memcpy_dir { 58 | .in +8 59 | IBV_EXP_DM_CPY_TO_DEVICE, /* Copy direction is from host to device memory */ 60 | IBV_EXP_DM_CPY_TO_HOST, /* Copy direction is from device to host memory */ 61 | .in -8 62 | }; 63 | .fi 64 | .SH "RETURN VALUE" 65 | .B ibv_exp_alloc_dm() 66 | returns a pointer to the allocated device memory buffer, or NULL if the request fails. 67 | .PP 68 | .B ibv_exp_free_dm() 69 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 70 | .B ibv_exp_alloc_dm() 71 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 72 | .PP 73 | .SH "NOTES" 74 | .B ibv_exp_alloc_dm() 75 | may fail if the desired allocation length doesn't fit device specific allocation constrains 76 | such as minimum allocation length and length alignment. It may also fail if device has no more 77 | free device memory left, where the maximum amount of allocated memory is provided by the 78 | .I max_dm_size\fR attribute in 79 | .I ibv_device_attr_ex\fR struct. 80 | .PP 81 | .B ibv_exp_free_dm() 82 | may fail if any other resource (MR) is still associated with the DM being 83 | freed. 84 | .PP 85 | .B ibv_exp_memcpy_dm() 86 | may fail if copy attributes exceed allocated buffer size and/or access constrains are not met 87 | (such as minimum copy size, address alignment). 88 | .SH "SEE ALSO" 89 | .BR ibv_exp_query_device (3), 90 | .SH "AUTHORS" 91 | .TP 92 | Ariel Levkovich 93 | -------------------------------------------------------------------------------- /man/ibv_exp_alloc_mkey_list_memory.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_ALLOC_MKEY_LIST_MOMORY 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_alloc_mkey_list_memory \- allocates a buffer for UMR when using non-inline registration 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_exp_mkey_list_container *ibv_exp_alloc_mkey_list_memory(struct ibv_exp_mkey_list_container_attr " "*attr" ); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_alloc_mkey_list_memory() 14 | allocates a buffer for non-inline UMR registration associated with 15 | The protection domain (PD) 16 | .I attr->pd\fR. 17 | and of type 18 | .I attr->mkey_list_type 19 | with attr 20 | .I attr->max_klm_list_size\fR. 21 | maximum number of KLMs used to create UMR 22 | .PP 23 | The argument 24 | .I attr 25 | is an ibv_exp_mkey_list_container_attr struct, as defined in . 26 | .PP 27 | .nf 28 | struct ibv_exp_list_container_attr { 29 | .in +8 30 | struct ibv_pd *pd; /* protection domain (PD) associated with the UMR */ 31 | uint32_t mkey_list_type; /* use ibv_exp_mkey_list_type */ 32 | uint32_t max_klm_list_size; /* maximum number of MRs we can use to create the UMR */ 33 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 34 | .in -8 35 | }; 36 | 37 | .fi 38 | .I attr->mkey_list_type 39 | describes type of UMR we want to create; it is one of the following flags: 40 | .PP 41 | .TP 42 | .B IBV_EXP_MKEY_LIST_TYPE_INDIRECT_MR \fR indirect UMR Type 43 | .PP 44 | .SH "RETURN VALUE" 45 | .B ibv_exp_alloc_mkey_list_memory() 46 | returns a pointer to struct ibv_exp_mkey_list_container, or NULL if the request fails. 47 | 48 | .SH "NOTES" 49 | .PP 50 | We need this struct only if we want to Fill the UMR using non-inline post send 51 | .PP 52 | .SH "SEE ALSO" 53 | .BR ibv_alloc_pd (3), 54 | .BR ibv_exp_dealloc_mkey_list_memory (3), 55 | .BR ibv_post_send (3), 56 | .BR ibv_exp_create_mr (3) 57 | .SH "AUTHORS" 58 | .TP 59 | Haggai Abramovsky 60 | -------------------------------------------------------------------------------- /man/ibv_exp_bind_mw.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_BIND_MW 3 2014-04-27 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_bind_mw \- post a request to bind a type 1 memory window to a memory region 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_bind_mw(struct ibv_exp_mw_bind " "*mw_bind" ); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_bind_mw() 14 | posts to the queue pair 15 | .I mw_bind->qp 16 | a request to bind the memory window 17 | .I mw_bind->mw 18 | according to the details in 19 | .I mw_bind\fR. 20 | .PP 21 | The argument 22 | .I mw_bind 23 | is an ibv_exp_mw_bind struct, as defined in . 24 | .PP 25 | .nf 26 | struct ibv_exp_mw_bind { 27 | .in +8 28 | struct ibv_qp *qp; 29 | struct ibv_mw *mw; 30 | uint64_t wr_id; /* User defined WR ID */ 31 | uint64_t exp_send_flags; /* Use ibv_exp_send_flags */ 32 | struct ibv_exp_mw_bind_info bind_info; 33 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 34 | .in -8 35 | }; 36 | .PP 37 | struct ibv_exp_mw_bind_info { 38 | .in +8 39 | struct ibv_mr *mr; /* The MR to bind the MW to */ 40 | uint64_t addr; /* The address the MW should start at */ 41 | uint64_t length; /* The length (in byte) the MW should span */ 42 | uint64_t exp_mw_access_flags; /* Access flags to the MW. Use ibv_exp_access_flags */ 43 | .in -8 44 | }; 45 | 46 | .fi 47 | .PP 48 | The QP Transport Service Type must be either UC or RC for bind operations. 49 | .PP 50 | The attribute exp_send_flags describes the properties of the \s-1WR\s0. It is either 0 or the bitwise \s-1OR\s0 of one or more of the following flags: 51 | .PP 52 | .TP 53 | .B IBV_EXP_SEND_FENCE \fR Set the fence indicator. Valid only for QPs with Transport Service Type \fBIBV_QPT_RC 54 | .TP 55 | .B IBV_EXP_SEND_SIGNALED \fR Set the completion notification indicator. Relevant only if QP was created with sq_sig_all=0 56 | .TP 57 | .B IBV_EXP_SEND_SOLICITED \fR Set the solicited event indicator. Valid only for Send and RDMA Write with immediate 58 | .PP 59 | The exp_mw_access_flags define the allowed access to the MW after the bind 60 | completes successfully. It is either 0 or the bitwise \s-1OR\s0 of one 61 | or more of the following flags: 62 | .TP 63 | .B IBV_EXP_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access. Requires local write access to the MR. 64 | .TP 65 | .B IBV_EXP_ACCESS_REMOTE_READ\fR Enable Remote Read Access 66 | .TP 67 | .B IBV_EXP_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported). Requires local write access to the MR. 68 | .TP 69 | .B IBV_EXP_ACCESS_MW_ZERO_BASED\fR If set, the address given in post send is offset from the MW's start address. 70 | .SH "RETURN VALUE" 71 | .B ibv_exp_bind_mw() 72 | returns 0 on success, or the value of errno on failure (which 73 | indicates the failure reason). In case of a success, the R_Key of the 74 | memory window after the bind is returned in the mw_bind->mw->rkey field. 75 | .SH "NOTES" 76 | The bind does not complete when the function return - it is merely 77 | posted to the QP. The user should keep a copy of the old R_Key, and 78 | fix the mw structure if the subsequent CQE for the bind operation 79 | indicates a failure. The user may safely send the R_Key using a send 80 | request on the same QP, but must not transfer it to the remote in any 81 | other manner before reading a successful CQE. 82 | .PP 83 | Note that for type 2 MW, one should directly post bind WQE to the QP, 84 | using ibv_post_send. 85 | .SH "SEE ALSO" 86 | .BR ibv_alloc_mw (3), 87 | .BR ibv_post_send (3), 88 | .BR ibv_poll_cq (3) 89 | .BR ibv_reg_mr (3), 90 | .SH "AUTHORS" 91 | .TP 92 | Haggai Eran 93 | .TP 94 | Shachar Raindel 95 | .TP 96 | Yaniv Saar 97 | .TP 98 | Majd Dibbiny 99 | .TP 100 | Moshe Lazer 101 | -------------------------------------------------------------------------------- /man/ibv_exp_cqe_ts_to_ns.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_CQE_TS_TO_NS 3 2017-05-25 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_cqe_to_ns \- translate hw timestamp to nano-seconds 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "static inline uint64_t ibv_exp_cqe_ts_to_ns(struct ibv_exp_clock_info " "*clock_info" ", 11 | .BI " uint64_t " "ts"); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_exp_cqe_ts_to_ns() 15 | translates the HW timestamp value in \fBts\fR to nano-seconds using the provided translation 16 | object \fBclock_info\fR. See \fBibv_exp_query_values\fR for details how to create a 17 | translation object. 18 | .SH "RETURN VALUE" 19 | .B ibv_exp_cqe_ts_to_ns() 20 | returns ts translated to nano-seconds, or 0 on error (errno will contain the 21 | error value). 22 | .SH "NOTES" 23 | While the implementation may vary from hardware to hardware it is recommended to update the 24 | clock_info object at least once a second prior to its use in order to improve the accuracy 25 | of the translation. 26 | .SH "SEE ALSO" 27 | .BR ibv_exp_query_values (3), 28 | .SH "AUTHORS" 29 | .TP 30 | Eitan Rabin 31 | -------------------------------------------------------------------------------- /man/ibv_exp_create_cq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_CREATE_CQ 3 2014-04-09 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_create_cq, ibv_destroy_cq \- create or destroy a completion queue (CQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_cq *ibv_exp_create_cq(struct ibv_context " "*context" ", int " "cqe" , 11 | .BI " void " "*cq_context" , 12 | .BI " struct ibv_comp_channel " "*channel" , 13 | .BI " int " "comp_vector" , 14 | .BI " struct ibv_exp_cq_init_attr" " *attr"); 15 | .sp 16 | .BI "int ibv_destroy_cq(struct ibv_cq " "*cq" ); 17 | .fi 18 | .SH "DESCRIPTION" 19 | .fi 20 | .B ibv_exp_create_cq() 21 | creates a completion queue (CQ) with at least 22 | .I cqe 23 | entries for the RDMA device context 24 | .I context\fR. 25 | The pointer 26 | .I cq_context 27 | will be used to set user context pointer of the CQ structure. The argument 28 | .I channel 29 | is optional; if not NULL, the completion channel 30 | .I channel 31 | will be used to return completion events. The CQ will use the 32 | completion vector 33 | .I comp_vector 34 | for signaling completion events; it must be at least zero and less than 35 | .I context\fR->num_comp_vectors. 36 | 37 | The argument 38 | .I attr 39 | is an ibv_exp_cq_init_attr struct, as defined in . 40 | .nf 41 | struct ibv_exp_cq_init_attr { 42 | .in +8 43 | .fi 44 | uint32_t comp_mask; /* Identifies valid fields. Use enum ibv_exp_cq_init_attr_mask */ 45 | .nf 46 | uint32_t flags; /* Flags mask to create CQ with extra features */ 47 | struct ibv_exp_res_domain *res_domain; /* Provides resource domain to indicate the CQ threading and message model */ 48 | /* Create CQ with Peer-direct async support */ 49 | struct ibv_exp_peer_direct_attr *peer_direct_attrs; 50 | .in -8 51 | }; 52 | 53 | enum ibv_exp_cq_init_attr_mask{ 54 | .in +8 55 | IBV_EXP_CQ_INIT_ATTR_FLAGS = 1 << 0, /* Set if attr->flags is valid */ 56 | IBV_EXP_CQ_INIT_ATTR_RES_DOMAIN = 1 << 1, /* Set if attr->res_domain is valid */ 57 | IBV_EXP_CQ_INIT_PEER_DIRECT = 1 << 2, /* Set if attr->peer_direct_attr is valid */ 58 | .in -8 59 | }; 60 | 61 | .fi 62 | .I attr->flags 63 | specifies the CQ features. It is either 0 or the bitwise OR of one or more of the following flags: 64 | .PP 65 | .TP 66 | .B IBV_EXP_CQ_CREATE_CROSS_CHANNEL \fR Create CQ with Cross Channel 67 | .TP 68 | .B IBV_EXP_CQ_TIMESTAMP \fR Return timestamp in WC 69 | .TP 70 | .B IBV_EXP_CQ_TIMESTAMP_TO_SYS_TIME \fR Convert the timestamp in WC to system time (unsupported by mlx4) 71 | .TP 72 | .B IBV_EXP_CQ_COMPRESSED_CQE \fR Work with compressed CQEs 73 | .TP 74 | .B IBV_EXP_CQ_AS_NOTIFY \fR Use PowerPC as_notify interrupt instead of MSI. 75 | 76 | .PP 77 | .B ibv_destroy_cq() 78 | destroys the CQ 79 | .I cq\fR. 80 | .SH "RETURN VALUE" 81 | .B ibv_exp_create_cq() 82 | returns a pointer to the CQ, or NULL if the request fails. 83 | .PP 84 | .B ibv_destroy_cq() 85 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 86 | .SH "NOTES" 87 | .B ibv_exp_create_cq() 88 | may create a CQ with size greater than or equal to the requested 89 | size. Check the cqe attribute in the returned CQ for the actual size. 90 | .PP 91 | .B ibv_destroy_cq() 92 | fails if any queue pair is still associated with this CQ. 93 | .SH "SEE ALSO" 94 | .BR ibv_resize_cq (3), 95 | .BR ibv_req_notify_cq (3), 96 | .BR ibv_ack_cq_events (3), 97 | .BR ibv_create_qp (3), 98 | .BR ibv_exp_create_res_domain (3), 99 | .BR peer_direct (7) 100 | .SH "AUTHORS" 101 | .TP 102 | Dotan Barak 103 | .TP 104 | Majd Dibbiny 105 | .TP 106 | Moshe Lazer 107 | -------------------------------------------------------------------------------- /man/ibv_exp_create_dct.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_CREATE_DCT 3 2013-12-10 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_create_dct \- Create a Dynamically Connected Target (DCT) endpoint. 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_dct *ibv_exp_create_dct(struct ibv_context " "*context," 11 | .BI " struct ibv_exp_dct_init_attr " "*attr" ); 12 | .sp 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_exp_create_dct() 16 | creates a DC target endpoint associated with the ibv_context 17 | .I context\fR. 18 | The argument 19 | .I attr 20 | is an ibv_exp_dct_init_attr struct, as defined in . 21 | .PP 22 | .nf 23 | struct ibv_exp_dct_init_attr { 24 | .in +8 25 | struct ibv_pd *pd; /* PD associated with the protection domain */ 26 | struct ibv_cq *cq; /* CQ used to report receive completions */ 27 | struct ibv_srq *srq; /* The SRQ that will provide receive buffers */ 28 | uint64_t dc_key; /* DC access key (64 bit key) */ 29 | uint8_t port; /* Port number */ 30 | uint32_t access_flags; /* Access flags (IBV_ACCESS_REMOTE_READ/WRITE/ATOMIC) */ 31 | uint8_t min_rnr_timer; /* Min rnr NAK time between successive requests of rejected messages */ 32 | uint8_t tclass; /* Traffic class used in packets sent by the DCT in case GRH is used */ 33 | uint32_t flow_label; /* Flow label used in packets sent by the DCT in case GRH is used */ 34 | enum ibv_mtu mtu; /* MTU of the DCT */ 35 | uint8_t pkey_index; /* PKey index */ 36 | uint8_t gid_index; /* Gid index associated with the DCT (to verify incoming packets if GRH is used) */ 37 | uint8_t hop_limit; /* Hop limit used in packets sent by the DCT in case GRH is used */ 38 | uint32_t inline_size; /* The size requested by the user to be inline received */ 39 | uint32_t create_flags; /* Reserved (must be 0) */ 40 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 41 | .in -8 42 | }; 43 | .fi 44 | .SH "RETURN VALUE" 45 | .B ibv_exp_create_dct() 46 | returns a pointer to the created DCT, or NULL if the request fails. 47 | .SH "AUTHORS" 48 | .TP 49 | Moshe Lazer 50 | .TP 51 | Eli Cohen 52 | .TP 53 | -------------------------------------------------------------------------------- /man/ibv_exp_create_mr.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_CREATE_MR 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_create_mr \- create empty memory region (MR) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_mr *ibv_exp_create_mr(struct ibv_exp_create_mr_in " "*in" ); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_create_mr() 14 | create empty memory region (MR) associated with the protection domain 15 | .I in->pd\fR. 16 | The MR's init attributes are 17 | .I in->attr 18 | and the maximum KLMs we can use to fill it is 19 | .I in->attr.max_klm_list_size\fR. 20 | .PP 21 | The argument 22 | .I in 23 | is an ibv_exp_create_mr_in struct, as defined in . 24 | .PP 25 | .nf 26 | struct ibv_exp_create_mr_in { 27 | .in +8 28 | struct ibv_pd *pd; /* protection domain (PD) associated with the MR */ 29 | struct ibv_exp_mr_init_attr attr; /* Initialization attributes of the memory region (MR) */ 30 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 31 | .in -8 32 | }; 33 | .PP 34 | .fi 35 | The argument 36 | .I in->attr 37 | is an ibv_exp_mr_init_attr struct, as defined in . 38 | .PP 39 | .nf 40 | struct ibv_exp_mr_init_attr { 41 | .in +8 42 | uint32_t max_klm_list_size; /* Maximum number of KLMs we can use to fill the MR */ 43 | uint32_t create_flags; /* use ibv_exp_mr_create_flags */ 44 | uint32_t exp_access_flags; /* reserved for future growth (must be 0) */ 45 | .in -8 46 | }; 47 | 48 | .fi 49 | .I in->attr.exp_access 50 | describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of the following flags: 51 | .PP 52 | .TP 53 | .B IBV_EXP_ACCESS_LOCAL_WRITE \fR Enable Local Write Access 54 | .TP 55 | .B IBV_EXP_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access 56 | .TP 57 | .B IBV_EXP_ACCESS_REMOTE_READ\fR Enable Remote Read Access 58 | .TP 59 | .B IBV_EXP_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported) 60 | .TP 61 | .B IBV_EXP_ACCESS_MW_BIND\fR Enable Memory Window Binding 62 | .TP 63 | .B IBV_EXP_ACCESS_ALLOCATE_MR\fR Request the low level driver to allocate the memory used for backing the MR. Could improve performance in some cases. 64 | .TP 65 | .B IBV_EXP_ACCESS_SHARED_MR_USER_READ\fR Enable sharing this MR for reading by user (application owner). 66 | .TP 67 | .B IBV_EXP_ACCESS_SHARED_MR_USER_WRITE\fR Enable sharing this MR for writing by user. 68 | .TP 69 | .B IBV_EXP_ACCESS_SHARED_MR_GROUP_READ\fR Enable sharing this MR for reading by group (application group). 70 | .TP 71 | .B IBV_EXP_ACCESS_SHARED_MR_GROUP_WRITE\fR Enable sharing this MR for writing by group. 72 | .TP 73 | .B IBV_EXP_ACCESS_SHARED_MR_OTHER_READ\fR Enable sharing this MR for reading by other. 74 | .TP 75 | .B IBV_EXP_ACCESS_SHARED_MR_OTHER_WRITE\fR Enable sharing this MR for writing by other. 76 | .TP 77 | .B IBV_EXP_ACCESS_ON_DEMAND\fR Create an on-demand paging MR. 78 | .PP 79 | If 80 | .B IBV_EXP_ACCESS_REMOTE_WRITE 81 | or 82 | .B IBV_EXP_ACCESS_REMOTE_ATOMIC 83 | is set, then 84 | .B IBV_EXP_ACCESS_LOCAL_WRITE 85 | must be set too. 86 | .PP 87 | Local read access is always enabled for the MR. 88 | .fi 89 | .I in->attr.create_flags 90 | describes the capabilities of the MR we want to create; it is one of the following flags: 91 | .PP 92 | .TP 93 | .B IBV_EXP_MR_INDIRECT_KLMS\fR Enable capabilities of creating KLM using ibv_exp_post_send() 94 | .PP 95 | .SH "RETURN VALUE" 96 | .B ibv_exp_create_mr() 97 | returns a pointer to an empty MR with lkey, or NULL if the request fails. 98 | The local key (\fBL_Key\fR) field 99 | .B lkey 100 | is used as the lkey field of struct ibv_sge when posting buffers with 101 | ibv_post_* verbs, and the remote key (\fBR_Key\fR) 102 | field 103 | .B rkey 104 | is used by remote processes to perform Atomic and RDMA operations. The remote process places this 105 | .B rkey 106 | as the rkey field of struct ibv_send_wr passed to the ibv_post_send function. 107 | 108 | .SH "NOTES" 109 | .PP 110 | The user can't use this MR untill we FILL the MR using 111 | .I ibv_exp_post_send 112 | with opcode 113 | .I IBV_EXP_WR_UMR_FILL 114 | 115 | .SH "SEE ALSO" 116 | .BR ibv_dereg_mr (3), 117 | .BR ibv_exp_reg_mr (3), 118 | .BR ibv_alloc_pd (3), 119 | .BR ibv_post_send (3), 120 | .BR ibv_post_recv (3), 121 | .SH "AUTHORS" 122 | .TP 123 | Haggai Abramovsky 124 | -------------------------------------------------------------------------------- /man/ibv_exp_create_res_domain.3: -------------------------------------------------------------------------------- 1 | .TH IBV_EXP_CREATE_RES_DOMAIN 3 2015-05-25 libibverbs "Libibverbs Programmer's Manual" 2 | .SH "NAME" 3 | ibv_exp_create_res_domain \- create resource domain 4 | .PP 5 | ibv_exp_destroy_res_domain \- destroy resource domain 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .BI "static inline struct ibv_exp_res_domain *ibv_exp_create_res_domain(struct ibv_context " "*context", 10 | .BI " struct ibv_exp_res_domain_init_attr " "*attr" ");" 11 | 12 | .BI "static inline int ibv_exp_destroy_res_domain(struct ibv_context " "*context," 13 | .BI " struct ibv_exp_res_domain " "*res_dom," 14 | .BI " struct ibv_exp_destroy_res_domain_attr " "*attr" ");" 15 | .fi 16 | .SH "DESCRIPTION" 17 | .B ibv_exp_create_res_domain() 18 | Creates resource domain which is a verb object that may be associated with QP and a CQ objects on creation to enhance data-path performance. 19 | .PP 20 | The argument 21 | .I attr 22 | is an ibv_exp_res_domain_init_attr struct, as defined in . 23 | .PP 24 | .nf 25 | enum ibv_exp_thread_model { 26 | IBV_EXP_THREAD_SAFE, /* The lib responsible to protect the object in multithreaded environment */ 27 | IBV_EXP_THREAD_UNSAFE, /* The application responsible to protect the object in multithreaded environment */ 28 | IBV_EXP_THREAD_SINGLE /* The object is called from only one thread */ 29 | }; 30 | 31 | enum ibv_exp_msg_model { 32 | IBV_EXP_MSG_DEFAULT, /* Use the provider default message model */ 33 | IBV_EXP_MSG_LOW_LATENCY, /* Hint the provider to optimize for low latency */ 34 | IBV_EXP_MSG_HIGH_BW, /* Hint the provider to optimize for high bandwidth */ 35 | IBV_EXP_MSG_FORCE_LOW_LATENCY, /* Force the provider to optimize for low latency */ 36 | }; 37 | 38 | enum ibv_exp_res_domain_init_attr_comp_mask { 39 | IBV_EXP_RES_DOMAIN_THREAD_MODEL = (1 << 0), 40 | IBV_EXP_RES_DOMAIN_MSG_MODEL = (1 << 1), 41 | IBV_EXP_RES_DOMAIN_RESERVED = (1 << 2), 42 | }; 43 | 44 | struct ibv_exp_res_domain_init_attr { 45 | uint32_t comp_mask; /* use ibv_exp_res_domain_init_attr_comp_mask */ 46 | enum ibv_exp_thread_model thread_model; 47 | enum ibv_exp_msg_model msg_model; 48 | }; 49 | 50 | .PP 51 | .B ibv_exp_destroy_res_domain() 52 | Destroys the resource domain. 53 | 54 | .SH "RETURN VALUE" 55 | .B ibv_exp_create_res_domain() 56 | returns a pointer to the created resource domain, or NULL if the request fails. 57 | 58 | .PP 59 | .B ibv_exp_destroy_res_domain() 60 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 61 | 62 | .SH "NOTES" 63 | 64 | .SH "SEE ALSO" 65 | .SH "AUTHORS" 66 | .TP 67 | Moshe Lazer 68 | -------------------------------------------------------------------------------- /man/ibv_exp_create_rwq_ind_table.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH CREATE_RWQ_IND_TBL 3 2015-08-04 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_create_rwq_ind_table, ibv_exp_destroy_rwq_ind_table \- create or destroy a Receive Work Queue Indirection Table (RWQ IND TBL). 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_exp_rwq_ind_table *ibv_exp_create_rwq_ind_table(struct ibv_context " "*context," 11 | .BI " struct ibv_exp_rwq_ind_table_init_attr " "*init_attr" ); 12 | .sp 13 | .BI "int ibv_exp_destroy_rwq_ind_table(struct ibv_exp_rwq_ind_table " "*rwq_ind_table" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_exp_create_rwq_ind_table() 17 | creates a RWQ IND TBL associated with the ibv_context 18 | .I context\fR. 19 | The argument 20 | .I init_attr 21 | is an ibv_exp_rwq_ind_table_init_attr struct, as defined in . 22 | .PP 23 | .nf 24 | struct ibv_exp_rwq_ind_table_init_attr { 25 | .in +8 26 | struct ibv_pd *pd; /* PD to be associated with the created object */ 27 | uint32_t log_ind_tbl_size; /* Log, base 2, of Indirection table size */ 28 | struct ibv_exp_wq **ind_tbl; /* Each entry is a pointer to Receive Work Queue */ 29 | uint32_t comp_mask; /* Identifies valid fields. Use ibv_exp_ind_table_init_attr_mask */ 30 | .in -8 31 | }; 32 | .fi 33 | .PP 34 | The function 35 | .B ibv_exp_create_rwq_ind_table() 36 | will create a RWQ IND TBL that holds a table of Receive Work Queue. 37 | For further usage of the created object see below 38 | .I NOTES\fR. 39 | .PP 40 | .B ibv_exp_destroy_rwq_ind_table() 41 | destroys the RWQ IND TBL 42 | .I rwq_ind_table\fR. 43 | .SH "RETURN VALUE" 44 | .B ibv_exp_create_rwq_ind_table() 45 | returns a pointer to the created RWQ IND TBL, or NULL if the request fails. 46 | .PP 47 | .B ibv_exp_destroy_rwq_ind_table() 48 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 49 | .SH "NOTES" 50 | The created object should be used as part of 51 | .I ibv_exp_create_qp() 52 | to enable dispatching of incoming packets based on some RX hash configuration. 53 | .SH "SEE ALSO" 54 | .BR ibv_exp_create_wq (3), 55 | .BR ibv_exp_modify_wq (3), 56 | .BR ibv_exp_create_qp (3), 57 | .SH "AUTHORS" 58 | .TP 59 | Yishai Hadas 60 | -------------------------------------------------------------------------------- /man/ibv_exp_create_srq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_CREATE_SRQ 3 2017-05-07 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_create_srq \- create a a shared receive queue (SRQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_cq *ibv_exp_create_srq(struct ibv_context" " *context" ", struct ibv_exp_create_srq_attr" " *attr"); 11 | .SH "DESCRIPTION" 12 | .fi 13 | .B ibv_exp_create_srq() 14 | creates a shared receive queue (SRQ). The argument 15 | .I attr 16 | is an ibv_exp_create_srq_attr struct, as defined in . 17 | .PP 18 | .nf 19 | struct ibv_exp_create_srq_attr { 20 | .in +8 21 | struct ibv_srq_init_attr base; /* SRQ attributes */ 22 | enum ibv_exp_srq_type srq_type; /* Basic / XRC / tag matching */ 23 | struct ibv_pd *pd; /* PD associated with the SRQ */ 24 | uint32_t comp_mask; /* Identifies valid fields. Use enum ibv_exp_create_srq_comp_mask */ 25 | struct ibv_cq *cq; /* CQ to associate with the SRQ */ 26 | struct ibv_xrcd *xrcd; /* XRC domain to associate with the SRQ */ 27 | struct ibv_exp_tm_cap tm_cap; /* Tag matching attributes */ 28 | struct ibv_exp_mp_wr mp_wr; /* Multi-Packet WR attributes */ 29 | .in -8 30 | }; 31 | 32 | struct ibv_exp_mp_wr { 33 | .in +8 34 | uint8_t log_num_of_strides; /* Log2 number of strides per a MP WR */ 35 | uint8_t log_stride_size; /* Log2 stride size */ 36 | .in -8 37 | }; 38 | 39 | struct ibv_exp_tm_cap { 40 | .in +8 41 | uint32_t max_num_tags; /* Tag matching list size */ 42 | uint32_t max_ops; /* Number of outstanding tag list operations */ 43 | .in -8 44 | }; 45 | .fi 46 | 47 | .SH "RETURN VALUE" 48 | .B ibv_exp_create_srq() 49 | returns a pointer to the SRQ, or NULL if the request fails. 50 | .SH "SEE ALSO" 51 | .BR ibv_exp_post_srq_ops (3) 52 | .SH "AUTHORS" 53 | .TP 54 | Artemy Kovalyov 55 | .TP 56 | Guy Levi 57 | -------------------------------------------------------------------------------- /man/ibv_exp_create_wq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_CREATE_WQ 3 2015-08-04 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_create_wq, ibv_exp_destroy_wq \- create or destroy a Work Queue (WQ). 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_exp_wq *ibv_exp_create_wq(struct ibv_context " "*context," 11 | .BI " struct ibv_exp_wq_init_attr " "*wq_init_attr" ); 12 | .sp 13 | .BI "int ibv_exp_destroy_wq(struct ibv_exp_wq " "*wq" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_exp_create_wq() 17 | creates a WQ associated with the ibv_context 18 | .I context\fR. 19 | The argument 20 | .I wq_init_attr 21 | is an ibv_exp_wq_init_attr struct, as defined in . 22 | .PP 23 | .nf 24 | struct ibv_exp_wq_init_attr { 25 | .in +8 26 | void *wq_context; /* Associated context of the WQ */ 27 | enum ibv_exp_wq_type wq_type; /* WQ type */ 28 | uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */ 29 | uint32_t max_recv_sge; /* Requested max receive number of scatter/gather (s/g) elements per WR in the RQ */ 30 | struct ibv_pd *pd; /* PD to be associated with the WQ */ 31 | struct ibv_cq *cq; /* CQ to be associated with the WQ */ 32 | struct ibv_srq *srq; /* SRQ handle if WQ is of type IBV_EXP_WQT_SRQ, otherwise NULL */ 33 | uint32_t comp_mask; /* Identifies valid fields. Use ibv_exp_wq_init_attr_mask */ 34 | struct ibv_exp_res_domain *res_domain; /* Provides resource domain to indicate the WQ threading and message model */ 35 | struct ibv_exp_wq_mp_rq mp_rq; /* Provides multi-packet data for receive WQ */ 36 | uint16_t vlan_offloads; /* Provide VLAN offload support for receive WQ */ 37 | .in -8 38 | }; 39 | 40 | struct ibv_exp_wq_mp_rq { 41 | .in +8 42 | enum ibv_exp_mp_rq_shifts use_shift; /* Shift to use for received payload */ 43 | uint8_t single_wqe_log_num_of_strides; /* Log of number of strides for single WQE */ 44 | uint8_t single_stride_log_num_of_bytes; /* Log of number of bytes in single stride */ 45 | .in -8 46 | }; 47 | 48 | .fi 49 | .PP 50 | The function 51 | .B ibv_exp_create_wq() 52 | will update the 53 | .I wq_init_attr\fB\fR->max_recv_wr 54 | and 55 | .I wq_init_attr\fB\fR->max_recv_sge 56 | fields with the actual \s-1WQ\s0 values of the WQ that was created; 57 | the values will be greater than or equal to the values requested. 58 | .PP 59 | .B ibv_exp_destroy_wq() 60 | destroys the WQ 61 | .I wq\fR. 62 | .SH "RETURN VALUE" 63 | .B ibv_exp_create_wq() 64 | returns a pointer to the created WQ, or NULL if the request fails. 65 | .PP 66 | .B ibv_exp_destroy_wq() 67 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 68 | .SH "NOTES" 69 | .PP 70 | The attributes max_recv_wr and max_recv_sge are ignored by 71 | .B ibv_exp_create_wq() 72 | if the WQ is to be associated with an SRQ. 73 | .SH "SEE ALSO" 74 | .BR ibv_exp_modify_wq (3), 75 | .SH "AUTHORS" 76 | .TP 77 | Yishai Hadas 78 | .TP 79 | Noa Osherovich 80 | -------------------------------------------------------------------------------- /man/ibv_exp_dealloc_mkey_list_memory.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_DEALLOC_MKEY_LIST_MOMORY 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_dealloc_mkey_list_memory \- deallocates the struct that was allocated using ibv_exp_alloc_mkey_list_memory() 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_dealloc_mkey_list_memory(struct ibv_exp_mkey_list_container " "*mem" ); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_dealloc_mkey_list_memory() 14 | dallocates the argument 15 | .I mem 16 | that was allocated using ibv_exp_alloc_mkey_list_memory() 17 | .PP 18 | The argument 19 | .I mem 20 | is an ibv_exp_mkey_list_container struct and is defined in as follow: 21 | .PP 22 | .nf 23 | struct ibv_exp_list_container { 24 | .in +8 25 | uint32_t max_klm_list_size; /* maximum number of KLMs we can use to create the UMR */ 26 | struct ibv_context *context; /* RDMA device context */ 27 | .in -8 28 | }; 29 | 30 | .SH "RETURN VALUE" 31 | .B ibv_exp_dealloc_mkey_list_memory() 32 | returns 0 on success, the value of errno on failure (which indicates the failure reason). 33 | .PP 34 | .SH "SEE ALSO" 35 | .BR ibv_exp_alloc_mkey_list_memory (3) 36 | .SH "AUTHORS" 37 | .TP 38 | Haggai Abramovsky 39 | -------------------------------------------------------------------------------- /man/ibv_exp_ec_encode_async.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_EC_ENCODE_ASYNC 3 2015-11-28 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_ec_encode_sync, ibv_exp_ec_encode_async \- synchronous and asynchronous erasure coding calculation 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_ec_encode_sync(struct ibv_exp_ec_calc " "*ec_calc" , 11 | .BI " struct ibv_exp_ec_mem " "*ec_mem" ); 12 | .sp 13 | .BI "int ibv_exp_ec_encode_async(struct ibv_exp_ec_calc " "*ec_calc" , 14 | .BI " struct ibv_exp_ec_mem " "*ec_mem" , 15 | .BI " struct ibv_exp_ec_comp " "*ec_comp" ); 16 | .fi 17 | .SH "DESCRIPTION" 18 | .B ibv_exp_ec_encode_sync() 19 | performs synchronous erasure coding calculation on a given set of data blocks and 20 | places the calculation result in a given set of coding blocks. The given buffers 21 | and their logical block size are described in the erasure coding memory layout 22 | .I ec_mem\fR. 23 | .PP 24 | .nf 25 | struct ibv_exp_ec_mem { 26 | .in +8 27 | struct ibv_sge *data_blocks; /* array of data sg elements */ 28 | int num_data_sge; /* number of data sg elements */ 29 | struct ibv_sge *code_blocks; /* array of code sg elements */ 30 | int num_code_sge; /* number of code sg elements */ 31 | int block_size; /* logical block size */ 32 | .in -8 33 | }; 34 | .fi 35 | 36 | The erasure coding memory layout specifies the data set layout by 37 | .I data_blocks\fR array of 38 | .I num_data_sge\fR elements, and the code set layout by 39 | .I code_blocks\fR array of 40 | .I num_code_sge\fR elements. Both the data and code sets are assumed 41 | to have a single unique logical 42 | .I block_size\fR. 43 | 44 | .PP 45 | The calculation operation will block until the calculation is completed. 46 | .fi 47 | 48 | .B ibv_exp_ec_encode_async() 49 | equivalently performs non-blocking asynchronous erasure coding calculation. 50 | .PP 51 | The erasure coding calculation completes by executing the provided erasure 52 | coding completion handle 53 | .I ec_comp\fR 54 | .nf 55 | struct ibv_exp_ec_comp { 56 | .in +8 57 | void (*done)(struct ibv_exp_ec_comp *comp); /* function handle of the EC calculation completion */ 58 | enum ibv_exp_ec_status status; /* status of the EC calculation */ 59 | .in -8 60 | }; 61 | .fi 62 | 63 | The caller is expected to pass a 64 | .I ec_comp.done\fR function pointer to execute a post-calculation user-defined logic. 65 | The caller is expected to check the completion status 66 | .I ec_comp.status\fR in order to verify the calculation succeeded or failed. 67 | 68 | .nf 69 | enum ibv_exp_ec_status { 70 | .in +8 71 | IBV_EXP_EC_CALC_SUCCESS, /* EC calc operation succeded */ 72 | IBV_EXP_EC_CALC_FAIL, /* EC calc operation failed */ 73 | .in -8 74 | }; 75 | .fi 76 | 77 | .PP 78 | .SH "RETURN VALUE" 79 | .B ibv_exp_ec_encode_sync(), 80 | returns 0 on successfully completed calculation, or the value of a calculation failure. 81 | .PP 82 | .B ibv_exp_ec_encode_async(), 83 | returns 0 on success, or the value of errno on failure (which indicates the 84 | failure reason). 85 | .SH "CONSTRAINTS" 86 | .PP 87 | .I ec_mem.num_data_sg 88 | attribute must be equal to the number of data blocks init attribute 89 | .I K\fR. 90 | .PP 91 | .I ec_mem.num_code_sg 92 | init attribute must be equal to the number of code blocks init attribute 93 | .I M\fR. 94 | .PP 95 | .I block_size 96 | must be multiplier of 64 bytes. 97 | .PP 98 | .SH "SEE ALSO" 99 | .BR ibv_exp_ec_encode_sync (3), 100 | .BR ibv_exp_ec_decode_sync (3), 101 | .BR ibv_exp_ec_decode_async (3), 102 | .BR ibv_exp_ec_update_sync (3), 103 | .BR ibv_exp_ec_update_async (3), 104 | .BR ibv_exp_alloc_ec_calc (3), 105 | .BR ibv_exp_dealloc_ec_calc (3), 106 | .SH "AUTHORS" 107 | .TP 108 | Sagi Grimberg 109 | -------------------------------------------------------------------------------- /man/ibv_exp_get_provider_func.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_GET_PROVIDER_FUNC 3 2014-04-23 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_get_provider_func \- gets provider's function pointer 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "void *ibv_exp_get_provider_func(struct ibv_context " "*context" ", enum ibv_exp_func_name " "name"); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_get_provider_func() 14 | returns a function's pointer of function 15 | .I name 16 | associated with device context 17 | .I context. 18 | This verb can be used to achieve direct access to provider's data path functions. 19 | .PP 20 | .sp 21 | .fi 22 | .PP 23 | The argument 24 | .I name 25 | is an ibv_exp_func_name enum, as defined in . It should be one of the following values: 26 | .PP 27 | .nf 28 | .TP 29 | .B IBV_EXP_POST_SEND_FUNC \fR Get the exp_post_send's provider's function. 30 | .TP 31 | .B IBV_EXP_POLL_CQ_FUNC \fR Get the exp_poll_cq's provider's function. 32 | .TP 33 | .B IBV_POST_SEND_FUNC \fR Get the post_send's provider's function. 34 | .TP 35 | .B IBV_POLL_CQ_FUNC \fR Get the poll_cq's provider's function. 36 | .TP 37 | .B IBV_POST_RECV_FUNC \fR Get the post_recv's provider's function. 38 | 39 | .SH "RETURN VALUE" 40 | On success, 41 | .B ibv_exp_get_provider_func() 42 | returns a function's pointer, and null on error. 43 | .SH "AUTHORS" 44 | .TP 45 | Majd Dibbiny 46 | 47 | -------------------------------------------------------------------------------- /man/ibv_exp_modify_cq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_MODIFY_CQ 3 2014-04-09 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_modify_cq \- modify attributes of a complition queue (CQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_modify_cq(struct ibv_cq " "*cq" , 11 | .BI " struct ibv_exp_cq_attr " "*cq_attr" , 12 | .BI " int " "cq_attr_mask" ); 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_exp_modify_cq() 16 | modifies the attributes of CQ 17 | .I cq 18 | with the attributes in 19 | .I cq_attr 20 | according to the mask 21 | .I cq_attr_mask\fR. 22 | .nf 23 | 24 | The argument \fIcq_attr\fR is an ibv_exp_cq_attr struct, as defined in . 25 | .PP 26 | struct ibv_exp_cq_attr { 27 | .in +8 28 | uint32_t comp_mask; /* Set to IBV_EXP_CQ_ATTR_RESERVED-1 */ 29 | struct { 30 | .in +8 31 | uint16_t cq_count; /* Event Generation Moderation counter */ 32 | uint16_t cq_period; /* Event Generation Moderation timer in microseconds */ 33 | .in -8 34 | } moderation; 35 | uint32_t cq_cap_flags; /* use ibv_exp_cq_cap_flags from verbs_exp.h */ 36 | .in -8 37 | }; 38 | .fi 39 | .PP 40 | The argument 41 | .I cq_attr_mask 42 | specifies the CQ attributes to be modified. 43 | The argument is either 0 or the bitwise OR of one or more of the following flags: 44 | .PP 45 | .TP 46 | .B IBV_EXP_CQ_MODERATION \fR Set the CQ moderation parameters 47 | .TP 48 | .B IBV_EXP_CQ_CAP_FLAGS \fR Set the CQ capability flags 49 | .SH "RETURN VALUE" 50 | .B ibv_exp_modify_cq() 51 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 52 | .SH "NOTES" 53 | If any of the modify attributes is invalid, none of the attributes will be modified. 54 | .SH "SEE ALSO" 55 | .BR ibv_exp_create_cq (3), 56 | .BR ibv_destroy_cq (3) 57 | 58 | .SH AUTHORS 59 | .TP 60 | Igor Ivanov 61 | .RI < Igor.Ivanov@itseez.com > 62 | .TP 63 | Majd Dibbiny 64 | .RI < majd@mellanox.com > 65 | -------------------------------------------------------------------------------- /man/ibv_exp_modify_wq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_MODIFY_WQ 3 2015-08-04 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_modify_wq \- Modify a Work Queue (WQ). 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct int ibv_exp_modify_wq(struct ibv_exp_wq " "*wq," 11 | .BI " struct ibv_exp_wq_attr " "*wq_attr" ); 12 | .sp 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_exp_modify_wq() 16 | modifys a WQ 17 | .I wq\fR. 18 | The argument 19 | .I wq_attr 20 | is an ibv_exp_wq_attr struct, as defined in . 21 | .PP 22 | .nf 23 | struct ibv_exp_wq_attr { 24 | .in +8 25 | uint32_t attr_mask; /* Use enum ibv_exp_wq_attr_mask */ 26 | enum ibv_exp_wq_state wq_state; /* Move to this state */ 27 | enum ibv_exp_wq_state curr_wq_state; /* Assume this is the current state */ 28 | uint16_t vlan_offloads; /* Change WQ's VLAN offloading behaviour */ 29 | .in -8 30 | }; 31 | .fi 32 | .PP 33 | The function 34 | .B ibv_exp_modify_wq() 35 | will modify the WQ based on the given 36 | .I wq_attr\fB\fR->attr_mask 37 | .SH "RETURN VALUE" 38 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 39 | .SH "SEE ALSO" 40 | .BR ibv_exp_create_wq (3), 41 | .BR ibv_exp_destroy_wq (3), 42 | .SH "AUTHORS" 43 | .TP 44 | Yishai Hadas 45 | .TP 46 | Noa Osherovich 47 | -------------------------------------------------------------------------------- /man/ibv_exp_open_device.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_OPEN_DEVICE 3 2017-04-27 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_open_device \- open an RDMA device context 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_context *ibv_exp_open_device(struct ibv_device " "*device" ", 11 | .BI " struct ibv_exp_open_device_attr " "*attr"); 12 | .sp 13 | .fi 14 | .SH "DESCRIPTION" 15 | .fi 16 | .B ibv_exp_open_device() 17 | opens the device 18 | .I device 19 | and creates a context with the specified 20 | .I attr 21 | 22 | The argument 23 | .I attr 24 | is an ibv_exp_open_device_attr struct, as defined in . 25 | .nf 26 | struct ibv_exp_open_device_attr { 27 | .in +8 28 | .fi 29 | uint32_t comp_mask; /* Identifies valid fields. Use enum ibv_exp_set_context_attr */ 30 | .nf 31 | struct exp_peer_info peer_info; /* Provides peer information - name , id */ 32 | .in -8 33 | }; 34 | 35 | .fi 36 | .I attr->comp_mask 37 | specifies the attribute computability, as defined in ibv_exp_set_context_attr enum: 38 | .nf 39 | enum ibv_exp_set_context_attr{ 40 | .in +8 41 | IBV_EXP_SET_ATTR_PEER_INFO = 1 << 0, /* Set if attr->peer_info is valid */ 42 | IBV_EXP_SET_CONTEXT_ATTR_RESERVED = 1 << 1, 43 | .in -8 44 | }; 45 | 46 | .fi 47 | .I attr->peer_info 48 | specifies the peer name and id. 49 | .nf 50 | struct exp_peer_info { 51 | .in +8 52 | .fi 53 | uint64_t peer_id; /* Peer client unique identity */ 54 | .nf 55 | char *peer_name; /* Peer client name */ 56 | .in -8 57 | }; 58 | 59 | .SH "RETURN VALUE" 60 | .B ibv_exp_open_device() 61 | returns a pointer to the allocated device context, or NULL if the request fails. 62 | .PP 63 | .SH "SEE ALSO" 64 | .BR ibv_open_device (3), 65 | .BR ibv_close_device (3), 66 | .BR ibv_get_device_list (3), 67 | .BR ibv_query_device (3), 68 | .BR ibv_query_port (3), 69 | .BR ibv_query_gid (3), 70 | .BR ibv_query_pkey (3) 71 | .SH "AUTHORS" 72 | .TP 73 | Feras Daoud 74 | -------------------------------------------------------------------------------- /man/ibv_exp_post_srq_ops.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md 3 | .\" 4 | .TH IBV_EXP_POST_SRQ_OPS 3 2017-03-26 libibverbs "Libibverbs Programmer's Manual" 5 | .SH "NAME" 6 | ibv_exp_post_srq_ops \- perform configuration manipulations 7 | on a special shared receive queue (SRQ) 8 | .SH "SYNOPSIS" 9 | .nf 10 | .B #include 11 | .sp 12 | .BI "int ibv_exp_post_srq_ops(struct ibv_srq " "*srq" ", struct ibv_exp_ops_wr " "*wr" , 13 | .BI " struct ibv_exp_ops_wr " "**bad_wr" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | The 17 | .B ibv_exp_post_srq_ops() 18 | performs series of offload configuration manipulations on spacial types of SRQ 19 | .I srq\fR. Currenlty it is used to configure tag matching SRQ. Series of configuration 20 | operations defined by linked lists of struct ibv_ops_wr elements starting from 21 | .I wr. 22 | .PP 23 | .nf 24 | struct ibv_exp_ops_wr { 25 | .in +8 26 | uint64_t wr_id; /* User defined WR ID */ 27 | /* Pointer to next WR in list, NULL if last WR */ 28 | struct ibv_exp_ops_wr *next; 29 | enum ibv_exp_ops_wr_opcode opcode; /* From enum ibv_exp_ops_wr_opcode */ 30 | int flags; /* From enum ibv_exp_ops_flags */ 31 | struct { 32 | .in +8 33 | /* Number of unexpected messages 34 | * handled by SW */ 35 | uint32_t unexpected_cnt; 36 | /* Input parameter for the DEL opcode 37 | * and output parameter for the ADD opcode */ 38 | uint32_t handle; 39 | struct { 40 | .in +8 41 | uint64_t recv_wr_id; /* User defined WR ID for TM_RECV */ 42 | struct ibv_sge *sg_list; /* Pointer to the s/g array */ 43 | int num_sge; /* Size of the s/g array */ 44 | uint64_t tag; 45 | uint64_t mask; 46 | .in -8 47 | } add; 48 | .in -8 49 | } tm; 50 | .in -8 51 | }; 52 | .fi 53 | .PP 54 | First part of struct ibv_ops_wr retains ibv_send_wr notion. 55 | Opcode defines operation to perform. Currently supported IBV_EXP_WR_TAG_ADD, 56 | IBV_EXP_WR_TAG_DEL and IBV_EXP_WR_TAG_SYNC values. See below for detailed 57 | description. 58 | .PP 59 | To allow reliable data delivery TM SRQ maintain special low level 60 | synchronization primitive - phase synchronization. Receive side message 61 | handling comprises two concurrent activities - posting tagged buffers by 62 | SW and receiving incoming messages by HW. This process considered 63 | coherent only if all unexpected messages received by HW is completely 64 | processed in SW. To pass to hardware number of processed unexpected 65 | messages unexpected_cnt field should be used and IBV_EXP_OPS_TM_SYNC flag 66 | should be set. 67 | .PP 68 | To request WC for tag list operations IBV_EXP_OPS_SIGNALED flags should be 69 | passed. In this case WC will be generated on TM SRQ's CQ, provided wr_id 70 | will identify WC. 71 | .PP 72 | Opcode IBV_EXP_WR_TAG_ADD used to add tag entry to tag matching list. 73 | Tag entry consists of SGE list, tag & mask (matching parameters), 74 | user specified opaque wr_id (passed via recv_wr_id field) and uniquely 75 | identified by handle (returned by driver). 76 | Size of tag matching list is limited by max_num_tags. 77 | SGE list size is limited by max_sge. 78 | .PP 79 | Opcode IBV_EXP_WR_TAG_DEL removes previously added tag entry. 80 | Field handle should be set to value returned by previously performed 81 | IBV_EXP_WR_TAG_ADD operation. 82 | Operation may fail due to concurrent tag consumption - in this case 83 | IBV_EXP_WC_TM_ERR flag will be returned in WC. 84 | .PP 85 | Opcode IBV_EXP_WR_TAG_SYNC may be used if no changes to matching list 86 | required, just to updated unexpected messages counter. 87 | .PP 88 | IBV_EXP_WC_TM_SYNC_REQ flag returned in list operation WC shows that counter 89 | synchronization required. This flag also may be returned by unexpected receive 90 | WC, asking for IBV_EXP_WR_TAG_SYNC operation to keep TM coherence consistency. 91 | .SH "RETURN VALUE" 92 | .B ibv_exp_post_srq_ops() 93 | returns 0 on success, or the value of errno on failure (which indicates the 94 | failure reason). 95 | .SH "SEE ALSO" 96 | .BR ibv_exp_create_srq (3), 97 | .SH "AUTHORS" 98 | .TP 99 | Artemy Kovalyov 100 | -------------------------------------------------------------------------------- /man/ibv_exp_post_task.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_POST_TASK 3 2014-04-09 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_post_task \- post a list of send/recv tasks (TAKSs) to QPs 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_post_task(struct ibv_context " "*context" ", 11 | .BI " struct ibv_exp_task " "*task" , 12 | .BI " struct ibv_exp_task " "**bad_task" ); 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_exp_post_task() 16 | posts the linked list of tasks (TASKs) starting with 17 | .I task. 18 | It stops processing TASKs from this list at the first failure (that can 19 | be detected immediately while requests are being posted), and returns 20 | this failing TASK through 21 | .I bad_task\fR. 22 | Every TASK consists of the linked list of work requests (WRs) is being 23 | posted to queue pair (QP). The task list may have entries posted to 24 | multiple QPs and includes send and receive communication primitives, 25 | as well as the communication coordination primitives wait, send_enable 26 | and receive_enable. 27 | There are two types of TASK as send/recv. 28 | .PP 29 | The argument 30 | .I task 31 | is an ibv_exp_task struct, as defined in . 32 | .PP 33 | .nf 34 | struct ibv_exp_task { 35 | .in +8 36 | enum ibv_exp_task_type task_type; /* Task type: IBV_EXP_TASK_SEND or IBV_EXP_TASK_SEND */ 37 | struct { 38 | .in +8 39 | struct ibv_qp *qp; /* Addressed QP */ 40 | union { 41 | .in +8 42 | struct ibv_exp_send_wr *send_wr; /* Pointer to next WR in list, NULL if last WR */ 43 | struct ibv_recv_wr *recv_wr; /* Pointer to next WR in list, NULL if last WR */ 44 | .in -8 45 | }; 46 | .in -8 47 | } item; 48 | .in -8 49 | struct ibv_exp_task *next; /* Pointer to next TASK in list, NULL if last TASK */ 50 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 51 | }; 52 | .sp 53 | .fi 54 | .PP 55 | .SH "RETURN VALUE" 56 | .B ibv_exp_post_task() 57 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 58 | 59 | .SH AUTHORS 60 | .TP 61 | Igor Ivanov 62 | .RI < Igor.Ivanov@itseez.com > 63 | .TP 64 | Majd Dibbiny 65 | .RI < Majd@mellanox.com > 66 | -------------------------------------------------------------------------------- /man/ibv_exp_prefetch_mr.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_PREFETCH_MR 3 2013-08-06 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_prefetch_mr \- prefetch pages of an on-demand paging memory region 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int " "ibv_exp_prefetch_mr"( 11 | .BI " struct ibv_mr " "*mr" ", struct ibv_exp_prefetch_attr " "*attr"); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_exp_prefetch_mr() 15 | requests the driver to prefetch a given range of pages and map them for access from the HCA. 16 | The function is applicable to MRs that were registered as ODP, i.e. with the 17 | experimental access flag 18 | .B IBV_EXP_ACCESS_ON_DEMAND. 19 | .PP 20 | .I mr 21 | - the memory region containing the area that the driver is requested to prefetch. 22 | .PP 23 | .I attr 24 | - a structure containing the input arguments to the function. It is defined as: 25 | .PP 26 | .nf 27 | struct ibv_exp_prefetch_attr { 28 | .in +8 29 | uint32_t flags; /* Use enum ibv_exp_prefetch_flags in verbs_exp.h */ 30 | void *addr; /* Address of the area to prefetch */ 31 | size_t length; /* Length of the area to prefetch */ 32 | uint32_t comp_mask; /* Use enum ibv_exp_prefetch_attr_comp_mask in verbs_exp.h */ 33 | .in -8 34 | }; 35 | .fi 36 | .PP 37 | .PP 38 | .SH "RETURN VALUE" 39 | .B ibv_exp_prefetch_mr() 40 | returns 0 when the call was successful. Otherwise returns an error code: 41 | .PP 42 | .in +2 43 | .B ENOSYS 44 | libibverbs or provider driver doesn't support the prefetching verb. 45 | .PP 46 | .in +2 47 | .B EFAULT 48 | when the range requested is out of the memory region bounds, or when 49 | parts of it are not part of the process address space. 50 | .PP 51 | .in +2 52 | .B EINVAL 53 | when the MR is invalid. 54 | .SH "NOTES" 55 | This function is considered as a hint to the driver. The actual prefetch is 56 | done on 'best effort' policy, meaning that the driver may decide to ignore 57 | the fetch. In such case the call is considered successful, although no prefetch 58 | was done. 59 | .PP 60 | This function is an experimental verbs extensions supported only by the 61 | Mellanox OFED driver collection. It will be deprecated in the future once 62 | a stable API is added to the upstream version of libibverbs. 63 | .SH "SEE ALSO" 64 | .BR ibv_exp_reg_mr (3) 65 | .SH "AUTHORS" 66 | .TP 67 | Haggai Eran 68 | -------------------------------------------------------------------------------- /man/ibv_exp_query_dct.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_QUERY_DCT 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_query_dct \- query DCT's attributes. 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_query_dct(struct ibv_exp_dct " "*dct" ", struct ibv_exp_dct_attr " "*attr"); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_query_dct() 14 | gets the attributes of 15 | .I dct\fR 16 | into the argument 17 | .I attr. 18 | .I attr 19 | is an ibv_exp_dct_attr struct, as defined in . 20 | .PP 21 | .nf 22 | struct ibv_exp_dct_attr { 23 | .in +8 24 | uint64_t dc_key; /* DC access key (64 bit key) */ 25 | uint8_t port; /* Port number */ 26 | uint32_t access_flags; /* use ibv_access_flags form verbs.h */ 27 | uint8_t min_rnr_timer; /* Min rnr NAK time between successive requests of rejected messages */ 28 | uint8_t tclass; /* Traffic class used in packets sent by the DCT in case GRH is used */ 29 | uint32_t flow_label; /* Flow label used in packets sent by the DCT in case GRH is used */ 30 | enum ibv_mtu mtu; /* MTU of the DCT */ 31 | uint8_t pkey_index; /* PKey index */ 32 | uint8_t gid_index; /* Gid index associated with the DCT (to verify incoming packets if GRH is used) */ 33 | uint8_t hop_limit; /* Hop limit used in packets sent by the DCT in case GRH is used */ 34 | uint32_t key_violations; /* DC access key violation counter */ 35 | uint8_t state; /* DCT state (IBV_EXP_DCT_STATE_ACTIVE, IBV_EXP_DCT_STATE_DRAINING, IBV_EXP_DCT_STATE_DRAINED) */ 36 | struct ibv_srq *srq; /* The SRQ that will provide receive buffers */ 37 | struct ibv_cq *cq; /* CQ used to report receive completions */ 38 | struct ibv_pd *pd; /* PD associated with the protection domain */ 39 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 40 | .in -8 41 | }; 42 | .fi 43 | .PP 44 | The function 45 | .B ibv_exp_query_dct() 46 | will update the 47 | .I attr 48 | struct with the actual \s-1dct\s0 values of the DCT that was queried. 49 | .PP 50 | .SH "RETURN VALUE" 51 | .B ibv_exp_query_dct() 52 | returns 0 on success, or the value of errno on failure. 53 | 54 | .SH "NOTES" 55 | .PP 56 | .SH "SEE ALSO" 57 | .BR ibv_exp_create_qp (3), 58 | .BR ibv_exp_create_dct (3) 59 | .BR ibv_exp_query_qp (3) 60 | .SH "AUTHORS" 61 | .TP 62 | Haggai Abramovsky 63 | -------------------------------------------------------------------------------- /man/ibv_exp_query_gid_attr.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_QUERY_GID_ATTR 3 2015-08-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_query_gid_attr \- query a GID attributes 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_query_gid_attr(struct ibv_context " "*context" ", uint8_t " "port_num" , 11 | .BI " unsigned int " "index" ", struct ibv_exp_gid_attr " "*gid_attr" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_exp_query_gid_attr() 15 | returns the GID attributes in entry 16 | .I index 17 | of port 18 | .I port_num 19 | for device context 20 | .I context 21 | through the pointer 22 | .I gid_attr\fR. 23 | .PP 24 | The argument 25 | .I gid_attr 26 | is an ibv_exp_gid_attr struct, as defined in . 27 | .PP 28 | .nf 29 | struct ibv_exp_gid_attr { 30 | .in +8 31 | uint32_t comp_mask; /* Use ibv_exp_query_gid_attr */ 32 | enum ibv_exp_roce_gid_type type; /* The GID type */ 33 | union ibv_gid gid; /* The GID in the desired index of the specified port */ 34 | .in -8 35 | }; 36 | 37 | comp_mask is used as an input to the verb, to choose which of the fields should 38 | be queried, and as an output to indicate which fields were queried. 39 | 40 | .SH "RETURN VALUE" 41 | .B ibv_exp_query_gid_attr() 42 | returns 0 on success, and errno on failure. 43 | .SH "SEE ALSO" 44 | .BR ibv_query_gid (3), 45 | .SH "AUTHORS" 46 | .TP 47 | Majd Dibbiny 48 | -------------------------------------------------------------------------------- /man/ibv_exp_query_mkey.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_QUERY_MKEY 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_query_mkey \- query MR's attribute, for MRs created by ibv_exp_create_mr() function 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_query_mkey(struct ibv_mr " "*mr" ", struct ibv_exp_mkey_attr " "*attr"); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_query_mkey() 14 | gets the attributes of the memory region (MR) 15 | .I mr 16 | into the argument 17 | .I attr. 18 | .PP 19 | The argument 20 | .I attr 21 | is an ibv_exp_mkey_attr struct, as defined in . 22 | .PP 23 | .nf 24 | struct ibv_exp_mkey_attr { 25 | .in +8 26 | uint32_t max_klm_list_size; /* maximum number of MRs we can use to create the UMR */ 27 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 28 | .in -8 29 | }; 30 | .fi 31 | .PP 32 | The function 33 | .B ibv_exp_query_mkey() 34 | will update the 35 | .I attr 36 | struct with the actual \s-1mr\s0 values of the MR that were queried. 37 | .PP 38 | .SH "RETURN VALUE" 39 | .B ibv_exp_query_mkey() 40 | returns 0 on success, or the value of errno on failure. 41 | 42 | .SH "NOTES" 43 | .PP 44 | .SH "SEE ALSO" 45 | .BR ibv_exp_create_mr (3), 46 | .SH "AUTHORS" 47 | .TP 48 | Haggai Abramovsky 49 | -------------------------------------------------------------------------------- /man/ibv_exp_query_values.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_QUERY_VALUES 3 2014-11-13 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_query_values \- query values 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_query_values(struct ibv_context " "*context" ", int " "q_values" ", struct ibv_exp_values " "*values"); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_exp_query_values() 14 | queries the values defined in the bitmask 15 | .I q_values 16 | into the appropriate fields of 17 | .I values. 18 | .PP 19 | The argument 20 | .I q_values 21 | is enum ibv_exp_values_comp_mask, as defined in . It's bitwise OR of one or more of the following flags: 22 | .TP 23 | .B IBV_EXP_VALUES_HW_CLOCK_NS \fR Query hardware clock in nano-seconds 24 | .TP 25 | .B IBV_EXP_VALUES_HW_CLOCK \fR Query hardware clock in cycles 26 | .TP 27 | .B IBV_EXP_VALUES_CLOCK_INFO \fR Query hardware clock info translation object 28 | .PP 29 | The argument 30 | .I values 31 | is an ibv_exp_values struct, as defined in : 32 | .nf 33 | struct ibv_exp_values { 34 | .in +8 35 | uint32_t comp_mask; /* Bitmask that is used as input to indicate which of the following fields exist and as output to 36 | indicate which values were queried. use enum ibv_exp_values_comp_mask */ 37 | uint64_t hwclock_ns; /* If requested, the queried value of hardware clock in nano-seconds */ 38 | uint64_t hwclock; /* If requested, the queried value of 39 | hardware clock in cycles*/ 40 | struct ibv_exp_clock_info clock_info; /* If requested, returns the current clock info translation object */ 41 | .in -8 42 | }; 43 | .fi 44 | .PP 45 | .SH "RETURN VALUE" 46 | .B ibv_exp_query_values() 47 | returns 0. 48 | 49 | .SH "NOTES" 50 | \fBclock_info\fR can be used to translate the value of the HW \fBtimestamp\fR field 51 | in \fBibv_exp_wc\fR to nano-seconds. For more details see \fBibv_exp_cqe_to_ns()\fR. 52 | .PP 53 | .SH "SEE ALSO" 54 | .BR ibv_exp_cqe_to_ns (3). 55 | .SH "AUTHORS" 56 | .TP 57 | Majd Dibbiny 58 | -------------------------------------------------------------------------------- /man/ibv_exp_reg_shared_mr.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_EXP_REG_SHARED_MR 3 2014-04-09 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_reg_shared_mr \- register a shared memory region (MR) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_mr *ibv_exp_reg_shared_mr(struct ibv_exp_reg_shared_mr_in " *in "); " 11 | .fi 12 | .SH "DESCRIPTION" 13 | .fi 14 | .B ibv_exp_reg_shared_mr() 15 | registers a memory region (MR) associated with the protection domain 16 | .I in->pd\fR. 17 | .I in->mr_handle 18 | is the identifier of the MR that its physical memory going to be shared by this MR. 19 | This 20 | .I in->mr_handle 21 | is returned as part of 22 | .I struct ibv_mr 23 | and valid when original MR was created with sharing access mode. 24 | The 25 | .I in->addr 26 | can be NULL and this is the common usage.If 27 | .I in->addr 28 | is not NULL, then the kernel takes it as a hint about the returned 29 | .I addr\fR. 30 | The argument 31 | .I in 32 | is an ibv_exp_reg_shared_mr_in struct, as defined in . 33 | 34 | struct ibv_exp_reg_shared_mr_in { 35 | .in +8 36 | .nf 37 | uint32_t mr_handle; 38 | struct ibv_pd *pd; 39 | void *addr; 40 | uint64_t exp_access; /* use ibv_exp_access_flags from verbs_exp.h */ 41 | uint32_t comp_mask; /* reserved for future growth (must be 0) */ 42 | .in -8 43 | }; 44 | .fi 45 | The struct field 46 | .I exp_access 47 | describes the desired memory protection attributes; it expects not to exceed the given permissions when the original MR was created. 48 | it is either 0 or the bitwise OR of one or more of the following flags: 49 | .PP 50 | .TP 51 | .B IBV_EXP_ACCESS_LOCAL_WRITE \fR Enable Local Write Access 52 | .TP 53 | .B IBV_EXP_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access 54 | .TP 55 | .B IBV_EXP_ACCESS_REMOTE_READ\fR Enable Remote Read Access 56 | .TP 57 | .B IBV_EXP_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported) 58 | .TP 59 | .B IBV_EXP_ACCESS_MW_BIND\fR Enable Memory Window Binding 60 | .PP 61 | If 62 | .B IBV_EXP_ACCESS_REMOTE_WRITE 63 | or 64 | .B IBV_EXP_ACCESS_REMOTE_ATOMIC 65 | is set, then 66 | .B IBV_EXP_ACCESS_LOCAL_WRITE 67 | must be set too. 68 | .PP 69 | Local read access is always enabled for the MR. 70 | .nf 71 | .fi 72 | .SH "RETURN VALUE" 73 | .B ibv_exp_reg_shared_mr() 74 | returns a pointer to the registered MR, or NULL if the request fails. 75 | The local key (\fBL_Key\fR) field 76 | .B lkey 77 | is used as the lkey field of struct ibv_sge when posting buffers with 78 | ibv_post_* verbs, and the remote key (\fBR_Key\fR) 79 | field 80 | .B rkey 81 | is used by remote processes to perform Atomic and RDMA operations. The remote process places this 82 | .B rkey 83 | as the rkey field of struct ibv_send_wr passed to the ibv_post_send function. 84 | .SH "NOTES" 85 | Once 86 | .B ibv_exp_reg_shared_mr() 87 | has succeeded its memory is valid even if original MR was released by 88 | .B ibv_dereg_mr() \fR call. 89 | To release this shared MR 90 | .B ibv_dereg_mr() 91 | should be used, the returned 92 | .I addr 93 | must not free explicitly it is freed internally as part of 94 | .B ibv_dereg_mr() 95 | 96 | .SH "SEE ALSO" 97 | .BR ibv_post_send (3), 98 | .BR ibv_post_recv (3), 99 | .BR ibv_post_srq_recv (3), 100 | .BR ibv_reg_mr (3) 101 | .SH "AUTHORS" 102 | .TP 103 | Dotan Barak 104 | .TP 105 | Majd Dibbiny 106 | -------------------------------------------------------------------------------- /man/ibv_exp_rereg_mr.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_REREG_MR 3 2014-08-27 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_exp_rereg_mr \- re-register a memory region (MR) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_exp_rereg_mr(struct ibv_mr " "*mr" ", int " " flags" , 11 | .BI " struct ibv_pd * " "pd" ", void " " *addr", 12 | .BI " size_t " " length" ", uint64_t " " access", 13 | .BI " struct ibv_exp_rereg_mr_attr *" " attr"); 14 | .fi 15 | .fi 16 | .SH "DESCRIPTION" 17 | .B ibv_exp_rereg_mr() 18 | Modifies the attributes of an existing memory region (MR) 19 | .I mr\fR. 20 | Conceptually, this call performs the functions deregister memory region 21 | followed by register memory region. Where possible, 22 | resources are reused instead of deallocated and reallocated. 23 | .PP 24 | .I flags\fR 25 | is a bit-mask used to indicate which of the following properties of the memory region are being modified. Flags should be a combination (bit field) of: 26 | .PP 27 | .TP 28 | .B IBV_EXP_REREG_MR_CHANGE_TRANSLATION \fR Change translation (location and length) 29 | .TP 30 | .B IBV_EXP_REREG_MR_CHANGE_PD \fR Change protection domain 31 | .TP 32 | .B IBV_EXP_REREG_MR_CHANGE_ACCESS \fR Change access flags 33 | .PP 34 | When 35 | .B IBV_EXP_REREG_MR_CHANGE_PD 36 | is used, 37 | .I pd\fR 38 | represents the new PD this MR should be registered to. 39 | .br 40 | When 41 | .B IBV_EXP_REREG_MR_CHANGE_TRANSLATION 42 | is used, 43 | .I addr\fR. 44 | represents the virtual address (user-space pointer) of the new MR, while 45 | .I length\fR 46 | represents its length. 47 | .PP 48 | The access and other flags are represented in the field 49 | .I access\fR. 50 | This field describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of the following flags: 51 | .PP 52 | .TP 53 | .B IBV_EXP_ACCESS_LOCAL_WRITE \fR Enable Local Write Access 54 | .TP 55 | .B IBV_EXP_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access 56 | .TP 57 | .B IBV_EXP_ACCESS_REMOTE_READ\fR Enable Remote Read Access 58 | .TP 59 | .B IBV_EXP_ACCESS_ALLOCATE_MR\fR Enable contiguous pages allocation 60 | .PP 61 | When 62 | .B IBV_ACCESS_ALLOCATE_MR 63 | is used, both 64 | .I addr 65 | and 66 | .I length 67 | should be NULL and 0 respectively, and the allocation is done internally. 68 | .PP 69 | .I attr\fR 70 | is available for future extensions. 71 | .SH "RETURN VALUE" 72 | .B ibv_exp_rereg_mr() 73 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 74 | .SH "NOTES" 75 | If the memory re-registration call failed, the MR can't be used. 76 | Even on a failure, the user still needs to call ibv_dereg_mr on this MR. 77 | .SH "SEE ALSO" 78 | .BR ibv_reg_mr (3), 79 | .BR ibv_dereg_mr (3), 80 | .SH "AUTHORS" 81 | .TP 82 | Matan Barak 83 | -------------------------------------------------------------------------------- /man/ibv_fork_init.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_FORK_INIT 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_fork_init \- initialize libibverbs to support fork() 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_fork_init(void); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_fork_init() 14 | initializes libibverbs's data structures to handle 15 | .B fork() 16 | function calls correctly and avoid data corruption, whether 17 | .B fork() 18 | is called explicitly or implicitly (such as in 19 | .B system()\fR). 20 | .PP 21 | It is not necessary to use this function if all parent process threads 22 | are always blocked until all child processes end or change address 23 | spaces via an 24 | .B exec() 25 | operation. 26 | .PP 27 | When 28 | .B ibv_fork_init()\fR is used at the parent, the child process should call 29 | .B exec*()\fR or 30 | .B exit()\fR immediately after fork. 31 | .SH "RETURN VALUE" 32 | .B ibv_fork_init() 33 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 34 | .SH "NOTES" 35 | .B ibv_fork_init() 36 | works on Linux kernels supporting the 37 | .BR MADV_DONTFORK 38 | flag for 39 | .B madvise() 40 | (2.6.17 and higher). 41 | .PP 42 | Setting the environment variable 43 | .BR RDMAV_FORK_SAFE 44 | or 45 | .BR IBV_FORK_SAFE 46 | to any value has the same effect as calling 47 | .B ibv_fork_init()\fR. 48 | .PP 49 | Setting the environment variable 50 | .BR RDMAV_HUGEPAGES_SAFE 51 | to any value tells the library to check the underlying page size used by the 52 | kernel for memory regions. This is required if an application uses huge 53 | pages either directly or indirectly via a library such as libhugetlbfs. 54 | .PP 55 | Calling 56 | .B ibv_fork_init() 57 | will reduce performance due to an extra system call for every memory 58 | registration, and the additional memory allocated to track memory 59 | regions. The precise performance impact depends on the workload and 60 | usually will not be significant. 61 | .PP 62 | Setting 63 | .BR RDMAV_HUGEPAGES_SAFE 64 | adds further overhead to all memory registrations. 65 | .SH "SEE ALSO" 66 | .BR fork (2), 67 | .BR wait (2), 68 | .BR system (3), 69 | .BR exec (3), 70 | .BR ibv_get_device_list (3) 71 | .SH "AUTHORS" 72 | .TP 73 | Dotan Barak 74 | -------------------------------------------------------------------------------- /man/ibv_get_device_guid.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_GET_DEVICE_GUID 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_get_device_guid \- get an RDMA device's GUID 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "uint64_t ibv_get_device_guid(struct ibv_device " "*device" "); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_get_device_guid() 14 | returns the Global Unique IDentifier (GUID) of the RDMA device 15 | .I device\fR. 16 | .SH "RETURN VALUE" 17 | .B ibv_get_device_guid() 18 | returns the GUID of the device in network byte order. 19 | .SH "SEE ALSO" 20 | .BR ibv_get_device_list (3), 21 | .BR ibv_get_device_name (3), 22 | .BR ibv_open_device (3) 23 | .SH "AUTHORS" 24 | .TP 25 | Dotan Barak 26 | -------------------------------------------------------------------------------- /man/ibv_get_device_list.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_GET_DEVICE_LIST 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_get_device_list, ibv_free_device_list \- get and release list of available RDMA devices 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_device **ibv_get_device_list(int " "*num_devices" ); 11 | .sp 12 | .BI "void ibv_free_device_list(struct ibv_device " "**list" ); 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_get_device_list() 16 | returns a NULL-terminated array of RDMA devices currently available. 17 | The argument 18 | .I num_devices 19 | is optional; if not NULL, it is set to the number of devices returned in the array. 20 | .PP 21 | .B ibv_free_device_list() 22 | frees the array of devices 23 | .I list 24 | returned by 25 | .B ibv_get_device_list()\fR. 26 | .SH "RETURN VALUE" 27 | .B ibv_get_device_list() 28 | returns the array of available RDMA devices, or sets 29 | .I errno 30 | and returns NULL if the request fails. If no devices are found then 31 | .I num_devices 32 | is set to 0, and non-NULL is returned. 33 | .PP 34 | .B ibv_free_device_list() 35 | returns no value. 36 | .SH "ERRORS" 37 | .TP 38 | .B EPERM 39 | Permission denied. 40 | .TP 41 | .B ENOSYS 42 | No kernel support for RDMA. 43 | .TP 44 | .B ENOMEM 45 | Insufficient memory to complete the operation. 46 | .SH "NOTES" 47 | Client code should open all the devices it intends to use with 48 | .B ibv_open_device()\fR before calling 49 | .B ibv_free_device_list()\fR. 50 | Once it frees the array with 51 | .B ibv_free_device_list()\fR, 52 | it will be able to use only the open devices; pointers to unopened devices will no longer be valid. 53 | .SH "SEE ALSO" 54 | .BR ibv_fork_init (3), 55 | .BR ibv_get_device_name (3), 56 | .BR ibv_get_device_guid (3), 57 | .BR ibv_open_device (3) 58 | .SH "AUTHORS" 59 | .TP 60 | Dotan Barak 61 | -------------------------------------------------------------------------------- /man/ibv_get_device_name.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_GET_DEVICE_NAME 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_get_device_name \- get an RDMA device's name 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "const char *ibv_get_device_name(struct ibv_device " "*device" "); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_get_device_name() 14 | returns a human-readable name associated with the RDMA device 15 | .I device\fR. 16 | .SH "RETURN VALUE" 17 | .B ibv_get_device_name() 18 | returns a pointer to the device name, or NULL if the request fails. 19 | .SH "SEE ALSO" 20 | .BR ibv_get_device_list (3), 21 | .BR ibv_get_device_guid (3), 22 | .BR ibv_open_device (3) 23 | .SH "AUTHORS" 24 | .TP 25 | Dotan Barak 26 | -------------------------------------------------------------------------------- /man/ibv_get_srq_num.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_GET_SRQ_NUM 3 2013-06-26 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_get_srq_num \- return srq number associated with the given shared receive queue (SRQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_get_srq_num(struct ibv_srq " "*srq" , 11 | .BI " uint32_t " "*srq_num" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_get_srq_num() 15 | return srq number associated with the given shared receive queue 16 | The argument 17 | .I srq 18 | is an ibv_srq struct, as defined in . 19 | .I srq_num 20 | is an output parameter that holds the returned srq number. 21 | .PP 22 | .nf 23 | .SH "RETURN VALUE" 24 | .B ibv_get_srq_num() 25 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 26 | .SH "SEE ALSO" 27 | .BR ibv_alloc_pd (3), 28 | .BR ibv_modify_srq (3), 29 | .BR ibv_create_srq_ex (3) 30 | .SH "AUTHORS" 31 | .TP 32 | Yishai Hadas 33 | -------------------------------------------------------------------------------- /man/ibv_inc_rkey.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_INC_RKEY 3 2015-01-29 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | .nf 6 | ibv_inc_rkey \- creates a new rkey from the given one 7 | .SH "SYNOPSIS" 8 | .nf 9 | .B #include 10 | .sp 11 | .BI "uint32_t ibv_inc_rkey(uint32_t " "rkey" "); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_inc_rkey() 15 | Increases the 8 LSB of 16 | .I rkey 17 | and returns the new value. 18 | .PP 19 | .SH "RETURN VALUE" 20 | .B ibv_inc_rkey() 21 | returns the new rkey. 22 | .SH "NOTES" 23 | .PP 24 | The verb generates a new rkey that is different from the previous one on its tag part 25 | but has the same index (bits 0xffffff00). 26 | A use case for this verb can be to create a new rkey from a Memory window's rkey 27 | when binding it to a Memory region. 28 | .SH "AUTHORS" 29 | .TP 30 | Majd Dibbiny 31 | .TP 32 | Yishai Hadas 33 | -------------------------------------------------------------------------------- /man/ibv_intf.1: -------------------------------------------------------------------------------- 1 | .TH IBV_INTF 1 "May 03, 2015" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_intf \- Test application to utilize different send/receive/poll interfaces 5 | 6 | .SH SYNOPSIS 7 | .B ibv_intf 8 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 9 | [\-n iters] [\-l sl] [\-t inline-recv] [\-S send-verbs] 10 | [\-R recv-verbs] [\-P poll-verbs] [\-c cpus-list] [\-b burst] 11 | [\-T num-threads] [\-C] [\-A] \fBHOSTNAME\fR 12 | 13 | .B ibv_intf 14 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 15 | [\-n iters] [\-l sl] [\-t inline-recv] [\-S send-verbs] 16 | [\-R recv-verbs] [\-P poll-verbs] [\-c cpus-list] [\-b burst] 17 | [\-T num-threads] [\-C] [\-A] 18 | 19 | .SH DESCRIPTION 20 | .PP 21 | Run efficient multi-threaded post\-send/recive test over InfiniBand via the reliable 22 | connected (RC) transport. 23 | Use different interfaces to send/recive messages and poll completions. 24 | Unless the '\-A' option is set, the application utilize the resource-domain verbs object to gain performance. 25 | The application allocates one resource-domain per application thread. 26 | .TP 27 | By using the '\-S', '\-R' and '\-P' options the application covers the following verbs interfaces: 28 | .TP 29 | \-S 30 | \tS_NORM \- ibv_post_send 31 | \tS_PEND \- send_pending (member of ibv_exp_qp_burst_family) 32 | \tS_PEND_INL \- send_pending_inline (member of ibv_exp_qp_burst_family) 33 | \tS_PEND_SG_LIST \- send_pending_sg_list (member of ibv_exp_qp_burst_family) 34 | \tS_BURST \- send_burst (member of ibv_exp_qp_burst_family) 35 | .TP 36 | \-R 37 | \tR_NORM \- ibv_post_recv 38 | \tR_BURST \- recv_burst (member of ibv_exp_qp_burst_family) 39 | .TP 40 | \-P 41 | \tP_NORM \- ibv_poll_cq 42 | \tP_CNT \- poll_cnt (member of ibv_exp_cq_family) 43 | \tP_LEN \- poll_length (member of ibv_exp_cq_family) 44 | 45 | .SH OPTIONS 46 | 47 | .PP 48 | .TP 49 | \fB\-p\fR, \fB\-\-port\fR= listen on/connect to port (default 18515) 50 | .TP 51 | \fB\-d\fR, \fB\-\-ib\-dev\fR= use IB device (default mlx4_0) 52 | .TP 53 | \fB\-i\fR, \fB\-\-ib\-port\fR= use port of IB device (default 1) 54 | .TP 55 | \fB\-s\fR, \fB\-\-size\fR= size of message (default 64 max size 65,536) 56 | .TP 57 | \fB\-m\fR, \fB\-\-mtu\fR= path MTU (default 4,096) 58 | .TP 59 | \fB\-r\fR, \fB\-\-rx\-depth\fR= receive queue size (default 2,100) 60 | .TP 61 | \fB\-n\fR, \fB\-\-iters\fR= number of messages (default 1,000,000) 62 | .TP 63 | \fB\-l\fR, \fB\-\-sl\fR= service level value (default 0) 64 | .TP 65 | \fB\-t\fR, \fB\-\-inline\-recv\fR= size of inline\-recv (default 0) 66 | .TP 67 | \fB\-S\fR, \fB\-\-send\-verb\fR= send verb interface to use S_NORM/S_PEND/S_PEND_INL/S_PEND_SG_LIST/S_BURST (default S_PEND) 68 | .TP 69 | \fB\-R\fR, \fB\-\-recv\-verb\fR= recv verb interface to use R_NORM/R_BURST (default R_BURST) 70 | .TP 71 | \fB\-P\fR, \fB\-\-poll\-verb\fR= poll verb interface to use P_NORM/P_CNT/P_LEN (default send: P_CNT recv: P_LEN) 72 | .TP 73 | \fB\-c\fR, \fB\-\-cpus\-list\fR= CPUs list to run on (default [0..5],[12..17]) 74 | .TP 75 | \fB\-b\fR, \fB\-\-burst\fR= size of send/recv wr burst (default 10) 76 | .TP 77 | \fB\-T\fR, \fB\-\-num\-threads\fR= Number of threads to run (default 1) 78 | .TP 79 | \fB\-C\fR, \fB\-\-check\-data\fR check the data received (default no\-checks) 80 | .TP 81 | \fB\-A\fR, \fB\-\-avoid\-res\-domain\fR avoid usage of resource domain (default use res\-domain) 82 | 83 | .SH SEE ALSO 84 | .BR ibv_rc_pingpong (1), 85 | .BR ibv_uc_pingpong (1), 86 | .BR ibv_ud_pingpong (1), 87 | .BR ibv_srq_pingpong (1) 88 | 89 | .SH AUTHORS 90 | .TP 91 | Moshe Lazer 92 | .RI < moshel@mellanox.com > 93 | -------------------------------------------------------------------------------- /man/ibv_modify_srq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_MODIFY_SRQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_modify_srq \- modify attributes of a shared receive queue (SRQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_modify_srq(struct ibv_srq " "*srq" , 11 | .BI " struct ibv_srq_attr " "*srq_attr" , 12 | .BI " int " "srq_attr_mask" ); 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_modify_srq() 16 | modifies the attributes of SRQ 17 | .I srq 18 | with the attributes in 19 | .I srq_attr 20 | according to the mask 21 | .I srq_attr_mask\fR. 22 | The argument \fIsrq_attr\fR is an ibv_srq_attr struct, as defined in . 23 | .PP 24 | .nf 25 | struct ibv_srq_attr { 26 | .in +8 27 | uint32_t max_wr; /* maximum number of outstanding work requests (WRs) in the SRQ */ 28 | uint32_t max_sge; /* number of scatter elements per WR (irrelevant for ibv_modify_srq) */ 29 | uint32_t srq_limit; /* the limit value of the SRQ */ 30 | .in -8 31 | }; 32 | .fi 33 | .PP 34 | The argument 35 | .I srq_attr_mask 36 | specifies the SRQ attributes to be modified. 37 | The argument is either 0 or the bitwise OR of one or more of the following flags: 38 | .PP 39 | .TP 40 | .B IBV_SRQ_MAX_WR \fR Resize the SRQ 41 | .TP 42 | .B IBV_SRQ_LIMIT \fR Set the SRQ limit 43 | .SH "RETURN VALUE" 44 | .B ibv_modify_srq() 45 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 46 | .SH "NOTES" 47 | If any of the modify attributes is invalid, none of the attributes will be modified. 48 | .PP 49 | Not all devices support resizing SRQs. To check if a device supports it, check if the 50 | .B IBV_DEVICE_SRQ_RESIZE 51 | bit is set in the device capabilities flags. 52 | .PP 53 | Modifying the srq_limit arms the SRQ to produce an 54 | .B IBV_EVENT_SRQ_LIMIT_REACHED 55 | "low watermark" asynchronous event once the number of WRs in the SRQ drops below srq_limit. 56 | .SH "SEE ALSO" 57 | .BR ibv_query_device (3), 58 | .BR ibv_create_srq (3), 59 | .BR ibv_destroy_srq (3), 60 | .BR ibv_query_srq (3) 61 | .SH "AUTHORS" 62 | .TP 63 | Dotan Barak 64 | -------------------------------------------------------------------------------- /man/ibv_open_device.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_OPEN_DEVICE 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_open_device, ibv_close_device \- open and close an RDMA device context 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_context *ibv_open_device(struct ibv_device " "*device" "); 11 | .sp 12 | .BI "int ibv_close_device(struct ibv_context " "*context" "); 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_open_device() 16 | opens the device 17 | .I device 18 | and creates a context for further use. 19 | .PP 20 | .B ibv_close_device() 21 | closes the device context 22 | .I context\fR. 23 | .SH "RETURN VALUE" 24 | .B ibv_open_device() 25 | returns a pointer to the allocated device context, or NULL if the request fails. 26 | .PP 27 | .B ibv_close_device() 28 | returns 0 on success, \-1 on failure. 29 | .SH "NOTES" 30 | .B ibv_close_device() 31 | does not release all the resources allocated using context 32 | .I context\fR. 33 | To avoid resource leaks, the user should release all associated 34 | resources before closing a context. 35 | .SH "SEE ALSO" 36 | .BR ibv_get_device_list (3), 37 | .BR ibv_query_device (3), 38 | .BR ibv_query_port (3), 39 | .BR ibv_query_gid (3), 40 | .BR ibv_query_pkey (3) 41 | .SH "AUTHORS" 42 | .TP 43 | Dotan Barak 44 | -------------------------------------------------------------------------------- /man/ibv_open_qp.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_OPEN_QP 3 2011-08-12 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_open_qp \- open a shareable queue pair (QP) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_qp *ibv_open_qp(struct ibv_context " "*context" , 11 | .BI " struct ibv_qp_open_attr " "*qp_open_attr" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_open_qp() 15 | opens an existing queue pair (QP) associated with the extended protection domain 16 | .I xrcd\fR. 17 | The argument 18 | .I qp_open_attr 19 | is an ibv_qp_open_attr struct, as defined in . 20 | .PP 21 | .nf 22 | struct ibv_qp_open_attr { 23 | .in +8 24 | uint32_t comp_mask; /* Identifies valid fields */ 25 | uint32_t qp_num; /* QP number */ 26 | struct *ibv_xrcd; /* XRC domain */ 27 | void *qp_context; /* Associated context of the QP */ 28 | enum ibv_qp_type qp_type; /* QP transport service type */ 29 | .fi 30 | .PP 31 | .B ibv_destroy_qp() 32 | closes the opened QP and destroys the underlying QP if it has no 33 | other references. 34 | .I qp\fR. 35 | .SH "RETURN VALUE" 36 | .B ibv_open_qp() 37 | returns a pointer to the opened QP, or NULL if the request fails. 38 | Check the QP number (\fBqp_num\fR) in the returned QP. 39 | .SH "NOTES" 40 | .B ibv_open_qp() 41 | will fail if a it is asked to open a QP that does not exist within 42 | the xrcd with the specified qp_num and qp_type. 43 | .SH "SEE ALSO" 44 | .BR ibv_alloc_pd (3), 45 | .BR ibv_create_qp (3), 46 | .BR ibv_create_qp_ex (3), 47 | .BR ibv_modify_qp (3), 48 | .BR ibv_query_qp (3) 49 | .SH "AUTHORS" 50 | .TP 51 | Sean Hefty 52 | -------------------------------------------------------------------------------- /man/ibv_open_xrcd.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_OPEN_XRCD 3 2011-06-17 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_open_xrcd, ibv_close_xrcd \- open or close an XRC protection domain (XRCDs) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_xrcd *ibv_open_xrcd(struct ibv_context " "*context" "," 11 | .BI " struct ibv_xrcd_init_attr " "*xrcd_init_attr" ); 12 | .sp 13 | .BI "int ibv_close_xrcd(struct ibv_xrcd " "*xrcd" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_open_xrcd() 17 | open an XRC domain for the RDMA device context 18 | .I context 19 | .I xrcd_init_attr 20 | is an ibv_xrcd_init_attr struct, as defined in . 21 | .PP 22 | .nf 23 | struct ibv_xrcd_init_attr { 24 | .in +8 25 | uint32_t comp_mask; /* Identifies valid fields */ 26 | int fd; 27 | int oflag; 28 | .fi 29 | .PP 30 | .I fd 31 | is the file descriptor to associate with the XRCD. 32 | .I oflag 33 | describes the desired creation attributes. It is a bitwise OR of zero or more 34 | of the following flags: 35 | .PP 36 | .TP 37 | .B O_CREAT 38 | Indicates that an XRCD should be created and associated with the inode referenced 39 | by the given fd. If the XRCD exists, this flag has no effect except as noted under 40 | .BR O_EXCL 41 | below.\fR 42 | .TP 43 | .B O_EXCL 44 | If 45 | .BR O_EXCL 46 | and 47 | .BR O_CREAT 48 | are set, open will fail if an XRCD associated with the inode exists. 49 | .PP 50 | If 51 | .I fd 52 | equals -1, no inode is associated with the XRCD. To indicate that XRCD should be created, use 53 | .I oflag 54 | = 55 | .B O_CREAT\fR. 56 | .PP 57 | .B ibv_close_xrcd() 58 | closes the XRCD 59 | .I xrcd\fR. 60 | If this is the last reference, the XRCD will be destroyed. 61 | .SH "RETURN VALUE" 62 | .B ibv_open_xrcd() 63 | returns a pointer to the opened XRCD, or NULL if the request fails. 64 | .PP 65 | .B ibv_close_xrcd() 66 | returns 0 on success, or the value of errno on failure (which indicates the 67 | failure reason). 68 | .SH "NOTES" 69 | .B ibv_close_xrcd() 70 | may fail if any other resource is still associated with the XRCD being closed. 71 | .SH "SEE ALSO" 72 | .BR ibv_create_srq_ex (3), 73 | .BR ibv_create_qp_ex (3), 74 | .SH "AUTHORS" 75 | .TP 76 | Sean Hefty 77 | -------------------------------------------------------------------------------- /man/ibv_poll_cq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_POLL_CQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_poll_cq \- poll a completion queue (CQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_poll_cq(struct ibv_cq " "*cq" ", int " "num_entries" , 11 | .BI " struct ibv_wc " "*wc" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_poll_cq() 15 | polls the CQ 16 | .I cq 17 | for work completions and returns the first 18 | .I num_entries 19 | (or all available completions if the CQ contains fewer than this number) in the array 20 | .I wc\fR. 21 | The argument 22 | .I wc 23 | is a pointer to an array of ibv_wc structs, as defined in . 24 | .PP 25 | .nf 26 | struct ibv_wc { 27 | .in +8 28 | uint64_t wr_id; /* ID of the completed Work Request (WR) */ 29 | enum ibv_wc_status status; /* Status of the operation */ 30 | enum ibv_wc_opcode opcode; /* Operation type specified in the completed WR */ 31 | uint32_t vendor_err; /* Vendor error syndrome */ 32 | uint32_t byte_len; /* Number of bytes transferred */ 33 | uint32_t imm_data; /* Immediate data (in network byte order) */ 34 | uint32_t qp_num; /* Local QP number of completed WR */ 35 | uint32_t src_qp; /* Source QP number (remote QP number) of completed WR (valid only for UD QPs) */ 36 | int wc_flags; /* Flags of the completed WR */ 37 | uint16_t pkey_index; /* P_Key index (valid only for GSI QPs) */ 38 | uint16_t slid; /* Source LID */ 39 | uint8_t sl; /* Service Level */ 40 | uint8_t dlid_path_bits; /* DLID path bits (not applicable for multicast messages) */ 41 | .in -8 42 | }; 43 | .sp 44 | .fi 45 | .PP 46 | The attribute wc_flags describes the properties of the work completion. 47 | It is either 0 or the bitwise OR of one or more of the following flags: 48 | .PP 49 | .TP 50 | .B IBV_WC_GRH \fR GRH is present (valid only for UD QPs) 51 | .TP 52 | .B IBV_WC_WITH_IMM \fR Immediate data value is valid 53 | .PP 54 | Not all 55 | .I wc 56 | attributes are always valid. If the completion status is other than 57 | .B IBV_WC_SUCCESS\fR, 58 | only the following attributes are valid: wr_id, status, qp_num, and vendor_err. 59 | .SH "RETURN VALUE" 60 | On success, 61 | .B ibv_poll_cq() 62 | returns a non-negative value equal to the number of completions 63 | found. On failure, a negative value is returned. 64 | .SH "ERRORS" 65 | .TP 66 | .B EBUSY 67 | CQ is blocked by 68 | .B ibv_exp_peer_peek_cq() 69 | .SH "NOTES" 70 | .PP 71 | Each polled completion is removed from the CQ and cannot be returned to it. 72 | .PP 73 | The user should consume work completions at a rate that prevents CQ 74 | overrun from occurrence. In case of a CQ overrun, the async event 75 | .B IBV_EVENT_CQ_ERR 76 | will be triggered, and the CQ cannot be used. 77 | .SH "SEE ALSO" 78 | .BR ibv_post_send (3), 79 | .BR ibv_post_recv (3), 80 | .BR peer_direct (7) 81 | .SH "AUTHORS" 82 | .TP 83 | Dotan Barak 84 | -------------------------------------------------------------------------------- /man/ibv_post_recv.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_POST_RECV 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_post_recv \- post a list of work requests (WRs) to a receive queue 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_post_recv(struct ibv_qp " "*qp" ", struct ibv_recv_wr " "*wr" , 11 | .BI " struct ibv_recv_wr " "**bad_wr" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_post_recv() 15 | posts the linked list of work requests (WRs) starting with 16 | .I wr 17 | to the receive queue of the queue pair 18 | .I qp\fR. 19 | It stops processing WRs from this list at the first failure (that can 20 | be detected immediately while requests are being posted), and returns 21 | this failing WR through 22 | .I bad_wr\fR. 23 | .PP 24 | The argument 25 | .I wr 26 | is an ibv_recv_wr struct, as defined in . 27 | .PP 28 | .nf 29 | struct ibv_recv_wr { 30 | .in +8 31 | uint64_t wr_id; /* User defined WR ID */ 32 | struct ibv_recv_wr *next; /* Pointer to next WR in list, NULL if last WR */ 33 | struct ibv_sge *sg_list; /* Pointer to the s/g array */ 34 | int num_sge; /* Size of the s/g array */ 35 | .in -8 36 | }; 37 | .sp 38 | .nf 39 | struct ibv_sge { 40 | .in +8 41 | uint64_t addr; /* Start address of the local memory buffer */ 42 | uint32_t length; /* Length of the buffer */ 43 | uint32_t lkey; /* Key of the local Memory Region */ 44 | .in -8 45 | }; 46 | .fi 47 | .SH "RETURN VALUE" 48 | .B ibv_post_recv() 49 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 50 | .SH "NOTES" 51 | The buffers used by a WR can only be safely reused after WR the 52 | request is fully executed and a work completion has been retrieved 53 | from the corresponding completion queue (CQ). 54 | .PP 55 | If the QP 56 | .I qp 57 | is associated with a shared receive queue, you must use the function 58 | .B ibv_post_srq_recv()\fR, 59 | and not 60 | .B ibv_post_recv()\fR, 61 | since the QP's own receive queue will not be used. 62 | .PP 63 | If a WR is being posted to a UD QP, the Global Routing Header (GRH) of 64 | the incoming message will be placed in the first 40 bytes of the 65 | buffer(s) in the scatter list. If no GRH is present in the incoming 66 | message, then the first bytes will be undefined. This means that in 67 | all cases, the actual data of the incoming message will start at an 68 | offset of 40 bytes into the buffer(s) in the scatter list. 69 | .SH "SEE ALSO" 70 | .BR ibv_create_qp (3), 71 | .BR ibv_post_send (3), 72 | .BR ibv_post_srq_recv (3), 73 | .BR ibv_poll_cq (3) 74 | .SH "AUTHORS" 75 | .TP 76 | Dotan Barak 77 | -------------------------------------------------------------------------------- /man/ibv_post_srq_recv.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_POST_SRQ_RECV 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_post_srq_recv \- post a list of work requests (WRs) to a shared receive queue (SRQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_post_srq_recv(struct ibv_srq " "*srq" ", struct ibv_recv_wr " "*wr" , 11 | .BI " struct ibv_recv_wr " "**bad_wr" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_post_srq_recv() 15 | posts the linked list of work requests (WRs) starting with 16 | .I wr 17 | to the shared receive queue (SRQ) 18 | .I srq\fR. 19 | It stops processing WRs from this list at the first failure (that can 20 | be detected immediately while requests are being posted), and returns 21 | this failing WR through 22 | .I bad_wr\fR. 23 | .PP 24 | The argument 25 | .I wr 26 | is an ibv_recv_wr struct, as defined in . 27 | .PP 28 | .nf 29 | struct ibv_recv_wr { 30 | .in +8 31 | uint64_t wr_id; /* User defined WR ID */ 32 | struct ibv_recv_wr *next; /* Pointer to next WR in list, NULL if last WR */ 33 | struct ibv_sge *sg_list; /* Pointer to the s/g array */ 34 | int num_sge; /* Size of the s/g array */ 35 | .in -8 36 | }; 37 | .sp 38 | .nf 39 | struct ibv_sge { 40 | .in +8 41 | uint64_t addr; /* Start address of the local memory buffer */ 42 | uint32_t length; /* Length of the buffer */ 43 | uint32_t lkey; /* Key of the local Memory Region */ 44 | .in -8 45 | }; 46 | .fi 47 | .SH "RETURN VALUE" 48 | .B ibv_post_srq_recv() 49 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 50 | .SH "NOTES" 51 | The buffers used by a WR can only be safely reused after WR the 52 | request is fully executed and a work completion has been retrieved 53 | from the corresponding completion queue (CQ). 54 | .PP 55 | If a WR is being posted to a UD QP, the Global Routing Header (GRH) of 56 | the incoming message will be placed in the first 40 bytes of the 57 | buffer(s) in the scatter list. If no GRH is present in the incoming 58 | message, then the first bytes will be undefined. This means that in 59 | all cases, the actual data of the incoming message will start at an 60 | offset of 40 bytes into the buffer(s) in the scatter list. 61 | .SH "SEE ALSO" 62 | .BR ibv_create_qp (3), 63 | .BR ibv_post_send (3), 64 | .BR ibv_post_recv (3), 65 | .BR ibv_poll_cq (3) 66 | .SH "AUTHORS" 67 | .TP 68 | Dotan Barak 69 | -------------------------------------------------------------------------------- /man/ibv_query_device_ex.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_QUERY_DEVICE_EX 3 2014-12-17 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_query_device_ex \- query an RDMA device's attributes 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_query_device_ex(struct ibv_context " "*context", 11 | .BI " struct ibv_device_attr_ex " "*attr" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_query_device_ex() 15 | returns the attributes of the device with context 16 | .I context\fR. 17 | The argument 18 | .I attr 19 | is a pointer to an ibv_device_attr_ex struct, as defined in . 20 | .PP 21 | .nf 22 | struct ibv_device_attr_ex { 23 | .in +8 24 | struct ibv_device_attr orig_attr; 25 | uint32_t comp_mask; /* Compatibility mask that defines which of the following variables are valid */ 26 | struct ibv_odp_caps odp_caps; /* On-Demand Paging capabilities */ 27 | .in -8 28 | }; 29 | 30 | struct ibv_exp_odp_caps { 31 | uint64_t general_odp_caps; /* Mask with enum ibv_odp_general_cap_bits */ 32 | struct { 33 | uint32_t rc_odp_caps; /* Mask with enum ibv_odp_tranport_cap_bits to know which operations are supported. */ 34 | uint32_t uc_odp_caps; /* Mask with enum ibv_odp_tranport_cap_bits to know which operations are supported. */ 35 | uint32_t ud_odp_caps; /* Mask with enum ibv_odp_tranport_cap_bits to know which operations are supported. */ 36 | } per_transport_caps; 37 | }; 38 | 39 | enum ibv_odp_general_cap_bits { 40 | IBV_ODP_SUPPORT = 1 << 0, /* On demand paging is supported */ 41 | }; 42 | 43 | enum ibv_odp_transport_cap_bits { 44 | IBV_ODP_SUPPORT_SEND = 1 << 0, /* Send operations support on-demand paging */ 45 | IBV_ODP_SUPPORT_RECV = 1 << 1, /* Receive operations support on-demand paging */ 46 | IBV_ODP_SUPPORT_WRITE = 1 << 2, /* RDMA-Write operations support on-demand paging */ 47 | IBV_ODP_SUPPORT_READ = 1 << 3, /* RDMA-Read operations support on-demand paging */ 48 | IBV_ODP_SUPPORT_ATOMIC = 1 << 4, /* RDMA-Atomic operations support on-demand paging */ 49 | }; 50 | 51 | .fi 52 | .SH "RETURN VALUE" 53 | .B ibv_query_device_ex() 54 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 55 | .SH "NOTES" 56 | The maximum values returned by this function are the upper limits of 57 | supported resources by the device. However, it may not be possible to 58 | use these maximum values, since the actual number of any resource that 59 | can be created may be limited by the machine configuration, the amount 60 | of host memory, user permissions, and the amount of resources already 61 | in use by other users/processes. 62 | .SH "SEE ALSO" 63 | .BR ibv_query_device (3), 64 | .BR ibv_open_device (3), 65 | .BR ibv_query_port (3), 66 | .BR ibv_query_pkey (3), 67 | .BR ibv_query_gid (3) 68 | .SH "AUTHORS" 69 | .TP 70 | Majd Dibbiny 71 | -------------------------------------------------------------------------------- /man/ibv_query_gid.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_QUERY_GID 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_query_gid \- query an InfiniBand port's GID table 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_query_gid(struct ibv_context " "*context" ", uint8_t " "port_num" , 11 | .BI " int " "index" ", union ibv_gid " "*gid" ); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_query_gid() 15 | returns the GID value in entry 16 | .I index 17 | of port 18 | .I port_num 19 | for device context 20 | .I context 21 | through the pointer 22 | .I gid\fR. 23 | .SH "RETURN VALUE" 24 | .B ibv_query_gid() 25 | returns 0 on success, and \-1 on error. 26 | .SH "SEE ALSO" 27 | .BR ibv_open_device (3), 28 | .BR ibv_query_device (3), 29 | .BR ibv_query_port (3), 30 | .BR ibv_query_pkey (3) 31 | .SH "AUTHORS" 32 | .TP 33 | Dotan Barak 34 | -------------------------------------------------------------------------------- /man/ibv_query_pkey.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_QUERY_PKEY 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_query_pkey \- query an InfiniBand port's P_Key table 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_query_pkey(struct ibv_context " "*context" ", uint8_t " "port_num" , 11 | .BI " int " "index" ", uint16_t " "*pkey" "); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_query_pkey() 15 | returns the P_Key value (in network byte order) in entry 16 | .I index 17 | of port 18 | .I port_num 19 | for device context 20 | .I context 21 | through the pointer 22 | .I pkey\fR. 23 | .SH "RETURN VALUE" 24 | .B ibv_query_pkey() 25 | returns 0 on success, and \-1 on error. 26 | .SH "SEE ALSO" 27 | .BR ibv_open_device (3), 28 | .BR ibv_query_device (3), 29 | .BR ibv_query_port (3), 30 | .BR ibv_query_gid (3) 31 | .SH "AUTHORS" 32 | .TP 33 | Dotan Barak 34 | -------------------------------------------------------------------------------- /man/ibv_query_port.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_QUERY_PORT 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_query_port \- query an RDMA port's attributes 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_query_port(struct ibv_context " "*context" ", uint8_t " "port_num" , 11 | .BI " struct ibv_port_attr " "*port_attr" "); 12 | .fi 13 | .SH "DESCRIPTION" 14 | .B ibv_query_port() 15 | returns the attributes of port 16 | .I port_num 17 | for device context 18 | .I context 19 | through the pointer 20 | .I port_attr\fR. 21 | The argument 22 | .I port_attr 23 | is an ibv_port_attr struct, as defined in . 24 | .PP 25 | .nf 26 | struct ibv_port_attr { 27 | .in +8 28 | enum ibv_port_state state; /* Logical port state */ 29 | enum ibv_mtu max_mtu; /* Max MTU supported by port */ 30 | enum ibv_mtu active_mtu; /* Actual MTU */ 31 | int gid_tbl_len; /* Length of source GID table */ 32 | uint32_t port_cap_flags; /* Port capabilities */ 33 | uint32_t max_msg_sz; /* Maximum message size */ 34 | uint32_t bad_pkey_cntr; /* Bad P_Key counter */ 35 | uint32_t qkey_viol_cntr; /* Q_Key violation counter */ 36 | uint16_t pkey_tbl_len; /* Length of partition table */ 37 | uint16_t lid; /* Base port LID */ 38 | uint16_t sm_lid; /* SM LID */ 39 | uint8_t lmc; /* LMC of LID */ 40 | uint8_t max_vl_num; /* Maximum number of VLs */ 41 | uint8_t sm_sl; /* SM service level */ 42 | uint8_t subnet_timeout; /* Subnet propagation delay */ 43 | uint8_t init_type_reply;/* Type of initialization performed by SM */ 44 | uint8_t active_width; /* Currently active link width */ 45 | uint8_t active_speed; /* Currently active link speed */ 46 | uint8_t phys_state; /* Physical port state */ 47 | uint8_t link_layer; /* link layer protocol of the port */ 48 | .in -8 49 | }; 50 | .sp 51 | possible values for the link layer field are IBV_LINK_LAYER_INFINIBAND, 52 | IBV_LINK_LAYER_ETHERNET, or IBV_LINK_LAYER_UNSPECIFIED. 53 | .sp 54 | .fi 55 | .SH "RETURN VALUE" 56 | .B ibv_query_port() 57 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 58 | .SH "SEE ALSO" 59 | .BR ibv_create_qp (3), 60 | .BR ibv_destroy_qp (3), 61 | .BR ibv_query_qp (3), 62 | .BR ibv_create_ah (3) 63 | .SH "AUTHORS" 64 | .TP 65 | Dotan Barak 66 | -------------------------------------------------------------------------------- /man/ibv_query_qp.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_QUERY_QP 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_query_qp \- get the attributes of a queue pair (QP) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_query_qp(struct ibv_qp " "*qp" ", struct ibv_qp_attr " "*attr" , 11 | .BI " int " "attr_mask" , 12 | .BI " struct ibv_qp_init_attr " "*init_attr" ); 13 | .fi 14 | .SH "DESCRIPTION" 15 | .B ibv_query_qp() 16 | gets the attributes specified in 17 | .I attr_mask 18 | for the QP 19 | .I qp 20 | and returns them through the pointers 21 | .I attr 22 | and 23 | .I init_attr\fR. 24 | The argument 25 | .I attr 26 | is an ibv_qp_attr struct, as defined in . 27 | .PP 28 | .nf 29 | struct ibv_qp_attr { 30 | .in +8 31 | enum ibv_qp_state qp_state; /* Current QP state */ 32 | enum ibv_qp_state cur_qp_state; /* Current QP state - irrelevant for ibv_query_qp */ 33 | enum ibv_mtu path_mtu; /* Path MTU (valid only for RC/UC QPs) */ 34 | enum ibv_mig_state path_mig_state; /* Path migration state (valid if HCA supports APM) */ 35 | uint32_t qkey; /* Q_Key of the QP (valid only for UD QPs) */ 36 | uint32_t rq_psn; /* PSN for receive queue (valid only for RC/UC QPs) */ 37 | uint32_t sq_psn; /* PSN for send queue (valid only for RC/UC QPs) */ 38 | uint32_t dest_qp_num; /* Destination QP number (valid only for RC/UC QPs) */ 39 | int qp_access_flags; /* Mask of enabled remote access operations (valid only for RC/UC QPs) */ 40 | struct ibv_qp_cap cap; /* QP capabilities */ 41 | struct ibv_ah_attr ah_attr; /* Primary path address vector (valid only for RC/UC QPs) */ 42 | struct ibv_ah_attr alt_ah_attr; /* Alternate path address vector (valid only for RC/UC QPs) */ 43 | uint16_t pkey_index; /* Primary P_Key index */ 44 | uint16_t alt_pkey_index; /* Alternate P_Key index */ 45 | uint8_t en_sqd_async_notify; /* Enable SQD.drained async notification - irrelevant for ibv_query_qp */ 46 | uint8_t sq_draining; /* Is the QP draining? (Valid only if qp_state is SQD) */ 47 | uint8_t max_rd_atomic; /* Number of outstanding RDMA reads & atomic operations on the destination QP (valid only for RC QPs) */ 48 | uint8_t max_dest_rd_atomic; /* Number of responder resources for handling incoming RDMA reads & atomic operations (valid only for RC QPs) */ 49 | uint8_t min_rnr_timer; /* Minimum RNR NAK timer (valid only for RC QPs) */ 50 | uint8_t port_num; /* Primary port number */ 51 | uint8_t timeout; /* Local ack timeout for primary path (valid only for RC QPs) */ 52 | uint8_t retry_cnt; /* Retry count (valid only for RC QPs) */ 53 | uint8_t rnr_retry; /* RNR retry (valid only for RC QPs) */ 54 | uint8_t alt_port_num; /* Alternate port number */ 55 | uint8_t alt_timeout; /* Local ack timeout for alternate path (valid only for RC QPs) */ 56 | .in -8 57 | }; 58 | .fi 59 | .PP 60 | For details on struct ibv_qp_cap see the description of 61 | .B ibv_create_qp()\fR. 62 | For details on struct ibv_ah_attr see the description of 63 | .B ibv_create_ah()\fR. 64 | .SH "RETURN VALUE" 65 | .B ibv_query_qp() 66 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 67 | .SH "NOTES" 68 | The argument 69 | .I attr_mask 70 | is a hint that specifies the minimum list of attributes to retrieve. 71 | Some RDMA devices may return extra attributes not requested, for 72 | example if the value can be returned cheaply. This has the same 73 | form as in 74 | .B ibv_modify_qp()\fR. 75 | .PP 76 | Attribute values are valid if they have been set using 77 | .B ibv_modify_qp()\fR. 78 | The exact list of valid attributes depends on the QP state. 79 | .PP 80 | Multiple calls to 81 | .B ibv_query_qp() 82 | may yield some differences in the values returned for the following attributes: qp_state, path_mig_state, sq_draining, ah_attr (if APM is enabled). 83 | .SH "SEE ALSO" 84 | .BR ibv_create_qp (3), 85 | .BR ibv_destroy_qp (3), 86 | .BR ibv_modify_qp (3), 87 | .BR ibv_create_ah (3) 88 | .SH "AUTHORS" 89 | .TP 90 | Dotan Barak 91 | -------------------------------------------------------------------------------- /man/ibv_query_srq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_QUERY_SRQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_query_srq \- get the attributes of a shared receive queue (SRQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_query_srq(struct ibv_srq " "*srq" ", struct ibv_srq_attr " "*srq_attr" ); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_query_srq() 14 | gets the attributes of the SRQ 15 | .I srq 16 | and returns them through the pointer 17 | .I srq_attr\fR. 18 | The argument 19 | .I srq_attr 20 | is an ibv_srq_attr struct, as defined in . 21 | .PP 22 | .nf 23 | struct ibv_srq_attr { 24 | .in +8 25 | uint32_t max_wr; /* maximum number of outstanding work requests (WRs) in the SRQ */ 26 | uint32_t max_sge; /* maximum number of scatter elements per WR */ 27 | uint32_t srq_limit; /* the limit value of the SRQ */ 28 | .in -8 29 | }; 30 | .fi 31 | .SH "RETURN VALUE" 32 | .B ibv_query_srq() 33 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 34 | .SH "NOTES" 35 | If the value returned for srq_limit is 0, then the SRQ limit reached 36 | ("low watermark") event is not (or no longer) armed, and no 37 | asynchronous events will be generated until the event is rearmed. 38 | .SH "SEE ALSO" 39 | .BR ibv_create_srq (3), 40 | .BR ibv_destroy_srq (3), 41 | .BR ibv_modify_srq (3) 42 | .SH "AUTHORS" 43 | .TP 44 | Dotan Barak 45 | -------------------------------------------------------------------------------- /man/ibv_rate_to_mbps.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_RATE_TO_MBPS 3 2012-03-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | .nf 6 | ibv_rate_to_mbps \- convert IB rate enumeration to Mbit/sec 7 | .sp 8 | mbps_to_ibv_rate \- convert Mbit/sec to an IB rate enumeration 9 | .SH "SYNOPSIS" 10 | .nf 11 | .B #include 12 | .sp 13 | .BI "int ibv_rate_to_mbps(enum ibv_rate " "rate" "); 14 | .sp 15 | .BI "enum ibv_rate mbps_to_ibv_rate(int " "mbps" "); 16 | .fi 17 | .SH "DESCRIPTION" 18 | .B ibv_rate_to_mbps() 19 | converts the IB transmission rate enumeration 20 | .I rate 21 | to a number of Mbit/sec. For example, if 22 | .I rate 23 | is 24 | .BR IBV_RATE_5_GBPS\fR, 25 | the value 5000 will be returned (5 Gbit/sec = 5000 Mbit/sec). 26 | .PP 27 | .B mbps_to_ibv_rate() 28 | converts the number of Mbit/sec 29 | .I mult 30 | to an IB transmission rate enumeration. For example, if 31 | .I mult 32 | is 5000, the rate enumeration 33 | .BR IBV_RATE_5_GBPS 34 | will be returned. 35 | .SH "RETURN VALUE" 36 | .B ibv_rate_to_mbps() 37 | returns the number of Mbit/sec. 38 | .PP 39 | .B mbps_to_ibv_rate() 40 | returns the enumeration representing the IB transmission rate. 41 | .SH "SEE ALSO" 42 | .BR ibv_query_port (3) 43 | .SH "AUTHORS" 44 | .TP 45 | Dotan Barak 46 | -------------------------------------------------------------------------------- /man/ibv_rate_to_mult.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_RATE_TO_MULT 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | .nf 6 | ibv_rate_to_mult \- convert IB rate enumeration to multiplier of 2.5 Gbit/sec 7 | .sp 8 | mult_to_ibv_rate \- convert multiplier of 2.5 Gbit/sec to an IB rate enumeration 9 | .SH "SYNOPSIS" 10 | .nf 11 | .B #include 12 | .sp 13 | .BI "int ibv_rate_to_mult(enum ibv_rate " "rate" "); 14 | .sp 15 | .BI "enum ibv_rate mult_to_ibv_rate(int " "mult" "); 16 | .fi 17 | .SH "DESCRIPTION" 18 | .B ibv_rate_to_mult() 19 | converts the IB transmission rate enumeration 20 | .I rate 21 | to a multiple of 2.5 Gbit/sec (the base rate). For example, if 22 | .I rate 23 | is 24 | .BR IBV_RATE_5_GBPS\fR, 25 | the value 2 will be returned (5 Gbit/sec = 2 * 2.5 Gbit/sec). 26 | .PP 27 | .B mult_to_ibv_rate() 28 | converts the multiplier value (of 2.5 Gbit/sec) 29 | .I mult 30 | to an IB transmission rate enumeration. For example, if 31 | .I mult 32 | is 2, the rate enumeration 33 | .BR IBV_RATE_5_GBPS 34 | will be returned. 35 | .SH "RETURN VALUE" 36 | .B 37 | ibv_rate_to_mult() 38 | returns the multiplier of the base rate 2.5 Gbit/sec. 39 | .PP 40 | .B mult_to_ibv_rate() 41 | returns the enumeration representing the IB transmission rate. 42 | .SH "SEE ALSO" 43 | .BR ibv_query_port (3) 44 | .SH "AUTHORS" 45 | .TP 46 | Dotan Barak 47 | -------------------------------------------------------------------------------- /man/ibv_rc_pingpong.1: -------------------------------------------------------------------------------- 1 | .TH IBV_RC_PINGPONG 1 "August 30, 2005" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_rc_pingpong \- simple InfiniBand RC transport test 5 | 6 | .SH SYNOPSIS 7 | .B ibv_rc_pingpong 8 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 9 | [\-n iters] [\-l sl] [\-e] \fBHOSTNAME\fR 10 | 11 | .B ibv_rc_pingpong 12 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 13 | [\-n iters] [\-l sl] [\-e] 14 | 15 | .SH DESCRIPTION 16 | .PP 17 | Run a simple ping-pong test over InfiniBand via the reliable 18 | connected (RC) transport. 19 | 20 | .SH OPTIONS 21 | 22 | .PP 23 | .TP 24 | \fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR 25 | use TCP port \fIPORT\fR for initial synchronization (default 18515) 26 | .TP 27 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 28 | use IB device \fIDEVICE\fR (default first device found) 29 | .TP 30 | \fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR 31 | use IB port \fIPORT\fR (default port 1) 32 | .TP 33 | \fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR 34 | ping-pong messages of size \fISIZE\fR (default 4096) 35 | .TP 36 | \fB\-r\fR, \fB\-\-rx\-depth\fR=\fIDEPTH\fR 37 | post \fIDEPTH\fR receives at a time (default 1000) 38 | .TP 39 | \fB\-n\fR, \fB\-\-iters\fR=\fIITERS\fR 40 | perform \fIITERS\fR message exchanges (default 1000) 41 | .TP 42 | \fB\-l\fR, \fB\-\-sl\fR=\fISL\fR 43 | use \fISL\fR as the service level value of the QP (default 0) 44 | .TP 45 | \fB\-e\fR, \fB\-\-events\fR 46 | sleep while waiting for work completion events (default is to poll for 47 | completions) 48 | 49 | .SH SEE ALSO 50 | .BR ibv_uc_pingpong (1), 51 | .BR ibv_ud_pingpong (1), 52 | .BR ibv_srq_pingpong (1) 53 | 54 | .SH AUTHORS 55 | .TP 56 | Roland Dreier 57 | .RI < rolandd@cisco.com > 58 | 59 | .SH BUGS 60 | The network synchronization between client and server instances is 61 | weak, and does not prevent incompatible options from being used on the 62 | two instances. The method used for retrieving work completions is not 63 | strictly correct, and race conditions may cause failures on some 64 | systems. 65 | -------------------------------------------------------------------------------- /man/ibv_reg_mr.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_REG_MR 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_reg_mr, ibv_dereg_mr \- register or deregister a memory region (MR) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "struct ibv_mr *ibv_reg_mr(struct ibv_pd " "*pd" ", void " "*addr" , 11 | .BI " size_t " "length" ", int " "access" ); 12 | .sp 13 | .BI "int ibv_dereg_mr(struct ibv_mr " "*mr" ); 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_reg_mr() 17 | registers a memory region (MR) associated with the protection domain 18 | .I pd\fR. 19 | The MR's starting address is 20 | .I addr 21 | and its size is 22 | .I length\fR. 23 | The argument 24 | .I access 25 | describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of the following flags: 26 | .PP 27 | .TP 28 | .B IBV_ACCESS_LOCAL_WRITE \fR Enable Local Write Access 29 | .TP 30 | .B IBV_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access 31 | .TP 32 | .B IBV_ACCESS_REMOTE_READ\fR Enable Remote Read Access 33 | .TP 34 | .B IBV_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported) 35 | .TP 36 | .B IBV_ACCESS_MW_BIND\fR Enable Memory Window Binding 37 | .TP 38 | .B IBV_ACCESS_ON_DEMAND\fR Create an on-demand paging MR 39 | .PP 40 | If 41 | .B IBV_ACCESS_REMOTE_WRITE 42 | or 43 | .B IBV_ACCESS_REMOTE_ATOMIC 44 | is set, then 45 | .B IBV_ACCESS_LOCAL_WRITE 46 | must be set too. 47 | .PP 48 | Local read access is always enabled for the MR. 49 | .PP 50 | .B ibv_dereg_mr() 51 | deregisters the MR 52 | .I mr\fR. 53 | .SH "RETURN VALUE" 54 | .B ibv_reg_mr() 55 | returns a pointer to the registered MR, or NULL if the request fails. 56 | The local key (\fBL_Key\fR) field 57 | .B lkey 58 | is used as the lkey field of struct ibv_sge when posting buffers with 59 | ibv_post_* verbs, and the the remote key (\fBR_Key\fR) 60 | field 61 | .B rkey 62 | is used by remote processes to perform Atomic and RDMA operations. The remote process places this 63 | .B rkey 64 | as the rkey field of struct ibv_send_wr passed to the ibv_post_send function. 65 | .PP 66 | .B ibv_dereg_mr() 67 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 68 | .SH "NOTES" 69 | .B ibv_dereg_mr() 70 | fails if any memory window is still bound to this MR. 71 | .SH "SEE ALSO" 72 | .BR ibv_alloc_pd (3), 73 | .BR ibv_post_send (3), 74 | .BR ibv_post_recv (3), 75 | .BR ibv_post_srq_recv (3) 76 | .SH "AUTHORS" 77 | .TP 78 | Dotan Barak 79 | -------------------------------------------------------------------------------- /man/ibv_req_notify_cq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_REQ_NOTIFY_CQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_req_notify_cq \- request completion notification on a completion queue (CQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_req_notify_cq(struct ibv_cq " "*cq" ", int " "solicited_only" "); 11 | .SH "DESCRIPTION" 12 | .B ibv_req_notify_cq() 13 | requests a completion notification on the completion queue (CQ) 14 | .I cq\fR. 15 | .PP 16 | Upon the addition of a new CQ entry (CQE) to 17 | .I cq\fR, 18 | a completion event will be added to the completion channel associated 19 | with the CQ. 20 | If the argument 21 | .I solicited_only 22 | is zero, a completion event is generated for any new CQE. If 23 | .I solicited_only 24 | is non\-zero, an event is only generated for a new CQE with that is 25 | considered "solicited." A CQE is solicited if it is a receive 26 | completion for a message with the Solicited Event header bit set, or 27 | if the status is not successful. All other successful receive 28 | completions, or any successful send completion is unsolicited. 29 | .SH "RETURN VALUE" 30 | .B 31 | ibv_req_notify_cq() 32 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 33 | .SH "NOTES" 34 | The request for notification is "one shot." Only one completion event 35 | will be generated for each call to 36 | .B ibv_req_notify_cq()\fR. 37 | .SH "SEE ALSO" 38 | .BR ibv_create_comp_channel (3), 39 | .BR ibv_create_cq (3), 40 | .BR ibv_get_cq_event (3) 41 | .SH "AUTHORS" 42 | .TP 43 | Dotan Barak 44 | -------------------------------------------------------------------------------- /man/ibv_rereg_mr.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_REREG_MR 3 2016-03-13 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_rereg_mr \- re-register a memory region (MR) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_rereg_mr(struct ibv_mr " "*mr" ", int " " flags" , 11 | .BI " struct ibv_pd * " "pd" ", void " " *addr", 12 | .BI " size_t " " length" ", int " " access"); 13 | .fi 14 | .fi 15 | .SH "DESCRIPTION" 16 | .B ibv_rereg_mr() 17 | Modifies the attributes of an existing memory region (MR) 18 | .I mr\fR. 19 | Conceptually, this call performs the functions deregister memory region 20 | followed by register memory region. Where possible, 21 | resources are reused instead of deallocated and reallocated. 22 | .PP 23 | .I flags\fR 24 | is a bit-mask used to indicate which of the following properties of the memory region are being modified. Flags should be a combination (bit field) of: 25 | .PP 26 | .TP 27 | .B IBV_REREG_MR_CHANGE_TRANSLATION \fR Change translation (location and length) 28 | .TP 29 | .B IBV_REREG_MR_CHANGE_PD \fR Change protection domain 30 | .TP 31 | .B IBV_REREG_MR_CHANGE_ACCESS \fR Change access flags 32 | .PP 33 | When 34 | .B IBV_REREG_MR_CHANGE_PD 35 | is used, 36 | .I pd\fR 37 | represents the new PD this MR should be registered to. 38 | .br 39 | When 40 | .B IBV_REREG_MR_CHANGE_TRANSLATION 41 | is used, 42 | .I addr\fR. 43 | represents the virtual address (user-space pointer) of the new MR, while 44 | .I length\fR 45 | represents its length. 46 | .PP 47 | The access and other flags are represented in the field 48 | .I access\fR. 49 | This field describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of ibv_access_flags. 50 | .TP 51 | .SH "RETURN VALUE" 52 | .B ibv_rereg_mr() 53 | returns 0 on success, otherwise an error has occurred, 54 | .I enum ibv_rereg_mr_err_code\fR 55 | represents the error as of below. 56 | .br 57 | IBV_REREG_MR_ERR_INPUT - Old MR is valid, an input error was detected by libibverbs. 58 | .br 59 | IBV_REREG_MR_ERR_DONT_FORK_NEW - Old MR is valid, failed via dont fork on new address range. 60 | .br 61 | IBV_REREG_MR_ERR_DO_FORK_OLD - New MR is valid, failed via do fork on old address range. 62 | .br 63 | IBV_REREG_MR_ERR_CMD - MR shouldn't be used, command error. 64 | .br 65 | IBV_REREG_MR_ERR_CMD_AND_DO_FORK_NEW - MR shouldn't be used, command error, invalid fork state on new address range. 66 | 67 | .SH "NOTES" 68 | Even on a failure, the user still needs to call ibv_dereg_mr on this MR. 69 | .SH "SEE ALSO" 70 | .BR ibv_reg_mr (3), 71 | .BR ibv_dereg_mr (3), 72 | .SH "AUTHORS" 73 | .TP 74 | Matan Barak 75 | .TP 76 | Yishai Hadas 77 | -------------------------------------------------------------------------------- /man/ibv_resize_cq.3: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH IBV_RESIZE_CQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | ibv_resize_cq \- resize a completion queue (CQ) 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .sp 10 | .BI "int ibv_resize_cq(struct ibv_cq " "*cq" ", int " "cqe" "); 11 | .fi 12 | .SH "DESCRIPTION" 13 | .B ibv_resize_cq() 14 | resizes the completion queue (CQ) 15 | .I cq 16 | to have at least 17 | .I cqe 18 | entries. 19 | .I cqe 20 | must be at least the number of unpolled entries in the CQ 21 | .I cq\fR. 22 | If 23 | .I cqe 24 | is a valid value less than the current CQ size, 25 | .B ibv_resize_cq() 26 | may not do anything, since this function is only guaranteed to resize 27 | the CQ to a size at least as big as the requested size. 28 | .SH "RETURN VALUE" 29 | .B ibv_resize_cq() 30 | returns 0 on success, or the value of errno on failure (which indicates the failure reason). 31 | .SH "NOTES" 32 | .B ibv_resize_cq() 33 | may assign a CQ size greater than or equal to the requested size. 34 | The cqe member of 35 | .I cq 36 | will be updated to the actual size. 37 | .SH "SEE ALSO" 38 | .BR ibv_create_cq (3) 39 | .BR ibv_destroy_cq (3) 40 | .SH "AUTHORS" 41 | .TP 42 | Dotan Barak 43 | -------------------------------------------------------------------------------- /man/ibv_shared_mr.1: -------------------------------------------------------------------------------- 1 | .TH IBV_SHARED_MR 1 "August 28, 2012" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_shared_mr \- simple InfiniBand program which demonstrates the usage of a shared memory region 5 | 6 | .SH SYNOPSIS 7 | .B ibv_shared_mr 8 | [\-p port] [\-d device] [\-s size] [\-n no-rdma] 9 | \fBHOSTNAME\fR 10 | 11 | .SH DESCRIPTION 12 | .PP 13 | Run a simple shared memory region test over InfiniBand. 14 | Server creates a shared memory region,client gets its ID and writes some data directly to 15 | its memory, server verifies the data. 16 | Note - both client and server must run on same machine. 17 | 18 | .SH OPTIONS 19 | 20 | .PP 21 | .TP 22 | \fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR 23 | use TCP port \fIPORT\fR for initial synchronization (default 18515) 24 | .TP 25 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 26 | use IB device \fIDEVICE\fR (default first device found) 27 | .TP 28 | \fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR 29 | messages of size \fISIZE\fR (default 4096) 30 | .TP 31 | \fB\-s\fR, \fB\-\-no-rdma\fR 32 | shared memory region is used only for shared memory purposes - no rdma. 33 | .SH AUTHORS 34 | .TP 35 | Yishai Hadas 36 | .RI 37 | 38 | -------------------------------------------------------------------------------- /man/ibv_srq_pingpong.1: -------------------------------------------------------------------------------- 1 | .TH IBV_SRQ_PINGPONG 1 "August 30, 2005" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_srq_pingpong \- simple InfiniBand shared receive queue test 5 | 6 | .SH SYNOPSIS 7 | .B ibv_srq_pingpong 8 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-q num QPs] [\-r rx depth] 9 | [\-n iters] [\-l sl] [\-e] \fBHOSTNAME\fR 10 | 11 | .B ibv_srq_pingpong 12 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-q num QPs] [\-r rx depth] 13 | [\-n iters] [\-l sl] [\-e] 14 | 15 | .SH DESCRIPTION 16 | .PP 17 | Run a simple ping-pong test over InfiniBand via the reliable 18 | connected (RC) transport, using multiple queue pairs (QPs) and a 19 | single shared receive queue (SRQ). 20 | 21 | .SH OPTIONS 22 | 23 | .PP 24 | .TP 25 | \fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR 26 | use TCP port \fIPORT\fR for initial synchronization (default 18515) 27 | .TP 28 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 29 | use IB device \fIDEVICE\fR (default first device found) 30 | .TP 31 | \fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR 32 | use IB port \fIPORT\fR (default port 1) 33 | .TP 34 | \fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR 35 | ping-pong messages of size \fISIZE\fR (default 4096) 36 | .TP 37 | \fB\-q\fR, \fB\-\-num\-qp\fR=\fINUM\fR 38 | use \fINUM\fR queue pairs for test (default 16) 39 | .TP 40 | \fB\-r\fR, \fB\-\-rx\-depth\fR=\fIDEPTH\fR 41 | post \fIDEPTH\fR receives at a time (default 1000) 42 | .TP 43 | \fB\-n\fR, \fB\-\-iters\fR=\fIITERS\fR 44 | perform \fIITERS\fR message exchanges (default 1000) 45 | .TP 46 | \fB\-l\fR, \fB\-\-sl\fR=\fISL\fR 47 | use \fISL\fR as the service level value of the QPs (default 0) 48 | .TP 49 | \fB\-e\fR, \fB\-\-events\fR 50 | sleep while waiting for work completion events (default is to poll for 51 | completions) 52 | 53 | .SH SEE ALSO 54 | .BR ibv_rc_pingpong (1), 55 | .BR ibv_uc_pingpong (1), 56 | .BR ibv_ud_pingpong (1) 57 | 58 | .SH AUTHORS 59 | .TP 60 | Roland Dreier 61 | .RI < rolandd@cisco.com > 62 | 63 | .SH BUGS 64 | The network synchronization between client and server instances is 65 | weak, and does not prevent incompatible options from being used on the 66 | two instances. The method used for retrieving work completions is not 67 | strictly correct, and race conditions may cause failures on some 68 | systems. 69 | -------------------------------------------------------------------------------- /man/ibv_task_pingpong.1: -------------------------------------------------------------------------------- 1 | .TH IBV_TASK_PINGPONG 1 2013-03-10 "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_task_pingpong \- ping-pong test demonstrates using of verbs_post_task(). 5 | 6 | .SH SYNOPSIS 7 | .B ibv_task_pingpong 8 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 9 | [\-n iters] [\-l sl] [\-e] [\-m mtu] 10 | [\-c calc] [\-t op_type] [\-o operands] [\-w wait] 11 | \fBHOSTNAME\fR 12 | 13 | .B ibv_task_pingpong 14 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 15 | [\-n iters] [\-l sl] [\-e] [\-m mtu] 16 | [\-c calc] [\-t op_type] [\-o operands] [\-w wait] 17 | 18 | .SH DESCRIPTION 19 | .PP 20 | Run a simple ping-pong test over InfiniBand via the reliable 21 | connected (RC) transport using TASKs based on WAIT, CALC, SEND_EN 22 | work requests. 23 | 24 | .SH OPTIONS 25 | 26 | .PP 27 | .TP 28 | \fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR 29 | use TCP port \fIPORT\fR for initial synchronization (default 18515) 30 | .TP 31 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 32 | use IB device \fIDEVICE\fR (default first device found) 33 | .TP 34 | \fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR 35 | use IB port \fIPORT\fR (default port 1) 36 | .TP 37 | \fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR 38 | ping-pong messages of size \fISIZE\fR (default 4096) 39 | .TP 40 | \fB\-r\fR, \fB\-\-rx\-depth\fR=\fIDEPTH\fR 41 | post \fIDEPTH\fR receives at a time (default 1000) 42 | .TP 43 | \fB\-n\fR, \fB\-\-iters\fR=\fIITERS\fR 44 | perform \fIITERS\fR message exchanges (default 1000) 45 | .TP 46 | \fB\-l\fR, \fB\-\-sl\fR=\fISL\fR 47 | use \fISL\fR as the service level value of the QP (default 0) 48 | .TP 49 | \fB\-e\fR, \fB\-\-events\fR 50 | sleep while waiting for work completion events (default is to poll for 51 | completions) 52 | .TP 53 | \fB\-m\fR, \fB\-\-mtu\fR=\fISIZE\fR 54 | path MTU (default 4096) 55 | .TP 56 | \fB\-c\fR, \fB\-\-calc\fR=\fIOPERATION\fR 57 | calc operation 58 | .TP 59 | \fB\-t\fR, \fB\-\-op_type\fR=\fITYPE\fR 60 | calc operands type 61 | .TP 62 | \fB\-o\fR, \fB\-\-operands\fR=\fIO1,O2...\fR 63 | comma separated list of operands 64 | .TP 65 | \fB\-w\fR, \fB\-\-wait_cq\fR=\fIWAIT\fR 66 | wait for enties on CQ 67 | 68 | .SH SEE ALSO 69 | .BR ibv_uc_pingpong (1), 70 | .BR ibv_ud_pingpong (1), 71 | .BR ibv_srq_pingpong (1) 72 | 73 | .SH AUTHORS 74 | .TP 75 | Igor Ivanov 76 | .RI < Igor.Ivanov@itseez.com > 77 | .TP 78 | Roland Dreier 79 | .RI < rolandd@cisco.com > 80 | -------------------------------------------------------------------------------- /man/ibv_uc_pingpong.1: -------------------------------------------------------------------------------- 1 | .TH IBV_UC_PINGPONG 1 "August 30, 2005" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_uc_pingpong \- simple InfiniBand UC transport test 5 | 6 | .SH SYNOPSIS 7 | .B ibv_uc_pingpong 8 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 9 | [\-n iters] [\-l sl] [\-e] \fBHOSTNAME\fR 10 | 11 | .B ibv_uc_pingpong 12 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 13 | [\-n iters] [\-l sl] [\-e] 14 | 15 | .SH DESCRIPTION 16 | .PP 17 | Run a simple ping-pong test over InfiniBand via the reliable 18 | connected (RC) transport. 19 | 20 | .SH OPTIONS 21 | 22 | .PP 23 | .TP 24 | \fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR 25 | use TCP port \fIPORT\fR for initial synchronization (default 18515) 26 | .TP 27 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 28 | use IB device \fIDEVICE\fR (default first device found) 29 | .TP 30 | \fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR 31 | use IB port \fIPORT\fR (default port 1) 32 | .TP 33 | \fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR 34 | ping-pong messages of size \fISIZE\fR (default 4096) 35 | .TP 36 | \fB\-r\fR, \fB\-\-rx\-depth\fR=\fIDEPTH\fR 37 | post \fIDEPTH\fR receives at a time (default 1000) 38 | .TP 39 | \fB\-n\fR, \fB\-\-iters\fR=\fIITERS\fR 40 | perform \fIITERS\fR message exchanges (default 1000) 41 | .TP 42 | \fB\-l\fR, \fB\-\-sl\fR=\fISL\fR 43 | use \fISL\fR as the service level value of the QP (default 0) 44 | .TP 45 | \fB\-e\fR, \fB\-\-events\fR 46 | sleep while waiting for work completion events (default is to poll for 47 | completions) 48 | 49 | .SH SEE ALSO 50 | .BR ibv_rc_pingpong (1), 51 | .BR ibv_ud_pingpong (1), 52 | .BR ibv_srq_pingpong (1) 53 | 54 | .SH AUTHORS 55 | .TP 56 | Roland Dreier 57 | .RI < rolandd@cisco.com > 58 | 59 | .SH BUGS 60 | The network synchronization between client and server instances is 61 | weak, and does not prevent incompatible options from being used on the 62 | two instances. The method used for retrieving work completions is not 63 | strictly correct, and race conditions may cause failures on some 64 | systems. 65 | -------------------------------------------------------------------------------- /man/ibv_ud_pingpong.1: -------------------------------------------------------------------------------- 1 | .TH IBV_UD_PINGPONG 1 "August 30, 2005" "libibverbs" "USER COMMANDS" 2 | 3 | .SH NAME 4 | ibv_ud_pingpong \- simple InfiniBand UD transport test 5 | 6 | .SH SYNOPSIS 7 | .B ibv_ud_pingpong 8 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 9 | [\-n iters] [\-l sl] [\-e] \fBHOSTNAME\fR 10 | 11 | .B ibv_ud_pingpong 12 | [\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth] 13 | [\-n iters] [\-l sl] [\-e] 14 | 15 | .SH DESCRIPTION 16 | .PP 17 | Run a simple ping-pong test over InfiniBand via the unreliable 18 | datagram (UD) transport. 19 | 20 | .SH OPTIONS 21 | 22 | .PP 23 | .TP 24 | \fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR 25 | use TCP port \fIPORT\fR for initial synchronization (default 18515) 26 | .TP 27 | \fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR 28 | use IB device \fIDEVICE\fR (default first device found) 29 | .TP 30 | \fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR 31 | use IB port \fIPORT\fR (default port 1) 32 | .TP 33 | \fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR 34 | ping-pong messages of size \fISIZE\fR (default 2048) 35 | .TP 36 | \fB\-r\fR, \fB\-\-rx\-depth\fR=\fIDEPTH\fR 37 | post \fIDEPTH\fR receives at a time (default 500) 38 | .TP 39 | \fB\-n\fR, \fB\-\-iters\fR=\fIITERS\fR 40 | perform \fIITERS\fR message exchanges (default 1000) 41 | .TP 42 | \fB\-l\fR, \fB\-\-sl\fR=\fISL\fR 43 | send messages with service level \fISL\fR (default 0) 44 | .TP 45 | \fB\-e\fR, \fB\-\-events\fR 46 | sleep while waiting for work completion events (default is to poll for 47 | completions) 48 | 49 | .SH SEE ALSO 50 | .BR ibv_rc_pingpong (1), 51 | .BR ibv_uc_pingpong (1), 52 | .BR ibv_srq_pingpong (1) 53 | 54 | .SH AUTHORS 55 | .TP 56 | Roland Dreier 57 | .RI < rolandd@cisco.com > 58 | 59 | .SH BUGS 60 | The network synchronization between client and server instances is 61 | weak, and does not prevent incompatible options from being used on the 62 | two instances. The method used for retrieving work completions is not 63 | strictly correct, and race conditions may cause failures on some 64 | systems. 65 | -------------------------------------------------------------------------------- /man/peer_direct.7: -------------------------------------------------------------------------------- 1 | .\" -*- nroff -*- 2 | .\" 3 | .TH PEER-DIRECT 7 2013-08-22 peer-direct "Libibverbs Programmer's Manual" 4 | .SH "NAME" 5 | Peer-Direct async \- Infiniband verbs library sub-system 6 | .SH "SYNOPSIS" 7 | .nf 8 | .B #include 9 | .fi 10 | .SH "DESCRIPTION" 11 | 12 | Peer-Direct technology gives peer hardware 13 | devices, such as GPU cards, dedicated AS accelerators, etc. ability 14 | to take control over HCA in critical path offloading CPU. 15 | 16 | To achieve this, there is a set of verbs calls and 17 | structures providing application with abstract description of operation 18 | sequences intended to be executed by peer device. 19 | .PP 20 | QP/CQ have corresponding comp_mask flags to make them 21 | accesible by peer device: 22 | .TP 23 | .B IBV_EXP_QP_INIT_ATTR_PEER_DIRECT 24 | .TP 25 | .B IBV_EXP_CQ_INIT_ATTR_PEER_DIRECT 26 | .SS struct ibv_peer_direct_attr 27 | Structure describing peer device associated with registered QP/CQ - 28 | new part of corresponding exp_create_attr strucutures: 29 | .sp 30 | .nf 31 | struct ibv_exp_peer_direct_attr { 32 | uint64_t peer_id; 33 | struct ibv_peer_buf *(*buf_alloc)(struct ibv_peer_buf_alloc_attr *attr); 34 | int (*buf_release)(struct ibv_peer_buf *pb); 35 | uint64_t (*register_va)(void *start, size_t length, uint64_t peer_id); 36 | int (*unregister_va)(uint64_t registration_id, uint64_t peer_id); 37 | uint64_t caps; 38 | size_t peer_dma_op_map_len; 39 | uint32_t comp_mask; 40 | } 41 | .fi 42 | .sp 43 | .I peer_id 44 | Unique ID per peer device. Used to identify specific HW devices where relevant. 45 | .sp 46 | .I buf_alloc 47 | callback should return struct 48 | .I ibv_peer_buf 49 | with buffer of at least 50 | .B attr->length 51 | length. Buffer should be mapped in the application address space 52 | for read/write (depends on 53 | .B attr->dir 54 | value). 55 | If NULL returned then buffer will be allocated in system memory by ibverbs driver. 56 | Otherwise pointer to struct 57 | .I ibv_peer_buf 58 | describing allocated buffer returned. 59 | .sp 60 | .I buf_release 61 | If buffer was allocated by buf_alloc then buf_release will be called to release it. 62 | .B pb 63 | - struct returned by buf_alloc. 64 | buf_release is responsible to release everything allocated by buf_alloc. 65 | .br 66 | Return 0 on succes. 67 | .sp 68 | .I register_va 69 | callback should register virtual address from the 70 | application as an area the peer is allowed to access. 71 | .B start 72 | pointer to beginning of region in virtual space 73 | .B length 74 | length of region 75 | .B peer_id 76 | the ID of the peer device which will be accessing the region. 77 | .br 78 | Return id of registered address on success, 0 on failure. 79 | .sp 80 | .I unregister_va 81 | If virtual address was registered with register_va then 82 | unregister_va will be called to unregister it. 83 | .BR registration_id 84 | - id returned by register_va 85 | .B peer_id 86 | the ID of the peer device passed to register_va. 87 | .br 88 | Return 0 on success. 89 | .sp 90 | .I caps 91 | bitmask of supported ibv_peer_op types 92 | .sp 93 | .I peer_dma_op_map_len 94 | Maximal length of DMA operation the peer can do in copy-block 95 | .sp 96 | .I comp_mask 97 | Reserved for future extensions, must be 0 98 | .SS struct ibv_peer_buf_alloc_attr 99 | description of desired buffer 100 | .sp 101 | .nf 102 | struct ibv_peer_buf_alloc_attr { 103 | size_t length; 104 | uint32_t dir; 105 | uint64_t peer_id; 106 | uint32_t comp_mask; 107 | } 108 | .fi 109 | .sp 110 | .I dir 111 | Indicate HW entities supposed to access memory buffer: 112 | .TP 113 | IBV_PEER_DIRECTION_FROM_X means X writes to the buffer 114 | .TP 115 | IBV_PEER_DIRECTION_TO_Y means Y read from the buffer 116 | .TP 117 | IBV_PEER_DIRECTION_FROM_CPU 118 | .TP 119 | IBV_PEER_DIRECTION_FROM_HCA 120 | .TP 121 | IBV_PEER_DIRECTION_FROM_PEER 122 | .TP 123 | IBV_PEER_DIRECTION_TO_CPU 124 | .TP 125 | IBV_PEER_DIRECTION_TO_HCA 126 | .TP 127 | IBV_PEER_DIRECTION_TO_PEER 128 | .P 129 | .I peer_id 130 | The ID of the peer device which will be accessing the allocated buffer 131 | .sp 132 | .I comp_mask 133 | Reserved for future extensions, must be 0 134 | .SS struct ibv_peer_buf 135 | 136 | .nf 137 | struct ibv_peer_buf { 138 | void *addr; 139 | size_t length; 140 | uint32_t comp_mask; 141 | } 142 | .fi 143 | .SH "SEE ALSO" 144 | .BR ibv_exp_create_qp (3), 145 | .BR ibv_exp_create_cq (3), 146 | .BR ibv_exp_peer_commit_qp (3), 147 | .BR ibv_exp_rollback_qp (3), 148 | .BR ibv_exp_peer_peek_cq (3), 149 | .BR ibv_exp_peer_abort_peek_cq (3) 150 | .SH "AUTHORS" 151 | .TP 152 | Artemy Kovalyov 153 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | *.la 2 | .dirstamp 3 | .libs 4 | -------------------------------------------------------------------------------- /src/libibverbs.map: -------------------------------------------------------------------------------- 1 | IBVERBS_1.0 { 2 | global: 3 | ibv_get_device_list; 4 | ibv_free_device_list; 5 | ibv_get_device_name; 6 | ibv_get_device_guid; 7 | ibv_open_device; 8 | ibv_close_device; 9 | ibv_get_async_event; 10 | ibv_ack_async_event; 11 | ibv_query_device; 12 | ibv_query_device_ex; 13 | ibv_query_port; 14 | ibv_query_gid; 15 | ibv_query_pkey; 16 | ibv_alloc_pd; 17 | ibv_dealloc_pd; 18 | ibv_reg_mr; 19 | ibv_dereg_mr; 20 | ibv_create_comp_channel; 21 | ibv_destroy_comp_channel; 22 | ibv_create_cq; 23 | ibv_resize_cq; 24 | ibv_destroy_cq; 25 | ibv_get_cq_event; 26 | ibv_ack_cq_events; 27 | ibv_create_srq; 28 | ibv_modify_srq; 29 | ibv_query_srq; 30 | ibv_destroy_srq; 31 | ibv_create_qp; 32 | ibv_query_qp; 33 | ibv_modify_qp; 34 | ibv_destroy_qp; 35 | ibv_create_ah; 36 | ibv_destroy_ah; 37 | ibv_attach_mcast; 38 | ibv_detach_mcast; 39 | ibv_cmd_get_context; 40 | ibv_cmd_query_device; 41 | ibv_cmd_query_device_ex; 42 | ibv_cmd_query_port; 43 | ibv_cmd_query_gid; 44 | ibv_cmd_query_pkey; 45 | ibv_cmd_alloc_pd; 46 | ibv_cmd_dealloc_pd; 47 | ibv_cmd_reg_mr; 48 | ibv_cmd_dereg_mr; 49 | ibv_cmd_create_cq; 50 | ibv_cmd_poll_cq; 51 | ibv_cmd_req_notify_cq; 52 | ibv_cmd_resize_cq; 53 | ibv_cmd_destroy_cq; 54 | ibv_cmd_create_srq; 55 | ibv_cmd_modify_srq; 56 | ibv_cmd_query_srq; 57 | ibv_cmd_destroy_srq; 58 | ibv_cmd_create_qp; 59 | ibv_cmd_query_qp; 60 | ibv_cmd_modify_qp; 61 | ibv_cmd_destroy_qp; 62 | ibv_cmd_post_send; 63 | ibv_cmd_post_recv; 64 | ibv_cmd_post_srq_recv; 65 | ibv_cmd_create_ah; 66 | ibv_cmd_destroy_ah; 67 | ibv_cmd_attach_mcast; 68 | ibv_cmd_detach_mcast; 69 | ibv_cmd_create_flow; 70 | ibv_cmd_destroy_flow; 71 | ibv_copy_qp_attr_from_kern; 72 | ibv_copy_path_rec_from_kern; 73 | ibv_copy_path_rec_to_kern; 74 | ibv_rate_to_mult; 75 | mult_to_ibv_rate; 76 | ibv_get_sysfs_path; 77 | ibv_read_sysfs_file; 78 | 79 | local: *; 80 | }; 81 | 82 | IBVERBS_1.1 { 83 | global: 84 | ibv_get_device_list; 85 | ibv_free_device_list; 86 | ibv_get_device_name; 87 | ibv_get_device_guid; 88 | ibv_open_device; 89 | ibv_close_device; 90 | 91 | ibv_init_ah_from_wc; 92 | ibv_create_ah_from_wc; 93 | ibv_copy_ah_attr_from_kern; 94 | ibv_fork_init; 95 | ibv_dontfork_range; 96 | ibv_dofork_range; 97 | ibv_register_driver; 98 | verbs_register_driver; 99 | 100 | ibv_node_type_str; 101 | ibv_port_state_str; 102 | ibv_event_type_str; 103 | ibv_wc_status_str; 104 | 105 | ibv_cmd_alloc_mw; 106 | ibv_cmd_dealloc_mw; 107 | 108 | ibv_rate_to_mbps; 109 | mbps_to_ibv_rate; 110 | ibv_cmd_open_xrcd; 111 | ibv_cmd_close_xrcd; 112 | ibv_cmd_create_srq_ex; 113 | ibv_cmd_open_qp; 114 | ibv_open_xrc_domain; 115 | ibv_create_xrc_srq; 116 | ibv_close_xrc_domain; 117 | ibv_create_xrc_rcv_qp; 118 | ibv_modify_xrc_rcv_qp; 119 | ibv_reg_xrc_rcv_qp; 120 | ibv_unreg_xrc_rcv_qp; 121 | ibv_query_xrc_rcv_qp; 122 | ibv_exp_cmd_create_qp; 123 | ibv_exp_cmd_query_device; 124 | ibv_exp_cmd_create_dct; 125 | ibv_exp_cmd_destroy_dct; 126 | ibv_exp_cmd_query_dct; 127 | ibv_exp_cmd_arm_dct; 128 | ibv_exp_cmd_modify_cq; 129 | ibv_exp_cmd_modify_qp; 130 | ibv_exp_cmd_create_cq; 131 | ibv_exp_cmd_create_mr; 132 | ibv_exp_cmd_query_mkey; 133 | ibv_cmd_exp_reg_mr; 134 | ibv_cmd_exp_prefetch_mr; 135 | ibv_exp_cmd_rereg_mr; 136 | ibv_exp_cmd_getenv; 137 | ibv_exp_cmd_create_flow; 138 | ibv_exp_cmd_destroy_flow; 139 | ibv_exp_cmd_create_wq; 140 | ibv_exp_cmd_modify_wq; 141 | ibv_exp_cmd_destroy_wq; 142 | ibv_exp_cmd_create_rwq_ind_table; 143 | ibv_exp_cmd_destroy_rwq_ind_table; 144 | ibv_exp_cmd_set_context_attr; 145 | ibv_cmd_rereg_mr; 146 | ibv_exp_cmd_create_srq; 147 | ibv_exp_cmd_alloc_dm; 148 | ibv_exp_cmd_free_dm; 149 | } IBVERBS_1.0; 150 | -------------------------------------------------------------------------------- /src/neigh.h: -------------------------------------------------------------------------------- 1 | #ifndef _GET_NEIGH_ 2 | #define _GET_NEIGH_ 3 | 4 | #include 5 | #include 6 | #include "config.h" 7 | #ifdef HAVE_LIBNL1 8 | #include 9 | #else 10 | #include 11 | #endif 12 | 13 | enum get_neigh_status { 14 | GET_NEIGH_STATUS_OK = 0, 15 | GET_NEIGH_STATUS_IN_PROCESS = 1 << 0, 16 | GET_NEIGH_STATUS_ERR = 1 << 1, 17 | }; 18 | 19 | struct get_neigh_handler { 20 | #ifdef HAVE_LIBNL1 21 | struct nl_handle *sock; 22 | #else 23 | struct nl_sock *sock; 24 | #endif 25 | struct nl_cache *link_cache; 26 | struct nl_cache *neigh_cache; 27 | struct nl_cache *route_cache; 28 | int32_t oif; 29 | int vid; 30 | struct rtnl_neigh *filter_neigh; 31 | struct nl_addr *found_ll_addr; 32 | struct nl_addr *dst; 33 | struct nl_addr *src; 34 | enum get_neigh_status neigh_status; 35 | uint64_t timeout; 36 | }; 37 | 38 | int process_get_neigh(struct get_neigh_handler *neigh_handler); 39 | void neigh_free_resources(struct get_neigh_handler *neigh_handler); 40 | void neigh_set_vlan_id(struct get_neigh_handler *neigh_handler, uint16_t vid); 41 | uint16_t neigh_get_vlan_id_from_dev(struct get_neigh_handler *neigh_handler); 42 | int neigh_init_resources(struct get_neigh_handler *neigh_handler, int timeout); 43 | 44 | int neigh_set_src(struct get_neigh_handler *neigh_handler, 45 | int family, void *buf, size_t size); 46 | void neigh_set_oif(struct get_neigh_handler *neigh_handler, int oif); 47 | int neigh_set_dst(struct get_neigh_handler *neigh_handler, 48 | int family, void *buf, size_t size); 49 | int neigh_get_oif_from_src(struct get_neigh_handler *neigh_handler); 50 | int neigh_get_ll(struct get_neigh_handler *neigh_handler, void *addr_buf, 51 | int addr_size); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/sysfs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. 3 | * 4 | * This software is available to you under a choice of one of two 5 | * licenses. You may choose to be licensed under the terms of the GNU 6 | * General Public License (GPL) Version 2, available from the file 7 | * COPYING in the main directory of this source tree, or the 8 | * OpenIB.org BSD license below: 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must retain the above 15 | * copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | 33 | #if HAVE_CONFIG_H 34 | # include 35 | #endif /* HAVE_CONFIG_H */ 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #include "ibverbs.h" 46 | 47 | static char *sysfs_path; 48 | 49 | const char *ibv_get_sysfs_path(void) 50 | { 51 | char *env = NULL; 52 | 53 | if (sysfs_path) 54 | return sysfs_path; 55 | 56 | /* 57 | * Only follow use path passed in through the calling user's 58 | * environment if we're not running SUID. 59 | */ 60 | if (getuid() == geteuid()) 61 | env = getenv("SYSFS_PATH"); 62 | 63 | if (env) { 64 | int len; 65 | 66 | sysfs_path = strndup(env, IBV_SYSFS_PATH_MAX); 67 | len = strlen(sysfs_path); 68 | while (len > 0 && sysfs_path[len - 1] == '/') { 69 | --len; 70 | sysfs_path[len] = '\0'; 71 | } 72 | } else 73 | sysfs_path = "/sys"; 74 | 75 | return sysfs_path; 76 | } 77 | 78 | int ibv_read_sysfs_file(const char *dir, const char *file, 79 | char *buf, size_t size) 80 | { 81 | char *path; 82 | int fd; 83 | int len; 84 | 85 | if (asprintf(&path, "%s/%s", dir, file) < 0) 86 | return -1; 87 | 88 | fd = open(path, O_RDONLY); 89 | if (fd < 0) { 90 | free(path); 91 | return -1; 92 | } 93 | 94 | len = read(fd, buf, size); 95 | 96 | close(fd); 97 | free(path); 98 | 99 | if (len > 0 && buf[len - 1] == '\n') 100 | buf[--len] = '\0'; 101 | 102 | return len; 103 | } 104 | -------------------------------------------------------------------------------- /tests/api/gtest_init.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Mellanox Technologies Ltd. 2012. ALL RIGHTS RESERVED. 3 | * This software product is a proprietary product of Mellanox Technologies Ltd. 4 | * (the "Company") and all right, title, and interest and to the software product, 5 | * including all associated intellectual property rights, are and shall 6 | * remain exclusively with the Company. 7 | * 8 | * This software product is governed by the End User License Agreement 9 | * provided with the software product. 10 | * $COPYRIGHT$ 11 | * $HEADER$ 12 | */ 13 | 14 | #include "gtest_cmn.h" 15 | #include "gtest/gtest.h" 16 | 17 | 18 | /* ibv_get_device_list: [TI.1] Correct */ 19 | TEST(tc_ibv_get_device_list, ti_1) { 20 | 21 | struct ibv_device **dev_list; 22 | int num_devices = 0; 23 | 24 | errno = EOK; 25 | dev_list = ibv_get_device_list(&num_devices); 26 | EXPECT_TRUE(errno == EOK); 27 | EXPECT_TRUE(dev_list != NULL); 28 | EXPECT_TRUE(num_devices); 29 | 30 | ibv_free_device_list(dev_list); 31 | } 32 | 33 | /* ibv_get_device_name: [TI.1] Correct */ 34 | TEST(tc_ibv_get_device_name, ti_1) { 35 | 36 | struct ibv_device **dev_list; 37 | int num_devices = 0; 38 | int i = 0; 39 | 40 | errno = EOK; 41 | dev_list = ibv_get_device_list(&num_devices); 42 | EXPECT_TRUE(errno == EOK); 43 | EXPECT_TRUE(dev_list != NULL); 44 | EXPECT_TRUE(num_devices); 45 | 46 | for (i = 0; i < num_devices; ++i) { 47 | VERBS_INFO(" %-16s\t%016llx\n", 48 | ibv_get_device_name(dev_list[i]), 49 | (unsigned long long) ntohll(ibv_get_device_guid(dev_list[i]))); 50 | } 51 | 52 | ibv_free_device_list(dev_list); 53 | } 54 | 55 | /* ibv_open_device: [TI.1] Correct */ 56 | TEST(tc_ibv_open_device, ti_1) { 57 | 58 | struct ibv_device **dev_list; 59 | struct ibv_device *ibv_dev; 60 | struct ibv_context*ibv_ctx; 61 | int num_devices = 0; 62 | 63 | errno = EOK; 64 | dev_list = ibv_get_device_list(&num_devices); 65 | ASSERT_TRUE(errno == EOK); 66 | ASSERT_TRUE(dev_list != NULL); 67 | ASSERT_TRUE(num_devices); 68 | 69 | ibv_dev = dev_list[0]; 70 | 71 | ibv_ctx = ibv_open_device(ibv_dev); 72 | ASSERT_TRUE(ibv_ctx != NULL); 73 | 74 | ibv_close_device(ibv_ctx); 75 | ibv_free_device_list(dev_list); 76 | } 77 | -------------------------------------------------------------------------------- /tests/cmn/gtest_cmn.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Mellanox Technologies Ltd. 2012. ALL RIGHTS RESERVED. 3 | * This software product is a proprietary product of Mellanox Technologies Ltd. 4 | * (the "Company") and all right, title, and interest and to the software product, 5 | * including all associated intellectual property rights, are and shall 6 | * remain exclusively with the Company. 7 | * 8 | * This software product is governed by the End User License Agreement 9 | * provided with the software product. 10 | * $COPYRIGHT$ 11 | * $HEADER$ 12 | */ 13 | 14 | #include "gtest_cmn.h" 15 | 16 | 17 | uint32_t gtest_debug_mask = (GTEST_LOG_FATAL | GTEST_LOG_ERR | GTEST_LOG_WARN); 18 | char *gtest_dev_name; 19 | 20 | 21 | void sys_hexdump(void *ptr, int buflen) 22 | { 23 | unsigned char *buf = (unsigned char*)ptr; 24 | char out_buf[120]; 25 | int ret = 0; 26 | int out_pos = 0; 27 | int i, j; 28 | 29 | VERBS_TRACE("dump data at %p\n", ptr); 30 | for (i=0; i 31 | 32 | 33 | #include "cmn/gtest_cmn.h" 34 | #include "gtest/gtest.h" 35 | #include "gtest/gtest-all.cc" 36 | 37 | 38 | GTEST_API_ int main(int argc, char **argv) { 39 | std::cout << "Running main() from gtest_main.cc\n"; 40 | 41 | sys_getenv(); 42 | testing::GTEST_FLAG(print_time) = true; 43 | testing::InitGoogleTest(&argc, argv); 44 | return RUN_ALL_TESTS(); 45 | } 46 | -------------------------------------------------------------------------------- /util/util.h: -------------------------------------------------------------------------------- 1 | /* GPLv2 or OpenIB.org BSD (MIT) See COPYING file */ 2 | #ifndef UTIL_UTIL_H 3 | #define UTIL_UTIL_H 4 | 5 | /* Return true if the snprintf succeeded, false if there was truncation or 6 | * error */ 7 | #define check_snprintf(buf, len, fmt, ...) \ 8 | ({ \ 9 | int rc = snprintf(buf, len, fmt, ##__VA_ARGS__); \ 10 | (rc < len && rc >= 0); \ 11 | }) 12 | 13 | #endif 14 | --------------------------------------------------------------------------------