зеркало из https://github.com/microsoft/Freeflow.git
simplify the installation process
This commit is contained in:
Родитель
06043ae8f1
Коммит
9915419652
10
README.md
10
README.md
|
@ -37,17 +37,15 @@ Then log into the router container with
|
|||
sudo docker run exec -it router1 bash
|
||||
```
|
||||
|
||||
Download and install the same version of RDMA libraries and drivers as the host machine.
|
||||
Download and install RDMA libraries and drivers in router container.
|
||||
Currently, Freeflow is developed and tested with "MLNX_OFED_LINUX-4.0-2.0.0.1-ubuntu14.04-x86_64.tgz"
|
||||
You can download it from http://www.mellanox.com/page/products_dyn?product_family=26.
|
||||
|
||||
Then, build the code in libraries-router/librdmacm-1.1.0mlnx/, and install the library to /usr/lib/ (which is default).
|
||||
Then, build the code using the script build-router.sh. In ffrouter/, start the router by running "./router router1".
|
||||
|
||||
Finally, build the code of ffrouter/ with "build.sh" in the source folder and run "./router router1".
|
||||
Step 2: Repeat Step 1 to start the router in other hosts. You can capture a Docker image of router1 for avoiding repeating the installations and building.
|
||||
|
||||
Step 2: Repeat Step 1 to start router in other hosts. You can capture a Docker image of router1 for avoiding repeating the installations and building.
|
||||
|
||||
Step 3: Start a customer container on the same host as router1
|
||||
Step 3: Start an application container on the same host as router1
|
||||
```
|
||||
sudo docker run --name node1 --net weave -e "FFR_NAME=router1" -e "FFR_ID=10" -e "LD_LIBRARY_PATH=/usr/lib" -e --ipc=container:router1 -v /sys/class/:/sys/class/ -v /freeflow:/freeflow -v /dev/:/dev/ --privileged --device=/dev/infiniband/uverbs0 --device=/dev/infiniband/rdma_cm -it -d ubuntu /bin/bash
|
||||
```
|
||||
|
|
|
@ -1,16 +1,4 @@
|
|||
cd libraries-router/libmlx4-1.2.1mlnx1/
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr/ --libdir=/usr/lib/ --sysconfdir=/etc/
|
||||
make
|
||||
make install
|
||||
|
||||
cd ../libibverbs-1.2.1mlnx1/
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr/ --libdir=/usr/lib/ --sysconfdir=/etc/
|
||||
make
|
||||
make install
|
||||
|
||||
cd ../librdmacm-1.1.0mlnx/
|
||||
cd libraries-router/librdmacm-1.1.0mlnx/
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr/ --libdir=/usr/lib/ --sysconfdir=/etc/
|
||||
make
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
*.o
|
||||
*.lo
|
||||
configure
|
||||
Makefile.in
|
||||
autom4te.cache
|
||||
aclocal.m4
|
||||
stamp-h.in
|
||||
config.h.in
|
||||
config.log
|
||||
config.h
|
||||
.libs
|
||||
.deps
|
||||
libibverbs.spec
|
||||
Makefile
|
||||
config.status
|
||||
stamp-h1
|
||||
libtool
|
|
@ -1,5 +0,0 @@
|
|||
[gerrit]
|
||||
host=r-webdev02.lab.mtl.com
|
||||
port=29418
|
||||
project=mlnx_ofed_2_0/libibverbs.git
|
||||
defaultbranch=mlnx_ofed_2_1
|
|
@ -1,4 +0,0 @@
|
|||
Roland Dreier <roland@topspin.com>
|
||||
Dotan Barak <dotanba@gmail.com>
|
||||
Sean Hefty <sean.hefty@intel.com>
|
||||
Michael S. Tsirkin <mst@mellanox.co.il>
|
|
@ -1,378 +0,0 @@
|
|||
This software is available to you under a choice of one of two
|
||||
licenses. You may choose to be licensed under the terms of the the
|
||||
OpenIB.org BSD license or the GNU General Public License (GPL) Version
|
||||
2, both included below.
|
||||
|
||||
Copyright (c) 2004 Topspin Communications. All rights reserved.
|
||||
|
||||
==================================================================
|
||||
|
||||
OpenIB.org BSD license
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
==================================================================
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,228 +0,0 @@
|
|||
AM_CPPFLAGS = -I$(srcdir)/include
|
||||
|
||||
lib_LTLIBRARIES = src/libibverbs.la
|
||||
|
||||
ACLOCAL_AMFLAGS = -I config
|
||||
AM_CFLAGS = -g -Wall -Werror
|
||||
|
||||
src_libibverbs_la_CFLAGS = $(AM_CFLAGS) -DIBV_CONFIG_DIR=\"$(sysconfdir)/libibverbs.d\" \
|
||||
$(LIBNL_CFLAGS)
|
||||
|
||||
libibverbs_version_script = @LIBIBVERBS_VERSION_SCRIPT@
|
||||
|
||||
src_libibverbs_la_SOURCES = src/cmd.c src/compat-1_0.c src/device.c src/init.c \
|
||||
src/marshall.c src/memory.c src/sysfs.c src/verbs.c \
|
||||
src/enum_strs.c src/cmd_exp.c
|
||||
if ! NO_RESOLVE_NEIGH
|
||||
src_libibverbs_la_SOURCES += src/neigh.c
|
||||
noinst_HEADERS = src/neigh.h
|
||||
endif
|
||||
src_libibverbs_la_LDFLAGS = -version-info 1 -export-dynamic $(LIBNL_LIBS)\
|
||||
$(libibverbs_version_script)
|
||||
src_libibverbs_la_DEPENDENCIES = $(srcdir)/src/libibverbs.map
|
||||
|
||||
bin_PROGRAMS = examples/ibv_devices examples/ibv_devinfo \
|
||||
examples/ibv_asyncwatch examples/ibv_rc_pingpong examples/ibv_uc_pingpong \
|
||||
examples/ibv_ud_pingpong examples/ibv_srq_pingpong examples/ibv_shared_mr \
|
||||
examples/ibv_xsrq_pingpong examples/ibv_cc_pingpong examples/ibv_task_pingpong \
|
||||
examples/ibv_dcini examples/ibv_dctgt examples/ibv_umr examples/ibv_intf \
|
||||
examples/ibv_polldcinfo
|
||||
|
||||
examples_ibv_devices_SOURCES = examples/device_list.c
|
||||
examples_ibv_devices_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_devinfo_SOURCES = examples/devinfo.c
|
||||
examples_ibv_devinfo_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_rc_pingpong_SOURCES = examples/rc_pingpong.c examples/pingpong.c
|
||||
examples_ibv_rc_pingpong_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_uc_pingpong_SOURCES = examples/uc_pingpong.c examples/pingpong.c
|
||||
examples_ibv_uc_pingpong_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_ud_pingpong_SOURCES = examples/ud_pingpong.c examples/pingpong.c
|
||||
examples_ibv_ud_pingpong_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_srq_pingpong_SOURCES = examples/srq_pingpong.c examples/pingpong.c
|
||||
examples_ibv_srq_pingpong_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_shared_mr_SOURCES = examples/shared_mr.c
|
||||
examples_ibv_shared_mr_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_asyncwatch_SOURCES = examples/asyncwatch.c
|
||||
examples_ibv_asyncwatch_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_xsrq_pingpong_SOURCES = examples/xsrq_pingpong.c examples/pingpong.c
|
||||
examples_ibv_xsrq_pingpong_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_cc_pingpong_SOURCES = examples/cc_pingpong.c
|
||||
examples_ibv_cc_pingpong_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_task_pingpong_SOURCES = examples/task_pingpong.c
|
||||
examples_ibv_task_pingpong_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_dcini_SOURCES = examples/dcini.c
|
||||
examples_ibv_dcini_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_dctgt_SOURCES = examples/dctgt.c examples/pingpong.c examples/dc.h
|
||||
examples_ibv_dctgt_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_umr_SOURCES = examples/umr_rc.c examples/pingpong.c
|
||||
examples_ibv_umr_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_intf_SOURCES = examples/intf.c examples/get_clock.c examples/get_clock.h
|
||||
examples_ibv_intf_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
examples_ibv_polldcinfo_SOURCES = examples/polldcinfo.c
|
||||
examples_ibv_polldcinfo_LDADD = $(top_builddir)/src/libibverbs.la
|
||||
|
||||
|
||||
# Enable ibverbs library test
|
||||
#
|
||||
if TEST_ENABLE
|
||||
|
||||
# Primary ibverbs test
|
||||
#
|
||||
TESTS = ibv_test
|
||||
noinst_PROGRAMS = ibv_test
|
||||
|
||||
ibv_test_CXXFLAGS = -g -Wall -O3 -fno-strict-aliasing
|
||||
ibv_test_CPPFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/tests \
|
||||
-I$(top_srcdir)/tests/cmn
|
||||
ibv_test_SOURCES = \
|
||||
tests/cmn/gtest_cmn.h \
|
||||
tests/gtest/gtest.h \
|
||||
tests/api/gtest_cd.h \
|
||||
tests/gtest_main.cc \
|
||||
tests/cmn/gtest_cmn.cc \
|
||||
tests/api/gtest_cd_tc1.cc \
|
||||
tests/api/gtest_cd_tc2.cc \
|
||||
tests/api/gtest_cd_tc3.cc \
|
||||
tests/api/gtest_cd_tc4.cc \
|
||||
tests/api/gtest_cd_tc5.cc \
|
||||
tests/api/gtest_cd_tc6.cc \
|
||||
tests/api/gtest_cd_tc7.cc \
|
||||
tests/api/gtest_cd_tc8.cc \
|
||||
tests/api/gtest_init.cc
|
||||
ibv_test_LDADD = \
|
||||
$(top_builddir)/src/libibverbs.la
|
||||
|
||||
test: ibv_test
|
||||
rm -f core.*
|
||||
./ibv_test
|
||||
|
||||
valgrind: ibv_test
|
||||
valgrind --tool=memcheck --leak-check=full --track-origins=yes ./ibv_test
|
||||
|
||||
endif
|
||||
|
||||
libibverbsincludedir = $(includedir)/infiniband
|
||||
|
||||
libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
|
||||
include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
|
||||
include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h \
|
||||
include/infiniband/ofa_verbs.h include/infiniband/driver_exp.h include/infiniband/kern-abi_exp.h \
|
||||
include/infiniband/verbs_exp.h include/infiniband/peer_ops.h
|
||||
|
||||
man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1 \
|
||||
man/ibv_rc_pingpong.1 man/ibv_uc_pingpong.1 man/ibv_ud_pingpong.1 \
|
||||
man/ibv_srq_pingpong.1 man/ibv_alloc_pd.3 man/ibv_attach_mcast.3 \
|
||||
man/ibv_create_ah.3 man/ibv_create_ah_from_wc.3 \
|
||||
man/ibv_create_comp_channel.3 man/ibv_create_cq.3 \
|
||||
man/ibv_create_qp.3 man/ibv_create_srq.3 man/ibv_event_type_str.3 \
|
||||
man/ibv_fork_init.3 man/ibv_get_async_event.3 \
|
||||
man/ibv_get_cq_event.3 man/ibv_get_device_guid.3 \
|
||||
man/ibv_get_device_list.3 man/ibv_get_device_name.3 \
|
||||
man/ibv_modify_qp.3 man/ibv_modify_srq.3 man/ibv_open_device.3 \
|
||||
man/ibv_poll_cq.3 man/ibv_post_recv.3 man/ibv_post_send.3 \
|
||||
man/ibv_post_srq_recv.3 man/ibv_query_device.3 man/ibv_query_gid.3 \
|
||||
man/ibv_query_pkey.3 man/ibv_query_port.3 man/ibv_query_qp.3 \
|
||||
man/ibv_query_srq.3 man/ibv_rate_to_mult.3 man/ibv_reg_mr.3 \
|
||||
man/ibv_req_notify_cq.3 man/ibv_resize_cq.3 man/ibv_rate_to_mbps.3 \
|
||||
man/verbs.7 man/ibv_exp_reg_shared_mr.3 man/ibv_shared_mr.1 \
|
||||
man/ibv_exp_post_task.3 man/ibv_exp_modify_cq.3 \
|
||||
man/ibv_cc_pingpong.1 man/ibv_task_pingpong.1 man/ibv_create_qp_ex.3 \
|
||||
man/ibv_create_srq_ex.3 man/ibv_open_xrcd.3 man/ibv_get_srq_num.3 \
|
||||
man/ibv_open_qp.3 man/ibv_create_flow.3 man/ibv_exp_create_flow.3 \
|
||||
man/ibv_exp_create_cq.3 man/ibv_exp_modify_qp.3 \
|
||||
man/ibv_exp_poll_cq.3 man/ibv_exp_query_device.3 \
|
||||
man/ibv_exp_get_provider_func.3 man/ibv_exp_reg_mr.3 \
|
||||
man/ibv_exp_bind_mw.3 man/ibv_exp_create_qp.3 \
|
||||
man/ibv_exp_post_send.3 man/ibv_exp_create_dct.3 \
|
||||
man/ibv_exp_prefetch_mr.3 man/ibv_exp_alloc_mkey_list_memory.3 \
|
||||
man/ibv_exp_create_mr.3 man/ibv_exp_dealloc_mkey_list_memory.3 \
|
||||
man/ibv_exp_query_mkey.3 man/ibv_exp_query_dct.3 \
|
||||
man/ibv_exp_rereg_mr.3 man/ibv_exp_query_values.3 \
|
||||
man/ibv_alloc_mw.3 man/ibv_intf.1 man/ibv_exp_create_res_domain.3 \
|
||||
man/ibv_exp_query_intf.3 man/ibv_exp_create_wq.3 \
|
||||
man/ibv_exp_modify_wq.3 man/ibv_exp_create_rwq_ind_table.3 \
|
||||
man/ibv_exp_query_gid_attr.3 man/ibv_exp_alloc_ec_calc.3 \
|
||||
man/ibv_exp_ec_encode_async.3 man/ibv_exp_ec_decode_async.3 \
|
||||
man/ibv_exp_ec_update_async.3 \
|
||||
man/peer_direct.7 man/ibv_exp_peer_commit_qp.3 \
|
||||
man/ibv_query_device_ex.3 man/ibv_rereg_mr.3 man/ibv_bind_mw.3 \
|
||||
man/ibv_inc_rkey.3
|
||||
|
||||
EXTRA_DIST = include/infiniband/driver.h include/infiniband/kern-abi.h \
|
||||
include/infiniband/opcode.h include/infiniband/verbs.h include/infiniband/marshall.h \
|
||||
include/infiniband/sa-kern-abi.h include/infiniband/sa.h \
|
||||
src/ibverbs.h \
|
||||
tests/gtest/gtest-all.cc \
|
||||
examples/pingpong.h examples/cc_pingpong.h \
|
||||
src/libibverbs.map libibverbs.spec.in $(man_MANS)
|
||||
EXTRA_DIST += debian
|
||||
EXTRA_DIST += autogen.sh
|
||||
|
||||
|
||||
dist-hook: libibverbs.spec
|
||||
cp libibverbs.spec $(distdir)
|
||||
|
||||
install-data-hook:
|
||||
cd $(DESTDIR)$(mandir)/man3 && \
|
||||
$(RM) ibv_ack_async_event.3 && \
|
||||
$(RM) ibv_ack_cq_events.3 && \
|
||||
$(RM) ibv_close_device.3 && \
|
||||
$(RM) ibv_dealloc_pd.3 && \
|
||||
$(RM) ibv_dereg_mr.3 && \
|
||||
$(RM) ibv_destroy_ah.3 && \
|
||||
$(RM) ibv_destroy_comp_channel.3 && \
|
||||
$(RM) ibv_destroy_cq.3 && \
|
||||
$(RM) ibv_destroy_qp.3 && \
|
||||
$(RM) ibv_destroy_srq.3 && \
|
||||
$(RM) ibv_detach_mcast.3 && \
|
||||
$(RM) ibv_free_device_list.3 && \
|
||||
$(RM) ibv_init_ah_from_wc.3 && \
|
||||
$(RM) ibv_node_type_str.3 && \
|
||||
$(RM) ibv_port_state_str.3 && \
|
||||
$(RM) ibv_close_xrcd.3 && \
|
||||
$(RM) ibv_destroy_flow.3 && \
|
||||
$(RM) ibv_dealloc_mw.3 && \
|
||||
$(RM) ibv_exp_destroy_flow.3 && \
|
||||
$(RM) ibv_exp_destroy_res_domain.3 && \
|
||||
$(RM) ibv_exp_release_intf.3 && \
|
||||
$(RM) ibv_exp_destroy_wq.3 && \
|
||||
$(RM) ibv_exp_destroy_rwq_ind_table.3 && \
|
||||
$(RM) ibv_exp_dealloc_ec_calc.3 && \
|
||||
$(RM) ibv_exp_ec_encode_sync.3 && \
|
||||
$(RM) ibv_exp_ec_decode_sync.3 && \
|
||||
$(RM) ibv_exp_ec_update_sync.3 && \
|
||||
$(RM) ibv_exp_rollback_qp.3 && \
|
||||
$(RM) ibv_exp_peer_peek_cq.3 && \
|
||||
$(RM) ibv_exp_peer_abort_peek_cq.3 && \
|
||||
$(LN_S) ibv_get_async_event.3 ibv_ack_async_event.3 && \
|
||||
$(LN_S) ibv_get_cq_event.3 ibv_ack_cq_events.3 && \
|
||||
$(LN_S) ibv_open_device.3 ibv_close_device.3 && \
|
||||
$(LN_S) ibv_alloc_pd.3 ibv_dealloc_pd.3 && \
|
||||
$(LN_S) ibv_reg_mr.3 ibv_dereg_mr.3 && \
|
||||
$(LN_S) ibv_create_ah.3 ibv_destroy_ah.3 && \
|
||||
$(LN_S) ibv_create_comp_channel.3 ibv_destroy_comp_channel.3 && \
|
||||
$(LN_S) ibv_create_cq.3 ibv_destroy_cq.3 && \
|
||||
$(LN_S) ibv_create_qp.3 ibv_destroy_qp.3 && \
|
||||
$(LN_S) ibv_create_srq.3 ibv_destroy_srq.3 && \
|
||||
$(LN_S) ibv_attach_mcast.3 ibv_detach_mcast.3 && \
|
||||
$(LN_S) ibv_get_device_list.3 ibv_free_device_list.3 && \
|
||||
$(LN_S) ibv_create_ah_from_wc.3 ibv_init_ah_from_wc.3 && \
|
||||
$(LN_S) ibv_event_type_str.3 ibv_node_type_str.3 && \
|
||||
$(LN_S) ibv_event_type_str.3 ibv_port_state_str.3 && \
|
||||
$(LN_S) ibv_open_xrcd.3 ibv_close_xrcd.3 && \
|
||||
$(LN_S) ibv_create_flow.3 ibv_destroy_flow.3 && \
|
||||
$(LN_S) ibv_exp_create_flow.3 ibv_exp_destroy_flow.3 && \
|
||||
$(LN_S) ibv_alloc_mw.3 ibv_dealloc_mw.3 && \
|
||||
$(LN_S) ibv_exp_create_res_domain.3 ibv_exp_destroy_res_domain.3 && \
|
||||
$(LN_S) ibv_exp_query_intf.3 ibv_exp_release_intf.3 && \
|
||||
$(LN_S) ibv_exp_create_wq.3 ibv_exp_destroy_wq.3 && \
|
||||
$(LN_S) ibv_exp_create_rwq_ind_table.3 ibv_exp_destroy_rwq_ind_table.3 && \
|
||||
$(LN_S) ibv_exp_alloc_ec_calc.3 ibv_exp_dealloc_ec_calc.3 && \
|
||||
$(LN_S) ibv_exp_ec_encode_async.3 ibv_exp_ec_encode_sync.3 && \
|
||||
$(LN_S) ibv_exp_ec_decode_async.3 ibv_exp_ec_decode_sync.3 && \
|
||||
$(LN_S) ibv_exp_ec_update_async.3 ibv_exp_ec_update_sync.3 && \
|
||||
$(LN_S) ibv_exp_peer_commit_qp.3 ibv_exp_rollback_qp.3 && \
|
||||
$(LN_S) ibv_exp_peer_commit_qp.3 ibv_exp_peer_peek_cq.3 && \
|
||||
$(LN_S) ibv_exp_peer_commit_qp.3 ibv_exp_peer_abort_peek_cq.3
|
|
@ -1,164 +0,0 @@
|
|||
Introduction
|
||||
============
|
||||
|
||||
libibverbs is a library that allows programs to use RDMA "verbs" for
|
||||
direct access to RDMA (currently InfiniBand and iWARP) hardware from
|
||||
userspace. For more information on RDMA verbs, see the InfiniBand
|
||||
Architecture Specification vol. 1, especially chapter 11, and the RDMA
|
||||
Consortium's RDMA Protocol Verbs Specification.
|
||||
|
||||
Using libibverbs
|
||||
================
|
||||
|
||||
Device nodes
|
||||
------------
|
||||
|
||||
The verbs library expects special character device files named
|
||||
/dev/infiniband/uverbsN to be created. When you load the kernel
|
||||
modules, including both the low-level driver for your IB hardware as
|
||||
well as the ib_uverbs module, you should see one or more uverbsN
|
||||
entries in /sys/class/infiniband_verbs in addition to the
|
||||
/dev/infiniband/uverbsN character device files.
|
||||
|
||||
To create the appropriate character device files automatically with
|
||||
udev, a rule like
|
||||
|
||||
KERNEL="uverbs*", NAME="infiniband/%k"
|
||||
|
||||
can be used. This will create device nodes named
|
||||
|
||||
/dev/infiniband/uverbs0
|
||||
|
||||
and so on. Since the RDMA userspace verbs should be safe for use by
|
||||
non-privileged users, you may want to add an appropriate MODE or GROUP
|
||||
to your udev rule.
|
||||
|
||||
Permissions
|
||||
-----------
|
||||
|
||||
To use IB verbs from userspace, a process must be able to access the
|
||||
appropriate /dev/infiniband/uverbsN special device file. You can
|
||||
check the permissions on this file with the command
|
||||
|
||||
ls -l /dev/infiniband/uverbs*
|
||||
|
||||
Make sure that the permissions on these files are such that the
|
||||
user/group that your verbs program runs as can access the device file.
|
||||
|
||||
To use IB verbs from userspace, a process must also have permission to
|
||||
tell the kernel to lock sufficient memory for all of your registered
|
||||
memory regions as well as the memory used internally by IB resources
|
||||
such as queue pairs (QPs) and completion queues (CQs). To check your
|
||||
resource limits, use the command
|
||||
|
||||
ulimit -l
|
||||
|
||||
(or "limit memorylocked" for csh-like shells).
|
||||
|
||||
If you see a small number such as 32 (the units are KB) then you will
|
||||
need to increase this limit. This is usually done for ordinary users
|
||||
via the file /etc/security/limits.conf. More configuration may be
|
||||
necessary if you are logging in via OpenSSH and your sshd is
|
||||
configured to use privilege separation.
|
||||
|
||||
Valgrind support
|
||||
----------------
|
||||
|
||||
When running applications that use libibverbs under the Valgrind
|
||||
memory-checking debugger, Valgrind will falsely report "read from
|
||||
uninitialized" for memory that was initialized by the kernel drivers.
|
||||
Specifically, Valgrind cannot see when kernel drivers write to
|
||||
userspace memory, so when the process reads from that memory, Valgrind
|
||||
incorrectly assumes that the memory contents are uninitialized, and
|
||||
therefore raises a warning.
|
||||
|
||||
libibverbs can be built with specific support for the Valgrind
|
||||
memory-checking debugger by specifying the --with-valgrind command
|
||||
line argument to configure. This flag enables code in libibverbs to
|
||||
tell Valgrind "this memory may look uninitialized, but it's really
|
||||
OK," which therefore suppresses the incorrect "read from
|
||||
uninitialized" warnings. This code adds trivial overhead to the
|
||||
critical performance path, so it is disabled by default. The intent
|
||||
is that production users can use a "normal" build of libibverbs and
|
||||
developers can use the "valgrind debug" build by simply switching
|
||||
their LD_LIBRARY_PATH environment variables.
|
||||
|
||||
Libibverbs needs some header files from Valgrind in order to compile
|
||||
this support; it is important to use the header files from the same
|
||||
version of Valgrind that will be used at run time. You may need to
|
||||
specify the directory where Valgrind's header files are installed as
|
||||
an argument to --with-valgrind. For example
|
||||
|
||||
./configure --with-valgrind=/opt/valgrind
|
||||
|
||||
will make the libibverbs build look for valgrind headers in
|
||||
/opt/valgrind/include
|
||||
|
||||
Reporting bugs
|
||||
==============
|
||||
|
||||
Bugs should be reported to the OpenFabrics mailing list
|
||||
<general@lists.openfabrics.org>. In your bug report, please include:
|
||||
|
||||
* Information about your system:
|
||||
- Linux distribution and version
|
||||
- Linux kernel and version
|
||||
- InfiniBand/iWARP hardware and firmware version
|
||||
- ... any other relevant information
|
||||
|
||||
* How to reproduce the bug. Command line arguments for a libibverbs
|
||||
example program or source code that other developers can
|
||||
compile and run is most convenient.
|
||||
|
||||
* If the bug is a crash, the exact output printed out when the crash
|
||||
occurred, including any kernel messages produced.
|
||||
|
||||
* If a verbs call is mysteriously returning an error or failing, the
|
||||
output of "strace -ewrite -ewrite=all <command>".
|
||||
|
||||
Submitting patches
|
||||
==================
|
||||
|
||||
Patches should also be submitted to the OpenFabrics mailing list
|
||||
<general@lists.openfabrics.org>. Please use unified diff form (the -u
|
||||
option to GNU diff), and include a good description of what your patch
|
||||
does and why it should be applied. If your patch fixes a bug, please
|
||||
make sure to describe the bug and how your fix works.
|
||||
|
||||
Please include a change to the ChangeLog file (in standard GNU
|
||||
changelog format) as part of your patch.
|
||||
|
||||
Make sure that your contribution can be licensed under the same
|
||||
license as the original code you are patching, and that you have all
|
||||
necessary permissions to release your work.
|
||||
|
||||
TODO
|
||||
====
|
||||
|
||||
1.1 series
|
||||
----------
|
||||
|
||||
The libibverbs API and ABI are frozen for all releases in the 1.1
|
||||
series. Methods were added to struct ibv_context to implement the
|
||||
following features, so it should be possible to add them in a future
|
||||
release in the 1.1 series:
|
||||
|
||||
* Memory window (MW) support.
|
||||
|
||||
* Implement the reregister memory region (MR) verb. We will add an
|
||||
extension to the IB spec to allow the application to indicate that
|
||||
the region is only being extended, and that operations in progress
|
||||
should _not_ fail (contrary to the IB spec, which states that
|
||||
reregister must be implemented so that it behaves equivalently to a
|
||||
deregister followed by a register).
|
||||
|
||||
Other possibilities
|
||||
-------------------
|
||||
|
||||
There are no plans to implement the following features, which would be
|
||||
needed for completeness but don't seem particularly useful. However,
|
||||
if there is demand from application developers or an implementation is
|
||||
contributed, then the feature may be added.
|
||||
|
||||
* Implement the query address handle (AH) verb.
|
||||
* Implement the query memory region (MR) verb.
|
|
@ -1,7 +0,0 @@
|
|||
#! /bin/sh -exE
|
||||
|
||||
aclocal -I config
|
||||
libtoolize --force --copy
|
||||
autoheader
|
||||
automake --foreign --add-missing --copy
|
||||
autoconf
|
|
@ -1,8 +0,0 @@
|
|||
mkinstalldirs
|
||||
depcomp
|
||||
compile
|
||||
missing
|
||||
config.guess
|
||||
config.sub
|
||||
ltmain.sh
|
||||
install-sh
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,384 +0,0 @@
|
|||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
||||
|
||||
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ------------------------------------------
|
||||
m4_define([_LT_MANGLE_OPTION],
|
||||
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ---------------------------------------
|
||||
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
|
||||
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
|
||||
# saved as a flag.
|
||||
m4_define([_LT_SET_OPTION],
|
||||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option `$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
|
||||
# ------------------------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
m4_define([_LT_IF_OPTION],
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
|
||||
|
||||
|
||||
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
|
||||
# -------------------------------------------------------
|
||||
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
|
||||
# are set.
|
||||
m4_define([_LT_UNLESS_OPTIONS],
|
||||
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
|
||||
[m4_define([$0_found])])])[]dnl
|
||||
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
|
||||
])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
|
||||
# ----------------------------------------
|
||||
# OPTION-LIST is a space-separated list of Libtool options associated
|
||||
# with MACRO-NAME. If any OPTION has a matching handler declared with
|
||||
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
|
||||
# the unknown option and exit.
|
||||
m4_defun([_LT_SET_OPTIONS],
|
||||
[# Set options
|
||||
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[_LT_SET_OPTION([$1], _LT_Option)])
|
||||
|
||||
m4_if([$1],[LT_INIT],[
|
||||
dnl
|
||||
dnl Simply set some default values (i.e off) if boolean options were not
|
||||
dnl specified:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
|
||||
])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
|
||||
])
|
||||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl `shared' nor `disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
||||
## --------------------------------- ##
|
||||
## Macros to handle LT_INIT options. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
|
||||
# -----------------------------------------
|
||||
m4_define([_LT_MANGLE_DEFUN],
|
||||
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
|
||||
# -----------------------------------------------
|
||||
m4_define([LT_OPTION_DEFINE],
|
||||
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
|
||||
])# LT_OPTION_DEFINE
|
||||
|
||||
|
||||
# dlopen
|
||||
# ------
|
||||
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
||||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
|
||||
|
||||
|
||||
# win32-dll
|
||||
# ---------
|
||||
# Declare package support for building win32 dll's.
|
||||
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
|
||||
[enable_win32_dll=yes
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
esac
|
||||
|
||||
test -z "$AS" && AS=as
|
||||
_LT_DECL([], [AS], [1], [Assembler program])dnl
|
||||
|
||||
test -z "$DLLTOOL" && DLLTOOL=dlltool
|
||||
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
|
||||
|
||||
test -z "$OBJDUMP" && OBJDUMP=objdump
|
||||
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
|
||||
])# win32-dll
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
||||
|
||||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the `shared' and
|
||||
# `disable-shared' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
|
||||
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
||||
_LT_DECL([build_libtool_libs], [enable_shared], [0],
|
||||
[Whether or not to build shared libraries])
|
||||
])# _LT_ENABLE_SHARED
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-shared])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
|
||||
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the `static' and
|
||||
# `disable-static' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
|
||||
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
||||
_LT_DECL([build_old_libs], [enable_static], [0],
|
||||
[Whether or not to build static libraries])
|
||||
])# _LT_ENABLE_STATIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-static])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
|
||||
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the `fast-install'
|
||||
# and `disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
|
||||
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
||||
_LT_DECL([fast_install], [enable_fast_install], [0],
|
||||
[Whether or not to optimize for fast installation])dnl
|
||||
])# _LT_ENABLE_FAST_INSTALL
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
|
||||
|
||||
# Old names:
|
||||
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
||||
|
||||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||
[lt_p=${PACKAGE-default}
|
||||
case $withval in
|
||||
yes|no) pic_mode=$withval ;;
|
||||
*)
|
||||
pic_mode=default
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for lt_pkg in $withval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$lt_pkg" = "X$lt_p"; then
|
||||
pic_mode=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[pic_mode=default])
|
||||
|
||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
|
||||
|
||||
# Old name:
|
||||
AU_DEFUN([AC_LIBTOOL_PICMODE],
|
||||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
|
||||
|
||||
## ----------------- ##
|
||||
## LTDL_INIT Options ##
|
||||
## ----------------- ##
|
||||
|
||||
m4_define([_LTDL_MODE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
|
||||
[m4_define([_LTDL_MODE], [nonrecursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
|
||||
[m4_define([_LTDL_MODE], [recursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
|
||||
[m4_define([_LTDL_MODE], [subproject])])
|
||||
|
||||
m4_define([_LTDL_TYPE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [installable],
|
||||
[m4_define([_LTDL_TYPE], [installable])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||
[m4_define([_LTDL_TYPE], [convenience])])
|
|
@ -1,123 +0,0 @@
|
|||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6 ltsugar.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
|
||||
|
||||
|
||||
# lt_join(SEP, ARG1, [ARG2...])
|
||||
# -----------------------------
|
||||
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
|
||||
# associated separator.
|
||||
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
|
||||
# versions in m4sugar had bugs.
|
||||
m4_define([lt_join],
|
||||
[m4_if([$#], [1], [],
|
||||
[$#], [2], [[$2]],
|
||||
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
m4_define([_lt_join],
|
||||
[m4_if([$#$2], [2], [],
|
||||
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
|
||||
|
||||
# lt_car(LIST)
|
||||
# lt_cdr(LIST)
|
||||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59 which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
[$#], 1, [],
|
||||
[m4_dquote(m4_shift($@))])])
|
||||
m4_define([lt_unquote], $1)
|
||||
|
||||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
# than defined and empty).
|
||||
#
|
||||
# This macro is needed until we can rely on Autoconf 2.62, since earlier
|
||||
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
|
||||
m4_define([lt_append],
|
||||
[m4_define([$1],
|
||||
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
|
||||
|
||||
|
||||
|
||||
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
|
||||
# ----------------------------------------------------------
|
||||
# Produce a SEP delimited list of all paired combinations of elements of
|
||||
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
|
||||
# has the form PREFIXmINFIXSUFFIXn.
|
||||
# Needed until we can rely on m4_combine added in Autoconf 2.62.
|
||||
m4_define([lt_combine],
|
||||
[m4_if(m4_eval([$# > 3]), [1],
|
||||
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
|
||||
[[m4_foreach([_Lt_prefix], [$2],
|
||||
[m4_foreach([_Lt_suffix],
|
||||
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
|
||||
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
|
||||
|
||||
|
||||
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
|
||||
# -----------------------------------------------------------------------
|
||||
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
|
||||
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
|
||||
m4_define([lt_if_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[lt_append([$1], [$2], [$3])$4],
|
||||
[$5])],
|
||||
[lt_append([$1], [$2], [$3])$4])])
|
||||
|
||||
|
||||
# lt_dict_add(DICT, KEY, VALUE)
|
||||
# -----------------------------
|
||||
m4_define([lt_dict_add],
|
||||
[m4_define([$1($2)], [$3])])
|
||||
|
||||
|
||||
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
|
||||
# --------------------------------------------
|
||||
m4_define([lt_dict_add_subkey],
|
||||
[m4_define([$1($2:$3)], [$4])])
|
||||
|
||||
|
||||
# lt_dict_fetch(DICT, KEY, [SUBKEY])
|
||||
# ----------------------------------
|
||||
m4_define([lt_dict_fetch],
|
||||
[m4_ifval([$3],
|
||||
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
|
||||
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
|
||||
|
||||
|
||||
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------------------
|
||||
m4_define([lt_if_dict_fetch],
|
||||
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
|
||||
[$5],
|
||||
[$6])])
|
||||
|
||||
|
||||
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
|
||||
# --------------------------------------------------------------
|
||||
m4_define([lt_dict_filter],
|
||||
[m4_if([$5], [], [],
|
||||
[lt_join(m4_quote(m4_default([$4], [[, ]])),
|
||||
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
|
||||
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
|
||||
])
|
|
@ -1,23 +0,0 @@
|
|||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 3337 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.2])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3337])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.2'
|
||||
macro_revision='1.3337'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
|
@ -1,98 +0,0 @@
|
|||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
|
@ -1,148 +0,0 @@
|
|||
#! /bin/sh
|
||||
# test-driver - basic testsuite driver script.
|
||||
|
||||
scriptversion=2013-07-13.22; # UTC
|
||||
|
||||
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
# Make unconditional expansion of undefined variables an error. This
|
||||
# helps a lot in preventing typo-related bugs.
|
||||
set -u
|
||||
|
||||
usage_error ()
|
||||
{
|
||||
echo "$0: $*" >&2
|
||||
print_usage >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
print_usage ()
|
||||
{
|
||||
cat <<END
|
||||
Usage:
|
||||
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
|
||||
[--expect-failure={yes|no}] [--color-tests={yes|no}]
|
||||
[--enable-hard-errors={yes|no}] [--]
|
||||
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
|
||||
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
|
||||
END
|
||||
}
|
||||
|
||||
test_name= # Used for reporting.
|
||||
log_file= # Where to save the output of the test script.
|
||||
trs_file= # Where to save the metadata of the test run.
|
||||
expect_failure=no
|
||||
color_tests=no
|
||||
enable_hard_errors=yes
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) print_usage; exit $?;;
|
||||
--version) echo "test-driver $scriptversion"; exit $?;;
|
||||
--test-name) test_name=$2; shift;;
|
||||
--log-file) log_file=$2; shift;;
|
||||
--trs-file) trs_file=$2; shift;;
|
||||
--color-tests) color_tests=$2; shift;;
|
||||
--expect-failure) expect_failure=$2; shift;;
|
||||
--enable-hard-errors) enable_hard_errors=$2; shift;;
|
||||
--) shift; break;;
|
||||
-*) usage_error "invalid option: '$1'";;
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
missing_opts=
|
||||
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
|
||||
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
|
||||
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
|
||||
if test x"$missing_opts" != x; then
|
||||
usage_error "the following mandatory options are missing:$missing_opts"
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
usage_error "missing argument"
|
||||
fi
|
||||
|
||||
if test $color_tests = yes; then
|
||||
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
|
||||
red='[0;31m' # Red.
|
||||
grn='[0;32m' # Green.
|
||||
lgn='[1;32m' # Light green.
|
||||
blu='[1;34m' # Blue.
|
||||
mgn='[0;35m' # Magenta.
|
||||
std='[m' # No color.
|
||||
else
|
||||
red= grn= lgn= blu= mgn= std=
|
||||
fi
|
||||
|
||||
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
|
||||
trap "st=129; $do_exit" 1
|
||||
trap "st=130; $do_exit" 2
|
||||
trap "st=141; $do_exit" 13
|
||||
trap "st=143; $do_exit" 15
|
||||
|
||||
# Test script is run here.
|
||||
"$@" >$log_file 2>&1
|
||||
estatus=$?
|
||||
|
||||
if test $enable_hard_errors = no && test $estatus -eq 99; then
|
||||
tweaked_estatus=1
|
||||
else
|
||||
tweaked_estatus=$estatus
|
||||
fi
|
||||
|
||||
case $tweaked_estatus:$expect_failure in
|
||||
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
|
||||
0:*) col=$grn res=PASS recheck=no gcopy=no;;
|
||||
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
|
||||
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
|
||||
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
|
||||
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
|
||||
esac
|
||||
|
||||
# Report the test outcome and exit status in the logs, so that one can
|
||||
# know whether the test passed or failed simply by looking at the '.log'
|
||||
# file, without the need of also peaking into the corresponding '.trs'
|
||||
# file (automake bug#11814).
|
||||
echo "$res $test_name (exit status: $estatus)" >>$log_file
|
||||
|
||||
# Report outcome to console.
|
||||
echo "${col}${res}${std}: $test_name"
|
||||
|
||||
# Register the test result, and other relevant metadata.
|
||||
echo ":test-result: $res" > $trs_file
|
||||
echo ":global-test-result: $res" >> $trs_file
|
||||
echo ":recheck: $recheck" >> $trs_file
|
||||
echo ":copy-in-global-log: $gcopy" >> $trs_file
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
|
@ -1,127 +0,0 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT(libibverbs, 1.2.1mlnx1, linux-rdma@vger.kernel.org)
|
||||
AC_CONFIG_SRCDIR([src/ibverbs.h])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AC_CONFIG_MACRO_DIR(config)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([1.10 foreign tar-ustar silent-rules subdir-objects])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
dnl Checks for programs
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_GNU_SOURCE
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
LT_INIT
|
||||
|
||||
##########################
|
||||
# Enable tests
|
||||
#
|
||||
AC_ARG_ENABLE(
|
||||
[test],
|
||||
[AC_HELP_STRING([--enable-test],
|
||||
[Build test programs (default=no)])],
|
||||
[enable_test=$enableval],
|
||||
[enable_test=no])
|
||||
AM_CONDITIONAL(TEST_ENABLE, test x$enable_test = xyes)
|
||||
|
||||
##########################
|
||||
# Enable support for valgrind
|
||||
#
|
||||
AC_ARG_WITH([valgrind],
|
||||
AC_HELP_STRING([--with-valgrind],
|
||||
[Enable Valgrind annotations (small runtime overhead, default NO)]))
|
||||
if test x$with_valgrind = x || test x$with_valgrind = xno; then
|
||||
want_valgrind=no
|
||||
AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
|
||||
else
|
||||
want_valgrind=yes
|
||||
if test -d $with_valgrind; then
|
||||
CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([resolve-neigh],
|
||||
AC_HELP_STRING([--with-resolve-neigh],
|
||||
[Enable neighbour resolution in Ethernet (default YES)]))
|
||||
have_libnl=no
|
||||
if test x$with_resolve_neigh = x || test x$with_resolve_neigh = xyes; then
|
||||
PKG_CHECK_MODULES([LIBNL],[libnl-3.0],[
|
||||
have_libnl=yes
|
||||
AC_DEFINE([HAVE_LIBNL3], [1], [Use libnl-3.0])
|
||||
AC_DEFINE([HAVE_LIBNL], [1], [Use libnl])
|
||||
PKG_CHECK_MODULES([LIBNL_ROUTE3], [libnl-route-3.0])
|
||||
LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE3_CFLAGS"
|
||||
LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE3_LIBS"], [:]
|
||||
);
|
||||
|
||||
PKG_CHECK_MODULES([LIBNL3_BUG], [libnl-3.0 >= 3.2.15 libnl-3.0 < 3.2.22],
|
||||
[AC_DEFINE([HAVE_LIBNL3_BUG], [1], [Use libnl-3.2.15-21])], [:])
|
||||
|
||||
if test "$have_libnl" = no; then
|
||||
PKG_CHECK_MODULES([LIBNL], [libnl-1], [have_libnl=yes
|
||||
AC_DEFINE([HAVE_LIBNL1], [1], [Use libnl-1])
|
||||
AC_DEFINE([HAVE_LIBNL], [1], [Use libnl])
|
||||
AC_CHECK_LIB(nl, rtnl_link_vlan_get_id, [],
|
||||
AC_MSG_ERROR([rtnl_link_vlan_get_id not found. libibverbs requires libnl.]))
|
||||
],[
|
||||
AC_MSG_ERROR([libibverbs requires libnl.])
|
||||
])
|
||||
fi
|
||||
else
|
||||
AC_DEFINE([NRESOLVE_NEIGH], 1, [Define to 1 to disable resovle neigh annotations.])
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"])
|
||||
AC_SUBST([LIBNL_CFLAGS])
|
||||
AC_SUBST([LIBNL_LIBS])
|
||||
AM_CONDITIONAL(NO_RESOLVE_NEIGH, test x$with_resolve_neigh = xno)
|
||||
|
||||
dnl Checks for libraries
|
||||
AC_CHECK_LIB(dl, dlsym, [],
|
||||
AC_MSG_ERROR([dlsym() not found. libibverbs requires libdl.]))
|
||||
AC_CHECK_LIB(pthread, pthread_mutex_init, [],
|
||||
AC_MSG_ERROR([pthread_mutex_init() not found. libibverbs requires libpthread.]))
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
if test x$want_valgrind = xyes; then
|
||||
AC_CHECK_HEADER(valgrind/memcheck.h,
|
||||
[AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
|
||||
[Define to 1 if you have the <valgrind/memcheck.h> header file.])],
|
||||
[if test $want_valgrind = yes; then
|
||||
AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
|
||||
fi])
|
||||
fi
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
|
||||
[if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
|
||||
ac_cv_version_script=yes
|
||||
else
|
||||
ac_cv_version_script=no
|
||||
fi])
|
||||
|
||||
if test $ac_cv_version_script = yes; then
|
||||
LIBIBVERBS_VERSION_SCRIPT='-Wl,--version-script=$(srcdir)/src/libibverbs.map'
|
||||
else
|
||||
LIBIBVERBS_VERSION_SCRIPT=
|
||||
fi
|
||||
AC_SUBST(LIBIBVERBS_VERSION_SCRIPT)
|
||||
|
||||
AC_CACHE_CHECK(for .symver assembler support, ac_cv_asm_symver_support,
|
||||
[AC_TRY_COMPILE(, [asm("symbol:\n.symver symbol, api@ABI\n");],
|
||||
ac_cv_asm_symver_support=yes,
|
||||
ac_cv_asm_symver_support=no)])
|
||||
if test $ac_cv_asm_symver_support = yes; then
|
||||
AC_DEFINE([HAVE_SYMVER_SUPPORT], 1, [assembler has .symver support])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile libibverbs.spec])
|
||||
AC_OUTPUT
|
|
@ -1,392 +0,0 @@
|
|||
libibverbs (1.2.1mlnx1-OFED.4.0.1.5.3.40200) unstable; urgency=low
|
||||
|
||||
* Roll 1.2.1mlnx1-1
|
||||
|
||||
-- Alaa Hleihel <alaa@mellanox.com> Tue, 09 Aug 2016 18:47:10 +0200
|
||||
|
||||
libibverbs (1.1.8mlnx1-1) unstable; urgency=low
|
||||
|
||||
* libibverbs/man: Update ibv_exp_create_mr man page.
|
||||
* libibverbs/man: Added description to ibv_exp_query_dct man page.
|
||||
* libibverbs/man: Added access flag to ibv_exp_bind_mw man page.
|
||||
* libibverbs: move Valgrind macros from being default on compilation
|
||||
* Check for GRH when creating RoCE AH
|
||||
* libibverbs/man: fix typo in ibv_exp_create_qp
|
||||
* libibverbs: Add wc_auto_evict_size to arch
|
||||
* Avoid VERBS_SET_ENV variable and use ibv_exp_use_priv_env
|
||||
* libibverbs: update qp->state in ibv_exp_cmd_modify_qp.
|
||||
* Implement verbs sepcific setenv/getenv
|
||||
* libibverbs/examples: fix memory leak in ibv_cc_pingpong
|
||||
* libibverbs.spec.in: Changed valgrind libs DESTDIR
|
||||
* Fixed invalid date
|
||||
* libibverbs.spec.in: Added valgrind support on RHEL6.x
|
||||
* initialize struct in __ibv_reg_mr
|
||||
* fixed and added valgrind Macros
|
||||
* fix fork support for both contig pages and ODP
|
||||
* libibverbs: added option to ask for specific addr in contig_pages registratoin
|
||||
* gtest: fix test to set errno
|
||||
* Add a man page for ibv_exp_rereg_mr
|
||||
* libibverbs/man: added ibv_exp_query_dct to Makefile.am
|
||||
* libibverbs/man: update man pages
|
||||
* libibverbs/man: fix man pages.
|
||||
* libibverbs/man: added ibv_exp_query_dct man page
|
||||
* libibverbs/man: update/created UMR man pages
|
||||
* libibverbs: Fix ack evnets acounting for DC targets
|
||||
* man pages: typos
|
||||
* man: Fix manual pages of different verbs.
|
||||
* libibverbs: fix ibv_*pingpong test
|
||||
* libibverbs: added -Werror to Makefile
|
||||
* libibverbs: Fix handling asynchronous events for DCT
|
||||
* libibverbs: fix compatability issue in create_dct
|
||||
* libibverbs/example: fixed ibv_umr with repeat_block
|
||||
* libibverbs: Fix some issues found by coverity
|
||||
* libibverbs.spec.in: devel package provides verbs.h
|
||||
* libibverbs: UMR API fix
|
||||
* libibverbs: fixed ibv_umr with repeat_block flag
|
||||
* libibverbs: fix ibv_umr with contigouse mr
|
||||
* libibverbs: Add max_dct to exp_query_device
|
||||
* libibverbs: fix ibv_umr test
|
||||
* libibverbs: Update comment to ibv_exp_modify_qp
|
||||
* libibverbs: add enum ibv_exp_prefetch_flags for flags field.
|
||||
* libibverbs: fix issues in verbs_exp.h
|
||||
* libibvebs/examples: move printf to fprintf in umr test.
|
||||
* examples/devinfo: change usage screen for --ib-port.
|
||||
* libibverbs: don't run ibv_dontfork_range on ODP MRs
|
||||
* libibverbs: align ibv_exp_destroy_dct to 64 bit.
|
||||
* libibverbs: add new transports for odp caps.
|
||||
* libibverbs: fix segfault when creating DCI without recv_cq
|
||||
* libibverbs: Fix qp state update
|
||||
* libibverbs: fixed dealloc PD failure in the test
|
||||
* libibverbs: added poll_cq to umr invalidate case
|
||||
* Parse grh as IPv4 or IPv6 header
|
||||
* configure: Update AM_INIT_AUTOMAKE to support new auto tools.
|
||||
* libibverbs: Align dct_key to 64 bits in ibv_exp_modify_qp
|
||||
* libibvebrs: update ibv_exp_reg_mr manual page
|
||||
* libibverbs: Define the Implicit MR size.
|
||||
* libibvebrs: fix ibv_exp_prefetch_mr manual page
|
||||
* libibverbs: remove attr_size from ibv_exp_prefetch_mr.
|
||||
* libibverbs: fix void_ptr used in arithmetic
|
||||
* libibverbs: Update PD on create exp mr
|
||||
* libibverbs: Update QP state on modify and query
|
||||
* Add MR re-registeration
|
||||
* libibverbs: Indicate UMR support at create
|
||||
* libiverbs/examples: Clear ah_attr before use
|
||||
* libibverbs/examples: support odp in rc_pingpong
|
||||
* libibverbs: Avoid setting the mr->length and mr->addr in relaxed access mode.
|
||||
* libibverbs: add relaxed access bit.
|
||||
* libibverbs: Add new ibv_exp_prefetch_mr verb for ODP MRs.
|
||||
* libibverbs: add experimental register MR verb
|
||||
* libibverbs: query odp caps in query device
|
||||
* libibverbs: Add completion opcodes for masked atomic operations
|
||||
* libibverbs: rename field on struct ibv_exp_ext_atomics_params
|
||||
* libibverbs: fix calculation of experimental context ptr
|
||||
* libibverbs: fix calculation of experimental context ptr
|
||||
* libibverbs: Re-work UMR API
|
||||
* libibverbs: Add work completio opcode for UMR ops
|
||||
* libibverbs/examples: Fix comp_mask issue
|
||||
* libibverbs: Modify atomic cap sizes to a bitmask
|
||||
* libibverbs: Add aarch64
|
||||
* libibverbs: add UMR functionality
|
||||
* libibverbs: Add man/ibv_exp_create_dct.3 to Makefile.am.
|
||||
* libibverbs: Add support NOP send opcoded
|
||||
* libibverbs: Init comp mask in dctgt example
|
||||
* libibverbs: Remove unused variables
|
||||
* /libibverbs/ibv_xsrq_pingpong change default mtu size from 2048 to 1024
|
||||
* libibverbs: Simplify extended atomics API
|
||||
* libibverbs: Add atomic support
|
||||
* libibverbs: fix mem leak in handle_encoded_mac
|
||||
* libibverbs: updated man pages according to the experimental API.
|
||||
* libibverbs: Fix bugger overflow in xrc_pingong
|
||||
* libibverbs: fix comp_mask issues
|
||||
* libibverbs/examples: print hca_core_clock in ibv_devinfo verbose mode.
|
||||
* libibverbs: update qp state on exp modify qp
|
||||
* Convering GID to MAC should use (xor 2) only on port 1
|
||||
* libibverbs: improve experimental interface
|
||||
* libibverbs: Avoid provisioning of max RDMA/atomics for DC INI
|
||||
* Fix libibverbs usage of libnl3
|
||||
* examples: change imm_data to ex.invalidate_rkey
|
||||
* Get rid of double meaning field in exp_send_wr
|
||||
* remove unnecessary comment
|
||||
* Add support for libnl3 and align code with upstream
|
||||
* Initialize comp_mask in exp. create_cq
|
||||
* libibverbs: change wc_size from int to uint32_t.
|
||||
* libibverbs: Update DCI example to match PRM 2.0 definitions
|
||||
* libibverbs/examples: Organize the verbose mode print.
|
||||
* libibverbs: compile issue on some platforms
|
||||
* libibverbs: enable direct access to provider main data path functions
|
||||
* Fix ibv_exp_create_cq command
|
||||
* libibverbs: added gid support to ibv_xsrq_pingpong test
|
||||
* libibverbs/examples: remove the exp_ prefix in the verbose print.
|
||||
* libibverbs: Add comments to verbs_exp.h
|
||||
* libibverbs/examples: report device_cap_flags2 in ibv_devinfo -v.
|
||||
|
||||
-- Vladimir Sokolovsky <vlad@mellanox.com> Wed, 10 Dec 2014 10:53:10 +0200
|
||||
|
||||
libibverbs (1.1.7mlnx1-1) unstable; urgency=low
|
||||
|
||||
* libibverbs: use uint32_t instead of int for comp_mask.
|
||||
* libibverbs/examples: ibv_devinfo usage screen correction.
|
||||
* libibverbs: Update support for atomic response endianess
|
||||
* libibvers: Update cap flags enums
|
||||
* libibverbs: Add support for atomic response endianess
|
||||
* libibverbs: clarify the name of device_cap_flags2 flags
|
||||
* libibverbs: Change definition of rmb for x86_64 archs
|
||||
* libibverbs: Support getting notifications from a DCT
|
||||
* libibverbs: Align verbs interface with upstream
|
||||
* libibverbs: Fix init to rtr params for DC initiator
|
||||
* libibverbs/tests: update tests for new libibverbs experimental interface
|
||||
* libibverbs: add ibv_exp_reg_mr experimental verb
|
||||
* libibverbs: Change legacy extended verbs to experimental verbs
|
||||
* libibverbs: Change legacy extended uverbs to experimental uverbs
|
||||
* libibverbs: Avoid endless loop on occupied port
|
||||
* (origin/mlnx_ofed_2_1) libibverbs: update ibv_poll_cq man page
|
||||
* libibverbs: add man page for ibv_exp_create_dct
|
||||
* tests: Remove IBV_CALC_OP_MAXLOC from supported operations
|
||||
* libibverbs: Fix DCT kernel/user interface
|
||||
* libibverbs: Change inline receive indication to create DCT
|
||||
* libibverbs: Return gracefully from ibv_dctgt
|
||||
* Fix memory leak in neigh resolver
|
||||
* Add a new ibv_exp_query_port
|
||||
* examples/ping_pong: buffer defined with wrong length
|
||||
* tests: Fix CD.TC7 test case
|
||||
* libibverbs: Add option for mtu in DC ini
|
||||
* libibverbs: Fix destroy DCT
|
||||
* libibverbs: verbs_exp.h need to include verbs.h
|
||||
* libibverbs: add debian support to EXTRA_DIST
|
||||
* libibverbs: add support for "git review" command line gerrit tool
|
||||
* libibverbs: fix autotools configuration
|
||||
* man: fix ib_create_flow man page to match other man pages style
|
||||
* Cosmetic changes to flow steering struct
|
||||
* Fix vagrind errors.
|
||||
* examples: Change ibv_cc_pingpong and ibv_task_pingpong to exp API
|
||||
* tests: Add IBV_TEST_DEV environment variable
|
||||
* neigh: Add specific resolution for multicast
|
||||
* libibverbs: Add inline flag to ibv_dctgt
|
||||
* libibverbs: Fix inline DC targets
|
||||
* libibvers: add verb extension
|
||||
* libibverbs: task_pingpong can't modify QP to RTR
|
||||
* libibverbs: Fix DC example sizes
|
||||
* libibverbs: Change CD tests to exp API
|
||||
* libibverbs: Change inline receive interface
|
||||
* neigh resolver sometimes fail after restart
|
||||
* Neigh_resolver: socket should choose a random local port
|
||||
* Some netlink sockets are trying to take an already allocated sockets
|
||||
* Neigh resolver timer elapsed too fast from second iteration
|
||||
* examples: modify ibv_dctgt to read DC capabilites
|
||||
* libibverbs: Add DC extended capabilities
|
||||
* libibverbs: return DC related objects in query
|
||||
* libibverbs: Remove deprecated enum IBV_QPT_DCT
|
||||
* Revert "move flow steering to experimental verbs"
|
||||
* move flow steering to experimental verbs
|
||||
* flow steering sync with latest kernel upstream code
|
||||
* libibverbs: Move DC calls to experimental verbs files
|
||||
* libibverbs: Add missing state fields to query DCT
|
||||
* libibverbs: remove inline field for DCT attibutes
|
||||
* libibverbs: Modify support for DC
|
||||
* libibiverbs: Add missing include
|
||||
* libibverbs: Install include files to include dir
|
||||
* Change place of bind_mw struct in ib_send_wr due to compatibility issues
|
||||
* libibverbs: Add experimental inline receive
|
||||
* Revert "Adding to rc_pingpong an option to perform orthogonal RDMA"
|
||||
* Revert "Adding to rc_pingpong an option of orthogonal RDMA through MW"
|
||||
* Revert "Fix in ibv_rc_pinpong, failed to register MR"
|
||||
* neigh_resolver: incorrectly calculated timeout
|
||||
* Add support for IPv4 encoded multicast addresses
|
||||
* Fix in ibv_rc_pinpong, failed to register MR
|
||||
* fix libibverbs compilation for ppc
|
||||
* Adding to rc_pingpong an option of orthogonal RDMA through MW
|
||||
* Adding to rc_pingpong an option to perform orthogonal RDMA
|
||||
* Adding man pages for memory windows
|
||||
* Adding new verbs for memory window
|
||||
* Adding memory window commands
|
||||
* Extending struct ibv_send_wr
|
||||
* Re-organize struct ibv_mw_bind
|
||||
* Adding capabilities flags that are related to memory window
|
||||
* libibverbs.spec.in: Add option to pass configure options to spec file. usage: --define 'configure_options <options>'
|
||||
* make neigh resolution optional
|
||||
* enumeration for MIC and SCIF
|
||||
* extension verb: ibv_query_values_ex
|
||||
* extension verb: add timestamping for query_device extension verb
|
||||
* extension verb: ibv_create_cq_ex - add timestamp flags
|
||||
* extension verb: ibv_poll_cq_ex
|
||||
* integrate neighbour lookup
|
||||
* Added libnl dependency
|
||||
* XRC - Sample application issues
|
||||
* XRC - remove dead-code
|
||||
* update verbs man page
|
||||
* man pages for ibv_create_flow/ibv_destroy_flow
|
||||
* XRC - sync verbs location with upstream
|
||||
* libibverbs: Add support for Create CQ extended
|
||||
* libibverbs: Modify ibv_asyncwatch to accept the monitored device
|
||||
* tests: Add check if device support Cross-Channel functionality
|
||||
* tests: Add possibility to configure tested QPs as UD
|
||||
* examples: Fix cleanup bug in the sample application
|
||||
* XRC - sync to latest upstream changes
|
||||
* compile fix
|
||||
* XRC issues
|
||||
* fix macro typo
|
||||
* XRC compat issue
|
||||
* libibverbs: XRC man pages
|
||||
* libibverbs: XRC source compat layer
|
||||
* libibverbs: XRC binary compat layer
|
||||
* Add DC support
|
||||
|
||||
-- Vladimir Sokolovsky <vlad@mellanox.com> Sun, 23 Mar 2014 14:16:10 +0200
|
||||
|
||||
libibverbs (1.1.6mlnx2-1) unstable; urgency=low
|
||||
|
||||
* libibverbs: XRC sample, fix message size
|
||||
* tests: Add unit-tests for Cross-channel API
|
||||
* examples: Add examples for Cross-channel API
|
||||
* man: Add manuals for new verbs api
|
||||
* libibverbs: Add Cross-channel capability
|
||||
* libibverbs: Added new flag IB_DEVICE_CROSS_CHANNEL into enum ib_device_cap_flags
|
||||
* libibverbs: Add ibv_query_device_ex
|
||||
* libibverbs: Add ibv_modify_cq
|
||||
* libibverbs: Support Cross-channel capability in ibv_create_qp_ex
|
||||
* libibverbs: XRC open flags
|
||||
* libibverbs: Add XRC sample source file
|
||||
* libibverbs: Add XRC sample application
|
||||
* libibverbs: Add man page for ibv_open_qp
|
||||
* libibverbs: Add ibv_open_qp
|
||||
* libibverbs: Add support for XRC QPs
|
||||
* livibverbs: Add support for XRC SRQs
|
||||
* libibverbs: Introduce XRC domains
|
||||
* Remove old APIs definitions
|
||||
* Implement ibv_create_flow and ibv_destroy_flow
|
||||
* Add general definitions to support verbs extensions
|
||||
* Revert "Implement ibv_attach_flow and ibv_detach_flow."
|
||||
* Revert "Pad ibv_attach_flow struct to avoid alignment problems"
|
||||
* Revert "Expose rule_type field in ibv_flow_spec struct"
|
||||
* shared_mr: example program adapted to use new verbs extension API
|
||||
* shared_mr support on top on verbs extenstion
|
||||
* libibverbs: Infrastructure to support verbs extensions
|
||||
* Revert "verbs extension mechanism based on Sean first patch"
|
||||
|
||||
-- Vladimir Sokolovsky <vlad@mellanox.com> Mon, 7 Jan 2013 13:38:10 +0200
|
||||
|
||||
libibverbs (1.1.6mlnx1-1) unstable; urgency=low
|
||||
|
||||
* New Mellanox release.
|
||||
|
||||
-- Vladimir Sokolovsky <vlad@mellanox.com> Mon, 7 Jan 2013 13:38:10 +0200
|
||||
|
||||
libibverbs (1.1.6-1) unstable; urgency=low
|
||||
|
||||
* Don't use brace expansion for {a,so} in libibverbs-dev.install
|
||||
* New upstream releases.
|
||||
- Add IBoE support
|
||||
- Add ibv_devinfo support for displaying extended speeds (FDR, etc)
|
||||
|
||||
-- Roland Dreier <roland@digitalvampire.org> Wed, 21 Dec 2011 16:35:08 -0800
|
||||
|
||||
libibverbs (1.1.5-1) unstable; urgency=low
|
||||
|
||||
* Switch to dpkg-source 3.0 (quilt) format.
|
||||
* New upstream releases.
|
||||
- Fix handling of madvise() failures
|
||||
- Add path record definitions to sa.h
|
||||
- Handle huge pages for fork support/madvise
|
||||
- Fix crash if no devices and ibv_get_device_list() called multiple times
|
||||
* Update maintainer and set DM-Upload-Allowed to yes. (Closes: #632106)
|
||||
* Don't ship .la files.
|
||||
* Update to Standards-Version: 3.9.2.
|
||||
|
||||
-- Roland Dreier <roland@digitalvampire.org> Wed, 29 Jun 2011 23:57:34 -0700
|
||||
|
||||
libibverbs (1.1.3-2) unstable; urgency=low
|
||||
|
||||
* Add override_dh_strip target to get debugging information actually
|
||||
put into the -dbg package.
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Wed, 11 Nov 2009 14:44:51 -0800
|
||||
|
||||
libibverbs (1.1.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Don't use enums for bit flags (avoid C++ annoyances)
|
||||
- Return some errors via errno instead of stderr
|
||||
* Move -dbg package to section debug.
|
||||
* Update to Standards-Version: 3.8.3 (no changes needed).
|
||||
* Change build system from cdbs to debhelper 7.
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Thu, 29 Oct 2009 14:19:02 -0700
|
||||
|
||||
libibverbs (1.1.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Fix memory registration failure cause by too-big madvise()
|
||||
- Fix many Valgrind false positives
|
||||
- Add functions to convert enum values to strings
|
||||
* Replace deprecated ${Source-Version} with ${binary:Version}
|
||||
* Use DEB_DH_MAKESHLIBS_ARGS_ALL to pass appropriate -V option to
|
||||
dh_makeshlibs, since new symbols were added in libibverbs 1.1.2.
|
||||
(Closes: #465435)
|
||||
* Add debian/watch file.
|
||||
* Update control file to talk about generic RDMA and iWARP, not just
|
||||
InfiniBand, since libibverbs works with both IB and iWARP.
|
||||
* Acknowledge NMU (Closes: #442638).
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Fri, 18 Apr 2008 15:08:52 -0700
|
||||
|
||||
libibverbs (1.1.1-1.1) unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload.
|
||||
* Re-generated autotools files to fix double build bug, closes: #442638
|
||||
* Bumped Standards-Version to 3.7.3, no change needed.
|
||||
|
||||
-- Michael Meskes <meskes@debian.org> Mon, 14 Apr 2008 10:07:58 +0000
|
||||
|
||||
libibverbs (1.1.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Initialize state of newly created QPs to RESET (fixes problems
|
||||
with libmlx4/ConnectX HCAs).
|
||||
- Don't warn root about RLIMIT_MEMLOCK, since it doesn't matter.
|
||||
- Fix free() errors in ibv_xx_pingpong examples.
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Fri, 15 Jun 2007 12:49:02 -0700
|
||||
|
||||
libibverbs (1.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Add support for use of fork() in applications.
|
||||
- Add manual pages documenting API in section 3.
|
||||
- New method of finding and loading device-specific drivers.
|
||||
- Add basic support for iWARP devices.
|
||||
- Provide compatible ABI for applications linked against libibverbs 1.0.
|
||||
* Update libtool during build to avoid setting RPATH in binaries on amd64.
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Sat, 28 Apr 2007 14:15:29 -0700
|
||||
|
||||
libibverbs (1.0.4-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Fix static linking so it has a chance of working.
|
||||
- Fix cut-and-paste error in sparc mb() macro.
|
||||
- Other miscellaneous fixes.
|
||||
* Improve package description.
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Tue, 31 Oct 2006 15:04:33 -0800
|
||||
|
||||
libibverbs (1.0.3-1) unstable; urgency=low
|
||||
|
||||
* Change priority to extra, since libibverbs depends on libsysfs2, which
|
||||
has priority extra. (Debian policy section 2.5 states that a package
|
||||
may not depend on another package of lower priority)
|
||||
* New upstream release:
|
||||
- For sparc, only generate membar instruction if compiling for V9
|
||||
instruction set. (Closes: #365559)
|
||||
- Reduce (but not yet eliminate) dependency on libsysfs.
|
||||
- Deprecate some ib_XXX symbol names and introduce ibv_XXX
|
||||
replacements for internal consistency.
|
||||
- Other minor fixes.
|
||||
* Update to Standards-Version: 3.7.2.
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Tue, 2 May 2006 15:33:14 -0700
|
||||
|
||||
libibverbs (1.0.2-1) unstable; urgency=low
|
||||
|
||||
* Initial Release. (Closes: #325752)
|
||||
|
||||
-- Roland Dreier <rolandd@cisco.com> Wed, 15 Feb 2006 11:21:59 -0700
|
|
@ -1 +0,0 @@
|
|||
7
|
|
@ -1,81 +0,0 @@
|
|||
Source: libibverbs
|
||||
Priority: extra
|
||||
Maintainer: Roland Dreier <roland@digitalvampire.org>
|
||||
DM-Upload-Allowed: yes
|
||||
Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.13.19)
|
||||
Standards-Version: 3.9.2
|
||||
Section: libs
|
||||
Homepage: http://www.openfabrics.org/
|
||||
|
||||
Package: libibverbs1
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
|
||||
Description: Library for direct userspace use of RDMA (InfiniBand/iWARP)
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
For this library to be useful, a device-specific plug-in module
|
||||
should also be installed.
|
||||
.
|
||||
This package contains the shared library.
|
||||
|
||||
Package: libibverbs-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, libibverbs1 (= ${binary:Version})
|
||||
Description: Development files for the libibverbs library
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
This package is needed to compile programs against libibverbs1.
|
||||
It contains the header files and static libraries (optionally)
|
||||
needed for compiling.
|
||||
|
||||
Package: libibverbs1-dbg
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, libibverbs1 (= ${binary:Version})
|
||||
Description: Debugging symbols for the libibverbs library
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
This package contains the debugging symbols associated with
|
||||
libibverbs1. They will automatically be used by gdb for debugging
|
||||
libibverbs-related issues.
|
||||
|
||||
Package: ibverbs-utils
|
||||
Section: net
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Examples for the libibverbs library
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
This package contains useful libibverbs1 example programs such as
|
||||
ibv_devinfo, which displays information about InfiniBand devices.
|
|
@ -1,49 +0,0 @@
|
|||
Initial Debianization:
|
||||
This package was debianized by Roland Dreier <rolandd@cisco.com> on
|
||||
Mon, 25 Apr 2005 10:21:08 -0700.
|
||||
|
||||
Source:
|
||||
It was downloaded from the OpenIB web site at
|
||||
<https://openib.org/downloads.html>
|
||||
|
||||
Authors:
|
||||
Roland Dreier <roland@topspin.com>
|
||||
Dotan Barak <dotanba@gmail.com>
|
||||
Sean Hefty <sean.hefty@intel.com>
|
||||
Michael S. Tsirkin <mst@mellanox.co.il>
|
||||
|
||||
Portions are copyrighted by:
|
||||
* Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
|
||||
* Copyright (c) 2004, 2005 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
|
||||
* Copyright (c) 2005 PathScale, Inc. All rights reserved.
|
||||
* Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005 Voltaire, Inc. All rights reserved.
|
||||
|
||||
libibverbs is licensed under a choice of one of two licenses. You may
|
||||
choose to be licensed under the terms of the GNU General Public
|
||||
License (GPL) Version 2, available from the file
|
||||
/usr/share/common-licenses/GPL-2 on your Debian system, or the
|
||||
OpenIB.org BSD license below:
|
||||
|
||||
Redistribution and use in source and binary forms, with or
|
||||
without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,2 +0,0 @@
|
|||
usr/bin
|
||||
usr/share/man/man1
|
|
@ -1,4 +0,0 @@
|
|||
usr/include
|
||||
usr/lib/libibverbs*.a
|
||||
usr/lib/libibverbs*.so
|
||||
usr/share/man/man3
|
|
@ -1,16 +0,0 @@
|
|||
usr/share/man/man3/ibv_get_async_event.3 usr/share/man/man3/ibv_ack_async_event.3
|
||||
usr/share/man/man3/ibv_get_cq_event.3 usr/share/man/man3/ibv_ack_cq_events.3
|
||||
usr/share/man/man3/ibv_open_device.3 usr/share/man/man3/ibv_close_device.3
|
||||
usr/share/man/man3/ibv_alloc_pd.3 usr/share/man/man3/ibv_dealloc_pd.3
|
||||
usr/share/man/man3/ibv_reg_mr.3 usr/share/man/man3/ibv_dereg_mr.3
|
||||
usr/share/man/man3/ibv_create_ah.3 usr/share/man/man3/ibv_destroy_ah.3
|
||||
usr/share/man/man3/ibv_create_comp_channel.3 usr/share/man/man3/ibv_destroy_comp_channel.3
|
||||
usr/share/man/man3/ibv_create_cq.3 usr/share/man/man3/ibv_destroy_cq.3
|
||||
usr/share/man/man3/ibv_create_qp.3 usr/share/man/man3/ibv_destroy_qp.3
|
||||
usr/share/man/man3/ibv_create_srq.3 usr/share/man/man3/ibv_destroy_srq.3
|
||||
usr/share/man/man3/ibv_attach_mcast.3 usr/share/man/man3/ibv_detach_mcast.3
|
||||
usr/share/man/man3/ibv_get_device_list.3 usr/share/man/man3/ibv_free_device_list.3
|
||||
usr/share/man/man3/ibv_create_ah_from_wc.3 usr/share/man/man3/ibv_init_ah_from_wc.3
|
||||
usr/share/man/man3/ibv_rate_to_mult.3 usr/share/man/man3/mult_to_ibv_rate.3
|
||||
usr/share/man/man3/ibv_event_type_str.3 usr/share/man/man3/ibv_node_type_str.3
|
||||
usr/share/man/man3/ibv_event_type_str.3 usr/share/man/man3/ibv_port_state_str.3
|
|
@ -1 +0,0 @@
|
|||
usr/lib/libibverbs*.so.*
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
# postinst script for libibverbs1
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = configure ]; then
|
||||
getent group rdma > /dev/null 2>&1 || addgroup --system --quiet rdma
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/make -f
|
||||
# -*- mode: makefile; coding: utf-8 -*-
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_strip:
|
||||
dh_strip --dbg-package=libibverbs1-dbg
|
||||
|
||||
override_dh_makeshlibs:
|
||||
dh_makeshlibs -V 'libibverbs1 (>= 1.1.2)'
|
|
@ -1 +0,0 @@
|
|||
3.0 (quilt)
|
|
@ -1,3 +0,0 @@
|
|||
version=3
|
||||
opts="uversionmangle=s/-rc/~rc/" \
|
||||
http://www.openfabrics.org/downloads/verbs/libibverbs-(.+)\.tar\.gz
|
|
@ -1,9 +0,0 @@
|
|||
.dirstamp
|
||||
ibv_asyncwatch
|
||||
ibv_devices
|
||||
ibv_devinfo
|
||||
ibv_rc_pingpong
|
||||
ibv_srq_pingpong
|
||||
ibv_uc_pingpong
|
||||
ibv_ud_pingpong
|
||||
.libs
|
|
@ -1,162 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
|
||||
static const char *event_name_str(enum ibv_event_type event_type)
|
||||
{
|
||||
switch (event_type) {
|
||||
case IBV_EVENT_DEVICE_FATAL:
|
||||
return "IBV_EVENT_DEVICE_FATAL";
|
||||
case IBV_EVENT_PORT_ACTIVE:
|
||||
return "IBV_EVENT_PORT_ACTIVE";
|
||||
case IBV_EVENT_PORT_ERR:
|
||||
return "IBV_EVENT_PORT_ERR";
|
||||
case IBV_EVENT_LID_CHANGE:
|
||||
return "IBV_EVENT_LID_CHANGE";
|
||||
case IBV_EVENT_PKEY_CHANGE:
|
||||
return "IBV_EVENT_PKEY_CHANGE";
|
||||
case IBV_EVENT_SM_CHANGE:
|
||||
return "IBV_EVENT_SM_CHANGE";
|
||||
case IBV_EVENT_CLIENT_REREGISTER:
|
||||
return "IBV_EVENT_CLIENT_REREGISTER";
|
||||
case IBV_EVENT_GID_CHANGE:
|
||||
return "IBV_EVENT_GID_CHANGE";
|
||||
|
||||
case IBV_EVENT_CQ_ERR:
|
||||
case IBV_EVENT_QP_FATAL:
|
||||
case IBV_EVENT_QP_REQ_ERR:
|
||||
case IBV_EVENT_QP_ACCESS_ERR:
|
||||
case IBV_EVENT_COMM_EST:
|
||||
case IBV_EVENT_SQ_DRAINED:
|
||||
case IBV_EVENT_PATH_MIG:
|
||||
case IBV_EVENT_PATH_MIG_ERR:
|
||||
case IBV_EVENT_SRQ_ERR:
|
||||
case IBV_EVENT_SRQ_LIMIT_REACHED:
|
||||
case IBV_EVENT_QP_LAST_WQE_REACHED:
|
||||
default:
|
||||
return "unexpected";
|
||||
}
|
||||
}
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s start an asyncwatch process\n", argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default first device found)\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
struct ibv_context *context;
|
||||
struct ibv_async_event event;
|
||||
char *ib_devname = NULL;
|
||||
int i = 0;
|
||||
|
||||
/* Force line-buffering in case stdout is redirected */
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
|
||||
while (1) {
|
||||
int c;
|
||||
static struct option long_options[] = {
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "help", .has_arg = 0, .val = 'h' },
|
||||
{ 0 }
|
||||
};
|
||||
c = getopt_long(argc, argv, "d:h", long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
switch (c) {
|
||||
case 'd':
|
||||
ib_devname = strdupa(optarg);
|
||||
break;
|
||||
case 'h':
|
||||
/* fall through */
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
if (ib_devname) {
|
||||
for (; dev_list[i]; ++i) {
|
||||
if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dev_list[i]) {
|
||||
fprintf(stderr, "IB device %s not found\n",
|
||||
ib_devname ? ib_devname : "");
|
||||
return 1;
|
||||
}
|
||||
|
||||
context = ibv_open_device(dev_list[i]);
|
||||
if (!context) {
|
||||
fprintf(stderr, "Couldn't get context for %s\n",
|
||||
ibv_get_device_name(dev_list[i]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s: async event FD %d\n",
|
||||
ibv_get_device_name(dev_list[i]), context->async_fd);
|
||||
|
||||
while (1) {
|
||||
if (ibv_get_async_event(context, &event))
|
||||
return 1;
|
||||
|
||||
printf(" event_type %s (%d), port %d\n",
|
||||
event_name_str(event.event_type),
|
||||
event.event_type, event.element.port_num);
|
||||
|
||||
ibv_ack_async_event(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,218 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Cisco Systems. All rights reserved.
|
||||
* Copyright (c) 2009-2010 Mellanox Technologies. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef IBV_CC_PINGPONG_H
|
||||
#define IBV_CC_PINGPONG_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <infiniband/verbs.h>
|
||||
#include <infiniband/verbs_exp.h>
|
||||
|
||||
|
||||
#define FLOAT64 double
|
||||
|
||||
enum pp_wr_data_type {
|
||||
PP_DATA_TYPE_INT8 = 0,
|
||||
PP_DATA_TYPE_INT16,
|
||||
PP_DATA_TYPE_INT32,
|
||||
PP_DATA_TYPE_INT64,
|
||||
PP_DATA_TYPE_UINT8,
|
||||
PP_DATA_TYPE_UINT16,
|
||||
PP_DATA_TYPE_UINT32,
|
||||
PP_DATA_TYPE_UINT64,
|
||||
PP_DATA_TYPE_FLOAT32,
|
||||
PP_DATA_TYPE_FLOAT64,
|
||||
PP_DATA_TYPE_FLOAT96,
|
||||
PP_DATA_TYPE_INVALID /* Keep Last */
|
||||
};
|
||||
|
||||
enum pp_wr_calc_op {
|
||||
PP_CALC_LXOR = 0,
|
||||
PP_CALC_BXOR,
|
||||
PP_CALC_LOR,
|
||||
PP_CALC_BOR,
|
||||
PP_CALC_LAND,
|
||||
PP_CALC_BAND,
|
||||
PP_CALC_ADD,
|
||||
PP_CALC_MAX,
|
||||
PP_CALC_MIN,
|
||||
PP_CALC_MAXLOC,
|
||||
PP_CALC_MINLOC,
|
||||
PP_CALC_PROD,
|
||||
PP_CALC_INVALID /* Keep Last */
|
||||
};
|
||||
|
||||
static struct {
|
||||
char size;
|
||||
const char str[32];
|
||||
} pp_wr_data_type_str[] = {
|
||||
[PP_DATA_TYPE_INT8] = { .size = 1, .str = "INT8" },
|
||||
[PP_DATA_TYPE_INT16] = { .size = 2, .str = "INT16"},
|
||||
[PP_DATA_TYPE_INT32] = { .size = 4, .str = "INT32"},
|
||||
[PP_DATA_TYPE_INT64] = { .size = 8, .str = "INT64"},
|
||||
[PP_DATA_TYPE_UINT8] = { .size = 1, .str = "UINT8" },
|
||||
[PP_DATA_TYPE_UINT16] = { .size = 2, .str = "UINT16"},
|
||||
[PP_DATA_TYPE_UINT32] = { .size = 4, .str = "UINT32"},
|
||||
[PP_DATA_TYPE_UINT64] = { .size = 8, .str = "UINT64"},
|
||||
[PP_DATA_TYPE_FLOAT32] = { .size = 4, .str = "FLOAT32"},
|
||||
[PP_DATA_TYPE_FLOAT64] = { .size = 8, .str = "FLOAT64"},
|
||||
};
|
||||
|
||||
static const char pp_wr_calc_op_str[][32] = {
|
||||
[PP_CALC_LXOR] = "XOR",
|
||||
[PP_CALC_BXOR] = "BXOR",
|
||||
[PP_CALC_LOR] = "LOR",
|
||||
[PP_CALC_BOR] = "BOR",
|
||||
[PP_CALC_LAND] = "LAND",
|
||||
[PP_CALC_BAND] = "BAND",
|
||||
[PP_CALC_ADD] = "ADD",
|
||||
[PP_CALC_MAX] = "MAX",
|
||||
[PP_CALC_MIN] = "MIN",
|
||||
[PP_CALC_MAXLOC] = "MAXLOC",
|
||||
[PP_CALC_MINLOC] = "MINLOC",
|
||||
[PP_CALC_PROD] = "PROD"
|
||||
};
|
||||
|
||||
static inline int pp_calc_data_size_to_bytes(enum ibv_exp_calc_data_size data_size)
|
||||
{
|
||||
switch (data_size) {
|
||||
case IBV_EXP_CALC_DATA_SIZE_64_BIT: return 8;
|
||||
case IBV_EXP_CALC_DATA_SIZE_NUMBER: /* fall through */
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int pp_query_calc_cap(struct ibv_context *context,
|
||||
enum ibv_exp_calc_op calc_op,
|
||||
enum ibv_exp_calc_data_type data_type,
|
||||
enum ibv_exp_calc_data_size data_size,
|
||||
int *operands_per_gather,
|
||||
int *max_num_operands)
|
||||
{
|
||||
/* TODO: check using pp_query_device() should be added */
|
||||
|
||||
if (operands_per_gather)
|
||||
*operands_per_gather = 1;
|
||||
|
||||
if (max_num_operands)
|
||||
*max_num_operands = 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void pp_print_data_type(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < PP_DATA_TYPE_INVALID; i++)
|
||||
printf("\t%s\n", pp_wr_data_type_str[i].str);
|
||||
}
|
||||
|
||||
static inline const char *pp_data_type_to_str(enum pp_wr_data_type data_type)
|
||||
{
|
||||
if (data_type < sizeof(pp_wr_data_type_str)/sizeof(pp_wr_data_type_str[0]))
|
||||
return pp_wr_data_type_str[data_type].str;
|
||||
|
||||
return "INVALID DATA TYPE";
|
||||
|
||||
}
|
||||
|
||||
static inline int pp_data_type_to_size(enum pp_wr_data_type data_type)
|
||||
{
|
||||
if (data_type < sizeof(pp_wr_data_type_str)/sizeof(pp_wr_data_type_str[0]))
|
||||
return pp_wr_data_type_str[data_type].size;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline enum pp_wr_data_type pp_str_to_data_type(const char *data_type_str)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(pp_wr_data_type_str)/sizeof(pp_wr_data_type_str[0]); i++) {
|
||||
if (!strcmp(data_type_str, pp_wr_data_type_str[i].str))
|
||||
return i;
|
||||
}
|
||||
|
||||
return PP_DATA_TYPE_INVALID;
|
||||
}
|
||||
|
||||
static inline void pp_print_calc_op(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < PP_CALC_INVALID; i++)
|
||||
printf("\t%s\n", pp_wr_calc_op_str[i]);
|
||||
}
|
||||
|
||||
static inline const char *pp_calc_op_to_str(enum pp_wr_calc_op calc_op)
|
||||
{
|
||||
if (calc_op < sizeof(pp_wr_calc_op_str)/sizeof(pp_wr_calc_op_str[0]))
|
||||
return pp_wr_calc_op_str[calc_op];
|
||||
|
||||
return "INVALID OPERATION OPCODE";
|
||||
|
||||
}
|
||||
|
||||
static inline enum pp_wr_calc_op pp_str_to_calc_op(const char *calc_op)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(pp_wr_calc_op_str)/sizeof(pp_wr_calc_op_str[0]); i++) {
|
||||
if (!strcmp(calc_op, pp_wr_calc_op_str[i]))
|
||||
return i;
|
||||
}
|
||||
|
||||
return PP_CALC_INVALID;
|
||||
}
|
||||
|
||||
static inline void pp_print_dev_calc_ops(struct ibv_context *context)
|
||||
{
|
||||
/* TODO: check using pp_query_device() should be added */
|
||||
#if 0
|
||||
int i, j, flag, supp;
|
||||
|
||||
for (i = 0; i < PP_CALC_INVALID; i++) {
|
||||
flag = 0;
|
||||
|
||||
for (j = 0; j < PP_DATA_TYPE_INVALID; j++) {
|
||||
supp = pp_query_calc_cap(context, i, j, NULL, NULL);
|
||||
|
||||
if (!supp) {
|
||||
if (!flag) {
|
||||
printf("\t%s:\n", pp_calc_op_to_str(i));
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
printf("\t\t%s\n", pp_data_type_to_str(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline enum ibv_mtu pp_mtu_to_enum(int mtu)
|
||||
{
|
||||
switch (mtu) {
|
||||
case 256: return IBV_MTU_256;
|
||||
case 512: return IBV_MTU_512;
|
||||
case 1024: return IBV_MTU_1024;
|
||||
case 2048: return IBV_MTU_2048;
|
||||
case 4096: return IBV_MTU_4096;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint16_t pp_get_local_lid(struct ibv_context *context, int port)
|
||||
{
|
||||
struct ibv_port_attr attr;
|
||||
|
||||
if (ibv_query_port(context, port, &attr))
|
||||
return 0;
|
||||
|
||||
return attr.lid;
|
||||
}
|
||||
|
||||
#endif /* IBV_CC_PINGPONG_H */
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __DC_H
|
||||
#define __DC_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <infiniband/verbs.h>
|
||||
|
||||
struct pingpong_dest {
|
||||
int lid;
|
||||
int rsn;
|
||||
uint64_t dckey;
|
||||
};
|
||||
|
||||
/* DCTN LID DCT KEY */
|
||||
#define MSG_FORMAT "000000:0000:0000000000000000"
|
||||
|
||||
static inline int to_ib_mtu(int mtu, enum ibv_mtu *ibmtu)
|
||||
{
|
||||
switch (mtu) {
|
||||
case 256:
|
||||
*ibmtu = IBV_MTU_256;
|
||||
return 0;
|
||||
case 512:
|
||||
*ibmtu = IBV_MTU_512;
|
||||
return 0;
|
||||
case 1024:
|
||||
*ibmtu = IBV_MTU_1024;
|
||||
return 0;
|
||||
case 2048:
|
||||
*ibmtu = IBV_MTU_2048;
|
||||
return 0;
|
||||
case 4096:
|
||||
*ibmtu = IBV_MTU_4096;
|
||||
return 0;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __DC_H */
|
||||
|
|
@ -1,564 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <infiniband/verbs.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
#include <malloc.h>
|
||||
#include <getopt.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <time.h>
|
||||
#include "dc.h"
|
||||
|
||||
struct dc_ctx {
|
||||
struct ibv_qp *qp;
|
||||
struct ibv_cq *cq;
|
||||
struct ibv_pd *pd;
|
||||
struct ibv_mr *mr;
|
||||
struct ibv_ah *ah;
|
||||
struct ibv_context *ctx;
|
||||
void *addr;
|
||||
size_t length;
|
||||
int port;
|
||||
int lid;
|
||||
uint64_t remote_dct_key;
|
||||
uint64_t dct_key;
|
||||
int local_key_defined;
|
||||
uint32_t dct_number;
|
||||
struct ibv_port_attr portinfo;
|
||||
int ib_port;
|
||||
enum ibv_mtu mtu;
|
||||
int sl;
|
||||
uint16_t gid_index;
|
||||
int use_gid;
|
||||
union ibv_gid dgid;
|
||||
};
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s <host> connect to server at <host>\n", argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default first device found)\n");
|
||||
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
|
||||
printf(" -s, --size=<size> size of message to exchange (default 4096)\n");
|
||||
printf(" -n, --iters=<iters> number of exchanges (default 1000)\n");
|
||||
printf(" -e, --events sleep on CQ events (default poll)\n");
|
||||
printf(" -c, --contiguous-mr use contiguous mr\n");
|
||||
printf(" -k, --dc-key DC transport key\n");
|
||||
printf(" -m, --mtu MTU of the DCI\n");
|
||||
printf(" -a, --check-nop check NOP opcode\n");
|
||||
printf(" -g, --gid-index gid index\n");
|
||||
printf(" -r, --dgid remote gid. must be given if -g is used\n");
|
||||
printf(" -l, --sl service level\n");
|
||||
}
|
||||
|
||||
int send_nop(struct dc_ctx *ctx)
|
||||
{
|
||||
struct ibv_exp_send_wr *bad_wr;
|
||||
struct ibv_exp_send_wr wr;
|
||||
struct ibv_exp_wc wc;
|
||||
int err;
|
||||
int n;
|
||||
|
||||
memset(&wr, 0, sizeof(wr));
|
||||
|
||||
wr.num_sge = 0;
|
||||
wr.exp_opcode = IBV_EXP_WR_NOP;
|
||||
wr.exp_send_flags = IBV_EXP_SEND_SIGNALED;
|
||||
|
||||
err = ibv_exp_post_send(ctx->qp, &wr, &bad_wr);
|
||||
if (err) {
|
||||
fprintf(stderr, "post nop failed\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
do {
|
||||
n = ibv_exp_poll_cq(ctx->cq, 1, &wc, sizeof(wc));
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "poll CQ failed %d\n", n);
|
||||
return -1;
|
||||
}
|
||||
} while (!n);
|
||||
|
||||
if (wc.status != IBV_WC_SUCCESS) {
|
||||
fprintf(stderr, "completion with error %d\n", wc.status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int to_rts(struct dc_ctx *ctx)
|
||||
{
|
||||
struct ibv_exp_qp_attr attr = {
|
||||
.qp_state = IBV_QPS_INIT,
|
||||
.pkey_index = 0,
|
||||
.port_num = ctx->ib_port,
|
||||
.qp_access_flags = 0,
|
||||
.dct_key = ctx->dct_key,
|
||||
};
|
||||
|
||||
if (ibv_exp_modify_qp(ctx->qp, &attr,
|
||||
IBV_EXP_QP_STATE |
|
||||
IBV_EXP_QP_PKEY_INDEX |
|
||||
IBV_EXP_QP_PORT |
|
||||
IBV_EXP_QP_DC_KEY)) {
|
||||
fprintf(stderr, "Failed to modify QP to INIT\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
attr.qp_state = IBV_QPS_RTR;
|
||||
attr.max_dest_rd_atomic = 0;
|
||||
attr.path_mtu = ctx->mtu;
|
||||
attr.ah_attr.is_global = !!ctx->use_gid;
|
||||
if (ctx->use_gid) {
|
||||
attr.ah_attr.grh.sgid_index = ctx->gid_index;
|
||||
attr.ah_attr.grh.hop_limit = 1;
|
||||
attr.ah_attr.grh.dgid = ctx->dgid;
|
||||
}
|
||||
|
||||
attr.ah_attr.dlid = ctx->lid;
|
||||
attr.ah_attr.port_num = ctx->ib_port;
|
||||
attr.ah_attr.sl = ctx->sl;
|
||||
attr.dct_key = ctx->dct_key;
|
||||
|
||||
if (ibv_exp_modify_qp(ctx->qp, &attr, IBV_EXP_QP_STATE |
|
||||
IBV_EXP_QP_PATH_MTU |
|
||||
IBV_EXP_QP_AV)) {
|
||||
fprintf(stderr, "Failed to modify QP to RTR\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
attr.qp_state = IBV_QPS_RTS;
|
||||
attr.timeout = 14;
|
||||
attr.retry_cnt = 7;
|
||||
attr.rnr_retry = 7;
|
||||
attr.max_rd_atomic = 1;
|
||||
if (ibv_exp_modify_qp(ctx->qp, &attr, IBV_EXP_QP_STATE |
|
||||
IBV_EXP_QP_TIMEOUT |
|
||||
IBV_EXP_QP_RETRY_CNT |
|
||||
IBV_EXP_QP_RNR_RETRY |
|
||||
IBV_EXP_QP_MAX_QP_RD_ATOMIC)) {
|
||||
fprintf(stderr, "Failed to modify QP to RTS\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pp_client_exch_dest(struct dc_ctx *ctx, const char *servername, int port)
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof(MSG_FORMAT)];
|
||||
int n;
|
||||
int sockfd = -1;
|
||||
int err;
|
||||
|
||||
if (asprintf(&service, "%d", port) < 0)
|
||||
return -1;
|
||||
|
||||
n = getaddrinfo(servername, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
|
||||
free(service);
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't connect to %s:%d\n", servername, port);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sprintf(msg, "%06x:%04x:0000000000000000", ctx->qp->qp_num, ctx->portinfo.lid);
|
||||
if (write(sockfd, msg, sizeof(msg)) != sizeof(msg)) {
|
||||
fprintf(stderr, "Couldn't send local address\n");
|
||||
err = -1;
|
||||
}
|
||||
|
||||
err = read(sockfd, msg, sizeof(msg));
|
||||
if (err != sizeof(msg)) {
|
||||
perror("client read");
|
||||
fprintf(stderr, "Read %d/%zu\n", err, sizeof(msg));
|
||||
err = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
sscanf(msg, "%06x:%04x:%016" SCNx64, &ctx->dct_number, &ctx->lid, &ctx->remote_dct_key);
|
||||
printf("Remote address: DCTN %06x, LID %04x, DCT key %016" PRIx64 "\n",
|
||||
ctx->dct_number, ctx->lid, ctx->remote_dct_key);
|
||||
|
||||
if (!ctx->local_key_defined)
|
||||
ctx->dct_key = ctx->remote_dct_key;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
close(sockfd);
|
||||
return err;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
struct ibv_device *ib_dev;
|
||||
char *ib_devname = NULL;
|
||||
int port = 18515;
|
||||
int size = 4096;
|
||||
int iters = 1000;
|
||||
int use_event = 0;
|
||||
int use_contig_mr;
|
||||
int err;
|
||||
struct ibv_ah_attr ah_attr;
|
||||
struct dc_ctx ctx = {
|
||||
.ib_port = 1,
|
||||
.mtu = IBV_MTU_2048,
|
||||
.sl = 0,
|
||||
};
|
||||
struct ibv_exp_send_wr wr;
|
||||
struct ibv_exp_send_wr *bad_wr;
|
||||
struct ibv_sge sg_list;
|
||||
int i;
|
||||
char *servername = NULL;
|
||||
enum ibv_mtu mtu;
|
||||
int check_nop = 0;
|
||||
int dgid_given = 0;
|
||||
|
||||
srand48(getpid() * time(NULL));
|
||||
|
||||
while (1) {
|
||||
int c;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{ .name = "port", .has_arg = 1, .val = 'p' },
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "ib-port", .has_arg = 1, .val = 'i' },
|
||||
{ .name = "size", .has_arg = 1, .val = 's' },
|
||||
{ .name = "iters", .has_arg = 1, .val = 'n' },
|
||||
{ .name = "events", .has_arg = 0, .val = 'e' },
|
||||
{ .name = "contig-mr", .has_arg = 0, .val = 'c' },
|
||||
{ .name = "dc-key", .has_arg = 1, .val = 'k' },
|
||||
{ .name = "mtu", .has_arg = 1, .val = 'm' },
|
||||
{ .name = "check-nop", .has_arg = 0, .val = 'a' },
|
||||
{ .name = "sl", .has_arg = 1, .val = 'l' },
|
||||
{ .name = "gid-index", .has_arg = 1, .val = 'g' },
|
||||
{ .name = "dgid", .has_arg = 1, .val = 'r' },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "p:d:i:s:n:ect:k:m:al:g:r:",
|
||||
long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'p':
|
||||
port = strtol(optarg, NULL, 0);
|
||||
if (port < 0 || port > 65535) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
ctx.dct_key = strtoull(optarg, NULL, 0);
|
||||
ctx.local_key_defined = 1;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
ib_devname = strdupa(optarg);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
ctx.ib_port = strtol(optarg, NULL, 0);
|
||||
if (ctx.ib_port < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
size = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
iters = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
++use_event;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
++use_contig_mr;
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
mtu = strtol(optarg, NULL, 0);
|
||||
if (to_ib_mtu(mtu, &ctx.mtu)) {
|
||||
printf("invalid MTU %d\n", mtu);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
check_nop = 1;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
ctx.sl = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
ctx.gid_index = strtol(optarg, NULL, 0);
|
||||
ctx.use_gid = 1;
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
if (!inet_pton(AF_INET6, optarg, &ctx.dgid)) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
dgid_given = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind == argc - 1) {
|
||||
servername = strdupa(argv[optind]);
|
||||
if (ctx.use_gid && !dgid_given) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
} else if (optind < argc) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ib_devname) {
|
||||
ib_dev = *dev_list;
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "No IB devices found\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; dev_list[i]; ++i)
|
||||
if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
|
||||
break;
|
||||
ib_dev = dev_list[i];
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "IB device %s not found\n", ib_devname);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx.ctx = ibv_open_device(ib_dev);
|
||||
if (!ctx.ctx) {
|
||||
fprintf(stderr, "Couldn't get context for %s\n",
|
||||
ibv_get_device_name(ib_dev));
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx.pd = ibv_alloc_pd(ctx.ctx);
|
||||
if (!ctx.pd) {
|
||||
fprintf(stderr, "failed to allocate pd\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx.length = size;
|
||||
ctx.addr = malloc(ctx.length);
|
||||
if (!ctx.addr) {
|
||||
fprintf(stderr, "failed to allocate memory\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ibv_query_port(ctx.ctx, ctx.ib_port, &ctx.portinfo)) {
|
||||
fprintf(stderr, "Couldn't get port info\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx.mr = ibv_reg_mr(ctx.pd, ctx.addr, ctx.length,
|
||||
IBV_ACCESS_REMOTE_WRITE | IBV_ACCESS_LOCAL_WRITE);
|
||||
if (!ctx.mr) {
|
||||
fprintf(stderr, "failed to create mr\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ctx.cq = ibv_create_cq(ctx.ctx, 128, NULL, NULL, 0);
|
||||
if (!ctx.cq) {
|
||||
fprintf(stderr, "failed to create cq\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_qp_init_attr_ex attr = {
|
||||
.send_cq = ctx.cq,
|
||||
.recv_cq = ctx.cq,
|
||||
.cap = {
|
||||
.max_send_wr = 100,
|
||||
.max_send_sge = 1,
|
||||
},
|
||||
.qp_type = IBV_EXP_QPT_DC_INI,
|
||||
.pd = ctx.pd,
|
||||
.comp_mask = IBV_QP_INIT_ATTR_PD,
|
||||
};
|
||||
|
||||
ctx.qp = ibv_create_qp_ex(ctx.ctx, &attr);
|
||||
if (!ctx.qp) {
|
||||
fprintf(stderr, "failed to create qp\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (pp_client_exch_dest(&ctx, servername, port)) {
|
||||
printf("failed to connect to target\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("local address: LID %04x, QPN %06x, DC_KEY %016" PRIx64 "\n",
|
||||
ctx.portinfo.lid, ctx.qp->qp_num, ctx.dct_key);
|
||||
|
||||
memset(&ah_attr, 0, sizeof(ah_attr));
|
||||
ah_attr.is_global = 0;
|
||||
ah_attr.dlid = ctx.lid;
|
||||
ah_attr.sl = ctx.sl;
|
||||
ah_attr.src_path_bits = 0;
|
||||
ah_attr.port_num = ctx.ib_port;
|
||||
if (ctx.use_gid) {
|
||||
ah_attr.is_global = 1;
|
||||
ah_attr.grh.hop_limit = 1;
|
||||
ah_attr.grh.sgid_index = ctx.gid_index;
|
||||
ah_attr.grh.dgid = ctx.dgid;
|
||||
}
|
||||
ctx.ah = ibv_create_ah(ctx.pd, &ah_attr);
|
||||
if (!ctx.ah) {
|
||||
fprintf(stderr, "failed to create ah\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
err = to_rts(&ctx);
|
||||
if (err) {
|
||||
fprintf(stderr, "failed to move to rts\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (check_nop) {
|
||||
err = send_nop(&ctx);
|
||||
if (err) {
|
||||
fprintf(stderr, "nop operation failed\n");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < iters; ++i) {
|
||||
memset(&wr, 0, sizeof(wr));
|
||||
wr.num_sge = 1;
|
||||
wr.exp_opcode = IBV_EXP_WR_SEND;
|
||||
wr.exp_send_flags = IBV_EXP_SEND_SIGNALED;
|
||||
sg_list.addr = (uint64_t)(unsigned long)ctx.addr;
|
||||
sg_list.length = ctx.length;
|
||||
sg_list.lkey = ctx.mr->lkey;
|
||||
wr.sg_list = &sg_list;
|
||||
wr.dc.ah = ctx.ah;
|
||||
wr.dc.dct_access_key = ctx.dct_key;
|
||||
wr.dc.dct_number = ctx.dct_number;
|
||||
|
||||
err = ibv_exp_post_send(ctx.qp, &wr, &bad_wr);
|
||||
if (err) {
|
||||
fprintf(stderr, "failed to post send request\n");
|
||||
return -1;
|
||||
} else {
|
||||
int num;
|
||||
struct ibv_wc wc;
|
||||
|
||||
do {
|
||||
num = ibv_poll_cq(ctx.cq, 1, &wc);
|
||||
if (num < 0) {
|
||||
fprintf(stderr, "failed to poll cq\n");
|
||||
return -1;
|
||||
}
|
||||
} while (!num);
|
||||
if (wc.status != IBV_WC_SUCCESS) {
|
||||
fprintf(stderr, "completion with error %d\n", wc.status);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("test finished successfully\n");
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,607 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
#include <infiniband/verbs.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
#include <malloc.h>
|
||||
#include <getopt.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <infiniband/verbs_exp.h>
|
||||
#include "dc.h"
|
||||
|
||||
struct dc_ctx {
|
||||
struct ibv_qp *qp;
|
||||
struct ibv_cq *cq;
|
||||
struct ibv_pd *pd;
|
||||
struct ibv_mr *mr;
|
||||
struct ibv_srq *srq;
|
||||
struct ibv_context *ctx;
|
||||
void *addr;
|
||||
size_t length;
|
||||
int port;
|
||||
uint64_t dct_key;
|
||||
unsigned size;
|
||||
int ib_port;
|
||||
enum ibv_mtu mtu;
|
||||
int rcv_idx;
|
||||
struct ibv_port_attr portinfo;
|
||||
struct ibv_exp_dct *dct;
|
||||
pthread_t thread;
|
||||
int thread_active;
|
||||
int inl;
|
||||
pthread_t poll_thread;
|
||||
};
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s start a server and wait for connection\n", argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default first device found)\n");
|
||||
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
|
||||
printf(" -s, --size=<size> size of message to exchange (default 4096)\n");
|
||||
printf(" -n, --iters=<iters> number of exchanges (unlimited)\n");
|
||||
printf(" -e, --events sleep on CQ events (default poll)\n");
|
||||
printf(" -c, --contiguous-mr use contiguous mr\n");
|
||||
printf(" -k, --dc-key DC transport key\n");
|
||||
printf(" -m, --mtu MTU of the DCT\n");
|
||||
printf(" -l, --inline Requested inline receive size\n");
|
||||
}
|
||||
|
||||
static int post_recv(struct dc_ctx *ctx, int n)
|
||||
{
|
||||
struct ibv_sge list = {
|
||||
.length = ctx->size,
|
||||
.lkey = ctx->mr->lkey
|
||||
};
|
||||
struct ibv_recv_wr wr = {
|
||||
.sg_list = &list,
|
||||
.num_sge = 1,
|
||||
};
|
||||
struct ibv_recv_wr *bad_wr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; ++i) {
|
||||
list.addr = (uintptr_t)ctx->addr + (ctx->size * (ctx->rcv_idx++ % 32));
|
||||
if (ibv_post_srq_recv(ctx->srq, &wr, &bad_wr))
|
||||
break;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static struct pingpong_dest *pp_server_exch_dest(struct dc_ctx *ctx,
|
||||
const struct pingpong_dest *my_dest)
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_PASSIVE,
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof(MSG_FORMAT)];
|
||||
int n;
|
||||
int sockfd = -1, connfd;
|
||||
struct pingpong_dest *rem_dest = NULL;
|
||||
int err;
|
||||
|
||||
if (asprintf(&service, "%d", ctx->port) < 0)
|
||||
return NULL;
|
||||
|
||||
n = getaddrinfo(NULL, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for port %d\n", gai_strerror(n), ctx->port);
|
||||
free(service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
n = 1;
|
||||
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n));
|
||||
|
||||
if (!bind(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't listen to port %d\n", ctx->port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
err = listen(sockfd, 1);
|
||||
if (err)
|
||||
return NULL;
|
||||
|
||||
connfd = accept(sockfd, NULL, 0);
|
||||
close(sockfd);
|
||||
if (connfd < 0) {
|
||||
fprintf(stderr, "accept() failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
n = read(connfd, msg, sizeof(msg));
|
||||
if (n != sizeof(msg)) {
|
||||
perror("server read");
|
||||
fprintf(stderr, "%d/%d: Couldn't read remote address\n", n, (int)sizeof(msg));
|
||||
goto out;
|
||||
}
|
||||
|
||||
rem_dest = malloc(sizeof(*rem_dest));
|
||||
if (!rem_dest)
|
||||
goto out;
|
||||
|
||||
sscanf(msg, "%06x:%04x:%016" SCNx64, &rem_dest->rsn, &rem_dest->lid, &rem_dest->dckey);
|
||||
printf("Connection from: QPN %06x, LID %04x\n", rem_dest->rsn, rem_dest->lid);
|
||||
|
||||
sprintf(msg, "%06x:%04x:%016" PRIx64, ctx->dct->dct_num, ctx->portinfo.lid, ctx->dct_key);
|
||||
|
||||
if (write(connfd, msg, sizeof(msg)) != sizeof(msg)) {
|
||||
fprintf(stderr, "Couldn't send local address\n");
|
||||
free(rem_dest);
|
||||
rem_dest = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
close(connfd);
|
||||
return rem_dest;
|
||||
}
|
||||
|
||||
static void *handle_clients(void *arg)
|
||||
{
|
||||
struct dc_ctx *ctx = arg;
|
||||
struct pingpong_dest my_dest;
|
||||
struct pingpong_dest *ret;
|
||||
|
||||
while (ctx->thread_active) {
|
||||
ret = pp_server_exch_dest(ctx, &my_dest);
|
||||
if (!ret)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char *event_name_str(enum ibv_event_type event_type)
|
||||
{
|
||||
switch (event_type) {
|
||||
case IBV_EVENT_DEVICE_FATAL:
|
||||
return "IBV_EVENT_DEVICE_FATAL";
|
||||
case IBV_EVENT_PORT_ACTIVE:
|
||||
return "IBV_EVENT_PORT_ACTIVE";
|
||||
case IBV_EVENT_PORT_ERR:
|
||||
return "IBV_EVENT_PORT_ERR";
|
||||
case IBV_EVENT_LID_CHANGE:
|
||||
return "IBV_EVENT_LID_CHANGE";
|
||||
case IBV_EVENT_PKEY_CHANGE:
|
||||
return "IBV_EVENT_PKEY_CHANGE";
|
||||
case IBV_EVENT_SM_CHANGE:
|
||||
return "IBV_EVENT_SM_CHANGE";
|
||||
case IBV_EVENT_CLIENT_REREGISTER:
|
||||
return "IBV_EVENT_CLIENT_REREGISTER";
|
||||
case IBV_EVENT_GID_CHANGE:
|
||||
return "IBV_EVENT_GID_CHANGE";
|
||||
case IBV_EXP_EVENT_DCT_KEY_VIOLATION:
|
||||
return "IBV_EXP_EVENT_DCT_KEY_VIOLATION";
|
||||
case IBV_EVENT_QP_ACCESS_ERR:
|
||||
return "IBV_EVENT_QP_ACCESS_ERR";
|
||||
|
||||
case IBV_EVENT_CQ_ERR:
|
||||
case IBV_EVENT_QP_FATAL:
|
||||
case IBV_EVENT_QP_REQ_ERR:
|
||||
case IBV_EVENT_COMM_EST:
|
||||
case IBV_EVENT_SQ_DRAINED:
|
||||
case IBV_EVENT_PATH_MIG:
|
||||
case IBV_EVENT_PATH_MIG_ERR:
|
||||
case IBV_EVENT_SRQ_ERR:
|
||||
case IBV_EVENT_SRQ_LIMIT_REACHED:
|
||||
case IBV_EVENT_QP_LAST_WQE_REACHED:
|
||||
default:
|
||||
return "unexpected";
|
||||
}
|
||||
}
|
||||
|
||||
static void *poll_async(void *arg)
|
||||
{
|
||||
struct dc_ctx *ctx = arg;
|
||||
struct ibv_async_event event;
|
||||
struct ibv_exp_arm_attr attr;
|
||||
int err;
|
||||
|
||||
while (1) {
|
||||
attr.comp_mask = 0;
|
||||
err = ibv_exp_arm_dct(ctx->dct, &attr);
|
||||
if (err) {
|
||||
fprintf(stderr, "arm dct failed %d\n", err);
|
||||
return NULL;
|
||||
}
|
||||
if (ibv_get_async_event(ctx->ctx, &event))
|
||||
return NULL;
|
||||
|
||||
printf(" event_type %s (%d)\n",
|
||||
event_name_str(event.event_type),
|
||||
event.event_type);
|
||||
|
||||
ibv_ack_async_event(&event);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
struct ibv_device *ib_dev;
|
||||
char *ib_devname = NULL;
|
||||
int iters = 0;
|
||||
int use_event = 0;
|
||||
int err;
|
||||
struct dc_ctx ctx = {
|
||||
.port = 18515,
|
||||
.ib_port = 1,
|
||||
.dct_key = 0x1234,
|
||||
.size = 4096,
|
||||
.mtu = IBV_MTU_2048,
|
||||
.inl = 0,
|
||||
};
|
||||
int i;
|
||||
uint32_t srqn;
|
||||
int mtu;
|
||||
struct ibv_exp_device_attr dattr;
|
||||
|
||||
srand48(getpid() * time(NULL));
|
||||
|
||||
while (1) {
|
||||
int c;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{ .name = "port", .has_arg = 1, .val = 'p' },
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "ib-port", .has_arg = 1, .val = 'i' },
|
||||
{ .name = "size", .has_arg = 1, .val = 's' },
|
||||
{ .name = "iters", .has_arg = 1, .val = 'n' },
|
||||
{ .name = "events", .has_arg = 0, .val = 'e' },
|
||||
{ .name = "dc-key", .has_arg = 1, .val = 'k' },
|
||||
{ .name = "mtu", .has_arg = 1, .val = 'm' },
|
||||
{ .name = "inline", .has_arg = 1, .val = 'l' },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "p:d:i:s:n:ek:m:l:", long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'p':
|
||||
ctx.port = strtol(optarg, NULL, 0);
|
||||
if (ctx.port < 0 || ctx.port > 65535) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
ib_devname = strdupa(optarg);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
ctx.inl = strtol(optarg, NULL, 0);
|
||||
if (ctx.inl < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
ctx.ib_port = strtol(optarg, NULL, 0);
|
||||
if (ctx.ib_port < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
mtu = strtol(optarg, NULL, 0);
|
||||
if (to_ib_mtu(mtu, &ctx.mtu)) {
|
||||
printf("invalid MTU %d\n", mtu);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
ctx.size = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
iters = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
++use_event;
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
ctx.dct_key = strtoull(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < argc) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ib_devname) {
|
||||
ib_dev = *dev_list;
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "No IB devices found\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; dev_list[i]; ++i)
|
||||
if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
|
||||
break;
|
||||
ib_dev = dev_list[i];
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "IB device %s not found\n", ib_devname);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx.ctx = ibv_open_device(ib_dev);
|
||||
if (!ctx.ctx) {
|
||||
fprintf(stderr, "Couldn't get context for %s\n",
|
||||
ibv_get_device_name(ib_dev));
|
||||
return 1;
|
||||
}
|
||||
|
||||
dattr.comp_mask = IBV_EXP_DEVICE_ATTR_EXP_CAP_FLAGS |
|
||||
IBV_EXP_DEVICE_DC_RD_REQ |
|
||||
IBV_EXP_DEVICE_DC_RD_RES;
|
||||
err = ibv_exp_query_device(ctx.ctx, &dattr);
|
||||
if (err) {
|
||||
printf("couldn't query device extended attributes\n");
|
||||
return -1;
|
||||
} else {
|
||||
if (!(dattr.comp_mask & IBV_EXP_DEVICE_ATTR_EXP_CAP_FLAGS)) {
|
||||
printf("no extended capability flgas\n");
|
||||
return -1;
|
||||
}
|
||||
if (!(dattr.exp_device_cap_flags & IBV_EXP_DEVICE_DC_TRANSPORT)) {
|
||||
printf("DC transport not enabled\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(dattr.comp_mask & IBV_EXP_DEVICE_DC_RD_REQ)) {
|
||||
printf("no report on max requestor rdma/atomic resources\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(dattr.comp_mask & IBV_EXP_DEVICE_DC_RD_RES)) {
|
||||
printf("no report on max responder rdma/atomic resources\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx.pd = ibv_alloc_pd(ctx.ctx);
|
||||
if (!ctx.pd) {
|
||||
fprintf(stderr, "failed to allocate pd\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx.length = 32 * ctx.size;
|
||||
ctx.addr = malloc(ctx.length);
|
||||
if (!ctx.addr) {
|
||||
fprintf(stderr, "failed to allocate memory\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ctx.mr = ibv_reg_mr(ctx.pd, ctx.addr, ctx.length,
|
||||
IBV_ACCESS_REMOTE_WRITE | IBV_ACCESS_LOCAL_WRITE);
|
||||
if (!ctx.mr) {
|
||||
fprintf(stderr, "failed to create mr\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ctx.cq = ibv_create_cq(ctx.ctx, 128, NULL, NULL, 0);
|
||||
if (!ctx.cq) {
|
||||
fprintf(stderr, "failed to create cq\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
struct ibv_srq_init_attr attr = {
|
||||
.attr = {
|
||||
.max_wr = 100,
|
||||
.max_sge = 1
|
||||
}
|
||||
};
|
||||
|
||||
ctx.srq = ibv_create_srq(ctx.pd, &attr);
|
||||
if (!ctx.srq) {
|
||||
fprintf(stderr, "Couldn't create SRQ\n");
|
||||
return -1;
|
||||
}
|
||||
ibv_get_srq_num(ctx.srq, &srqn);
|
||||
}
|
||||
|
||||
err = post_recv(&ctx, 100);
|
||||
if (err != 100) {
|
||||
fprintf(stderr, "posted %d out of %d receive buffers\n", err, 100);
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_exp_dct_init_attr dctattr = {
|
||||
.pd = ctx.pd,
|
||||
.cq = ctx.cq,
|
||||
.srq = ctx.srq,
|
||||
.dc_key = ctx.dct_key,
|
||||
.port = ctx.ib_port,
|
||||
.access_flags = IBV_ACCESS_REMOTE_WRITE,
|
||||
.min_rnr_timer = 2,
|
||||
.tclass = 0,
|
||||
.flow_label = 0,
|
||||
.mtu = ctx.mtu,
|
||||
.pkey_index = 0,
|
||||
.gid_index = 0,
|
||||
.hop_limit = 1,
|
||||
.create_flags = 0,
|
||||
.inline_size = ctx.inl,
|
||||
};
|
||||
|
||||
ctx.dct = ibv_exp_create_dct(ctx.ctx, &dctattr);
|
||||
if (!ctx.dct) {
|
||||
printf("create dct failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_exp_dct_attr dcqattr;
|
||||
|
||||
dcqattr.comp_mask = 0;
|
||||
err = ibv_exp_query_dct(ctx.dct, &dcqattr);
|
||||
if (err) {
|
||||
printf("query dct failed\n");
|
||||
return -1;
|
||||
} else if (dcqattr.dc_key != ctx.dct_key) {
|
||||
printf("queried dckry (0x%llx) is different then provided at create (0x%llx)\n",
|
||||
(unsigned long long)dcqattr.dc_key,
|
||||
(unsigned long long)ctx.dct_key);
|
||||
return -1;
|
||||
} else if (dcqattr.state != IBV_EXP_DCT_STATE_ACTIVE) {
|
||||
printf("state is not active %d\n", dcqattr.state);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("local address: DCTN 0x%06x, SRQN 0x%06x, DCKEY 0x%016llx\n",
|
||||
ctx.dct->dct_num, srqn, (unsigned long long)ctx.dct_key);
|
||||
}
|
||||
|
||||
if (ibv_query_port(ctx.ctx, ctx.ib_port, &ctx.portinfo)) {
|
||||
fprintf(stderr, "Couldn't get port info\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx.thread_active = 1;
|
||||
err = pthread_create(&ctx.thread, NULL, handle_clients, &ctx);
|
||||
if (err) {
|
||||
perror("thread create faild:");
|
||||
return -1;
|
||||
}
|
||||
|
||||
err = pthread_create(&ctx.poll_thread, NULL, poll_async, &ctx);
|
||||
if (err) {
|
||||
perror("thread create faild:");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < iters || iters == 0; ++i) {
|
||||
int num;
|
||||
struct ibv_wc wc;
|
||||
|
||||
do {
|
||||
num = ibv_poll_cq(ctx.cq, 1, &wc);
|
||||
if (num < 0) {
|
||||
fprintf(stderr, "failed to poll cq\n");
|
||||
return -1;
|
||||
}
|
||||
} while (!num);
|
||||
if (wc.status != IBV_WC_SUCCESS) {
|
||||
fprintf(stderr, "completion with error:\n");
|
||||
fprintf(stderr, "status: %d\n", wc.status);
|
||||
} else {
|
||||
if (post_recv(&ctx, 1) != 1) {
|
||||
fprintf(stderr, "failed to post receive buffer\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("test finished successfully\n");
|
||||
ctx.thread_active = 0;
|
||||
if (pthread_cancel(ctx.thread))
|
||||
printf("pthread_cancel failed\n");
|
||||
|
||||
if (pthread_cancel(ctx.poll_thread))
|
||||
printf("pthread_cancel failed\n");
|
||||
|
||||
err = pthread_join(ctx.thread, NULL);
|
||||
if (err) {
|
||||
perror("thread join faild:");
|
||||
return -1;
|
||||
}
|
||||
if (ibv_exp_destroy_dct(ctx.dct))
|
||||
printf("destroy dct failed\n");
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
#include <infiniband/arch.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
int num_devices, i;
|
||||
|
||||
dev_list = ibv_get_device_list(&num_devices);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf(" %-16s\t node GUID\n", "device");
|
||||
printf(" %-16s\t----------------\n", "------");
|
||||
|
||||
for (i = 0; i < num_devices; ++i) {
|
||||
printf(" %-16s\t%016llx\n",
|
||||
ibv_get_device_name(dev_list[i]),
|
||||
(unsigned long long) ntohll(ibv_get_device_guid(dev_list[i])));
|
||||
}
|
||||
|
||||
ibv_free_device_list(dev_list);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,782 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Cisco Systems. All rights reserved.
|
||||
* Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include <netinet/in.h>
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
#include <infiniband/driver.h>
|
||||
#include <infiniband/arch.h>
|
||||
|
||||
static int verbose;
|
||||
|
||||
static int null_gid(union ibv_gid *gid)
|
||||
{
|
||||
return !(gid->raw[8] | gid->raw[9] | gid->raw[10] | gid->raw[11] |
|
||||
gid->raw[12] | gid->raw[13] | gid->raw[14] | gid->raw[15]);
|
||||
}
|
||||
|
||||
static const char *guid_str(uint64_t node_guid, char *str)
|
||||
{
|
||||
node_guid = ntohll(node_guid);
|
||||
sprintf(str, "%04x:%04x:%04x:%04x",
|
||||
(unsigned) (node_guid >> 48) & 0xffff,
|
||||
(unsigned) (node_guid >> 32) & 0xffff,
|
||||
(unsigned) (node_guid >> 16) & 0xffff,
|
||||
(unsigned) (node_guid >> 0) & 0xffff);
|
||||
return str;
|
||||
}
|
||||
|
||||
static const char *transport_str(enum ibv_transport_type transport)
|
||||
{
|
||||
switch (transport) {
|
||||
case IBV_TRANSPORT_IB: return "InfiniBand";
|
||||
case IBV_TRANSPORT_IWARP: return "iWARP";
|
||||
case IBV_EXP_TRANSPORT_SCIF: return "SCIF";
|
||||
default: return "invalid transport";
|
||||
}
|
||||
}
|
||||
|
||||
static const char *port_state_str(enum ibv_port_state pstate)
|
||||
{
|
||||
switch (pstate) {
|
||||
case IBV_PORT_DOWN: return "PORT_DOWN";
|
||||
case IBV_PORT_INIT: return "PORT_INIT";
|
||||
case IBV_PORT_ARMED: return "PORT_ARMED";
|
||||
case IBV_PORT_ACTIVE: return "PORT_ACTIVE";
|
||||
default: return "invalid state";
|
||||
}
|
||||
}
|
||||
|
||||
static const char *port_phy_state_str(uint8_t phys_state)
|
||||
{
|
||||
switch (phys_state) {
|
||||
case 1: return "SLEEP";
|
||||
case 2: return "POLLING";
|
||||
case 3: return "DISABLED";
|
||||
case 4: return "PORT_CONFIGURATION TRAINNING";
|
||||
case 5: return "LINK_UP";
|
||||
case 6: return "LINK_ERROR_RECOVERY";
|
||||
case 7: return "PHY TEST";
|
||||
default: return "invalid physical state";
|
||||
}
|
||||
}
|
||||
|
||||
static const char *exp_atomic_cap_str(enum ibv_exp_atomic_cap exp_atom_cap)
|
||||
{
|
||||
switch (exp_atom_cap) {
|
||||
case IBV_EXP_ATOMIC_NONE: return "ATOMIC_NONE";
|
||||
case IBV_EXP_ATOMIC_HCA: return "ATOMIC_HCA";
|
||||
case IBV_EXP_ATOMIC_GLOB: return "ATOMIC_GLOB";
|
||||
case IBV_EXP_ATOMIC_HCA_REPLY_BE: return "ATOMIC_HCA_REPLY_BE";
|
||||
default: return "invalid atomic capability";
|
||||
}
|
||||
}
|
||||
|
||||
static const char *mtu_str(enum ibv_mtu max_mtu)
|
||||
{
|
||||
switch (max_mtu) {
|
||||
case IBV_MTU_256: return "256";
|
||||
case IBV_MTU_512: return "512";
|
||||
case IBV_MTU_1024: return "1024";
|
||||
case IBV_MTU_2048: return "2048";
|
||||
case IBV_MTU_4096: return "4096";
|
||||
default: return "invalid MTU";
|
||||
}
|
||||
}
|
||||
|
||||
static const char *width_str(uint8_t width)
|
||||
{
|
||||
switch (width) {
|
||||
case 1: return "1";
|
||||
case 2: return "4";
|
||||
case 4: return "8";
|
||||
case 8: return "12";
|
||||
default: return "invalid width";
|
||||
}
|
||||
}
|
||||
|
||||
static const char *speed_str(uint8_t speed)
|
||||
{
|
||||
switch (speed) {
|
||||
case 1: return "2.5 Gbps";
|
||||
case 2: return "5.0 Gbps";
|
||||
|
||||
case 4: /* fall through */
|
||||
case 8: return "10.0 Gbps";
|
||||
|
||||
case 16: return "14.0 Gbps";
|
||||
case 32: return "25.0 Gbps";
|
||||
case 64: return "50.0 Gbps";
|
||||
default: return "invalid speed";
|
||||
}
|
||||
}
|
||||
|
||||
static const char *vl_str(uint8_t vl_num)
|
||||
{
|
||||
switch (vl_num) {
|
||||
case 1: return "1";
|
||||
case 2: return "2";
|
||||
case 3: return "4";
|
||||
case 4: return "8";
|
||||
case 5: return "15";
|
||||
default: return "invalid value";
|
||||
}
|
||||
}
|
||||
|
||||
static int print_all_port_gids(struct ibv_context *ctx, uint8_t port_num, int tbl_len)
|
||||
{
|
||||
union ibv_gid gid;
|
||||
int rc = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < tbl_len; i++) {
|
||||
rc = ibv_query_gid(ctx, port_num, i, &gid);
|
||||
if (rc) {
|
||||
fprintf(stderr, "Failed to query gid to port %d, index %d\n",
|
||||
port_num, i);
|
||||
return rc;
|
||||
}
|
||||
if (!null_gid(&gid))
|
||||
printf("\t\t\tGID[%3d]:\t\t%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
|
||||
i,
|
||||
gid.raw[ 0], gid.raw[ 1],
|
||||
gid.raw[ 2], gid.raw[ 3],
|
||||
gid.raw[ 4], gid.raw[ 5],
|
||||
gid.raw[ 6], gid.raw[ 7],
|
||||
gid.raw[ 8], gid.raw[ 9],
|
||||
gid.raw[10], gid.raw[11],
|
||||
gid.raw[12], gid.raw[13],
|
||||
gid.raw[14], gid.raw[15]);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static const char *link_layer_str(uint8_t link_layer)
|
||||
{
|
||||
switch (link_layer) {
|
||||
case IBV_LINK_LAYER_UNSPECIFIED:
|
||||
case IBV_LINK_LAYER_INFINIBAND:
|
||||
return "InfiniBand";
|
||||
case IBV_LINK_LAYER_ETHERNET:
|
||||
return "Ethernet";
|
||||
case IBV_EXP_LINK_LAYER_SCIF:
|
||||
return "SCIF";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void print_caps(int caps)
|
||||
{
|
||||
int unknown_flags = ~(IBV_DEVICE_RESIZE_MAX_WR |
|
||||
IBV_DEVICE_BAD_PKEY_CNTR |
|
||||
IBV_DEVICE_BAD_QKEY_CNTR |
|
||||
IBV_DEVICE_RAW_MULTI |
|
||||
IBV_DEVICE_AUTO_PATH_MIG |
|
||||
IBV_DEVICE_CHANGE_PHY_PORT |
|
||||
IBV_DEVICE_UD_AV_PORT_ENFORCE |
|
||||
IBV_DEVICE_CURR_QP_STATE_MOD |
|
||||
IBV_DEVICE_SHUTDOWN_PORT |
|
||||
IBV_DEVICE_INIT_TYPE |
|
||||
IBV_DEVICE_PORT_ACTIVE_EVENT |
|
||||
IBV_DEVICE_SYS_IMAGE_GUID |
|
||||
IBV_DEVICE_RC_RNR_NAK_GEN |
|
||||
IBV_DEVICE_SRQ_RESIZE |
|
||||
IBV_DEVICE_N_NOTIFY_CQ |
|
||||
IBV_DEVICE_XRC);
|
||||
|
||||
if (caps & IBV_DEVICE_RESIZE_MAX_WR)
|
||||
printf("\t\t\t\t\tRESIZE_MAX_WR\n");
|
||||
if (caps & IBV_DEVICE_BAD_PKEY_CNTR)
|
||||
printf("\t\t\t\t\tBAD_PKEY_CNTR\n");
|
||||
if (caps & IBV_DEVICE_BAD_QKEY_CNTR)
|
||||
printf("\t\t\t\t\tBAD_QKEY_CNTR\n");
|
||||
if (caps & IBV_DEVICE_RAW_MULTI)
|
||||
printf("\t\t\t\t\tRAW_MULTI\n");
|
||||
if (caps & IBV_DEVICE_AUTO_PATH_MIG)
|
||||
printf("\t\t\t\t\tAUTO_PATH_MIG\n");
|
||||
if (caps & IBV_DEVICE_CHANGE_PHY_PORT)
|
||||
printf("\t\t\t\t\tCHANGE_PHY_PORT\n");
|
||||
if (caps & IBV_DEVICE_UD_AV_PORT_ENFORCE)
|
||||
printf("\t\t\t\t\tUD_AV_PORT_ENFORCE\n");
|
||||
if (caps & IBV_DEVICE_CURR_QP_STATE_MOD)
|
||||
printf("\t\t\t\t\tCURR_QP_STATE_MOD\n");
|
||||
if (caps & IBV_DEVICE_SHUTDOWN_PORT)
|
||||
printf("\t\t\t\t\tSHUTDOWN_PORT\n");
|
||||
if (caps & IBV_DEVICE_INIT_TYPE)
|
||||
printf("\t\t\t\t\tINIT_TYPE\n");
|
||||
if (caps & IBV_DEVICE_PORT_ACTIVE_EVENT)
|
||||
printf("\t\t\t\t\tPORT_ACTIVE_EVENT\n");
|
||||
if (caps & IBV_DEVICE_SYS_IMAGE_GUID)
|
||||
printf("\t\t\t\t\tSYS_IMAGE_GUID\n");
|
||||
if (caps & IBV_DEVICE_RC_RNR_NAK_GEN)
|
||||
printf("\t\t\t\t\tRC_RNR_NAK_GEN\n");
|
||||
if (caps & IBV_DEVICE_SRQ_RESIZE)
|
||||
printf("\t\t\t\t\tSRQ_RESIZE\n");
|
||||
if (caps & IBV_DEVICE_N_NOTIFY_CQ)
|
||||
printf("\t\t\t\t\tN_NOTIFY_CQ\n");
|
||||
if (caps & IBV_DEVICE_XRC)
|
||||
printf("\t\t\t\t\tXRC\n");
|
||||
if (caps & unknown_flags)
|
||||
printf("\t\t\t\t\tUnknown flags: 0x%08x\n", caps & unknown_flags);
|
||||
}
|
||||
|
||||
static void print_caps_exp(uint64_t caps)
|
||||
{
|
||||
uint64_t unknown_flags = ~(IBV_EXP_DEVICE_DC_TRANSPORT |
|
||||
IBV_EXP_DEVICE_QPG |
|
||||
IBV_EXP_DEVICE_UD_RSS |
|
||||
IBV_EXP_DEVICE_UD_TSS |
|
||||
IBV_EXP_DEVICE_MEM_WINDOW |
|
||||
IBV_EXP_DEVICE_MEM_MGT_EXTENSIONS |
|
||||
IBV_EXP_DEVICE_MW_TYPE_2A |
|
||||
IBV_EXP_DEVICE_MW_TYPE_2B |
|
||||
IBV_EXP_DEVICE_CROSS_CHANNEL |
|
||||
IBV_EXP_DEVICE_MANAGED_FLOW_STEERING |
|
||||
IBV_EXP_DEVICE_MR_ALLOCATE |
|
||||
IBV_EXP_DEVICE_MR_ALLOCATE |
|
||||
IBV_EXP_DEVICE_EXT_ATOMICS |
|
||||
IBV_EXP_DEVICE_NOP |
|
||||
IBV_EXP_DEVICE_UMR |
|
||||
IBV_EXP_DEVICE_ODP |
|
||||
IBV_EXP_DEVICE_VXLAN_SUPPORT |
|
||||
IBV_EXP_DEVICE_RX_CSUM_TCP_UDP_PKT |
|
||||
IBV_EXP_DEVICE_RX_CSUM_IP_PKT |
|
||||
IBV_EXP_DEVICE_DC_INFO |
|
||||
IBV_EXP_DEVICE_EXT_MASKED_ATOMICS |
|
||||
IBV_EXP_DEVICE_RX_TCP_UDP_PKT_TYPE |
|
||||
IBV_EXP_DEVICE_SCATTER_FCS);
|
||||
|
||||
if (caps & IBV_EXP_DEVICE_DC_TRANSPORT)
|
||||
printf("\t\t\t\t\tEXP_DC_TRANSPORT\n");
|
||||
if (caps & IBV_EXP_DEVICE_QPG)
|
||||
printf("\t\t\t\t\tEXP_DEVICE_QPG\n");
|
||||
if (caps & IBV_EXP_DEVICE_UD_RSS)
|
||||
printf("\t\t\t\t\tEXP_UD_RSS\n");
|
||||
if (caps & IBV_EXP_DEVICE_UD_TSS)
|
||||
printf("\t\t\t\t\tEXP_UD_TSS\n");
|
||||
if (caps & IBV_EXP_DEVICE_MEM_WINDOW)
|
||||
printf("\t\t\t\t\tEXP_MEM_WINDOW\n");
|
||||
if (caps & IBV_EXP_DEVICE_MEM_MGT_EXTENSIONS)
|
||||
printf("\t\t\t\t\tEXP_MEM_MGT_EXTENSIONS\n");
|
||||
if (caps & IBV_EXP_DEVICE_MW_TYPE_2A)
|
||||
printf("\t\t\t\t\tEXP_MW_TYPE_2A\n");
|
||||
if (caps & IBV_EXP_DEVICE_MW_TYPE_2B)
|
||||
printf("\t\t\t\t\tEXP_MW_TYPE_2B\n");
|
||||
if (caps & IBV_EXP_DEVICE_CROSS_CHANNEL)
|
||||
printf("\t\t\t\t\tEXP_CROSS_CHANNEL\n");
|
||||
if (caps & IBV_EXP_DEVICE_MANAGED_FLOW_STEERING)
|
||||
printf("\t\t\t\t\tEXP_MANAGED_FLOW_STEERING\n");
|
||||
if (caps & IBV_EXP_DEVICE_MR_ALLOCATE)
|
||||
printf("\t\t\t\t\tEXP_MR_ALLOCATE\n");
|
||||
if (caps & IBV_EXP_DEVICE_SHARED_MR)
|
||||
printf("\t\t\t\t\tEXP_SHARED_MR\n");
|
||||
if (caps & IBV_EXP_DEVICE_EXT_ATOMICS)
|
||||
printf("\t\t\t\t\tEXT_ATOMICS\n");
|
||||
if (caps & IBV_EXP_DEVICE_NOP)
|
||||
printf("\t\t\t\t\tEXT_SEND NOP\n");
|
||||
if (caps & IBV_EXP_DEVICE_UMR)
|
||||
printf("\t\t\t\t\tEXP_UMR\n");
|
||||
if (caps & IBV_EXP_DEVICE_ODP)
|
||||
printf("\t\t\t\t\tEXP_ODP\n");
|
||||
if (caps & IBV_EXP_DEVICE_VXLAN_SUPPORT)
|
||||
printf("\t\t\t\t\tEXP_VXLAN_SUPPORT\n");
|
||||
if (caps & IBV_EXP_DEVICE_RX_CSUM_TCP_UDP_PKT)
|
||||
printf("\t\t\t\t\tEXP_RX_CSUM_TCP_UDP_PKT\n");
|
||||
if (caps & IBV_EXP_DEVICE_RX_CSUM_IP_PKT)
|
||||
printf("\t\t\t\t\tEXP_RX_CSUM_IP_PKT\n");
|
||||
if (caps & IBV_EXP_DEVICE_DC_INFO)
|
||||
printf("\t\t\t\t\tEXP_DC_INFO\n");
|
||||
if (caps & IBV_EXP_DEVICE_EXT_MASKED_ATOMICS)
|
||||
printf("\t\t\t\t\tEXP_MASKED_ATOMICS\n");
|
||||
if (caps & IBV_EXP_DEVICE_RX_TCP_UDP_PKT_TYPE)
|
||||
printf("\t\t\t\t\tEXP_RX_TCP_UDP_PKT_TYPE\n");
|
||||
if (caps & IBV_EXP_DEVICE_SCATTER_FCS)
|
||||
printf("\t\t\t\t\tEXP_SCATTER_FCS\n");
|
||||
if (caps & unknown_flags)
|
||||
printf("\t\t\t\t\tUnknown flags: 0x%" PRIX64 "\n", caps & unknown_flags);
|
||||
}
|
||||
|
||||
void print_odp_trans_caps(uint32_t trans)
|
||||
{
|
||||
uint32_t unknown_transport_caps = ~(IBV_EXP_ODP_SUPPORT_SEND |
|
||||
IBV_EXP_ODP_SUPPORT_RECV |
|
||||
IBV_EXP_ODP_SUPPORT_WRITE |
|
||||
IBV_EXP_ODP_SUPPORT_READ |
|
||||
IBV_EXP_ODP_SUPPORT_ATOMIC |
|
||||
IBV_EXP_ODP_SUPPORT_SRQ_RECV);
|
||||
|
||||
if (!trans)
|
||||
printf("\t\t\t\t\tNO SUPPORT\n");
|
||||
else {
|
||||
if (trans & IBV_EXP_ODP_SUPPORT_SEND)
|
||||
printf("\t\t\t\t\tSUPPORT_SEND\n");
|
||||
if (trans & IBV_EXP_ODP_SUPPORT_RECV)
|
||||
printf("\t\t\t\t\tSUPPORT_RECV\n");
|
||||
if (trans & IBV_EXP_ODP_SUPPORT_WRITE)
|
||||
printf("\t\t\t\t\tSUPPORT_WRITE\n");
|
||||
if (trans & IBV_EXP_ODP_SUPPORT_READ)
|
||||
printf("\t\t\t\t\tSUPPORT_READ\n");
|
||||
if (trans & IBV_EXP_ODP_SUPPORT_ATOMIC)
|
||||
printf("\t\t\t\t\tSUPPORT_ATOMIC\n");
|
||||
if (trans & IBV_EXP_ODP_SUPPORT_SRQ_RECV)
|
||||
printf("\t\t\t\t\tSUPPORT_SRQ_RECV\n");
|
||||
if (trans & unknown_transport_caps)
|
||||
printf("\t\t\t\t\tUnkown flags: 0x%" PRIX32 "\n",
|
||||
trans & unknown_transport_caps);
|
||||
}
|
||||
}
|
||||
|
||||
void print_odp_caps(struct ibv_exp_odp_caps caps)
|
||||
{
|
||||
uint64_t unknown_general_caps = ~(IBV_EXP_ODP_SUPPORT);
|
||||
|
||||
/* general odp caps */
|
||||
printf("\tgeneral_odp_caps:\n");
|
||||
if (caps.general_odp_caps & IBV_EXP_ODP_SUPPORT)
|
||||
printf("\t\t\t\t\tODP_SUPPORT\n");
|
||||
if (caps.general_odp_caps & unknown_general_caps)
|
||||
printf("\t\t\t\t\tUnkown flags: 0x%" PRIX64 "\n",
|
||||
caps.general_odp_caps & unknown_general_caps);
|
||||
|
||||
/* RC transport */
|
||||
printf("\trc_odp_caps:\n");
|
||||
print_odp_trans_caps(caps.per_transport_caps.rc_odp_caps);
|
||||
printf("\tuc_odp_caps:\n");
|
||||
print_odp_trans_caps(caps.per_transport_caps.uc_odp_caps);
|
||||
printf("\tud_odp_caps:\n");
|
||||
print_odp_trans_caps(caps.per_transport_caps.ud_odp_caps);
|
||||
printf("\tdc_odp_caps:\n");
|
||||
print_odp_trans_caps(caps.per_transport_caps.dc_odp_caps);
|
||||
printf("\txrc_odp_caps:\n");
|
||||
print_odp_trans_caps(caps.per_transport_caps.xrc_odp_caps);
|
||||
printf("\traw_eth_odp_caps:\n");
|
||||
print_odp_trans_caps(caps.per_transport_caps.raw_eth_odp_caps);
|
||||
}
|
||||
|
||||
static char *qp_type_flag_str(enum ibv_exp_supported_qp_types qp_type_flag)
|
||||
{
|
||||
switch (qp_type_flag) {
|
||||
case IBV_EXP_QPT_RC: return "RC";
|
||||
case IBV_EXP_QPT_UC: return "UC";
|
||||
case IBV_EXP_QPT_UD: return "UD";
|
||||
case IBV_EXP_QPT_XRC_INIT: return "XRC_INIT";
|
||||
case IBV_EXP_QPT_XRC_TGT: return "XRC_TGT";
|
||||
case IBV_EXP_QPT_RAW_PACKET: return "RAW_PACKET";
|
||||
default: return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
static void print_tso_caps(const struct ibv_exp_tso_caps *caps)
|
||||
{
|
||||
uint32_t unknown_general_caps = ~(1 << IBV_QPT_RAW_PACKET |
|
||||
1 << IBV_QPT_UD);
|
||||
printf("\ttso_caps:\n");
|
||||
printf("\tmax_tso:\t\t\t%d\n", caps->max_tso);
|
||||
|
||||
if (caps->max_tso) {
|
||||
printf("\tsupported_qp:\n");
|
||||
if (ibv_is_qpt_supported(caps->supported_qpts, IBV_QPT_RAW_PACKET))
|
||||
printf("\t\t\t\t\tSUPPORT_RAW_PACKET\n");
|
||||
if (ibv_is_qpt_supported(caps->supported_qpts, IBV_QPT_UD))
|
||||
printf("\t\t\t\t\tSUPPORT_UD\n");
|
||||
if (caps->supported_qpts & unknown_general_caps)
|
||||
printf("\t\t\t\t\tUnknown flags: 0x%" PRIX32 "\n",
|
||||
caps->supported_qpts & unknown_general_caps);
|
||||
}
|
||||
}
|
||||
|
||||
void print_packet_pacing_caps(const struct ibv_exp_packet_pacing_caps *caps)
|
||||
{
|
||||
uint32_t unknown_general_caps = ~(1 << IBV_QPT_RAW_PACKET |
|
||||
1 << IBV_QPT_UD);
|
||||
printf("\tpacket_pacing_caps:\n");
|
||||
printf("\tqp_rate_limit_min:\t\t%dkbps\n", caps->qp_rate_limit_min);
|
||||
printf("\tqp_rate_limit_max:\t\t%dkbps\n", caps->qp_rate_limit_max);
|
||||
|
||||
if (caps->qp_rate_limit_max) {
|
||||
printf("\tsupported_qp:\n");
|
||||
if (ibv_is_qpt_supported(caps->supported_qpts, IBV_QPT_RAW_PACKET))
|
||||
printf("\t\t\t\t\tSUPPORT_RAW_PACKET\n");
|
||||
if (ibv_is_qpt_supported(caps->supported_qpts, IBV_QPT_UD))
|
||||
printf("\t\t\t\t\tSUPPORT_UD\n");
|
||||
if (caps->supported_qpts & unknown_general_caps)
|
||||
printf("\t\t\t\t\tUnknown flags: 0x%" PRIX32 "\n",
|
||||
caps->supported_qpts & unknown_general_caps);
|
||||
}
|
||||
}
|
||||
|
||||
static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
|
||||
{
|
||||
struct ibv_context *ctx;
|
||||
struct ibv_exp_device_attr device_attr;
|
||||
struct ibv_device_attr device_legacy_attr;
|
||||
struct ibv_port_attr port_attr;
|
||||
int rc = 0;
|
||||
uint8_t port;
|
||||
char buf[256];
|
||||
|
||||
ctx = ibv_open_device(ib_dev);
|
||||
if (!ctx) {
|
||||
fprintf(stderr, "Failed to open device\n");
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
memset(&device_attr, 0, sizeof(device_attr));
|
||||
device_attr.comp_mask = IBV_EXP_DEVICE_ATTR_RESERVED - 1;
|
||||
|
||||
if (ibv_exp_query_device(ctx, &device_attr)) {
|
||||
if (ibv_query_device(ctx, &device_legacy_attr)) {
|
||||
fprintf(stderr, "Failed to query device props\n");
|
||||
rc = 2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
memcpy(&device_attr, &device_legacy_attr, sizeof(device_legacy_attr));
|
||||
}
|
||||
|
||||
printf("hca_id:\t%s\n", ibv_get_device_name(ib_dev));
|
||||
printf("\ttransport:\t\t\t%s (%d)\n",
|
||||
transport_str(ib_dev->transport_type), ib_dev->transport_type);
|
||||
if (strlen(device_attr.fw_ver))
|
||||
printf("\tfw_ver:\t\t\t\t%s\n", device_attr.fw_ver);
|
||||
printf("\tnode_guid:\t\t\t%s\n", guid_str(device_attr.node_guid, buf));
|
||||
printf("\tsys_image_guid:\t\t\t%s\n", guid_str(device_attr.sys_image_guid, buf));
|
||||
printf("\tvendor_id:\t\t\t0x%04x\n", device_attr.vendor_id);
|
||||
printf("\tvendor_part_id:\t\t\t%d\n", device_attr.vendor_part_id);
|
||||
printf("\thw_ver:\t\t\t\t0x%X\n", device_attr.hw_ver);
|
||||
|
||||
if (ibv_read_sysfs_file(ib_dev->ibdev_path, "board_id", buf, sizeof buf) > 0)
|
||||
printf("\tboard_id:\t\t\t%s\n", buf);
|
||||
|
||||
printf("\tphys_port_cnt:\t\t\t%d\n", device_attr.phys_port_cnt);
|
||||
|
||||
if (verbose) {
|
||||
printf("\tmax_mr_size:\t\t\t0x%llx\n",
|
||||
(unsigned long long) device_attr.max_mr_size);
|
||||
printf("\tpage_size_cap:\t\t\t0x%llx\n",
|
||||
(unsigned long long) device_attr.page_size_cap);
|
||||
printf("\tmax_qp:\t\t\t\t%d\n", device_attr.max_qp);
|
||||
printf("\tmax_qp_wr:\t\t\t%d\n", device_attr.max_qp_wr);
|
||||
printf("\tdevice_cap_flags:\t\t0x%08x\n",
|
||||
(int)(device_attr.exp_device_cap_flags & (IBV_EXP_START_FLAG - 1)));
|
||||
print_caps(device_attr.exp_device_cap_flags & (IBV_EXP_START_FLAG - 1));
|
||||
printf("\tdevice_cap_exp_flags:\t\t0x%" PRIX64 "\n",
|
||||
device_attr.exp_device_cap_flags & ~(IBV_EXP_START_FLAG - 1));
|
||||
print_caps_exp(device_attr.exp_device_cap_flags & ~(IBV_EXP_START_FLAG - 1));
|
||||
printf("\tmax_sge:\t\t\t%d\n", device_attr.max_sge);
|
||||
printf("\tmax_sge_rd:\t\t\t%d\n", device_attr.max_sge_rd);
|
||||
printf("\tmax_cq:\t\t\t\t%d\n", device_attr.max_cq);
|
||||
printf("\tmax_cqe:\t\t\t%d\n", device_attr.max_cqe);
|
||||
printf("\tmax_mr:\t\t\t\t%d\n", device_attr.max_mr);
|
||||
printf("\tmax_pd:\t\t\t\t%d\n", device_attr.max_pd);
|
||||
printf("\tmax_qp_rd_atom:\t\t\t%d\n", device_attr.max_qp_rd_atom);
|
||||
printf("\tmax_ee_rd_atom:\t\t\t%d\n", device_attr.max_ee_rd_atom);
|
||||
printf("\tmax_res_rd_atom:\t\t%d\n", device_attr.max_res_rd_atom);
|
||||
printf("\tmax_qp_init_rd_atom:\t\t%d\n", device_attr.max_qp_init_rd_atom);
|
||||
printf("\tmax_ee_init_rd_atom:\t\t%d\n", device_attr.max_ee_init_rd_atom);
|
||||
printf("\tatomic_cap:\t\t\t%s (%d)\n",
|
||||
exp_atomic_cap_str(device_attr.exp_atomic_cap),
|
||||
device_attr.exp_atomic_cap);
|
||||
printf("\tlog atomic arg sizes (mask)\t\t0x%" PRIx64 "\n", device_attr.ext_atom.log_atomic_arg_sizes);
|
||||
printf("\tmasked_log_atomic_arg_sizes (mask)\t0x%" PRIx64 "\n", device_attr.masked_atomic.masked_log_atomic_arg_sizes);
|
||||
printf("\tmasked_log_atomic_arg_sizes_network_endianness (mask)\t0x%" PRIx64 "\n",
|
||||
device_attr.masked_atomic.masked_log_atomic_arg_sizes_network_endianness);
|
||||
printf("\tmax fetch and add bit boundary\t%d\n", device_attr.masked_atomic.max_fa_bit_boundary);
|
||||
printf("\tlog max atomic inline\t\t%d\n", device_attr.masked_atomic.log_max_atomic_inline);
|
||||
printf("\tmax_ee:\t\t\t\t%d\n", device_attr.max_ee);
|
||||
printf("\tmax_rdd:\t\t\t%d\n", device_attr.max_rdd);
|
||||
printf("\tmax_mw:\t\t\t\t%d\n", device_attr.max_mw);
|
||||
printf("\tmax_raw_ipv6_qp:\t\t%d\n", device_attr.max_raw_ipv6_qp);
|
||||
printf("\tmax_raw_ethy_qp:\t\t%d\n", device_attr.max_raw_ethy_qp);
|
||||
printf("\tmax_mcast_grp:\t\t\t%d\n", device_attr.max_mcast_grp);
|
||||
printf("\tmax_mcast_qp_attach:\t\t%d\n", device_attr.max_mcast_qp_attach);
|
||||
printf("\tmax_total_mcast_qp_attach:\t%d\n",
|
||||
device_attr.max_total_mcast_qp_attach);
|
||||
printf("\tmax_ah:\t\t\t\t%d\n", device_attr.max_ah);
|
||||
printf("\tmax_fmr:\t\t\t%d\n", device_attr.max_fmr);
|
||||
if (device_attr.max_fmr)
|
||||
printf("\tmax_map_per_fmr:\t\t%d\n", device_attr.max_map_per_fmr);
|
||||
printf("\tmax_srq:\t\t\t%d\n", device_attr.max_srq);
|
||||
if (device_attr.max_srq) {
|
||||
printf("\tmax_srq_wr:\t\t\t%d\n", device_attr.max_srq_wr);
|
||||
printf("\tmax_srq_sge:\t\t\t%d\n", device_attr.max_srq_sge);
|
||||
}
|
||||
printf("\tmax_pkeys:\t\t\t%d\n", device_attr.max_pkeys);
|
||||
printf("\tlocal_ca_ack_delay:\t\t%d\n", device_attr.local_ca_ack_delay);
|
||||
printf("\thca_core_clock:\t\t\t%" PRIu64 "\n",
|
||||
device_attr.hca_core_clock);
|
||||
printf("\tmax_klm_list_size:\t\t%d\n", device_attr.umr_caps.max_klm_list_size);
|
||||
printf("\tmax_send_wqe_inline_klms:\t%d\n", device_attr.umr_caps.max_send_wqe_inline_klms);
|
||||
printf("\tmax_umr_recursion_depth:\t%d\n", device_attr.umr_caps.max_umr_recursion_depth);
|
||||
printf("\tmax_umr_stride_dimension:\t%d\n", device_attr.umr_caps.max_umr_stride_dimension);
|
||||
print_odp_caps(device_attr.odp_caps);
|
||||
printf("\tmax_dct:\t\t\t%d\n", device_attr.max_dct);
|
||||
printf("\tmax_device_ctx:\t\t\t%d\n", device_attr.max_device_ctx);
|
||||
if ((device_attr.comp_mask & IBV_EXP_DEVICE_ATTR_MP_RQ) &&
|
||||
device_attr.mp_rq_caps.supported_qps) {
|
||||
enum ibv_exp_supported_qp_types qp_type_flag = IBV_EXP_QPT_RC;
|
||||
uint32_t unknown_shifts_flags = device_attr.mp_rq_caps.allowed_shifts &
|
||||
~IBV_EXP_MP_RQ_2BYTES_SHIFT;
|
||||
|
||||
printf("\tMulti-Packet RQ supported\n");
|
||||
printf("\t\tSupported for QP types: ");
|
||||
while (qp_type_flag < IBV_EXP_QPT_RESERVED) {
|
||||
if (device_attr.mp_rq_caps.supported_qps & qp_type_flag)
|
||||
printf("%s ", qp_type_flag_str(qp_type_flag));
|
||||
qp_type_flag <<= 1;
|
||||
}
|
||||
printf("\n");
|
||||
printf("\t\tSupported payload shifts:\n");
|
||||
if (device_attr.mp_rq_caps.allowed_shifts & IBV_EXP_MP_RQ_2BYTES_SHIFT)
|
||||
printf("\t\t\t2 bytes\n");
|
||||
if (unknown_shifts_flags)
|
||||
printf("\t\t\tUnknown payload shift flags (0x%x)\n", unknown_shifts_flags);
|
||||
printf("\t\tLog number of strides for single WQE: %d - %d\n",
|
||||
device_attr.mp_rq_caps.min_single_wqe_log_num_of_strides,
|
||||
device_attr.mp_rq_caps.max_single_wqe_log_num_of_strides);
|
||||
printf("\t\tLog number of bytes in single stride: %d - %d\n",
|
||||
device_attr.mp_rq_caps.min_single_stride_log_num_of_bytes,
|
||||
device_attr.mp_rq_caps.max_single_stride_log_num_of_bytes);
|
||||
} else {
|
||||
printf("\tMulti-Packet RQ is not supported\n");
|
||||
}
|
||||
if (device_attr.comp_mask & IBV_EXP_DEVICE_ATTR_VLAN_OFFLOADS) {
|
||||
uint32_t unknown_vlan_caps;
|
||||
printf("\n\tVLAN offloads caps:\n");
|
||||
if (device_attr.wq_vlan_offloads_cap &
|
||||
IBV_EXP_RECEIVE_WQ_CVLAN_STRIP)
|
||||
printf("\t\t\t\t\tC-VLAN stripping offload\n");
|
||||
if (device_attr.wq_vlan_offloads_cap &
|
||||
IBV_EXP_RECEIVE_WQ_CVLAN_INSERTION)
|
||||
printf("\t\t\t\t\tC-VLAN insertion offload\n");
|
||||
unknown_vlan_caps = device_attr.wq_vlan_offloads_cap &
|
||||
~(IBV_EXP_RECEIVE_WQ_CVLAN_STRIP |
|
||||
IBV_EXP_RECEIVE_WQ_CVLAN_INSERTION);
|
||||
if (unknown_vlan_caps)
|
||||
printf("\tVLAN offloads unknown caps:\t\t0x%x\n",
|
||||
unknown_vlan_caps);
|
||||
}
|
||||
printf("\trx_pad_end_addr_align:\t%d\n", device_attr.rx_pad_end_addr_align);
|
||||
print_tso_caps(&device_attr.tso_caps);
|
||||
print_packet_pacing_caps(&device_attr.packet_pacing_caps);
|
||||
}
|
||||
|
||||
if (device_attr.phys_port_cnt)
|
||||
printf("\tDevice ports:\n");
|
||||
for (port = 1; port <= device_attr.phys_port_cnt; ++port) {
|
||||
/* if in the command line the user didn't ask for info about this port */
|
||||
if ((ib_port) && (port != ib_port))
|
||||
continue;
|
||||
|
||||
rc = ibv_query_port(ctx, port, &port_attr);
|
||||
if (rc) {
|
||||
fprintf(stderr, "Failed to query port %u props\n", port);
|
||||
goto cleanup;
|
||||
}
|
||||
printf("\t\tport:\t%d\n", port);
|
||||
printf("\t\t\tstate:\t\t\t%s (%d)\n",
|
||||
port_state_str(port_attr.state), port_attr.state);
|
||||
printf("\t\t\tmax_mtu:\t\t%s (%d)\n",
|
||||
mtu_str(port_attr.max_mtu), port_attr.max_mtu);
|
||||
printf("\t\t\tactive_mtu:\t\t%s (%d)\n",
|
||||
mtu_str(port_attr.active_mtu), port_attr.active_mtu);
|
||||
printf("\t\t\tsm_lid:\t\t\t%d\n", port_attr.sm_lid);
|
||||
printf("\t\t\tport_lid:\t\t%d\n", port_attr.lid);
|
||||
printf("\t\t\tport_lmc:\t\t0x%02x\n", port_attr.lmc);
|
||||
printf("\t\t\tlink_layer:\t\t%s\n",
|
||||
link_layer_str(port_attr.link_layer));
|
||||
|
||||
if (verbose) {
|
||||
printf("\t\t\tmax_msg_sz:\t\t0x%x\n", port_attr.max_msg_sz);
|
||||
printf("\t\t\tport_cap_flags:\t\t0x%08x\n", port_attr.port_cap_flags);
|
||||
printf("\t\t\tmax_vl_num:\t\t%s (%d)\n",
|
||||
vl_str(port_attr.max_vl_num), port_attr.max_vl_num);
|
||||
printf("\t\t\tbad_pkey_cntr:\t\t0x%x\n", port_attr.bad_pkey_cntr);
|
||||
printf("\t\t\tqkey_viol_cntr:\t\t0x%x\n", port_attr.qkey_viol_cntr);
|
||||
printf("\t\t\tsm_sl:\t\t\t%d\n", port_attr.sm_sl);
|
||||
printf("\t\t\tpkey_tbl_len:\t\t%d\n", port_attr.pkey_tbl_len);
|
||||
printf("\t\t\tgid_tbl_len:\t\t%d\n", port_attr.gid_tbl_len);
|
||||
printf("\t\t\tsubnet_timeout:\t\t%d\n", port_attr.subnet_timeout);
|
||||
printf("\t\t\tinit_type_reply:\t%d\n", port_attr.init_type_reply);
|
||||
printf("\t\t\tactive_width:\t\t%sX (%d)\n",
|
||||
width_str(port_attr.active_width), port_attr.active_width);
|
||||
printf("\t\t\tactive_speed:\t\t%s (%d)\n",
|
||||
speed_str(port_attr.active_speed), port_attr.active_speed);
|
||||
printf("\t\t\tphys_state:\t\t%s (%d)\n",
|
||||
port_phy_state_str(port_attr.phys_state), port_attr.phys_state);
|
||||
|
||||
if (print_all_port_gids(ctx, port, port_attr.gid_tbl_len))
|
||||
goto cleanup;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
cleanup:
|
||||
if (ctx)
|
||||
if (ibv_close_device(ctx)) {
|
||||
fprintf(stderr, "Failed to close device");
|
||||
rc = 3;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage: %s print the ca attributes\n", argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default all devices found)\n");
|
||||
printf(" -i, --ib-port=<port> use port <port> of IB device (default 0: all ports)\n");
|
||||
printf(" -l, --list print only the IB devices names\n");
|
||||
printf(" -v, --verbose print all the attributes of the IB device(s)\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *ib_devname = NULL;
|
||||
int ret = 0;
|
||||
struct ibv_device **dev_list, **orig_dev_list;
|
||||
int num_of_hcas;
|
||||
int ib_port = 0;
|
||||
|
||||
/* parse command line options */
|
||||
while (1) {
|
||||
int c;
|
||||
static struct option long_options[] = {
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "ib-port", .has_arg = 1, .val = 'i' },
|
||||
{ .name = "list", .has_arg = 0, .val = 'l' },
|
||||
{ .name = "verbose", .has_arg = 0, .val = 'v' },
|
||||
{ 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "d:i:lv", long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'd':
|
||||
ib_devname = strdup(optarg);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
ib_port = strtol(optarg, NULL, 0);
|
||||
if (ib_port < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
dev_list = orig_dev_list = ibv_get_device_list(&num_of_hcas);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("%d HCA%s found:\n", num_of_hcas,
|
||||
num_of_hcas != 1 ? "s" : "");
|
||||
|
||||
while (*dev_list) {
|
||||
printf("\t%s\n", ibv_get_device_name(*dev_list));
|
||||
++dev_list;
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
ibv_free_device_list(orig_dev_list);
|
||||
|
||||
return 0;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
dev_list = orig_dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ib_devname) {
|
||||
while (*dev_list) {
|
||||
if (!strcmp(ibv_get_device_name(*dev_list), ib_devname))
|
||||
break;
|
||||
++dev_list;
|
||||
}
|
||||
|
||||
if (!*dev_list) {
|
||||
fprintf(stderr, "IB device '%s' wasn't found\n", ib_devname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret |= print_hca_cap(*dev_list, ib_port);
|
||||
} else {
|
||||
if (!*dev_list) {
|
||||
fprintf(stderr, "No IB devices found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (*dev_list) {
|
||||
ret |= print_hca_cap(*dev_list, ib_port);
|
||||
++dev_list;
|
||||
}
|
||||
}
|
||||
|
||||
if (ib_devname)
|
||||
free(ib_devname);
|
||||
|
||||
ibv_free_device_list(orig_dev_list);
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -1,234 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Author: Michael S. Tsirkin <mst@mellanox.co.il>
|
||||
*/
|
||||
|
||||
/* #define DEBUG 1 */
|
||||
/* #define DEBUG_DATA 1 */
|
||||
/* #define GET_CPU_MHZ_FROM_PROC 1 */
|
||||
|
||||
/* For gettimeofday */
|
||||
#define _DEFAULT_SOURCE
|
||||
#define _BSD_SOURCE
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "get_clock.h"
|
||||
|
||||
#ifndef DEBUG
|
||||
#define DEBUG 0
|
||||
#endif
|
||||
#ifndef DEBUG_DATA
|
||||
#define DEBUG_DATA 0
|
||||
#endif
|
||||
|
||||
#define MEASUREMENTS 200
|
||||
#define USECSTEP 10
|
||||
#define USECSTART 100
|
||||
|
||||
/*
|
||||
Use linear regression to calculate cycles per microsecond.
|
||||
http://en.wikipedia.org/wiki/Linear_regression#Parameter_estimation
|
||||
*/
|
||||
static double sample_get_cpu_mhz(void)
|
||||
{
|
||||
struct timeval tv1, tv2;
|
||||
cycles_t start;
|
||||
double sx = 0, sy = 0, sxx = 0, syy = 0, sxy = 0;
|
||||
double tx, ty;
|
||||
int i;
|
||||
|
||||
/* Regression: y = a + b x */
|
||||
long x[MEASUREMENTS];
|
||||
cycles_t y[MEASUREMENTS];
|
||||
double a; /* system call overhead in cycles */
|
||||
double b; /* cycles per microsecond */
|
||||
double r_2;
|
||||
|
||||
for (i = 0; i < MEASUREMENTS; ++i) {
|
||||
start = get_cycles();
|
||||
|
||||
if (gettimeofday(&tv1, NULL)) {
|
||||
fprintf(stderr, "gettimeofday failed.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
do {
|
||||
if (gettimeofday(&tv2, NULL)) {
|
||||
fprintf(stderr, "gettimeofday failed.\n");
|
||||
return 0;
|
||||
}
|
||||
} while ((tv2.tv_sec - tv1.tv_sec) * 1000000 +
|
||||
(tv2.tv_usec - tv1.tv_usec) < USECSTART + i * USECSTEP);
|
||||
|
||||
x[i] = (tv2.tv_sec - tv1.tv_sec) * 1000000 +
|
||||
tv2.tv_usec - tv1.tv_usec;
|
||||
y[i] = get_cycles() - start;
|
||||
if (DEBUG_DATA)
|
||||
fprintf(stderr, "x=%ld y=%lld\n", x[i], (long long)y[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < MEASUREMENTS; ++i) {
|
||||
tx = x[i];
|
||||
ty = y[i];
|
||||
sx += tx;
|
||||
sy += ty;
|
||||
sxx += tx * tx;
|
||||
syy += ty * ty;
|
||||
sxy += tx * ty;
|
||||
}
|
||||
|
||||
b = (MEASUREMENTS * sxy - sx * sy) / (MEASUREMENTS * sxx - sx * sx);
|
||||
a = (sy - b * sx) / MEASUREMENTS;
|
||||
|
||||
if (DEBUG)
|
||||
fprintf(stderr, "a = %g\n", a);
|
||||
if (DEBUG)
|
||||
fprintf(stderr, "b = %g\n", b);
|
||||
if (DEBUG)
|
||||
fprintf(stderr, "a / b = %g\n", a / b);
|
||||
r_2 = (MEASUREMENTS * sxy - sx * sy) * (MEASUREMENTS * sxy - sx * sy) /
|
||||
(MEASUREMENTS * sxx - sx * sx) /
|
||||
(MEASUREMENTS * syy - sy * sy);
|
||||
|
||||
if (DEBUG)
|
||||
fprintf(stderr, "r^2 = %g\n", r_2);
|
||||
if (r_2 < 0.9) {
|
||||
fprintf(stderr, "Correlation coefficient r^2: %g < 0.9\n", r_2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
#ifndef __s390x__
|
||||
static double proc_get_cpu_mhz(int no_cpu_freq_fail)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[256];
|
||||
double mhz = 0.0;
|
||||
int print_flag = 0;
|
||||
double delta;
|
||||
|
||||
f = fopen("/proc/cpuinfo", "r");
|
||||
if (!f)
|
||||
return 0.0;
|
||||
while (fgets(buf, sizeof(buf), f)) {
|
||||
double m;
|
||||
int rc;
|
||||
|
||||
#if defined(__ia64__)
|
||||
/* Use the ITC frequency on IA64 */
|
||||
rc = sscanf(buf, "itc MHz : %lf", &m);
|
||||
#elif defined(__PPC__) || defined(__PPC64__)
|
||||
/* PPC has a different format as well */
|
||||
rc = sscanf(buf, "clock : %lf", &m);
|
||||
#elif defined(__sparc__) && defined(__arch64__)
|
||||
/*
|
||||
* on sparc the /proc/cpuinfo lines that hold
|
||||
* the cpu freq in HZ are as follow:
|
||||
* Cpu{cpu-num}ClkTck : 00000000a9beeee4
|
||||
*/
|
||||
char *s;
|
||||
unsigned val;
|
||||
|
||||
s = strstr(buf, "ClkTck\t: ");
|
||||
if (!s)
|
||||
continue;
|
||||
s += (strlen("ClkTck\t: ") - strlen("0x"));
|
||||
strncpy(s, "0x", strlen("0x"));
|
||||
rc = sscanf(s, "%x", &val);
|
||||
m = val/1000000;
|
||||
#else
|
||||
rc = sscanf(buf, "cpu MHz : %lf", &m);
|
||||
#endif
|
||||
|
||||
if (rc != 1)
|
||||
continue;
|
||||
|
||||
if (mhz == 0.0) {
|
||||
mhz = m;
|
||||
continue;
|
||||
}
|
||||
delta = mhz > m ? mhz - m : m - mhz;
|
||||
if ((delta / mhz > 0.02) && (print_flag == 0)) {
|
||||
print_flag = 1;
|
||||
fprintf(stderr, "Conflicting CPU frequency values"
|
||||
" detected: %lf != %lf\n", mhz, m);
|
||||
if (no_cpu_freq_fail) {
|
||||
fprintf(stderr, "Test integrity may be harmed !\n");
|
||||
} else {
|
||||
fclose(f);
|
||||
return 0.0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
return mhz;
|
||||
}
|
||||
#endif
|
||||
|
||||
double get_cpu_mhz(int no_cpu_freq_fail)
|
||||
{
|
||||
#ifdef __s390x__
|
||||
return sample_get_cpu_mhz();
|
||||
#else
|
||||
double sample, proc, delta;
|
||||
|
||||
sample = sample_get_cpu_mhz();
|
||||
proc = proc_get_cpu_mhz(no_cpu_freq_fail);
|
||||
#ifdef __aarch64__
|
||||
if (proc < 1)
|
||||
proc = sample;
|
||||
#endif
|
||||
if (!proc || !sample)
|
||||
return 0;
|
||||
|
||||
delta = proc > sample ? proc - sample : sample - proc;
|
||||
if (delta / proc > 0.02) {
|
||||
#if !defined(__PPC__) && !defined(__PPC64__)
|
||||
fprintf(stderr, "Warning: measured timestamp frequency "
|
||||
"%g differs from nominal %g MHz\n",
|
||||
sample, proc);
|
||||
if (!no_cpu_freq_fail)
|
||||
fprintf(stderr, " Add --CPU-freq flag to show report\n");
|
||||
#endif
|
||||
return sample;
|
||||
}
|
||||
return proc;
|
||||
#endif
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Author: Michael S. Tsirkin <mst@mellanox.co.il>
|
||||
*/
|
||||
|
||||
#ifndef GET_CLOCK_H
|
||||
#define GET_CLOCK_H
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
/* Note: only x86 CPUs which have rdtsc instruction are supported. */
|
||||
typedef unsigned long long cycles_t;
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
unsigned low, high;
|
||||
unsigned long long val;
|
||||
|
||||
asm volatile ("rdtsc" : "=a" (low), "=d" (high));
|
||||
val = high;
|
||||
val = (val << 32) | low;
|
||||
return val;
|
||||
}
|
||||
#elif defined(__PPC__) || defined(__PPC64__)
|
||||
/* Note: only PPC CPUs which have mftb instruction are supported. */
|
||||
/* PPC64 has mftb */
|
||||
typedef unsigned long cycles_t;
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
cycles_t ret;
|
||||
|
||||
asm volatile ("mftb %0" : "=r" (ret) : );
|
||||
return ret;
|
||||
}
|
||||
#elif defined(__ia64__)
|
||||
/* Itanium2 and up has ar.itc (Itanium1 has errata) */
|
||||
typedef unsigned long cycles_t;
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
cycles_t ret;
|
||||
|
||||
asm volatile ("mov %0=ar.itc" : "=r" (ret));
|
||||
return ret;
|
||||
}
|
||||
#elif defined(__s390x__)
|
||||
typedef unsigned long long cycles_t;
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
cycles_t clk;
|
||||
|
||||
asm volatile("stck %0" : "=Q" (clk) : : "cc");
|
||||
return clk >> 2;
|
||||
}
|
||||
#elif defined(__sparc__) && defined(__arch64__)
|
||||
typedef unsigned long long cycles_t;
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
cycles_t v;
|
||||
|
||||
asm volatile ("rd %%tick, %0" : "=r" (v) : );
|
||||
return v;
|
||||
}
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
typedef unsigned long cycles_t;
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
cycles_t cval;
|
||||
|
||||
asm volatile("isb" : : : "memory");
|
||||
asm volatile("mrs %0, cntvct_el0" : "=r" (cval));
|
||||
return cval;
|
||||
}
|
||||
|
||||
#else
|
||||
#warning get_cycles not implemented for this architecture: attempt asm/timex.h
|
||||
#include <asm/timex.h>
|
||||
#endif
|
||||
|
||||
extern double get_cpu_mhz(int);
|
||||
|
||||
#endif
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Cisco Systems. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pingpong.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
enum ibv_mtu pp_mtu_to_enum(int mtu)
|
||||
{
|
||||
switch (mtu) {
|
||||
case 256: return IBV_MTU_256;
|
||||
case 512: return IBV_MTU_512;
|
||||
case 1024: return IBV_MTU_1024;
|
||||
case 2048: return IBV_MTU_2048;
|
||||
case 4096: return IBV_MTU_4096;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t pp_get_local_lid(struct ibv_context *context, int port)
|
||||
{
|
||||
struct ibv_port_attr attr;
|
||||
|
||||
if (ibv_query_port(context, port, &attr))
|
||||
return 0;
|
||||
|
||||
return attr.lid;
|
||||
}
|
||||
|
||||
int pp_get_port_info(struct ibv_context *context, int port,
|
||||
struct ibv_port_attr *attr)
|
||||
{
|
||||
return ibv_query_port(context, port, attr);
|
||||
}
|
||||
|
||||
void wire_gid_to_gid(const char *wgid, union ibv_gid *gid)
|
||||
{
|
||||
char tmp[9];
|
||||
uint32_t v32;
|
||||
uint32_t *raw = (uint32_t *)gid->raw;
|
||||
int i;
|
||||
|
||||
for (tmp[8] = 0, i = 0; i < 4; ++i) {
|
||||
memcpy(tmp, wgid + i * 8, 8);
|
||||
sscanf(tmp, "%x", &v32);
|
||||
raw[i] = ntohl(v32);
|
||||
}
|
||||
}
|
||||
|
||||
void gid_to_wire_gid(const union ibv_gid *gid, char wgid[])
|
||||
{
|
||||
int i;
|
||||
uint32_t *raw = (uint32_t *)gid->raw;
|
||||
|
||||
for (i = 0; i < 4; ++i)
|
||||
sprintf(&wgid[i * 8], "%08x",
|
||||
htonl(raw[i]));
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Cisco Systems. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef IBV_PINGPONG_H
|
||||
#define IBV_PINGPONG_H
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
#include <infiniband/verbs_exp.h>
|
||||
|
||||
enum ibv_mtu pp_mtu_to_enum(int mtu);
|
||||
uint16_t pp_get_local_lid(struct ibv_context *context, int port);
|
||||
int pp_get_port_info(struct ibv_context *context, int port,
|
||||
struct ibv_port_attr *attr);
|
||||
void wire_gid_to_gid(const char *wgid, union ibv_gid *gid);
|
||||
void gid_to_wire_gid(const union ibv_gid *gid, char wgid[]);
|
||||
|
||||
#endif /* IBV_PINGPONG_H */
|
|
@ -1,162 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <infiniband/verbs.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
#include <malloc.h>
|
||||
#include <getopt.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <time.h>
|
||||
#include "dc.h"
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s\n", argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default first device found)\n");
|
||||
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
struct ibv_device *ib_dev;
|
||||
char *ib_devname = NULL;
|
||||
int ib_port = 1;
|
||||
struct ibv_context *ctx;
|
||||
int n;
|
||||
struct ibv_exp_dc_info_ent ents[2];
|
||||
int i;
|
||||
int j;
|
||||
|
||||
srand48(getpid() * time(NULL));
|
||||
|
||||
while (1) {
|
||||
int c;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "ib-port", .has_arg = 1, .val = 'i' },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "d:i:",
|
||||
long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'd':
|
||||
ib_devname = strdupa(optarg);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
ib_port = strtol(optarg, NULL, 0);
|
||||
if (ib_port < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < argc) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ib_devname) {
|
||||
ib_dev = *dev_list;
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "No IB devices found\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
|
||||
for (i = 0; dev_list[i]; ++i)
|
||||
if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
|
||||
break;
|
||||
|
||||
ib_dev = dev_list[i];
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "IB device %s not found\n", ib_devname);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx = ibv_open_device(ib_dev);
|
||||
if (!ctx) {
|
||||
fprintf(stderr, "Couldn't get context for %s\n",
|
||||
ibv_get_device_name(ib_dev));
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
n = ibv_exp_poll_dc_info(ctx, ents, 2, ib_port);
|
||||
if (n < 0) {
|
||||
printf("error polling dc info, aborting\n");
|
||||
return -1;
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
printf("=== sqeuence number 0x%08x\n", ents[i].seqnum);
|
||||
for (j = 0; j < 30; j++)
|
||||
printf("lid[%d] = 0x%04x\n", j, ents[i].lid[j]);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,546 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2012 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
#include <malloc.h>
|
||||
#include <getopt.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <infiniband/verbs.h>
|
||||
|
||||
#define DATA_BYTE_VALUE 0x7b
|
||||
|
||||
static int page_size;
|
||||
static char *servername;
|
||||
static int no_rdma;
|
||||
|
||||
struct shared_mr_context {
|
||||
struct ibv_context *context;
|
||||
struct ibv_pd *pd;
|
||||
struct ibv_mr *mr;
|
||||
void *buf;
|
||||
size_t size;
|
||||
int sockfd;
|
||||
};
|
||||
|
||||
struct shared_mr_info {
|
||||
uint32_t mr_handle;
|
||||
};
|
||||
|
||||
static inline unsigned long align(unsigned long val, unsigned long align)
|
||||
{
|
||||
return (val + align - 1) & ~(align - 1);
|
||||
}
|
||||
|
||||
static struct shared_mr_info *shared_mr_client_exch_info(
|
||||
struct shared_mr_context *ctx,
|
||||
int port)
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof "0000"];
|
||||
int n;
|
||||
int sockfd = -1;
|
||||
struct shared_mr_info *rem_shared_mr_info = NULL;
|
||||
|
||||
if (asprintf(&service, "%d", port) < 0)
|
||||
return NULL;
|
||||
|
||||
n = getaddrinfo(servername, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername,
|
||||
port);
|
||||
free(service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't connect to %s:%d\n",
|
||||
servername, port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (read(sockfd, msg, sizeof msg) != sizeof msg) {
|
||||
perror("client read");
|
||||
fprintf(stderr, "Couldn't read shared mr ID\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
rem_shared_mr_info = malloc(sizeof *rem_shared_mr_info);
|
||||
if (!rem_shared_mr_info)
|
||||
goto out;
|
||||
|
||||
sscanf(msg, "%x", &rem_shared_mr_info->mr_handle);
|
||||
ctx->sockfd = sockfd;
|
||||
return rem_shared_mr_info;
|
||||
|
||||
out:
|
||||
close(sockfd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int shared_mr_server_exch_info(struct shared_mr_context *ctx,
|
||||
int port,
|
||||
const struct shared_mr_info *shared_mr_info)
|
||||
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_PASSIVE,
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof "0000"];
|
||||
int n;
|
||||
int sockfd = -1, connfd;
|
||||
|
||||
if (asprintf(&service, "%d", port) < 0)
|
||||
return 1;
|
||||
|
||||
n = getaddrinfo(NULL, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
|
||||
free(service);
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
n = 1;
|
||||
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR,
|
||||
&n, sizeof n);
|
||||
|
||||
if (!bind(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't listen to port %d\n", port);
|
||||
return 1;
|
||||
}
|
||||
|
||||
listen(sockfd, 1);
|
||||
connfd = accept(sockfd, NULL, 0);
|
||||
close(sockfd);
|
||||
if (connfd < 0) {
|
||||
fprintf(stderr, "accept() failed\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
sprintf(msg, "%04x", shared_mr_info->mr_handle);
|
||||
if (write(connfd, msg, sizeof msg) != sizeof msg) {
|
||||
fprintf(stderr, "Couldn't send shared mr ID\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ctx->sockfd = connfd;
|
||||
return 0;
|
||||
|
||||
|
||||
out:
|
||||
close(connfd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* write some data on all buffer than send len to server */
|
||||
static int shared_mr_client_write(struct shared_mr_context *ctx)
|
||||
{
|
||||
|
||||
memset(ctx->buf, DATA_BYTE_VALUE, ctx->size);
|
||||
if (write(ctx->sockfd, (char *)(&(ctx->size)), sizeof(ctx->size)) !=
|
||||
sizeof(ctx->size))
|
||||
return 1;
|
||||
fprintf(stderr, "shared_mr_client_write has succeeded\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int shared_mr_server_read(struct shared_mr_context *ctx)
|
||||
{
|
||||
char msg[sizeof(ctx->size)];
|
||||
size_t len;
|
||||
int i;
|
||||
char *data_buf;
|
||||
if (read(ctx->sockfd, msg, sizeof msg) != sizeof msg) {
|
||||
perror("server read");
|
||||
fprintf(stderr, "Couldn't read data len\n");
|
||||
return 1;
|
||||
}
|
||||
memcpy(&len, msg, sizeof len);
|
||||
if (ctx->size != len) {
|
||||
fprintf(stderr, "read data len missmatch (%zu,%zu)\n",
|
||||
len, ctx->size);
|
||||
return 1;
|
||||
}
|
||||
|
||||
data_buf = ctx->buf;
|
||||
for (i = 0; i < len; i++) {
|
||||
if (data_buf[i] != DATA_BYTE_VALUE) {
|
||||
fprintf(stderr, "data mismatch, offset=%d\n", i);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "server - data match\n");
|
||||
return 0;
|
||||
}
|
||||
static int register_shared_mr(struct shared_mr_context *ctx,
|
||||
struct shared_mr_info *shared_mr_info)
|
||||
{
|
||||
struct ibv_mr *shared_mr;
|
||||
uint64_t access = IBV_EXP_ACCESS_LOCAL_WRITE;
|
||||
struct ibv_exp_reg_shared_mr_in shared_mr_in;
|
||||
|
||||
memset(&shared_mr_in, 0, sizeof(shared_mr_in));
|
||||
shared_mr_in.mr_handle = shared_mr_info->mr_handle;
|
||||
shared_mr_in.pd = ctx->pd;
|
||||
/* shared_mr_in.addr is NULL as part of memset */
|
||||
|
||||
if (no_rdma)
|
||||
access |= IBV_EXP_ACCESS_NO_RDMA;
|
||||
|
||||
shared_mr_in.exp_access = access;
|
||||
shared_mr = ibv_exp_reg_shared_mr(&shared_mr_in);
|
||||
if (!shared_mr) {
|
||||
fprintf(stderr, "Failed via reg shared mr errno=%d\n", errno);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "client registered successfully to shared mr %s\n",
|
||||
no_rdma ? "(non rdma)" : "");
|
||||
|
||||
ctx->mr = shared_mr;
|
||||
ctx->buf = shared_mr->addr;
|
||||
ctx->size = shared_mr->length;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int create_shared_mr(struct shared_mr_context *ctx,
|
||||
struct shared_mr_info *shared_mr_info)
|
||||
{
|
||||
|
||||
struct ibv_exp_reg_mr_in in;
|
||||
|
||||
in.pd = ctx->pd;
|
||||
in.addr = ctx->buf;
|
||||
in.length = ctx->size;
|
||||
in.exp_access = IBV_EXP_ACCESS_LOCAL_WRITE |
|
||||
IBV_EXP_ACCESS_SHARED_MR_USER_WRITE |
|
||||
IBV_EXP_ACCESS_SHARED_MR_USER_READ;
|
||||
if (ctx->buf) {
|
||||
in.comp_mask = IBV_EXP_REG_MR_CREATE_FLAGS;
|
||||
in.create_flags = IBV_EXP_REG_MR_CREATE_CONTIG;
|
||||
} else {
|
||||
in.exp_access |= IBV_EXP_ACCESS_ALLOCATE_MR;
|
||||
in.comp_mask = 0;
|
||||
}
|
||||
|
||||
ctx->mr = ibv_exp_reg_mr(&in);
|
||||
|
||||
if (!ctx->mr) {
|
||||
fprintf(stderr, "Couldn't register MR\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx->buf = ctx->mr->addr;
|
||||
shared_mr_info->mr_handle = ctx->mr->handle;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct shared_mr_context *shared_mr_init_ctx(struct ibv_device *ib_dev,
|
||||
size_t size, void *contig_addr)
|
||||
{
|
||||
struct shared_mr_context *ctx;
|
||||
|
||||
ctx = calloc(1, sizeof *ctx);
|
||||
if (!ctx)
|
||||
return NULL;
|
||||
|
||||
ctx->size = size;
|
||||
ctx->buf = contig_addr;
|
||||
|
||||
ctx->context = ibv_open_device(ib_dev);
|
||||
if (!ctx->context) {
|
||||
fprintf(stderr, "Couldn't get context for %s\n",
|
||||
ibv_get_device_name(ib_dev));
|
||||
goto clean_ctx;
|
||||
}
|
||||
|
||||
ctx->pd = ibv_alloc_pd(ctx->context);
|
||||
if (!ctx->pd) {
|
||||
fprintf(stderr, "Couldn't allocate PD\n");
|
||||
goto clean_device;
|
||||
}
|
||||
|
||||
return ctx;
|
||||
|
||||
clean_device:
|
||||
ibv_close_device(ctx->context);
|
||||
|
||||
clean_ctx:
|
||||
free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int shared_mr_close_ctx(struct shared_mr_context *ctx)
|
||||
{
|
||||
|
||||
if (ctx->mr) {
|
||||
if (ibv_dereg_mr(ctx->mr)) {
|
||||
fprintf(stderr, "Couldn't deregister MR\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->pd) {
|
||||
if (ibv_dealloc_pd(ctx->pd)) {
|
||||
fprintf(stderr, "Couldn't deallocate PD\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ibv_close_device(ctx->context)) {
|
||||
fprintf(stderr, "Couldn't release context\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ctx->sockfd)
|
||||
close(ctx->sockfd);
|
||||
|
||||
free(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s start a server and wait for connection\n",
|
||||
argv0);
|
||||
printf(" %s <host> connect to server at <host>\n",
|
||||
argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default first device found)\n");
|
||||
printf(" -s, --size=<size> size of message to exchange (default 4096)\n");
|
||||
printf(" -n, --no-rdma no rdma on shared mr\n");
|
||||
printf(" -a, --contig_addr ask for specific contiguous addr\n");
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
struct ibv_device *ib_dev;
|
||||
struct shared_mr_context *ctx;
|
||||
struct shared_mr_info shared_mr_info;
|
||||
struct shared_mr_info *rem_shared_mr_info = NULL;
|
||||
char *ib_devname = NULL;
|
||||
int port = 18515;
|
||||
size_t size = 4096;
|
||||
int rc = 0;
|
||||
void *contig_addr = NULL;
|
||||
|
||||
|
||||
while (1) {
|
||||
int c;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{ .name = "port", .has_arg = 1, .val = 'p' },
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "size", .has_arg = 1, .val = 's' },
|
||||
{ .name = "no-rdma", .has_arg = 0, .val = 'n' },
|
||||
{ .name = "contig_addr", .has_arg = 1, .val = 'a' },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "p:d:s:na:", long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'p':
|
||||
port = strtol(optarg, NULL, 0);
|
||||
if (port < 0 || port > 65535) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
ib_devname = strdup(optarg);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
size = strtoull(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
++no_rdma;
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
contig_addr = (void *)(uintptr_t)strtoull(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind == argc - 1)
|
||||
servername = strdup(argv[optind]);
|
||||
else if (optind < argc) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
page_size = sysconf(_SC_PAGESIZE);
|
||||
size = align(size, page_size);
|
||||
|
||||
dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ib_devname) {
|
||||
ib_dev = *dev_list;
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "No IB devices found\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; dev_list[i]; ++i)
|
||||
if (!strcmp(ibv_get_device_name(dev_list[i]),
|
||||
ib_devname))
|
||||
break;
|
||||
ib_dev = dev_list[i];
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "IB device %s not found\n", ib_devname);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx = shared_mr_init_ctx(ib_dev, size, contig_addr);
|
||||
if (!ctx)
|
||||
return 1;
|
||||
|
||||
if (servername) {
|
||||
rem_shared_mr_info = shared_mr_client_exch_info(ctx, port);
|
||||
if (!rem_shared_mr_info) {
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (register_shared_mr(ctx, rem_shared_mr_info)) {
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (shared_mr_client_write(ctx)) {
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
|
||||
}
|
||||
} else {
|
||||
if (create_shared_mr(ctx, &shared_mr_info)) {
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
if (shared_mr_server_exch_info(ctx, port, &shared_mr_info)) {
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
if (shared_mr_server_read(ctx)) {
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cleanup:
|
||||
|
||||
if (shared_mr_close_ctx(ctx))
|
||||
return 1;
|
||||
|
||||
ibv_free_device_list(dev_list);
|
||||
if (rem_shared_mr_info)
|
||||
free(rem_shared_mr_info);
|
||||
|
||||
return rc;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,859 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
#include <malloc.h>
|
||||
#include <getopt.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "pingpong.h"
|
||||
|
||||
enum {
|
||||
PINGPONG_RECV_WRID = 1,
|
||||
PINGPONG_SEND_WRID = 2,
|
||||
};
|
||||
|
||||
static int page_size;
|
||||
|
||||
struct pingpong_context {
|
||||
struct ibv_context *context;
|
||||
struct ibv_comp_channel *channel;
|
||||
struct ibv_pd *pd;
|
||||
struct ibv_mr *mr;
|
||||
struct ibv_cq *cq;
|
||||
struct ibv_qp *qp;
|
||||
void *buf;
|
||||
int size;
|
||||
int rx_depth;
|
||||
int pending;
|
||||
struct ibv_port_attr portinfo;
|
||||
};
|
||||
|
||||
struct pingpong_dest {
|
||||
int lid;
|
||||
int qpn;
|
||||
int psn;
|
||||
union ibv_gid gid;
|
||||
};
|
||||
|
||||
static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
|
||||
enum ibv_mtu mtu, int sl,
|
||||
struct pingpong_dest *dest, int sgid_idx)
|
||||
{
|
||||
struct ibv_qp_attr attr = {
|
||||
.qp_state = IBV_QPS_RTR,
|
||||
.path_mtu = mtu,
|
||||
.dest_qp_num = dest->qpn,
|
||||
.rq_psn = dest->psn,
|
||||
.ah_attr = {
|
||||
.is_global = 0,
|
||||
.dlid = dest->lid,
|
||||
.sl = sl,
|
||||
.src_path_bits = 0,
|
||||
.port_num = port
|
||||
}
|
||||
};
|
||||
|
||||
if (dest->gid.global.interface_id) {
|
||||
attr.ah_attr.is_global = 1;
|
||||
attr.ah_attr.grh.hop_limit = 1;
|
||||
attr.ah_attr.grh.dgid = dest->gid;
|
||||
attr.ah_attr.grh.sgid_index = sgid_idx;
|
||||
}
|
||||
if (ibv_modify_qp(ctx->qp, &attr,
|
||||
IBV_QP_STATE |
|
||||
IBV_QP_AV |
|
||||
IBV_QP_PATH_MTU |
|
||||
IBV_QP_DEST_QPN |
|
||||
IBV_QP_RQ_PSN)) {
|
||||
fprintf(stderr, "Failed to modify QP to RTR\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
attr.qp_state = IBV_QPS_RTS;
|
||||
attr.sq_psn = my_psn;
|
||||
if (ibv_modify_qp(ctx->qp, &attr,
|
||||
IBV_QP_STATE |
|
||||
IBV_QP_SQ_PSN)) {
|
||||
fprintf(stderr, "Failed to modify QP to RTS\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct pingpong_dest *pp_client_exch_dest(const char *servername, int port,
|
||||
const struct pingpong_dest *my_dest)
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof "0000:000000:000000:00000000000000000000000000000000"];
|
||||
int n;
|
||||
int sockfd = -1;
|
||||
struct pingpong_dest *rem_dest = NULL;
|
||||
char gid[33];
|
||||
|
||||
if (asprintf(&service, "%d", port) < 0)
|
||||
return NULL;
|
||||
|
||||
n = getaddrinfo(servername, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
|
||||
free(service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't connect to %s:%d\n", servername, port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gid_to_wire_gid(&my_dest->gid, gid);
|
||||
sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
|
||||
my_dest->psn, gid);
|
||||
if (write(sockfd, msg, sizeof msg) != sizeof msg) {
|
||||
fprintf(stderr, "Couldn't send local address\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (read(sockfd, msg, sizeof msg) != sizeof msg) {
|
||||
perror("client read");
|
||||
fprintf(stderr, "Couldn't read remote address\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (write(sockfd, "done", sizeof("done")) != sizeof("done")) {
|
||||
fprintf(stderr, "Couldn't send \"done\" msg\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
rem_dest = malloc(sizeof *rem_dest);
|
||||
if (!rem_dest)
|
||||
goto out;
|
||||
|
||||
sscanf(msg, "%x:%x:%x:%s", &rem_dest->lid, &rem_dest->qpn,
|
||||
&rem_dest->psn, gid);
|
||||
wire_gid_to_gid(gid, &rem_dest->gid);
|
||||
|
||||
out:
|
||||
close(sockfd);
|
||||
return rem_dest;
|
||||
}
|
||||
|
||||
static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
|
||||
int ib_port, enum ibv_mtu mtu,
|
||||
int port, int sl,
|
||||
const struct pingpong_dest *my_dest,
|
||||
int sgid_idx)
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_PASSIVE,
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof "0000:000000:000000:00000000000000000000000000000000"];
|
||||
int n;
|
||||
int sockfd = -1, connfd;
|
||||
struct pingpong_dest *rem_dest = NULL;
|
||||
char gid[33];
|
||||
|
||||
if (asprintf(&service, "%d", port) < 0)
|
||||
return NULL;
|
||||
|
||||
n = getaddrinfo(NULL, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
|
||||
free(service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
n = 1;
|
||||
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &n, sizeof n);
|
||||
|
||||
if (!bind(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't listen to port %d\n", port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
listen(sockfd, 1);
|
||||
connfd = accept(sockfd, NULL, 0);
|
||||
close(sockfd);
|
||||
if (connfd < 0) {
|
||||
fprintf(stderr, "accept() failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
n = read(connfd, msg, sizeof msg);
|
||||
if (n != sizeof msg) {
|
||||
perror("server read");
|
||||
fprintf(stderr, "%d/%d: Couldn't read remote address\n", n, (int) sizeof msg);
|
||||
goto out;
|
||||
}
|
||||
|
||||
rem_dest = malloc(sizeof *rem_dest);
|
||||
if (!rem_dest)
|
||||
goto out;
|
||||
|
||||
sscanf(msg, "%x:%x:%x:%s", &rem_dest->lid, &rem_dest->qpn,
|
||||
&rem_dest->psn, gid);
|
||||
wire_gid_to_gid(gid, &rem_dest->gid);
|
||||
|
||||
if (pp_connect_ctx(ctx, ib_port, my_dest->psn, mtu, sl, rem_dest,
|
||||
sgid_idx)) {
|
||||
fprintf(stderr, "Couldn't connect to remote QP\n");
|
||||
free(rem_dest);
|
||||
rem_dest = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
gid_to_wire_gid(&my_dest->gid, gid);
|
||||
sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
|
||||
my_dest->psn, gid);
|
||||
if (write(connfd, msg, sizeof msg) != sizeof msg) {
|
||||
fprintf(stderr, "Couldn't send local address\n");
|
||||
free(rem_dest);
|
||||
rem_dest = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* expecting msg "done" */
|
||||
if (read(connfd, msg, sizeof(msg)) <= 0) {
|
||||
fprintf(stderr, "Couldn't read \"done\" msg\n");
|
||||
free(rem_dest);
|
||||
rem_dest = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
close(connfd);
|
||||
return rem_dest;
|
||||
}
|
||||
|
||||
static struct pingpong_context *pp_init_ctx(struct ibv_device *ib_dev, int size,
|
||||
int rx_depth, int port,
|
||||
int use_event)
|
||||
{
|
||||
struct pingpong_context *ctx;
|
||||
|
||||
ctx = calloc(1, sizeof *ctx);
|
||||
if (!ctx)
|
||||
return NULL;
|
||||
|
||||
ctx->size = size;
|
||||
ctx->rx_depth = rx_depth;
|
||||
|
||||
ctx->buf = memalign(page_size, size);
|
||||
if (!ctx->buf) {
|
||||
fprintf(stderr, "Couldn't allocate work buf.\n");
|
||||
goto clean_ctx;
|
||||
}
|
||||
|
||||
/* FIXME memset(ctx->buf, 0, size); */
|
||||
memset(ctx->buf, 0x7b, size);
|
||||
|
||||
ctx->context = ibv_open_device(ib_dev);
|
||||
if (!ctx->context) {
|
||||
fprintf(stderr, "Couldn't get context for %s\n",
|
||||
ibv_get_device_name(ib_dev));
|
||||
goto clean_buffer;
|
||||
}
|
||||
|
||||
if (use_event) {
|
||||
ctx->channel = ibv_create_comp_channel(ctx->context);
|
||||
if (!ctx->channel) {
|
||||
fprintf(stderr, "Couldn't create completion channel\n");
|
||||
goto clean_device;
|
||||
}
|
||||
} else
|
||||
ctx->channel = NULL;
|
||||
|
||||
ctx->pd = ibv_alloc_pd(ctx->context);
|
||||
if (!ctx->pd) {
|
||||
fprintf(stderr, "Couldn't allocate PD\n");
|
||||
goto clean_comp_channel;
|
||||
}
|
||||
|
||||
ctx->mr = ibv_reg_mr(ctx->pd, ctx->buf, size, IBV_ACCESS_LOCAL_WRITE);
|
||||
if (!ctx->mr) {
|
||||
fprintf(stderr, "Couldn't register MR\n");
|
||||
goto clean_pd;
|
||||
}
|
||||
|
||||
ctx->cq = ibv_create_cq(ctx->context, rx_depth + 1, NULL,
|
||||
ctx->channel, 0);
|
||||
if (!ctx->cq) {
|
||||
fprintf(stderr, "Couldn't create CQ\n");
|
||||
goto clean_mr;
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_qp_init_attr attr = {
|
||||
.send_cq = ctx->cq,
|
||||
.recv_cq = ctx->cq,
|
||||
.cap = {
|
||||
.max_send_wr = 1,
|
||||
.max_recv_wr = rx_depth,
|
||||
.max_send_sge = 1,
|
||||
.max_recv_sge = 1
|
||||
},
|
||||
.qp_type = IBV_QPT_UC
|
||||
};
|
||||
|
||||
ctx->qp = ibv_create_qp(ctx->pd, &attr);
|
||||
if (!ctx->qp) {
|
||||
fprintf(stderr, "Couldn't create QP\n");
|
||||
goto clean_cq;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_qp_attr attr = {
|
||||
.qp_state = IBV_QPS_INIT,
|
||||
.pkey_index = 0,
|
||||
.port_num = port,
|
||||
.qp_access_flags = 0
|
||||
};
|
||||
|
||||
if (ibv_modify_qp(ctx->qp, &attr,
|
||||
IBV_QP_STATE |
|
||||
IBV_QP_PKEY_INDEX |
|
||||
IBV_QP_PORT |
|
||||
IBV_QP_ACCESS_FLAGS)) {
|
||||
fprintf(stderr, "Failed to modify QP to INIT\n");
|
||||
goto clean_qp;
|
||||
}
|
||||
}
|
||||
|
||||
return ctx;
|
||||
|
||||
clean_qp:
|
||||
ibv_destroy_qp(ctx->qp);
|
||||
|
||||
clean_cq:
|
||||
ibv_destroy_cq(ctx->cq);
|
||||
|
||||
clean_mr:
|
||||
ibv_dereg_mr(ctx->mr);
|
||||
|
||||
clean_pd:
|
||||
ibv_dealloc_pd(ctx->pd);
|
||||
|
||||
clean_comp_channel:
|
||||
if (ctx->channel)
|
||||
ibv_destroy_comp_channel(ctx->channel);
|
||||
|
||||
clean_device:
|
||||
ibv_close_device(ctx->context);
|
||||
|
||||
clean_buffer:
|
||||
free(ctx->buf);
|
||||
|
||||
clean_ctx:
|
||||
free(ctx);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int pp_close_ctx(struct pingpong_context *ctx)
|
||||
{
|
||||
if (ibv_destroy_qp(ctx->qp)) {
|
||||
fprintf(stderr, "Couldn't destroy QP\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_destroy_cq(ctx->cq)) {
|
||||
fprintf(stderr, "Couldn't destroy CQ\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_dereg_mr(ctx->mr)) {
|
||||
fprintf(stderr, "Couldn't deregister MR\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_dealloc_pd(ctx->pd)) {
|
||||
fprintf(stderr, "Couldn't deallocate PD\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ctx->channel) {
|
||||
if (ibv_destroy_comp_channel(ctx->channel)) {
|
||||
fprintf(stderr, "Couldn't destroy completion channel\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ibv_close_device(ctx->context)) {
|
||||
fprintf(stderr, "Couldn't release context\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
free(ctx->buf);
|
||||
free(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pp_post_recv(struct pingpong_context *ctx, int n)
|
||||
{
|
||||
struct ibv_sge list = {
|
||||
.addr = (uintptr_t) ctx->buf,
|
||||
.length = ctx->size,
|
||||
.lkey = ctx->mr->lkey
|
||||
};
|
||||
struct ibv_recv_wr wr = {
|
||||
.wr_id = PINGPONG_RECV_WRID,
|
||||
.sg_list = &list,
|
||||
.num_sge = 1,
|
||||
};
|
||||
struct ibv_recv_wr *bad_wr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; ++i)
|
||||
if (ibv_post_recv(ctx->qp, &wr, &bad_wr))
|
||||
break;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static int pp_post_send(struct pingpong_context *ctx)
|
||||
{
|
||||
struct ibv_sge list = {
|
||||
.addr = (uintptr_t) ctx->buf,
|
||||
.length = ctx->size,
|
||||
.lkey = ctx->mr->lkey
|
||||
};
|
||||
struct ibv_send_wr wr = {
|
||||
.wr_id = PINGPONG_SEND_WRID,
|
||||
.sg_list = &list,
|
||||
.num_sge = 1,
|
||||
.opcode = IBV_WR_SEND,
|
||||
.send_flags = IBV_SEND_SIGNALED,
|
||||
};
|
||||
struct ibv_send_wr *bad_wr;
|
||||
|
||||
return ibv_post_send(ctx->qp, &wr, &bad_wr);
|
||||
}
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s start a server and wait for connection\n", argv0);
|
||||
printf(" %s <host> connect to server at <host>\n", argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default first device found)\n");
|
||||
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
|
||||
printf(" -s, --size=<size> size of message to exchange (default 4096)\n");
|
||||
printf(" -m, --mtu=<size> path MTU (default 1024)\n");
|
||||
printf(" -r, --rx-depth=<dep> number of receives to post at a time (default 500)\n");
|
||||
printf(" -n, --iters=<iters> number of exchanges (default 1000)\n");
|
||||
printf(" -l, --sl=<sl> service level value\n");
|
||||
printf(" -e, --events sleep on CQ events (default poll)\n");
|
||||
printf(" -g, --gid-idx=<gid index> local port gid index\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
struct ibv_device *ib_dev;
|
||||
struct pingpong_context *ctx;
|
||||
struct pingpong_dest my_dest;
|
||||
struct pingpong_dest *rem_dest;
|
||||
struct timeval start, end;
|
||||
char *ib_devname = NULL;
|
||||
char *servername = NULL;
|
||||
int port = 18515;
|
||||
int ib_port = 1;
|
||||
int size = 4096;
|
||||
enum ibv_mtu mtu = IBV_MTU_1024;
|
||||
int rx_depth = 500;
|
||||
int iters = 1000;
|
||||
int use_event = 0;
|
||||
int routs;
|
||||
int rcnt, scnt;
|
||||
int num_cq_events = 0;
|
||||
int sl = 0;
|
||||
int gidx = -1;
|
||||
char gid[33];
|
||||
|
||||
srand48(getpid() * time(NULL));
|
||||
|
||||
while (1) {
|
||||
int c;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{ .name = "port", .has_arg = 1, .val = 'p' },
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "ib-port", .has_arg = 1, .val = 'i' },
|
||||
{ .name = "size", .has_arg = 1, .val = 's' },
|
||||
{ .name = "mtu", .has_arg = 1, .val = 'm' },
|
||||
{ .name = "rx-depth", .has_arg = 1, .val = 'r' },
|
||||
{ .name = "iters", .has_arg = 1, .val = 'n' },
|
||||
{ .name = "sl", .has_arg = 1, .val = 'l' },
|
||||
{ .name = "events", .has_arg = 0, .val = 'e' },
|
||||
{ .name = "gid-idx", .has_arg = 1, .val = 'g' },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "p:d:i:s:m:r:n:l:eg:",
|
||||
long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'p':
|
||||
port = strtol(optarg, NULL, 0);
|
||||
if (port < 0 || port > 65535) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
ib_devname = strdupa(optarg);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
ib_port = strtol(optarg, NULL, 0);
|
||||
if (ib_port < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
size = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
|
||||
if (mtu < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
rx_depth = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
iters = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
sl = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
++use_event;
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
gidx = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind == argc - 1)
|
||||
servername = strdupa(argv[optind]);
|
||||
else if (optind < argc) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
page_size = sysconf(_SC_PAGESIZE);
|
||||
|
||||
dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ib_devname) {
|
||||
ib_dev = *dev_list;
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "No IB devices found\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; dev_list[i]; ++i)
|
||||
if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
|
||||
break;
|
||||
ib_dev = dev_list[i];
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "IB device %s not found\n", ib_devname);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx = pp_init_ctx(ib_dev, size, rx_depth, ib_port, use_event);
|
||||
if (!ctx)
|
||||
return 1;
|
||||
|
||||
routs = pp_post_recv(ctx, ctx->rx_depth);
|
||||
if (routs < ctx->rx_depth) {
|
||||
fprintf(stderr, "Couldn't post receive (%d)\n", routs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (use_event)
|
||||
if (ibv_req_notify_cq(ctx->cq, 0)) {
|
||||
fprintf(stderr, "Couldn't request CQ notification\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (pp_get_port_info(ctx->context, ib_port, &ctx->portinfo)) {
|
||||
fprintf(stderr, "Couldn't get port info\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
my_dest.lid = ctx->portinfo.lid;
|
||||
if (ctx->portinfo.link_layer != IBV_LINK_LAYER_ETHERNET &&
|
||||
!my_dest.lid) {
|
||||
fprintf(stderr, "Couldn't get local LID\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (gidx >= 0) {
|
||||
if (ibv_query_gid(ctx->context, ib_port, gidx, &my_dest.gid)) {
|
||||
fprintf(stderr, "can't read sgid of index %d\n", gidx);
|
||||
return 1;
|
||||
}
|
||||
} else
|
||||
memset(&my_dest.gid, 0, sizeof my_dest.gid);
|
||||
|
||||
my_dest.qpn = ctx->qp->qp_num;
|
||||
my_dest.psn = lrand48() & 0xffffff;
|
||||
inet_ntop(AF_INET6, &my_dest.gid, gid, sizeof gid);
|
||||
printf(" local address: LID 0x%04x, QPN 0x%06x, PSN 0x%06x, GID %s\n",
|
||||
my_dest.lid, my_dest.qpn, my_dest.psn, gid);
|
||||
|
||||
|
||||
if (servername)
|
||||
rem_dest = pp_client_exch_dest(servername, port, &my_dest);
|
||||
else
|
||||
rem_dest = pp_server_exch_dest(ctx, ib_port, mtu, port, sl,
|
||||
&my_dest, gidx);
|
||||
|
||||
if (!rem_dest)
|
||||
return 1;
|
||||
|
||||
inet_ntop(AF_INET6, &rem_dest->gid, gid, sizeof gid);
|
||||
printf(" remote address: LID 0x%04x, QPN 0x%06x, PSN 0x%06x, GID %s\n",
|
||||
rem_dest->lid, rem_dest->qpn, rem_dest->psn, gid);
|
||||
|
||||
if (servername)
|
||||
if (pp_connect_ctx(ctx, ib_port, my_dest.psn, mtu, sl, rem_dest,
|
||||
gidx))
|
||||
return 1;
|
||||
|
||||
ctx->pending = PINGPONG_RECV_WRID;
|
||||
|
||||
if (servername) {
|
||||
if (pp_post_send(ctx)) {
|
||||
fprintf(stderr, "Couldn't post send\n");
|
||||
return 1;
|
||||
}
|
||||
ctx->pending |= PINGPONG_SEND_WRID;
|
||||
}
|
||||
|
||||
if (gettimeofday(&start, NULL)) {
|
||||
perror("gettimeofday");
|
||||
return 1;
|
||||
}
|
||||
|
||||
rcnt = scnt = 0;
|
||||
while (rcnt < iters || scnt < iters) {
|
||||
if (use_event) {
|
||||
struct ibv_cq *ev_cq;
|
||||
void *ev_ctx;
|
||||
|
||||
if (ibv_get_cq_event(ctx->channel, &ev_cq, &ev_ctx)) {
|
||||
fprintf(stderr, "Failed to get cq_event\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
++num_cq_events;
|
||||
|
||||
if (ev_cq != ctx->cq) {
|
||||
fprintf(stderr, "CQ event for unknown CQ %p\n", ev_cq);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_req_notify_cq(ctx->cq, 0)) {
|
||||
fprintf(stderr, "Couldn't request CQ notification\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_wc wc[2];
|
||||
int ne, i;
|
||||
|
||||
do {
|
||||
ne = ibv_poll_cq(ctx->cq, 2, wc);
|
||||
if (ne < 0) {
|
||||
fprintf(stderr, "poll CQ failed %d\n", ne);
|
||||
return 1;
|
||||
}
|
||||
|
||||
} while (!use_event && ne < 1);
|
||||
|
||||
for (i = 0; i < ne; ++i) {
|
||||
if (wc[i].status != IBV_WC_SUCCESS) {
|
||||
fprintf(stderr, "Failed status %s (%d) for wr_id %d\n",
|
||||
ibv_wc_status_str(wc[i].status),
|
||||
wc[i].status, (int) wc[i].wr_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch ((int) wc[i].wr_id) {
|
||||
case PINGPONG_SEND_WRID:
|
||||
++scnt;
|
||||
break;
|
||||
|
||||
case PINGPONG_RECV_WRID:
|
||||
if (--routs <= 1) {
|
||||
routs += pp_post_recv(ctx, ctx->rx_depth - routs);
|
||||
if (routs < ctx->rx_depth) {
|
||||
fprintf(stderr,
|
||||
"Couldn't post receive (%d)\n",
|
||||
routs);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
++rcnt;
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Completion for unknown wr_id %d\n",
|
||||
(int) wc[i].wr_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx->pending &= ~(int) wc[i].wr_id;
|
||||
if (scnt < iters && !ctx->pending) {
|
||||
if (pp_post_send(ctx)) {
|
||||
fprintf(stderr, "Couldn't post send\n");
|
||||
return 1;
|
||||
}
|
||||
ctx->pending = PINGPONG_RECV_WRID |
|
||||
PINGPONG_SEND_WRID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gettimeofday(&end, NULL)) {
|
||||
perror("gettimeofday");
|
||||
return 1;
|
||||
}
|
||||
|
||||
{
|
||||
float usec = (end.tv_sec - start.tv_sec) * 1000000 +
|
||||
(end.tv_usec - start.tv_usec);
|
||||
long long bytes = (long long) size * iters * 2;
|
||||
|
||||
printf("%lld bytes in %.2f seconds = %.2f Mbit/sec\n",
|
||||
bytes, usec / 1000000., bytes * 8. / usec);
|
||||
printf("%d iters in %.2f seconds = %.2f usec/iter\n",
|
||||
iters, usec / 1000000., usec / iters);
|
||||
}
|
||||
|
||||
ibv_ack_cq_events(ctx->cq, num_cq_events);
|
||||
|
||||
if (pp_close_ctx(ctx))
|
||||
return 1;
|
||||
|
||||
ibv_free_device_list(dev_list);
|
||||
free(rem_dest);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,850 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
#include <malloc.h>
|
||||
#include <getopt.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "pingpong.h"
|
||||
|
||||
enum {
|
||||
PINGPONG_RECV_WRID = 1,
|
||||
PINGPONG_SEND_WRID = 2,
|
||||
};
|
||||
|
||||
static int page_size;
|
||||
|
||||
struct pingpong_context {
|
||||
struct ibv_context *context;
|
||||
struct ibv_comp_channel *channel;
|
||||
struct ibv_pd *pd;
|
||||
struct ibv_mr *mr;
|
||||
struct ibv_cq *cq;
|
||||
struct ibv_qp *qp;
|
||||
struct ibv_ah *ah;
|
||||
void *buf;
|
||||
int size;
|
||||
int rx_depth;
|
||||
int pending;
|
||||
struct ibv_port_attr portinfo;
|
||||
};
|
||||
|
||||
struct pingpong_dest {
|
||||
int lid;
|
||||
int qpn;
|
||||
int psn;
|
||||
union ibv_gid gid;
|
||||
};
|
||||
|
||||
static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
|
||||
int sl, struct pingpong_dest *dest, int sgid_idx)
|
||||
{
|
||||
struct ibv_ah_attr ah_attr = {
|
||||
.is_global = 0,
|
||||
.dlid = dest->lid,
|
||||
.sl = sl,
|
||||
.src_path_bits = 0,
|
||||
.port_num = port
|
||||
};
|
||||
struct ibv_qp_attr attr = {
|
||||
.qp_state = IBV_QPS_RTR
|
||||
};
|
||||
|
||||
if (ibv_modify_qp(ctx->qp, &attr, IBV_QP_STATE)) {
|
||||
fprintf(stderr, "Failed to modify QP to RTR\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
attr.qp_state = IBV_QPS_RTS;
|
||||
attr.sq_psn = my_psn;
|
||||
|
||||
if (ibv_modify_qp(ctx->qp, &attr,
|
||||
IBV_QP_STATE |
|
||||
IBV_QP_SQ_PSN)) {
|
||||
fprintf(stderr, "Failed to modify QP to RTS\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (dest->gid.global.interface_id) {
|
||||
ah_attr.is_global = 1;
|
||||
ah_attr.grh.hop_limit = 1;
|
||||
ah_attr.grh.dgid = dest->gid;
|
||||
ah_attr.grh.sgid_index = sgid_idx;
|
||||
}
|
||||
|
||||
ctx->ah = ibv_create_ah(ctx->pd, &ah_attr);
|
||||
if (!ctx->ah) {
|
||||
fprintf(stderr, "Failed to create AH\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct pingpong_dest *pp_client_exch_dest(const char *servername, int port,
|
||||
const struct pingpong_dest *my_dest)
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof "0000:000000:000000:00000000000000000000000000000000"];
|
||||
int n;
|
||||
int sockfd = -1;
|
||||
struct pingpong_dest *rem_dest = NULL;
|
||||
char gid[33];
|
||||
|
||||
if (asprintf(&service, "%d", port) < 0)
|
||||
return NULL;
|
||||
|
||||
n = getaddrinfo(servername, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
|
||||
free(service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't connect to %s:%d\n", servername, port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gid_to_wire_gid(&my_dest->gid, gid);
|
||||
sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
|
||||
my_dest->psn, gid);
|
||||
if (write(sockfd, msg, sizeof msg) != sizeof msg) {
|
||||
fprintf(stderr, "Couldn't send local address\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (recv(sockfd, msg, sizeof(msg), MSG_WAITALL) != sizeof(msg)) {
|
||||
perror("client read");
|
||||
fprintf(stderr, "Couldn't read remote address\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (write(sockfd, "done", sizeof("done")) != sizeof("done")) {
|
||||
fprintf(stderr, "Couldn't send \"done\" msg\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
rem_dest = malloc(sizeof *rem_dest);
|
||||
if (!rem_dest)
|
||||
goto out;
|
||||
|
||||
sscanf(msg, "%x:%x:%x:%s", &rem_dest->lid, &rem_dest->qpn,
|
||||
&rem_dest->psn, gid);
|
||||
wire_gid_to_gid(gid, &rem_dest->gid);
|
||||
|
||||
out:
|
||||
close(sockfd);
|
||||
return rem_dest;
|
||||
}
|
||||
|
||||
static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
|
||||
int ib_port, int port, int sl,
|
||||
const struct pingpong_dest *my_dest,
|
||||
int sgid_idx)
|
||||
{
|
||||
struct addrinfo *res, *t;
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_PASSIVE,
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM
|
||||
};
|
||||
char *service;
|
||||
char msg[sizeof "0000:000000:000000:00000000000000000000000000000000"];
|
||||
int n;
|
||||
int sockfd = -1, connfd;
|
||||
struct pingpong_dest *rem_dest = NULL;
|
||||
char gid[33];
|
||||
|
||||
if (asprintf(&service, "%d", port) < 0)
|
||||
return NULL;
|
||||
|
||||
n = getaddrinfo(NULL, service, &hints, &res);
|
||||
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
|
||||
free(service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (t = res; t; t = t->ai_next) {
|
||||
sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
|
||||
if (sockfd >= 0) {
|
||||
n = 1;
|
||||
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &n, sizeof n);
|
||||
|
||||
if (!bind(sockfd, t->ai_addr, t->ai_addrlen))
|
||||
break;
|
||||
close(sockfd);
|
||||
sockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
free(service);
|
||||
|
||||
if (sockfd < 0) {
|
||||
fprintf(stderr, "Couldn't listen to port %d\n", port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
listen(sockfd, 1);
|
||||
connfd = accept(sockfd, NULL, 0);
|
||||
close(sockfd);
|
||||
if (connfd < 0) {
|
||||
fprintf(stderr, "accept() failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
n = recv(connfd, msg, sizeof(msg), MSG_WAITALL);
|
||||
if (n != sizeof msg) {
|
||||
perror("server read");
|
||||
fprintf(stderr, "%d/%d: Couldn't read remote address\n", n, (int) sizeof msg);
|
||||
goto out;
|
||||
}
|
||||
|
||||
rem_dest = malloc(sizeof *rem_dest);
|
||||
if (!rem_dest)
|
||||
goto out;
|
||||
|
||||
sscanf(msg, "%x:%x:%x:%s", &rem_dest->lid, &rem_dest->qpn,
|
||||
&rem_dest->psn, gid);
|
||||
wire_gid_to_gid(gid, &rem_dest->gid);
|
||||
|
||||
if (pp_connect_ctx(ctx, ib_port, my_dest->psn, sl, rem_dest,
|
||||
sgid_idx)) {
|
||||
fprintf(stderr, "Couldn't connect to remote QP\n");
|
||||
free(rem_dest);
|
||||
rem_dest = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
gid_to_wire_gid(&my_dest->gid, gid);
|
||||
sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
|
||||
my_dest->psn, gid);
|
||||
if (write(connfd, msg, sizeof msg) != sizeof msg) {
|
||||
fprintf(stderr, "Couldn't send local address\n");
|
||||
free(rem_dest);
|
||||
rem_dest = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* expecting msg "done" */
|
||||
if (read(connfd, msg, sizeof(msg)) <= 0) {
|
||||
fprintf(stderr, "Couldn't read \"done\" msg\n");
|
||||
free(rem_dest);
|
||||
rem_dest = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
close(connfd);
|
||||
return rem_dest;
|
||||
}
|
||||
|
||||
static struct pingpong_context *pp_init_ctx(struct ibv_device *ib_dev, int size,
|
||||
int rx_depth, int port,
|
||||
int use_event)
|
||||
{
|
||||
struct pingpong_context *ctx;
|
||||
|
||||
ctx = malloc(sizeof *ctx);
|
||||
if (!ctx)
|
||||
return NULL;
|
||||
|
||||
ctx->size = size;
|
||||
ctx->rx_depth = rx_depth;
|
||||
|
||||
ctx->buf = memalign(page_size, size + 40);
|
||||
if (!ctx->buf) {
|
||||
fprintf(stderr, "Couldn't allocate work buf.\n");
|
||||
goto clean_ctx;
|
||||
}
|
||||
|
||||
/* FIXME memset(ctx->buf, 0, size + 40); */
|
||||
memset(ctx->buf, 0x7b, size + 40);
|
||||
|
||||
ctx->context = ibv_open_device(ib_dev);
|
||||
if (!ctx->context) {
|
||||
fprintf(stderr, "Couldn't get context for %s\n",
|
||||
ibv_get_device_name(ib_dev));
|
||||
goto clean_buffer;
|
||||
}
|
||||
|
||||
if (use_event) {
|
||||
ctx->channel = ibv_create_comp_channel(ctx->context);
|
||||
if (!ctx->channel) {
|
||||
fprintf(stderr, "Couldn't create completion channel\n");
|
||||
goto clean_device;
|
||||
}
|
||||
} else
|
||||
ctx->channel = NULL;
|
||||
|
||||
ctx->pd = ibv_alloc_pd(ctx->context);
|
||||
if (!ctx->pd) {
|
||||
fprintf(stderr, "Couldn't allocate PD\n");
|
||||
goto clean_comp_channel;
|
||||
}
|
||||
|
||||
ctx->mr = ibv_reg_mr(ctx->pd, ctx->buf, size + 40, IBV_ACCESS_LOCAL_WRITE);
|
||||
if (!ctx->mr) {
|
||||
fprintf(stderr, "Couldn't register MR\n");
|
||||
goto clean_pd;
|
||||
}
|
||||
|
||||
ctx->cq = ibv_create_cq(ctx->context, rx_depth + 1, NULL,
|
||||
ctx->channel, 0);
|
||||
if (!ctx->cq) {
|
||||
fprintf(stderr, "Couldn't create CQ\n");
|
||||
goto clean_mr;
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_qp_init_attr attr = {
|
||||
.send_cq = ctx->cq,
|
||||
.recv_cq = ctx->cq,
|
||||
.cap = {
|
||||
.max_send_wr = 1,
|
||||
.max_recv_wr = rx_depth,
|
||||
.max_send_sge = 1,
|
||||
.max_recv_sge = 1
|
||||
},
|
||||
.qp_type = IBV_QPT_UD,
|
||||
};
|
||||
|
||||
ctx->qp = ibv_create_qp(ctx->pd, &attr);
|
||||
if (!ctx->qp) {
|
||||
fprintf(stderr, "Couldn't create QP\n");
|
||||
goto clean_cq;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_qp_attr attr = {
|
||||
.qp_state = IBV_QPS_INIT,
|
||||
.pkey_index = 0,
|
||||
.port_num = port,
|
||||
.qkey = 0x11111111
|
||||
};
|
||||
|
||||
if (ibv_modify_qp(ctx->qp, &attr,
|
||||
IBV_QP_STATE |
|
||||
IBV_QP_PKEY_INDEX |
|
||||
IBV_QP_PORT |
|
||||
IBV_QP_QKEY)) {
|
||||
fprintf(stderr, "Failed to modify QP to INIT\n");
|
||||
goto clean_qp;
|
||||
}
|
||||
}
|
||||
|
||||
return ctx;
|
||||
|
||||
clean_qp:
|
||||
ibv_destroy_qp(ctx->qp);
|
||||
|
||||
clean_cq:
|
||||
ibv_destroy_cq(ctx->cq);
|
||||
|
||||
clean_mr:
|
||||
ibv_dereg_mr(ctx->mr);
|
||||
|
||||
clean_pd:
|
||||
ibv_dealloc_pd(ctx->pd);
|
||||
|
||||
clean_comp_channel:
|
||||
if (ctx->channel)
|
||||
ibv_destroy_comp_channel(ctx->channel);
|
||||
|
||||
clean_device:
|
||||
ibv_close_device(ctx->context);
|
||||
|
||||
clean_buffer:
|
||||
free(ctx->buf);
|
||||
|
||||
clean_ctx:
|
||||
free(ctx);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int pp_close_ctx(struct pingpong_context *ctx)
|
||||
{
|
||||
if (ibv_destroy_qp(ctx->qp)) {
|
||||
fprintf(stderr, "Couldn't destroy QP\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_destroy_cq(ctx->cq)) {
|
||||
fprintf(stderr, "Couldn't destroy CQ\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_dereg_mr(ctx->mr)) {
|
||||
fprintf(stderr, "Couldn't deregister MR\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_destroy_ah(ctx->ah)) {
|
||||
fprintf(stderr, "Couldn't destroy AH\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_dealloc_pd(ctx->pd)) {
|
||||
fprintf(stderr, "Couldn't deallocate PD\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ctx->channel) {
|
||||
if (ibv_destroy_comp_channel(ctx->channel)) {
|
||||
fprintf(stderr, "Couldn't destroy completion channel\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ibv_close_device(ctx->context)) {
|
||||
fprintf(stderr, "Couldn't release context\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
free(ctx->buf);
|
||||
free(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pp_post_recv(struct pingpong_context *ctx, int n)
|
||||
{
|
||||
struct ibv_sge list = {
|
||||
.addr = (uintptr_t) ctx->buf,
|
||||
.length = ctx->size + 40,
|
||||
.lkey = ctx->mr->lkey
|
||||
};
|
||||
struct ibv_recv_wr wr = {
|
||||
.wr_id = PINGPONG_RECV_WRID,
|
||||
.sg_list = &list,
|
||||
.num_sge = 1,
|
||||
};
|
||||
struct ibv_recv_wr *bad_wr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; ++i)
|
||||
if (ibv_post_recv(ctx->qp, &wr, &bad_wr))
|
||||
break;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static int pp_post_send(struct pingpong_context *ctx, uint32_t qpn)
|
||||
{
|
||||
struct ibv_sge list = {
|
||||
.addr = (uintptr_t) ctx->buf + 40,
|
||||
.length = ctx->size,
|
||||
.lkey = ctx->mr->lkey
|
||||
};
|
||||
struct ibv_send_wr wr = {
|
||||
.wr_id = PINGPONG_SEND_WRID,
|
||||
.sg_list = &list,
|
||||
.num_sge = 1,
|
||||
.opcode = IBV_WR_SEND,
|
||||
.send_flags = IBV_SEND_SIGNALED,
|
||||
.wr = {
|
||||
.ud = {
|
||||
.ah = ctx->ah,
|
||||
.remote_qpn = qpn,
|
||||
.remote_qkey = 0x11111111
|
||||
}
|
||||
}
|
||||
};
|
||||
struct ibv_send_wr *bad_wr;
|
||||
|
||||
return ibv_post_send(ctx->qp, &wr, &bad_wr);
|
||||
}
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s start a server and wait for connection\n", argv0);
|
||||
printf(" %s <host> connect to server at <host>\n", argv0);
|
||||
printf("\n");
|
||||
printf("Options:\n");
|
||||
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
|
||||
printf(" -d, --ib-dev=<dev> use IB device <dev> (default first device found)\n");
|
||||
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
|
||||
printf(" -s, --size=<size> size of message to exchange (default 1024)\n");
|
||||
printf(" -r, --rx-depth=<dep> number of receives to post at a time (default 500)\n");
|
||||
printf(" -n, --iters=<iters> number of exchanges (default 1000)\n");
|
||||
printf(" -e, --events sleep on CQ events (default poll)\n");
|
||||
printf(" -g, --gid-idx=<gid index> local port gid index\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct ibv_device **dev_list;
|
||||
struct ibv_device *ib_dev;
|
||||
struct pingpong_context *ctx;
|
||||
struct pingpong_dest my_dest;
|
||||
struct pingpong_dest *rem_dest;
|
||||
struct timeval start, end;
|
||||
char *ib_devname = NULL;
|
||||
char *servername = NULL;
|
||||
int port = 18515;
|
||||
int ib_port = 1;
|
||||
int size = 1024;
|
||||
int rx_depth = 500;
|
||||
int iters = 1000;
|
||||
int use_event = 0;
|
||||
int routs;
|
||||
int rcnt, scnt;
|
||||
int num_cq_events = 0;
|
||||
int sl = 0;
|
||||
int gidx = -1;
|
||||
char gid[INET6_ADDRSTRLEN];
|
||||
|
||||
srand48(getpid() * time(NULL));
|
||||
|
||||
while (1) {
|
||||
int c;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{ .name = "port", .has_arg = 1, .val = 'p' },
|
||||
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
|
||||
{ .name = "ib-port", .has_arg = 1, .val = 'i' },
|
||||
{ .name = "size", .has_arg = 1, .val = 's' },
|
||||
{ .name = "rx-depth", .has_arg = 1, .val = 'r' },
|
||||
{ .name = "iters", .has_arg = 1, .val = 'n' },
|
||||
{ .name = "sl", .has_arg = 1, .val = 'l' },
|
||||
{ .name = "events", .has_arg = 0, .val = 'e' },
|
||||
{ .name = "gid-idx", .has_arg = 1, .val = 'g' },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "p:d:i:s:r:n:l:eg:",
|
||||
long_options, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'p':
|
||||
port = strtol(optarg, NULL, 0);
|
||||
if (port < 0 || port > 65535) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
ib_devname = strdupa(optarg);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
ib_port = strtol(optarg, NULL, 0);
|
||||
if (ib_port < 0) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
size = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
rx_depth = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
iters = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
sl = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
++use_event;
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
gidx = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind == argc - 1)
|
||||
servername = strdupa(argv[optind]);
|
||||
else if (optind < argc) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
page_size = sysconf(_SC_PAGESIZE);
|
||||
|
||||
dev_list = ibv_get_device_list(NULL);
|
||||
if (!dev_list) {
|
||||
perror("Failed to get IB devices list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ib_devname) {
|
||||
ib_dev = *dev_list;
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "No IB devices found\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; dev_list[i]; ++i)
|
||||
if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
|
||||
break;
|
||||
ib_dev = dev_list[i];
|
||||
if (!ib_dev) {
|
||||
fprintf(stderr, "IB device %s not found\n", ib_devname);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx = pp_init_ctx(ib_dev, size, rx_depth, ib_port, use_event);
|
||||
if (!ctx)
|
||||
return 1;
|
||||
|
||||
routs = pp_post_recv(ctx, ctx->rx_depth);
|
||||
if (routs < ctx->rx_depth) {
|
||||
fprintf(stderr, "Couldn't post receive (%d)\n", routs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (use_event)
|
||||
if (ibv_req_notify_cq(ctx->cq, 0)) {
|
||||
fprintf(stderr, "Couldn't request CQ notification\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (pp_get_port_info(ctx->context, ib_port, &ctx->portinfo)) {
|
||||
fprintf(stderr, "Couldn't get port info\n");
|
||||
return 1;
|
||||
}
|
||||
my_dest.lid = ctx->portinfo.lid;
|
||||
|
||||
my_dest.qpn = ctx->qp->qp_num;
|
||||
my_dest.psn = lrand48() & 0xffffff;
|
||||
|
||||
if (gidx >= 0) {
|
||||
if (ibv_query_gid(ctx->context, ib_port, gidx, &my_dest.gid)) {
|
||||
fprintf(stderr, "Could not get local gid for gid index "
|
||||
"%d\n", gidx);
|
||||
return 1;
|
||||
}
|
||||
} else
|
||||
memset(&my_dest.gid, 0, sizeof my_dest.gid);
|
||||
|
||||
inet_ntop(AF_INET6, &my_dest.gid, gid, sizeof gid);
|
||||
printf(" local address: LID 0x%04x, QPN 0x%06x, PSN 0x%06x: GID %s\n",
|
||||
my_dest.lid, my_dest.qpn, my_dest.psn, gid);
|
||||
|
||||
if (servername)
|
||||
rem_dest = pp_client_exch_dest(servername, port, &my_dest);
|
||||
else
|
||||
rem_dest = pp_server_exch_dest(ctx, ib_port, port, sl,
|
||||
&my_dest, gidx);
|
||||
|
||||
if (!rem_dest)
|
||||
return 1;
|
||||
|
||||
inet_ntop(AF_INET6, &rem_dest->gid, gid, sizeof gid);
|
||||
printf(" remote address: LID 0x%04x, QPN 0x%06x, PSN 0x%06x, GID %s\n",
|
||||
rem_dest->lid, rem_dest->qpn, rem_dest->psn, gid);
|
||||
|
||||
if (servername)
|
||||
if (pp_connect_ctx(ctx, ib_port, my_dest.psn, sl, rem_dest,
|
||||
gidx))
|
||||
return 1;
|
||||
|
||||
ctx->pending = PINGPONG_RECV_WRID;
|
||||
|
||||
if (servername) {
|
||||
if (pp_post_send(ctx, rem_dest->qpn)) {
|
||||
fprintf(stderr, "Couldn't post send\n");
|
||||
return 1;
|
||||
}
|
||||
ctx->pending |= PINGPONG_SEND_WRID;
|
||||
}
|
||||
|
||||
if (gettimeofday(&start, NULL)) {
|
||||
perror("gettimeofday");
|
||||
return 1;
|
||||
}
|
||||
|
||||
rcnt = scnt = 0;
|
||||
while (rcnt < iters || scnt < iters) {
|
||||
if (use_event) {
|
||||
struct ibv_cq *ev_cq;
|
||||
void *ev_ctx;
|
||||
|
||||
if (ibv_get_cq_event(ctx->channel, &ev_cq, &ev_ctx)) {
|
||||
fprintf(stderr, "Failed to get cq_event\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
++num_cq_events;
|
||||
|
||||
if (ev_cq != ctx->cq) {
|
||||
fprintf(stderr, "CQ event for unknown CQ %p\n", ev_cq);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ibv_req_notify_cq(ctx->cq, 0)) {
|
||||
fprintf(stderr, "Couldn't request CQ notification\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
struct ibv_wc wc[2];
|
||||
int ne, i;
|
||||
|
||||
do {
|
||||
ne = ibv_poll_cq(ctx->cq, 2, wc);
|
||||
if (ne < 0) {
|
||||
fprintf(stderr, "poll CQ failed %d\n", ne);
|
||||
return 1;
|
||||
}
|
||||
} while (!use_event && ne < 1);
|
||||
|
||||
for (i = 0; i < ne; ++i) {
|
||||
if (wc[i].status != IBV_WC_SUCCESS) {
|
||||
fprintf(stderr, "Failed status %s (%d) for wr_id %d\n",
|
||||
ibv_wc_status_str(wc[i].status),
|
||||
wc[i].status, (int) wc[i].wr_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch ((int) wc[i].wr_id) {
|
||||
case PINGPONG_SEND_WRID:
|
||||
++scnt;
|
||||
break;
|
||||
|
||||
case PINGPONG_RECV_WRID:
|
||||
if (--routs <= 1) {
|
||||
routs += pp_post_recv(ctx, ctx->rx_depth - routs);
|
||||
if (routs < ctx->rx_depth) {
|
||||
fprintf(stderr,
|
||||
"Couldn't post receive (%d)\n",
|
||||
routs);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
++rcnt;
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Completion for unknown wr_id %d\n",
|
||||
(int) wc[i].wr_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ctx->pending &= ~(int) wc[i].wr_id;
|
||||
if (scnt < iters && !ctx->pending) {
|
||||
if (pp_post_send(ctx, rem_dest->qpn)) {
|
||||
fprintf(stderr, "Couldn't post send\n");
|
||||
return 1;
|
||||
}
|
||||
ctx->pending = PINGPONG_RECV_WRID |
|
||||
PINGPONG_SEND_WRID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gettimeofday(&end, NULL)) {
|
||||
perror("gettimeofday");
|
||||
return 1;
|
||||
}
|
||||
|
||||
{
|
||||
float usec = (end.tv_sec - start.tv_sec) * 1000000 +
|
||||
(end.tv_usec - start.tv_usec);
|
||||
long long bytes = (long long) size * iters * 2;
|
||||
|
||||
printf("%lld bytes in %.2f seconds = %.2f Mbit/sec\n",
|
||||
bytes, usec / 1000000., bytes * 8. / usec);
|
||||
printf("%d iters in %.2f seconds = %.2f usec/iter\n",
|
||||
iters, usec / 1000000., usec / iters);
|
||||
}
|
||||
|
||||
ibv_ack_cq_events(ctx->cq, num_cq_events);
|
||||
|
||||
if (pp_close_ctx(ctx))
|
||||
return 1;
|
||||
|
||||
ibv_free_device_list(dev_list);
|
||||
free(rem_dest);
|
||||
|
||||
return 0;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,160 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef INFINIBAND_ARCH_H
|
||||
#define INFINIBAND_ARCH_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
#ifdef htonll
|
||||
#undef htonll
|
||||
#endif
|
||||
|
||||
#ifdef ntohll
|
||||
#undef ntohll
|
||||
#endif
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
static inline uint64_t htonll(uint64_t x) { return bswap_64(x); }
|
||||
static inline uint64_t ntohll(uint64_t x) { return bswap_64(x); }
|
||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
static inline uint64_t htonll(uint64_t x) { return x; }
|
||||
static inline uint64_t ntohll(uint64_t x) { return x; }
|
||||
#else
|
||||
#error __BYTE_ORDER is neither __LITTLE_ENDIAN nor __BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Architecture-specific defines. Currently, an architecture is
|
||||
* required to implement the following operations:
|
||||
*
|
||||
* mb() - memory barrier. No loads or stores may be reordered across
|
||||
* this macro by either the compiler or the CPU.
|
||||
* rmb() - read memory barrier. No loads may be reordered across this
|
||||
* macro by either the compiler or the CPU.
|
||||
* wmb() - write memory barrier. No stores may be reordered across
|
||||
* this macro by either the compiler or the CPU.
|
||||
* wc_wmb() - flush write combine buffers. No write-combined writes
|
||||
* will be reordered across this macro by either the compiler or
|
||||
* the CPU.
|
||||
*/
|
||||
|
||||
#if defined(__i386__)
|
||||
|
||||
#define mb() asm volatile("lock; addl $0,0(%%esp) " ::: "memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() asm volatile("" ::: "memory")
|
||||
#define wc_wmb() mb()
|
||||
#define nc_wmb() wmb()
|
||||
|
||||
#elif defined(__x86_64__)
|
||||
|
||||
#define mb() asm volatile("" ::: "memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() asm volatile("" ::: "memory")
|
||||
#define wc_wmb() asm volatile("sfence" ::: "memory")
|
||||
#define nc_wmb() wmb()
|
||||
#define WC_AUTO_EVICT_SIZE 64
|
||||
|
||||
#elif defined(__PPC64__)
|
||||
|
||||
#define mb() asm volatile("sync" ::: "memory")
|
||||
#define rmb() asm volatile("lwsync" ::: "memory")
|
||||
#define wmb() rmb()
|
||||
#define wc_wmb() mb()
|
||||
#define nc_wmb() mb()
|
||||
#define WC_AUTO_EVICT_SIZE 64
|
||||
|
||||
#elif defined(__ia64__)
|
||||
|
||||
#define mb() asm volatile("mf" ::: "memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() mb()
|
||||
#define wc_wmb() asm volatile("fwb" ::: "memory")
|
||||
#define nc_wmb() wmb()
|
||||
|
||||
#elif defined(__PPC__)
|
||||
|
||||
#define mb() asm volatile("sync" ::: "memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() mb()
|
||||
#define wc_wmb() wmb()
|
||||
#define nc_wmb() wmb()
|
||||
|
||||
#elif defined(__sparc_v9__)
|
||||
|
||||
#define mb() asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" ::: "memory")
|
||||
#define rmb() asm volatile("membar #LoadLoad" ::: "memory")
|
||||
#define wmb() asm volatile("membar #StoreStore" ::: "memory")
|
||||
#define wc_wmb() wmb()
|
||||
#define nc_wmb() wmb()
|
||||
|
||||
#elif defined(__sparc__)
|
||||
|
||||
#define mb() asm volatile("" ::: "memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() mb()
|
||||
#define wc_wmb() wmb()
|
||||
#define nc_wmb() wmb()
|
||||
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
/* Perhaps dmb would be sufficient? Let us be conservative for now. */
|
||||
#define mb() asm volatile("dsb sy" ::: "memory")
|
||||
#define rmb() asm volatile("dsb ld" ::: "memory")
|
||||
#define wmb() asm volatile("dsb st" ::: "memory")
|
||||
#define wc_wmb() wmb()
|
||||
#define nc_wmb() wmb()
|
||||
|
||||
#elif defined(__s390x__)
|
||||
|
||||
#define mb() asm volatile("" ::: "memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() mb()
|
||||
#define wc_wmb() wmb()
|
||||
#define nc_wmb() wmb()
|
||||
|
||||
#else
|
||||
|
||||
#error No architecture specific memory barrier defines found!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef WC_AUTO_EVICT_SIZE
|
||||
static inline int wc_auto_evict_size(void) { return WC_AUTO_EVICT_SIZE; };
|
||||
#else
|
||||
static inline int wc_auto_evict_size(void) { return 0; };
|
||||
#endif
|
||||
|
||||
#endif /* INFINIBAND_ARCH_H */
|
|
@ -1,247 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005, 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2005 PathScale, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef INFINIBAND_DRIVER_H
|
||||
#define INFINIBAND_DRIVER_H
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
#include <infiniband/kern-abi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define BEGIN_C_DECLS extern "C" {
|
||||
# define END_C_DECLS }
|
||||
#else /* !__cplusplus */
|
||||
# define BEGIN_C_DECLS
|
||||
# define END_C_DECLS
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Extension that low-level drivers should add to their .so filename
|
||||
* (probably via libtool "-release" option). For example a low-level
|
||||
* driver named "libfoo" should build a plug-in named "libfoo-rdmav2.so".
|
||||
*/
|
||||
#define IBV_DEVICE_LIBRARY_EXTENSION rdmav2
|
||||
|
||||
enum verbs_xrcd_mask {
|
||||
VERBS_XRCD_HANDLE = 1 << 0,
|
||||
VERBS_XRCD_RESERVED = 1 << 1
|
||||
};
|
||||
|
||||
struct verbs_xrcd {
|
||||
struct ibv_xrcd xrcd;
|
||||
uint32_t comp_mask;
|
||||
uint32_t handle;
|
||||
};
|
||||
|
||||
enum verbs_srq_mask {
|
||||
VERBS_SRQ_TYPE = 1 << 0,
|
||||
VERBS_SRQ_XRCD = 1 << 1,
|
||||
VERBS_SRQ_CQ = 1 << 2,
|
||||
VERBS_SRQ_NUM = 1 << 3,
|
||||
VERBS_SRQ_RESERVED = 1 << 4
|
||||
};
|
||||
|
||||
struct verbs_srq {
|
||||
struct ibv_srq srq;
|
||||
uint32_t comp_mask;
|
||||
enum ibv_srq_type srq_type;
|
||||
struct verbs_xrcd *xrcd;
|
||||
struct ibv_cq *cq;
|
||||
uint32_t srq_num;
|
||||
};
|
||||
|
||||
enum verbs_qp_mask {
|
||||
VERBS_QP_XRCD = 1 << 0,
|
||||
VERBS_QP_RESERVED = 1 << 1
|
||||
};
|
||||
|
||||
struct verbs_qp {
|
||||
struct ibv_qp qp;
|
||||
uint32_t comp_mask;
|
||||
struct verbs_xrcd *xrcd;
|
||||
};
|
||||
typedef struct ibv_device *(*ibv_driver_init_func)(const char *uverbs_sys_path,
|
||||
int abi_version);
|
||||
typedef struct verbs_device *(*verbs_driver_init_func)(const char *uverbs_sys_path,
|
||||
int abi_version);
|
||||
|
||||
void ibv_register_driver(const char *name, ibv_driver_init_func init_func);
|
||||
void verbs_register_driver(const char *name, verbs_driver_init_func init_func);
|
||||
int ibv_cmd_get_context(struct ibv_context *context, struct ibv_get_context *cmd,
|
||||
size_t cmd_size, struct ibv_get_context_resp *resp,
|
||||
size_t resp_size);
|
||||
int ibv_cmd_query_device(struct ibv_context *context,
|
||||
struct ibv_device_attr *device_attr,
|
||||
uint64_t *raw_fw_ver,
|
||||
struct ibv_query_device *cmd, size_t cmd_size);
|
||||
int ibv_cmd_query_device_ex(struct ibv_context *context,
|
||||
const struct ibv_query_device_ex_input *input,
|
||||
struct ibv_device_attr_ex *attr, size_t attr_size,
|
||||
uint64_t *raw_fw_ver,
|
||||
struct ibv_query_device_ex *cmd,
|
||||
size_t cmd_core_size,
|
||||
size_t cmd_size,
|
||||
struct ibv_query_device_resp_ex *resp,
|
||||
size_t resp_core_size,
|
||||
size_t resp_size);
|
||||
int ibv_cmd_query_port(struct ibv_context *context, uint8_t port_num,
|
||||
struct ibv_port_attr *port_attr,
|
||||
struct ibv_query_port *cmd, size_t cmd_size);
|
||||
int ibv_cmd_query_gid(struct ibv_context *context, uint8_t port_num,
|
||||
int index, union ibv_gid *gid);
|
||||
int ibv_cmd_query_pkey(struct ibv_context *context, uint8_t port_num,
|
||||
int index, uint16_t *pkey);
|
||||
int ibv_cmd_alloc_pd(struct ibv_context *context, struct ibv_pd *pd,
|
||||
struct ibv_alloc_pd *cmd, size_t cmd_size,
|
||||
struct ibv_alloc_pd_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_dealloc_pd(struct ibv_pd *pd);
|
||||
int ibv_cmd_open_xrcd(struct ibv_context *context, struct verbs_xrcd *xrcd,
|
||||
int vxrcd_size,
|
||||
struct ibv_xrcd_init_attr *attr,
|
||||
struct ibv_open_xrcd *cmd, size_t cmd_size,
|
||||
struct ibv_open_xrcd_resp *resp,
|
||||
size_t resp_size);
|
||||
int ibv_cmd_close_xrcd(struct verbs_xrcd *xrcd);
|
||||
#define IBV_CMD_REG_MR_HAS_RESP_PARAMS
|
||||
int ibv_cmd_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
|
||||
uint64_t hca_va, int access,
|
||||
struct ibv_mr *mr, struct ibv_reg_mr *cmd,
|
||||
size_t cmd_size,
|
||||
struct ibv_reg_mr_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_rereg_mr(struct ibv_mr *mr, uint32_t flags, void *addr,
|
||||
size_t length, uint64_t hca_va, int access,
|
||||
struct ibv_pd *pd, struct ibv_rereg_mr *cmd,
|
||||
size_t cmd_sz, struct ibv_rereg_mr_resp *resp,
|
||||
size_t resp_sz);
|
||||
int ibv_cmd_dereg_mr(struct ibv_mr *mr);
|
||||
int ibv_cmd_alloc_mw(struct ibv_pd *pd, enum ibv_mw_type type,
|
||||
struct ibv_mw *mw, struct ibv_alloc_mw *cmd,
|
||||
size_t cmd_size,
|
||||
struct ibv_alloc_mw_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_dealloc_mw(struct ibv_mw *mw,
|
||||
struct ibv_dealloc_mw *cmd, size_t cmd_size);
|
||||
int ibv_cmd_create_cq(struct ibv_context *context, int cqe,
|
||||
struct ibv_comp_channel *channel,
|
||||
int comp_vector, struct ibv_cq *cq,
|
||||
struct ibv_create_cq *cmd, size_t cmd_size,
|
||||
struct ibv_create_cq_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_poll_cq(struct ibv_cq *cq, int ne, struct ibv_wc *wc);
|
||||
int ibv_cmd_req_notify_cq(struct ibv_cq *cq, int solicited_only);
|
||||
#define IBV_CMD_RESIZE_CQ_HAS_RESP_PARAMS
|
||||
int ibv_cmd_resize_cq(struct ibv_cq *cq, int cqe,
|
||||
struct ibv_resize_cq *cmd, size_t cmd_size,
|
||||
struct ibv_resize_cq_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_destroy_cq(struct ibv_cq *cq);
|
||||
|
||||
int ibv_cmd_create_srq(struct ibv_pd *pd,
|
||||
struct ibv_srq *srq, struct ibv_srq_init_attr *attr,
|
||||
struct ibv_create_srq *cmd, size_t cmd_size,
|
||||
struct ibv_create_srq_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_create_srq_ex(struct ibv_context *context,
|
||||
struct verbs_srq *srq, int vsrq_sz,
|
||||
struct ibv_srq_init_attr_ex *attr_ex,
|
||||
struct ibv_create_xsrq *cmd, size_t cmd_size,
|
||||
struct ibv_create_srq_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_modify_srq(struct ibv_srq *srq,
|
||||
struct ibv_srq_attr *srq_attr,
|
||||
int srq_attr_mask,
|
||||
struct ibv_modify_srq *cmd, size_t cmd_size);
|
||||
int ibv_cmd_query_srq(struct ibv_srq *srq,
|
||||
struct ibv_srq_attr *srq_attr,
|
||||
struct ibv_query_srq *cmd, size_t cmd_size);
|
||||
int ibv_cmd_destroy_srq(struct ibv_srq *srq);
|
||||
|
||||
int ibv_cmd_create_qp(struct ibv_pd *pd,
|
||||
struct ibv_qp *qp, struct ibv_qp_init_attr *attr,
|
||||
struct ibv_create_qp *cmd, size_t cmd_size,
|
||||
struct ibv_create_qp_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_open_qp(struct ibv_context *context,
|
||||
struct verbs_qp *qp, int vqp_sz,
|
||||
struct ibv_qp_open_attr *attr,
|
||||
struct ibv_open_qp *cmd, size_t cmd_size,
|
||||
struct ibv_create_qp_resp *resp, size_t resp_size);
|
||||
int ibv_cmd_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *qp_attr,
|
||||
int attr_mask,
|
||||
struct ibv_qp_init_attr *qp_init_attr,
|
||||
struct ibv_query_qp *cmd, size_t cmd_size);
|
||||
int ibv_cmd_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
|
||||
int attr_mask,
|
||||
struct ibv_modify_qp *cmd, size_t cmd_size);
|
||||
int ibv_cmd_destroy_qp(struct ibv_qp *qp);
|
||||
int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
|
||||
struct ibv_send_wr **bad_wr);
|
||||
int ibv_cmd_post_recv(struct ibv_qp *ibqp, struct ibv_recv_wr *wr,
|
||||
struct ibv_recv_wr **bad_wr);
|
||||
int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr,
|
||||
struct ibv_recv_wr **bad_wr);
|
||||
int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah,
|
||||
struct ibv_ah_attr *attr,
|
||||
struct ibv_create_ah_resp *resp,
|
||||
size_t resp_size);
|
||||
int ibv_cmd_destroy_ah(struct ibv_ah *ah);
|
||||
int ibv_cmd_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
|
||||
int ibv_cmd_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
|
||||
|
||||
struct ibv_exp_flow *ibv_exp_cmd_create_flow(struct ibv_qp *qp,
|
||||
struct ibv_exp_flow_attr *flow_attr);
|
||||
int ibv_exp_cmd_destroy_flow(struct ibv_exp_flow *flow_id);
|
||||
struct ibv_flow *ibv_cmd_create_flow(struct ibv_qp *qp,
|
||||
struct ibv_flow_attr *flow_attr);
|
||||
int ibv_cmd_destroy_flow(struct ibv_flow *flow_id);
|
||||
|
||||
int ibv_dontfork_range(void *base, size_t size);
|
||||
int ibv_dofork_range(void *base, size_t size);
|
||||
|
||||
void copy_query_dev_fields(struct ibv_device_attr *device_attr,
|
||||
struct ibv_query_device_resp *resp,
|
||||
uint64_t *raw_fw_ver);
|
||||
/*
|
||||
* sysfs helper functions
|
||||
*/
|
||||
const char *ibv_get_sysfs_path(void);
|
||||
|
||||
int ibv_read_sysfs_file(const char *dir, const char *file,
|
||||
char *buf, size_t size);
|
||||
|
||||
static inline int verbs_get_srq_num(struct ibv_srq *srq, uint32_t *srq_num)
|
||||
{
|
||||
struct verbs_srq *vsrq = container_of(srq, struct verbs_srq, srq);
|
||||
if (vsrq->comp_mask & VERBS_SRQ_NUM) {
|
||||
*srq_num = vsrq->srq_num;
|
||||
return 0;
|
||||
}
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
#endif /* INFINIBAND_DRIVER_H */
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005, 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2005 PathScale, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef INFINIBAND_DRIVER_EXP_H
|
||||
#define INFINIBAND_DRIVER_EXP_H
|
||||
|
||||
#include <infiniband/verbs_exp.h>
|
||||
#include <infiniband/driver.h>
|
||||
#include <infiniband/kern-abi_exp.h>
|
||||
|
||||
int ibv_exp_cmd_query_device(struct ibv_context *context,
|
||||
struct ibv_exp_device_attr *device_attr,
|
||||
uint64_t *raw_fw_ver,
|
||||
struct ibv_exp_query_device *cmd, size_t cmd_size);
|
||||
int ibv_exp_cmd_create_qp(struct ibv_context *context,
|
||||
struct verbs_qp *qp, int vqp_sz,
|
||||
struct ibv_exp_qp_init_attr *attr_exp,
|
||||
void *cmd_buf, size_t lib_cmd_size, size_t drv_cmd_size,
|
||||
void *resp_buf, size_t lib_resp_size, size_t drv_resp_size,
|
||||
int force_exp);
|
||||
int ibv_exp_cmd_create_dct(struct ibv_context *context,
|
||||
struct ibv_exp_dct *dct,
|
||||
struct ibv_exp_dct_init_attr *attr,
|
||||
struct ibv_exp_create_dct *cmd,
|
||||
size_t lib_cmd_sz, size_t drv_cmd_sz,
|
||||
struct ibv_exp_create_dct_resp *resp,
|
||||
size_t lib_resp_sz, size_t drv_resp_sz);
|
||||
int ibv_exp_cmd_destroy_dct(struct ibv_context *context,
|
||||
struct ibv_exp_dct *dct,
|
||||
struct ibv_exp_destroy_dct *cmd,
|
||||
size_t lib_cmd_sz, size_t drv_cmd_sz,
|
||||
struct ibv_exp_destroy_dct_resp *resp,
|
||||
size_t lib_resp_sz, size_t drv_resp_sz);
|
||||
int ibv_exp_cmd_query_dct(struct ibv_context *context,
|
||||
struct ibv_exp_query_dct *cmd,
|
||||
size_t lib_cmd_sz, size_t drv_cmd_sz,
|
||||
struct ibv_exp_query_dct_resp *resp,
|
||||
size_t lib_resp_sz, size_t drv_resp_sz,
|
||||
struct ibv_exp_dct_attr *attr);
|
||||
int ibv_exp_cmd_arm_dct(struct ibv_context *context,
|
||||
struct ibv_exp_arm_attr *attr,
|
||||
struct ibv_exp_arm_dct *cmd,
|
||||
size_t lib_cmd_sz, size_t drv_cmd_sz,
|
||||
struct ibv_exp_arm_dct_resp *resp,
|
||||
size_t lib_resp_sz, size_t drv_resp_sz);
|
||||
int ibv_exp_cmd_modify_cq(struct ibv_cq *cq,
|
||||
struct ibv_exp_cq_attr *attr,
|
||||
int attr_mask,
|
||||
struct ibv_exp_modify_cq *cmd, size_t cmd_size);
|
||||
int ibv_exp_cmd_create_cq(struct ibv_context *context, int cqe,
|
||||
struct ibv_comp_channel *channel,
|
||||
int comp_vector, struct ibv_cq *cq,
|
||||
struct ibv_exp_create_cq *cmd, size_t lib_cmd_sz, size_t drv_cmd_sz,
|
||||
struct ibv_create_cq_resp *resp, size_t lib_resp_sz, size_t drv_resp_sz,
|
||||
struct ibv_exp_cq_init_attr *attr);
|
||||
int ibv_exp_cmd_modify_qp(struct ibv_qp *qp, struct ibv_exp_qp_attr *attr,
|
||||
uint64_t attr_mask, struct ibv_exp_modify_qp *cmd,
|
||||
size_t cmd_size);
|
||||
int ibv_exp_cmd_create_mr(struct ibv_exp_create_mr_in *in, struct ibv_mr *mr,
|
||||
struct ibv_exp_create_mr *cmd, size_t lib_cmd_sz, size_t drv_cmd_sz,
|
||||
struct ibv_exp_create_mr_resp *resp, size_t lib_resp_sz, size_t drv_resp_sz);
|
||||
int ibv_exp_cmd_query_mkey(struct ibv_context *context,
|
||||
struct ibv_mr *mr,
|
||||
struct ibv_exp_mkey_attr *mkey_attr,
|
||||
struct ibv_exp_query_mkey *cmd, size_t lib_cmd_sz, size_t drv_cmd_sz,
|
||||
struct ibv_exp_query_mkey_resp *resp, size_t lib_resp_sz, size_t drv_resp_sz);
|
||||
int ibv_cmd_exp_reg_mr(const struct ibv_exp_reg_mr_in *mr_init_attr,
|
||||
uint64_t hca_va, struct ibv_mr *mr,
|
||||
struct ibv_exp_reg_mr *cmd,
|
||||
size_t cmd_size,
|
||||
struct ibv_exp_reg_mr_resp *resp,
|
||||
size_t resp_size);
|
||||
int ibv_cmd_exp_prefetch_mr(struct ibv_mr *mr,
|
||||
struct ibv_exp_prefetch_attr *attr);
|
||||
int ibv_exp_cmd_create_wq(struct ibv_context *context,
|
||||
struct ibv_exp_wq_init_attr *wq_init_attr,
|
||||
struct ibv_exp_wq *wq,
|
||||
struct ibv_exp_create_wq *cmd,
|
||||
size_t cmd_core_size,
|
||||
size_t cmd_size,
|
||||
struct ibv_exp_create_wq_resp *resp,
|
||||
size_t resp_core_size,
|
||||
size_t resp_size);
|
||||
int ibv_exp_cmd_destroy_wq(struct ibv_exp_wq *wq);
|
||||
int ibv_exp_cmd_modify_wq(struct ibv_exp_wq *wq, struct ibv_exp_wq_attr *attr,
|
||||
struct ib_exp_modify_wq *cmd, size_t cmd_size);
|
||||
int ibv_exp_cmd_create_rwq_ind_table(struct ibv_context *context,
|
||||
struct ibv_exp_rwq_ind_table_init_attr *init_attr,
|
||||
struct ibv_exp_rwq_ind_table *rwq_ind_table,
|
||||
struct ibv_exp_create_rwq_ind_table *cmd,
|
||||
size_t cmd_core_size,
|
||||
size_t cmd_size,
|
||||
struct ibv_exp_create_rwq_ind_table_resp *resp,
|
||||
size_t resp_core_size,
|
||||
size_t resp_size);
|
||||
int ibv_exp_cmd_destroy_rwq_ind_table(struct ibv_exp_rwq_ind_table *rwq_ind_table);
|
||||
/*
|
||||
* ibv_exp_cmd_getenv
|
||||
*
|
||||
* @context: context to the device
|
||||
* @name: the name of the variable to read
|
||||
* @value: pointer where the value of the variable will be written
|
||||
* @n: number of bytes pointed to by val
|
||||
*
|
||||
* return: 0 success
|
||||
* < 0 varaible was not found
|
||||
> 0 variable found but not enuogh space provided. requied space is the value returned.
|
||||
*/
|
||||
int ibv_exp_cmd_getenv(struct ibv_context *context,
|
||||
const char *name, char *value, size_t n);
|
||||
|
||||
|
||||
#endif /* INFINIBAND_DRIVER_EXP_H */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,720 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
|
||||
* Copyright (c) 2005 PathScale, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef KERN_ABI_EXP_H
|
||||
#define KERN_ABI_EXP_H
|
||||
|
||||
#include <infiniband/kern-abi.h>
|
||||
|
||||
/*
|
||||
* This file must be kept in sync with the kernel's version of
|
||||
* drivers/infiniband/include/ib_user_verbs_exp.h
|
||||
*/
|
||||
|
||||
enum {
|
||||
IB_USER_VERBS_EXP_CMD_FIRST = 64
|
||||
};
|
||||
|
||||
enum {
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_QP,
|
||||
IB_USER_VERBS_EXP_CMD_MODIFY_CQ,
|
||||
IB_USER_VERBS_EXP_CMD_MODIFY_QP,
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_CQ,
|
||||
IB_USER_VERBS_EXP_CMD_QUERY_DEVICE,
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_DCT,
|
||||
IB_USER_VERBS_EXP_CMD_DESTROY_DCT,
|
||||
IB_USER_VERBS_EXP_CMD_QUERY_DCT,
|
||||
IB_USER_VERBS_EXP_CMD_ARM_DCT,
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_MR,
|
||||
IB_USER_VERBS_EXP_CMD_QUERY_MKEY,
|
||||
IB_USER_VERBS_EXP_CMD_REG_MR,
|
||||
IB_USER_VERBS_EXP_CMD_PREFETCH_MR,
|
||||
IB_USER_VERBS_EXP_CMD_REREG_MR,
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_WQ,
|
||||
IB_USER_VERBS_EXP_CMD_MODIFY_WQ,
|
||||
IB_USER_VERBS_EXP_CMD_DESTROY_WQ,
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_RWQ_IND_TBL,
|
||||
IB_USER_VERBS_EXP_CMD_DESTROY_RWQ_IND_TBL,
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_FLOW,
|
||||
};
|
||||
|
||||
enum {
|
||||
IB_USER_VERBS_CMD_EXP_CREATE_WQ =
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_WQ +
|
||||
IB_USER_VERBS_EXP_CMD_FIRST,
|
||||
IB_USER_VERBS_CMD_EXP_MODIFY_WQ =
|
||||
IB_USER_VERBS_EXP_CMD_MODIFY_WQ +
|
||||
IB_USER_VERBS_EXP_CMD_FIRST,
|
||||
IB_USER_VERBS_CMD_EXP_DESTROY_WQ =
|
||||
IB_USER_VERBS_EXP_CMD_DESTROY_WQ +
|
||||
IB_USER_VERBS_EXP_CMD_FIRST,
|
||||
IB_USER_VERBS_CMD_EXP_CREATE_RWQ_IND_TBL =
|
||||
IB_USER_VERBS_EXP_CMD_CREATE_RWQ_IND_TBL +
|
||||
IB_USER_VERBS_EXP_CMD_FIRST,
|
||||
IB_USER_VERBS_CMD_EXP_DESTROY_RWQ_IND_TBL =
|
||||
IB_USER_VERBS_EXP_CMD_DESTROY_RWQ_IND_TBL +
|
||||
IB_USER_VERBS_EXP_CMD_FIRST,
|
||||
/*
|
||||
* Set commands that didn't exist to -1 so our compile-time
|
||||
* trick opcodes in IBV_INIT_CMD() doesn't break.
|
||||
*/
|
||||
IB_USER_VERBS_CMD_EXP_CREATE_WQ_V2 = -1,
|
||||
IB_USER_VERBS_CMD_EXP_MODIFY_WQ_V2 = -1,
|
||||
IB_USER_VERBS_CMD_EXP_DESTROY_WQ_V2 = -1,
|
||||
IB_USER_VERBS_CMD_EXP_CREATE_RWQ_IND_TBL_V2 = -1,
|
||||
IB_USER_VERBS_CMD_EXP_DESTROY_RWQ_IND_TBL_V2 = -1,
|
||||
};
|
||||
|
||||
enum ibv_exp_create_qp_comp_mask {
|
||||
IBV_EXP_CREATE_QP_CAP_FLAGS = (1ULL << 0),
|
||||
IBV_EXP_CREATE_QP_INL_RECV = (1ULL << 1),
|
||||
IBV_EXP_CREATE_QP_QPG = (1ULL << 2),
|
||||
IBV_EXP_CREATE_QP_MAX_INL_KLMS = (1ULL << 3)
|
||||
};
|
||||
|
||||
struct ibv_create_qpg_init_attrib {
|
||||
__u32 tss_child_count;
|
||||
__u32 rss_child_count;
|
||||
};
|
||||
|
||||
struct ibv_create_qpg {
|
||||
__u32 qpg_type;
|
||||
union {
|
||||
struct {
|
||||
__u32 parent_handle;
|
||||
__u32 reserved;
|
||||
};
|
||||
struct ibv_create_qpg_init_attrib parent_attrib;
|
||||
};
|
||||
__u32 reserved2;
|
||||
};
|
||||
|
||||
enum ibv_exp_create_qp_kernel_flags {
|
||||
IBV_EXP_CREATE_QP_KERNEL_FLAGS = IBV_EXP_QP_CREATE_CROSS_CHANNEL |
|
||||
IBV_EXP_QP_CREATE_MANAGED_SEND |
|
||||
IBV_EXP_QP_CREATE_MANAGED_RECV |
|
||||
IBV_EXP_QP_CREATE_ATOMIC_BE_REPLY |
|
||||
IBV_EXP_QP_CREATE_RX_END_PADDING |
|
||||
IBV_EXP_QP_CREATE_SCATTER_FCS
|
||||
};
|
||||
|
||||
struct ibv_exp_create_qp {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u64 user_handle;
|
||||
__u32 pd_handle;
|
||||
__u32 send_cq_handle;
|
||||
__u32 recv_cq_handle;
|
||||
__u32 srq_handle;
|
||||
__u32 max_send_wr;
|
||||
__u32 max_recv_wr;
|
||||
__u32 max_send_sge;
|
||||
__u32 max_recv_sge;
|
||||
__u32 max_inline_data;
|
||||
__u8 sq_sig_all;
|
||||
__u8 qp_type;
|
||||
__u8 is_srq;
|
||||
__u8 reserved;
|
||||
__u64 qp_cap_flags;
|
||||
__u32 max_inl_recv;
|
||||
__u32 reserved1;
|
||||
struct ibv_create_qpg qpg;
|
||||
__u64 max_inl_send_klms;
|
||||
struct {
|
||||
__u64 rx_hash_fields_mask;
|
||||
__u32 rwq_ind_tbl_handle;
|
||||
__u8 rx_hash_function;
|
||||
__u8 rx_hash_key_len;
|
||||
__u8 rx_hash_key[128];
|
||||
__u16 reserved;
|
||||
} rx_hash_info;
|
||||
__u8 port_num;
|
||||
__u8 reserved_2[7];
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
enum ibv_exp_create_qp_resp_comp_mask {
|
||||
IBV_EXP_CREATE_QP_RESP_INL_RECV = (1ULL << 0),
|
||||
};
|
||||
|
||||
struct ibv_exp_create_qp_resp {
|
||||
__u64 comp_mask;
|
||||
__u32 qp_handle;
|
||||
__u32 qpn;
|
||||
__u32 max_send_wr;
|
||||
__u32 max_recv_wr;
|
||||
__u32 max_send_sge;
|
||||
__u32 max_recv_sge;
|
||||
__u32 max_inline_data;
|
||||
__u32 max_inl_recv;
|
||||
};
|
||||
|
||||
struct ibv_exp_umr_caps_resp {
|
||||
__u32 max_klm_list_size;
|
||||
__u32 max_send_wqe_inline_klms;
|
||||
__u32 max_umr_recursion_depth;
|
||||
__u32 max_umr_stride_dimension;
|
||||
};
|
||||
|
||||
struct ibv_exp_odp_caps_resp {
|
||||
__u64 general_odp_caps;
|
||||
struct {
|
||||
__u32 rc_odp_caps;
|
||||
__u32 uc_odp_caps;
|
||||
__u32 ud_odp_caps;
|
||||
__u32 dc_odp_caps;
|
||||
__u32 xrc_odp_caps;
|
||||
__u32 raw_eth_odp_caps;
|
||||
} per_transport_caps;
|
||||
};
|
||||
|
||||
struct ibv_exp_query_device {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_rx_hash_caps_resp {
|
||||
__u32 max_rwq_indirection_tables;
|
||||
__u32 max_rwq_indirection_table_size;
|
||||
__u64 supported_packet_fields;
|
||||
__u32 supported_qps;
|
||||
__u8 supported_hash_functions;
|
||||
__u8 reserved[3];
|
||||
};
|
||||
|
||||
struct ibv_exp_mp_rq_caps_resp {
|
||||
__u32 supported_qps; /* use ibv_exp_supported_qp_types */
|
||||
__u32 allowed_shifts; /* use ibv_exp_mp_rq_shifts */
|
||||
__u8 min_single_wqe_log_num_of_strides;
|
||||
__u8 max_single_wqe_log_num_of_strides;
|
||||
__u8 min_single_stride_log_num_of_bytes;
|
||||
__u8 max_single_stride_log_num_of_bytes;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct ibv_exp_ec_caps_resp {
|
||||
__u32 max_ec_data_vector_count;
|
||||
__u32 max_ec_calc_inflight_calcs;
|
||||
};
|
||||
|
||||
struct ibv_exp_masked_atomic_caps {
|
||||
__u32 max_fa_bit_boundary;
|
||||
__u32 log_max_atomic_inline;
|
||||
__u64 masked_log_atomic_arg_sizes;
|
||||
__u64 masked_log_atomic_arg_sizes_network_endianness;
|
||||
};
|
||||
|
||||
struct ibv_exp_lso_caps_resp {
|
||||
__u32 max_tso;
|
||||
__u32 supported_qpts;
|
||||
};
|
||||
|
||||
struct ibv_exp_packet_pacing_caps_resp {
|
||||
__u32 qp_rate_limit_min;
|
||||
__u32 qp_rate_limit_max; /* In kbps */
|
||||
__u32 supported_qpts;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct ibv_exp_query_device_resp {
|
||||
__u64 comp_mask;
|
||||
__u64 fw_ver;
|
||||
__u64 node_guid;
|
||||
__u64 sys_image_guid;
|
||||
__u64 max_mr_size;
|
||||
__u64 page_size_cap;
|
||||
__u32 vendor_id;
|
||||
__u32 vendor_part_id;
|
||||
__u32 hw_ver;
|
||||
__u32 max_qp;
|
||||
__u32 max_qp_wr;
|
||||
__u32 device_cap_flags;
|
||||
__u32 max_sge;
|
||||
__u32 max_sge_rd;
|
||||
__u32 max_cq;
|
||||
__u32 max_cqe;
|
||||
__u32 max_mr;
|
||||
__u32 max_pd;
|
||||
__u32 max_qp_rd_atom;
|
||||
__u32 max_ee_rd_atom;
|
||||
__u32 max_res_rd_atom;
|
||||
__u32 max_qp_init_rd_atom;
|
||||
__u32 max_ee_init_rd_atom;
|
||||
__u32 exp_atomic_cap;
|
||||
__u32 max_ee;
|
||||
__u32 max_rdd;
|
||||
__u32 max_mw;
|
||||
__u32 max_raw_ipv6_qp;
|
||||
__u32 max_raw_ethy_qp;
|
||||
__u32 max_mcast_grp;
|
||||
__u32 max_mcast_qp_attach;
|
||||
__u32 max_total_mcast_qp_attach;
|
||||
__u32 max_ah;
|
||||
__u32 max_fmr;
|
||||
__u32 max_map_per_fmr;
|
||||
__u32 max_srq;
|
||||
__u32 max_srq_wr;
|
||||
__u32 max_srq_sge;
|
||||
__u16 max_pkeys;
|
||||
__u8 local_ca_ack_delay;
|
||||
__u8 phys_port_cnt;
|
||||
__u8 reserved[4];
|
||||
__u64 timestamp_mask;
|
||||
__u64 hca_core_clock;
|
||||
__u64 device_cap_flags2;
|
||||
__u32 dc_rd_req;
|
||||
__u32 dc_rd_res;
|
||||
__u32 inline_recv_sz;
|
||||
__u32 max_rss_tbl_sz;
|
||||
__u64 log_atomic_arg_sizes;
|
||||
__u32 max_fa_bit_boundary;
|
||||
__u32 log_max_atomic_inline;
|
||||
struct ibv_exp_umr_caps_resp umr_caps;
|
||||
struct ibv_exp_odp_caps_resp odp_caps;
|
||||
__u32 max_dct;
|
||||
__u32 max_ctx_res_domain;
|
||||
struct ibv_exp_rx_hash_caps_resp rx_hash;
|
||||
__u32 max_wq_type_rq;
|
||||
__u32 max_device_ctx;
|
||||
struct ibv_exp_mp_rq_caps_resp mp_rq_caps;
|
||||
__u16 wq_vlan_offloads_cap;
|
||||
__u8 reserved1[2];
|
||||
__u32 ec_w_mask;
|
||||
struct ibv_exp_ec_caps_resp ec_caps;
|
||||
struct ibv_exp_masked_atomic_caps masked_atomic_caps;
|
||||
__u16 rx_pad_end_addr_align;
|
||||
__u8 reserved2[6];
|
||||
struct ibv_exp_lso_caps_resp tso_caps;
|
||||
struct ibv_exp_packet_pacing_caps_resp packet_pacing_caps;
|
||||
};
|
||||
|
||||
struct ibv_exp_create_dct {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u64 user_handle;
|
||||
__u32 pd_handle;
|
||||
__u32 cq_handle;
|
||||
__u32 srq_handle;
|
||||
__u32 access_flags;
|
||||
__u64 dc_key;
|
||||
__u32 flow_label;
|
||||
__u8 min_rnr_timer;
|
||||
__u8 tclass;
|
||||
__u8 port;
|
||||
__u8 pkey_index;
|
||||
__u8 gid_index;
|
||||
__u8 hop_limit;
|
||||
__u8 mtu;
|
||||
__u8 rsvd0;
|
||||
__u32 create_flags;
|
||||
__u32 inline_size;
|
||||
__u32 rsvd1;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_create_dct_resp {
|
||||
__u32 dct_handle;
|
||||
__u32 dct_num;
|
||||
__u32 inline_size;
|
||||
__u32 rsvd;
|
||||
};
|
||||
|
||||
struct ibv_exp_destroy_dct {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u32 dct_handle;
|
||||
__u32 rsvd;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_destroy_dct_resp {
|
||||
__u32 events_reported;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct ibv_exp_query_dct {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u32 dct_handle;
|
||||
__u32 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_query_dct_resp {
|
||||
__u64 dc_key;
|
||||
__u32 access_flags;
|
||||
__u32 flow_label;
|
||||
__u32 key_violations;
|
||||
__u8 port;
|
||||
__u8 min_rnr_timer;
|
||||
__u8 tclass;
|
||||
__u8 mtu;
|
||||
__u8 pkey_index;
|
||||
__u8 gid_index;
|
||||
__u8 hop_limit;
|
||||
__u8 state;
|
||||
__u32 rsvd;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_arm_dct {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u32 dct_handle;
|
||||
__u32 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_arm_dct_resp {
|
||||
__u64 reserved;
|
||||
};
|
||||
|
||||
struct ibv_exp_modify_cq {
|
||||
struct ex_hdr hdr;
|
||||
__u32 cq_handle;
|
||||
__u32 attr_mask;
|
||||
__u16 cq_count;
|
||||
__u16 cq_period;
|
||||
__u32 cq_cap_flags;
|
||||
__u32 comp_mask;
|
||||
__u32 rsvd;
|
||||
};
|
||||
|
||||
struct ibv_exp_modify_qp {
|
||||
struct ex_hdr hdr;
|
||||
__u32 comp_mask;
|
||||
struct ibv_qp_dest dest;
|
||||
struct ibv_qp_dest alt_dest;
|
||||
__u32 qp_handle;
|
||||
__u32 attr_mask;
|
||||
__u32 qkey;
|
||||
__u32 rq_psn;
|
||||
__u32 sq_psn;
|
||||
__u32 dest_qp_num;
|
||||
__u32 qp_access_flags;
|
||||
__u16 pkey_index;
|
||||
__u16 alt_pkey_index;
|
||||
__u8 qp_state;
|
||||
__u8 cur_qp_state;
|
||||
__u8 path_mtu;
|
||||
__u8 path_mig_state;
|
||||
__u8 en_sqd_async_notify;
|
||||
__u8 max_rd_atomic;
|
||||
__u8 max_dest_rd_atomic;
|
||||
__u8 min_rnr_timer;
|
||||
__u8 port_num;
|
||||
__u8 timeout;
|
||||
__u8 retry_cnt;
|
||||
__u8 rnr_retry;
|
||||
__u8 alt_port_num;
|
||||
__u8 alt_timeout;
|
||||
__u8 reserved[6];
|
||||
__u64 dct_key;
|
||||
__u32 exp_attr_mask;
|
||||
__u32 flow_entropy;
|
||||
__u32 rate_limit;
|
||||
__u32 reserved1;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
enum ibv_exp_create_cq_comp_mask {
|
||||
IBV_EXP_CREATE_CQ_CAP_FLAGS = (uint64_t)1 << 0,
|
||||
};
|
||||
|
||||
struct ibv_exp_create_cq {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u64 user_handle;
|
||||
__u32 cqe;
|
||||
__u32 comp_vector;
|
||||
__s32 comp_channel;
|
||||
__u32 reserved;
|
||||
__u64 create_flags;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_create_mr {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u32 pd_handle;
|
||||
__u32 max_klm_list_size;
|
||||
__u64 exp_access_flags;
|
||||
__u32 create_flags;
|
||||
__u32 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_create_mr_resp {
|
||||
__u64 comp_mask;
|
||||
__u32 handle;
|
||||
__u32 lkey;
|
||||
__u32 rkey;
|
||||
__u32 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_query_mkey {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u32 handle;
|
||||
__u32 lkey;
|
||||
__u32 rkey;
|
||||
__u32 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ibv_exp_query_mkey_resp {
|
||||
__u64 comp_mask;
|
||||
__u32 max_klm_list_size;
|
||||
__u32 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
enum ibv_exp_reg_mr_comp_mask {
|
||||
IBV_EXP_REG_MR_EXP_ACCESS_FLAGS = 1ULL << 0,
|
||||
};
|
||||
|
||||
struct ibv_exp_reg_mr {
|
||||
struct ex_hdr hdr;
|
||||
__u64 start;
|
||||
__u64 length;
|
||||
__u64 hca_va;
|
||||
__u32 pd_handle;
|
||||
__u32 reserved;
|
||||
__u64 exp_access_flags;
|
||||
__u64 comp_mask;
|
||||
};
|
||||
|
||||
struct ibv_exp_prefetch_mr {
|
||||
struct ex_hdr hdr;
|
||||
__u64 comp_mask;
|
||||
__u32 mr_handle;
|
||||
__u32 flags;
|
||||
__u64 start;
|
||||
__u64 length;
|
||||
};
|
||||
|
||||
struct ibv_exp_reg_mr_resp {
|
||||
__u32 mr_handle;
|
||||
__u32 lkey;
|
||||
__u32 rkey;
|
||||
__u32 reserved;
|
||||
__u64 comp_mask;
|
||||
};
|
||||
|
||||
struct ibv_exp_rereg_mr {
|
||||
struct ex_hdr hdr;
|
||||
__u32 comp_mask;
|
||||
__u32 mr_handle;
|
||||
__u32 flags;
|
||||
__u32 reserved;
|
||||
__u64 start;
|
||||
__u64 length;
|
||||
__u64 hca_va;
|
||||
__u32 pd_handle;
|
||||
__u32 access_flags;
|
||||
};
|
||||
|
||||
struct ibv_exp_rereg_mr_resp {
|
||||
__u32 comp_mask;
|
||||
__u32 lkey;
|
||||
__u32 rkey;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct ibv_exp_cmd_wq_mp_rq {
|
||||
__u32 use_shift; /* use ibv_exp_mp_rq_shifts */
|
||||
__u8 single_wqe_log_num_of_strides;
|
||||
__u8 single_stride_log_num_of_bytes;
|
||||
__u16 reserved;
|
||||
};
|
||||
|
||||
enum ibv_exp_cmd_create_wq_comp_mask {
|
||||
IBV_EXP_CMD_CREATE_WQ_MP_RQ = 1 << 0,
|
||||
IBV_EXP_CMD_CREATE_WQ_VLAN_OFFLOADS = 1 << 1,
|
||||
IBV_EXP_CMD_CREATE_WQ_FLAGS = 1 << 2,
|
||||
};
|
||||
|
||||
struct ibv_exp_create_wq {
|
||||
struct ex_hdr hdr;
|
||||
__u32 comp_mask; /* enum ibv_exp_cmd_create_wq_comp_mask */
|
||||
__u32 wq_type; /* enum ibv_exp_wq_type */
|
||||
__u64 user_handle;
|
||||
__u32 pd_handle;
|
||||
__u32 cq_handle;
|
||||
__u32 max_recv_wr;
|
||||
__u32 max_recv_sge;
|
||||
};
|
||||
|
||||
struct ibv_exp_create_wq_resp {
|
||||
__u32 comp_mask;
|
||||
__u32 response_length;
|
||||
__u32 wq_handle;
|
||||
__u32 max_recv_wr;
|
||||
__u32 max_recv_sge;
|
||||
__u32 wqn;
|
||||
};
|
||||
|
||||
struct ib_exp_destroy_wq {
|
||||
struct ex_hdr hdr;
|
||||
__u32 comp_mask;
|
||||
__u32 wq_handle;
|
||||
};
|
||||
|
||||
struct ibv_destroy_wq_resp {
|
||||
__u32 comp_mask;
|
||||
__u32 response_length;
|
||||
__u32 events_reported;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct ib_exp_modify_wq {
|
||||
struct ex_hdr hdr;
|
||||
__u32 comp_mask;
|
||||
__u32 wq_handle;
|
||||
__u32 wq_state;
|
||||
__u32 curr_wq_state;
|
||||
};
|
||||
|
||||
struct ibv_exp_create_rwq_ind_table {
|
||||
struct ex_hdr hdr;
|
||||
__u32 comp_mask;
|
||||
__u32 log_ind_tbl_size;
|
||||
/* Following are wq handles based on log_ind_tbl_size, must be 64 bytes aligned.
|
||||
* __u32 wq_handle1
|
||||
* __u32 wq_handle2
|
||||
*/
|
||||
};
|
||||
|
||||
struct ibv_exp_create_rwq_ind_table_resp {
|
||||
__u32 comp_mask;
|
||||
__u32 response_length;
|
||||
__u32 ind_tbl_handle;
|
||||
__u32 ind_tbl_num;
|
||||
};
|
||||
|
||||
struct ibv_exp_destroy_rwq_ind_table {
|
||||
struct ex_hdr hdr;
|
||||
__u32 comp_mask;
|
||||
__u32 ind_tbl_handle;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_ipv6_filter {
|
||||
__u8 src_ip[16];
|
||||
__u8 dst_ip[16];
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_spec_ipv6 {
|
||||
__u32 type;
|
||||
__u16 size;
|
||||
__u16 reserved;
|
||||
struct ibv_exp_kern_ipv6_filter val;
|
||||
struct ibv_exp_kern_ipv6_filter mask;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_ipv6_ext_filter {
|
||||
__u8 src_ip[16];
|
||||
__u8 dst_ip[16];
|
||||
__u32 flow_label;
|
||||
__u8 next_hdr;
|
||||
__u8 traffic_class;
|
||||
__u8 hop_limit;
|
||||
__u8 reserved;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_spec_ipv6_ext {
|
||||
__u32 type;
|
||||
__u16 size;
|
||||
__u16 reserved;
|
||||
struct ibv_exp_kern_ipv6_ext_filter val;
|
||||
struct ibv_exp_kern_ipv6_ext_filter mask;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_ipv4_ext_filter {
|
||||
__u32 src_ip;
|
||||
__u32 dst_ip;
|
||||
__u8 proto;
|
||||
__u8 tos;
|
||||
__u8 ttl;
|
||||
__u8 flags;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_spec_ipv4_ext {
|
||||
__u32 type;
|
||||
__u16 size;
|
||||
__u16 reserved;
|
||||
struct ibv_exp_kern_ipv4_ext_filter val;
|
||||
struct ibv_exp_kern_ipv4_ext_filter mask;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_tunnel_filter {
|
||||
__u32 tunnel_id;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_spec_tunnel {
|
||||
__u32 type;
|
||||
__u16 size;
|
||||
__u16 reserved;
|
||||
struct ibv_exp_kern_tunnel_filter val;
|
||||
struct ibv_exp_kern_tunnel_filter mask;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_spec_action_tag {
|
||||
__u32 type;
|
||||
__u16 size;
|
||||
__u16 reserved;
|
||||
__u32 tag_id;
|
||||
__u32 reserved1;
|
||||
};
|
||||
|
||||
struct ibv_exp_kern_spec {
|
||||
union {
|
||||
struct {
|
||||
__u32 type;
|
||||
__u16 size;
|
||||
__u16 reserved;
|
||||
} hdr;
|
||||
struct ibv_kern_spec_ib ib;
|
||||
struct ibv_kern_spec_eth eth;
|
||||
struct ibv_kern_spec_ipv4 ipv4;
|
||||
struct ibv_exp_kern_spec_ipv4_ext ipv4_ext;
|
||||
struct ibv_kern_spec_tcp_udp tcp_udp;
|
||||
struct ibv_exp_kern_spec_ipv6 ipv6;
|
||||
struct ibv_exp_kern_spec_ipv6_ext ipv6_ext;
|
||||
struct ibv_exp_kern_spec_tunnel tunnel;
|
||||
struct ibv_exp_kern_spec_action_tag flow_tag;
|
||||
};
|
||||
};
|
||||
#endif /* KERN_ABI_EXP_H */
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef INFINIBAND_MARSHALL_H
|
||||
#define INFINIBAND_MARSHALL_H
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
#include <infiniband/sa.h>
|
||||
#include <infiniband/kern-abi.h>
|
||||
#include <infiniband/sa-kern-abi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define BEGIN_C_DECLS extern "C" {
|
||||
# define END_C_DECLS }
|
||||
#else /* !__cplusplus */
|
||||
# define BEGIN_C_DECLS
|
||||
# define END_C_DECLS
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
void ibv_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
|
||||
struct ibv_kern_qp_attr *src);
|
||||
|
||||
void ibv_copy_ah_attr_from_kern(struct ibv_ah_attr *dst,
|
||||
struct ibv_kern_ah_attr *src);
|
||||
|
||||
void ibv_copy_path_rec_from_kern(struct ibv_sa_path_rec *dst,
|
||||
struct ibv_kern_path_rec *src);
|
||||
|
||||
void ibv_copy_path_rec_to_kern(struct ibv_kern_path_rec *dst,
|
||||
struct ibv_sa_path_rec *src);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* INFINIBAND_MARSHALL_H */
|
|
@ -1,210 +0,0 @@
|
|||
#ifndef INFINIBAND_OFA_VERBS_H
|
||||
#define INFINIBAND_OFA_VERBS_H
|
||||
|
||||
struct ibv_srq_init_attr;
|
||||
struct ibv_cq;
|
||||
struct ibv_pd;
|
||||
struct ibv_qp_init_attr;
|
||||
struct ibv_qp_attr;
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define DEPRECATED __attribute__((deprecated))
|
||||
#else
|
||||
#define DEPRECATED
|
||||
#endif
|
||||
|
||||
/* XRC compatability layer */
|
||||
#define LEGACY_XRC_SRQ_HANDLE 0xffffffff
|
||||
|
||||
struct ibv_xrc_domain {
|
||||
struct ibv_context *context;
|
||||
uint32_t handle;
|
||||
};
|
||||
|
||||
struct ibv_srq_legacy {
|
||||
struct ibv_context *context;
|
||||
void *srq_context;
|
||||
struct ibv_pd *pd;
|
||||
uint32_t handle;
|
||||
|
||||
uint32_t events_completed;
|
||||
|
||||
uint32_t xrc_srq_num_bin_compat;
|
||||
struct ibv_xrc_domain *xrc_domain_bin_compat;
|
||||
struct ibv_cq *xrc_cq_bin_compat;
|
||||
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t cond;
|
||||
/* Here we hook the new one from OFED 2.0 */
|
||||
void *ibv_srq;
|
||||
/* Below 3 fields are for legacy source compatibility, reside
|
||||
* on same offset as of those fields in struct ibv_srq.
|
||||
*/
|
||||
uint32_t xrc_srq_num;
|
||||
struct ibv_xrc_domain *xrc_domain;
|
||||
struct ibv_cq *xrc_cq;
|
||||
};
|
||||
|
||||
/**
|
||||
* ibv_open_xrc_domain - open an XRC domain
|
||||
* Returns a reference to an XRC domain.
|
||||
*
|
||||
* @context: Device context
|
||||
* @fd: descriptor for inode associated with the domain
|
||||
* If fd == -1, no inode is associated with the domain; in this ca= se,
|
||||
* the only legal value for oflag is O_CREAT
|
||||
*
|
||||
* @oflag: oflag values are constructed by OR-ing flags from the following list
|
||||
*
|
||||
* O_CREAT
|
||||
* If a domain belonging to device named by context is already associated
|
||||
* with the inode, this flag has no effect, except as noted under O_EXCL
|
||||
* below. Otherwise, a new XRC domain is created and is associated with
|
||||
* inode specified by fd.
|
||||
*
|
||||
* O_EXCL
|
||||
* If O_EXCL and O_CREAT are set, open will fail if a domain associated with
|
||||
* the inode exists. The check for the existence of the domain and creation
|
||||
* of the domain if it does not exist is atomic with respect to other
|
||||
* processes executing open with fd naming the same inode.
|
||||
*/
|
||||
struct ibv_xrc_domain *ibv_open_xrc_domain(struct ibv_context *context,
|
||||
int fd, int oflag) DEPRECATED;
|
||||
|
||||
/**
|
||||
* ibv_create_xrc_srq - Creates a SRQ associated with the specified protection
|
||||
* domain and xrc domain.
|
||||
* @pd: The protection domain associated with the SRQ.
|
||||
* @xrc_domain: The XRC domain associated with the SRQ.
|
||||
* @xrc_cq: CQ to report completions for XRC packets on.
|
||||
*
|
||||
* @srq_init_attr: A list of initial attributes required to create the SRQ.
|
||||
*
|
||||
* srq_attr->max_wr and srq_attr->max_sge are read the determine the
|
||||
* requested size of the SRQ, and set to the actual values allocated
|
||||
* on return. If ibv_create_srq() succeeds, then max_wr and max_sge
|
||||
* will always be at least as large as the requested values.
|
||||
*/
|
||||
struct ibv_srq *ibv_create_xrc_srq(struct ibv_pd *pd,
|
||||
struct ibv_xrc_domain *xrc_domain,
|
||||
struct ibv_cq *xrc_cq,
|
||||
struct ibv_srq_init_attr *srq_init_attr) DEPRECATED;
|
||||
|
||||
/**
|
||||
* ibv_close_xrc_domain - close an XRC domain
|
||||
* If this is the last reference, destroys the domain.
|
||||
*
|
||||
* @d: reference to XRC domain to close
|
||||
*
|
||||
* close is implicitly performed at process exit.
|
||||
*/
|
||||
int ibv_close_xrc_domain(struct ibv_xrc_domain *d) DEPRECATED;
|
||||
|
||||
/**
|
||||
* ibv_create_xrc_rcv_qp - creates an XRC QP for serving as a receive-side-only QP,
|
||||
*
|
||||
* This QP is created in kernel space, and persists until the last process
|
||||
* registered for the QP calls ibv_unreg_xrc_rcv_qp() (at which time the QP
|
||||
* is destroyed).
|
||||
*
|
||||
* @init_attr: init attributes to use for QP. xrc domain MUST be included here.
|
||||
* All other fields are ignored.
|
||||
*
|
||||
* @xrc_rcv_qpn: qp_num of created QP (if success). To be passed to the
|
||||
* remote node (sender). The remote node will use xrc_rcv_qpn
|
||||
* in ibv_post_send when sending to XRC SRQ's on this host
|
||||
* in the same xrc domain.
|
||||
*
|
||||
* RETURNS: success (0), or a (negative) error value.
|
||||
*
|
||||
* NOTE: this verb also registers the calling user-process with the QP at its
|
||||
* creation time (implicit call to ibv_reg_xrc_rcv_qp), to avoid race
|
||||
* conditions. The creating process will need to call ibv_unreg_xrc_qp()
|
||||
* for the QP to release it from this process.
|
||||
*/
|
||||
int ibv_create_xrc_rcv_qp(struct ibv_qp_init_attr *init_attr,
|
||||
uint32_t *xrc_rcv_qpn) DEPRECATED;
|
||||
|
||||
/**
|
||||
* ibv_modify_xrc_rcv_qp - modifies an xrc_rcv qp.
|
||||
*
|
||||
* @xrc_domain: xrc domain the QP belongs to (for verification).
|
||||
* @xrc_qp_num: The (24 bit) number of the XRC QP.
|
||||
* @attr: modify-qp attributes. The following fields must be specified:
|
||||
* for RESET_2_INIT: qp_state, pkey_index , port, qp_access_flags
|
||||
* for INIT_2_RTR: qp_state, path_mtu, dest_qp_num, rq_psn,
|
||||
* max_dest_rd_atomic, min_rnr_timer, ah_attr
|
||||
* The QP need not be brought to RTS for the QP to operate as a
|
||||
* receive-only QP.
|
||||
* @attr_mask: bitmap indicating which attributes are provided in the attr
|
||||
* struct. Used for validity checking.
|
||||
* The following bits must be set:
|
||||
* for RESET_2_INIT: IBV_QP_PKEY_INDEX, IBV_QP_PORT,
|
||||
* IBV_QP_ACCESS_FLAGS, IBV_QP_STATE
|
||||
* for INIT_2_RTR: IBV_QP_AV, IBV_QP_PATH_MTU, IBV_QP_DEST_QPN,
|
||||
* IBV_QP_RQ_PSN, IBV_QP_MAX_DEST_RD_ATOMIC,
|
||||
* IBV_QP_MIN_RNR_TIMER, IBV_QP_STATE
|
||||
*
|
||||
* RETURNS: success (0), or a (positive) error value.
|
||||
*
|
||||
*/
|
||||
int ibv_modify_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain,
|
||||
uint32_t xrc_qp_num,
|
||||
struct ibv_qp_attr *attr, int attr_mask) DEPRECATED;
|
||||
|
||||
/**
|
||||
* ibv_query_xrc_rcv_qp - queries an xrc_rcv qp.
|
||||
*
|
||||
* @xrc_domain: xrc domain the QP belongs to (for verification).
|
||||
* @xrc_qp_num: The (24 bit) number of the XRC QP.
|
||||
* @attr: for returning qp attributes.
|
||||
* @attr_mask: bitmap indicating which attributes to return.
|
||||
* @init_attr: for returning the init attributes
|
||||
*
|
||||
* RETURNS: success (0), or a (positive) error value.
|
||||
*
|
||||
*/
|
||||
int ibv_query_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain, uint32_t xrc_qp_num,
|
||||
struct ibv_qp_attr *attr, int attr_mask,
|
||||
struct ibv_qp_init_attr *init_attr) DEPRECATED;
|
||||
|
||||
/**
|
||||
* ibv_reg_xrc_rcv_qp: registers a user process with an XRC QP which serves as
|
||||
* a receive-side only QP.
|
||||
*
|
||||
* @xrc_domain: xrc domain the QP belongs to (for verification).
|
||||
* @xrc_qp_num: The (24 bit) number of the XRC QP.
|
||||
*
|
||||
* RETURNS: success (0),
|
||||
* or error (EINVAL), if:
|
||||
* 1. There is no such QP_num allocated.
|
||||
* 2. The QP is allocated, but is not an receive XRC QP
|
||||
* 3. The XRC QP does not belong to the given domain.
|
||||
*/
|
||||
int ibv_reg_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain,
|
||||
uint32_t xrc_qp_num) DEPRECATED;
|
||||
|
||||
/**
|
||||
* ibv_unreg_xrc_rcv_qp: detaches a user process from an XRC QP serving as
|
||||
* a receive-side only QP. If as a result, there are no remaining
|
||||
* userspace processes registered for this XRC QP, it is destroyed.
|
||||
*
|
||||
* @xrc_domain: xrc domain the QP belongs to (for verification).
|
||||
* @xrc_qp_num: The (24 bit) number of the XRC QP.
|
||||
*
|
||||
* RETURNS: success (0),
|
||||
* or error (EINVAL), if:
|
||||
* 1. There is no such QP_num allocated.
|
||||
* 2. The QP is allocated, but is not an XRC QP
|
||||
* 3. The XRC QP does not belong to the given domain.
|
||||
* NOTE: There is no reason to return a special code if the QP is destroyed.
|
||||
* The unregister simply succeeds.
|
||||
*/
|
||||
int ibv_unreg_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain,
|
||||
uint32_t xrc_qp_num) DEPRECATED;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef INFINIBAND_OPCODE_H
|
||||
#define INFINIBAND_OPCODE_H
|
||||
|
||||
/*
|
||||
* This macro cleans up the definitions of constants for BTH opcodes.
|
||||
* It is used to define constants such as IBV_OPCODE_UD_SEND_ONLY,
|
||||
* which becomes IBV_OPCODE_UD + IBV_OPCODE_SEND_ONLY, and this gives
|
||||
* the correct value.
|
||||
*
|
||||
* In short, user code should use the constants defined using the
|
||||
* macro rather than worrying about adding together other constants.
|
||||
*/
|
||||
#define IBV_OPCODE(transport, op) \
|
||||
IBV_OPCODE_ ## transport ## _ ## op = \
|
||||
IBV_OPCODE_ ## transport + IBV_OPCODE_ ## op
|
||||
|
||||
enum {
|
||||
/* transport types -- just used to define real constants */
|
||||
IBV_OPCODE_RC = 0x00,
|
||||
IBV_OPCODE_UC = 0x20,
|
||||
IBV_OPCODE_RD = 0x40,
|
||||
IBV_OPCODE_UD = 0x60,
|
||||
|
||||
/* operations -- just used to define real constants */
|
||||
IBV_OPCODE_SEND_FIRST = 0x00,
|
||||
IBV_OPCODE_SEND_MIDDLE = 0x01,
|
||||
IBV_OPCODE_SEND_LAST = 0x02,
|
||||
IBV_OPCODE_SEND_LAST_WITH_IMMEDIATE = 0x03,
|
||||
IBV_OPCODE_SEND_ONLY = 0x04,
|
||||
IBV_OPCODE_SEND_ONLY_WITH_IMMEDIATE = 0x05,
|
||||
IBV_OPCODE_RDMA_WRITE_FIRST = 0x06,
|
||||
IBV_OPCODE_RDMA_WRITE_MIDDLE = 0x07,
|
||||
IBV_OPCODE_RDMA_WRITE_LAST = 0x08,
|
||||
IBV_OPCODE_RDMA_WRITE_LAST_WITH_IMMEDIATE = 0x09,
|
||||
IBV_OPCODE_RDMA_WRITE_ONLY = 0x0a,
|
||||
IBV_OPCODE_RDMA_WRITE_ONLY_WITH_IMMEDIATE = 0x0b,
|
||||
IBV_OPCODE_RDMA_READ_REQUEST = 0x0c,
|
||||
IBV_OPCODE_RDMA_READ_RESPONSE_FIRST = 0x0d,
|
||||
IBV_OPCODE_RDMA_READ_RESPONSE_MIDDLE = 0x0e,
|
||||
IBV_OPCODE_RDMA_READ_RESPONSE_LAST = 0x0f,
|
||||
IBV_OPCODE_RDMA_READ_RESPONSE_ONLY = 0x10,
|
||||
IBV_OPCODE_ACKNOWLEDGE = 0x11,
|
||||
IBV_OPCODE_ATOMIC_ACKNOWLEDGE = 0x12,
|
||||
IBV_OPCODE_COMPARE_SWAP = 0x13,
|
||||
IBV_OPCODE_FETCH_ADD = 0x14,
|
||||
|
||||
/* real constants follow -- see comment about above IBV_OPCODE()
|
||||
macro for more details */
|
||||
|
||||
/* RC */
|
||||
IBV_OPCODE(RC, SEND_FIRST),
|
||||
IBV_OPCODE(RC, SEND_MIDDLE),
|
||||
IBV_OPCODE(RC, SEND_LAST),
|
||||
IBV_OPCODE(RC, SEND_LAST_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RC, SEND_ONLY),
|
||||
IBV_OPCODE(RC, SEND_ONLY_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RC, RDMA_WRITE_FIRST),
|
||||
IBV_OPCODE(RC, RDMA_WRITE_MIDDLE),
|
||||
IBV_OPCODE(RC, RDMA_WRITE_LAST),
|
||||
IBV_OPCODE(RC, RDMA_WRITE_LAST_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RC, RDMA_WRITE_ONLY),
|
||||
IBV_OPCODE(RC, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RC, RDMA_READ_REQUEST),
|
||||
IBV_OPCODE(RC, RDMA_READ_RESPONSE_FIRST),
|
||||
IBV_OPCODE(RC, RDMA_READ_RESPONSE_MIDDLE),
|
||||
IBV_OPCODE(RC, RDMA_READ_RESPONSE_LAST),
|
||||
IBV_OPCODE(RC, RDMA_READ_RESPONSE_ONLY),
|
||||
IBV_OPCODE(RC, ACKNOWLEDGE),
|
||||
IBV_OPCODE(RC, ATOMIC_ACKNOWLEDGE),
|
||||
IBV_OPCODE(RC, COMPARE_SWAP),
|
||||
IBV_OPCODE(RC, FETCH_ADD),
|
||||
|
||||
/* UC */
|
||||
IBV_OPCODE(UC, SEND_FIRST),
|
||||
IBV_OPCODE(UC, SEND_MIDDLE),
|
||||
IBV_OPCODE(UC, SEND_LAST),
|
||||
IBV_OPCODE(UC, SEND_LAST_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(UC, SEND_ONLY),
|
||||
IBV_OPCODE(UC, SEND_ONLY_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(UC, RDMA_WRITE_FIRST),
|
||||
IBV_OPCODE(UC, RDMA_WRITE_MIDDLE),
|
||||
IBV_OPCODE(UC, RDMA_WRITE_LAST),
|
||||
IBV_OPCODE(UC, RDMA_WRITE_LAST_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(UC, RDMA_WRITE_ONLY),
|
||||
IBV_OPCODE(UC, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
|
||||
|
||||
/* RD */
|
||||
IBV_OPCODE(RD, SEND_FIRST),
|
||||
IBV_OPCODE(RD, SEND_MIDDLE),
|
||||
IBV_OPCODE(RD, SEND_LAST),
|
||||
IBV_OPCODE(RD, SEND_LAST_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RD, SEND_ONLY),
|
||||
IBV_OPCODE(RD, SEND_ONLY_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RD, RDMA_WRITE_FIRST),
|
||||
IBV_OPCODE(RD, RDMA_WRITE_MIDDLE),
|
||||
IBV_OPCODE(RD, RDMA_WRITE_LAST),
|
||||
IBV_OPCODE(RD, RDMA_WRITE_LAST_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RD, RDMA_WRITE_ONLY),
|
||||
IBV_OPCODE(RD, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
|
||||
IBV_OPCODE(RD, RDMA_READ_REQUEST),
|
||||
IBV_OPCODE(RD, RDMA_READ_RESPONSE_FIRST),
|
||||
IBV_OPCODE(RD, RDMA_READ_RESPONSE_MIDDLE),
|
||||
IBV_OPCODE(RD, RDMA_READ_RESPONSE_LAST),
|
||||
IBV_OPCODE(RD, RDMA_READ_RESPONSE_ONLY),
|
||||
IBV_OPCODE(RD, ACKNOWLEDGE),
|
||||
IBV_OPCODE(RD, ATOMIC_ACKNOWLEDGE),
|
||||
IBV_OPCODE(RD, COMPARE_SWAP),
|
||||
IBV_OPCODE(RD, FETCH_ADD),
|
||||
|
||||
/* UD */
|
||||
IBV_OPCODE(UD, SEND_ONLY),
|
||||
IBV_OPCODE(UD, SEND_ONLY_WITH_IMMEDIATE)
|
||||
};
|
||||
|
||||
#endif /* INFINIBAND_OPCODE_H */
|
|
@ -1,370 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Mellanox Technologies Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef PEER_OPS_H
|
||||
#define PEER_OPS_H
|
||||
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <infiniband/verbs.h>
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
enum ibv_exp_peer_op {
|
||||
IBV_EXP_PEER_OP_RESERVED1 = 1,
|
||||
|
||||
IBV_EXP_PEER_OP_FENCE = 0,
|
||||
|
||||
IBV_EXP_PEER_OP_STORE_DWORD = 4,
|
||||
IBV_EXP_PEER_OP_STORE_QWORD = 2,
|
||||
IBV_EXP_PEER_OP_COPY_BLOCK = 3,
|
||||
|
||||
IBV_EXP_PEER_OP_POLL_AND_DWORD = 12,
|
||||
IBV_EXP_PEER_OP_POLL_NOR_DWORD = 13,
|
||||
IBV_EXP_PEER_OP_POLL_GEQ_DWORD = 14,
|
||||
};
|
||||
|
||||
enum ibv_exp_peer_op_caps {
|
||||
IBV_EXP_PEER_OP_FENCE_CAP = (1 << IBV_EXP_PEER_OP_FENCE),
|
||||
IBV_EXP_PEER_OP_STORE_DWORD_CAP = (1 << IBV_EXP_PEER_OP_STORE_DWORD),
|
||||
IBV_EXP_PEER_OP_STORE_QWORD_CAP = (1 << IBV_EXP_PEER_OP_STORE_QWORD),
|
||||
IBV_EXP_PEER_OP_COPY_BLOCK_CAP = (1 << IBV_EXP_PEER_OP_COPY_BLOCK),
|
||||
IBV_EXP_PEER_OP_POLL_AND_DWORD_CAP
|
||||
= (1 << IBV_EXP_PEER_OP_POLL_AND_DWORD),
|
||||
IBV_EXP_PEER_OP_POLL_NOR_DWORD_CAP
|
||||
= (1 << IBV_EXP_PEER_OP_POLL_NOR_DWORD),
|
||||
IBV_EXP_PEER_OP_POLL_GEQ_DWORD_CAP
|
||||
= (1 << IBV_EXP_PEER_OP_POLL_GEQ_DWORD),
|
||||
};
|
||||
|
||||
enum ibv_exp_peer_fence {
|
||||
IBV_EXP_PEER_FENCE_OP_READ = (1 << 0),
|
||||
IBV_EXP_PEER_FENCE_OP_WRITE = (1 << 1),
|
||||
IBV_EXP_PEER_FENCE_FROM_CPU = (1 << 2),
|
||||
IBV_EXP_PEER_FENCE_FROM_HCA = (1 << 3),
|
||||
IBV_EXP_PEER_FENCE_MEM_SYS = (1 << 4),
|
||||
IBV_EXP_PEER_FENCE_MEM_PEER = (1 << 5),
|
||||
};
|
||||
|
||||
/* Indicate HW entities supposed to access memory buffer:
|
||||
* IBV_EXP_PEER_DIRECTION_FROM_X means X writes to the buffer
|
||||
* IBV_EXP_PEER_DIRECTION_TO_Y means Y read from the buffer
|
||||
*/
|
||||
enum ibv_exp_peer_direction {
|
||||
IBV_EXP_PEER_DIRECTION_FROM_CPU = (1 << 0),
|
||||
IBV_EXP_PEER_DIRECTION_FROM_HCA = (1 << 1),
|
||||
IBV_EXP_PEER_DIRECTION_FROM_PEER = (1 << 2),
|
||||
IBV_EXP_PEER_DIRECTION_TO_CPU = (1 << 3),
|
||||
IBV_EXP_PEER_DIRECTION_TO_HCA = (1 << 4),
|
||||
IBV_EXP_PEER_DIRECTION_TO_PEER = (1 << 5),
|
||||
};
|
||||
|
||||
struct ibv_exp_peer_buf_alloc_attr {
|
||||
size_t length;
|
||||
/* Bitmask from enum ibv_exp_peer_direction */
|
||||
uint32_t dir;
|
||||
/* The ID of the peer device which will be
|
||||
* accessing the allocated buffer
|
||||
*/
|
||||
uint64_t peer_id;
|
||||
/* Data alignment */
|
||||
uint32_t alignment;
|
||||
/* Reserved for future extensions, must be 0 */
|
||||
uint32_t comp_mask;
|
||||
};
|
||||
|
||||
struct ibv_exp_peer_buf {
|
||||
void *addr;
|
||||
size_t length;
|
||||
/* Reserved for future extensions, must be 0 */
|
||||
uint32_t comp_mask;
|
||||
};
|
||||
|
||||
enum ibv_exp_peer_direct_attr_mask {
|
||||
IBV_EXP_PEER_DIRECT_VERSION = (1 << 0) /* Must be set */
|
||||
};
|
||||
|
||||
#define IBV_EXP_PEER_IOMEMORY ((struct ibv_exp_peer_buf *)-1UL)
|
||||
|
||||
struct ibv_exp_peer_direct_attr {
|
||||
/* Unique ID per peer device.
|
||||
* Used to identify specific HW devices where relevant.
|
||||
*/
|
||||
uint64_t peer_id;
|
||||
/* buf_alloc callback should return struct ibv_exp_peer_buf with buffer
|
||||
* of at least attr->length.
|
||||
* @attr: description of desired buffer
|
||||
*
|
||||
* Buffer should be mapped in the application address space
|
||||
* for read/write (depends on attr->dir value).
|
||||
* attr->dir value is supposed to indicate the expected directions
|
||||
* of access to the buffer, to allow optimization by the peer driver.
|
||||
* If NULL returned then buffer will be allocated in system memory
|
||||
* by ibverbs driver.
|
||||
*/
|
||||
struct ibv_exp_peer_buf *(*buf_alloc)(struct ibv_exp_peer_buf_alloc_attr *attr);
|
||||
/* If buffer was allocated by buf_alloc then buf_release will be
|
||||
* called to release it.
|
||||
* @pb: struct returned by buf_alloc
|
||||
*
|
||||
* buf_release is responsible to release everything allocated by
|
||||
* buf_alloc.
|
||||
* Return 0 on succes.
|
||||
*/
|
||||
int (*buf_release)(struct ibv_exp_peer_buf *pb);
|
||||
/* register_va callback should register virtual address from the
|
||||
* application as an area the peer is allowed to access.
|
||||
* @start: pointer to beginning of region in virtual space
|
||||
* @length: length of region
|
||||
* @peer_id: the ID of the peer device which will be accessing
|
||||
* the region.
|
||||
* @pb: if registering a buffer that was returned from buf_alloc(),
|
||||
* pb is the struct that was returned. If registering io memory area,
|
||||
* pb is IBV_EXP_PEER_IOMEMORY. Otherwise - NULL
|
||||
*
|
||||
* Return id of registered address on success, 0 on failure.
|
||||
*/
|
||||
uint64_t (*register_va)(void *start, size_t length, uint64_t peer_id,
|
||||
struct ibv_exp_peer_buf *pb);
|
||||
/* If virtual address was registered with register_va then
|
||||
* unregister_va will be called to unregister it.
|
||||
* @target_id: id returned by register_va
|
||||
* @peer_id: the ID of the peer device passed to register_va
|
||||
*
|
||||
* Return 0 on success.
|
||||
*/
|
||||
int (*unregister_va)(uint64_t target_id, uint64_t peer_id);
|
||||
/* Bitmask from ibv_exp_peer_op_caps */
|
||||
uint64_t caps;
|
||||
/* Maximal length of DMA operation the peer can do in copy-block */
|
||||
size_t peer_dma_op_map_len;
|
||||
/* From ibv_exp_peer_direct_attr_mask */
|
||||
uint32_t comp_mask;
|
||||
/* Feature version, must be 1 */
|
||||
uint32_t version;
|
||||
};
|
||||
|
||||
/* QP API - CPU posts send work-requests without exposing them to the HW.
|
||||
* Later, the peer device exposes the relevant work requests to the HCA
|
||||
* for execution.
|
||||
*/
|
||||
|
||||
struct peer_op_wr {
|
||||
struct peer_op_wr *next;
|
||||
enum ibv_exp_peer_op type;
|
||||
union {
|
||||
struct {
|
||||
uint64_t fence_flags; /* from ibv_exp_peer_fence */
|
||||
} fence;
|
||||
|
||||
struct {
|
||||
uint32_t data;
|
||||
uint64_t target_id;
|
||||
size_t offset;
|
||||
} dword_va; /* Use for all operations targeting dword */
|
||||
|
||||
struct {
|
||||
uint64_t data;
|
||||
uint64_t target_id;
|
||||
size_t offset;
|
||||
} qword_va; /* Use for all operations targeting qword */
|
||||
|
||||
struct {
|
||||
void *src;
|
||||
uint64_t target_id;
|
||||
size_t offset;
|
||||
size_t len;
|
||||
} copy_op;
|
||||
} wr;
|
||||
uint32_t comp_mask; /* Reserved for future expensions, must be 0 */
|
||||
};
|
||||
|
||||
struct ibv_exp_peer_commit {
|
||||
/* IN/OUT - linked list of empty/filled descriptors */
|
||||
struct peer_op_wr *storage;
|
||||
/* IN/OUT - number of allocated/filled descriptors */
|
||||
uint32_t entries;
|
||||
/* OUT - identifier used in ibv_exp_rollback_qp to rollback WQEs set */
|
||||
uint64_t rollback_id;
|
||||
uint32_t comp_mask; /* Reserved for future expensions, must be 0 */
|
||||
};
|
||||
|
||||
/**
|
||||
* ibv_exp_peer_commit_qp - request descriptors for committing all WQEs
|
||||
* currently posted to the send work queue
|
||||
* @qp: the QP being requested
|
||||
* @peer: context with list of &struct peer_op_wr describing actions
|
||||
* necessary to commit WQEs
|
||||
*
|
||||
* Function
|
||||
* - fill peer->storage with descriptors
|
||||
* - put number of filled descriptors to peer->entries;
|
||||
* - put data necessary for rollback to peer->rollback_id
|
||||
* If number of entries is not sufficient - return -ENOSPC
|
||||
*
|
||||
* Note: caller is responsible to ensure that the peer fences any data store
|
||||
* before executing the commit
|
||||
*/
|
||||
static inline int ibv_exp_peer_commit_qp(struct ibv_qp *qp,
|
||||
struct ibv_exp_peer_commit *peer)
|
||||
{
|
||||
struct verbs_context_exp *vctx;
|
||||
|
||||
vctx = verbs_get_exp_ctx_op(qp->context, exp_peer_commit_qp);
|
||||
if (!vctx)
|
||||
return ENOSYS;
|
||||
|
||||
return vctx->exp_peer_commit_qp(qp, peer);
|
||||
}
|
||||
|
||||
enum ibv_exp_rollback_flags {
|
||||
/* Abort all WQEs which were not committed to HW yet.
|
||||
* rollback_id is ignored. **/
|
||||
IBV_EXP_ROLLBACK_ABORT_UNCOMMITED = (1 << 0),
|
||||
/* Abort the request even if there are following requests
|
||||
* being aborted as well. **/
|
||||
IBV_EXP_ROLLBACK_ABORT_LATE = (1 << 1),
|
||||
};
|
||||
|
||||
struct ibv_exp_rollback_ctx {
|
||||
uint64_t rollback_id; /* from ibv_exp_peer_commit call */
|
||||
uint32_t flags; /* from ibv_exp_rollback_flags */
|
||||
uint32_t comp_mask; /* Reserved for future expensions, must be 0 */
|
||||
};
|
||||
|
||||
/**
|
||||
* ibv_exp_rollback_qp - indicate that the commit attempt failed
|
||||
* @qp: the QP being rolled back
|
||||
* @rollback: context with rollback_id returned by
|
||||
* earlier ibv_exp_peer_commit_qp and flags
|
||||
*/
|
||||
static inline int ibv_exp_rollback_qp(struct ibv_qp *qp,
|
||||
struct ibv_exp_rollback_ctx *rollback)
|
||||
{
|
||||
struct verbs_context_exp *vctx;
|
||||
|
||||
vctx = verbs_get_exp_ctx_op(qp->context, exp_rollback_send);
|
||||
if (!vctx)
|
||||
return ENOSYS;
|
||||
|
||||
return vctx->exp_rollback_send(qp, rollback);
|
||||
}
|
||||
|
||||
/* CQ interface - peek into a CQ and describe how to check if
|
||||
* there is a CQ entry available.
|
||||
*/
|
||||
|
||||
enum {
|
||||
IBV_EXP_PEER_PEEK_ABSOLUTE,
|
||||
IBV_EXP_PEER_PEEK_RELATIVE
|
||||
};
|
||||
|
||||
struct ibv_exp_peer_peek {
|
||||
/* IN/OUT - linked list of empty/filled descriptors */
|
||||
struct peer_op_wr *storage;
|
||||
/* IN/OUT - number of allocated/filled descriptors */
|
||||
uint32_t entries;
|
||||
/* IN - Which CQ entry does the peer want to peek for
|
||||
* completion. According to "whence" directive entry
|
||||
* chosen as follows:
|
||||
* IBV_EXP_PEER_PEEK_ABSOLUTE -
|
||||
* "offset" is absolute index of entry wrapped to 32-bit
|
||||
* IBV_EXP_PEER_PEEK_RELATIVE -
|
||||
* "offset" is relative to current poll_cq location.
|
||||
*/
|
||||
uint32_t whence;
|
||||
uint32_t offset;
|
||||
/* OUT - identifier used in ibv_exp_peer_ack_peek_cq to advance CQ */
|
||||
uint64_t peek_id;
|
||||
uint32_t comp_mask; /* Reserved for future expensions, must be 0 */
|
||||
};
|
||||
|
||||
/**
|
||||
* ibv_exp_peer_peek_cq - request descriptors for peeking CQ in specific
|
||||
* offset from currently expected CQ entry.
|
||||
* @cq: the CQ being requested
|
||||
* @peer_ctx: context with list of &struct peer_op_wr describing actions
|
||||
* necessary to wait for desired CQ entry is delivered and report
|
||||
* this to ibverbs.
|
||||
*
|
||||
* A peek CQ request places a "block" on the relevant CQ entry.
|
||||
* Poll CQ requests to poll the CQ entry will fail with an error.
|
||||
* The block will be removed by executing the descriptors.
|
||||
* If the peer will not be able to execute the descriptors,
|
||||
* it should call ibv_exp_peer_abort_peek_cq to remove the block.
|
||||
*
|
||||
* Function
|
||||
* - fill peek_ctx->storage with descriptors.
|
||||
* - put number of filled descriptors to peek_ctx->entries.
|
||||
* - put data necessary to abort peek.
|
||||
* If number of entries is not sufficient - return -ENOSPC.
|
||||
*/
|
||||
static inline int ibv_exp_peer_peek_cq(struct ibv_cq *cq,
|
||||
struct ibv_exp_peer_peek *peek_ctx)
|
||||
{
|
||||
struct verbs_context_exp *vctx;
|
||||
|
||||
vctx = verbs_get_exp_ctx_op(cq->context, exp_peer_peek_cq);
|
||||
if (!vctx)
|
||||
return ENOSYS;
|
||||
|
||||
return vctx->exp_peer_peek_cq(cq, peek_ctx);
|
||||
}
|
||||
|
||||
struct ibv_exp_peer_abort_peek {
|
||||
uint64_t peek_id; /* From the peer_peek_cq call */
|
||||
uint32_t comp_mask; /* Reserved for future expensions, must be 0 */
|
||||
};
|
||||
|
||||
/**
|
||||
* ibv_exp_peer_abort_peek_cq - indicate that peek is aborted
|
||||
* @cq: the CQ being rolled back
|
||||
* @abort_ctx: context with peek_id returned by earlier ibv_exp_peer_peek_cq
|
||||
*
|
||||
* Note: This should be done only if the peek descriptors were not executed
|
||||
*/
|
||||
static inline int ibv_exp_peer_abort_peek_cq(struct ibv_cq *cq,
|
||||
struct ibv_exp_peer_abort_peek *abort_ctx)
|
||||
{
|
||||
struct verbs_context_exp *vctx;
|
||||
|
||||
vctx = verbs_get_exp_ctx_op(cq->context, exp_peer_abort_peek_cq);
|
||||
if (!vctx)
|
||||
return ENOSYS;
|
||||
|
||||
return vctx->exp_peer_abort_peek_cq(cq, abort_ctx);
|
||||
}
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* PEER_OPS_H */
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef INFINIBAND_SA_KERN_ABI_H
|
||||
#define INFINIBAND_SA_KERN_ABI_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Obsolete, deprecated names. Will be removed in libibverbs 1.1.
|
||||
*/
|
||||
#define ib_kern_path_rec ibv_kern_path_rec
|
||||
|
||||
struct ibv_kern_path_rec {
|
||||
__u8 dgid[16];
|
||||
__u8 sgid[16];
|
||||
__u16 dlid;
|
||||
__u16 slid;
|
||||
__u32 raw_traffic;
|
||||
__u32 flow_label;
|
||||
__u32 reversible;
|
||||
__u32 mtu;
|
||||
__u16 pkey;
|
||||
__u8 hop_limit;
|
||||
__u8 traffic_class;
|
||||
__u8 numb_path;
|
||||
__u8 sl;
|
||||
__u8 mtu_selector;
|
||||
__u8 rate_selector;
|
||||
__u8 rate;
|
||||
__u8 packet_life_time_selector;
|
||||
__u8 packet_life_time;
|
||||
__u8 preference;
|
||||
};
|
||||
|
||||
#endif /* INFINIBAND_SA_KERN_ABI_H */
|
|
@ -1,135 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005 Voltaire, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef INFINIBAND_SA_H
|
||||
#define INFINIBAND_SA_H
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
|
||||
struct ibv_sa_path_rec {
|
||||
/* reserved */
|
||||
/* reserved */
|
||||
union ibv_gid dgid;
|
||||
union ibv_gid sgid;
|
||||
uint16_t dlid;
|
||||
uint16_t slid;
|
||||
int raw_traffic;
|
||||
/* reserved */
|
||||
uint32_t flow_label;
|
||||
uint8_t hop_limit;
|
||||
uint8_t traffic_class;
|
||||
int reversible;
|
||||
uint8_t numb_path;
|
||||
uint16_t pkey;
|
||||
/* reserved */
|
||||
uint8_t sl;
|
||||
uint8_t mtu_selector;
|
||||
uint8_t mtu;
|
||||
uint8_t rate_selector;
|
||||
uint8_t rate;
|
||||
uint8_t packet_life_time_selector;
|
||||
uint8_t packet_life_time;
|
||||
uint8_t preference;
|
||||
};
|
||||
|
||||
struct ibv_sa_mcmember_rec {
|
||||
union ibv_gid mgid;
|
||||
union ibv_gid port_gid;
|
||||
uint32_t qkey;
|
||||
uint16_t mlid;
|
||||
uint8_t mtu_selector;
|
||||
uint8_t mtu;
|
||||
uint8_t traffic_class;
|
||||
uint16_t pkey;
|
||||
uint8_t rate_selector;
|
||||
uint8_t rate;
|
||||
uint8_t packet_life_time_selector;
|
||||
uint8_t packet_life_time;
|
||||
uint8_t sl;
|
||||
uint32_t flow_label;
|
||||
uint8_t hop_limit;
|
||||
uint8_t scope;
|
||||
uint8_t join_state;
|
||||
int proxy_join;
|
||||
};
|
||||
|
||||
struct ibv_sa_service_rec {
|
||||
uint64_t id;
|
||||
union ibv_gid gid;
|
||||
uint16_t pkey;
|
||||
/* uint16_t resv; */
|
||||
uint32_t lease;
|
||||
uint8_t key[16];
|
||||
uint8_t name[64];
|
||||
uint8_t data8[16];
|
||||
uint16_t data16[8];
|
||||
uint32_t data32[4];
|
||||
uint64_t data64[2];
|
||||
};
|
||||
|
||||
#define IBV_PATH_RECORD_REVERSIBLE 0x80
|
||||
|
||||
struct ibv_path_record {
|
||||
uint64_t service_id;
|
||||
union ibv_gid dgid;
|
||||
union ibv_gid sgid;
|
||||
uint16_t dlid;
|
||||
uint16_t slid;
|
||||
uint32_t flowlabel_hoplimit; /* resv-31:28 flow label-27:8 hop limit-7:0*/
|
||||
uint8_t tclass;
|
||||
uint8_t reversible_numpath; /* reversible-7:7 num path-6:0 */
|
||||
uint16_t pkey;
|
||||
uint16_t qosclass_sl; /* qos class-15:4 sl-3:0 */
|
||||
uint8_t mtu; /* mtu selector-7:6 mtu-5:0 */
|
||||
uint8_t rate; /* rate selector-7:6 rate-5:0 */
|
||||
uint8_t packetlifetime; /* lifetime selector-7:6 lifetime-5:0 */
|
||||
uint8_t preference;
|
||||
uint8_t reserved[6];
|
||||
};
|
||||
|
||||
#define IBV_PATH_FLAG_GMP (1<<0)
|
||||
#define IBV_PATH_FLAG_PRIMARY (1<<1)
|
||||
#define IBV_PATH_FLAG_ALTERNATE (1<<2)
|
||||
#define IBV_PATH_FLAG_OUTBOUND (1<<3)
|
||||
#define IBV_PATH_FLAG_INBOUND (1<<4)
|
||||
#define IBV_PATH_FLAG_INBOUND_REVERSE (1<<5)
|
||||
#define IBV_PATH_FLAG_BIDIRECTIONAL (IBV_PATH_FLAG_OUTBOUND | \
|
||||
IBV_PATH_FLAG_INBOUND_REVERSE)
|
||||
|
||||
struct ibv_path_data {
|
||||
uint32_t flags;
|
||||
uint32_t reserved;
|
||||
struct ibv_path_record path;
|
||||
};
|
||||
|
||||
#endif /* INFINIBAND_SA_H */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,192 +0,0 @@
|
|||
###
|
||||
%{!?configure_options: %define configure_options %{nil}}
|
||||
%{!?_with_valgrind: %define _with_valgrind 0}
|
||||
%{!?_disable_valgrind: %define _disable_valgrind 0}
|
||||
|
||||
%if 0%{?rhel} != 0
|
||||
%if 0%{_disable_valgrind} == 0
|
||||
%define _with_valgrind 1
|
||||
%endif
|
||||
%endif
|
||||
###
|
||||
|
||||
Name: libibverbs
|
||||
Version: 1.2.1mlnx1
|
||||
Release: 1%{?dist}
|
||||
Summary: A library for direct userspace use of RDMA (InfiniBand/iWARP) hardware
|
||||
|
||||
Group: System Environment/Libraries
|
||||
License: GPLv2 or BSD
|
||||
Url: http://openfabrics.org/
|
||||
Source: http://openfabrics.org/downloads/verbs/libibverbs-%{version}.tar.gz
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
Requires(post): /sbin/ldconfig
|
||||
Requires(postun): /sbin/ldconfig
|
||||
%if %{_with_valgrind}
|
||||
BuildRequires: valgrind-devel
|
||||
%endif
|
||||
|
||||
%description
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. This includes direct hardware
|
||||
access from userspace to InfiniBand/iWARP adapters (kernel bypass) for
|
||||
fast path operations.
|
||||
|
||||
For this library to be useful, a device-specific plug-in module should
|
||||
also be installed.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for the libibverbs library
|
||||
Group: System Environment/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Provides: %{_prefix}/include/infiniband/verbs.h
|
||||
|
||||
%description devel
|
||||
Header files for the libibverbs library.
|
||||
|
||||
%package devel-static
|
||||
Summary: Static development files for the libibverbs library
|
||||
Group: System Environment/Libraries
|
||||
|
||||
%description devel-static
|
||||
Static libraries for the libibverbs library.
|
||||
|
||||
%package utils
|
||||
Summary: Examples for the libibverbs library
|
||||
Group: System Environment/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description utils
|
||||
Useful libibverbs1 example programs such as ibv_devinfo, which
|
||||
displays information about RDMA devices.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-@VERSION@
|
||||
|
||||
%build
|
||||
%if %{_with_valgrind}
|
||||
%configure %{configure_options} --libdir=%{_libdir}/mlnx_ofed/valgrind --with-valgrind
|
||||
make %{?_smp_mflags}
|
||||
make DESTDIR=$RPM_BUILD_DIR/%{name}-%{version}/valgrind install
|
||||
rm -f $RPM_BUILD_DIR/%{name}-%{version}/valgrind/%{_libdir}/mlnx_ofed/valgrind/*.*a
|
||||
make clean
|
||||
%endif
|
||||
|
||||
%configure %{configure_options}
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make DESTDIR=%{buildroot} install
|
||||
%if %{_with_valgrind}
|
||||
mkdir -p %{buildroot}/%{_libdir}/mlnx_ofed
|
||||
cp -a $RPM_BUILD_DIR/%{name}-%{version}/valgrind/%{_libdir}/mlnx_ofed/valgrind %{buildroot}/%{_libdir}/mlnx_ofed
|
||||
%endif
|
||||
# remove unpackaged files from the buildroot
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/libibverbs*.so.*
|
||||
%if %{_with_valgrind}
|
||||
%{_libdir}/mlnx_ofed/valgrind/libibverbs*.so.*
|
||||
%endif
|
||||
%doc AUTHORS COPYING ChangeLog README
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/lib*.so
|
||||
%if %{_with_valgrind}
|
||||
%{_libdir}/mlnx_ofed/valgrind/lib*.so
|
||||
%endif
|
||||
%{_includedir}/*
|
||||
%{_mandir}/man3/*
|
||||
%{_mandir}/man7/*
|
||||
|
||||
%files devel-static
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/*.a
|
||||
|
||||
%files utils
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/*
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%changelog
|
||||
* Wed Dec 21 2011 Roland Dreier <roland@digitalvampire.org> - 1.1.6-1
|
||||
- New upstream release
|
||||
|
||||
* Tue Jun 28 2011 Roland Dreier <roland@digitalvampire.org> - 1.1.5-1
|
||||
- New upstream release
|
||||
|
||||
* Thu Jun 3 2010 Roland Dreier <rdreier@cisco.com> - 1.1.4-1
|
||||
- New upstream release
|
||||
|
||||
* Thu Oct 29 2009 Roland Dreier <rdreier@cisco.com> - 1.1.3-1
|
||||
- New upstream release
|
||||
|
||||
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||
|
||||
* Wed Apr 16 2008 Roland Dreier <rdreier@cisco.com> - 1.1.2-1
|
||||
- New upstream release
|
||||
- Update description to mention RDMA and iWARP, not just InfiniBand
|
||||
- Add "Requires" tag for libibverbs base package to -devel
|
||||
|
||||
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.1.1-3
|
||||
- Autorebuild for GCC 4.3
|
||||
|
||||
* Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 1.1.1-2
|
||||
- Rebuild for selinux ppc32 issue.
|
||||
|
||||
* Fri Jun 15 2007 Roland Dreier <rdreier@cisco.com> - 1.1.1-1
|
||||
- New upstream release
|
||||
|
||||
* Wed Apr 11 2007 Roland Dreier <rdreier@cisco.com> - 1.1-1
|
||||
- New upstream release
|
||||
|
||||
* Mon May 22 2006 Roland Dreier <rdreier@cisco.com> - 1.1-0.1.rc2
|
||||
- New upstream release
|
||||
- Remove dependency on libsysfs, since it is no longer used
|
||||
- Put section 3 manpages in devel package.
|
||||
- Spec file cleanups: remove unused ver macro, improve BuildRoot, add
|
||||
Requires for /sbin/ldconfig, split static libraries into
|
||||
devel-static package, and don't use makeinstall any more (all
|
||||
suggested by Doug Ledford <dledford@redhat.com>).
|
||||
|
||||
* Thu May 4 2006 Roland Dreier <rdreier@cisco.com> - 1.0.4-1
|
||||
- New upstream release
|
||||
|
||||
* Tue Mar 14 2006 Roland Dreier <rdreier@cisco.com> - 1.0.3-1
|
||||
- New upstream release
|
||||
|
||||
* Mon Mar 13 2006 Roland Dreier <rdreier@cisco.com> - 1.0.1-1
|
||||
- New upstream release
|
||||
|
||||
* Thu Feb 16 2006 Roland Dreier <rdreier@cisco.com> - 1.0-1
|
||||
- New upstream release
|
||||
|
||||
* Wed Feb 15 2006 Roland Dreier <rolandd@cisco.com> - 1.0-0.5.rc7
|
||||
- New upstream release
|
||||
|
||||
* Sun Jan 22 2006 Roland Dreier <rolandd@cisco.com> - 1.0-0.4.rc6
|
||||
- New upstream release
|
||||
|
||||
* Tue Oct 25 2005 Roland Dreier <rolandd@cisco.com> - 1.0-0.3.rc5
|
||||
- New upstream release
|
||||
|
||||
* Wed Oct 5 2005 Roland Dreier <rolandd@cisco.com> - 1.0-0.2.rc4
|
||||
- Update to upstream 1.0-rc4 release
|
||||
|
||||
* Mon Sep 26 2005 Roland Dreier <rolandd@cisco.com> - 1.0-0.1.rc3
|
||||
- Initial attempt at Fedora Extras-compliant spec file
|
|
@ -1,54 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_ALLOC_MW 3 2016-02-02 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_alloc_mw, ibv_dealloc_mw \- allocate or deallocate a memory window (MW)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_mw *ibv_alloc_mw(struct ibv_pd " "*pd" ,
|
||||
.BI " enum ibv_mw_type " "type");
|
||||
.sp
|
||||
.BI "int ibv_dealloc_mw(struct ibv_mw " "*mw" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_alloc_mw()
|
||||
allocates a memory window (MW) associated with the protection domain
|
||||
.I pd\fR.
|
||||
The MW's type (1 or 2A/2B) is
|
||||
.I type\fR.
|
||||
.PP
|
||||
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).
|
||||
Once bound, the memory window allows RDMA (remote) access to a subset of the MR to which it was bound,
|
||||
until invalidated by: ibv_bind_mw verb with zero length for type 1,
|
||||
IBV_WR_LOCAL_INV/IBV_WR_SEND_WITH_INV WR opcode for type 2, deallocation.
|
||||
.PP
|
||||
.B ibv_dealloc_mw()
|
||||
Unbinds in case was previously bound and deallocates the MW
|
||||
.I mw\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_alloc_mw()
|
||||
returns a pointer to the allocated MW, or NULL if the request fails.
|
||||
The remote key (\fBR_Key\fR)
|
||||
field
|
||||
.B rkey
|
||||
is used by remote processes to perform Atomic and RDMA operations. This key will be changed during bind operations. The remote process places this
|
||||
.B rkey
|
||||
as the rkey field of struct ibv_send_wr passed to the ibv_post_send function.
|
||||
.PP
|
||||
.B ibv_dealloc_mw()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.B ibv_dereg_mr()
|
||||
fails if any memory window is still bound to this MR.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_post_send (3),
|
||||
.BR ibv_bind_mw (3),
|
||||
.BR ibv_reg_mr (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Majd Dibbiny <majd@mellanox.com>
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
|
@ -1,40 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_ALLOC_PD 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_alloc_pd, ibv_dealloc_pd \- allocate or deallocate a protection domain (PDs)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_pd *ibv_alloc_pd(struct ibv_context " "*context" );
|
||||
.sp
|
||||
.BI "int ibv_dealloc_pd(struct ibv_pd " "*pd" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_alloc_pd()
|
||||
allocates a PD for the RDMA device context
|
||||
.I context\fR.
|
||||
.PP
|
||||
.B ibv_dealloc_pd()
|
||||
deallocates the PD
|
||||
.I pd\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_alloc_pd()
|
||||
returns a pointer to the allocated PD, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_dealloc_pd()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.B ibv_dealloc_pd()
|
||||
may fail if any other resource is still associated with the PD being
|
||||
freed.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_reg_mr (3),
|
||||
.BR ibv_create_srq (3),
|
||||
.BR ibv_create_qp (3),
|
||||
.BR ibv_create_ah (3),
|
||||
.BR ibv_create_ah_from_wc (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,16 +0,0 @@
|
|||
.TH IBV_ASYNCWATCH 1 "August 30, 2005" "libibverbs" "USER COMMANDS"
|
||||
|
||||
.SH NAME
|
||||
ibv_asyncwatch \- display asynchronous events
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B ibv_asyncwatch
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Display asynchronous events forwarded to userspace for an RDMA device.
|
||||
|
||||
.SH AUTHORS
|
||||
.TP
|
||||
Roland Dreier
|
||||
.RI < rolandd@cisco.com >
|
|
@ -1,53 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_ATTACH_MCAST 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_attach_mcast, ibv_detach_mcast \- attach and detach a queue pair
|
||||
(QPs) to/from a multicast group
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "int ibv_attach_mcast(struct ibv_qp " "*qp" ", const union ibv_gid " "*gid" ",
|
||||
.BI " uint16_t " "lid" ");
|
||||
.sp
|
||||
.BI "int ibv_detach_mcast(struct ibv_qp " "*qp" ", const union ibv_gid " "*gid" ",
|
||||
.BI " uint16_t " "lid" ");
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_attach_mcast()
|
||||
attaches the QP
|
||||
.I qp
|
||||
to the multicast group having MGID
|
||||
.I gid
|
||||
and MLID
|
||||
.I lid\fR.
|
||||
.PP
|
||||
.B ibv_detach_mcast()
|
||||
detaches the QP
|
||||
.I qp
|
||||
to the multicast group having MGID
|
||||
.I gid
|
||||
and MLID
|
||||
.I lid\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_attach_mcast()
|
||||
and
|
||||
.B ibv_detach_mcast()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
Only QPs of Transport Service Type
|
||||
.BR IBV_QPT_UD
|
||||
may be attached to multicast groups.
|
||||
.PP
|
||||
If a QP is attached to the same multicast group multiple times, the QP will still receive a single copy of a multicast message.
|
||||
.PP
|
||||
In order to receive multicast messages, a join request for the
|
||||
multicast group must be sent to the subnet administrator (SA), so that
|
||||
the fabric's multicast routing is configured to deliver messages to
|
||||
the local port.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_create_qp (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,92 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_BIND_MW 3 2016-02-02 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_bind_mw \- post a request to bind a type 1 memory window to a memory region
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "int ibv_bind_mw(struct ibv_qp " "*qp" ", struct ibv_mw " "*mw" ",
|
||||
.BI " struct ibv_mw_bind " "*mw_bind" ");
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_bind_mw()
|
||||
posts to the queue pair
|
||||
.I qp
|
||||
a request to bind the memory window
|
||||
.I mw
|
||||
according to the details in
|
||||
.I mw_bind\fR.
|
||||
.PP
|
||||
The argument
|
||||
.I mw_bind
|
||||
is an ibv_mw_bind struct, as defined in <infiniband/verbs.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_mw_bind {
|
||||
.in +8
|
||||
uint64_t wr_id; /* User defined WR ID */
|
||||
int send_flags; /* Use ibv_send_flags */
|
||||
struct ibv_mw_bind_info bind_info; /* MW bind information */
|
||||
.in -8
|
||||
}
|
||||
.fi
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_mw_bind_info {
|
||||
.in +8
|
||||
struct ibv_mr *mr; /* The MR to bind the MW to */
|
||||
uint64_t addr; /* The address the MW should start at */
|
||||
uint64_t length; /* The length (in bytes) the MW should span */
|
||||
int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
The QP Transport Service Type must be either UC, RC or XRC_SEND for bind operations.
|
||||
.PP
|
||||
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:
|
||||
.PP
|
||||
.TP
|
||||
.B IBV_SEND_FENCE \fR Set the fence indicator.
|
||||
.TP
|
||||
.B IBV_SEND_SIGNALED \fR Set the completion notification indicator. Relevant only if QP was created with sq_sig_all=0
|
||||
.PP
|
||||
The mw_access_flags define the allowed access to the MW after the bind
|
||||
completes successfully. It is either 0 or the bitwise \s-1OR\s0 of one
|
||||
or more of the following flags:
|
||||
.TP
|
||||
.B IBV_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access. Requires local write access to the MR.
|
||||
.TP
|
||||
.B IBV_ACCESS_REMOTE_READ\fR Enable Remote Read Access
|
||||
.TP
|
||||
.B IBV_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported). Requires local write access to the MR.
|
||||
.TP
|
||||
.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.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_bind_mw()
|
||||
returns 0 on success, or the value of errno on failure (which
|
||||
indicates the failure reason). In case of a success, the R_key of the
|
||||
memory window after the bind is returned in the mw_bind->mw->rkey field.
|
||||
.SH "NOTES"
|
||||
The bind does not complete when the function return - it is merely
|
||||
posted to the QP. The user should keep a copy of the old R_key, and
|
||||
fix the mw structure if the subsequent CQE for the bind operation
|
||||
indicates a failure. The user may safely send the R_key using a send
|
||||
request on the same QP, (based on QP ordering rules: a send after a bind
|
||||
request on the same QP are always ordered), but must not transfer it to the
|
||||
remote in any other manner before reading a successful CQE.
|
||||
.PP
|
||||
Note that for type 2 MW, one should directly post bind WR to the QP,
|
||||
using ibv_post_send.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_mw (3),
|
||||
.BR ibv_post_send (3),
|
||||
.BR ibv_poll_cq (3)
|
||||
.BR ibv_reg_mr (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Majd Dibbiny <majd@mellanox.com>
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
|
@ -1,85 +0,0 @@
|
|||
.TH IBV_CC_PINGPONG 1 2013-03-10 "libibverbs" "USER COMMANDS"
|
||||
|
||||
.SH NAME
|
||||
ibv_cc_pingpong \- ping-pong test demonstrates using of WAIT and CALC work requests.
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B ibv_cc_pingpong
|
||||
[\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth]
|
||||
[\-n iters] [\-l sl] [\-e] [\-m mtu]
|
||||
[\-c calc] [\-t op_type] [\-o operands] [\-w wait]
|
||||
\fBHOSTNAME\fR
|
||||
|
||||
.B ibv_cc_pingpong
|
||||
[\-p port] [\-d device] [\-i ib port] [\-s size] [\-r rx depth]
|
||||
[\-n iters] [\-l sl] [\-e] [\-m mtu]
|
||||
[\-c calc] [\-t op_type] [\-o operands] [\-w wait]
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Run a simple ping-pong test over InfiniBand via the reliable
|
||||
connected (RC) transport using WAIT on CQ work request
|
||||
and CALC work request.
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
\fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR
|
||||
use TCP port \fIPORT\fR for initial synchronization (default 18515)
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR
|
||||
use IB device \fIDEVICE\fR (default first device found)
|
||||
.TP
|
||||
\fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR
|
||||
use IB port \fIPORT\fR (default port 1)
|
||||
.TP
|
||||
\fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR
|
||||
ping-pong messages of size \fISIZE\fR (default 4096)
|
||||
.TP
|
||||
\fB\-r\fR, \fB\-\-rx\-depth\fR=\fIDEPTH\fR
|
||||
post \fIDEPTH\fR receives at a time (default 1000)
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-iters\fR=\fIITERS\fR
|
||||
perform \fIITERS\fR message exchanges (default 1000)
|
||||
.TP
|
||||
\fB\-l\fR, \fB\-\-sl\fR=\fISL\fR
|
||||
use \fISL\fR as the service level value of the QP (default 0)
|
||||
.TP
|
||||
\fB\-e\fR, \fB\-\-events\fR
|
||||
sleep while waiting for work completion events (default is to poll for
|
||||
completions)
|
||||
.TP
|
||||
\fB\-m\fR, \fB\-\-mtu\fR=\fISIZE\fR
|
||||
path MTU (default 4096)
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-calc\fR=\fIOPERATION\fR
|
||||
calc operation
|
||||
.TP
|
||||
\fB\-t\fR, \fB\-\-op_type\fR=\fITYPE\fR
|
||||
calc operands type
|
||||
.TP
|
||||
\fB\-o\fR, \fB\-\-operands\fR=\fIO1,O2...\fR
|
||||
comma separated list of operands
|
||||
.TP
|
||||
\fB\-w\fR, \fB\-\-wait_cq\fR=\fIWAIT\fR
|
||||
wait for enties on CQ
|
||||
.TP
|
||||
\fB\-g\fR, \fB\-\-gid-index\fR=\fIGID_INDEX\fR
|
||||
gid index to use
|
||||
.TP
|
||||
\fB\-G\fR, \fB\-\-dgid\fR=\fIDGID\fR
|
||||
remote GID. Mandatory if gid index is given
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR ibv_uc_pingpong (1),
|
||||
.BR ibv_ud_pingpong (1),
|
||||
.BR ibv_srq_pingpong (1)
|
||||
|
||||
.SH AUTHORS
|
||||
.TP
|
||||
Igor Ivanov
|
||||
.RI < Igor.Ivanov@itseez.com >
|
||||
.TP
|
||||
Roland Dreier
|
||||
.RI < rolandd@cisco.com >
|
|
@ -1,64 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_AH 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_ah, ibv_destroy_ah \- create or destroy an address handle (AH)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_ah *ibv_create_ah(struct ibv_pd " "*pd" ",
|
||||
.BI " struct ibv_ah_attr " "*attr" ");
|
||||
.sp
|
||||
.BI "int ibv_destroy_ah(struct ibv_ah " "*ah" ");
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_create_ah()
|
||||
creates an address handle (AH) associated with the protection domain
|
||||
.I pd\fR.
|
||||
The argument
|
||||
.I attr
|
||||
is an ibv_ah_attr struct, as defined in <infiniband/verbs.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_ah_attr {
|
||||
.in +8
|
||||
struct ibv_global_route grh; /* Global Routing Header (GRH) attributes */
|
||||
uint16_t dlid; /* Destination LID */
|
||||
uint8_t sl; /* Service Level */
|
||||
uint8_t src_path_bits; /* Source path bits */
|
||||
uint8_t static_rate; /* Maximum static rate */
|
||||
uint8_t is_global; /* GRH attributes are valid */
|
||||
uint8_t port_num; /* Physical port number */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
struct ibv_global_route {
|
||||
.in +8
|
||||
union ibv_gid dgid; /* Destination GID or MGID */
|
||||
uint32_t flow_label; /* Flow label */
|
||||
uint8_t sgid_index; /* Source GID index */
|
||||
uint8_t hop_limit; /* Hop limit */
|
||||
uint8_t traffic_class; /* Traffic class */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.sp
|
||||
.PP
|
||||
.B ibv_destroy_ah()
|
||||
destroys the AH
|
||||
.I ah\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_ah()
|
||||
returns a pointer to the created AH, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_destroy_ah()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_init_ah_from_wc (3),
|
||||
.BR ibv_create_ah_from_wc (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,63 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_AH_FROM_WC 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_init_ah_from_wc, ibv_create_ah_from_wc \- initialize or create an
|
||||
address handle (AH) from a work completion
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "int ibv_init_ah_from_wc(struct ibv_context " "*context" ", uint8_t " "port_num" ,
|
||||
.BI " struct ibv_wc " "*wc" ", struct ibv_grh " "*grh" ,
|
||||
.BI " struct ibv_ah_attr " "*ah_attr" );
|
||||
.sp
|
||||
.BI "struct ibv_ah *ibv_create_ah_from_wc(struct ibv_pd " "*pd" ,
|
||||
.BI " struct ibv_wc " "*wc" ,
|
||||
.BI " struct ibv_grh " "*grh" ,
|
||||
.BI " uint8_t " "port_num" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_init_ah_from_wc()
|
||||
initializes the address handle (AH) attribute structure
|
||||
.I ah_attr
|
||||
for the RDMA device context
|
||||
.I context
|
||||
using the port number
|
||||
.I port_num\fR,
|
||||
using attributes from the work completion
|
||||
.I wc
|
||||
and the Global Routing Header (GRH) structure
|
||||
.I grh\fR.
|
||||
.PP
|
||||
.B ibv_create_ah_from_wc()
|
||||
creates an AH associated with the protection domain
|
||||
.I pd
|
||||
using the port number
|
||||
.I port_num\fR,
|
||||
using attributes from the work completion
|
||||
.I wc
|
||||
and the Global Routing Header (GRH) structure
|
||||
.I grh\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_init_ah_from_wc()
|
||||
returns 0 on success, and \-1 on error.
|
||||
.PP
|
||||
.B ibv_create_ah_from_wc()
|
||||
returns a pointer to the created AH, or NULL if the request fails.
|
||||
.SH "NOTES"
|
||||
The filled structure
|
||||
.I ah_attr
|
||||
returned from
|
||||
.B ibv_init_ah_from_wc()
|
||||
can be used to create a new AH using
|
||||
.B ibv_create_ah()\fR.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_open_device (3),
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_create_ah (3),
|
||||
.BR ibv_destroy_ah (3),
|
||||
.BR ibv_poll_cq (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,50 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_COMP_CHANNEL 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_comp_channel, ibv_destroy_comp_channel \- create or
|
||||
destroy a completion event channel
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context
|
||||
.BI " " "*context" );
|
||||
.sp
|
||||
.BI "int ibv_destroy_comp_channel(struct ibv_comp_channel " "*channel" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_create_comp_channel()
|
||||
creates a completion event channel for the RDMA device context
|
||||
.I context\fR.
|
||||
.PP
|
||||
.B ibv_destroy_comp_channel()
|
||||
destroys the completion event channel
|
||||
.I channel\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_comp_channel()
|
||||
returns a pointer to the created completion event channel, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_destroy_comp_channel()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
A "completion channel" is an abstraction introduced by libibverbs that
|
||||
does not exist in the InfiniBand Architecture verbs specification or
|
||||
RDMA Protocol Verbs Specification. A completion channel is
|
||||
essentially file descriptor that is used to deliver completion
|
||||
notifications to a userspace process. When a completion event is
|
||||
generated for a completion queue (CQ), the event is delivered via the
|
||||
completion channel attached to that CQ. This may be useful to steer
|
||||
completion events to different threads by using multiple completion
|
||||
channels.
|
||||
.PP
|
||||
.B ibv_destroy_comp_channel()
|
||||
fails if any CQs are still associated with the completion event
|
||||
channel being destroyed.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_open_device (3),
|
||||
.BR ibv_create_cq (3),
|
||||
.BR ibv_get_cq_event (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,58 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_CQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_cq, ibv_destroy_cq \- create or destroy a completion queue (CQ)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_cq *ibv_create_cq(struct ibv_context " "*context" ", int " "cqe" ,
|
||||
.BI " void " "*cq_context" ,
|
||||
.BI " struct ibv_comp_channel " "*channel" ,
|
||||
.BI " int " "comp_vector" );
|
||||
.sp
|
||||
.BI "int ibv_destroy_cq(struct ibv_cq " "*cq" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_create_cq()
|
||||
creates a completion queue (CQ) with at least
|
||||
.I cqe
|
||||
entries for the RDMA device context
|
||||
.I context\fR.
|
||||
The pointer
|
||||
.I cq_context
|
||||
will be used to set user context pointer of the CQ structure. The argument
|
||||
.I channel
|
||||
is optional; if not NULL, the completion channel
|
||||
.I channel
|
||||
will be used to return completion events. The CQ will use the
|
||||
completion vector
|
||||
.I comp_vector
|
||||
for signaling completion events; it must be at least zero and less than
|
||||
.I context\fR->num_comp_vectors.
|
||||
.PP
|
||||
.B ibv_destroy_cq()
|
||||
destroys the CQ
|
||||
.I cq\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_cq()
|
||||
returns a pointer to the CQ, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_destroy_cq()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.B ibv_create_cq()
|
||||
may create a CQ with size greater than or equal to the requested
|
||||
size. Check the cqe attribute in the returned CQ for the actual size.
|
||||
.PP
|
||||
.B ibv_destroy_cq()
|
||||
fails if any queue pair is still associated with this CQ.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_resize_cq (3),
|
||||
.BR ibv_req_notify_cq (3),
|
||||
.BR ibv_ack_cq_events (3),
|
||||
.BR ibv_create_qp (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,175 +0,0 @@
|
|||
.TH IBV_CREATE_FLOW 3 2013-08-21 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_flow, ibv_destroy_flow \- create or destroy flow steering rules
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_flow *ibv_create_flow(struct ibv_qp " "*qp" ,
|
||||
.BI " struct ibv_flow_attr " "*flow_attr");
|
||||
.BI "int ibv_destroy_flow(struct ibv_flow " "*flow_id");
|
||||
.sp
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.SS ibv_create_flow()
|
||||
allows a user application QP
|
||||
.I qp
|
||||
to be attached into a specified flow
|
||||
.I flow
|
||||
which is defined in
|
||||
.I <infiniband/verbs.h>
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_flow_attr {
|
||||
.in +8
|
||||
uint32_t comp_mask; /* Future extendibility */
|
||||
enum ibv_flow_attr_type type; /* Rule type - see below */
|
||||
uint16_t size; /* Size of command */
|
||||
uint16_t priority; /* Rule priority - see below */
|
||||
uint8_t num_of_specs; /* Number of ibv_flow_spec_xxx */
|
||||
uint8_t port; /* The uplink port number */
|
||||
uint32_t flags; /* Extra flags for rule - see below */
|
||||
/* Following are the optional layers according to user request
|
||||
* struct ibv_flow_spec_xxx
|
||||
* struct ibv_flow_spec_yyy
|
||||
*/
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
enum ibv_flow_attr_type {
|
||||
.in +8
|
||||
IBV_FLOW_ATTR_NORMAL = 0x0, /* Steering according to rule specifications */
|
||||
IBV_FLOW_ATTR_ALL_DEFAULT = 0x1, /* Default unicast and multicast rule - receive all Eth traffic which isn't steered to any QP */
|
||||
IBV_FLOW_ATTR_MC_DEFAULT = 0x2, /* Default multicast rule - receive all Eth multicast traffic which isn't steered to any QP */
|
||||
IBV_FLOW_ATTR_SNIFFER = 0x3, /* sniffer rule - receive all port traffic */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
enum ibv_flow_flags {
|
||||
.in +8
|
||||
IBV_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = 1 << 0, /* Apply the rules on packets that were sent from the attached QP through loopback */
|
||||
IBV_FLOW_ATTR_FLAGS_DONT_TRAP = 1 << 1, /* Rule doesn't trap received packets, allowing them to match lower prioritized rules */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
Each spec struct holds the relevant network layer parameters for matching. To enforce the match, the user sets a mask for each parameter.
|
||||
.br
|
||||
If the bit is set in the mask, the corresponding bit in the value should be matched.
|
||||
.br
|
||||
Note that most vendors support either full mask (all "1"s) or zero mask (all "0"s).
|
||||
.br
|
||||
.B Network parameters in the relevant network structs should be given in network order (big endian).
|
||||
|
||||
.SS Flow domains and priority
|
||||
Flow steering defines the concept of domain and priority. Each domain represents an application that can attach a flow.
|
||||
Domains are prioritized. A higher priority domain will always supersede a lower priority domain when their flow specifications overlap.
|
||||
.br
|
||||
.B IB verbs have the higher priority domain.
|
||||
.br
|
||||
In addition to the domain, there is priority within each of the domains.
|
||||
A lower priority numeric value (higher priority) takes precedence over matching rules with higher numeric priority value (lower priority).
|
||||
It is important to note that the priority value of a flow spec is used not only to establish the precedence of conflicting flow matches
|
||||
but also as a way to abstract the order on which flow specs are tested for matches. Flows with higher priorities will be tested before flows with lower priorities.
|
||||
.PP
|
||||
.SS ibv_destroy_flow()
|
||||
destroys the flow
|
||||
.I flow_id\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_flow()
|
||||
returns a pointer to the flow, or NULL if the request fails. In case of an error, errno is updated.
|
||||
.PP
|
||||
.B ibv_destroy_flow()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "ERRORS"
|
||||
.SS EINVAL
|
||||
.B ibv_create_flow()
|
||||
flow specification, QP or priority are invalid
|
||||
.PP
|
||||
.B ibv_destroy_flow()
|
||||
flow_id is invalid
|
||||
.SS ENOMEM
|
||||
Couldn't create/destroy flow, not enough memory
|
||||
.SS ENXIO
|
||||
Device managed flow steering isn't currently supported
|
||||
.SS EPERM
|
||||
No permissions to add the flow steering rule
|
||||
.SH "NOTES"
|
||||
These verbs are available only for devices supporting
|
||||
.br
|
||||
IBV_DEVICE_MANAGED_FLOW_STEERING and only for QPs of Transport Service Type
|
||||
.BR IBV_QPT_UD
|
||||
or
|
||||
.BR IBV_QPT_RAW_PACKET
|
||||
.PP
|
||||
.SH EXAMPLE
|
||||
.br
|
||||
Below flow_attr defines a rule in priority 0 to match a destination
|
||||
mac address and a source ipv4 address. For that, L2 and L3 specs are used.
|
||||
.br
|
||||
If there is a hit on this rule, means the
|
||||
received packet has destination mac: 66:11:22:33:44:55 and source ip: 0x0B86C806,
|
||||
the packet is steered to its attached qp.
|
||||
.sp
|
||||
.nf
|
||||
struct raw_eth_flow_attr {
|
||||
.in +8
|
||||
struct ibv_flow_attr attr;
|
||||
struct ibv_flow_spec_eth spec_eth;
|
||||
struct ibv_flow_spec_ipv4 spec_ipv4;
|
||||
.in -8
|
||||
} __attribute__((packed));
|
||||
.sp
|
||||
.nf
|
||||
struct raw_eth_flow_attr flow_attr = {
|
||||
.in +8
|
||||
.attr = {
|
||||
.comp_mask = 0,
|
||||
.type = IBV_FLOW_ATTR_NORMAL,
|
||||
.size = sizeof(flow_attr),
|
||||
.priority = 0,
|
||||
.num_of_specs = 2,
|
||||
.port = 1,
|
||||
.flags = 0,
|
||||
},
|
||||
.spec_eth = {
|
||||
.type = IBV_FLOW_SPEC_ETH,
|
||||
.size = sizeof(struct ibv_flow_spec_eth),
|
||||
.val = {
|
||||
.dst_mac = {0x66, 0x11, 0x22, 0x33, 0x44, 0x55},
|
||||
.src_mac = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
.ether_type = 0,
|
||||
.vlan_tag = 0,
|
||||
},
|
||||
.mask = {
|
||||
.dst_mac = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
|
||||
.src_mac = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
|
||||
.ether_type = 0,
|
||||
.vlan_tag = 0,
|
||||
}
|
||||
},
|
||||
.spec_ipv4 = {
|
||||
.type = IBV_FLOW_SPEC_IPV4,
|
||||
.size = sizeof(struct ibv_flow_spec_ipv4),
|
||||
.val = {
|
||||
.src_ip = 0x0B86C806,
|
||||
.dst_ip = 0,
|
||||
},
|
||||
.mask = {
|
||||
.src_ip = 0xFFFFFFFF,
|
||||
.dst_ip = 0,
|
||||
}
|
||||
}
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Hadar Hen Zion <hadarh@mellanox.com>
|
||||
.TP
|
||||
Matan Barak <matanb@mellanox.com>
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
|
@ -1,79 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_QP 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_qp, ibv_destroy_qp \- create or destroy a queue pair (QP)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_qp *ibv_create_qp(struct ibv_pd " "*pd" ,
|
||||
.BI " struct ibv_qp_init_attr " "*qp_init_attr" );
|
||||
.sp
|
||||
.BI "int ibv_destroy_qp(struct ibv_qp " "*qp" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_create_qp()
|
||||
creates a queue pair (QP) associated with the protection domain
|
||||
.I pd\fR.
|
||||
The argument
|
||||
.I qp_init_attr
|
||||
is an ibv_qp_init_attr struct, as defined in <infiniband/verbs.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_qp_init_attr {
|
||||
.in +8
|
||||
void *qp_context; /* Associated context of the QP */
|
||||
struct ibv_cq *send_cq; /* CQ to be associated with the Send Queue (SQ) */
|
||||
struct ibv_cq *recv_cq; /* CQ to be associated with the Receive Queue (RQ) */
|
||||
struct ibv_srq *srq; /* SRQ handle if QP is to be associated with an SRQ, otherwise NULL */
|
||||
struct ibv_qp_cap cap; /* QP capabilities */
|
||||
enum ibv_qp_type qp_type; /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_UC, IBV_QPT_UD or IBV_QPT_RAW_PACKET */
|
||||
int sq_sig_all; /* If set, each Work Request (WR) submitted to the SQ generates a completion entry */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
struct ibv_qp_cap {
|
||||
.in +8
|
||||
uint32_t max_send_wr; /* Requested max number of outstanding WRs in the SQ */
|
||||
uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */
|
||||
uint32_t max_send_sge; /* Requested max number of scatter/gather (s/g) elements in a WR in the SQ */
|
||||
uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the SQ */
|
||||
uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
The function
|
||||
.B ibv_create_qp()
|
||||
will update the
|
||||
.I qp_init_attr\fB\fR->cap
|
||||
struct with the actual \s-1QP\s0 values of the QP that was created;
|
||||
the values will be greater than or equal to the values requested.
|
||||
.PP
|
||||
.B ibv_destroy_qp()
|
||||
destroys the QP
|
||||
.I qp\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_qp()
|
||||
returns a pointer to the created QP, or NULL if the request fails.
|
||||
Check the QP number (\fBqp_num\fR) in the returned QP.
|
||||
.PP
|
||||
.B ibv_destroy_qp()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
The attributes max_recv_wr and max_recv_sge are ignored by
|
||||
.B ibv_create_qp()
|
||||
if the QP is to be associated with an SRQ.
|
||||
.PP
|
||||
.B ibv_destroy_qp()
|
||||
fails if the QP is attached to a multicast group.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_modify_qp (3),
|
||||
.BR ibv_query_qp (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,86 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_QP_EX 3 2014-04-27 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_qp_ex, ibv_destroy_qp \- create or destroy a queue pair (QP)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_qp *ibv_create_qp_ex(struct ibv_context " "*context" ,
|
||||
.BI " struct ibv_qp_init_attr_ex " "*qp_init_attr_ex" );
|
||||
.sp
|
||||
.BI "int ibv_destroy_qp(struct ibv_qp " "*qp" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_create_qp_ex()
|
||||
creates a queue pair (QP) associated with the protection domain
|
||||
.I pd\fR.
|
||||
The argument
|
||||
.I qp_init_attr_ex
|
||||
is an ibv_qp_init_attr_ex struct, as defined in <infiniband/verbs.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_qp_init_attr_ex {
|
||||
.in +8
|
||||
void *qp_context; /* Associated context of the QP */
|
||||
struct ibv_cq *send_cq; /* CQ to be associated with the Send Queue (SQ) */
|
||||
struct ibv_cq *recv_cq; /* CQ to be associated with the Receive Queue (RQ) */
|
||||
struct ibv_srq *srq; /* SRQ handle if QP is to be associated with an SRQ, otherwise NULL */
|
||||
struct ibv_qp_cap cap; /* QP capabilities */
|
||||
enum ibv_qp_type qp_type; /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_UC, IBV_QPT_UD or IBV_QPT_RAW_PACKET */
|
||||
int sq_sig_all; /* If set, each Work Request (WR) submitted to the SQ generates a completion entry */
|
||||
uint32_t comp_mask; /* Identifies valid fields */
|
||||
struct ibv_pd *pd; /* PD to be associated with the QP */
|
||||
struct ibv_xrcd *xrcd; /* XRC domain to be associated with the target QP */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
struct ibv_qp_cap {
|
||||
.in +8
|
||||
uint32_t max_send_wr; /* Requested max number of outstanding WRs in the SQ */
|
||||
uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */
|
||||
uint32_t max_send_sge; /* Requested max number of scatter/gather (s/g) elements in a WR in the SQ */
|
||||
uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the SQ */
|
||||
uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
The function
|
||||
.B ibv_create_qp_ex()
|
||||
will update the
|
||||
.I qp_init_attr_ex\fB\fR->cap
|
||||
struct with the actual \s-1QP\s0 values of the QP that was created;
|
||||
the values will be greater than or equal to the values requested.
|
||||
.PP
|
||||
.B ibv_destroy_qp()
|
||||
destroys the QP
|
||||
.I qp\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_qp_ex()
|
||||
returns a pointer to the created QP, or NULL if the request fails.
|
||||
Check the QP number (\fBqp_num\fR) in the returned QP.
|
||||
.PP
|
||||
.B ibv_destroy_qp()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
The attributes max_recv_wr and max_recv_sge are ignored by
|
||||
.B ibv_create_qp_ex()
|
||||
if the QP is to be associated with an SRQ.
|
||||
.PP
|
||||
.B ibv_destroy_qp()
|
||||
fails if the QP is attached to a multicast group.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_modify_qp (3),
|
||||
.BR ibv_query_qp (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
||||
.TP
|
||||
Majd Dibbiny <majd@mellanox.com>
|
||||
.TP
|
||||
Moshe Lazer <moshel@mellanox.com>
|
|
@ -1,67 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_SRQ 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_srq, ibv_destroy_srq \- create or destroy a shared receive queue (SRQ)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_srq *ibv_create_srq(struct ibv_pd " "*pd" ", struct "
|
||||
.BI " ibv_srq_init_attr " "*srq_init_attr" );
|
||||
.sp
|
||||
.BI "int ibv_destroy_srq(struct ibv_srq " "*srq" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_create_srq()
|
||||
creates a shared receive queue (SRQ) associated with the protection domain
|
||||
.I pd\fR.
|
||||
The argument
|
||||
.I srq_init_attr
|
||||
is an ibv_srq_init_attr struct, as defined in <infiniband/verbs.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_srq_init_attr {
|
||||
.in +8
|
||||
void *srq_context; /* Associated context of the SRQ */
|
||||
struct ibv_srq_attr attr; /* SRQ attributes */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
struct ibv_srq_attr {
|
||||
.in +8
|
||||
uint32_t max_wr; /* Requested max number of outstanding work requests (WRs) in the SRQ */
|
||||
uint32_t max_sge; /* Requested max number of scatter elements per WR */
|
||||
uint32_t srq_limit; /* The limit value of the SRQ (irrelevant for ibv_create_srq) */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
The function
|
||||
.B ibv_create_srq()
|
||||
will update the
|
||||
.I srq_init_attr
|
||||
struct with the original values of the SRQ that was created; the
|
||||
values of max_wr and max_sge will be greater than or equal to the
|
||||
values requested.
|
||||
.PP
|
||||
.B ibv_destroy_srq()
|
||||
destroys the SRQ
|
||||
.I srq\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_srq()
|
||||
returns a pointer to the created SRQ, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_destroy_srq()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.B ibv_destroy_srq()
|
||||
fails if any queue pair is still associated with this SRQ.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_modify_srq (3),
|
||||
.BR ibv_query_srq (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
|
@ -1,71 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_CREATE_SRQ_EX 3 2013-06-26 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_create_srq_ex, ibv_destroy_srq \- create or destroy a shared receive queue (SRQ)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "struct ibv_srq *ibv_create_srq_ex(struct ibv_context " "*context" ", struct "
|
||||
.BI " ibv_srq_init_attr_ex " "*srq_init_attr_ex" );
|
||||
.sp
|
||||
.BI "int ibv_destroy_srq(struct ibv_srq " "*srq" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_create_srq_ex()
|
||||
creates a shared receive queue (SRQ) supporting both basic and xrc modes.
|
||||
The argument
|
||||
.I srq_init_attr_ex
|
||||
is an ibv_srq_init_attr_ex struct, as defined in <infiniband/verbs.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_srq_init_attr_ex {
|
||||
.in +8
|
||||
void *srq_context; /* Associated context of the SRQ */
|
||||
struct ibv_srq_attr attr; /* SRQ attributes */
|
||||
uint32_t comp_mask; /* Identifies valid fields */
|
||||
enum ibv_srq_type srq_type; /* Basic / XRC */
|
||||
struct ibv_pd *pd; /* PD associated with the SRQ */
|
||||
struct ibv_xrcd *xrcd; /* XRC domain to associate with the SRQ */
|
||||
struct ibv_cq *cq; /* CQ to associate with the SRQ for XRC mode */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
struct ibv_srq_attr {
|
||||
.in +8
|
||||
uint32_t max_wr; /* Requested max number of outstanding work requests (WRs) in the SRQ */
|
||||
uint32_t max_sge; /* Requested max number of scatter elements per WR */
|
||||
uint32_t srq_limit; /* The limit value of the SRQ */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
The function
|
||||
.B ibv_create_srq_ex()
|
||||
will update the
|
||||
.I srq_init_attr_ex
|
||||
struct with the original values of the SRQ that was created; the
|
||||
values of max_wr and max_sge will be greater than or equal to the
|
||||
values requested.
|
||||
.PP
|
||||
.B ibv_destroy_srq()
|
||||
destroys the SRQ
|
||||
.I srq\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_create_srq_ex()
|
||||
returns a pointer to the created SRQ, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_destroy_srq()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.B ibv_destroy_srq()
|
||||
fails if any queue pair is still associated with this SRQ.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_modify_srq (3),
|
||||
.BR ibv_query_srq (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
|
@ -1,19 +0,0 @@
|
|||
.TH IBV_DEVICES 1 "August 30, 2005" "libibverbs" "USER COMMANDS"
|
||||
|
||||
.SH NAME
|
||||
ibv_devices \- list RDMA devices
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B ibv_devices
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
List RDMA devices available for use from userspace.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR ibv_devinfo (1)
|
||||
|
||||
.SH AUTHORS
|
||||
.TP
|
||||
Roland Dreier
|
||||
.RI < rolandd@cisco.com >
|
|
@ -1,39 +0,0 @@
|
|||
.TH IBV_DEVINFO 1 "August 30, 2005" "libibverbs" "USER COMMANDS"
|
||||
|
||||
.SH NAME
|
||||
ibv_devinfo \- query RDMA devices
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B ibv_devinfo
|
||||
[\-d device] [\-i port] [\-l] [\-v]
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Print information about RDMA devices available for use from userspace.
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR
|
||||
use IB device \fIDEVICE\fR (default first device found)
|
||||
|
||||
\fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR
|
||||
query port \fIPORT\fR (default all ports)
|
||||
|
||||
\fB\-l\fR, \fB\-\-list\fR
|
||||
only list names of RDMA devices
|
||||
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
print all available information about RDMA devices
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR ibv_devices (1)
|
||||
|
||||
.SH AUTHORS
|
||||
.TP
|
||||
Dotan Barak
|
||||
.RI < dotanba@gmail.com >
|
||||
.TP
|
||||
Roland Dreier
|
||||
.RI < rolandd@cisco.com >
|
|
@ -1,40 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EVENT_TYPE_STR 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
.nf
|
||||
ibv_event_type_str \- Return string describing event_type enum value
|
||||
.sp
|
||||
ibv_node_type_str \- Return string describing node_type enum value
|
||||
.sp
|
||||
ibv_port_state_str \- Return string describing port_state enum value
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs.h>
|
||||
.sp
|
||||
.BI "const char *ibv_event_type_str(enum ibv_event_type " "event_type");
|
||||
.sp
|
||||
.BI "const char *ibv_node_type_str(enum ibv_node_type " "node_type");
|
||||
.sp
|
||||
.BI "const char *ibv_port_state_str(enum ibv_port_state " "port_state");
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_node_type_str()
|
||||
returns a string describing the node type enum value
|
||||
.IR node_type .
|
||||
.PP
|
||||
.B ibv_port_state_str()
|
||||
returns a string describing the port state enum value
|
||||
.IR port_state .
|
||||
.PP
|
||||
.B ibv_event_type_str()
|
||||
returns a string describing the event type enum value
|
||||
.IR event_type .
|
||||
.SH "RETURN VALUE"
|
||||
These functions return a constant string that describes the enum value
|
||||
passed as their argument.
|
||||
.SH "AUTHOR"
|
||||
.TP
|
||||
Roland Dreier
|
||||
.RI < rolandd@cisco.com >
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_ALLOC_EC_CALC 3 2015-11-28 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_alloc_ec_calc, ibv_exp_dealloc_ec_calc \- allocates or deallocates an erasure coding calculation context
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_exp_ec_calc *ibv_alloc_ec_calc(struct ibv_pd " "*pd" ,
|
||||
.BI " struct ibv_exp_ec_calc_init_attr " "*attr" );
|
||||
.sp
|
||||
.BI "void ibv_dealloc_ec_calc(struct ibv_exp_ec_calc " "*calc" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_alloc_ec_calc()
|
||||
allocates an erasure coding calculation context associated with the
|
||||
protection domain
|
||||
.I pd\fR.
|
||||
The erasure coding initialization attributes
|
||||
.I attr
|
||||
as defined in <infiniband/verbs.h>
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_ec_calc_init_attr {
|
||||
.in +8
|
||||
uint32_t comp_mask; /* bitmask of ibv_exp_ec_calc_attr_comp_mask */
|
||||
uint32_t max_inflight_calcs; /* maximum inflight calculations */
|
||||
int k; /* number of data blocks */
|
||||
int m; /* number of code blocks */
|
||||
int w; /* Galois field bits GF(2^w) */
|
||||
int max_data_sge; /* maximum data sg elements to be used for encode/decode */
|
||||
int max_code_sge; /* maximum code sg elements to be used for encode/decode */
|
||||
uint8_t *encode_matrix; /* buffer that contain the encoding matrix */
|
||||
int affinity_hint; /* affinity hint for asynchronous calcs completion steering */
|
||||
int polling; /* polling mode (if set no completions will be generated by events) */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
.I comp_mask
|
||||
enumerates the valid fields in ibv_exp_ec_calc_init_attr:
|
||||
.PP
|
||||
.nf
|
||||
enum ibv_exp_ec_calc_attr_comp_mask {
|
||||
.in +8
|
||||
IBV_EXP_EC_CALC_ATTR_MAX_INFLIGHT = (1 << 0),
|
||||
IBV_EXP_EC_CALC_ATTR_K = (1 << 1),
|
||||
IBV_EXP_EC_CALC_ATTR_M = (1 << 2),
|
||||
IBV_EXP_EC_CALC_ATTR_W = (1 << 3),
|
||||
IBV_EXP_EC_CALC_ATTR_MAX_DATA_SGE = (1 << 4),
|
||||
IBV_EXP_EC_CALC_ATTR_MAX_CODE_SGE = (1 << 5),
|
||||
IBV_EXP_EC_CALC_ATTR_ENCODE_MAT = (1 << 6),
|
||||
IBV_EXP_EC_CALC_ATTR_AFFINITY = (1 << 7),
|
||||
IBV_EXP_EC_CALC_ATTR_POLLING = (1 << 8),
|
||||
IBV_EXP_EC_CALC_INIT_ATTR_RESERVED = (1 << 9),
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
.PP
|
||||
.I encode_matrix
|
||||
is provided as a byte pointer. The matrix rank corresponds
|
||||
to the number of data blocks
|
||||
.I K\fR (rows) over the number of coding blocks
|
||||
.I M\fR (columns).
|
||||
.nf
|
||||
10-4 encoding matrix (M) layout:
|
||||
.in +8
|
||||
---------------------------------------
|
||||
| M(1,1) | M(1,2) | M(1,3) | M(1,4) |
|
||||
---------------------------------------
|
||||
| M(2,1) | M(2,2) | M(2,3) | M(2,4) |
|
||||
---------------------------------------
|
||||
| M(3,1) | M(3,2) | M(3,3) | M(3,4) |
|
||||
---------------------------------------
|
||||
| M(4,1) | M(4,2) | M(4,3) | M(4,4) |
|
||||
---------------------------------------
|
||||
| M(5,1) | M(5,2) | M(5,3) | M(5,4) |
|
||||
---------------------------------------
|
||||
| M(6,1) | M(6,2) | M(6,3) | M(6,4) |
|
||||
---------------------------------------
|
||||
| M(7,1) | M(7,2) | M(7,3) | M(7,4) |
|
||||
---------------------------------------
|
||||
| M(8,1) | M(8,2) | M(8,3) | M(8,4) |
|
||||
---------------------------------------
|
||||
| M(9,1) | M(9,2) | M(9,3) | M(9,4) |
|
||||
---------------------------------------
|
||||
| M(10,1) | M(10,2) | M(10,3) | M(10,4) |
|
||||
---------------------------------------
|
||||
.in -8
|
||||
|
||||
The encode matrix memory layout is as follows:
|
||||
.in +8
|
||||
-----------------------------------------------------------------------------
|
||||
| M(1,1) | M(1,2) | M(1,3) | M(1,4) | M(2,1) | M(2,2) | M(2,3) | M(2,4) | ... |
|
||||
-----------------------------------------------------------------------------
|
||||
.in -8
|
||||
|
||||
};
|
||||
.fi
|
||||
|
||||
.PP
|
||||
The allocated erasure coding context shall be provided to any erasure coding routines.
|
||||
.fi
|
||||
.PP
|
||||
.B ibv_exp_dealloc_ec_calc()
|
||||
deallocates the erasure coding calculation context
|
||||
.I calc\fR.
|
||||
.fi
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_alloc_ec_calc()
|
||||
returns a pointer to struct ibv_exp_ec_calc, or NULL if the request fails with
|
||||
errno value set.
|
||||
|
||||
.SH "CONSTRAINTS"
|
||||
.PP
|
||||
.I max_data_sg
|
||||
init attribute must be equal to the number of data blocks init attribute
|
||||
.I k\fR.
|
||||
.I max_code_sg
|
||||
init attribute must be equal to the number of code blocks init attribute
|
||||
.I m\fR.
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_exp_ec_encode_sync (3),
|
||||
.BR ibv_exp_ec_encode_async (3),
|
||||
.BR ibv_exp_ec_decode_sync (3),
|
||||
.BR ibv_exp_ec_decode_async (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Sagi Grimberg <sagig@mellanox.com>
|
|
@ -1,59 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_ALLOC_MKEY_LIST_MOMORY 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_alloc_mkey_list_memory \- allocates a buffer for UMR when using non-inline registration
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_exp_mkey_list_container *ibv_exp_alloc_mkey_list_memory(struct ibv_exp_mkey_list_container_attr " "*attr" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_alloc_mkey_list_memory()
|
||||
allocates a buffer for non-inline UMR registration associated with
|
||||
The protection domain (PD)
|
||||
.I attr->pd\fR.
|
||||
and of type
|
||||
.I attr->mkey_list_type
|
||||
with attr
|
||||
.I attr->max_klm_list_size\fR.
|
||||
maximum number of KLMs used to create UMR
|
||||
.PP
|
||||
The argument
|
||||
.I attr
|
||||
is an ibv_exp_mkey_list_container_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_list_container_attr {
|
||||
.in +8
|
||||
struct ibv_pd *pd; /* protection domain (PD) associated with the UMR */
|
||||
uint32_t mkey_list_type; /* use ibv_exp_mkey_list_type */
|
||||
uint32_t max_klm_list_size; /* maximum number of MRs we can use to create the UMR */
|
||||
uint32_t comp_mask; /* reserved for future growth (must be 0) */
|
||||
.in -8
|
||||
};
|
||||
|
||||
.fi
|
||||
.I attr->mkey_list_type
|
||||
describes type of UMR we want to create; it is one of the following flags:
|
||||
.PP
|
||||
.TP
|
||||
.B IBV_EXP_MKEY_LIST_TYPE_INDIRECT_MR \fR indirect UMR Type
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_alloc_mkey_list_memory()
|
||||
returns a pointer to struct ibv_exp_mkey_list_container, or NULL if the request fails.
|
||||
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
We need this struct only if we want to Fill the UMR using non-inline post send
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_exp_dealloc_mkey_list_memory (3),
|
||||
.BR ibv_post_send (3),
|
||||
.BR ibv_exp_create_mr (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Haggai Abramovsky <hagaya@mellanox.com>
|
|
@ -1,100 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_BIND_MW 3 2014-04-27 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_bind_mw \- post a request to bind a type 1 memory window to a memory region
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "int ibv_exp_bind_mw(struct ibv_exp_mw_bind " "*mw_bind" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_bind_mw()
|
||||
posts to the queue pair
|
||||
.I mw_bind->qp
|
||||
a request to bind the memory window
|
||||
.I mw_bind->mw
|
||||
according to the details in
|
||||
.I mw_bind\fR.
|
||||
.PP
|
||||
The argument
|
||||
.I mw_bind
|
||||
is an ibv_exp_mw_bind struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_mw_bind {
|
||||
.in +8
|
||||
struct ibv_qp *qp;
|
||||
struct ibv_mw *mw;
|
||||
uint64_t wr_id; /* User defined WR ID */
|
||||
uint64_t exp_send_flags; /* Use ibv_exp_send_flags */
|
||||
struct ibv_exp_mw_bind_info bind_info;
|
||||
uint32_t comp_mask; /* reserved for future growth (must be 0) */
|
||||
.in -8
|
||||
};
|
||||
.PP
|
||||
struct ibv_exp_mw_bind_info {
|
||||
.in +8
|
||||
struct ibv_mr *mr; /* The MR to bind the MW to */
|
||||
uint64_t addr; /* The address the MW should start at */
|
||||
uint64_t length; /* The length (in byte) the MW should span */
|
||||
uint64_t exp_mw_access_flags; /* Access flags to the MW. Use ibv_exp_access_flags */
|
||||
.in -8
|
||||
};
|
||||
|
||||
.fi
|
||||
.PP
|
||||
The QP Transport Service Type must be either UC or RC for bind operations.
|
||||
.PP
|
||||
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:
|
||||
.PP
|
||||
.TP
|
||||
.B IBV_EXP_SEND_FENCE \fR Set the fence indicator. Valid only for QPs with Transport Service Type \fBIBV_QPT_RC
|
||||
.TP
|
||||
.B IBV_EXP_SEND_SIGNALED \fR Set the completion notification indicator. Relevant only if QP was created with sq_sig_all=0
|
||||
.TP
|
||||
.B IBV_EXP_SEND_SOLICITED \fR Set the solicited event indicator. Valid only for Send and RDMA Write with immediate
|
||||
.PP
|
||||
The exp_mw_access_flags define the allowed access to the MW after the bind
|
||||
completes successfully. It is either 0 or the bitwise \s-1OR\s0 of one
|
||||
or more of the following flags:
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access. Requires local write access to the MR.
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_REMOTE_READ\fR Enable Remote Read Access
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported). Requires local write access to the MR.
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_MW_ZERO_BASED\fR If set, the address given in post send is offset from the MW's start address.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_bind_mw()
|
||||
returns 0 on success, or the value of errno on failure (which
|
||||
indicates the failure reason). In case of a success, the R_Key of the
|
||||
memory window after the bind is returned in the mw_bind->mw->rkey field.
|
||||
.SH "NOTES"
|
||||
The bind does not complete when the function return - it is merely
|
||||
posted to the QP. The user should keep a copy of the old R_Key, and
|
||||
fix the mw structure if the subsequent CQE for the bind operation
|
||||
indicates a failure. The user may safely send the R_Key using a send
|
||||
request on the same QP, but must not transfer it to the remote in any
|
||||
other manner before reading a successful CQE.
|
||||
.PP
|
||||
Note that for type 2 MW, one should directly post bind WQE to the QP,
|
||||
using ibv_post_send.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_mw (3),
|
||||
.BR ibv_post_send (3),
|
||||
.BR ibv_poll_cq (3)
|
||||
.BR ibv_reg_mr (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Haggai Eran <haggaie@mellanox.com>
|
||||
.TP
|
||||
Shachar Raindel <raindel@mellanox.com>
|
||||
.TP
|
||||
Yaniv Saar <ysaar@mellanox.com>
|
||||
.TP
|
||||
Majd Dibbiny <majd@mellanox.com>
|
||||
.TP
|
||||
Moshe Lazer <moshel@mellanox.com>
|
|
@ -1,104 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_CREATE_CQ 3 2014-04-09 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_cq, ibv_destroy_cq \- create or destroy a completion queue (CQ)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_cq *ibv_exp_create_cq(struct ibv_context " "*context" ", int " "cqe" ,
|
||||
.BI " void " "*cq_context" ,
|
||||
.BI " struct ibv_comp_channel " "*channel" ,
|
||||
.BI " int " "comp_vector" ,
|
||||
.BI " struct ibv_exp_cq_init_attr" " *attr");
|
||||
.sp
|
||||
.BI "int ibv_destroy_cq(struct ibv_cq " "*cq" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.fi
|
||||
.B ibv_exp_create_cq()
|
||||
creates a completion queue (CQ) with at least
|
||||
.I cqe
|
||||
entries for the RDMA device context
|
||||
.I context\fR.
|
||||
The pointer
|
||||
.I cq_context
|
||||
will be used to set user context pointer of the CQ structure. The argument
|
||||
.I channel
|
||||
is optional; if not NULL, the completion channel
|
||||
.I channel
|
||||
will be used to return completion events. The CQ will use the
|
||||
completion vector
|
||||
.I comp_vector
|
||||
for signaling completion events; it must be at least zero and less than
|
||||
.I context\fR->num_comp_vectors.
|
||||
|
||||
The argument
|
||||
.I attr
|
||||
is an ibv_exp_cq_init_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.nf
|
||||
struct ibv_exp_cq_init_attr {
|
||||
.in +8
|
||||
.fi
|
||||
uint32_t comp_mask; /* Identifies valid fields. Use enum ibv_exp_cq_init_attr_mask */
|
||||
.nf
|
||||
uint32_t flags; /* Flags mask to create CQ with extra features */
|
||||
struct ibv_exp_res_domain *res_domain; /* Provides resource domain to indicate the CQ threading and message model */
|
||||
/* Create CQ with Peer-direct sync support */
|
||||
struct ibv_exp_peer_direct_attr *peer_direct_attrs;
|
||||
.in -8
|
||||
};
|
||||
|
||||
enum ibv_exp_cq_init_attr_mask{
|
||||
.in +8
|
||||
IBV_EXP_CQ_INIT_ATTR_FLAGS = 1 << 0, /* Set if attr->flags is valid */
|
||||
IBV_EXP_CQ_INIT_ATTR_RES_DOMAIN = 1 << 1, /* Set if attr->res_domain is valid */
|
||||
IBV_EXP_CQ_INIT_PEER_DIRECT = 1 << 2, /* Set if attr->peer_direct_attr is valid */
|
||||
.in -8
|
||||
};
|
||||
|
||||
.fi
|
||||
.I attr->flags
|
||||
specifies the CQ features. It is either 0 or the bitwise OR of one or more of the following flags:
|
||||
.PP
|
||||
.TP
|
||||
.B IBV_EXP_CQ_CREATE_CROSS_CHANNEL \fR Create CQ with Cross Channel
|
||||
.TP
|
||||
.B IBV_EXP_CQ_TIMESTAMP \fR Return timestamp in WC
|
||||
.TP
|
||||
.B IBV_EXP_CQ_TIMESTAMP_TO_SYS_TIME \fR Convert the timestamp in WC to system time (unsupported by mlx4)
|
||||
.TP
|
||||
.B IBV_EXP_CQ_COMPRESSED_CQE \fR Work with compressed CQEs
|
||||
|
||||
.PP
|
||||
.B ibv_destroy_cq()
|
||||
destroys the CQ
|
||||
.I cq\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_cq()
|
||||
returns a pointer to the CQ, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_destroy_cq()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.B ibv_exp_create_cq()
|
||||
may create a CQ with size greater than or equal to the requested
|
||||
size. Check the cqe attribute in the returned CQ for the actual size.
|
||||
.PP
|
||||
.B ibv_destroy_cq()
|
||||
fails if any queue pair is still associated with this CQ.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_resize_cq (3),
|
||||
.BR ibv_req_notify_cq (3),
|
||||
.BR ibv_ack_cq_events (3),
|
||||
.BR ibv_create_qp (3),
|
||||
.BR ibv_exp_create_res_domain (3),
|
||||
.BR peer_direct (7)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Dotan Barak <dotanba@gmail.com>
|
||||
.TP
|
||||
Majd Dibbiny <majd@mellanox.com>
|
||||
.TP
|
||||
Moshe Lazer <moshel@mellanox.com>
|
|
@ -1,52 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_CREATE_DCT 3 2013-12-10 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_dct \- Create a Dynamically Connected Target (DCT) endpoint.
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_dct *ibv_exp_create_dct(struct ibv_context " "*context,"
|
||||
.BI " struct ibv_exp_dct_init_attr " "*attr" );
|
||||
.sp
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_create_dct()
|
||||
creates a DC target endpoint associated with the ibv_context
|
||||
.I context\fR.
|
||||
The argument
|
||||
.I attr
|
||||
is an ibv_exp_dct_init_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_dct_init_attr {
|
||||
.in +8
|
||||
struct ibv_pd *pd; /* PD associated with the protection domain */
|
||||
struct ibv_cq *cq; /* CQ used to report receive completions */
|
||||
struct ibv_srq *srq; /* The SRQ that will provide receive buffers */
|
||||
uint64_t dc_key; /* DC access key (64 bit key) */
|
||||
uint8_t port; /* Port number */
|
||||
uint32_t access_flags; /* Access flags (IBV_ACCESS_REMOTE_READ/WRITE/ATOMIC) */
|
||||
uint8_t min_rnr_timer; /* Min rnr NAK time between successive requests of rejected messages */
|
||||
uint8_t tclass; /* Traffic class used in packets sent by the DCT in case GRH is used */
|
||||
uint32_t flow_label; /* Flow label used in packets sent by the DCT in case GRH is used */
|
||||
enum ibv_mtu mtu; /* MTU of the DCT */
|
||||
uint8_t pkey_index; /* PKey index */
|
||||
uint8_t gid_index; /* Gid index associated with the DCT (to verify incoming packets if GRH is used) */
|
||||
uint8_t hop_limit; /* Hop limit used in packets sent by the DCT in case GRH is used */
|
||||
uint32_t inline_size; /* The size requested by the user to be inline received */
|
||||
uint32_t create_flags; /* Reserved (must be 0) */
|
||||
uint32_t comp_mask; /* reserved for future growth (must be 0) */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_dct()
|
||||
returns a pointer to the created DCT, or NULL if the request fails.
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Moshe Lazer <moshel@mellanox.com>
|
||||
.TP
|
||||
Eli Cohen <eli@mellanox.com>
|
||||
.TP
|
|
@ -1,187 +0,0 @@
|
|||
.TH IBV_EXP_CREATE_FLOW 3 2016-08-31 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_flow, ibv_exp_destroy_flow \- create or destroy flow steering rules
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_exp_flow *ibv_exp_create_flow(struct ibv_qp " "*qp" ,
|
||||
.BI " struct ibv_exp_flow_attr " "*flow");
|
||||
.BI "int ibv_exp_destroy_flow(struct ibv_exp_flow " "*flow_id");
|
||||
.sp
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.SS ibv_exp_create_flow()
|
||||
allows a user application QP
|
||||
.I qp
|
||||
to be attached into a specified flow
|
||||
.I flow
|
||||
which is defined in
|
||||
.I <infiniband/verbs_exp.h>
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_flow_attr {
|
||||
.in +8
|
||||
enum ibv_exp_flow_attr_type type; /* Rule type - see below */
|
||||
uint16_t size; /* Size of command */
|
||||
uint16_t priority; /* Rule priority - See below */
|
||||
uint8_t num_of_specs; /* Number of ibv_flow_spec_xxx */
|
||||
uint8_t port; /* The uplink port number */
|
||||
uint32_t flags; /* Extra flags for rule - see below */
|
||||
uint64_t reserved; /* reserved for future growth (must be 0) */
|
||||
/* Following are the optional layers according to user request
|
||||
* struct ibv_exp_flow_spec_xxx
|
||||
* struct ibv_exp_flow_spec_yyy
|
||||
*/
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
enum ibv_exp_flow_attr_type {
|
||||
.in +8
|
||||
IBV_EXP_FLOW_ATTR_NORMAL = 0x0, /* steering according to rule specifications */
|
||||
IBV_EXP_FLOW_ATTR_ALL_DEFAULT = 0x1, /* default unicast and multicast rule - receive all Eth traffic which isn't steered to any QP */
|
||||
IBV_EXP_FLOW_ATTR_MC_DEFAULT = 0x2, /* default multicast rule - receive all Eth multicast traffic which isn't steered to any QP */
|
||||
IBV_EXP_FLOW_ATTR_SNIFFER = 0x3, /* sniffer rule - receive all port traffic */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
enum ibv_exp_flow_flags {
|
||||
.in +8
|
||||
IBV_EXP_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = 1, /* Apply the rules on packets that were sent from the attached QP through loopback. IB only.*/
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.sp
|
||||
.nf
|
||||
enum ibv_exp_flow_spec_type {
|
||||
.in +8
|
||||
IBV_EXP_FLOW_SPEC_ETH = 0x20, /* Flow specification of L2 header */
|
||||
IBV_EXP_FLOW_SPEC_IB = 0x21, /* Flow specification of IB header */
|
||||
IBV_EXP_FLOW_SPEC_IPV4 = 0x30, /* Flow specification of IPv4 partial header */
|
||||
IBV_EXP_FLOW_SPEC_IPV6 = 0x31, /* Flow specification of IPv6 partial header */
|
||||
IBV_EXP_FLOW_SPEC_IPV4_EXT = 0x32, /* Extended flow specification of IPv4 */
|
||||
IBV_EXP_FLOW_SPEC_IPV6_EXT = 0x33, /* Extended flow specification of IPv6 */
|
||||
IBV_EXP_FLOW_SPEC_TCP = 0x40, /* Flow specification of TCP header */
|
||||
IBV_EXP_FLOW_SPEC_UDP = 0x41, /* Flow specification of UDP header */
|
||||
IBV_EXP_FLOW_SPEC_VXLAN_TUNNEL = 0x50, /* Flow specification for VxLAN header */
|
||||
IBV_EXP_FLOW_SPEC_INNER = 0x100, /* Used to filter the inner packet fields, should be set with other spec from above */
|
||||
IBV_EXP_FLOW_SPEC_ACTION_TAG = 0x1000, /* When there is a matching, the flow tag will be reported in the CQE */
|
||||
.in -8
|
||||
};
|
||||
.br
|
||||
|
||||
Flow specification general structure:
|
||||
.BR
|
||||
struct ibv_exp_flow_spec_xxx {
|
||||
enum ibv_exp_flow_spec_type type;
|
||||
uint16_t size; /* Flow specification size = sizeof(struct ibv_exp_flow_spec_xxx) */
|
||||
struct ibv_exp_flow_xxx_filter val;
|
||||
struct ibv_exp_flow_xxx_filter mask; /* Defines which bits from the filter value are applicable when looking for a match in the incoming packet */
|
||||
};
|
||||
.br
|
||||
For all flow specification fields, please refer to verbs_exp.h.
|
||||
.PP
|
||||
Each header struct holds the relevant network layer parameters for matching. To enforce the match, the
|
||||
user sets a mask for each parameter. If the bit is set in the mask, the corresponding bit in the value should be matched.
|
||||
.br
|
||||
.B Network paramters in the relevant network structs should be given in network order (big endian).
|
||||
|
||||
.SS Flow domains and priority
|
||||
Flow steering defines the concept of domain and priority. Each domain represents a user agent that can attach a flow. The domains are prioritized. A higher priority domain will always supersede a lower priority domain when their flow specifications overlap. In addition to the domain, there is priority within each of the domains. Each domain has at most 2^12 priorities. A lower priority numeric value (higher priority) takes precedence over matching rules with higher numeric priority value (lower priority). It is important to note that the priority value of a flow spec is used not only to establish the precedence of conflicting flow matches but also as a way to abstract the order on which flow specs are tested for matches. Flows with higher priorities will be tested before flows with lower priorities.
|
||||
.br
|
||||
.B IB verbs have the higher priority domain.
|
||||
.PP
|
||||
.SS ibv_exp_destroy_flow()
|
||||
destroys the flow
|
||||
.I flow_id\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_flow()
|
||||
returns a pointer to the flow, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_exp_destroy_flow()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
1. These verbs are available only for devices supporting IBV_DEVICE_MANAGED_FLOW_STEERING and
|
||||
only for QPs of Transport Service Type
|
||||
.BR IBV_QPT_UD
|
||||
or
|
||||
.BR IBV_QPT_RAW_PACKET
|
||||
.br
|
||||
2. Most vendors support either full mask (all "1"s) or zero mask (all "0"s).
|
||||
.br
|
||||
3. User must memset the spec struct with zeros before using it.
|
||||
.br
|
||||
4. ether_type field in ibv_exp_flow_eth_filter is the ethertype following the last VLAN tag of the packet.
|
||||
.br
|
||||
.PP
|
||||
.SH "AUTHORS"
|
||||
.br
|
||||
Below flow_attr defines a rule in priority 0 to match a destination
|
||||
mac address and a source ipv4 address. For that, L2 and L3 specs are used.
|
||||
.br
|
||||
If there is a hit on this rule, means the
|
||||
received packet has destination mac: 66:11:22:33:44:55 and source ip: 0x0B86C806,
|
||||
the packet is steered to its attached qp.
|
||||
.sp
|
||||
.nf
|
||||
struct raw_eth_flow_attr {
|
||||
.in +8
|
||||
struct ibv_exp_flow_attr attr;
|
||||
struct ibv_exp_flow_spec_eth spec_eth;
|
||||
struct ibv_exp_flow_spec_ipv4 spec_ipv4;
|
||||
.in -8
|
||||
} __attribute__((packed));
|
||||
.sp
|
||||
.nf
|
||||
struct raw_eth_flow_attr flow_attr = {
|
||||
.in +8
|
||||
.attr = {
|
||||
.comp_mask = 0,
|
||||
.type = IBV_EXP_FLOW_ATTR_NORMAL,
|
||||
.size = sizeof(flow_attr),
|
||||
.priority = 0,
|
||||
.num_of_specs = 2,
|
||||
.port = 1,
|
||||
.flags = 0,
|
||||
},
|
||||
.spec_eth = {
|
||||
.type = IBV_EXP_FLOW_SPEC_ETH,
|
||||
.size = sizeof(struct ibv_exp_flow_spec_eth),
|
||||
.val = {
|
||||
.dst_mac = {0x66, 0x11, 0x22, 0x33, 0x44, 0x55},
|
||||
.src_mac = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
.ether_type = 0,
|
||||
.vlan_tag = 0,
|
||||
},
|
||||
.mask = {
|
||||
.dst_mac = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
|
||||
.src_mac = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
|
||||
.ether_type = 0,
|
||||
.vlan_tag = 0,
|
||||
}
|
||||
},
|
||||
.spec_ipv4 = {
|
||||
.type = IBV_EXP_FLOW_SPEC_IPV4,
|
||||
.size = sizeof(struct ibv_exp_flow_spec_ipv4),
|
||||
.val = {
|
||||
.src_ip = 0x0B86C806,
|
||||
.dst_ip = 0,
|
||||
},
|
||||
.mask = {
|
||||
.src_ip = 0xFFFFFFFF,
|
||||
.dst_ip = 0,
|
||||
}
|
||||
}
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
.SH EXAMPLE
|
||||
.TP
|
||||
Matan Barak <matanb@mellanox.com>
|
||||
.TP
|
||||
Hadar Hen Zion <hadarh@mellanox.com>
|
||||
.TP
|
||||
Maor Gottlieb <maorg@mellanox.com>
|
|
@ -1,123 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_CREATE_MR 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_mr \- create empty memory region (MR)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_mr *ibv_exp_create_mr(struct ibv_exp_create_mr_in " "*in" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_create_mr()
|
||||
create empty memory region (MR) associated with the protection domain
|
||||
.I in->pd\fR.
|
||||
The MR's init attributes are
|
||||
.I in->attr
|
||||
and the maximum KLMs we can use to fill it is
|
||||
.I in->attr.max_klm_list_size\fR.
|
||||
.PP
|
||||
The argument
|
||||
.I in
|
||||
is an ibv_exp_create_mr_in struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_create_mr_in {
|
||||
.in +8
|
||||
struct ibv_pd *pd; /* protection domain (PD) associated with the MR */
|
||||
struct ibv_exp_mr_init_attr attr; /* Initialization attributes of the memory region (MR) */
|
||||
uint32_t comp_mask; /* reserved for future growth (must be 0) */
|
||||
.in -8
|
||||
};
|
||||
.PP
|
||||
.fi
|
||||
The argument
|
||||
.I in->attr
|
||||
is an ibv_exp_mr_init_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_mr_init_attr {
|
||||
.in +8
|
||||
uint32_t max_klm_list_size; /* Maximum number of KLMs we can use to fill the MR */
|
||||
uint32_t create_flags; /* use ibv_exp_mr_create_flags */
|
||||
uint32_t exp_access_flags; /* reserved for future growth (must be 0) */
|
||||
.in -8
|
||||
};
|
||||
|
||||
.fi
|
||||
.I in->attr.exp_access
|
||||
describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of the following flags:
|
||||
.PP
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_LOCAL_WRITE \fR Enable Local Write Access
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_REMOTE_READ\fR Enable Remote Read Access
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported)
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_MW_BIND\fR Enable Memory Window Binding
|
||||
.TP
|
||||
.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.
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_SHARED_MR_USER_READ\fR Enable sharing this MR for reading by user (application owner).
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_SHARED_MR_USER_WRITE\fR Enable sharing this MR for writing by user.
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_SHARED_MR_GROUP_READ\fR Enable sharing this MR for reading by group (application group).
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_SHARED_MR_GROUP_WRITE\fR Enable sharing this MR for writing by group.
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_SHARED_MR_OTHER_READ\fR Enable sharing this MR for reading by other.
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_SHARED_MR_OTHER_WRITE\fR Enable sharing this MR for writing by other.
|
||||
.TP
|
||||
.B IBV_EXP_ACCESS_ON_DEMAND\fR Create an on-demand paging MR.
|
||||
.PP
|
||||
If
|
||||
.B IBV_EXP_ACCESS_REMOTE_WRITE
|
||||
or
|
||||
.B IBV_EXP_ACCESS_REMOTE_ATOMIC
|
||||
is set, then
|
||||
.B IBV_EXP_ACCESS_LOCAL_WRITE
|
||||
must be set too.
|
||||
.PP
|
||||
Local read access is always enabled for the MR.
|
||||
.fi
|
||||
.I in->attr.create_flags
|
||||
describes the capabilities of the MR we want to create; it is one of the following flags:
|
||||
.PP
|
||||
.TP
|
||||
.B IBV_EXP_MR_INDIRECT_KLMS\fR Enable capabilities of creating KLM using ibv_exp_post_send()
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_mr()
|
||||
returns a pointer to an empty MR with lkey, or NULL if the request fails.
|
||||
The local key (\fBL_Key\fR) field
|
||||
.B lkey
|
||||
is used as the lkey field of struct ibv_sge when posting buffers with
|
||||
ibv_post_* verbs, and the remote key (\fBR_Key\fR)
|
||||
field
|
||||
.B rkey
|
||||
is used by remote processes to perform Atomic and RDMA operations. The remote process places this
|
||||
.B rkey
|
||||
as the rkey field of struct ibv_send_wr passed to the ibv_post_send function.
|
||||
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
The user can't use this MR untill we FILL the MR using
|
||||
.I ibv_exp_post_send
|
||||
with opcode
|
||||
.I IBV_EXP_WR_UMR_FILL
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_dereg_mr (3),
|
||||
.BR ibv_exp_reg_mr (3),
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_post_send (3),
|
||||
.BR ibv_post_recv (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Haggai Abramovsky <hagaya@mellanox.com>
|
|
@ -1,132 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_CREATE_QP 3 2014-24-27 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_qp \- create a queue pair (QP)
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_qp *ibv_exp_create_qp(struct ibv_context " "*context" ,
|
||||
.BI " struct ibv_exp_qp_init_attr " "*qp_init_attr" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_create_qp()
|
||||
creates a queue pair (QP) associated with the protection domain
|
||||
.I qp_init_attr->pd\fR.
|
||||
.fi
|
||||
The argument
|
||||
.I qp_init_attr
|
||||
is an ibv_exp_qp_init_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_qp_init_attr {
|
||||
.in +8
|
||||
void *qp_context; /* Associated context of the QP */
|
||||
struct ibv_cq *send_cq; /* CQ to be associated with the Send Queue (SQ) */
|
||||
struct ibv_cq *recv_cq; /* CQ to be associated with the Receive Queue (RQ) */
|
||||
struct ibv_srq *srq; /* SRQ handle if QP is to be associated with an SRQ, otherwise NULL */
|
||||
struct ibv_qp_cap cap; /* QP capabilities */
|
||||
enum ibv_qp_type qp_type; /* QP Transport Service Type (RC, UD, UC etc.) */
|
||||
int sq_sig_all; /* If set, each Work Request (WR) submitted to the SQ generates a completion entry */
|
||||
uint32_t comp_mask; /* Identifies valid fields. Use ibv_exp_qp_init_attr_comp_mask */
|
||||
struct ibv_pd *pd; /* PD to be associated with the QP */
|
||||
struct ibv_xrcd *xrcd; /* XRC domain to be associated with the target QP */
|
||||
uint32_t exp_create_flags; /* Creation flags for this QP. Use ibv_exp_qp_create_flags */
|
||||
uint32_t max_inl_recv; /* Requested size of inline-receive */
|
||||
struct ibv_exp_qpg qpg; /* QP group, used for RSS/TSS */
|
||||
uint32_t max_atomic_arg; /* Request max atomic argument size for atomic masked operations */
|
||||
uint32_t max_inl_send_klms;/* Request Maximum number of KLMs when creating UMR whith IBV_EXP_SEND_INLINE */
|
||||
struct ibv_exp_res_domain *res_domain; /* Provides resource domain to indicate the QP threading and message model */
|
||||
struct ibv_exp_rx_hash_conf *rx_hash_conf;/* RX hash configuration used for RSS */
|
||||
uint8_t port_num; /* Port number to be associated with, applicable only to RX QP */
|
||||
/* Create QP with Peer-direct sync support */
|
||||
struct ibv_exp_peer_direct_attr *peer_direct_attrs;
|
||||
uint16_t max_tso_header; /* Maximum TSO header size */
|
||||
.in -8
|
||||
};
|
||||
.sp
|
||||
.nf
|
||||
struct ibv_qp_cap {
|
||||
.in +8
|
||||
uint32_t max_send_wr; /* Requested max number of outstanding WRs in the SQ */
|
||||
uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */
|
||||
uint32_t max_send_sge; /* Requested max number of scatter/gather (s/g) elements in a WR in the SQ */
|
||||
uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the SQ */
|
||||
uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.sp
|
||||
.nf
|
||||
The attribute exp_create_flags describes the properties of the QP. It is either 0 or the bitwise OR of one or more of the following flags:
|
||||
enum ibv_exp_qp_create_flags {
|
||||
.in +8
|
||||
IBV_EXP_QP_CREATE_CROSS_CHANNEL = (1 << 2), /* Create Cross-Channel */
|
||||
IBV_EXP_QP_CREATE_MANAGED_SEND = (1 << 3), /* Create managed send queue */
|
||||
IBV_EXP_QP_CREATE_MANAGED_RECV = (1 << 4), /* Create managed recv queue */
|
||||
IBV_EXP_QP_CREATE_IGNORE_SQ_OVERFLOW = (1 << 6), /* Send queue overflow will be ignored */
|
||||
IBV_EXP_QP_CREATE_IGNORE_RQ_OVERFLOW = (1 << 7), /* Recv queue overflow will be ignored */
|
||||
IBV_EXP_QP_CREATE_ATOMIC_BE_REPLY = (1 << 8), /* Should be set to use atomics on devices that are ATOMIC_HCA_REPLY_BE */
|
||||
IBV_EXP_QP_CREATE_UMR = (1 << 9), /* Create UMR */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.sp
|
||||
.nf
|
||||
struct ibv_exp_rx_hash_conf {
|
||||
.in +8
|
||||
uint8_t rx_hash_function; /* Use enum ibv_exp_rx_hash_function_flags */
|
||||
uint8_t rx_hash_key_len; /* key length - valid only for Toeplitz */
|
||||
uint8_t *rx_hash_key; /* key value - valid only for Toeplitz */
|
||||
uint64_t rx_hash_fields_mask; /* Use enum ibv_exp_rx_hash_fields to set which incoming packet field should participates in RX hash */
|
||||
struct ibv_exp_rwq_ind_table *rwq_ind_tbl; /* Receive work queue indirection table */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
The function
|
||||
.B ibv_exp_create_qp()
|
||||
will update the
|
||||
.I qp_init_attr\fB\fR->cap
|
||||
struct with the actual \s-1QP\s0 values of the QP that was created;
|
||||
the values will be greater than or equal to the values requested.
|
||||
It will also update the
|
||||
.I qp_init_attr\fB\fR->max_inl_recv
|
||||
in the same way.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_qp()
|
||||
returns a pointer to the created QP, or NULL if the request fails.
|
||||
Check the QP number (\fBqp_num\fR) in the returned QP.
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
The attributes max_recv_wr and max_recv_sge are ignored by
|
||||
.B ibv_exp_create_qp()
|
||||
if the QP is to be associated with an SRQ.
|
||||
.PP
|
||||
If the QP is RX one (i.e. ibv_exp_rx_hash_conf was set) it serves only as a steering entry:
|
||||
.nf
|
||||
1) Input CQs,SRQ must be NULL.
|
||||
.nf
|
||||
2) Input capabilities relate to send/recv must be 0.
|
||||
.nf
|
||||
3) ibv_post_send/recv is not supported on.
|
||||
.nf
|
||||
4) qp_type must support RX hash, use ibv_exp_query_device to get rx_hash_caps and evaluate.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_alloc_pd (3),
|
||||
.BR ibv_modify_qp (3),
|
||||
.BR ibv_exp_modify_qp (3),
|
||||
.BR ibv_exp_query_qp (3),
|
||||
.BR ibv_query_qp (3)
|
||||
.BR ibv_exp_create_res_domain (3),
|
||||
.BR ibv_exp_create_rwq_ind_table (3),
|
||||
.BR ibv_exp_query_device (3),
|
||||
.BR peer_direct (7)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
||||
.TP
|
||||
Majd Dibbiny <majd@mellanox.com>
|
||||
.TP
|
||||
Moshe Lazer <moshel@mellanox.com>
|
|
@ -1,67 +0,0 @@
|
|||
.TH IBV_EXP_CREATE_RES_DOMAIN 3 2015-05-25 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_res_domain \- create resource domain
|
||||
.PP
|
||||
ibv_exp_destroy_res_domain \- destroy resource domain
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.BI "static inline struct ibv_exp_res_domain *ibv_exp_create_res_domain(struct ibv_context " "*context",
|
||||
.BI " struct ibv_exp_res_domain_init_attr " "*attr" ");"
|
||||
|
||||
.BI "static inline int ibv_exp_destroy_res_domain(struct ibv_context " "*context,"
|
||||
.BI " struct ibv_exp_res_domain " "*res_dom,"
|
||||
.BI " struct ibv_exp_destroy_res_domain_attr " "*attr" ");"
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_create_res_domain()
|
||||
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.
|
||||
.PP
|
||||
The argument
|
||||
.I attr
|
||||
is an ibv_exp_res_domain_init_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
enum ibv_exp_thread_model {
|
||||
IBV_EXP_THREAD_SAFE, /* The lib responsible to protect the object in multithreaded environment */
|
||||
IBV_EXP_THREAD_UNSAFE, /* The application responsible to protect the object in multithreaded environment */
|
||||
IBV_EXP_THREAD_SINGLE /* The object is called from only one thread */
|
||||
};
|
||||
|
||||
enum ibv_exp_msg_model {
|
||||
IBV_EXP_MSG_DEFAULT, /* Use the provider default message model */
|
||||
IBV_EXP_MSG_LOW_LATENCY, /* Hint the provider to optimize for low latency */
|
||||
IBV_EXP_MSG_HIGH_BW, /* Hint the provider to optimize for high bandwidth */
|
||||
IBV_EXP_MSG_FORCE_LOW_LATENCY, /* Force the provider to optimize for low latency */
|
||||
};
|
||||
|
||||
enum ibv_exp_res_domain_init_attr_comp_mask {
|
||||
IBV_EXP_RES_DOMAIN_THREAD_MODEL = (1 << 0),
|
||||
IBV_EXP_RES_DOMAIN_MSG_MODEL = (1 << 1),
|
||||
IBV_EXP_RES_DOMAIN_RESERVED = (1 << 2),
|
||||
};
|
||||
|
||||
struct ibv_exp_res_domain_init_attr {
|
||||
uint32_t comp_mask; /* use ibv_exp_res_domain_init_attr_comp_mask */
|
||||
enum ibv_exp_thread_model thread_model;
|
||||
enum ibv_exp_msg_model msg_model;
|
||||
};
|
||||
|
||||
.PP
|
||||
.B ibv_exp_destroy_res_domain()
|
||||
Destroys the resource domain.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_res_domain()
|
||||
returns a pointer to the created resource domain, or NULL if the request fails.
|
||||
|
||||
.PP
|
||||
.B ibv_exp_destroy_res_domain()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
|
||||
.SH "NOTES"
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Moshe Lazer <moshel@mellanox.com>
|
|
@ -1,59 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH CREATE_RWQ_IND_TBL 3 2015-08-04 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_rwq_ind_table, ibv_exp_destroy_rwq_ind_table \- create or destroy a Receive Work Queue Indirection Table (RWQ IND TBL).
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_exp_rwq_ind_table *ibv_exp_create_rwq_ind_table(struct ibv_context " "*context,"
|
||||
.BI " struct ibv_exp_rwq_ind_table_init_attr " "*init_attr" );
|
||||
.sp
|
||||
.BI "int ibv_exp_destroy_rwq_ind_table(struct ibv_exp_rwq_ind_table " "*rwq_ind_table" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_create_rwq_ind_table()
|
||||
creates a RWQ IND TBL associated with the ibv_context
|
||||
.I context\fR.
|
||||
The argument
|
||||
.I init_attr
|
||||
is an ibv_exp_rwq_ind_table_init_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_rwq_ind_table_init_attr {
|
||||
.in +8
|
||||
struct ibv_pd *pd; /* PD to be associated with the created object */
|
||||
uint32_t log_ind_tbl_size; /* Log, base 2, of Indirection table size */
|
||||
struct ibv_exp_wq **ind_tbl; /* Each entry is a pointer to Receive Work Queue */
|
||||
uint32_t comp_mask; /* Identifies valid fields. Use ibv_exp_ind_table_init_attr_mask */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
The function
|
||||
.B ibv_exp_create_rwq_ind_table()
|
||||
will create a RWQ IND TBL that holds a table of Receive Work Queue.
|
||||
For further usage of the created object see below
|
||||
.I NOTES\fR.
|
||||
.PP
|
||||
.B ibv_exp_destroy_rwq_ind_table()
|
||||
destroys the RWQ IND TBL
|
||||
.I rwq_ind_table\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_rwq_ind_table()
|
||||
returns a pointer to the created RWQ IND TBL, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_exp_destroy_rwq_ind_table()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
The created object should be used as part of
|
||||
.I ibv_exp_create_qp()
|
||||
to enable dispatching of incoming packets based on some RX hash configuration.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_exp_create_wq (3),
|
||||
.BR ibv_exp_modify_wq (3),
|
||||
.BR ibv_exp_create_qp (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
|
@ -1,79 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_CREATE_WQ 3 2015-08-04 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_create_wq, ibv_exp_destroy_wq \- create or destroy a Work Queue (WQ).
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "struct ibv_exp_wq *ibv_exp_create_wq(struct ibv_context " "*context,"
|
||||
.BI " struct ibv_exp_wq_init_attr " "*wq_init_attr" );
|
||||
.sp
|
||||
.BI "int ibv_exp_destroy_wq(struct ibv_exp_wq " "*wq" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_create_wq()
|
||||
creates a WQ associated with the ibv_context
|
||||
.I context\fR.
|
||||
The argument
|
||||
.I wq_init_attr
|
||||
is an ibv_exp_wq_init_attr struct, as defined in <infiniband/verbs_exp.h>.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_wq_init_attr {
|
||||
.in +8
|
||||
void *wq_context; /* Associated context of the WQ */
|
||||
enum ibv_exp_wq_type wq_type; /* WQ type */
|
||||
uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */
|
||||
uint32_t max_recv_sge; /* Requested max receive number of scatter/gather (s/g) elements per WR in the RQ */
|
||||
struct ibv_pd *pd; /* PD to be associated with the WQ */
|
||||
struct ibv_cq *cq; /* CQ to be associated with the WQ */
|
||||
struct ibv_srq *srq; /* SRQ handle if WQ is of type IBV_EXP_WQT_SRQ, otherwise NULL */
|
||||
uint32_t comp_mask; /* Identifies valid fields. Use ibv_exp_wq_init_attr_mask */
|
||||
struct ibv_exp_res_domain *res_domain; /* Provides resource domain to indicate the WQ threading and message model */
|
||||
struct ibv_exp_wq_mp_rq mp_rq; /* Provides multi-packet data for receive WQ */
|
||||
uint16_t vlan_offloads; /* Provide VLAN offload support for receive WQ */
|
||||
.in -8
|
||||
};
|
||||
|
||||
struct ibv_exp_wq_mp_rq {
|
||||
.in +8
|
||||
enum ibv_exp_mp_rq_shifts use_shift; /* Shift to use for received payload */
|
||||
uint8_t single_wqe_log_num_of_strides; /* Log of number of strides for single WQE */
|
||||
uint8_t single_stride_log_num_of_bytes; /* Log of number of bytes in single stride */
|
||||
.in -8
|
||||
};
|
||||
|
||||
.fi
|
||||
.PP
|
||||
The function
|
||||
.B ibv_exp_create_wq()
|
||||
will update the
|
||||
.I wq_init_attr\fB\fR->max_recv_wr
|
||||
and
|
||||
.I wq_init_attr\fB\fR->max_recv_sge
|
||||
fields with the actual \s-1WQ\s0 values of the WQ that was created;
|
||||
the values will be greater than or equal to the values requested.
|
||||
.PP
|
||||
.B ibv_exp_destroy_wq()
|
||||
destroys the WQ
|
||||
.I wq\fR.
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_create_wq()
|
||||
returns a pointer to the created WQ, or NULL if the request fails.
|
||||
.PP
|
||||
.B ibv_exp_destroy_wq()
|
||||
returns 0 on success, or the value of errno on failure (which indicates the failure reason).
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
The attributes max_recv_wr and max_recv_sge are ignored by
|
||||
.B ibv_exp_create_wq()
|
||||
if the WQ is to be associated with an SRQ.
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_exp_modify_wq (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Yishai Hadas <yishaih@mellanox.com>
|
||||
.TP
|
||||
Noa Osherovich <noaos@mellanox.com>
|
|
@ -1,38 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_DEALLOC_MKEY_LIST_MOMORY 3 2014-08-28 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_dealloc_mkey_list_memory \- deallocates the struct that was allocated using ibv_exp_alloc_mkey_list_memory()
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "int ibv_exp_dealloc_mkey_list_memory(struct ibv_exp_mkey_list_container " "*mem" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_dealloc_mkey_list_memory()
|
||||
dallocates the argument
|
||||
.I mem
|
||||
that was allocated using ibv_exp_alloc_mkey_list_memory()
|
||||
.PP
|
||||
The argument
|
||||
.I mem
|
||||
is an ibv_exp_mkey_list_container struct and is defined in <infiniband/verbs_exp.h> as follow:
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_list_container {
|
||||
.in +8
|
||||
uint32_t max_klm_list_size; /* maximum number of KLMs we can use to create the UMR */
|
||||
struct ibv_context *context; /* RDMA device context */
|
||||
.in -8
|
||||
};
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_dealloc_mkey_list_memory()
|
||||
returns 0 on success, the value of errno on failure (which indicates the failure reason).
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_exp_alloc_mkey_list_memory (3)
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Haggai Abramovsky <hagaya@mellanox.com>
|
|
@ -1,167 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_EC_DECODE_ASYNC 3 2015-11-28 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_ec_decode_sync, ibv_exp_ec_decode_async \- synchronous and asynchronous erasure decoding calculation
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "int ibv_exp_ec_decode_sync(struct ibv_exp_ec_calc " "*ec_calc" ,
|
||||
.BI " struct ibv_exp_ec_mem " "*ec_mem" ,
|
||||
.BI " uint8_t* " "erasures" ,
|
||||
.BI " uint8_t " "*decode_matrix" );
|
||||
.sp
|
||||
.BI "int ibv_exp_ec_decode_async(struct ibv_exp_ec_calc " "*ec_calc" ,
|
||||
.BI " struct ibv_exp_ec_mem " "*ec_mem" ,
|
||||
.BI " uint8_t* " "erasures" ,
|
||||
.BI " uint8_t " "*decode_matrix" ,
|
||||
.BI " struct ibv_exp_ec_comp " "*ec_comp" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_ec_decode_sync()
|
||||
performs synchronous erasure decoding calculation on a given set of data blocks and
|
||||
code blocks and reconstructs the erased blocks described by
|
||||
.I erasures\fR using the decoding matrix
|
||||
.I decode_matrix\fR.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_ec_mem {
|
||||
.in +8
|
||||
struct ibv_sge *data_blocks; /* array of data sg elements */
|
||||
int num_data_sge; /* number of data sg elements */
|
||||
struct ibv_sge *code_blocks; /* array of code sg elements */
|
||||
int num_code_sge; /* number of code sg elements */
|
||||
int block_size; /* logical block size */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
The erasure coding memory layout specifies the data set layout by
|
||||
.I data_blocks\fR array of
|
||||
.I num_data_sge\fR elements, and the code set layout by
|
||||
.I code_blocks\fR array of
|
||||
.I num_code_sge\fR elements. Both the data and code sets are assumed
|
||||
to have a single unique logical
|
||||
.I block_size\fR.
|
||||
|
||||
.PP
|
||||
The erasures are provided in a byte-map where first
|
||||
.I K\fR bytes represent the data blocks and the following
|
||||
.I M\fR bytes represent the coding blocks.
|
||||
.nf
|
||||
10-4 erasures byte-map:
|
||||
.in +8
|
||||
------------------------------------------
|
||||
|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
|
||||
-------------------------------------------
|
||||
|code blocks| data blocks |
|
||||
-------------------------------------------
|
||||
.in -8
|
||||
Each erased block is represented by a positively set byte in the erasures byte-map.
|
||||
.fi
|
||||
|
||||
.PP
|
||||
The decoding matrix is provided as a byte pointer. The matrix rank corresponds
|
||||
to the number of blocks sufficient to recover the erased blocks
|
||||
.I K\fR and the number of erasures (positively set bytes in
|
||||
.I erasures\fR byte-map).
|
||||
.nf
|
||||
10-4 with 4 erasures decoding matrix (G) layout:
|
||||
.in +8
|
||||
---------------------------------------
|
||||
| G(1,1) | G(1,2) | G(1,3) | G(1,4) |
|
||||
---------------------------------------
|
||||
| G(2,1) | G(2,2) | G(2,3) | G(2,4) |
|
||||
---------------------------------------
|
||||
| G(3,1) | G(3,2) | G(3,3) | G(3,4) |
|
||||
---------------------------------------
|
||||
| G(4,1) | G(4,2) | G(4,3) | G(4,4) |
|
||||
---------------------------------------
|
||||
| G(5,1) | G(5,2) | G(5,3) | G(5,4) |
|
||||
---------------------------------------
|
||||
| G(6,1) | G(6,2) | G(6,3) | G(6,4) |
|
||||
---------------------------------------
|
||||
| G(7,1) | G(7,2) | G(7,3) | G(7,4) |
|
||||
---------------------------------------
|
||||
| G(8,1) | G(8,2) | G(8,3) | G(8,4) |
|
||||
---------------------------------------
|
||||
| G(9,1) | G(9,2) | G(9,3) | G(9,4) |
|
||||
---------------------------------------
|
||||
| G(10,1) | G(10,2) | G(10,3) | G(10,4) |
|
||||
---------------------------------------
|
||||
.in -8
|
||||
|
||||
The decode matrix memory layout is as follows:
|
||||
.in +8
|
||||
-----------------------------------------------------------------------------
|
||||
| G(1,1) | G(1,2) | G(1,3) | G(1,4) | G(2,1) | G(2,2) | G(2,3) | G(2,4) | ... |
|
||||
-----------------------------------------------------------------------------
|
||||
.in -8
|
||||
|
||||
.fi
|
||||
|
||||
.B ibv_exp_ec_decode_async()
|
||||
equivalently performs non-blocking asynchronous erasure decoding calculation.
|
||||
.PP
|
||||
The erasure coding calculation completes by executing the provided erasure
|
||||
coding completion handle
|
||||
.I ec_comp\fR
|
||||
.nf
|
||||
struct ibv_exp_ec_comp {
|
||||
.in +8
|
||||
void (*done)(struct ibv_exp_ec_comp *comp); /* function handle of the EC calculation completion */
|
||||
enum ibv_exp_ec_status status; /* status of the EC calculation */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
The caller is expected to pass a
|
||||
.I ec_comp.done\fR function pointer to execute a post-calculation user-defined logic.
|
||||
The caller is expected to check the completion status
|
||||
.I ec_comp.status\fR in order to verify the calculation succeeded or failed.
|
||||
|
||||
.nf
|
||||
enum ibv_exp_ec_status {
|
||||
.in +8
|
||||
IBV_EXP_EC_CALC_SUCCESS, /* EC calc operation succeded */
|
||||
IBV_EXP_EC_CALC_FAIL, /* EC calc operation failed */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_ec_decode_sync(),
|
||||
returns 0 on successfully completed calculation, or the value of a calculation failure.
|
||||
.PP
|
||||
.B ibv_exp_ec_decode_async(),
|
||||
returns 0 on success, or the value of errno on failure (which indicates the
|
||||
failure reason).
|
||||
.SH "CONSTRAINTS"
|
||||
.PP
|
||||
.I ec_mem.num_data_sg
|
||||
attribute must be equal to the number of data blocks init attribute
|
||||
.I K\fR.
|
||||
.PP
|
||||
.I ec_mem.num_code_sg
|
||||
init attribute must be equal to the number of code blocks init attribute
|
||||
.I M\fR.
|
||||
.PP
|
||||
.I block_size
|
||||
must be multiplier of 64 bytes.
|
||||
.PP
|
||||
.I erasures
|
||||
pointer to byte-map cannot set more bytes than
|
||||
.I M\fR.
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_exp_ec_encode_sync (3),
|
||||
.BR ibv_exp_ec_decode_sync (3),
|
||||
.BR ibv_exp_ec_update_sync (3),
|
||||
.BR ibv_exp_ec_update_async (3),
|
||||
.BR ibv_exp_alloc_ec_calc (3),
|
||||
.BR ibv_exp_dealloc_ec_calc (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Sagi Grimberg <sagig@mellanox.com>
|
|
@ -1,108 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_EC_ENCODE_ASYNC 3 2015-11-28 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_ec_encode_sync, ibv_exp_ec_encode_async \- synchronous and asynchronous erasure coding calculation
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "int ibv_exp_ec_encode_sync(struct ibv_exp_ec_calc " "*ec_calc" ,
|
||||
.BI " struct ibv_exp_ec_mem " "*ec_mem" );
|
||||
.sp
|
||||
.BI "int ibv_exp_ec_encode_async(struct ibv_exp_ec_calc " "*ec_calc" ,
|
||||
.BI " struct ibv_exp_ec_mem " "*ec_mem" ,
|
||||
.BI " struct ibv_exp_ec_comp " "*ec_comp" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_ec_encode_sync()
|
||||
performs synchronous erasure coding calculation on a given set of data blocks and
|
||||
places the calculation result in a given set of coding blocks. The given buffers
|
||||
and their logical block size are described in the erasure coding memory layout
|
||||
.I ec_mem\fR.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_ec_mem {
|
||||
.in +8
|
||||
struct ibv_sge *data_blocks; /* array of data sg elements */
|
||||
int num_data_sge; /* number of data sg elements */
|
||||
struct ibv_sge *code_blocks; /* array of code sg elements */
|
||||
int num_code_sge; /* number of code sg elements */
|
||||
int block_size; /* logical block size */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
The erasure coding memory layout specifies the data set layout by
|
||||
.I data_blocks\fR array of
|
||||
.I num_data_sge\fR elements, and the code set layout by
|
||||
.I code_blocks\fR array of
|
||||
.I num_code_sge\fR elements. Both the data and code sets are assumed
|
||||
to have a single unique logical
|
||||
.I block_size\fR.
|
||||
|
||||
.PP
|
||||
The calculation operation will block until the calculation is completed.
|
||||
.fi
|
||||
|
||||
.B ibv_exp_ec_encode_async()
|
||||
equivalently performs non-blocking asynchronous erasure coding calculation.
|
||||
.PP
|
||||
The erasure coding calculation completes by executing the provided erasure
|
||||
coding completion handle
|
||||
.I ec_comp\fR
|
||||
.nf
|
||||
struct ibv_exp_ec_comp {
|
||||
.in +8
|
||||
void (*done)(struct ibv_exp_ec_comp *comp); /* function handle of the EC calculation completion */
|
||||
enum ibv_exp_ec_status status; /* status of the EC calculation */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
The caller is expected to pass a
|
||||
.I ec_comp.done\fR function pointer to execute a post-calculation user-defined logic.
|
||||
The caller is expected to check the completion status
|
||||
.I ec_comp.status\fR in order to verify the calculation succeeded or failed.
|
||||
|
||||
.nf
|
||||
enum ibv_exp_ec_status {
|
||||
.in +8
|
||||
IBV_EXP_EC_CALC_SUCCESS, /* EC calc operation succeded */
|
||||
IBV_EXP_EC_CALC_FAIL, /* EC calc operation failed */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_ec_encode_sync(),
|
||||
returns 0 on successfully completed calculation, or the value of a calculation failure.
|
||||
.PP
|
||||
.B ibv_exp_ec_encode_async(),
|
||||
returns 0 on success, or the value of errno on failure (which indicates the
|
||||
failure reason).
|
||||
.SH "CONSTRAINTS"
|
||||
.PP
|
||||
.I ec_mem.num_data_sg
|
||||
attribute must be equal to the number of data blocks init attribute
|
||||
.I K\fR.
|
||||
.PP
|
||||
.I ec_mem.num_code_sg
|
||||
init attribute must be equal to the number of code blocks init attribute
|
||||
.I M\fR.
|
||||
.PP
|
||||
.I block_size
|
||||
must be multiplier of 64 bytes.
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_exp_ec_encode_sync (3),
|
||||
.BR ibv_exp_ec_decode_sync (3),
|
||||
.BR ibv_exp_ec_decode_async (3),
|
||||
.BR ibv_exp_ec_update_sync (3),
|
||||
.BR ibv_exp_ec_update_async (3),
|
||||
.BR ibv_exp_alloc_ec_calc (3),
|
||||
.BR ibv_exp_dealloc_ec_calc (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Sagi Grimberg <sagig@mellanox.com>
|
|
@ -1,128 +0,0 @@
|
|||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.TH IBV_EXP_EC_UPDATE_ASYNC 3 2016-03-07 libibverbs "Libibverbs Programmer's Manual"
|
||||
.SH "NAME"
|
||||
ibv_exp_ec_update_sync, ibv_exp_ec_update_async \- synchronous and asynchronous erasure coding calculation based on updates
|
||||
.SH "SYNOPSIS"
|
||||
.nf
|
||||
.B #include <infiniband/verbs_exp.h>
|
||||
.sp
|
||||
.BI "int ibv_exp_ec_update_sync(struct ibv_exp_ec_calc " "*ec_calc" ,
|
||||
.BI " struct ibv_exp_ec_mem " "*ec_mem",
|
||||
.BI " uint8_t *data_updates,
|
||||
.BI " uint8_t *code_updates);
|
||||
.sp
|
||||
.BI "int ibv_exp_ec_update_async(struct ibv_exp_ec_calc " "*ec_calc" ,
|
||||
.BI " struct ibv_exp_ec_mem " "*ec_mem" ,
|
||||
.BI " uint8_t *data_updates,
|
||||
.BI " uint8_t *code_updates,
|
||||
.BI " struct ibv_exp_ec_comp " "*ec_comp" );
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.B ibv_exp_ec_update_sync()
|
||||
performs synchronous erasure coding calculation based on blocks that are updated and previous code,
|
||||
places the calculation result in a given set of coding blocks. The given buffers
|
||||
and their logical block size are described in the erasure coding memory layout
|
||||
.I ec_mem\fR.
|
||||
.PP
|
||||
.nf
|
||||
struct ibv_exp_ec_mem {
|
||||
.in +8
|
||||
struct ibv_sge *data_blocks; /* array of data sg elements */
|
||||
int num_data_sge; /* number of data sg elements */
|
||||
struct ibv_sge *code_blocks; /* array of code sg elements */
|
||||
int num_code_sge; /* number of code sg elements */
|
||||
int block_size; /* logical block size */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
The erasure coding memory layout specifies the data set layout by
|
||||
.I data_blocks\fR array of
|
||||
.I num_data_sge\fR elements, and the code set layout by
|
||||
.I code_blocks\fR array of
|
||||
.I num_code_sge\fR elements. Both the data and code sets are assumed
|
||||
to have a single unique logical
|
||||
.I block_size\fR.
|
||||
|
||||
.PP
|
||||
The calculation operation will block until the calculation is completed.
|
||||
.fi
|
||||
|
||||
.B ibv_exp_ec_update_async()
|
||||
equivalently performs non-blocking asynchronous erasure coding calculation
|
||||
based on blocks that are updated and previous code
|
||||
.PP
|
||||
The erasure coding calculation completes by executing the provided erasure
|
||||
coding completion handle
|
||||
.I ec_comp\fR
|
||||
.nf
|
||||
struct ibv_exp_ec_comp {
|
||||
.in +8
|
||||
void (*done)(struct ibv_exp_ec_comp *comp); /* function handle of the EC calculation completion */
|
||||
enum ibv_exp_ec_status status; /* status of the EC calculation */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
The caller is expected to pass a
|
||||
.I ec_comp.done\fR function pointer to execute a post-calculation user-defined logic.
|
||||
The caller is expected to check the completion status
|
||||
.I ec_comp.status\fR in order to verify the calculation succeeded or failed.
|
||||
|
||||
.nf
|
||||
enum ibv_exp_ec_status {
|
||||
.in +8
|
||||
IBV_EXP_EC_CALC_SUCCESS, /* EC calc operation succeeded */
|
||||
IBV_EXP_EC_CALC_FAIL, /* EC calc operation failed */
|
||||
.in -8
|
||||
};
|
||||
.fi
|
||||
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.B ibv_exp_ec_update_sync(),
|
||||
returns 0 on successfully completed calculation, or the value of a calculation failure.
|
||||
.PP
|
||||
.B ibv_exp_ec_update_async(),
|
||||
returns 0 on success, or the value of errno on failure (which indicates the
|
||||
failure reason).
|
||||
.SH "CONSTRAINTS"
|
||||
.PP
|
||||
.I ec_mem.data_blocks
|
||||
attribute must be an sg constructed as C0 ... Cm Di D'i Dj D'j,
|
||||
were C0 ... Cm are code blocks, Di and Dj are original i-th and j-th data blocks,
|
||||
D'i and D'j are thir replacements and i<j.
|
||||
.I ec_mem.num_data_sg
|
||||
attribute must be equal to the number of data blocks in ec_mem.data_blocks,
|
||||
which should be less then init attribute
|
||||
.I ec_mem.code_blocks
|
||||
attribute must be an sg constructed as Ci,Cj,... ,
|
||||
were Ci, Cj, .. are redundancies that should be recomputed, and i < j.
|
||||
.I ec_mem.num_code_sg
|
||||
attribute must be equal to the number of code blocks in ec_mem.code_blocks,
|
||||
which should be less then init attribute
|
||||
.I K\fR.
|
||||
.PP
|
||||
.I ec_mem.num_code_sg
|
||||
init attribute must be equal to the number of code blocks init attribute
|
||||
.I M\fR.
|
||||
.PP
|
||||
.I data_updates
|
||||
must be an array of bytes with size equal to init attribute number of data blocks
|
||||
.I K\fR
|
||||
.PP
|
||||
.I code_updates
|
||||
must be an array of bytes with size equal to init attribute number of code blocks
|
||||
.I M\fR.
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.BR ibv_exp_ec_encode_sync (3),
|
||||
.BR ibv_exp_ec_encode_async (3),
|
||||
.BR ibv_exp_ec_decode_sync (3),
|
||||
.BR ibv_exp_ec_decode_async (3),
|
||||
.BR ibv_exp_alloc_ec_calc (3),
|
||||
.BR ibv_exp_dealloc_ec_calc (3),
|
||||
.SH "AUTHORS"
|
||||
.TP
|
||||
Jenny Derzhavetz <jennyf@mellanox.com>, Sagi Grimberg <sagig@mellanox.com>
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче