1
1

libfabric: update to official 1.0.0rc3 release

One change was made to the 1.0.0rc3 tarball: remove an errand
debugging printf that accidentally made its way into the tarball (but
isn't in git).
Этот коммит содержится в:
Jeff Squyres 2015-03-31 03:18:16 -07:00
родитель 8914a9c070
Коммит a89a5872c2
99 изменённых файлов: 4994 добавлений и 6596 удалений

Просмотреть файл

@ -38,7 +38,6 @@ src_libfabric_la_SOURCES = \
include/fi_enosys.h \
include/fi_indexer.h \
include/fi_list.h \
include/fi_log.h \
include/fi_rbuf.h \
include/prov.h \
src/fabric.c \
@ -215,7 +214,7 @@ _usnic_files = \
prov/usnic/src/usdf_timer.h
_usnic_cppflags = \
-D__LIBUSNIC__ \
-D__LIBUSNIC__ -DWANT_DEBUG_MSGS=0 \
-DHAVE_LIBNL3=$(HAVE_LIBNL3) $(usnic_nl_CPPFLAGS) \
-I$(top_srcdir)/prov/usnic/src/usnic_direct
@ -290,6 +289,7 @@ rdmainclude_HEADERS += \
$(top_srcdir)/include/rdma/fi_cm.h \
$(top_srcdir)/include/rdma/fi_domain.h \
$(top_srcdir)/include/rdma/fi_eq.h \
$(top_srcdir)/include/rdma/fi_log.h \
$(top_srcdir)/include/rdma/fi_prov.h \
$(top_srcdir)/include/rdma/fi_rma.h \
$(top_srcdir)/include/rdma/fi_endpoint.h \
@ -370,7 +370,7 @@ dummy_man_pages = \
man/man3/fi_cq_sread.3 \
man/man3/fi_cq_sreadfrom.3 \
man/man3/fi_cq_strerror.3 \
man/man3/fi_cq_write.3 \
man/man3/fi_cq_signal.3 \
man/man3/fi_domain_bind.3 \
man/man3/fi_domain_query.3 \
man/man3/fi_dupinfo.3 \

Просмотреть файл

@ -1,7 +1,7 @@
This README is for userspace RDMA fabric library.
Version Libfabric v1.0.0rc3
Released on 2015-03-26
Released on 2015-03-31
Building
========

Просмотреть файл

@ -128,6 +128,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define PT_LOCK_SPIN to 1 if available. */
#undef PT_LOCK_SPIN
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

Просмотреть файл

@ -1,270 +0,0 @@
#! /bin/sh
# Wrapper for Microsoft lib.exe
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2013 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# 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>.
# func_error message
func_error ()
{
echo "$me: $1" 1>&2
exit 1
}
file_conv=
# func_file_conv build_file
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv in
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_at_file at_file operation archive
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
# for each of them.
# When interpreting the content of the @FILE, do NOT use func_file_conv,
# since the user would need to supply preconverted file names to
# binutils ar, at least for MinGW.
func_at_file ()
{
operation=$2
archive=$3
at_file_contents=`cat "$1"`
eval set x "$at_file_contents"
shift
for member
do
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
done
}
case $1 in
'')
func_error "no command. Try '$0 --help' for more information."
;;
-h | --h*)
cat <<EOF
Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
Members may be specified in a file named with @FILE.
EOF
exit $?
;;
-v | --v*)
echo "$me, version $scriptversion"
exit $?
;;
esac
if test $# -lt 3; then
func_error "you must specify a program, an action and an archive"
fi
AR=$1
shift
while :
do
if test $# -lt 2; then
func_error "you must specify a program, an action and an archive"
fi
case $1 in
-lib | -LIB \
| -ltcg | -LTCG \
| -machine* | -MACHINE* \
| -subsystem* | -SUBSYSTEM* \
| -verbose | -VERBOSE \
| -wx* | -WX* )
AR="$AR $1"
shift
;;
*)
action=$1
shift
break
;;
esac
done
orig_archive=$1
shift
func_file_conv "$orig_archive"
archive=$file
# strip leading dash in $action
action=${action#-}
delete=
extract=
list=
quick=
replace=
index=
create=
while test -n "$action"
do
case $action in
d*) delete=yes ;;
x*) extract=yes ;;
t*) list=yes ;;
q*) quick=yes ;;
r*) replace=yes ;;
s*) index=yes ;;
S*) ;; # the index is always updated implicitly
c*) create=yes ;;
u*) ;; # TODO: don't ignore the update modifier
v*) ;; # TODO: don't ignore the verbose modifier
*)
func_error "unknown action specified"
;;
esac
action=${action#?}
done
case $delete$extract$list$quick$replace,$index in
yes,* | ,yes)
;;
yesyes*)
func_error "more than one action specified"
;;
*)
func_error "no action specified"
;;
esac
if test -n "$delete"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
for member
do
case $1 in
@*)
func_at_file "${1#@}" -REMOVE "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
;;
esac
done
elif test -n "$extract"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
if test $# -gt 0; then
for member
do
case $1 in
@*)
func_at_file "${1#@}" -EXTRACT "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
;;
esac
done
else
$AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
do
$AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
done
fi
elif test -n "$quick$replace"; then
if test ! -f "$orig_archive"; then
if test -z "$create"; then
echo "$me: creating $orig_archive"
fi
orig_archive=
else
orig_archive=$archive
fi
for member
do
case $1 in
@*)
func_file_conv "${1#@}"
set x "$@" "@$file"
;;
*)
func_file_conv "$1"
set x "$@" "$file"
;;
esac
shift
shift
done
if test -n "$orig_archive"; then
$AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
else
$AR -NOLOGO -OUT:"$archive" "$@" || exit $?
fi
elif test -n "$list"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
$AR -NOLOGO -LIST "$archive" || exit $?
fi

Просмотреть файл

@ -1,12 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2013 Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2013-05-16'
timestamp='2009-11-20'
# This file 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 3 of the License, or
# 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
@ -15,22 +17,26 @@ timestamp='2013-05-16'
# 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/>.
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# 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 Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner. Please send patches (context
# diff format) to <config-patches@gnu.org> and include a ChangeLog
# entry.
#
# Originally written by Per Bothner.
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
me=`echo "$0" | sed -e 's,.*/,,'`
@ -50,7 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2013 Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -132,33 +139,12 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_SYSTEM}" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval $set_cc_for_build
cat <<-EOF > $dummy.c
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
;;
esac
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@ -194,7 +180,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
os=netbsd
os=netbsd
;;
esac
# The OS release
@ -215,10 +201,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@ -241,7 +223,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@ -287,10 +269,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@ -316,12 +295,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
arm:riscos:*:*|arm:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@ -415,23 +394,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@ -501,8 +480,8 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@ -515,7 +494,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@ -572,7 +551,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
*:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@ -615,52 +594,52 @@ EOF
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@ -751,22 +730,22 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@ -790,14 +769,14 @@ EOF
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@ -809,35 +788,30 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
@ -874,22 +848,15 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@ -899,56 +866,52 @@ EOF
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo frv-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
LIBC=gnu
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@ -967,57 +930,51 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or1k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo or32-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-${LIBC}
echo sparc-unknown-linux-gnu
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-${LIBC}
echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-${LIBC}
echo powerpc64-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-${LIBC}
echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@ -1026,11 +983,11 @@ EOF
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@ -1062,7 +1019,7 @@ EOF
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@ -1090,13 +1047,13 @@ EOF
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@ -1131,8 +1088,8 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
@ -1175,10 +1132,10 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
@ -1204,11 +1161,11 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@ -1221,9 +1178,6 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@ -1250,21 +1204,19 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval $set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
fi
case $UNAME_PROCESSOR in
i386)
eval $set_cc_for_build
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
UNAME_PROCESSOR="x86_64"
fi
fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@ -1278,10 +1230,7 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@ -1326,13 +1275,13 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@ -1350,11 +1299,11 @@ EOF
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
@ -1372,11 +1321,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
"4"
#else
""
""
#endif
); exit (0);
); exit (0);
#endif
#endif

Просмотреть файл

@ -1,31 +1,38 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2013-04-24'
timestamp='2009-11-20'
# This file 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 3 of the License, or
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file 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.
# 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/>.
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# 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 Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# the same distribution terms that you use for the rest of that program.
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@ -68,7 +75,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2013 Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -115,18 +123,13 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@ -149,12 +152,12 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
-apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
@ -170,10 +173,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
;;
-hiux*)
os=-hiuxwe2
;;
@ -218,12 +221,6 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
@ -248,27 +245,20 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -286,45 +276,34 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| nios | nios2 \
| ns16k | ns32k \
| open8 \
| or1k | or32 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| rl78 | rx \
| rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| v850 | v850e \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
@ -334,21 +313,6 @@ case $basic_machine in
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@ -363,30 +327,25 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@ -404,34 +363,29 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
@ -456,7 +410,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
abacus)
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@ -526,20 +480,11 @@ case $basic_machine in
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
@ -571,7 +516,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
cr16)
basic_machine=cr16-unknown
os=-elf
;;
@ -729,6 +674,7 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@ -786,13 +732,9 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
microblaze*)
microblaze)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@ -829,18 +771,10 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i386-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@ -905,12 +839,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@ -993,10 +921,9 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
ppc) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@ -1021,11 +948,7 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
rdos)
basic_machine=i386-pc
os=-rdos
;;
@ -1094,9 +1017,6 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
@ -1153,8 +1073,20 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tile*)
basic_machine=$basic_machine-unknown
basic_machine=tile-unknown
os=-linux-gnu
;;
tx39)
@ -1224,9 +1156,6 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
@ -1324,11 +1253,11 @@ esac
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
@ -1352,21 +1281,20 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \
| -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@ -1413,7 +1341,7 @@ case $os in
-opened*)
os=-openedition
;;
-os400*)
-os400*)
os=-os400
;;
-wince*)
@ -1462,7 +1390,7 @@ case $os in
-sinix*)
os=-sysv4
;;
-tpf*)
-tpf*)
os=-tpf
;;
-triton*)
@ -1498,14 +1426,15 @@ case $os in
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)
@ -1528,10 +1457,10 @@ else
# system, and we'll never get to this point.
case $basic_machine in
score-*)
score-*)
os=-elf
;;
spu-*)
spu-*)
os=-elf
;;
*-acorn)
@ -1543,20 +1472,8 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@ -1576,11 +1493,14 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mep-*)
mep-*)
os=-elf
;;
mips*-cisco)
@ -1589,9 +1509,6 @@ case $basic_machine in
mips*-*)
os=-elf
;;
or1k-*)
os=-elf
;;
or32-*)
os=-coff
;;
@ -1610,7 +1527,7 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-knuth)
*-knuth)
os=-mmixware
;;
*-wec)

Просмотреть файл

@ -1,9 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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
@ -27,9 +28,9 @@ scriptversion=2013-05-30.07; # UTC
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@ -39,11 +40,11 @@ as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
@ -56,66 +57,6 @@ EOF
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
@ -128,9 +69,6 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
@ -142,32 +80,18 @@ if test "$depmode" = hp; then
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u="sed s,\\\\\\\\,/,g"
depmode=msvisualcpp
fi
case "$depmode" in
@ -190,7 +114,8 @@ gcc3)
done
"$@"
stat=$?
if test $stat -ne 0; then
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
@ -198,17 +123,13 @@ gcc3)
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
@ -216,31 +137,31 @@ gcc)
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@ -258,7 +179,8 @@ sgi)
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
@ -266,41 +188,43 @@ sgi)
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
@ -313,7 +237,9 @@ aix)
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
@ -322,100 +248,44 @@ aix)
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
@ -427,8 +297,8 @@ pgcc)
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@ -439,8 +309,9 @@ hp2)
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
@ -451,7 +322,8 @@ hp2)
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
@ -461,107 +333,77 @@ hp2)
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
@ -580,7 +422,7 @@ dashmstdout)
shift
fi
# Remove '-o $object'.
# Remove `-o $object'.
IFS=" "
for arg
do
@ -600,18 +442,18 @@ dashmstdout)
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@ -661,15 +503,12 @@ makedepend)
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
@ -686,7 +525,7 @@ cpp)
shift
fi
# Remove '-o $object'.
# Remove `-o $object'.
IFS=" "
for arg
do
@ -705,10 +544,10 @@ cpp)
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
@ -740,23 +579,23 @@ msvisualcpp)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;

Просмотреть файл

@ -58,11 +58,17 @@ subst("README");
chdir("man");
opendir(my $dh, ".") || die "Can't open man directory: $!";
my @files = grep { /\.\d$/ && -f "./$_" } readdir($dh);
my @subdirs = grep { /man\d+/ && -d "./$_" } readdir($dh);
closedir $dh;
foreach my $file (@files) {
subst($file);
foreach my $dir (@subdirs) {
opendir(my $dh, $dir) || die "Can't open man/$dir directory: $!";
my @files = grep { /\.\d$/ && -f "$dir/$_" } readdir($dh);
closedir $dh;
foreach my $file (@files) {
subst("$dir/$file");
}
}
exit(0);

Просмотреть файл

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -35,7 +35,7 @@ scriptversion=2011-11-20.07; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
@ -156,10 +156,6 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
@ -190,10 +186,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
@ -202,17 +194,13 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
@ -240,9 +228,9 @@ fi
for src
do
# Protect names problematic for 'test' and other utilities.
# Protect names starting with `-'.
case $src in
-* | [=\(\)!]) src=./$src;;
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
@ -264,7 +252,12 @@ do
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
@ -354,7 +347,7 @@ do
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
@ -392,7 +385,7 @@ do
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
-*) prefix='./';;
*) prefix='';;
esac
@ -410,7 +403,7 @@ do
for d
do
test X"$d" = X && continue
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then

Разница между файлами не показана из-за своего большого размера Загрузить разницу

4039
opal/mca/common/libfabric/libfabric/config/ltmain.sh Обычный файл → Исполняемый файл

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,14 +1,13 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# 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 7 ltoptions.m4
# serial 6 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@ -126,7 +125,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
@ -134,13 +133,13 @@ case $host in
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
_LT_DECL([], [AS], [0], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
@ -326,24 +325,9 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# 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@:>@],
[AS_HELP_STRING([--with-pic],
[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="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])

Просмотреть файл

@ -7,17 +7,17 @@
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# Generated from ltversion.in.
# serial 3337 ltversion.m4
# serial 3017 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
m4_define([LT_PACKAGE_VERSION], [2.2.6b])
m4_define([LT_PACKAGE_REVISION], [1.3017])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2'
macro_revision='1.3337'
[macro_version='2.2.6b'
macro_revision='1.3017'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

Просмотреть файл

@ -1,13 +1,13 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Copyright (C) 2004, 2005, 2007 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
# serial 4 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
@ -77,6 +77,7 @@ 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_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
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])])
@ -89,10 +90,3 @@ 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,10 +1,11 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
# Common stub for a few missing GNU programs while installing.
scriptversion=2012-06-26.16; # UTC
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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
@ -25,40 +26,69 @@ scriptversion=2012-06-26.16; # UTC
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
@ -70,141 +100,272 @@ Send bug reports to <bug-automake@gnu.org>."
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'automa4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar*)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)

Просмотреть файл

@ -91,6 +91,13 @@ dnl Checks for libraries
AC_CHECK_LIB(pthread, pthread_mutex_init, [],
AC_MSG_ERROR([pthread_mutex_init() not found. libfabric requires libpthread.]))
AC_CHECK_FUNC([pthread_spin_init],
[have_spinlock=1],
[have_spinlock=0])
AC_DEFINE_UNQUOTED([PT_LOCK_SPIN], [$have_spinlock],
[Define PT_LOCK_SPIN to 1 if available.])
have_clock_gettime=0
have_host_get_clock_service=0

Просмотреть файл

@ -43,6 +43,7 @@
#include <rdma/fabric.h>
#include <rdma/fi_prov.h>
#include <rdma/fi_atomic.h>
#include <rdma/fi_log.h>
#ifdef __APPLE__
#include <osx/osd.h>
@ -90,6 +91,26 @@ static inline uint64_t ntohll(uint64_t x) { return x; }
#define MIN(a, b) ((a) < (b) ? a : b)
#define MAX(a, b) ((a) > (b) ? a : b)
/* Restrict to size of struct fi_context */
struct fi_prov_context {
int disable_logging;
};
struct fi_filter {
char **names;
int negated;
};
extern struct fi_filter prov_log_filter;
void fi_create_filter(struct fi_filter *filter, const char *env_name);
void fi_free_filter(struct fi_filter *filter);
int fi_apply_filter(struct fi_filter *filter, const char *name);
void fi_log_init(void);
void fi_log_fini(void);
/* flsll is defined on BSD systems, but is different. */
static inline int fi_flsll(long long int i)
{
@ -104,7 +125,7 @@ static inline uint64_t roundup_power_of_two(uint64_t n)
#define FI_TAG_GENERIC 0xAAAAAAAAAAAAAAAAULL
#if defined(PT_LOCK_SPIN)
#if PT_LOCK_SPIN == 1
#define fastlock_t pthread_spinlock_t
#define fastlock_init(lock) pthread_spin_init(lock, PTHREAD_PROCESS_PRIVATE)
@ -206,7 +227,7 @@ int fi_recv_allowed(uint64_t caps);
int fi_rma_initiate_allowed(uint64_t caps);
int fi_rma_target_allowed(uint64_t caps);
uint64_t fi_gettime_ms();
uint64_t fi_gettime_ms(void);
#define RDMA_CONF_DIR SYSCONFDIR "/" RDMADIR
#define FI_CONF_DIR RDMA_CONF_DIR "/fabric"

Просмотреть файл

@ -313,22 +313,19 @@ static struct fi_ops_cq X = {
.read = X,
.readfrom = fi_no_cq_readfrom,
.readerr = X,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = fi_no_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal,
.strerror = X,
};
*/
ssize_t fi_no_cq_readfrom(struct fid_cq *cq, void *buf, size_t count,
fi_addr_t *src_addr);
ssize_t fi_no_cq_write(struct fid_cq *cq, const void *buf, size_t len);
ssize_t fi_no_cq_writeerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
size_t len, uint64_t flags);
ssize_t fi_no_cq_sread(struct fid_cq *cq, void *buf, size_t count,
const void *cond, int timeout);
ssize_t fi_no_cq_sreadfrom(struct fid_cq *cq, void *buf, size_t count,
fi_addr_t *src_addr, const void *cond, int timeout);
int fi_no_cq_signal(struct fid_cq *cq);
/*
static struct fi_ops_cntr X = {

Просмотреть файл

@ -127,15 +127,17 @@ typedef struct fid *fid_t;
#define FI_REMOTE_WRITE (1ULL << 21)
#define FI_REMOTE_CQ_DATA (1ULL << 24)
#define FI_EVENT (1ULL << 25)
#define FI_CANCEL (1ULL << 25)
#define FI_MORE (1ULL << 26)
#define FI_PEEK (1ULL << 27)
#define FI_TRIGGER (1ULL << 28)
#define FI_FENCE (1ULL << 29)
#define FI_EVENT (1ULL << 32)
#define FI_COMPLETION FI_EVENT
#define FI_REMOTE_SIGNAL (1ULL << 26)
#define FI_REMOTE_COMPLETE (1ULL << 27)
#define FI_CANCEL (1ULL << 28)
#define FI_MORE (1ULL << 29)
#define FI_PEEK (1ULL << 30)
#define FI_TRIGGER (1ULL << 31)
#define FI_FENCE (1ULL << 32)
#define FI_INJECT_COMPLETE (1ULL << 33)
#define FI_TRANSMIT_COMPLETE (1ULL << 34)
#define FI_COMMIT_COMPLETE (1ULL << 35)
struct fi_ioc {
@ -198,8 +200,8 @@ enum fi_resource_mgmt {
#define FI_ORDER_SAR (1 << 6)
#define FI_ORDER_SAW (1 << 7)
#define FI_ORDER_SAS (1 << 8)
#define FI_ORDER_RECV (1 << 9)
#define FI_ORDER_STRICT 0xFFFFFFFF
#define FI_ORDER_STRICT 0x1FF
#define FI_ORDER_DATA (1 << 16)
enum fi_ep_type {
FI_EP_UNSPEC,
@ -230,6 +232,7 @@ enum {
#define FI_PROV_MR_ATTR (1ULL << 2)
#define FI_MSG_PREFIX (1ULL << 3)
#define FI_ASYNC_IOV (1ULL << 4)
#define FI_RX_CQ_DATA (1ULL << 5)
struct fi_tx_attr {
uint64_t caps;
@ -264,8 +267,6 @@ struct fi_ep_attr {
size_t max_order_war_size;
size_t max_order_waw_size;
uint64_t mem_tag_format;
uint64_t msg_order;
uint64_t comp_order;
size_t tx_ctx_cnt;
size_t rx_ctx_cnt;
};

Просмотреть файл

@ -245,13 +245,11 @@ struct fi_ops_cq {
fi_addr_t *src_addr);
ssize_t (*readerr)(struct fid_cq *cq, struct fi_cq_err_entry *buf,
uint64_t flags);
ssize_t (*write)(struct fid_cq *cq, const void *buf, size_t len);
ssize_t (*writeerr)(struct fid_cq *cq, struct fi_cq_err_entry *buf,
size_t len, uint64_t flags);
ssize_t (*sread)(struct fid_cq *cq, void *buf, size_t count,
const void *cond, int timeout);
ssize_t (*sreadfrom)(struct fid_cq *cq, void *buf, size_t count,
fi_addr_t *src_addr, const void *cond, int timeout);
int (*signal)(struct fid_cq *cq);
const char * (*strerror)(struct fid_cq *cq, int prov_errno,
const void *err_data, char *buf, size_t len);
};
@ -378,17 +376,6 @@ fi_cq_readerr(struct fid_cq *cq, struct fi_cq_err_entry *buf, uint64_t flags)
return cq->ops->readerr(cq, buf, flags);
}
static inline ssize_t fi_cq_write(struct fid_cq *cq, const void *buf, size_t len)
{
return cq->ops->write(cq, buf, len);
}
static inline ssize_t fi_cq_writeerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
size_t len, uint64_t flags)
{
return cq->ops->writeerr(cq, buf, len, flags);
}
static inline ssize_t
fi_cq_sread(struct fid_cq *cq, void *buf, size_t count, const void *cond, int timeout)
{
@ -402,6 +389,11 @@ fi_cq_sreadfrom(struct fid_cq *cq, void *buf, size_t count,
return cq->ops->sreadfrom(cq, buf, count, src_addr, cond, timeout);
}
static inline int fi_cq_signal(struct fid_cq *cq)
{
return cq->ops->signal(cq);
}
static inline const char *
fi_cq_strerror(struct fid_cq *cq, int prov_errno, const void *err_data,
char *buf, size_t len)

Просмотреть файл

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015, Intel Corp., 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
@ -31,36 +32,68 @@
*
*/
#if !defined(FI_LOG_H)
#define FI_LOG_H
#ifndef _FI_LOG_H_
#define _FI_LOG_H_
#if HAVE_CONFIG_H
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <rdma/fabric.h>
#include <rdma/fi_prov.h>
extern int fi_log_level;
void fi_log_init(void);
void fi_warn_impl(const char *prov, const char *fmt, ...);
void fi_log_impl(int level, const char *prov, const char *func, int line,
const char *fmt, ...);
void fi_debug_impl(const char *prov, const char *func, int line, const char *fmt, ...);
/* Callers are responsible for including their own trailing "\n". Non-provider
* code should pass prov=NULL.
*/
#define FI_WARN(prov, ...) fi_warn_impl(prov, __VA_ARGS__)
#define FI_LOG(level, prov, ...) \
do { \
if ((level) <= fi_log_level) \
fi_log_impl(level, prov, __func__, __LINE__, __VA_ARGS__); \
} while (0)
#if ENABLE_DEBUG
# define FI_DEBUG(prov, ...) fi_debug_impl(prov, __func__, __LINE__, __VA_ARGS__)
#else
# define FI_DEBUG(prov, ...) do {} while (0)
#ifdef __cplusplus
extern "C" {
#endif
#endif /* !defined(FI_LOG_H) */
enum fi_log_subsys {
FI_LOG_CORE,
FI_LOG_FABRIC,
FI_LOG_DOMAIN,
FI_LOG_EP_CTRL,
FI_LOG_EP_DATA,
FI_LOG_AV,
FI_LOG_CQ,
FI_LOG_EQ,
FI_LOG_MR,
FI_LOG_SUBSYS_MAX
};
enum fi_log_level {
FI_LOG_WARN,
FI_LOG_TRACE,
FI_LOG_INFO,
FI_LOG_DEBUG,
FI_LOG_MAX
};
int fi_log_enabled(const struct fi_provider *prov, enum fi_log_level level,
enum fi_log_subsys subsys);
void fi_log(const struct fi_provider *prov, enum fi_log_level level,
enum fi_log_subsys subsys, const char *func, int line,
const char *fmt, ...);
#define FI_LOG(prov, level, subsystem, ...) \
do { \
if (fi_log_enabled(prov, level, subsystem)) \
fi_log(prov, level, subsystem, \
__func__, __LINE__, __VA_ARGS__); \
} while (0)
#define FI_WARN(prov, subsystem, ...) \
FI_LOG(prov, FI_LOG_WARN, subsystem, __VA_ARGS__)
#define FI_TRACE(prov, subsystem, ...) \
FI_LOG(prov, FI_LOG_TRACE, subsystem, __VA_ARGS__)
#define FI_INFO(prov, subsystem, ...) \
FI_LOG(prov, FI_LOG_INFO, subsystem, __VA_ARGS__)
#if ENABLE_DEBUG
#define FI_DBG(prov, subsystem, ...) \
FI_LOG(prov, FI_LOG_DEBUG, subsystem, __VA_ARGS__)
#else
#define FI_DBG(prov_name, subsystem, ...)
#endif
#ifdef __cplusplus
}
#endif
#endif /*_FI_LOG_H_ */

Просмотреть файл

@ -62,6 +62,7 @@ extern "C" {
struct fi_provider {
uint32_t version;
uint32_t fi_version;
struct fi_context context;
const char *name;
int (*getinfo)(uint32_t version, const char *node, const char *service,
uint64_t flags, struct fi_info *hints, struct fi_info **info);

Просмотреть файл

@ -7,5 +7,7 @@ FABRIC_1.0 {
fi_version;
fi_strerror;
fi_tostr;
fi_log_enabled;
fi_log;
local: *;
};

Просмотреть файл

@ -8,7 +8,7 @@ Url: http://www.github.com/ofiwg/libfabric
Source: http://www.openfabrics.org/downloads/fabrics/%{name}-%{version}.tar.bz2
Prefix: ${_prefix}
BuildRequires: libnl3-devel
BuildRequires: libnl-devel
BuildRequires: librdmacm-devel
BuildRequires: libibverbs-devel
BuildRequires: infinipath-psm-devel
@ -61,5 +61,5 @@ rm -rf %{buildroot}
%{_mandir}/man7/*
%changelog
* Mon Feb 16 2015 Open Fabrics Interfaces Working Group <ofiwg@lists.openfabrics.org> 1.0.0
- Release 1.0.0rc2
* Tue Mar 31 2015 Open Fabrics Interfaces Working Group <ofiwg@lists.openfabrics.org> 1.0.0
- Release 1.0.0rc3

Просмотреть файл

@ -8,7 +8,7 @@ Url: http://www.github.com/ofiwg/libfabric
Source: http://www.openfabrics.org/downloads/fabrics/%{name}-%{version}.tar.bz2
Prefix: ${_prefix}
BuildRequires: libnl3-devel
BuildRequires: libnl-devel
BuildRequires: librdmacm-devel
BuildRequires: libibverbs-devel
BuildRequires: infinipath-psm-devel
@ -61,5 +61,5 @@ rm -rf %{buildroot}
%{_mandir}/man7/*
%changelog
* Mon Feb 16 2015 Open Fabrics Interfaces Working Group <ofiwg@lists.openfabrics.org> 1.0.0
- Release 1.0.0rc2
* Tue Mar 31 2015 Open Fabrics Interfaces Working Group <ofiwg@lists.openfabrics.org> 1.0.0
- Release 1.0.0rc3

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_av 3 "2015\-03\-11" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_av 3 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_av - Address vector operations
@ -170,19 +170,19 @@ The name field allows the underlying provider to identify a shared AV.
If the name field is non-NULL and the AV is not opened for read-only
access, a named AV will be created, if it does not already exist.
.PP
\f[I]map_addr\f[] : The map_addr determines the base FI_ADDR address
\f[I]map_addr\f[] : The map_addr determines the base fi_addr_t address
that a provider should use when sharing an AV of type FI_AV_MAP between
processes.
Processes that provide the same value for map_addr to a shared AV may
use the same FI_ADDR values returned from an fi_av_insert call.
use the same fi_addr_t values returned from an fi_av_insert call.
.PP
The map_addr may be used by the provider to mmap memory allocated for a
shared AV between processes; however, the provider is not required to
use the map_addr in this fashion.
The only requirement is that an FI_ADDR returned as part of an
The only requirement is that an fi_addr_t returned as part of an
fi_av_insert call on one process is usable on another process which
opens an AV of the same name at the same map_addr value.
The relationship between the map_addr and any returned FI_ADDR is not
The relationship between the map_addr and any returned fi_addr_t is not
defined.
.PP
If name is non-NULL and map_addr is 0, then the map_addr used by the

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_cm 3 "2015\-02\-26" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_cm 3 "2015\-02\-26" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_cm - Connection management operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_cntr 3 "2015\-01\-29" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_cntr 3 "2015\-01\-29" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_cntr - Completion and event counter operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_control 3 "2015\-02\-16" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_control 3 "2015\-02\-16" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_control - Perform an operation on a fabric resource.

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_cq 3 "2015\-03\-24" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_cq 3 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_cq - Completion queue operations
@ -10,9 +10,6 @@ fi_control : Control CQ operation or attributes.
fi_cq_read / fi_cq_readfrom / fi_cq_readerr : Read a completion from a
completion queue
.PP
fi_cq_write / fi_cq_writeerr : Writes a completion or error event to a
completion queue
.PP
fi_cq_sread / fi_cq_sreadfrom : A synchronous (blocking) read that waits
until a specified condition has been met before reading a completion
from a completion queue.
@ -32,25 +29,22 @@ int\ fi_close(struct\ fid\ *cq);
int\ fi_control(struct\ fid\ *cq,\ int\ command,\ void\ *arg);
int\ fi_cq_read(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count);
ssize_t\ fi_cq_read(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count);
int\ fi_cq_readfrom(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count,
ssize_t\ fi_cq_readfrom(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count,
\ \ \ \ fi_addr_t\ *src_addr);
int\ fi_cq_readerr(struct\ fid_cq\ *cq,\ struct\ fi_cq_err_entry\ *buf,
ssize_t\ fi_cq_readerr(struct\ fid_cq\ *cq,\ struct\ fi_cq_err_entry\ *buf,
\ \ \ \ uint64_t\ flags);
int\ fi_cq_write(struct\ fid_cq\ *cq,\ const\ void\ *buf,\ size_t\ len);
int\ fi_cq_writeerr(struct\ fid_cq\ *cq,\ struct\ fi_cq_err_entry\ *buf,
\ \ \ \ size_t\ len,\ uint64_t\ flags);
int\ fi_cq_sread(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count,
ssize_t\ fi_cq_sread(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count,
\ \ \ \ const\ void\ *cond,\ int\ timeout);
int\ fi_cq_sreadfrom(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count,
ssize_t\ fi_cq_sreadfrom(struct\ fid_cq\ *cq,\ void\ *buf,\ size_t\ count,
\ \ \ \ fi_addr_t\ *src_addr,\ const\ void\ *cond,\ int\ timeout);
int\ fi_cq_signal(struct\ fid_cq\ *cq);
const\ char\ *\ fi_cq_strerror(struct\ fid_cq\ *cq,\ int\ prov_errno,
\ \ \ \ \ \ const\ void\ *err_data,\ char\ *buf,\ size_t\ len);
\f[]
@ -129,25 +123,7 @@ struct\ fi_cq_attr\ {
A value of 0 indicates that the provider may choose a default value.
.PP
\f[I]flags\f[] : Flags that control the configuration of the CQ.
.IP \[bu] 2
\f[I]FI_WRITE\f[] : Indicates that the application requires support for
inserting user events into the CQ.
If this flag is set, then the fi_cq_write and fi_cq_writeerr operations
must be supported by the provider.
If the FI_WRITE flag is not set, then the application may not invoke
fi_cq_write of fi_cq_writeerr.
.IP \[bu] 2
\f[I]FI_REMOTE_SIGNAL\f[] : If specified, this indicates that the CQ
should only signal its wait object upon receiving a remote operation
with FI_REMOTE_SIGNAL set, provided that all other wait conditions have
been met.
The use of FI_REMOTE_SIGNAL may improve system utilization by deferring
processing of an CQ until a remote endpoint has completed all necessary
operations.
FI_REMOTE_SIGNAL should be treated as an optimization.
Providers are not required to wait until a remote operation with
FI_REMOTE_SIGNAL is received before signaling a wait object associated
with an CQ.
This field must be 0.
.PP
\f[I]format\f[] : Completion queues allow the application to select the
amount of detail that it must store and report.
@ -390,21 +366,14 @@ The contents of the buffer will remain valid until a subsequent read
call against the CQ.
Users may call fi_cq_strerror to convert provider specific error
information into a printable string for debugging purposes.
.SS fi_cq_write / fi_cq_writeerr
.SS fi_cq_signal
.PP
The fi_cq_write and fi_cq_writeerr operations insert user-generated
completion entries into a completion queue.
fi_cq_write inserts non-error events into the CQ.
The format of the fi_cq_write event must be the same as the fi_cq_format
attribute defined for the CQ when it was created.
fi_cq_writeerr inserts error events into the CQ.
The error event format is struct fi_cq_err_entry.
The number of entries to insert into the CQ is determined by the len
parameter.
Len must be a multiple of the size of the event to insert.
.PP
User events inserted into a CQ with be associated with the source
address FI_ADDR_NOTAVAIL.
The fi_cq_signal call will signal the wait object used by the
fi_cq_sread and fi_cq_sreadfrom function.
This may be used to wake-up a thread that is blocked waiting to read a
completion operation.
The fi_cq_signal operation is only available if the CQ was configured
with a wait object.
.SH COMPLETION FLAGS
.PP
Completion flags provide additional details regarding the completed
@ -456,7 +425,7 @@ This completion flag indicates that the receive buffer referenced by the
completion has been consumed and was released by the provider.
.SH RETURN VALUES
.PP
fi_cq_open : Returns 0 on success.
fi_cq_open / fi_cq_signal : Returns 0 on success.
On error, a negative value corresponding to fabric errno is returned.
.PP
fi_cq_read / fi_cq_readfrom / fi_cq_readerr fi_cq_sread /
@ -466,10 +435,6 @@ On error, a negative value corresponding to fabric errno is returned.
If no completions are available to return from the CQ, -FI_EAGAIN will
be returned.
.PP
fi_cq_write / fi_cq_writeerr : On success, returns the number of bytes
read from or written to the completion queue.
On error, a negative value corresponding to fabric errno is returned.
.PP
fi_cq_strerror : Returns a character string interpretation of the
provider specific error returned with a completion.
.PP

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_domain 3 "2015\-03\-24" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_domain 3 "2015\-03\-24" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_domain - Open a fabric access domain

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_endpoint 3 "2015\-03\-23" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_endpoint 3 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_endpoint - Fabric endpoint operations
@ -454,6 +454,8 @@ indicated by fi_tx_size_left.
.PP
The fi_ep_attr structure defines the set of attributes associated with
an endpoint.
Endpoint attributes may be further refined using the transmit and
receive context attributes as shown below.
.IP
.nf
\f[C]
@ -467,8 +469,6 @@ struct\ fi_ep_attr\ {
\ \ \ \ size_t\ \ \ \ \ \ \ \ \ \ max_order_war_size;
\ \ \ \ size_t\ \ \ \ \ \ \ \ \ \ max_order_waw_size;
\ \ \ \ uint64_t\ \ \ \ \ \ \ \ mem_tag_format;
\ \ \ \ uint64_t\ \ \ \ \ \ \ \ msg_order;
\ \ \ \ uint64_t\ \ \ \ \ \ \ \ comp_order;
\ \ \ \ size_t\ \ \ \ \ \ \ \ \ \ tx_ctx_cnt;
\ \ \ \ size_t\ \ \ \ \ \ \ \ \ \ rx_ctx_cnt;
};
@ -641,118 +641,6 @@ A provider may increase the size of the fields.
It is recommended that field sizes be ordered from smallest to largest.
A generic, unstructured tag and mask can be achieved by requesting a bit
array consisting of alternating 1\[aq]s and 0\[aq]s.
.SS msg_order - Message Ordering
.PP
Message ordering refers to the order in which transport layer headers
(as viewed by the application) are processed.
Relaxed message order enables data transfers to be sent and received out
of order, which may improve performance by utilizing multiple paths
through the fabric from the initiating endpoint to a target endpoint.
Message order applies only between a single source and destination
endpoint pair.
Ordering between different target endpoints is not defined.
.PP
Message order is determined using a set of ordering bits.
Each set bit indicates that ordering is maintained between data
transfers of the specified type.
Message order is defined for [read | write | send] operations submitted
by an application after [read | write | send] operations.
.PP
Message ordering only applies to the processing of transport headers.
Message ordering is necessary, but does not guarantee the order in which
data is sent or received by the transport layer.
.PP
\f[I]FI_ORDER_RAR\f[] : Read after read.
If set, RMA and atomic read operations are processed in the order
submitted relative to other RMA and atomic read operations.
If not set, RMA and atomic reads may be processed out of order from
their submission.
.PP
\f[I]FI_ORDER_RAW\f[] : Read after write.
If set, RMA and atomic read operations are processed in the order
submitted relative to RMA and atomic write operations.
If not set, RMA and atomic reads may be processed ahead of RMA and
atomic writes.
.PP
\f[I]FI_ORDER_RAS\f[] : Read after send.
If set, RMA and atomic read operations are processed in the order
submitted relative to message send operations, including tagged sends.
If not set, RMA and atomic reads may be processed ahead of sends.
.PP
\f[I]FI_ORDER_WAR\f[] : Write after read.
If set, RMA and atomic write operations are processed in the order
submitted relative to RMA and atomic read operations.
If not set, RMA and atomic writes may be processed ahead of RMA and
atomic reads.
.PP
\f[I]FI_ORDER_WAW\f[] : Write after write.
If set, RMA and atomic write operations are processed in the order
submitted relative to other RMA and atomic write operations.
If not set, RMA and atomic writes may be processed out of order from
their submission.
.PP
\f[I]FI_ORDER_WAS\f[] : Write after send.
If set, RMA and atomic write operations are processed in the order
submitted relative to message send operations, including tagged sends.
If not set, RMA and atomic writes may be processed ahead of sends.
.PP
\f[I]FI_ORDER_SAR\f[] : Send after read.
If set, message send operations, including tagged sends, are processed
in order submitted relative to RMA and atomic read operations.
If not set, message sends may be processed ahead of RMA and atomic
reads.
.PP
\f[I]FI_ORDER_SAW\f[] : Send after write.
If set, message send operations, including tagged sends, are processed
in order submitted relative to RMA and atomic write operations.
If not set, message sends may be processed ahead of RMA and atomic
writes.
.PP
\f[I]FI_ORDER_SAS\f[] : Send after send.
If set, message send operations, including tagged sends, are processed
in the order submitted relative to other message send.
If not set, message sends may be processed out of order from their
submission.
.SS comp_order - Completion Ordering
.PP
Completion ordering refers to the order in which completed requests are
written into the completion queue.
Completion ordering is similar to message order.
Relaxed completion order may enable faster reporting of completed
transfers, allow acknowledgments to be sent over different fabric paths,
and support more sophisticated retry mechanisms.
This can result in lower-latency completions, particularly when using
unconnected endpoints.
Strict completion ordering may require that providers queue completed
operations or limit available optimizations
.PP
For transmit requests, completion ordering depends on the endpoint
communication type.
For unreliable communication, completion ordering applies to all data
transfer requests submitted to an endpoint.
For reliable communication, completion ordering only applies to requests
that target a single destination endpoint.
Completion ordering of requests that target different endpoints over a
reliable transport is not defined.
.PP
Applications should specify the completion ordering that they support or
require.
Providers should return the completion order that they actually provide,
with the constraint that the returned ordering is stricter than that
specified by the application.
Supported completion order values are:
.PP
\f[I]FI_ORDER_NONE\f[] : No ordering is defined for completed
operations.
Requests submitted to the transmit and receive queues may complete in
any order.
.PP
\f[I]FI_ORDER_STRICT\f[] : Requests complete in the order in which they
are submitted, in the case of transmit requests, or processed, in the
case of receive operations, by the provider.
Transmit operations complete in the order in which the requests were
submitted.
Receive operations complete in order, subject to buffer matching.
.SS tx_ctx_cnt - Transmit Context Count
.PP
Number of transmit contexts to associate with the endpoint.
@ -793,6 +681,267 @@ request.
.PP
See the scalable endpoint and shared contexts sections for additional
details.
.SH TRANSMIT CONTEXT ATTRIBUTES
.PP
Attribute specific to the transmit capabilities of an endpoint are
specified using struct fi_tx_attr.
.IP
.nf
\f[C]
struct\ fi_tx_attr\ {
\ \ \ \ uint64_t\ \ caps;
\ \ \ \ uint64_t\ \ mode;
\ \ \ \ uint64_t\ \ op_flags;
\ \ \ \ uint64_t\ \ msg_order;
\ \ \ \ uint64_t\ \ comp_order;
\ \ \ \ size_t\ \ \ \ inject_size;
\ \ \ \ size_t\ \ \ \ size;
\ \ \ \ size_t\ \ \ \ iov_limit;
\ \ \ \ size_t\ \ \ \ rma_iov_limit;
};
\f[]
.fi
.SS caps - Capabilities
.PP
The requested capabilities of the context.
The capabilities must be a subset of those requested of the associated
endpoint.
See the CAPABILITIES section if fi_getinfo(3) for capability details.
.SS mode
.PP
The operational mode bits of the context.
The mode bits will be a subset of those associated with the endpoint.
See the MODE section of fi_getinfo(3) for details.
.SS op_flags - Default transmit operation flags
.PP
Flags that control the operation of operations submitted against the
context.
Applicable flags are listed in the Operation Flags section.
.SS msg_order - Message Ordering
.PP
Message ordering refers to the order in which transport layer headers
(as viewed by the application) are processed.
Relaxed message order enables data transfers to be sent and received out
of order, which may improve performance by utilizing multiple paths
through the fabric from the initiating endpoint to a target endpoint.
Message order applies only between a single source and destination
endpoint pair.
Ordering between different target endpoints is not defined.
.PP
Message order is determined using a set of ordering bits.
Each set bit indicates that ordering is maintained between data
transfers of the specified type.
Message order is defined for [read | write | send] operations submitted
by an application after [read | write | send] operations.
.PP
Message ordering only applies to the end to end transmission of
transport headers.
Message ordering is necessary, but does not guarantee, the order in
which message data is sent or received by the transport layer.
Message ordering requires matching ordering semantics on the receiving
side of a data transfer operation in order to guarantee that ordering is
met.
.PP
\f[I]FI_ORDER_NONE\f[] : No ordering is specified.
This value may be used as input in order to obtain the default message
order supported by the provider.
.PP
\f[I]FI_ORDER_RAR\f[] : Read after read.
If set, RMA and atomic read operations are transmitted in the order
submitted relative to other RMA and atomic read operations.
If not set, RMA and atomic reads may be transmitted out of order from
their submission.
.PP
\f[I]FI_ORDER_RAW\f[] : Read after write.
If set, RMA and atomic read operations are transmitted in the order
submitted relative to RMA and atomic write operations.
If not set, RMA and atomic reads may be transmitted ahead of RMA and
atomic writes.
.PP
\f[I]FI_ORDER_RAS\f[] : Read after send.
If set, RMA and atomic read operations are transmitted in the order
submitted relative to message send operations, including tagged sends.
If not set, RMA and atomic reads may be transmitted ahead of sends.
.PP
\f[I]FI_ORDER_WAR\f[] : Write after read.
If set, RMA and atomic write operations are transmitted in the order
submitted relative to RMA and atomic read operations.
If not set, RMA and atomic writes may be transmitted ahead of RMA and
atomic reads.
.PP
\f[I]FI_ORDER_WAW\f[] : Write after write.
If set, RMA and atomic write operations are transmitted in the order
submitted relative to other RMA and atomic write operations.
If not set, RMA and atomic writes may be transmitted out of order from
their submission.
.PP
\f[I]FI_ORDER_WAS\f[] : Write after send.
If set, RMA and atomic write operations are transmitted in the order
submitted relative to message send operations, including tagged sends.
If not set, RMA and atomic writes may be transmitted ahead of sends.
.PP
\f[I]FI_ORDER_SAR\f[] : Send after read.
If set, message send operations, including tagged sends, are transmitted
in order submitted relative to RMA and atomic read operations.
If not set, message sends may be transmitted ahead of RMA and atomic
reads.
.PP
\f[I]FI_ORDER_SAW\f[] : Send after write.
If set, message send operations, including tagged sends, are transmitted
in order submitted relative to RMA and atomic write operations.
If not set, message sends may be transmitted ahead of RMA and atomic
writes.
.PP
\f[I]FI_ORDER_SAS\f[] : Send after send.
If set, message send operations, including tagged sends, are transmitted
in the order submitted relative to other message send.
If not set, message sends may be transmitted out of order from their
submission.
.SS comp_order - Completion Ordering
.PP
Completion ordering refers to the order in which completed requests are
written into the completion queue.
Completion ordering is similar to message order.
Relaxed completion order may enable faster reporting of completed
transfers, allow acknowledgments to be sent over different fabric paths,
and support more sophisticated retry mechanisms.
This can result in lower-latency completions, particularly when using
unconnected endpoints.
Strict completion ordering may require that providers queue completed
operations or limit available optimizations
.PP
For transmit requests, completion ordering depends on the endpoint
communication type.
For unreliable communication, completion ordering applies to all data
transfer requests submitted to an endpoint.
For reliable communication, completion ordering only applies to requests
that target a single destination endpoint.
Completion ordering of requests that target different endpoints over a
reliable transport is not defined.
.PP
Applications should specify the completion ordering that they support or
require.
Providers should return the completion order that they actually provide,
with the constraint that the returned ordering is stricter than that
specified by the application.
Supported completion order values are:
.PP
\f[I]FI_ORDER_NONE\f[] : No ordering is defined for completed
operations.
Requests submitted to the transmit context may complete in any order.
.PP
\f[I]FI_ORDER_STRICT\f[] : Requests complete in the order in which they
are submitted to the transmit context.
.SS inject_size
.PP
The requested inject operation size (see the FI_INJECT flag) that the
context will support.
This is the maximum size data transfer that can be associated with an
inject operation (such as fi_inject) or may be used with the FI_INJECT
data transfer flag.
.SS size
.PP
The size of the context.
The size is specified as the minimum number of transmit operations that
may be posted to the endpoint without the operation returning
-FI_EAGAIN.
.SS iov_limit
.PP
This is the maximum number of IO vectors (scatter-gather elements) that
a single posted operation may reference.
.SS rma_iov_limit
.PP
This is the maximum number of RMA IO vectors (scatter-gather elements)
that an RMA or atomic operation may reference.
The rma_iov_limit corresponds to the rma_iov_count values in RMA and
atomic operations.
See struct fi_msg_rma and struct fi_msg_atomic in fi_rma.3 and
fi_atomic.3, for additional details.
This limit applies to both the number of RMA IO vectors that may be
specified when initiating an operation from the local endpoint, as well
as the maximum number of IO vectors that may be carried in a single
request from a remote endpoint.
.SH RECEIVE CONTEXT ATTRIBUTES
.PP
Attribute specific to the receive capabilities of an endpoint are
specified using struct fi_rx_attr.
.IP
.nf
\f[C]
struct\ fi_rx_attr\ {
\ \ \ \ uint64_t\ \ caps;
\ \ \ \ uint64_t\ \ mode;
\ \ \ \ uint64_t\ \ op_flags;
\ \ \ \ uint64_t\ \ msg_order;
\ \ \ \ uint64_t\ \ comp_order;
\ \ \ \ size_t\ \ \ \ total_buffered_recv;
\ \ \ \ size_t\ \ \ \ size;
\ \ \ \ size_t\ \ \ \ iov_limit;
};
\f[]
.fi
.SS caps - Capabilities
.PP
The requested capabilities of the context.
The capabilities must be a subset of those requested of the associated
endpoint.
See the CAPABILITIES section if fi_getinfo(3) for capability details.
.SS mode
.PP
The operational mode bits of the context.
The mode bits will be a subset of those associated with the endpoint.
See the MODE section of fi_getinfo(3) for details.
.SS op_flags - Default receive operation flags
.PP
Flags that control the operation of operations submitted against the
context.
Applicable flags are listed in the Operation Flags section.
.SS msg_order - Message Ordering
.PP
For a description of message ordering, see the msg_order field in the
\f[I]Transmit Context Attribute\f[] section.
Receive context message ordering defines the order in which received
transport message headers are processed when received by an endpoint.
.PP
The following ordering flags, as defined for transmit ordering, also
apply to the processing of received operations: FI_ORDER_NONE,
FI_ORDER_RAR, FI_ORDER_RAW, FI_ORDER_RAS, FI_ORDER_WAR, FI_ORDER_WAW,
FI_ORDER_WAS, FI_ORDER_SAR, FI_ORDER_SAW, and FI_ORDER_SAS.
.SS comp_order - Completion Ordering
.PP
For a description of completion ordering, see the comp_order field in
the \f[I]Transmit Context Attribute\f[] section.
.PP
\f[I]FI_ORDER_NONE\f[] : No ordering is defined for completed
operations.
Receive operations may complete in any order, regardless of their
submission order.
.PP
\f[I]FI_ORDER_STRICT\f[] : Receive operations complete in the order in
which they are processed by the receive context, based on the receive
side msg_order attribute.
.PP
\f[I]FI_ORDER_DATA\f[] : When set, this bit indicates that received data
is written into memory in order.
Data ordering applies to memory accessed as part of a single operation
and between operations if message ordering is guaranteed.
.SS total_buffered_recv
.PP
Defines the total available space allocated by the provider to buffer
messages that are received for which there is no matching receive
operation.
If set to 0, any messages that arrive before a receive buffer has been
posted are lost.
.SS size
.PP
The size of the context.
The size is specified as the minimum number of receive operations that
may be posted to the endpoint without the operation returning
-FI_EAGAIN.
.SS iov_limit
.PP
This is the maximum number of IO vectors (scatter-gather elements) that
a single posted operating may reference.
.SH SCALABLE ENDPOINTS
.PP
A scalable endpoint is a communication portal that supports multiple
@ -832,69 +981,6 @@ Support for per transmit context attributes is provider specific and not
guaranteed.
Providers will return the actual attributes assigned to the context
through the attr parameter, if provided.
.IP
.nf
\f[C]
struct\ fi_tx_attr\ {
\ \ \ \ uint64_t\ \ caps;
\ \ \ \ uint64_t\ \ mode;
\ \ \ \ uint64_t\ \ op_flags;
\ \ \ \ uint64_t\ \ msg_order;
\ \ \ \ uint64_t\ \ comp_order;
\ \ \ \ size_t\ \ \ \ inject_size;
\ \ \ \ size_t\ \ \ \ size;
\ \ \ \ size_t\ \ \ \ iov_limit;
\ \ \ \ size_t\ \ \ \ rma_iov_limit;
};
\f[]
.fi
.PP
\f[I]caps\f[] : The requested capabilities of the context.
The capabilities must be a subset of those requested of the associated
endpoint.
See the CAPABILITIES section if fi_getinfo(3) for capability details.
.PP
\f[I]mode\f[] : The operational mode bits of the context.
The mode bits will be a subset of those associated with the endpoint.
See the MODE section of fi_getinfo(3) for details.
.PP
\f[I]op_flags\f[] : Flags that control the operation of operations
submitted against the context.
Applicable flags are listed in the Operation Flags section.
.PP
\f[I]msg_order\f[] : The message ordering requirements of the context.
The message ordering must be the same or more relaxed than those
specified of the associated endpoint.
See the fi_endpoint Message Ordering section.
.PP
\f[I]comp_order\f[] : The completion ordering requirements of the
context.
The completion ordering must be the same or more relaxed than those
specified of the associated endpoint.
See the fi_endpoint Completion Ordering section.
.PP
\f[I]inject_size\f[] : The requested inject operation size (see the
FI_INJECT flag) that the context will support.
See the fi_endpoint Inject Size section.
.PP
\f[I]size\f[] : The size of the context, in bytes.
The size is usually used as an output value by applications wishing to
track if sufficient space is available in the local queue to post a new
operation.
.PP
\f[I]iov_limit\f[] : This is the maximum number of IO vectors
(scatter-gather elements) that a single posted operation may reference.
.PP
\f[I]rma_iov_limit\f[] : This is the maximum number of RMA IO vectors
(scatter-gather elements) that an RMA or atomic operation may reference.
The rma_iov_limit corresponds to the rma_iov_count values in RMA and
atomic operations.
See struct fi_msg_rma and struct fi_msg_atomic in fi_rma.3 and
fi_atomic.3, for additional details.
This limit applies to both the number of RMA IO vectors that may be
specified when initiating an operation from the local endpoint, as well
as the maximum number of IO vectors that may be carried in a single
request from a remote endpoint.
.SS fi_rx_context
.PP
Receive contexts are independent receive queues for receiving incoming
@ -930,59 +1016,6 @@ Support for per receive context attributes is provider specific and not
guaranteed.
Providers will return the actual attributes assigned to the context
through the attr parameter, if provided.
.IP
.nf
\f[C]
struct\ fi_rx_attr\ {
\ \ \ \ uint64_t\ \ caps;
\ \ \ \ uint64_t\ \ mode;
\ \ \ \ uint64_t\ \ op_flags;
\ \ \ \ uint64_t\ \ msg_order;
\ \ \ \ uint64_t\ \ comp_order;
\ \ \ \ size_t\ \ \ \ total_buffered_recv;
\ \ \ \ size_t\ \ \ \ size;
\ \ \ \ size_t\ \ \ \ iov_limit;
};
\f[]
.fi
.PP
\f[I]caps\f[] : The requested capabilities of the context.
The capabilities must be a subset of those requested of the associated
endpoint.
See the CAPABILITIES section if fi_getinfo(3) for capability details.
.PP
\f[I]mode\f[] : The operational mode bits of the context.
The mode bits will be a subset of those associated with the endpoint.
See the MODE section of fi_getinfo(3) for details.
.PP
\f[I]op_flags\f[] : Flags that control the operation of operations
submitted against the context.
Applicable flags are listed in the Operation Flags section.
.PP
\f[I]msg_order\f[] : The message ordering requirements of the context.
The message ordering must be the same or more relaxed than those
specified of the associated endpoint.
See the fi_endpoint Message Ordering section.
.PP
\f[I]comp_order\f[] : The completion ordering requirements of the
context.
The completion ordering must be the same or more relaxed than those
specified of the associated endpoint.
See the fi_endpoint Completion Ordering section.
.PP
\f[I]total_buffered_recv\f[] : Defines the total available space
allocated by the provider to buffer messages that are received for which
there is no matching receive operation.
If set to 0, any messages that arrive before a receive buffer has been
posted are lost.
.PP
\f[I]size\f[] : The size of the context, in bytes.
The size is usually used as an output value by applications wishing to
track if sufficient space is available in the local queue to post a new
operation.
.PP
\f[I]iov_limit\f[] : This is the maximum number of IO vectors
(scatter-gather elements) that a single posted operating may reference.
.SH SHARED CONTEXTS
.PP
Shared contexts are transmit and receive contexts explicitly shared
@ -1073,26 +1106,22 @@ received that cannot fit into the remaining free buffer space.
\f[I]FI_COMPLETION\f[] : Indicates that a completion entry should be
generated for data transfer operations.
.PP
\f[I]FI_REMOTE_SIGNAL\f[] : Indicates that a completion entry at the
target process should be generated for the given operation.
The remote endpoint must be configured with FI_REMOTE_SIGNAL, or this
flag will be ignored by the target.
The local endpoint must be configured with the FI_REMOTE_SIGNAL
capability in order to specify this flag.
\f[I]FI_INJECT_COMPLETE\f[] : Indicates that a completion should be
generated when the source buffer(s) may be reused.
FI_INJECT_COMPLETE allows for the provider to complete an operation
after all source data has been cached, and while the operation may still
be in the process of being transmitted.
.PP
\f[I]FI_REMOTE_COMPLETE\f[] : Generally, this flag indicates that an
operation will not complete until it has been accepted into the fabric
and acknowledged by a remote service.
When used with unreliable endpoints, local completions should not be
generated until the associated operation has been successfully delivered
into the fabric.
For example, the corresponding messages have been placed on the wire.
When used with reliable endpoints, this flag indicates that the
operation will not complete until it has been acknowledged by the
target, or a proxy for the target that is responsible for ensuring its
reliable delivery.
For example, this flag often implies that a completion is not generated
until an ack has been received from the target.
\f[I]FI_TRANSMIT_COMPLETE\f[] : Indicates that a completion should not
be generated until an operation has been successfully transmitted and is
no longer being tracked by the provider.
For reliable endpoints, this flag generally indicates that an operation
will not complete until it has been accepted into the fabric and
acknowledged by a remote service.
For unreliable endpoints, this flag indicates that an operation will not
complete until it has been successfully delivered into the fabric.
For example, the corresponding message has been placed on the wire.
FI_TRANSMIT_COMPLETE is the default completion model for all endpoints.
.PP
Note that when set, if the target endpoint experiences an error
receiving the transferred data, that error will often be reported back
@ -1100,7 +1129,9 @@ to the initiator of the request.
This includes errors which may not normally be reported to the
initiator, such as remote buffer overruns.
.PP
\f[I]FI_REMOTE_COMMIT\f[] : This flag is defined for future use.
\f[I]FI_COMMIT_COMPLETE\f[] : Indicates that a completion should not be
generated until an operation has successfully been processed at the
target, with the data placed into the specified destination buffer.
.SH NOTES
.PP
Users should call fi_close to release all resources allocated to the

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_eq 3 "2015\-03\-24" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_eq 3 "2015\-03\-24" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_eq - Event queue operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_errno 3 "2015\-01\-08" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_errno 3 "2015\-01\-08" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_errno - fabric errors

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_fabric 3 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_fabric 3 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_fabric - Fabric domain operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_getinfo 3 "2015\-03\-19" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_getinfo 3 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_getinfo / fi_freeinfo - Obtain / free fabric interface information
@ -42,8 +42,8 @@ reaching specified node or service, subject to any provided hints.
Callers may specify NULL for node, service, and hints in order to
retrieve information about what providers are available and their
optimal usage models.
If no matching fabric information is available, info will be set to
NULL.
If no matching fabric information is available, info will be set to NULL
and the call will return -FI_ENODATA.
.PP
Based on the input hints, node, and service parameters, a list of fabric
domains and endpoints will be returned.
@ -80,11 +80,19 @@ Node, service, or hints may be provided, with any combination being
supported.
If node is provided, fi_getinfo will attempt to resolve the fabric
address to the given node.
The hints parameter, if provided, may be used to control the resulting
output as indicated below.
If node is not given, fi_getinfo will attempt to resolve the fabric
addressing information based on the provided hints.
.PP
The hints parameter, if provided, may be used to limit the resulting
output as indicated below.
As a general rule, specifying a non-zero value for input hints indicates
that a provider must support the requested value or fail the operation
with -FI_ENODATA.
With the exception of mode bits, hints that are set to zero are treated
as a wildcard.
A zeroed hint value results in providers either returning a default
value or a value that works best for their implementation.
.PP
The caller must call fi_freeinfo to release fi_info structures returned
by this call.
.PP
@ -148,6 +156,9 @@ is NULL.
\f[I]src_addr - source address\f[] : If specified, indicates the source
address.
This field will be ignored in hints if FI_SOURCE is specified.
On output a provider shall return an address that corresponds to the
indicated fabric or domain, with the format indicated by the returned
\f[I]addr_format\f[] field.
.PP
\f[I]dest_addr - destination address\f[] : If specified, indicates the
destination address.
@ -231,7 +242,7 @@ Message capabilities imply support for send and/or receive queues.
Endpoints supporting this capability support operations defined by
struct fi_ops_msg.
.PP
The ep_cap may be used to specify or restrict the type of messaging
The caps may be used to specify or restrict the type of messaging
operations that are supported.
In the absence of any relevant flags, FI_MSG implies the ability to send
and receive messages.
@ -323,11 +334,6 @@ This flag requires that FI_RMA and/or FI_ATOMIC be set.
capable of receiving write memory operations from remote endpoints.
This flag requires that FI_RMA and/or FI_ATOMIC be set.
.PP
\f[I]FI_REMOTE_SIGNAL\f[] : Indicates that the endpoint support the
FI_REMOTE_SIGNAL flag on data transfer operations.
Support requires marking outbound data transfers as signaled and
handling incoming transfers appropriately.
.PP
\f[I]FI_CANCEL\f[] : Indicates that the user desires the ability to
cancel outstanding data transfer operations.
If FI_CANCEL is not set, a provider may optimize code paths with the
@ -354,12 +360,12 @@ a provider must enable support for only those primary capabilities which
were selected.
Secondary capabilities may optionally be requested by an application.
If requested, a provider must support the capability or fail the
fi_getinfo request (FI_ENOSYS).
fi_getinfo request (FI_ENODATA).
A provider may optionally report non-selected secondary capabilities if
doing so would not compromise performance or security.
.PP
Primary capabilities: FI_MSG, FI_RMA, FI_TAGGED, FI_ATOMIC,
FI_NAMED_RX_CTX, FI_DIRECTD_RECV, FI_READ, FI_WRITE, FI_RECV, FI_SEND,
FI_NAMED_RX_CTX, FI_DIRECTED_RECV, FI_READ, FI_WRITE, FI_RECV, FI_SEND,
FI_REMOTE_READ, and FI_REMOTE_WRITE.
.PP
Secondary capabilities: FI_DYNAMIC_MR, FI_MULTI_RECV, FI_SOURCE,
@ -463,6 +469,13 @@ The FI_ASYNC_IOV mode indicates that the application must provide the
buffering needed for the IO vectors.
When set, an application must not modify an IO vector until the
associated operation has completed.
.PP
\f[I]FI_RX_CQ_DATA\f[] : This mode bit only applies to data transfers
that set FI_REMOTE_CQ_DATA.
When set, a data transfer that carries remote CQ data will consume a
receive buffer at the target.
This is true even for operations that would normally not consume posted
receive buffers, such as RMA write operations.
.SH ADDRESSING FORMATS
.PP
Multiple fabric interfaces take as input either a source or destination
@ -541,8 +554,6 @@ complete the operation.
.PP
\f[I]FI_ENODATA\f[] : Indicates that no providers could be found which
support the requested fabric information.
.PP
\f[I]FI_ENOSYS\f[] : No fabric providers were found.
.SH NOTES
.PP
If hints are provided, the operation will be controlled by the values

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_mr 3 "2015\-01\-29" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_mr 3 "2015\-01\-29" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_mr - Memory region operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_msg 3 "2015\-03\-04" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_msg 3 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_msg - Message data transfer operations
@ -198,11 +198,6 @@ will immediately be posted after the current call returns.
Use of this flag may improve performance by enabling the provider to
optimize its access to the fabric hardware.
.PP
\f[I]FI_REMOTE_SIGNAL\f[] : Indicates that a completion event at the
target process should be generated for the given operation.
The remote endpoint must be configured with FI_REMOTE_SIGNAL, or this
flag will be ignored by the target.
.PP
\f[I]FI_INJECT\f[] : Applies to fi_sendmsg.
Indicates that the outbound data buffer should be returned to user
immediately after the send call returns, even if the operation is
@ -223,9 +218,14 @@ The buffer will be freed from the endpoint when the available buffer
space falls below the network\[aq]s MTU size (see
FI_OPT_MIN_MULTI_RECV).
.PP
\f[I]FI_REMOTE_COMPLETE\f[] : Applies to fi_sendmsg.
\f[I]FI_INJECT_COMPLETE\f[] : Applies to fi_sendmsg.
Indicates that a completion should be generated when the source
buffer(s) may be reused.
.PP
\f[I]FI_TRANSMIT_COMPLETE\f[] : Applies to fi_sendmsg.
Indicates that a completion should not be generated until the operation
has completed on the remote side.
has been successfully transmitted and is no longer being tracked by the
provider.
.PP
\f[I]FI_FENCE\f[] : Applies to transmits.
Indicates that the requested operation, also known as the fenced

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_poll 3 "2015\-01\-29" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_poll 3 "2015\-01\-29" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_poll - Polling and wait set operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_rma 3 "2015\-03\-04" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_rma 3 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_rma - Remote memory access operations
@ -216,11 +216,6 @@ will immediately be posted after the current call returns.
Use of this flag may improve performance by enabling the provider to
optimize its access to the fabric hardware.
.PP
\f[I]FI_REMOTE_SIGNAL\f[] : Indicates that a completion event at the
target process should be generated for the given operation.
The remote endpoint must be configured with FI_REMOTE_SIGNAL, or this
flag will be ignored by the target.
.PP
\f[I]FI_INJECT\f[] : Applies to fi_writemsg.
Indicates that the outbound data buffer should be returned to user
immediately after the write call returns, even if the operation is
@ -228,9 +223,14 @@ handled asynchronously.
This may require that the underlying provider implementation copy the
data into a local buffer and transfer out of that buffer.
.PP
\f[I]FI_REMOTE_COMPLETE\f[] : Applies to fi_writemsg.
\f[I]FI_INJECT_COMPLETE\f[] : Applies to fi_writemsg.
Indicates that a completion should be generated when the source
buffer(s) may be reused.
.PP
\f[I]FI_TRANSMIT_COMPLETE\f[] : Applies to fi_writemsg.
Indicates that a completion should not be generated until the operation
has completed on the remote side.
has been successfully transmitted and is no longer being tracked by the
provider.
.PP
\f[I]FI_FENCE\f[] : Indicates that the requested operation, also known
as the fenced operation, be deferred until all previous operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_tagged 3 "2015\-03\-04" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_tagged 3 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_tagged - Tagged data transfer operations
@ -253,11 +253,6 @@ will immediately be posted after the current call returns.
Use of this flag may improve performance by enabling the provider to
optimize its access to the fabric hardware.
.PP
\f[I]FI_REMOTE_SIGNAL\f[] : Indicates that a completion event at the
target process should be generated for the given operation.
The remote endpoint must be configured with FI_REMOTE_SIGNAL, or this
flag will be ignored by the target.
.PP
\f[I]FI_INJECT\f[] : Applies to fi_tsendmsg.
Indicates that the outbound data buffer should be returned to user
immediately after the send call returns, even if the operation is
@ -265,9 +260,14 @@ handled asynchronously.
This may require that the underlying provider implementation copy the
data into a local buffer and transfer out of that buffer.
.PP
\f[I]FI_REMOTE_COMPLETE\f[] : Applies to fi_tsendmsg.
\f[I]FI_INJECT_COMPLETE\f[] : Applies to fi_tsendmsg.
Indicates that a completion should be generated when the source
buffer(s) may be reused.
.PP
\f[I]FI_TRANSMIT_COMPLETE\f[] : Applies to fi_tsendmsg.
Indicates that a completion should not be generated until the operation
has completed on the remote side.
has been successfully transmitted and is no longer being tracked by the
provider.
.PP
\f[I]FI_FENCE\f[] : Applies to transmits.
Indicates that the requested operation, also known as the fenced

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_trigger 3 "2015\-01\-01" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_trigger 3 "2015\-01\-01" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_trigger - Triggered operations

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_version 3 "2015\-01\-08" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_version 3 "2015\-01\-08" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
fi_version - Version of the library interfaces

Просмотреть файл

@ -1,4 +1,4 @@
.TH fabric 7 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fabric 7 "2015\-03\-27" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
Fabric Interface Library
@ -168,6 +168,69 @@ Atomic operations include well-known functionality, such as atomic-add
and compare-and-swap, plus several other pre-defined calls.
Unlike other data transfer interfaces, atomic operations are aware of
the data formatting at the target memory region.
.SH LOGGING INTERFACE
.PP
Logging can be controlled using the FI_LOG_LEVEL, FI_LOG_PROV, and
FI_LOG_SUBSYSTEMS environment variables.
.PP
\f[I]FI_LOG_LEVEL\f[] : FI_LOG_LEVEL controls the amount of logging data
that is output.
The following log levels are defined.
.IP \[bu] 2
\f[I]Warn\f[] : Warn is the least verbose setting and is intended for
reporting errors or warnings.
.IP \[bu] 2
\f[I]Trace\f[] : Trace is more verbose and is meant to include
non-detailed output helpful to tracing program execution.
.IP \[bu] 2
\f[I]Info\f[] : Info is high traffic and meant for detailed output.
.IP \[bu] 2
\f[I]Debug\f[] : Debug is high traffic and is likely to impact
application performance.
Debug output is only available if the library has been compiled with
debugging enabled.
.PP
\f[I]FI_LOG_PROV\f[] : The FI_LOG_PROV environment variable enables or
disables logging from specific providers.
Providers can be enabled by listing them in a comma separated fashion.
If the list begins with the \[aq]^\[aq] symbol, then the list will be
negated.
By default all providers are enabled.
.PP
Example: To enable logging from the psm and sockets provider:
FI_LOG_PROV="psm,sockets"
.PP
Example: To enable logging from providers other than psm:
FI_LOG_PROV="^psm"
.PP
\f[I]FI_LOG_SUBSYS\f[] : The FI_LOG_SUBSYS environment variable enables
or disables logging at the subsystem level.
The syntax for enabling or disabling subsystems is similar to that used
for FI_LOG_PROV.
The following subsystems are defined.
.IP \[bu] 2
\f[I]core\f[] : Provides output related to the core framework and its
management of providers.
.IP \[bu] 2
\f[I]fabric\f[] : Provides output specific to interactions associated
with the fabric object.
.IP \[bu] 2
\f[I]domain\f[] : Provides outout specific to interactions associated
with the domain object.
.IP \[bu] 2
\f[I]ep_ctrl\f[] : Provides outout specific to endpoint non-data
transfer operations, such as CM operations.
.IP \[bu] 2
\f[I]ep_data\f[] : Provides outout specific to endpoint data transfer
operations.
.IP \[bu] 2
\f[I]av\f[] : Provides outout specific to address vector operations.
.IP \[bu] 2
\f[I]cq\f[] : Provides outout specific to completion queue operations.
.IP \[bu] 2
\f[I]eq\f[] : Provides outout specific to event queue operations.
.IP \[bu] 2
\f[I]mr\f[] : Provides outout specific to memory registration.
.SH SEE ALSO
.PP
\f[C]fi_provider\f[](7), \f[C]fi_getinfo\f[](3),

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_direct 7 "2014\-11\-21" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_direct 7 "2014\-11\-21" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
Direct fabric provider access

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_provider 7 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_provider 7 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
Fabric Interface Providers
@ -82,10 +82,7 @@ routines.
Access domains must support opening address vector maps and tables.
.IP \[bu] 2
Address vectors associated with domains that may be identified using IP
addresses must support FI_SOCKADDR_IN and FI_SOCKADDR_IN6 input formats.
.IP \[bu] 2
Address vectors must support FI_ADDR, FI_ADDR_INDEX, and FI_AV output
formats.
addresses must support the FI_SOCKADDR_IN input format.
.IP \[bu] 2
Access domains must support opening completion queues and counters.
.IP \[bu] 2
@ -99,6 +96,37 @@ A provider is expected to be forward compatible, and must be able to be
compiled against expanded \f[C]fi_xxx_ops\f[] structures that define new
functions added after the provider was written.
Any unknown functions must be set to NULL.
.SH LOGGING INTERFACE
.PP
Logging is performed using the FI_ERR, FI_LOG, and FI_DEBUG macros.
.SS DEFINITIONS
.IP
.nf
\f[C]
#define\ FI_ERR(prov_name,\ subsystem,\ ...)
#define\ FI_LOG(prov_name,\ prov,\ level,\ subsystem,\ ...)
#define\ FI_DEBUG(prov_name,\ subsystem,\ ...)
\f[]
.fi
.SS ARGUMENTS
.PP
\f[I]prov_name\f[] : String representing the provider name.
.PP
\f[I]prov\f[] : Provider context structure.
.PP
\f[I]level\f[] : Log level associated with log statement.
.PP
\f[I]subsystem\f[] : Subsystem being logged from.
.SS DESCRIPTION
.PP
\f[I]FI_ERR\f[] : Always logged.
.PP
\f[I]FI_LOG\f[] : Logged if the intended provider, log level, and
subsystem parameters match the user supplied values.
.PP
\f[I]FI_DEBUG\f[] : Logged if configured with the --enable-debug flag.
.SH SEE ALSO
.PP
\f[C]fi_psm\f[](7), \f[C]fi_sockets\f[](7), \f[C]fi_usnic\f[](7),

Просмотреть файл

@ -1,22 +1,140 @@
.TH fi_psm 7 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_psm 7 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
The PSM Fabric Provider
.SH OVERVIEW
.PP
\&...Whatever the PSM provider maintainer wants to put here...
The \f[I]psm\f[] provider runs over the PSM interface that is currently
supported by the Intel TrueScale Fabric.
PSM provides tag-matching message queue functions that are optimized for
MPI implementations.
PSM also has limited Active Message support, which is not officially
published but is quite stable and well documented in the source code
(part of the OFED release).
The \f[I]psm\f[] provider makes use of both the tag-matching message
queue functions and the Active Message functions to support a variety of
libfabric data transfer APIs, including tagged message queue, message
queue, RMA, and atomic operations.
.SH LIMITATIONS
.PP
Suggestions:
.IP \[bu] 2
Document what is working
.IP \[bu] 2
Document what has been tested
.IP \[bu] 2
Document what is know to NOT be working
.IP \[bu] 2
Document any other things app developers and end users should know about
this provider (e.g., run-time tunable parameters, differences in
behavior between this and other providers, etc.)
The \f[I]psm\f[] provider doesn\[aq]t support all the features defined
in the libfabric API.
Here are some of the limitations:
.PP
Endpoint types : Only support non-connection based types
\f[I]FI_DGRAM\f[] and \f[I]FI_RDM\f[]
.PP
Endpoint capabilities : Endpoints can support any combination of data
transfer capabilities \f[I]FI_TAGGED\f[], \f[I]FI_MSG\f[],
\f[I]FI_ATOMICS\f[], and \f[I]FI_RMA\f[]s, further refined by
\f[I]FI_SEND\f[], \f[I]FI_RECV\f[], \f[I]FI_READ\f[], \f[I]FI_WRITE\f[],
\f[I]FI_REMOTE_READ\f[], and \f[I]FI_REMOTE_WRITE\f[] if only one
direction is needed.
However, no two endpoints can have overlapping receive or RMA target
capabilities in any of the above categories.
For example it is fine to have two endpoints with \f[I]FI_TAGGED\f[] |
\f[I]FI_SEND\f[], one endpoint with \f[I]FI_TAGGED\f[] |
\f[I]FI_RECV\f[], one endpoint with \f[I]FI_MSG\f[], one endpoint with
\f[I]FI_RMA\f[] | \f[I]FI_ATOMICS\f[].
But it is not allowed to have two endpoints with \f[I]FI_TAGGED\f[], or
two endpoints with \f[I]FI_RMA\f[].
.PP
\f[I]FI_MULTI_RECV\f[] is supported for non-tagged message queue only.
.PP
Other supported capabilities include \f[I]FI_CANCEL\f[],
\f[I]FI_TRIGGER\f[], and \f[I]FI_DYNAMIC_MR\f[].
.PP
Modes : \f[I]FI_CONTEXT\f[] is required.
That means, all the requests that generate completions must have a valid
pointer to type \f[I]struct fi_context\f[] passed as the operation
context.
.PP
Progress : The \f[I]psm\f[] provider requires manual progress.
The application is expected to call \f[I]fi_cq_read\f[] or
\f[I]fi_cntr_read\f[] function from time to time when no other libfabric
function is called to ensure progress is made in a timely manner.
Not doing so could result in either poor performance or no progress
being made as all.
.PP
Unsupported features : These features are unsupported: connection
management, event queue, scalable endpoint, passive endpoint, shared
receive context, send/inject with immediate data.
.SH RUNTIME PARAMETERS
.PP
The \f[I]psm\f[] provider checks for the following environment
variables:
.PP
\f[I]OFI_PSM_UUID\f[] : PSM requires that each job has a unique ID
(UUID).
All the processes in the same job need to use the same UUID in order to
be able to talk to each other.
The PSM reference manual advises to keep UUID unique to each job.
In practice, it generally works fine to reuse UUID as long as (1) no two
jobs with the same UUID are running at the same time; and (2) previous
jobs with the same UUID have exited normally.
If running into "resource busy" or "connection failure" issues with
unknown reason, it is advisable to manually set the UUID to a value
different from the default.
.PP
The default UUID is 0FFF0FFF-0000-0000-0000-0FFF0FFF0FFF.
.PP
\f[I]OFI_PSM_NAME_SERVER\f[] : The \f[I]psm\f[] provider has a simple
built-in name server that can be used to resolve an IP address or host
name into a transport address needed by the \f[I]fi_av_insert\f[] call.
The main purpose of this name server is to allow simple client-server
type applications (such as those in \f[I]fabtest\f[]) to be written
purely with libfabric, without using any out-of-band communication
mechanism.
For such applications, the server would run first, and the client would
call \f[I]fi_getinfo\f[] with the \f[I]node\f[] parameter set to the IP
address or host name of the server.
The resulting \f[I]fi_info\f[] structure would have the transport
address of the server in the \f[I]dest_addr\f[] field.
.PP
The name server won\[aq]t work properly if there are more than one
processes from the same job (i.e.
with the same UUID) running on the same node and acting as servers.
For such scenario it is recommended to have each process getting local
transport address with \f[I]fi_cm_getname\f[] and exchanginge the
addresses with out-of-band mechanism.
.PP
The name server is on by default.
It can be turned off by setting the variable to 0.
This may save a small amount of resource since a separate thread is
created when the name server is on.
.PP
\f[I]OFI_PSM_TAGGED_RMA\f[] : The RMA functions are implemented on top
of the PSM Active Message functions.
The Active Message functions has limit on the size of data can be
transferred in a single message.
Large transfers can be divided into small chunks and be pipelined.
However, the bandwidth is sub-optimal by doing this way.
.PP
The \f[I]psm\f[] provider use PSM tag-matching message queue functions
to achieve higher bandwidth for large size RMA.
For this purpose, a bit is reserved from the tag space to separate the
RMA traffic from the regular tagged message queue.
.PP
The option is on by default.
To turn it off set the variable to 0.
.PP
\f[I]OFI_PSM_AM_MSG\f[] : The \f[I]psm\f[] provider implements the
non-tagged message queue over the PSM tag-matching message queue.
One tag bit is reserved for this purpose.
Alternatively, the non-tagged message queue can be implemented over
Active Message.
This experimental feature has slightly larger latency.
.PP
This option is off by default.
To turn it on set the variable to 1.
.PP
\f[I]OFI_PSM_VERSION_CHECK\f[] : The \f[I]psm\f[] provider checks the
version of the PSM library and fails if the major version doesn\[aq]t
match with the header it is compiled with.
In some case (e.g.
testing compatibility between different versions) one may want to
continue even if the versions don\[aq]t match.
For that purpose the variable can be set to 0.
.SH SEE ALSO
.PP
\f[C]fabric\f[](7), \f[C]fi_provider\f[](7),

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_sockets 7 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_sockets 7 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
The Sockets Fabric Provider

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_usnic 7 "2015\-03\-24" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_usnic 7 "2015\-03\-31" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
The usNIC Fabric Provider
@ -10,9 +10,6 @@ It utilizes the Cisco usNIC (userspace NIC) capabilities of the VIC to
enable ultra low latency and other offload capabilities on Ethernet
networks.
.SH RELEASE NOTES
.PP
The following capabilities are currently supported via the
\f[I]usnic\f[] libfabric provider:
.IP \[bu] 2
The \f[I]usnic\f[] libfabric provider requires the use of the "libnl"
library.
@ -49,9 +46,35 @@ extensively tested as the underlying layer for Open MPI\[aq]s
\f[I]FI_EP_MSG\f[] and \f[I]FI_EP_RDM\f[] endpoints are implemented, but
are only lightly tested.
It is likely that there are still some bugs in these endpoint types.
RMA is not yet supported.
.IP \[bu] 2
Other capabilities, such as the tag matching interface and RDMA
operations, are not yet implemented.
\f[C]fi_provider\f[](7) lists requirements for all providers.
The following limitations exist in the \f[I]usnic\f[] provider:
.RS 2
.IP \[bu] 2
\f[I]fi_getname\f[] is not supported on \f[I]FI_EP_DGRAM\f[],
\f[I]FI_EP_MSG\f[], and passive endpoints.
.IP \[bu] 2
multicast operations are not supported on \f[I]FI_EP_DGRAM\f[] and
\f[I]FI_EP_RDM\f[] endpoints.
.IP \[bu] 2
\f[I]FI_EP_MSG\f[] endpoints only support connect, accept, and shutdown
CM operations.
.IP \[bu] 2
Passive endpoints only support listen CM operations.
.IP \[bu] 2
\f[I]FI_EP_DGRAM\f[] endpoints support \f[C]fi_sendmsg()\f[] and
\f[C]fi_recvmsg()\f[], but all flags are ignored.
.IP \[bu] 2
\f[I]FI_EP_RDM\f[] and \f[I]FI_EP_MSG\f[] endponts do not support
\f[C]fi_sendmsg()\f[] and \f[C]fi_recvmsg()\f[].
.IP \[bu] 2
Address vectors only support \f[C]FI_AV_MAP\f[].
.IP \[bu] 2
No counters are supported.
.IP \[bu] 2
The tag matching interface is not supported.
.RE
.IP \[bu] 2
The usnic libfabric provider supports extensions that provide
information and functionality beyond the standard libfabric interface.

Просмотреть файл

@ -1,4 +1,4 @@
.TH fi_verbs 7 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_verbs 7 "2015\-03\-16" "Libfabric Programmer\[aq]s Manual" "Libfabric v1.0.0rc3"
.SH NAME
.PP
The Verbs Fabric Provider

Просмотреть файл

@ -39,18 +39,23 @@ extern "C" {
#include "fi.h"
#include "fi_enosys.h"
#include "fi_list.h"
#include "fi_log.h"
#include <rdma/fi_log.h>
#define PSMX_PROV_NAME "psm"
#define PSMX_PROV_NAME_LEN 3
#define PSMX_DOMAIN_NAME "psm"
#define PSMX_DOMAIN_NAME_LEN 3
#define PSMX_FABRIC_NAME "psm"
#define PSMX_FABRIC_NAME_LEN 3
#define PSMX_PROVNAME "psm"
#define PSMX_DEFAULT_UUID "0FFF0FFF-0000-0000-0000-0FFF0FFF0FFF"
#define PSMX_DEBUG(...) FI_LOG(2, PSMX_PROVNAME, __VA_ARGS__)
#define PSMX_WARN(...) FI_WARN(PSMX_PROVNAME, __VA_ARGS__)
extern struct fi_provider psmx_prov;
#define PSMX_TIME_OUT 120
#define PSMX_OP_FLAGS (FI_INJECT | FI_MULTI_RECV | FI_COMPLETION | \
FI_TRIGGER | FI_REMOTE_SIGNAL | FI_REMOTE_COMPLETE)
FI_TRIGGER | FI_INJECT_COMPLETE | FI_COMMIT_COMPLETE)
#define PSMX_CAP_EXT (0)
@ -58,7 +63,6 @@ extern "C" {
FI_RMA | FI_MULTI_RECV | \
FI_READ | FI_WRITE | FI_SEND | FI_RECV | \
FI_REMOTE_READ | FI_REMOTE_WRITE | \
FI_REMOTE_SIGNAL | \
FI_CANCEL | FI_TRIGGER | \
FI_DYNAMIC_MR | \
PSMX_CAP_EXT)
@ -73,6 +77,9 @@ extern "C" {
#define PSMX_MSG_BIT (0x1ULL << 63)
#define PSMX_RMA_BIT (0x1ULL << 62)
/* Bits 60 .. 63 of the flag are provider specific */
#define PSMX_NO_COMPLETION (1ULL << 60)
enum psmx_context_type {
PSMX_NOCOMP_SEND_CONTEXT = 1,
PSMX_NOCOMP_RECV_CONTEXT,
@ -110,6 +117,7 @@ union psmx_pi {
#define PSMX_AM_FLAG_MASK 0xFFFF0000
#define PSMX_AM_EOM 0x40000000
#define PSMX_AM_DATA 0x20000000
#define PSMX_AM_FORCE_ACK 0x10000000
#ifndef PSMX_AM_USE_SEND_QUEUE
#define PSMX_AM_USE_SEND_QUEUE 0
@ -148,6 +156,8 @@ struct psmx_am_request {
uint64_t addr;
uint64_t key;
void *context;
void *peer_context;
void *peer_addr;
uint64_t data;
} write;
struct {
@ -517,8 +527,6 @@ struct psmx_env {
int name_server;
int am_msg;
int tagged_rma;
int debug;
int warning;
char *uuid;
};
@ -596,6 +604,8 @@ int psmx_am_rma_handler(psm_am_token_t token, psm_epaddr_t epaddr,
int psmx_am_atomic_handler(psm_am_token_t token, psm_epaddr_t epaddr,
psm_amarg_t *args, int nargs, void *src, uint32_t len);
void psmx_am_ack_rma(struct psmx_am_request *req);
struct psmx_fid_mr *psmx_mr_hash_get(uint64_t key);
int psmx_mr_validate(struct psmx_fid_mr *mr, uint64_t addr, size_t len, uint64_t access);
void psmx_cntr_check_trigger(struct psmx_fid_cntr *cntr);

Просмотреть файл

@ -53,10 +53,14 @@ int psmx_am_progress(struct psmx_fid_domain *domain)
while (!slist_empty(&domain->send_queue.list)) {
item = slist_remove_head(&domain->send_queue.list);
req = container_of(item, struct psmx_am_request, list_entry);
if (req->state == PSMX_AM_STATE_DONE)
if (req->state == PSMX_AM_STATE_DONE) {
free(req);
else
}
else {
pthread_mutex_unlock(&domain->send_queue.lock);
psmx_am_process_send(domain, req);
pthread_mutex_lock(&domain->send_queue.lock);
}
}
pthread_mutex_unlock(&domain->send_queue.lock);
#endif
@ -66,7 +70,9 @@ int psmx_am_progress(struct psmx_fid_domain *domain)
while (!slist_empty(&domain->rma_queue.list)) {
item = slist_remove_head(&domain->rma_queue.list);
req = container_of(item, struct psmx_am_request, list_entry);
pthread_mutex_unlock(&domain->rma_queue.lock);
psmx_am_process_rma(domain, req);
pthread_mutex_lock(&domain->rma_queue.lock);
}
pthread_mutex_unlock(&domain->rma_queue.lock);
}

Просмотреть файл

@ -739,7 +739,7 @@ static int psmx_atomic_self(int am_cmd,
}
gen_local_event:
no_event = ((flags & FI_INJECT) ||
no_event = ((flags & PSMX_NO_COMPLETION) ||
(ep->send_cq_event_flag && !(flags & FI_COMPLETION)));
if (ep->send_cq && !no_event) {
event = psmx_cq_create_event(
@ -860,17 +860,16 @@ ssize_t _psmx_atomic_write(struct fid_ep *ep,
memset((void *)req, 0, sizeof(*req));
memcpy((void *)req+sizeof(*req), (void *)buf, len);
buf = (void *)req + sizeof(*req);
req->no_event = 1;
}
else {
req = calloc(1, sizeof(*req));
if (!req)
return -FI_ENOMEM;
if (ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION))
req->no_event = 1;
}
req->no_event = (flags & PSMX_NO_COMPLETION) ||
(ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION));
req->op = PSMX_AM_REQ_ATOMIC_WRITE;
req->atomic.buf = (void *)buf;
req->atomic.len = len;
@ -954,7 +953,8 @@ static ssize_t psmx_atomic_inject(struct fid_ep *ep,
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
return _psmx_atomic_write(ep, buf, count, NULL/*desc*/,
dest_addr, addr, key,
datatype, op, NULL, ep_priv->flags | FI_INJECT);
datatype, op, NULL,
ep_priv->flags | FI_INJECT | PSMX_NO_COMPLETION);
}
ssize_t _psmx_atomic_readwrite(struct fid_ep *ep,
@ -1047,17 +1047,16 @@ ssize_t _psmx_atomic_readwrite(struct fid_ep *ep,
memset((void *)req, 0, sizeof(*req));
memcpy((void *)req+sizeof(*req), (void *)buf, len);
buf = (void *)req + sizeof(*req);
req->no_event = 1;
}
else {
req = calloc(1, sizeof(*req));
if (!req)
return -FI_ENOMEM;
if (ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION))
req->no_event = 1;
}
req->no_event = (flags & PSMX_NO_COMPLETION) ||
(ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION));
req->op = PSMX_AM_REQ_ATOMIC_READWRITE;
req->atomic.buf = (void *)buf;
req->atomic.len = len;
@ -1257,16 +1256,12 @@ ssize_t _psmx_atomic_compwrite(struct fid_ep *ep,
memcpy((void *)req + sizeof(*req) + len, (void *)compare, len);
buf = (void *)req + sizeof(*req);
compare = buf + len;
req->no_event = 1;
}
else {
req = calloc(1, sizeof(*req));
if (!req)
return -FI_ENOMEM;
if (ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION))
req->no_event = 1;
if (compare != buf + len) {
tmp_buf = malloc(len * 2);
if (!tmp_buf)
@ -1277,6 +1272,9 @@ ssize_t _psmx_atomic_compwrite(struct fid_ep *ep,
}
}
req->no_event = (flags & PSMX_NO_COMPLETION) ||
(ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION));
req->op = PSMX_AM_REQ_ATOMIC_COMPWRITE;
req->atomic.buf = (void *)buf;
req->atomic.len = len;

Просмотреть файл

@ -40,7 +40,8 @@ static void psmx_set_epaddr_context(struct psmx_fid_domain *domain,
context = (void *)psm_epaddr_getctxt(epaddr);
if (context) {
if (context->domain != domain || context->epid != epid) {
PSMX_WARN("%s: domain or epid doesn't match\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_AV,
"domain or epid doesn't match\n");
context = NULL;
}
}
@ -50,7 +51,8 @@ static void psmx_set_epaddr_context(struct psmx_fid_domain *domain,
context = malloc(sizeof *context);
if (!context) {
PSMX_WARN("%s: cannot allocate context\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_AV,
"cannot allocate context\n");
return;
}
@ -180,14 +182,16 @@ static int psmx_av_insert(struct fid_av *av, const void *addr, size_t count,
((psm_epaddr_t *) fi_addr)[i]);
}
else {
PSMX_DEBUG("%d: psm_ep_connect returned %s. remote epid=%lx.\n",
i, psm_error_get_string(errors[i]),
((psm_epid_t *)addr)[i]);
FI_INFO(&psmx_prov, FI_LOG_AV,
"%d: psm_ep_connect returned %s. remote epid=%lx.\n",
i, psm_error_get_string(errors[i]),
((psm_epid_t *)addr)[i]);
if (((psm_epid_t *)addr)[i] == 0)
PSMX_DEBUG("does the application depend on the provider"
"to resolve IP address into endpoint id? if so"
"check if the name server has started correctly"
"at the other side.\n");
FI_INFO(&psmx_prov, FI_LOG_AV,
"does the application depend on the provider"
"to resolve IP address into endpoint id? if so"
"check if the name server has started correctly"
"at the other side.\n");
fi_addr[i] = FI_ADDR_NOTAVAIL;
error_count++;
}
@ -318,7 +322,8 @@ int psmx_av_open(struct fid_domain *domain, struct fi_av_attr *attr,
type = attr->type;
break;
default:
PSMX_DEBUG("attr->type=%d, supported=%d %d\n",
FI_INFO(&psmx_prov, FI_LOG_AV,
"attr->type=%d, supported=%d %d\n",
attr->type, FI_AV_MAP, FI_AV_TABLE);
return -FI_EINVAL;
}

Просмотреть файл

@ -160,7 +160,8 @@ void psmx_cntr_check_trigger(struct psmx_fid_cntr *cntr)
trigger->atomic_compwrite.flags);
break;
default:
PSMX_DEBUG("%d unsupported op\n", trigger->op);
FI_INFO(&psmx_prov, FI_LOG_CQ,
"%d unsupported op\n", trigger->op);
break;
}
@ -377,8 +378,9 @@ int psmx_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
break;
default:
PSMX_DEBUG("attr->events=%d, supported=%d\n",
attr->events, FI_CNTR_EVENTS_COMP);
FI_INFO(&psmx_prov, FI_LOG_CQ,
"attr->events=%d, supported=%d\n",
attr->events, FI_CNTR_EVENTS_COMP);
return -FI_EINVAL;
}
@ -389,7 +391,8 @@ int psmx_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
case FI_WAIT_SET:
if (!attr->wait_set) {
PSMX_DEBUG("FI_WAIT_SET is specified but attr->wait_set is NULL\n");
FI_INFO(&psmx_prov, FI_LOG_CQ,
"FI_WAIT_SET is specified but attr->wait_set is NULL\n");
return -FI_EINVAL;
}
wait = (struct psmx_fid_wait *)attr->wait_set;
@ -407,8 +410,9 @@ int psmx_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
break;
default:
PSMX_DEBUG("attr->wait_obj=%d, supported=%d...%d\n",
attr->wait_obj, FI_WAIT_NONE, FI_WAIT_MUTEX_COND);
FI_INFO(&psmx_prov, FI_LOG_CQ,
"attr->wait_obj=%d, supported=%d...%d\n",
attr->wait_obj, FI_WAIT_NONE, FI_WAIT_MUTEX_COND);
return -FI_EINVAL;
}

Просмотреть файл

@ -68,7 +68,7 @@ struct psmx_cq_event *psmx_cq_create_event(struct psmx_fid_cq *cq,
else {
event = calloc(1, sizeof(*event));
if (!event) {
PSMX_WARN("%s: out of memory.\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_CQ, "out of memory.\n");
exit(-1);
}
}
@ -112,7 +112,8 @@ struct psmx_cq_event *psmx_cq_create_event(struct psmx_fid_cq *cq,
break;
default:
PSMX_WARN("%s: unsupported CQ format %d\n", __func__, cq->format);
FI_WARN(&psmx_prov, FI_LOG_CQ,
"unsupported CQ format %d\n", cq->format);
return NULL;
}
@ -206,7 +207,8 @@ static struct psmx_cq_event *psmx_cq_create_event_from_status(
else {
event = calloc(1, sizeof(*event));
if (!event) {
PSMX_WARN("%s: out of memory.\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_CQ,
"out of memory.\n");
exit(-1);
}
}
@ -257,7 +259,8 @@ static struct psmx_cq_event *psmx_cq_create_event_from_status(
break;
default:
PSMX_WARN("%s: unsupported EQ format %d\n", __func__, cq->format);
FI_WARN(&psmx_prov, FI_LOG_CQ,
"unsupported EQ format %d\n", cq->format);
return NULL;
}
@ -318,6 +321,9 @@ int psmx_cq_poll_mq(struct psmx_fid_cq *cq, struct psmx_fid_domain *domain,
struct psmx_cq_event *event;
int multi_recv;
int err;
int read_more = 1;
int read_count = 0;
void *event_buffer = count ? event_in : NULL;
while (1) {
err = psm_mq_ipeek(domain->psm_mq, &psm_req, NULL);
@ -327,6 +333,9 @@ int psmx_cq_poll_mq(struct psmx_fid_cq *cq, struct psmx_fid_domain *domain,
fi_context = psm_status.context;
if (!fi_context)
continue;
tmp_ep = PSMX_CTXT_EP(fi_context);
tmp_cq = NULL;
tmp_cntr = NULL;
@ -382,26 +391,42 @@ int psmx_cq_poll_mq(struct psmx_fid_cq *cq, struct psmx_fid_domain *domain,
struct fi_context *fi_context = psm_status.context;
struct psmx_fid_mr *mr;
struct psmx_am_request *req;
req = container_of(fi_context, struct psmx_am_request, fi_context);
if (req->op & PSMX_AM_FORCE_ACK) {
req->error = psmx_errno(psm_status.error_code);
psmx_am_ack_rma(req);
}
mr = PSMX_CTXT_USER(fi_context);
if (mr->cq) {
event = psmx_cq_create_event_from_status(
mr->cq, &psm_status, req->write.data,
(mr->cq == cq) ? event_in : NULL,
(mr->cq == cq) ? event_buffer : NULL,
count, src_addr);
if (!event)
return -FI_ENOMEM;
if (event != event_in)
if (event == event_buffer) {
read_count++;
read_more = --count;
event_buffer = count ? event_buffer + cq->entry_size : NULL;
}
else {
psmx_cq_enqueue_event(mr->cq, event);
if (mr->cq == cq)
read_more = 0;
}
}
if (mr->cntr)
psmx_cntr_inc(mr->cntr);
if (mr->domain->rma_ep->remote_write_cntr)
psmx_cntr_inc(mr->domain->rma_ep->remote_write_cntr);
if (!cq || mr->cq == cq)
return psm_status.error_code ? -FI_EAVAIL : 1;
continue;
if (read_more)
continue;
return read_count;
}
case PSMX_REMOTE_READ_CONTEXT:
@ -411,21 +436,28 @@ int psmx_cq_poll_mq(struct psmx_fid_cq *cq, struct psmx_fid_domain *domain,
mr = PSMX_CTXT_USER(fi_context);
if (mr->domain->rma_ep->remote_read_cntr)
psmx_cntr_inc(mr->domain->rma_ep->remote_read_cntr);
if (!cq)
return psm_status.error_code ? -FI_EAVAIL : 1;
continue;
}
}
if (tmp_cq) {
event = psmx_cq_create_event_from_status(tmp_cq, &psm_status, 0,
(tmp_cq == cq) ? event_in : NULL, count,
(tmp_cq == cq) ? event_buffer : NULL, count,
src_addr);
if (!event)
return -FI_ENOMEM;
if (event != event_in)
if (event == event_buffer) {
read_count++;
read_more = --count;
event_buffer = count ? event_buffer + cq->entry_size : NULL;
}
else {
psmx_cq_enqueue_event(tmp_cq, event);
if (tmp_cq == cq)
read_more = 0;
}
}
if (tmp_cntr)
@ -464,17 +496,21 @@ int psmx_cq_poll_mq(struct psmx_fid_cq *cq, struct psmx_fid_domain *domain,
return -FI_ENOMEM;
psmx_cq_enqueue_event(tmp_cq, event);
if (tmp_cq == cq)
read_more = 0;
}
free(req);
}
}
if (!cq || tmp_cq == cq)
return psm_status.error_code ? -FI_EAVAIL : 1;
if (read_more)
continue;
return read_count;
}
else if (err == PSM_MQ_NO_COMPLETIONS) {
return 0;
return read_count;
}
else {
return psmx_errno(err);
@ -561,56 +597,6 @@ static ssize_t psmx_cq_readerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
return 0;
}
static ssize_t psmx_cq_write(struct fid_cq *cq, const void *buf, size_t len)
{
struct psmx_fid_cq *cq_priv;
struct psmx_cq_event *event;
ssize_t written_len = 0;
cq_priv = container_of(cq, struct psmx_fid_cq, cq);
while (len >= cq_priv->entry_size) {
event = calloc(1, sizeof(*event));
if (!event) {
PSMX_WARN("%s: out of memory\n", __func__);
return -FI_ENOMEM;
}
memcpy((void *)&event->cqe, buf + written_len, cq_priv->entry_size);
psmx_cq_enqueue_event(cq_priv, event);
written_len += cq_priv->entry_size;
len -= cq_priv->entry_size;
}
return written_len;
}
static ssize_t psmx_cq_writeerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
size_t len, uint64_t flags)
{
struct psmx_fid_cq *cq_priv;
struct psmx_cq_event *event;
ssize_t written_len = 0;
cq_priv = container_of(cq, struct psmx_fid_cq, cq);
while (len >= sizeof(*buf)) {
event = calloc(1, sizeof(*event));
if (!event) {
PSMX_WARN("%s: out of memory\n", __func__);
return -FI_ENOMEM;
}
memcpy((void *)&event->cqe, buf + written_len, sizeof(*buf));
event->error = !!event->cqe.err.err;
psmx_cq_enqueue_event(cq_priv, event);
written_len += sizeof(*buf);
len -= sizeof(*buf);
}
return written_len;
}
static ssize_t psmx_cq_sreadfrom(struct fid_cq *cq, void *buf, size_t count,
fi_addr_t *src_addr, const void *cond,
int timeout)
@ -664,6 +650,17 @@ static ssize_t psmx_cq_sread(struct fid_cq *cq, void *buf, size_t count,
return psmx_cq_sreadfrom(cq, buf, count, NULL, cond, timeout);
}
static int psmx_cq_signal(struct fid_cq *cq)
{
struct psmx_fid_cq *cq_priv;
cq_priv = container_of(cq, struct psmx_fid_cq, cq);
if (cq_priv->wait)
psmx_wait_signal((struct fid_wait *)cq_priv->wait);
return 0;
}
static const char *psmx_cq_strerror(struct fid_cq *cq, int prov_errno, const void *prov_data,
char *buf, size_t len)
{
@ -724,10 +721,9 @@ static struct fi_ops_cq psmx_cq_ops = {
.read = psmx_cq_read,
.readfrom = psmx_cq_readfrom,
.readerr = psmx_cq_readerr,
.write = psmx_cq_write,
.writeerr = psmx_cq_writeerr,
.sread = psmx_cq_sread,
.sreadfrom = psmx_cq_sreadfrom,
.signal = psmx_cq_signal,
.strerror = psmx_cq_strerror,
};
@ -768,8 +764,9 @@ int psmx_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
break;
default:
PSMX_DEBUG("attr->format=%d, supported=%d...%d\n", attr->format,
FI_CQ_FORMAT_UNSPEC, FI_CQ_FORMAT_TAGGED);
FI_INFO(&psmx_prov, FI_LOG_CQ,
"attr->format=%d, supported=%d...%d\n", attr->format,
FI_CQ_FORMAT_UNSPEC, FI_CQ_FORMAT_TAGGED);
return -FI_EINVAL;
}
@ -780,7 +777,8 @@ int psmx_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
case FI_WAIT_SET:
if (!attr->wait_set) {
PSMX_DEBUG("FI_WAIT_SET is specified but attr->wait_set is NULL\n");
FI_INFO(&psmx_prov, FI_LOG_CQ,
"FI_WAIT_SET is specified but attr->wait_set is NULL\n");
return -FI_EINVAL;
}
wait = (struct psmx_fid_wait *)attr->wait_set;
@ -798,8 +796,9 @@ int psmx_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
break;
default:
PSMX_DEBUG("attr->wait_obj=%d, supported=%d...%d\n", attr->wait_obj,
FI_WAIT_NONE, FI_WAIT_MUTEX_COND);
FI_INFO(&psmx_prov, FI_LOG_CQ,
"attr->wait_obj=%d, supported=%d...%d\n", attr->wait_obj,
FI_WAIT_NONE, FI_WAIT_MUTEX_COND);
return -FI_EINVAL;
}
@ -810,8 +809,9 @@ int psmx_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
break;
default:
PSMX_DEBUG("attr->wait_cond=%d, supported=%d...%d\n",
attr->wait_cond, FI_CQ_COND_NONE, FI_CQ_COND_THRESHOLD);
FI_INFO(&psmx_prov, FI_LOG_CQ,
"attr->wait_cond=%d, supported=%d...%d\n",
attr->wait_cond, FI_CQ_COND_NONE, FI_CQ_COND_THRESHOLD);
return -FI_EINVAL;
}
}
@ -843,7 +843,7 @@ int psmx_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
for (i=0; i<PSMX_FREE_LIST_SIZE; i++) {
event = calloc(1, sizeof(*event));
if (!event) {
PSMX_WARN("%s: out of memory.\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_CQ, "out of memory.\n");
exit(-1);
}
slist_insert_tail(&event->list_entry, &cq_priv->free_list);

Просмотреть файл

@ -37,7 +37,7 @@ static int psmx_domain_close(fid_t fid)
struct psmx_fid_domain *domain;
int err;
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_DOMAIN, "\n");
domain = container_of(fid, struct psmx_fid_domain, domain.fid);
@ -98,7 +98,7 @@ int psmx_domain_open(struct fid_fabric *fabric, struct fi_info *info,
struct psm_ep_open_opts opts;
int err = -FI_ENOMEM;
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_DOMAIN, "\n");
fabric_priv = container_of(fabric, struct psmx_fid_fabric, fabric);
if (fabric_priv->active_domain) {
@ -107,7 +107,7 @@ int psmx_domain_open(struct fid_fabric *fabric, struct fi_info *info,
return 0;
}
if (!info->domain_attr->name || strncmp(info->domain_attr->name, "psm", 3))
if (!info->domain_attr->name || strncmp(info->domain_attr->name, PSMX_DOMAIN_NAME, PSMX_DOMAIN_NAME_LEN))
return -FI_EINVAL;
domain_priv = (struct psmx_fid_domain *) calloc(1, sizeof *domain_priv);
@ -127,8 +127,8 @@ int psmx_domain_open(struct fid_fabric *fabric, struct fi_info *info,
err = psm_ep_open(fabric_priv->uuid, &opts,
&domain_priv->psm_ep, &domain_priv->psm_epid);
if (err != PSM_OK) {
PSMX_WARN("%s: psm_ep_open returns %d, errno=%d\n",
__func__, err, errno);
FI_WARN(&psmx_prov, FI_LOG_CQ,
"psm_ep_open returns %d, errno=%d\n", err, errno);
err = psmx_errno(err);
goto err_out_free_domain;
}
@ -136,8 +136,8 @@ int psmx_domain_open(struct fid_fabric *fabric, struct fi_info *info,
err = psm_mq_init(domain_priv->psm_ep, PSM_MQ_ORDERMASK_ALL,
NULL, 0, &domain_priv->psm_mq);
if (err != PSM_OK) {
PSMX_WARN("%s: psm_mq_init returns %d, errno=%d\n",
__func__, err, errno);
FI_WARN(&psmx_prov, FI_LOG_CQ,
"psm_mq_init returns %d, errno=%d\n", err, errno);
err = psmx_errno(err);
goto err_out_close_ep;
}

Просмотреть файл

@ -37,35 +37,40 @@ static void psmx_ep_optimize_ops(struct psmx_fid_ep *ep)
if (ep->ep.tagged) {
if (ep->flags) {
ep->ep.tagged = &psmx_tagged_ops;
PSMX_DEBUG("generic tagged ops.\n");
FI_INFO(&psmx_prov, FI_LOG_EP_DATA,
"generic tagged ops.\n");
}
else if (ep->send_cq_event_flag && ep->recv_cq_event_flag) {
if (ep->av && ep->av->type == FI_AV_TABLE)
ep->ep.tagged = &psmx_tagged_ops_no_event_av_table;
else
ep->ep.tagged = &psmx_tagged_ops_no_event_av_map;
PSMX_DEBUG("tagged ops optimized for op_flags=0 and event suppression\n");
FI_INFO(&psmx_prov, FI_LOG_EP_DATA,
"tagged ops optimized for op_flags=0 and event suppression\n");
}
else if (ep->send_cq_event_flag) {
if (ep->av && ep->av->type == FI_AV_TABLE)
ep->ep.tagged = &psmx_tagged_ops_no_send_event_av_table;
else
ep->ep.tagged = &psmx_tagged_ops_no_send_event_av_map;
PSMX_DEBUG("tagged ops optimized for op_flags=0 and send event suppression\n");
FI_INFO(&psmx_prov, FI_LOG_EP_DATA,
"tagged ops optimized for op_flags=0 and send event suppression\n");
}
else if (ep->recv_cq_event_flag) {
if (ep->av && ep->av->type == FI_AV_TABLE)
ep->ep.tagged = &psmx_tagged_ops_no_recv_event_av_table;
else
ep->ep.tagged = &psmx_tagged_ops_no_recv_event_av_map;
PSMX_DEBUG("tagged ops optimized for op_flags=0 and recv event suppression\n");
FI_INFO(&psmx_prov, FI_LOG_EP_DATA,
"tagged ops optimized for op_flags=0 and recv event suppression\n");
}
else {
if (ep->av && ep->av->type == FI_AV_TABLE)
ep->ep.tagged = &psmx_tagged_ops_no_flag_av_table;
else
ep->ep.tagged = &psmx_tagged_ops_no_flag_av_map;
PSMX_DEBUG("tagged ops optimized for op_flags=0\n");
FI_INFO(&psmx_prov, FI_LOG_EP_DATA,
"tagged ops optimized for op_flags=0\n");
}
}
}
@ -386,7 +391,7 @@ int psmx_stx_ctx(struct fid_domain *domain, struct fi_tx_attr *attr,
{
struct psmx_fid_stx *stx_priv;
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_EP_DATA, "\n");
stx_priv = (struct psmx_fid_stx *) calloc(1, sizeof *stx_priv);
if (!stx_priv)

Просмотреть файл

@ -51,19 +51,21 @@ static int psmx_reserve_tag_bits(int *caps, uint64_t *max_tag_value)
reserved_bits |= PSMX_MSG_BIT;
}
else if (ask_caps) {
PSMX_DEBUG("unable to reserve tag bit for FI_MSG support.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or remove FI_MSG from the asked capabilities, "
"or set OFI_PSM_AM_MSG=1 to use an alternative (but less "
"optimized) message queue implementation.\n");
FI_INFO(&psmx_prov, FI_LOG_CORE,
"unable to reserve tag bit for FI_MSG support.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or remove FI_MSG from the asked capabilities, "
"or set OFI_PSM_AM_MSG=1 to use an alternative (but less "
"optimized) message queue implementation.\n");
return -1;
}
else {
PSMX_DEBUG("unable to reserve tag bit for FI_MSG support. "
"FI_MSG is removed from the capabilities.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or set OFI_PSM_AM_MSG=1 to use an alternative (but less "
"optimized) message queue implementation.\n");
FI_INFO(&psmx_prov, FI_LOG_CORE,
"unable to reserve tag bit for FI_MSG support. "
"FI_MSG is removed from the capabilities.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or set OFI_PSM_AM_MSG=1 to use an alternative (but less "
"optimized) message queue implementation.\n");
ret_caps &= ~FI_MSG;
}
}
@ -73,17 +75,19 @@ static int psmx_reserve_tag_bits(int *caps, uint64_t *max_tag_value)
reserved_bits |= PSMX_RMA_BIT;
}
else if (ask_caps) {
PSMX_DEBUG("unable to reserve tag bit for tagged RMA acceleration.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or remove FI_RMA from the asked capabilities, "
"or set OFI_PSM_TAGGED_RMA=0 to disable RMA acceleration.\n");
FI_INFO(&psmx_prov, FI_LOG_CORE,
"unable to reserve tag bit for tagged RMA acceleration.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or remove FI_RMA from the asked capabilities, "
"or set OFI_PSM_TAGGED_RMA=0 to disable RMA acceleration.\n");
return -1;
}
else {
PSMX_DEBUG("unable to reserve tag bit for tagged RMA acceleration. "
"FI_RMA is removed from the capabilities.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or set OFI_PSM_TAGGED_RMA=0 to disable RMA acceleration.\n");
FI_INFO(&psmx_prov, FI_LOG_CORE,
"unable to reserve tag bit for tagged RMA acceleration. "
"FI_RMA is removed from the capabilities.\n"
"ADVICE: please reduce the asked max_tag_value, "
"or set OFI_PSM_TAGGED_RMA=0 to disable RMA acceleration.\n");
ret_caps &= ~FI_RMA;
}
}
@ -106,12 +110,13 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
uint64_t max_tag_value = 0;
int err = -FI_ENODATA;
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_CORE,"\n");
*info = NULL;
if (psm_ep_num_devunits(&cnt) || !cnt) {
PSMX_DEBUG("no PSM device is found.\n");
FI_INFO(&psmx_prov, FI_LOG_CORE,
"no PSM device is found.\n");
return -FI_ENODATA;
}
@ -126,9 +131,10 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
case FI_EP_RDM:
break;
default:
PSMX_DEBUG("hints->ep_attr->type=%d, supported=%d,%d,%d.\n",
hints->ep_attr->type, FI_EP_UNSPEC,
FI_EP_DGRAM, FI_EP_RDM);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->ep_attr->type=%d, supported=%d,%d,%d.\n",
hints->ep_attr->type, FI_EP_UNSPEC,
FI_EP_DGRAM, FI_EP_RDM);
goto err_out;
}
@ -137,46 +143,52 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
case FI_PROTO_PSMX:
break;
default:
PSMX_DEBUG("hints->protocol=%d, supported=%d %d\n",
hints->ep_attr->protocol,
FI_PROTO_UNSPEC, FI_PROTO_PSMX);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->protocol=%d, supported=%d %d\n",
hints->ep_attr->protocol,
FI_PROTO_UNSPEC, FI_PROTO_PSMX);
goto err_out;
}
if (hints->ep_attr->tx_ctx_cnt > 1) {
PSMX_DEBUG("hints->ep_attr->tx_ctx_cnt=%d, supported=0,1\n",
hints->ep_attr->tx_ctx_cnt);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->ep_attr->tx_ctx_cnt=%d, supported=0,1\n",
hints->ep_attr->tx_ctx_cnt);
goto err_out;
}
if (hints->ep_attr->rx_ctx_cnt > 1) {
PSMX_DEBUG("hints->ep_attr->rx_ctx_cnt=%d, supported=0,1\n",
hints->ep_attr->rx_ctx_cnt);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->ep_attr->rx_ctx_cnt=%d, supported=0,1\n",
hints->ep_attr->rx_ctx_cnt);
goto err_out;
}
}
if ((hints->caps & PSMX_CAPS) != hints->caps &&
(hints->caps & PSMX_CAPS2) != hints->caps) {
PSMX_DEBUG("hints->caps=0x%llx, supported=0x%llx,0x%llx\n",
hints->caps, PSMX_CAPS, PSMX_CAPS2);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->caps=0x%llx, supported=0x%llx,0x%llx\n",
hints->caps, PSMX_CAPS, PSMX_CAPS2);
goto err_out;
}
if (hints->tx_attr) {
if ((hints->tx_attr->op_flags & PSMX_OP_FLAGS) !=
hints->tx_attr->op_flags) {
PSMX_DEBUG("hints->tx->flags=0x%llx, "
"supported=0x%llx\n",
hints->tx_attr->op_flags,
PSMX_OP_FLAGS);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->tx->flags=0x%llx, "
"supported=0x%llx\n",
hints->tx_attr->op_flags,
PSMX_OP_FLAGS);
goto err_out;
}
if (hints->tx_attr->inject_size > PSMX_INJECT_SIZE) {
PSMX_DEBUG("hints->tx_attr->inject_size=%ld,"
"supported=%ld.\n",
hints->tx_attr->inject_size,
PSMX_INJECT_SIZE);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->tx_attr->inject_size=%ld,"
"supported=%ld.\n",
hints->tx_attr->inject_size,
PSMX_INJECT_SIZE);
goto err_out;
}
}
@ -184,37 +196,42 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
if (hints->rx_attr &&
(hints->rx_attr->op_flags & PSMX_OP_FLAGS) !=
hints->rx_attr->op_flags) {
PSMX_DEBUG("hints->rx->flags=0x%llx, supported=0x%llx\n",
hints->rx_attr->op_flags, PSMX_OP_FLAGS);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->rx->flags=0x%llx, supported=0x%llx\n",
hints->rx_attr->op_flags, PSMX_OP_FLAGS);
goto err_out;
}
if ((hints->mode & PSMX_MODE) != PSMX_MODE) {
PSMX_DEBUG("hints->mode=0x%llx, required=0x%llx\n",
hints->mode, PSMX_MODE);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->mode=0x%llx, required=0x%llx\n",
hints->mode, PSMX_MODE);
goto err_out;
}
if (hints->fabric_attr && hints->fabric_attr->name &&
strncmp(hints->fabric_attr->name, "psm", 3)) {
PSMX_DEBUG("hints->fabric_name=%s, supported=psm\n",
hints->fabric_attr->name);
strncmp(hints->fabric_attr->name, PSMX_FABRIC_NAME, PSMX_FABRIC_NAME_LEN)) {
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->fabric_name=%s, supported=psm\n",
hints->fabric_attr->name);
goto err_out;
}
if (hints->domain_attr && hints->domain_attr->name &&
strncmp(hints->domain_attr->name, "psm", 3)) {
PSMX_DEBUG("hints->domain_name=%s, supported=psm\n",
hints->domain_attr->name);
strncmp(hints->domain_attr->name, PSMX_DOMAIN_NAME, PSMX_DOMAIN_NAME_LEN)) {
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->domain_name=%s, supported=psm\n",
hints->domain_attr->name);
goto err_out;
}
if (hints->ep_attr) {
if (hints->ep_attr->max_msg_size > PSMX_MAX_MSG_SIZE) {
PSMX_DEBUG("hints->ep_attr->max_msg_size=%ld,"
"supported=%ld.\n",
hints->ep_attr->max_msg_size,
PSMX_MAX_MSG_SIZE);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"hints->ep_attr->max_msg_size=%ld,"
"supported=%ld.\n",
hints->ep_attr->max_msg_size,
PSMX_MAX_MSG_SIZE);
goto err_out;
}
max_tag_value = fi_tag_bits(hints->ep_attr->mem_tag_format);
@ -238,15 +255,13 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
psmx_info->ep_attr->protocol = FI_PROTO_PSMX;
psmx_info->ep_attr->max_msg_size = PSMX_MAX_MSG_SIZE;
psmx_info->ep_attr->mem_tag_format = fi_tag_format(max_tag_value);
psmx_info->ep_attr->msg_order = FI_ORDER_SAS;
psmx_info->ep_attr->comp_order = FI_ORDER_NONE;
psmx_info->ep_attr->tx_ctx_cnt = 1;
psmx_info->ep_attr->rx_ctx_cnt = 1;
psmx_info->domain_attr->threading = FI_THREAD_COMPLETION;
psmx_info->domain_attr->control_progress = FI_PROGRESS_MANUAL;
psmx_info->domain_attr->data_progress = FI_PROGRESS_MANUAL;
psmx_info->domain_attr->name = strdup("psm");
psmx_info->domain_attr->name = strdup(PSMX_DOMAIN_NAME);
psmx_info->next = NULL;
psmx_info->caps = (hints && hints->caps) ? hints->caps : caps;
@ -256,15 +271,15 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
psmx_info->dest_addrlen = sizeof(psm_epid_t);
psmx_info->src_addr = NULL;
psmx_info->dest_addr = dest_addr;
psmx_info->fabric_attr->name = strdup("psm");
psmx_info->fabric_attr->prov_name = strdup("psm");
psmx_info->fabric_attr->name = strdup(PSMX_FABRIC_NAME);
psmx_info->fabric_attr->prov_name = strdup(PSMX_PROV_NAME);
psmx_info->tx_attr->caps = psmx_info->caps;
psmx_info->tx_attr->mode = psmx_info->mode;
psmx_info->tx_attr->op_flags = (hints && hints->tx_attr && hints->tx_attr->op_flags)
? hints->tx_attr->op_flags : 0;
psmx_info->tx_attr->msg_order = psmx_info->ep_attr->msg_order;
psmx_info->tx_attr->comp_order = psmx_info->ep_attr->comp_order;
psmx_info->tx_attr->msg_order = FI_ORDER_SAS;
psmx_info->tx_attr->comp_order = FI_ORDER_NONE;
psmx_info->tx_attr->inject_size = PSMX_INJECT_SIZE;
psmx_info->tx_attr->size = UINT64_MAX;
psmx_info->tx_attr->iov_limit = 1;
@ -273,8 +288,8 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
psmx_info->rx_attr->mode = psmx_info->mode;
psmx_info->rx_attr->op_flags = (hints && hints->rx_attr && hints->tx_attr->op_flags)
? hints->tx_attr->op_flags : 0;
psmx_info->rx_attr->msg_order = psmx_info->ep_attr->msg_order;
psmx_info->rx_attr->comp_order = psmx_info->ep_attr->comp_order;
psmx_info->rx_attr->msg_order = FI_ORDER_SAS;
psmx_info->rx_attr->comp_order = FI_ORDER_NONE;
psmx_info->rx_attr->total_buffered_recv = ~(0ULL); /* that's how PSM handles it internally! */
psmx_info->rx_attr->size = UINT64_MAX;
psmx_info->rx_attr->iov_limit = 1;
@ -290,7 +305,7 @@ static int psmx_fabric_close(fid_t fid)
{
struct psmx_fid_fabric *fabric;
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_CORE, "\n");
fabric = container_of(fid, struct psmx_fid_fabric, fabric.fid);
if (--fabric->refcnt) {
@ -324,9 +339,9 @@ static int psmx_fabric(struct fi_fabric_attr *attr,
pthread_t thread;
pthread_attr_t thread_attr;
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_CORE, "\n");
if (strncmp(attr->name, "psm", 3))
if (strncmp(attr->name, PSMX_FABRIC_NAME, PSMX_FABRIC_NAME_LEN))
return -FI_ENODATA;
if (psmx_active_fabric) {
@ -361,14 +376,14 @@ static int psmx_fabric(struct fi_fabric_attr *attr,
static void psmx_fini(void)
{
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_CORE, "\n");
if (! --psmx_init_count)
psm_finalize();
}
static struct fi_provider psmx_prov = {
.name = PSMX_PROVNAME,
struct fi_provider psmx_prov = {
.name = PSMX_PROV_NAME,
.version = FI_VERSION(0, 9),
.fi_version = FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION),
.getinfo = psmx_getinfo,
@ -404,12 +419,11 @@ PSM_INI
psmx_env.name_server = psmx_get_int_env("OFI_PSM_NAME_SERVER", 1);
psmx_env.am_msg = psmx_get_int_env("OFI_PSM_AM_MSG", 0);
psmx_env.tagged_rma = psmx_get_int_env("OFI_PSM_TAGGED_RMA", 1);
psmx_env.warning = psmx_get_int_env("OFI_PSM_WARNING", 1);
psmx_env.uuid = getenv("OFI_PSM_UUID");
if (!psmx_env.uuid)
psmx_env.uuid = PSMX_DEFAULT_UUID;
PSMX_DEBUG("\n");
FI_INFO(&psmx_prov, FI_LOG_CORE, "\n");
psm_error_register_handler(NULL, PSM_ERRHANDLER_NO_HANDLER);
@ -418,28 +432,35 @@ PSM_INI
err = psm_init(&major, &minor);
if (err != PSM_OK) {
PSMX_WARN("%s: psm_init failed: %s\n", __func__,
psm_error_get_string(err));
FI_WARN(&psmx_prov, FI_LOG_CORE,
"psm_init failed: %s\n", psm_error_get_string(err));
return NULL;
}
PSMX_DEBUG("PSM header version = (%d, %d)\n", PSM_VERNO_MAJOR, PSM_VERNO_MINOR);
PSMX_DEBUG("PSM library version = (%d, %d)\n", major, minor);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"PSM header version = (%d, %d)\n", PSM_VERNO_MAJOR, PSM_VERNO_MINOR);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"PSM library version = (%d, %d)\n", major, minor);
check_version = psmx_get_int_env("OFI_PSM_VERSION_CHECK", 1);
if (check_version && major != PSM_VERNO_MAJOR) {
FI_WARN(PSMX_PROVNAME, "%s: PSM version mismatch: header %d.%d, library %d.%d.\n",
__func__, PSM_VERNO_MAJOR, PSM_VERNO_MINOR, major, minor);
FI_WARN(PSMX_PROVNAME, "\tSet envar OFI_PSM_VERSION_CHECK=0 to bypass version check.\n");
FI_WARN(&psmx_prov, FI_LOG_CORE,
"PSM version mismatch: header %d.%d, library %d.%d.\n",
PSM_VERNO_MAJOR, PSM_VERNO_MINOR, major, minor);
FI_WARN(&psmx_prov, FI_LOG_CORE,
"\tSet envar OFI_PSM_VERSION_CHECK=0 to bypass version check.\n");
return NULL;
}
PSMX_DEBUG("OFI_PSM_NAME_SERVER = %d\n", psmx_env.name_server);
PSMX_DEBUG("OFI_PSM_AM_MSG = %d\n", psmx_env.am_msg);
PSMX_DEBUG("OFI_PSM_TAGGED_RMA = %d\n", psmx_env.tagged_rma);
PSMX_DEBUG("OFI_PSM_WARNING = %d\n", psmx_env.warning);
PSMX_DEBUG("OFI_PSM_UUID = %s\n", psmx_env.uuid);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"OFI_PSM_NAME_SERVER = %d\n", psmx_env.name_server);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"OFI_PSM_AM_MSG = %d\n", psmx_env.am_msg);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"OFI_PSM_TAGGED_RMA = %d\n", psmx_env.tagged_rma);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"OFI_PSM_UUID = %s\n", psmx_env.uuid);
psmx_init_count++;
return (&psmx_prov);

Просмотреть файл

@ -201,6 +201,8 @@ ssize_t _psmx_send(struct fid_ep *ep, const void *buf, size_t len,
struct fi_context * fi_context;
int err;
size_t idx;
int no_completion = 0;
struct psmx_cq_event *event;
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
@ -242,6 +244,10 @@ ssize_t _psmx_send(struct fid_ep *ep, const void *buf, size_t len,
psm_tag = ep_priv->domain->psm_epid | PSMX_MSG_BIT;
if ((flags & PSMX_NO_COMPLETION) ||
(ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION)))
no_completion = 1;
if (flags & FI_INJECT) {
if (len > PSMX_INJECT_SIZE)
return -FI_EMSGSIZE;
@ -255,10 +261,24 @@ ssize_t _psmx_send(struct fid_ep *ep, const void *buf, size_t len,
if (ep_priv->send_cntr)
psmx_cntr_inc(ep_priv->send_cntr);
if (ep_priv->send_cq && !no_completion) {
event = psmx_cq_create_event(
ep_priv->send_cq,
context, (void *)buf, flags, len,
0 /* data */, psm_tag,
0 /* olen */,
0 /* err */);
if (event)
psmx_cq_enqueue_event(ep_priv->send_cq, event);
else
return -FI_ENOMEM;
}
return 0;
}
if (ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION) && !context) {
if (no_completion && !context) {
fi_context = &ep_priv->nocomp_send_context;
}
else {
@ -344,7 +364,7 @@ static ssize_t psmx_inject(struct fid_ep *ep, const void *buf, size_t len,
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
return _psmx_send(ep, buf, len, NULL, dest_addr, NULL,
ep_priv->flags | FI_INJECT);
ep_priv->flags | FI_INJECT | PSMX_NO_COMPLETION);
}
struct fi_ops_msg psmx_msg_ops = {

Просмотреть файл

@ -149,7 +149,8 @@ int psmx_am_msg_handler(psm_am_token_t token, psm_epaddr_t epaddr,
epaddr_context = psm_epaddr_getctxt(epaddr);
if (!epaddr_context) {
PSMX_WARN("%s: NULL context for epaddr %p\n", __func__, epaddr);
FI_WARN(&psmx_prov, FI_LOG_EP_DATA,
"NULL context for epaddr %p\n", epaddr);
return -FI_EIO;
}
@ -210,7 +211,8 @@ int psmx_am_msg_handler(psm_am_token_t token, psm_epaddr_t epaddr,
req->recv.len_received += copy_len;
}
else {
PSMX_WARN("%s: NULL recv_req in follow-up packets.\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_EP_DATA,
"NULL recv_req in follow-up packets.\n");
op_error = -FI_ENOMSG;
}
}
@ -550,8 +552,8 @@ static ssize_t _psmx_send2(struct fid_ep *ep, const void *buf, size_t len,
req->ep = ep_priv;
req->cq_flags = FI_SEND | FI_MSG;
if ((ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION)) ||
(flags & FI_INJECT))
if ((flags & PSMX_NO_COMPLETION) ||
(ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION)))
req->no_event = 1;
args[0].u32w0 = PSMX_AM_REQ_SEND | (msg_size == len ? PSMX_AM_EOM : 0);
@ -640,7 +642,7 @@ static ssize_t psmx_inject2(struct fid_ep *ep, const void *buf, size_t len,
/* TODO: optimize it & guarantee buffered */
return _psmx_send2(ep, buf, len, NULL, dest_addr, NULL,
ep_priv->flags | FI_INJECT);
ep_priv->flags | FI_INJECT | PSMX_NO_COMPLETION);
}
struct fi_ops_msg psmx_msg2_ops = {

Просмотреть файл

@ -168,6 +168,8 @@ int psmx_am_rma_handler(psm_am_token_t token, psm_epaddr_t epaddr,
req->write.len = rma_len;
req->write.key = key;
req->write.context = (void *)args[4].u64;
req->write.peer_context = (void *)args[1].u64;
req->write.peer_addr = (void *)epaddr;
req->write.data = has_data ? args[5].u64 : 0;
PSMX_CTXT_TYPE(&req->fi_context) = PSMX_REMOTE_WRITE_CONTEXT;
PSMX_CTXT_USER(&req->fi_context) = mr;
@ -387,7 +389,7 @@ static ssize_t psmx_rma_self(int am_cmd,
psmx_cntr_inc(cntr);
}
no_event = (flags & FI_INJECT) ||
no_event = (flags & PSMX_NO_COMPLETION) ||
(ep->send_cq_event_flag && !(flags & FI_COMPLETION));
if (ep->send_cq && !no_event) {
@ -422,6 +424,22 @@ static ssize_t psmx_rma_self(int am_cmd,
return err;
}
void psmx_am_ack_rma(struct psmx_am_request *req)
{
psm_amarg_t args[8];
if ((req->op & PSMX_AM_OP_MASK) != PSMX_AM_REQ_WRITE_LONG)
return;
args[0].u32w0 = PSMX_AM_REP_WRITE | PSMX_AM_EOM;
args[0].u32w1 = req->error;
args[1].u64 = (uint64_t)(uintptr_t)req->write.peer_context;
psm_am_request_short(req->write.peer_addr,
PSMX_AM_RMA_HANDLER, args, 2, NULL, 0,
PSM_AM_FLAG_NOREPLY, NULL, NULL);
}
int psmx_am_process_rma(struct psmx_fid_domain *domain, struct psmx_am_request *req)
{
int err;
@ -625,6 +643,8 @@ ssize_t _psmx_write(struct fid_ep *ep, const void *buf, size_t len,
psm_mq_req_t psm_req;
uint64_t psm_tag;
size_t idx;
void *psm_context;
int no_event;
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
@ -676,6 +696,9 @@ ssize_t _psmx_write(struct fid_ep *ep, const void *buf, size_t len,
ep_priv, (void *)buf, len, desc,
addr, key, context, flags, data);
no_event = (flags & PSMX_NO_COMPLETION) ||
(ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION));
if (flags & FI_INJECT) {
if (len > PSMX_INJECT_SIZE)
return -FI_EMSGSIZE;
@ -687,23 +710,18 @@ ssize_t _psmx_write(struct fid_ep *ep, const void *buf, size_t len,
memset((void *)req, 0, sizeof(*req));
memcpy((void *)req + sizeof(*req), (void *)buf, len);
buf = (void *)req + sizeof(*req);
req->no_event = 1;
}
else {
req = calloc(1, sizeof(*req));
if (!req)
return -FI_ENOMEM;
if (ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION)) {
PSMX_CTXT_TYPE(&req->fi_context) = PSMX_NOCOMP_WRITE_CONTEXT;
req->no_event = 1;
}
else {
PSMX_CTXT_TYPE(&req->fi_context) = PSMX_WRITE_CONTEXT;
}
PSMX_CTXT_TYPE(&req->fi_context) = no_event ?
PSMX_NOCOMP_WRITE_CONTEXT :
PSMX_WRITE_CONTEXT;
}
req->no_event = no_event;
req->op = PSMX_AM_REQ_WRITE;
req->write.buf = (void *)buf;
req->write.len = len;
@ -731,13 +749,22 @@ ssize_t _psmx_write(struct fid_ep *ep, const void *buf, size_t len,
args[0].u32w0 |= PSMX_AM_DATA;
nargs++;
}
if (flags & FI_COMMIT_COMPLETE) {
args[0].u32w0 |= PSMX_AM_FORCE_ACK;
psm_context = NULL;
}
else {
psm_context = (void *)&req->fi_context;
}
psm_am_request_short((psm_epaddr_t) dest_addr,
PSMX_AM_RMA_HANDLER, args, nargs,
NULL, 0, am_flags | PSM_AM_FLAG_NOREPLY,
NULL, NULL);
psm_mq_isend(ep_priv->domain->psm_mq, (psm_epaddr_t) dest_addr,
0, psm_tag, buf, len, (void *)&req->fi_context, &psm_req);
0, psm_tag, buf, len, psm_context, &psm_req);
return 0;
}
@ -819,7 +846,7 @@ static ssize_t psmx_inject(struct fid_ep *ep, const void *buf, size_t len,
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
return _psmx_write(ep, buf, len, NULL, dest_addr, addr, key,
NULL, ep_priv->flags | FI_INJECT, 0);
NULL, ep_priv->flags | FI_INJECT | PSMX_NO_COMPLETION, 0);
}
static ssize_t psmx_writedata(struct fid_ep *ep, const void *buf, size_t len, void *desc,

Просмотреть файл

@ -72,8 +72,9 @@ ssize_t _psmx_tagged_recv(struct fid_ep *ep, void *buf, size_t len,
}
if (tag & ep_priv->domain->reserved_tag_bits) {
PSMX_WARN("%s: warning: using reserved tag bits."
"tag=%lx. reserved_bits=%lx.\n", __func__, tag,
FI_WARN(&psmx_prov, FI_LOG_EP_DATA,
"using reserved tag bits."
"tag=%lx. reserved_bits=%lx.\n", tag,
ep_priv->domain->reserved_tag_bits);
}
@ -258,7 +259,7 @@ static ssize_t psmx_tagged_recvmsg(struct fid_ep *ep, const struct fi_msg_tagged
msg->context, flags);
}
static ssize_t psmx_tagged_recv_no_flag(struct fid_ep *ep, void *buf,
static ssize_t psmx_tagged_recv_no_flag(struct fid_ep *ep, void *buf,
size_t len, void *desc, fi_addr_t src_addr,
uint64_t tag, uint64_t ignore,
void *context)
@ -268,7 +269,7 @@ static ssize_t psmx_tagged_recv_no_flag(struct fid_ep *ep, void *buf,
tag, ignore, context);
}
static ssize_t psmx_tagged_recv_no_event(struct fid_ep *ep, void *buf,
static ssize_t psmx_tagged_recv_no_event(struct fid_ep *ep, void *buf,
size_t len, void *desc, fi_addr_t src_addr,
uint64_t tag, uint64_t ignore,
void *context)
@ -361,6 +362,8 @@ ssize_t _psmx_tagged_send(struct fid_ep *ep, const void *buf, size_t len,
struct fi_context *fi_context;
int err;
size_t idx;
int no_completion = 0;
struct psmx_cq_event *event;
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
@ -390,8 +393,9 @@ ssize_t _psmx_tagged_send(struct fid_ep *ep, const void *buf, size_t len,
}
if (tag & ep_priv->domain->reserved_tag_bits) {
PSMX_WARN("%s: warning: using reserved tag bits."
"tag=%lx. reserved_bits=%lx.\n", __func__, tag,
FI_WARN(&psmx_prov, FI_LOG_EP_DATA,
"using reserved tag bits."
"tag=%lx. reserved_bits=%lx.\n", tag,
ep_priv->domain->reserved_tag_bits);
}
@ -409,6 +413,10 @@ ssize_t _psmx_tagged_send(struct fid_ep *ep, const void *buf, size_t len,
psm_tag = tag & (~ep_priv->domain->reserved_tag_bits);
if ((flags & PSMX_NO_COMPLETION) ||
(ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION)))
no_completion = 1;
if (flags & FI_INJECT) {
if (len > PSMX_INJECT_SIZE)
return -FI_EMSGSIZE;
@ -422,10 +430,24 @@ ssize_t _psmx_tagged_send(struct fid_ep *ep, const void *buf, size_t len,
if (ep_priv->send_cntr)
psmx_cntr_inc(ep_priv->send_cntr);
if (ep_priv->send_cq && !no_completion) {
event = psmx_cq_create_event(
ep_priv->send_cq,
context, (void *)buf, flags, len,
0 /* data */, psm_tag,
0 /* olen */,
0 /* err */);
if (event)
psmx_cq_enqueue_event(ep_priv->send_cq, event);
else
return -FI_ENOMEM;
}
return 0;
}
if (ep_priv->send_cq_event_flag && !(flags & FI_COMPLETION) && !context) {
if (no_completion && !context) {
fi_context = &ep_priv->nocomp_send_context;
}
else {
@ -810,7 +832,7 @@ static ssize_t psmx_tagged_inject(struct fid_ep *ep, const void *buf, size_t len
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
return _psmx_tagged_send(ep, buf, len, NULL, dest_addr, tag, NULL,
ep_priv->flags | FI_INJECT);
ep_priv->flags | FI_INJECT | PSMX_NO_COMPLETION);
}
static ssize_t psmx_tagged_search(struct fid_ep *ep, uint64_t *tag, uint64_t ignore,
@ -825,8 +847,9 @@ static ssize_t psmx_tagged_search(struct fid_ep *ep, uint64_t *tag, uint64_t ign
ep_priv = container_of(ep, struct psmx_fid_ep, ep);
if ((*tag) & ep_priv->domain->reserved_tag_bits) {
PSMX_WARN("%s: warning: using reserved tag bits."
"tag=%lx. reserved_bits=%lx.\n", __func__, *tag,
FI_WARN(&psmx_prov, FI_LOG_EP_DATA,
"using reserved tag bits."
"tag=%lx. reserved_bits=%lx.\n", *tag,
ep_priv->domain->reserved_tag_bits);
}

Просмотреть файл

@ -50,10 +50,11 @@ static void psmx_string_to_uuid(const char *s, psm_uuid_t uuid)
&uuid[10], &uuid[11], &uuid[12], &uuid[13], &uuid[14], &uuid[15]);
if (n != 16) {
PSMX_WARN("%s: wrong uuid format: %s\n", __func__, s);
PSMX_WARN("%s: correct uuid format is: "
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n",
__func__);
FI_WARN(&psmx_prov, FI_LOG_CORE,
"wrong uuid format: %s\n", s);
FI_WARN(&psmx_prov, FI_LOG_CORE,
"correct uuid format is: "
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n");
}
}
@ -105,7 +106,8 @@ void *psmx_name_server(void *args)
n = getaddrinfo(NULL, service, &hints, &res);
if (n < 0) {
PSMX_DEBUG("port %d: %s\n", port, gai_strerror(n));
FI_INFO(&psmx_prov, FI_LOG_CORE,
"port %d: %s\n", port, gai_strerror(n));
free(service);
return NULL;
}
@ -126,7 +128,8 @@ void *psmx_name_server(void *args)
free(service);
if (listenfd < 0) {
PSMX_DEBUG("couldn't listen to port %d. try set OFI_PSM_UUID to a different value?\n", port);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"couldn't listen to port %d. try set OFI_PSM_UUID to a different value?\n", port);
return NULL;
}
@ -136,10 +139,11 @@ void *psmx_name_server(void *args)
connfd = accept(listenfd, NULL, 0);
if (connfd >= 0) {
if (fabric->active_domain) {
ret = write(connfd, &fabric->active_domain->psm_epid, sizeof(psm_epid_t));
ret = write(connfd, &fabric->active_domain->psm_epid,
sizeof(psm_epid_t));
if (ret != sizeof(psm_epid_t))
PSMX_WARN("%s: error sending address info to the client\n",
__func__);
FI_WARN(&psmx_prov, FI_LOG_CORE,
"error sending address info to the client\n");
}
close(connfd);
}
@ -171,7 +175,8 @@ void *psmx_resolve_name(const char *servername, int port)
n = getaddrinfo(servername, service, &hints, &res);
if (n < 0) {
PSMX_DEBUG("(%s:%d):%s\n", servername, port, gai_strerror(n));
FI_INFO(&psmx_prov, FI_LOG_CORE,
"(%s:%d):%s\n", servername, port, gai_strerror(n));
free(service);
return NULL;
}
@ -190,7 +195,8 @@ void *psmx_resolve_name(const char *servername, int port)
free(service);
if (sockfd < 0) {
PSMX_DEBUG("couldn't connect to %s:%d\n", servername, port);
FI_INFO(&psmx_prov, FI_LOG_CORE,
"couldn't connect to %s:%d\n", servername, port);
return NULL;
}

Просмотреть файл

@ -86,7 +86,8 @@ static void psmx_wait_start_progress(struct psmx_fid_domain *domain)
pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
err = pthread_create(&psmx_wait_thread, &attr, psmx_wait_progress, (void *)domain);
if (err)
PSMX_WARN("%s: cannot create wait progress thread\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_EQ,
"cannot create wait progress thread\n");
pthread_attr_destroy(&attr);
while (!psmx_wait_thread_ready)
;
@ -189,7 +190,8 @@ void psmx_wait_signal(struct fid_wait *wait)
case FI_WAIT_FD:
if (write(wait_priv->fd[1], &c, 1) != 1)
PSMX_WARN("%s: error signaling wait object\n", __func__);
FI_WARN(&psmx_prov, FI_LOG_EQ,
"error signaling wait object\n");
break;
case FI_WAIT_MUTEX_COND:
@ -277,9 +279,10 @@ int psmx_wait_open(struct fid_fabric *fabric, struct fi_wait_attr *attr,
break;
default:
PSMX_DEBUG("attr->wait_obj=%d, supported=%d,%d,%d\n",
attr->wait_obj, FI_WAIT_UNSPEC,
FI_WAIT_FD, FI_WAIT_MUTEX_COND);
FI_INFO(&psmx_prov, FI_LOG_EQ,
"attr->wait_obj=%d, supported=%d,%d,%d\n",
attr->wait_obj, FI_WAIT_UNSPEC,
FI_WAIT_FD, FI_WAIT_MUTEX_COND);
return -FI_EINVAL;
}
}

Просмотреть файл

@ -98,17 +98,16 @@
FI_DIRECTED_RECV | FI_MULTI_RECV | \
FI_SOURCE | FI_READ | FI_WRITE | FI_RECV | FI_SEND | \
FI_REMOTE_READ | FI_REMOTE_WRITE | \
FI_COMPLETION | FI_REMOTE_SIGNAL | \
FI_MORE | FI_CANCEL | FI_FENCE | FI_REMOTE_COMPLETE)
FI_COMPLETION | \
FI_MORE | FI_CANCEL | FI_FENCE)
#define SOCK_EP_MSG_CAP SOCK_EP_RDM_CAP
#define SOCK_EP_DGRAM_CAP (FI_MSG | FI_TAGGED | FI_DYNAMIC_MR | \
FI_NAMED_RX_CTX | FI_DIRECTED_RECV | \
FI_MULTI_RECV | FI_SOURCE | FI_RECV | FI_SEND | \
FI_COMPLETION | FI_REMOTE_SIGNAL | \
FI_MORE | FI_CANCEL | FI_REMOTE_COMPLETE | \
FI_FENCE)
FI_COMPLETION | \
FI_MORE | FI_CANCEL | FI_FENCE)
#define SOCK_EP_MSG_ORDER (FI_ORDER_RAR | FI_ORDER_RAW | FI_ORDER_RAS| \
FI_ORDER_WAR | FI_ORDER_WAW | FI_ORDER_WAS | \
@ -117,7 +116,7 @@
#define SOCK_MODE (0)
#define SOCK_NO_COMPLETION (1ULL << 60)
#define SOCK_COMM_BUF_SZ (SOCK_EP_MAX_MSG_SZ)
#define SOCK_COMM_BUF_SZ (1<<20)
#define SOCK_COMM_THRESHOLD (128 * 1024)
#define SOCK_MAJOR_VERSION 1
@ -335,6 +334,12 @@ struct sock_eq_entry {
char event[0];
};
struct sock_eq_err_data_entry {
struct dlist_entry entry;
int do_free;
char err_data[];
};
struct sock_eq {
struct fid_eq eq;
struct fi_eq_attr attr;
@ -342,6 +347,7 @@ struct sock_eq {
struct dlistfd_head list;
struct dlistfd_head err_list;
struct dlist_entry err_data_list;
fastlock_t lock;
struct fid_wait *waitset;
@ -541,7 +547,6 @@ struct sock_tx_ctx {
struct dlist_entry pe_entry_list;
struct dlist_entry ep_list;
fastlock_t lock;
struct fi_tx_attr attr;
};
@ -737,6 +742,8 @@ struct sock_cm_msg_list_entry {
uint64_t timestamp_ms;
struct sockaddr_in addr;
struct dlist_entry entry;
fid_t fid;
struct sock_eq *eq;
char msg[0];
};
@ -847,7 +854,8 @@ int sock_eq_open(struct fid_fabric *fabric, struct fi_eq_attr *attr,
ssize_t sock_eq_report_event(struct sock_eq *sock_eq, uint32_t event,
const void *buf, size_t len, uint64_t flags);
ssize_t sock_eq_report_error(struct sock_eq *sock_eq, fid_t fid, void *context,
int err, int prov_errno, void *err_data);
uint64_t data, int err, int prov_errno,
void *err_data, size_t err_data_size);
int sock_eq_openwait(struct sock_eq *eq, const char *service);
int sock_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
@ -857,14 +865,6 @@ int sock_cntr_err_inc(struct sock_cntr *cntr);
int sock_cntr_progress(struct sock_cntr *cntr);
int sock_eq_open(struct fid_fabric *fabric, struct fi_eq_attr *attr,
struct fid_eq **eq, void *context);
ssize_t sock_eq_report_event(struct sock_eq *sock_eq, uint32_t event,
const void *buf, size_t len, uint64_t flags);
ssize_t sock_eq_report_error(struct sock_eq *sock_eq, fid_t fid, void *context,
int err, int prov_errno, void *err_data);
struct sock_mr *sock_mr_verify_key(struct sock_domain *domain, uint16_t key,
void *buf, size_t len, uint64_t access);
struct sock_mr *sock_mr_verify_desc(struct sock_domain *domain, void *desc,

Просмотреть файл

@ -57,6 +57,8 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_DATA, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_DATA, __VA_ARGS__)
static ssize_t sock_ep_tx_atomic(struct fid_ep *ep,
const struct fi_msg_atomic *msg,

Просмотреть файл

@ -49,6 +49,8 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_AV, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_AV, __VA_ARGS__)
fi_addr_t sock_av_lookup_key(struct sock_av *av, int key)
{
@ -146,13 +148,14 @@ static inline void sock_av_report_success(struct sock_av *av, void *context,
&eq_entry, sizeof(eq_entry), flags);
}
static inline void sock_av_report_error(struct sock_av *av, void *context)
static inline void sock_av_report_error(struct sock_av *av,
void *context, int index)
{
if (!av->eq)
return;
sock_eq_report_error(av->eq, &av->av_fid.fid,
context, -FI_EINVAL, -FI_EINVAL, NULL);
sock_eq_report_error(av->eq, &av->av_fid.fid,
context, index, FI_EINVAL, -FI_EINVAL, NULL, 0);
}
static int sock_av_is_valid_address(struct sockaddr_in *addr)
@ -179,7 +182,7 @@ static int sock_check_table_in(struct sock_av *_av, struct sockaddr_in *addr,
if (!sock_av_is_valid_address(&addr[i])) {
if (fi_addr)
fi_addr[i] = FI_ADDR_NOTAVAIL;
sock_av_report_error(_av, context);
sock_av_report_error(_av, context, i);
continue;
}
@ -191,7 +194,7 @@ static int sock_check_table_in(struct sock_av *_av, struct sockaddr_in *addr,
if (idm_set(&_av->addr_idm, _av->key[j], av_addr) < 0) {
if (fi_addr)
fi_addr[i] = FI_ADDR_NOTAVAIL;
sock_av_report_error(_av, context);
sock_av_report_error(_av, context, i);
continue;
}
@ -234,7 +237,7 @@ static int sock_check_table_in(struct sock_av *_av, struct sockaddr_in *addr,
if (!sock_av_is_valid_address(&addr[i])) {
if (fi_addr)
fi_addr[i] = FI_ADDR_NOTAVAIL;
sock_av_report_error(_av, context);
sock_av_report_error(_av, context, i);
continue;
}
@ -248,7 +251,7 @@ static int sock_check_table_in(struct sock_av *_av, struct sockaddr_in *addr,
if (idm_set(&_av->addr_idm, _av->table_hdr->stored, av_addr) < 0) {
if (fi_addr)
fi_addr[i] = FI_ADDR_NOTAVAIL;
sock_av_report_error(_av, context);
sock_av_report_error(_av, context, i);
continue;
}
@ -314,7 +317,7 @@ static int _sock_av_insertsvc(struct fid_av *av, const char *node,
ret = getaddrinfo(node, service, &sock_hints, &result);
if (ret) {
if (_av->eq) {
sock_av_report_error(_av, context);
sock_av_report_error(_av, context, 0);
sock_av_report_success(_av, context, 0, flags);
}
return -ret;
@ -326,14 +329,14 @@ static int _sock_av_insertsvc(struct fid_av *av, const char *node,
return ret;
}
int sock_av_insertsvc(struct fid_av *av, const char *node,
static int sock_av_insertsvc(struct fid_av *av, const char *node,
const char *service, fi_addr_t *fi_addr,
uint64_t flags, void *context)
{
return _sock_av_insertsvc(av, node, service, fi_addr, flags, context, 0);
}
int sock_av_insertsym(struct fid_av *av, const char *node, size_t nodecnt,
static int sock_av_insertsym(struct fid_av *av, const char *node, size_t nodecnt,
const char *service, size_t svccnt, fi_addr_t *fi_addr,
uint64_t flags, void *context)
{

Просмотреть файл

@ -176,7 +176,7 @@ static int sock_cntr_wait(struct fid_cntr *cntr, uint64_t threshold, int timeout
return -ret;
}
int sock_cntr_control(struct fid *fid, int command, void *arg)
static int sock_cntr_control(struct fid *fid, int command, void *arg)
{
int ret = 0;
struct sock_cntr *cntr;
@ -240,7 +240,7 @@ static int sock_cntr_close(struct fid *fid)
return 0;
}
uint64_t sock_cntr_readerr(struct fid_cntr *cntr)
static uint64_t sock_cntr_readerr(struct fid_cntr *cntr)
{
struct sock_cntr *_cntr;
_cntr = container_of(cntr, struct sock_cntr, cntr_fid);

Просмотреть файл

@ -55,6 +55,9 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_DATA, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_DATA, __VA_ARGS__)
static ssize_t sock_comm_send_socket(struct sock_conn *conn, const void *buf, size_t len)
{
ssize_t ret;
@ -123,7 +126,7 @@ ssize_t sock_comm_send(struct sock_conn *conn, const void *buf, size_t len)
return ret;
}
ssize_t sock_comm_recv_socket(struct sock_conn *conn, void *buf, size_t len)
static ssize_t sock_comm_recv_socket(struct sock_conn *conn, void *buf, size_t len)
{
ssize_t ret;
@ -133,11 +136,12 @@ ssize_t sock_comm_recv_socket(struct sock_conn *conn, void *buf, size_t len)
ret = 0;
}
SOCK_LOG_INFO("read from network: %lu\n", ret);
if (ret > 0)
SOCK_LOG_INFO("read from network: %lu\n", ret);
return ret;
}
ssize_t sock_comm_recv_buffer(struct sock_conn *conn)
static ssize_t sock_comm_recv_buffer(struct sock_conn *conn)
{
int ret;
size_t endlen;
@ -199,24 +203,18 @@ ssize_t sock_comm_peek(struct sock_conn *conn, void *buf, size_t len)
int sock_comm_buffer_init(struct sock_conn *conn)
{
int optval;
socklen_t size = SOCK_COMM_BUF_SZ;
socklen_t optlen = sizeof(socklen_t);
optval = 1;
if (setsockopt(conn->sock_fd, IPPROTO_TCP, TCP_NODELAY,
&optval, sizeof optval))
SOCK_LOG_ERROR("setsockopt failed\n");
fd_set_nonblock(conn->sock_fd);
sock_set_sockopts(conn->sock_fd);
rbinit(&conn->inbuf, SOCK_COMM_BUF_SZ);
rbinit(&conn->outbuf, SOCK_COMM_BUF_SZ);
if (setsockopt(conn->sock_fd, SOL_SOCKET, SO_RCVBUF, &size, optlen))
SOCK_LOG_ERROR("setsockopt failed\n");
SOCK_LOG_ERROR("setsockopt SO_RCVBUF failed\n");
if (setsockopt(conn->sock_fd, SOL_SOCKET, SO_SNDBUF, &size, optlen))
SOCK_LOG_ERROR("setsockopt failed\n");
SOCK_LOG_ERROR("setsockopt SO_SNDBUF failed\n");
if (!getsockopt(conn->sock_fd, SOL_SOCKET, SO_RCVBUF, &size, &optlen))
SOCK_LOG_INFO("SO_RCVBUF: %d\n", size);

Просмотреть файл

@ -53,6 +53,9 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_CTRL, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_CTRL, __VA_ARGS__)
int sock_conn_map_init(struct sock_conn_map *map, int init_size)
{
map->table = calloc(init_size, sizeof(*map->table));
@ -157,7 +160,6 @@ int fd_set_nonblock(int fd)
void sock_set_sockopts(int sock)
{
int optval;
optval = 1;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof optval))
SOCK_LOG_ERROR("setsockopt reuseaddr failed\n");
@ -177,7 +179,6 @@ uint16_t sock_conn_map_connect(struct sock_ep *ep,
char use_conn;
struct timeval tv;
socklen_t optlen;
uint64_t flags;
fd_set fds;
conn_fd = socket(AF_INET, SOCK_STREAM, 0);
@ -186,8 +187,6 @@ uint16_t sock_conn_map_connect(struct sock_ep *ep,
return 0;
}
sock_set_sockopts(conn_fd);
SOCK_LOG_INFO("Connecting to: %s:%d\n", inet_ntoa(addr->sin_addr),
ntohs(addr->sin_port));
@ -219,20 +218,19 @@ uint16_t sock_conn_map_connect(struct sock_ep *ep,
}
}
fd_set_nonblock(conn_fd);
flags = fcntl(conn_fd, F_GETFL, 0);
flags &= (~O_NONBLOCK);
if (fcntl(conn_fd, F_SETFL, flags))
SOCK_LOG_ERROR("fcntl failed\n");
ret = send(conn_fd, &((struct sockaddr_in*) ep->src_addr)->sin_port,
sizeof(((struct sockaddr_in*) ep->src_addr)->sin_port), 0);
do {
ret = send(conn_fd,
&((struct sockaddr_in*) ep->src_addr)->sin_port,
sizeof(((struct sockaddr_in*) ep->src_addr)->sin_port), 0);
} while(ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK));
if (ret != sizeof(((struct sockaddr_in*) ep->src_addr)->sin_port)) {
SOCK_LOG_ERROR("Cannot exchange port\n");
goto err;
}
ret = recv(conn_fd, &use_conn, sizeof(use_conn), 0);
do {
ret = recv(conn_fd, &use_conn, sizeof(use_conn), 0);
} while(ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK));
if (ret != sizeof(use_conn)) {
SOCK_LOG_ERROR("Cannot exchange port: %d\n", ret);
goto err;
@ -241,7 +239,6 @@ uint16_t sock_conn_map_connect(struct sock_ep *ep,
SOCK_LOG_INFO("Connect response: %d\n", use_conn);
if (use_conn) {
sock_set_sockopts(conn_fd);
fastlock_acquire(&map->lock);
ret = sock_conn_map_insert(map, addr, ep, conn_fd);
fastlock_release(&map->lock);
@ -320,7 +317,10 @@ static void *_sock_conn_listen(void *arg)
SOCK_LOG_INFO("ACCEPT: %s, %d\n", inet_ntoa(remote.sin_addr),
ntohs(remote.sin_port));
ret = recv(conn_fd, &remote.sin_port, sizeof(remote.sin_port), 0);
do {
ret = recv(conn_fd, &remote.sin_port,
sizeof(remote.sin_port), 0);
} while(ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK));
if (ret != sizeof(remote.sin_port))
SOCK_LOG_ERROR("Cannot exchange port\n");
@ -336,7 +336,9 @@ static void *_sock_conn_listen(void *arg)
}
fastlock_release(&map->lock);
ret = send(conn_fd, &use_conn, sizeof(use_conn), 0);
do {
ret = send(conn_fd, &use_conn, sizeof(use_conn), 0);
} while(ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK));
if (ret != sizeof(use_conn))
SOCK_LOG_ERROR("Cannot exchange port\n");
@ -379,7 +381,8 @@ int sock_conn_listen(struct sock_ep *ep)
((struct sockaddr_in*)ep->src_addr)->sin_port = 0;
}
ret = getaddrinfo(NULL, listener->service, &hints, &s_res);
ret = getaddrinfo(inet_ntoa(((struct sockaddr_in*)ep->src_addr)->sin_addr),
listener->service, &hints, &s_res);
if (ret) {
SOCK_LOG_ERROR("no available AF_INET address, service %s, %s\n",
listener->service, gai_strerror(ret));

Просмотреть файл

@ -48,6 +48,8 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_CQ, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_CQ, __VA_ARGS__)
int sock_cq_progress(struct sock_cq *cq)
{
@ -133,30 +135,6 @@ out:
return ret;
}
static ssize_t _sock_cq_writeerr(struct sock_cq *cq,
struct fi_cq_err_entry *buf, size_t len)
{
ssize_t ret;
fastlock_acquire(&cq->lock);
if (rbavail(&cq->cqerr_rb) < len) {
ret = -FI_ENOSPC;
SOCK_LOG_ERROR("Not enough space in CQ\n");
goto out;
}
rbwrite(&cq->cqerr_rb, buf, len);
rbcommit(&cq->cqerr_rb);
ret = len;
if (cq->signal)
sock_wait_signal(cq->waitset);
out:
fastlock_release(&cq->lock);
return ret;
}
static int sock_cq_report_context(struct sock_cq *cq, fi_addr_t addr,
struct sock_pe_entry *pe_entry)
{
@ -242,7 +220,7 @@ static inline ssize_t sock_cq_rbuf_read(struct sock_cq *cq, void *buf,
return count;
}
ssize_t sock_cq_sreadfrom(struct fid_cq *cq, void *buf, size_t count,
static ssize_t sock_cq_sreadfrom(struct fid_cq *cq, void *buf, size_t count,
fi_addr_t *src_addr, const void *cond, int timeout)
{
int ret = 0;
@ -291,24 +269,24 @@ ssize_t sock_cq_sreadfrom(struct fid_cq *cq, void *buf, size_t count,
return (ret == 0 || ret == -FI_ETIMEDOUT) ? -FI_EAGAIN : ret;
}
ssize_t sock_cq_sread(struct fid_cq *cq, void *buf, size_t len,
static ssize_t sock_cq_sread(struct fid_cq *cq, void *buf, size_t len,
const void *cond, int timeout)
{
return sock_cq_sreadfrom(cq, buf, len, NULL, cond, timeout);
}
ssize_t sock_cq_readfrom(struct fid_cq *cq, void *buf, size_t count,
static ssize_t sock_cq_readfrom(struct fid_cq *cq, void *buf, size_t count,
fi_addr_t *src_addr)
{
return sock_cq_sreadfrom(cq, buf, count, src_addr, NULL, 0);
}
ssize_t sock_cq_read(struct fid_cq *cq, void *buf, size_t count)
static ssize_t sock_cq_read(struct fid_cq *cq, void *buf, size_t count)
{
return sock_cq_readfrom(cq, buf, count, NULL);
}
ssize_t sock_cq_readerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
static ssize_t sock_cq_readerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
uint64_t flags)
{
struct sock_cq *sock_cq;
@ -329,38 +307,15 @@ ssize_t sock_cq_readerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
return ret;
}
ssize_t sock_cq_write(struct fid_cq *cq, const void *buf, size_t len)
{
struct sock_cq *sock_cq;
sock_cq = container_of(cq, struct sock_cq, cq_fid);
if (!(sock_cq->attr.flags & FI_WRITE))
return -FI_EINVAL;
return _sock_cq_write(sock_cq, FI_ADDR_NOTAVAIL, buf, len);
}
ssize_t sock_cq_writeerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
size_t len, uint64_t flags)
{
struct sock_cq *sock_cq;
sock_cq = container_of(cq, struct sock_cq, cq_fid);
if (!(sock_cq->attr.flags & FI_WRITE))
return -FI_EINVAL;
return _sock_cq_writeerr(sock_cq, buf, len);
}
const char * sock_cq_strerror(struct fid_cq *cq, int prov_errno,
static const char * sock_cq_strerror(struct fid_cq *cq, int prov_errno,
const void *err_data, char *buf, size_t len)
{
if (buf && len)
return strncpy(buf, strerror(prov_errno), len);
return strerror(prov_errno);
return strncpy(buf, strerror(-prov_errno), len);
return strerror(-prov_errno);
}
int sock_cq_close(struct fid *fid)
static int sock_cq_close(struct fid *fid)
{
struct sock_cq *cq;
@ -383,15 +338,22 @@ int sock_cq_close(struct fid *fid)
return 0;
}
struct fi_ops_cq sock_cq_ops = {
static int sock_cq_signal(struct fid_cq *cq)
{
struct sock_cq *sock_cq;
sock_cq = container_of(cq, struct sock_cq, cq_fid);
rbfdsignal(&sock_cq->cq_rbfd);
return 0;
}
static struct fi_ops_cq sock_cq_ops = {
.size = sizeof(struct fi_ops_cq),
.read = sock_cq_read,
.readfrom = sock_cq_readfrom,
.readerr = sock_cq_readerr,
.write = sock_cq_write,
.writeerr = sock_cq_writeerr,
.sread = sock_cq_sread,
.sreadfrom = sock_cq_sreadfrom,
.signal = sock_cq_signal,
.strerror = sock_cq_strerror,
};
@ -429,7 +391,7 @@ static int sock_cq_control(struct fid *fid, int command, void *arg)
return ret;
}
struct fi_ops sock_cq_fi_ops = {
static struct fi_ops sock_cq_fi_ops = {
.size = sizeof(struct fi_ops),
.close = sock_cq_close,
.bind = fi_no_bind,

Просмотреть файл

@ -40,6 +40,8 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_CTRL, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_CTRL, __VA_ARGS__)
struct sock_rx_ctx *sock_rx_ctx_alloc(const struct fi_rx_attr *attr, void *context)
{
@ -109,6 +111,7 @@ static struct sock_tx_ctx *sock_tx_context_alloc(const struct fi_tx_attr *attr,
goto err;
}
tx_ctx->attr = *attr;
tx_ctx->attr.op_flags |= FI_TRANSMIT_COMPLETE;
return tx_ctx;
err:
@ -122,11 +125,6 @@ struct sock_tx_ctx *sock_tx_ctx_alloc(const struct fi_tx_attr *attr, void *conte
return sock_tx_context_alloc(attr, context, FI_CLASS_TX_CTX);
}
struct sock_tx_ctx *sock_stx_ctx_alloc(const struct fi_tx_attr *attr, void *context)
{
return sock_tx_context_alloc(attr, context, FI_CLASS_STX_CTX);
}
void sock_tx_ctx_free(struct sock_tx_ctx *tx_ctx)
{
fastlock_destroy(&tx_ctx->rlock);

Просмотреть файл

@ -41,6 +41,9 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_DOMAIN, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_DOMAIN, __VA_ARGS__)
const struct fi_domain_attr sock_domain_attr = {
.name = NULL,
.threading = FI_THREAD_SAFE,
@ -339,7 +342,7 @@ static int sock_reg(struct fid *fid, const void *buf, size_t len,
flags, mr, context);
}
int sock_dom_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
static int sock_dom_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
{
struct sock_domain *dom;
struct sock_eq *eq;
@ -357,7 +360,7 @@ int sock_dom_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
return 0;
}
int sock_endpoint(struct fid_domain *domain, struct fi_info *info,
static int sock_endpoint(struct fid_domain *domain, struct fi_info *info,
struct fid_ep **ep, void *context)
{
switch (info->ep_attr->type) {
@ -372,7 +375,7 @@ int sock_endpoint(struct fid_domain *domain, struct fi_info *info,
}
}
int sock_scalable_ep(struct fid_domain *domain, struct fi_info *info,
static int sock_scalable_ep(struct fid_domain *domain, struct fi_info *info,
struct fid_ep **sep, void *context)
{
switch (info->ep_attr->type) {

Просмотреть файл

@ -41,6 +41,9 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_CTRL, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_CTRL, __VA_ARGS__)
extern struct fi_ops_rma sock_ep_rma;
extern struct fi_ops_msg sock_ep_msg_ops;
extern struct fi_ops_tagged sock_ep_tagged;
@ -56,7 +59,7 @@ extern const struct fi_fabric_attr sock_fabric_attr;
const struct fi_tx_attr sock_stx_attr = {
.caps = SOCK_EP_RDM_CAP,
.op_flags = 0,
.op_flags = FI_TRANSMIT_COMPLETE,
.msg_order = SOCK_EP_MSG_ORDER,
.inject_size = SOCK_EP_MAX_INJECT_SZ,
.size = SOCK_EP_TX_SZ,
@ -322,6 +325,7 @@ static int sock_ctx_control(struct fid *fid, int command, void *arg)
break;
case FI_SETOPSFLAG:
tx_ctx->attr.op_flags = *(uint64_t *) arg;
tx_ctx->attr.op_flags |= FI_TRANSMIT_COMPLETE;
break;
case FI_ENABLE:
ep = container_of(fid, struct fid_ep, fid);
@ -358,6 +362,7 @@ static int sock_ctx_control(struct fid *fid, int command, void *arg)
break;
case FI_SETOPSFLAG:
tx_ctx->attr.op_flags = *(uint64_t *) arg;
tx_ctx->attr.op_flags |= FI_TRANSMIT_COMPLETE;
break;
default:
return -FI_ENOSYS;
@ -565,6 +570,36 @@ static int sock_ep_close(struct fid *fid)
atomic_get(&sock_ep->num_tx_ctx))
return -FI_EBUSY;
if (sock_ep->ep_type == FI_EP_MSG) {
sock_ep->cm.do_listen = 0;
if (write(sock_ep->cm.signal_fds[0], &c, 1) != 1) {
SOCK_LOG_INFO("Failed to signal\n");
}
if (sock_ep->cm.listener_thread &&
pthread_join(sock_ep->cm.listener_thread, NULL)) {
SOCK_LOG_ERROR("pthread join failed (%d)\n", errno);
}
close(sock_ep->cm.signal_fds[0]);
close(sock_ep->cm.signal_fds[1]);
} else {
if (sock_ep->av) {
atomic_dec(&sock_ep->av->ref);
}
}
sock_ep->listener.do_listen = 0;
if (write(sock_ep->listener.signal_fds[0], &c, 1) != 1) {
SOCK_LOG_INFO("Failed to signal\n");
}
if (pthread_join(sock_ep->listener.listener_thread, NULL)) {
SOCK_LOG_ERROR("pthread join failed (%d)\n", errno);
}
close(sock_ep->listener.signal_fds[0]);
close(sock_ep->listener.signal_fds[1]);
fastlock_destroy(&sock_ep->cm.lock);
if (sock_ep->fclass != FI_CLASS_SEP && !sock_ep->tx_shared) {
sock_pe_remove_tx_ctx(sock_ep->tx_array[0]);
sock_tx_ctx_free(sock_ep->tx_array[0]);
@ -583,34 +618,6 @@ static int sock_ep_close(struct fid *fid)
if (sock_ep->dest_addr)
free(sock_ep->dest_addr);
if (sock_ep->ep_type == FI_EP_MSG) {
sock_ep->cm.do_listen = 0;
if (write(sock_ep->cm.signal_fds[0], &c, 1) != 1) {
SOCK_LOG_INFO("Failed to signal\n");
}
if (sock_ep->cm.listener_thread &&
pthread_join(sock_ep->cm.listener_thread, NULL)) {
SOCK_LOG_ERROR("pthread join failed (%d)\n", errno);
}
close(sock_ep->cm.signal_fds[0]);
close(sock_ep->cm.signal_fds[1]);
}
sock_ep->listener.do_listen = 0;
if (write(sock_ep->listener.signal_fds[0], &c, 1) != 1) {
SOCK_LOG_INFO("Failed to signal\n");
}
if (pthread_join(sock_ep->listener.listener_thread, NULL)) {
SOCK_LOG_ERROR("pthread join failed (%d)\n", errno);
}
close(sock_ep->listener.signal_fds[0]);
close(sock_ep->listener.signal_fds[1]);
sock_fabric_remove_service(sock_ep->domain->fab,
atoi(sock_ep->listener.service));
@ -793,6 +800,7 @@ static int sock_ep_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
ep->av = av;
av->cmap = &av->domain->r_cmap;
atomic_inc(&av->ref);
if (ep->tx_ctx &&
ep->tx_ctx->fid.ctx.fid.fclass == FI_CLASS_TX_CTX) {
@ -871,6 +879,7 @@ static int sock_ep_control(struct fid *fid, int command, void *arg)
break;
case FI_SETOPSFLAG:
ep->op_flags = *(uint64_t *) arg;
ep->op_flags |= FI_TRANSMIT_COMPLETE;
break;
case FI_ENABLE:
ep_fid = container_of(fid, struct fid_ep, fid);
@ -1289,9 +1298,6 @@ int sock_alloc_endpoint(struct fid_domain *domain, struct fi_info *info,
sock_ep->fclass = fclass;
*ep = sock_ep;
fastlock_acquire(&sock_dom->lock);
fastlock_release(&sock_dom->lock);
if (info) {
sock_ep->info.caps = info->caps;
sock_ep->info.addr_format = FI_SOCKADDR_IN;
@ -1320,6 +1326,7 @@ int sock_alloc_endpoint(struct fid_domain *domain, struct fi_info *info,
sock_ep->tx_attr.size = sock_ep->tx_attr.size ?
sock_ep->tx_attr.size :
(SOCK_EP_TX_SZ * SOCK_EP_TX_ENTRY_SZ);
sock_ep->op_flags |= FI_TRANSMIT_COMPLETE;
}
if (info->rx_attr) {
@ -1388,6 +1395,7 @@ int sock_alloc_endpoint(struct fid_domain *domain, struct fi_info *info,
if (sock_conn_listen(sock_ep))
goto err;
fastlock_init(&sock_ep->cm.lock);
if (sock_ep->ep_type == FI_EP_MSG) {
dlist_init(&sock_ep->cm.msg_list);
if (socketpair(AF_UNIX, SOCK_STREAM, 0,

Просмотреть файл

@ -55,6 +55,9 @@
#include "sock_util.h"
#include "sock.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_CTRL, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_CTRL, __VA_ARGS__)
const struct fi_ep_attr sock_dgram_ep_attr = {
.type = FI_EP_DGRAM,
.protocol = FI_PROTO_SOCK_TCP,
@ -63,14 +66,13 @@ const struct fi_ep_attr sock_dgram_ep_attr = {
.max_order_war_size = SOCK_EP_MAX_ORDER_WAR_SZ,
.max_order_waw_size = SOCK_EP_MAX_ORDER_WAW_SZ,
.mem_tag_format = SOCK_EP_MEM_TAG_FMT,
.msg_order = SOCK_EP_MSG_ORDER,
.tx_ctx_cnt = SOCK_EP_MAX_TX_CNT,
.rx_ctx_cnt = SOCK_EP_MAX_RX_CNT,
};
const struct fi_tx_attr sock_dgram_tx_attr = {
.caps = SOCK_EP_DGRAM_CAP,
.op_flags = 0,
.op_flags = FI_TRANSMIT_COMPLETE,
.msg_order = SOCK_EP_MSG_ORDER,
.inject_size = SOCK_EP_MAX_INJECT_SZ,
.size = SOCK_EP_TX_SZ,
@ -160,9 +162,6 @@ int sock_dgram_verify_ep_attr(struct fi_ep_attr *ep_attr,
sock_dgram_ep_attr.max_order_waw_size)
return -FI_ENODATA;
if ((ep_attr->msg_order | SOCK_EP_MSG_ORDER) != SOCK_EP_MSG_ORDER)
return -FI_ENODATA;
if ((ep_attr->tx_ctx_cnt > SOCK_EP_MAX_TX_CNT) &&
ep_attr->tx_ctx_cnt != FI_SHARED_CONTEXT)
return -FI_ENODATA;
@ -194,7 +193,7 @@ int sock_dgram_fi_info(void *src_addr, void *dest_addr, struct fi_info *hints,
return 0;
}
int sock_dgram_endpoint(struct fid_domain *domain, struct fi_info *info,
static int sock_dgram_endpoint(struct fid_domain *domain, struct fi_info *info,
struct sock_ep **ep, void *context, size_t fclass)
{
int ret;

Просмотреть файл

@ -57,7 +57,10 @@
#include "sock.h"
#include "sock_util.h"
const struct fi_ep_attr sock_msg_ep_attr = {
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_CTRL, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_CTRL, __VA_ARGS__)
static const struct fi_ep_attr sock_msg_ep_attr = {
.type = FI_EP_MSG,
.protocol = FI_PROTO_SOCK_TCP,
.max_msg_size = SOCK_EP_MAX_MSG_SZ,
@ -65,21 +68,20 @@ const struct fi_ep_attr sock_msg_ep_attr = {
.max_order_war_size = SOCK_EP_MAX_ORDER_WAR_SZ,
.max_order_waw_size = SOCK_EP_MAX_ORDER_WAW_SZ,
.mem_tag_format = SOCK_EP_MEM_TAG_FMT,
.msg_order = SOCK_EP_MSG_ORDER,
.tx_ctx_cnt = SOCK_EP_MAX_TX_CNT,
.rx_ctx_cnt = SOCK_EP_MAX_RX_CNT,
};
const struct fi_tx_attr sock_msg_tx_attr = {
static const struct fi_tx_attr sock_msg_tx_attr = {
.caps = SOCK_EP_MSG_CAP,
.op_flags = 0,
.op_flags = FI_TRANSMIT_COMPLETE,
.msg_order = SOCK_EP_MSG_ORDER,
.inject_size = SOCK_EP_MAX_INJECT_SZ,
.size = SOCK_EP_TX_SZ,
.iov_limit = SOCK_EP_MAX_IOV_LIMIT,
};
const struct fi_rx_attr sock_msg_rx_attr = {
static const struct fi_rx_attr sock_msg_rx_attr = {
.caps = SOCK_EP_MSG_CAP,
.op_flags = 0,
.msg_order = SOCK_EP_MSG_ORDER,
@ -88,7 +90,7 @@ const struct fi_rx_attr sock_msg_rx_attr = {
.iov_limit = SOCK_EP_MAX_IOV_LIMIT,
};
int sock_msg_verify_rx_attr(const struct fi_rx_attr *attr)
static int sock_msg_verify_rx_attr(const struct fi_rx_attr *attr)
{
if (!attr)
return 0;
@ -111,7 +113,7 @@ int sock_msg_verify_rx_attr(const struct fi_rx_attr *attr)
return 0;
}
int sock_msg_verify_tx_attr(const struct fi_tx_attr *attr)
static int sock_msg_verify_tx_attr(const struct fi_tx_attr *attr)
{
if (!attr)
return 0;
@ -162,9 +164,6 @@ int sock_msg_verify_ep_attr(struct fi_ep_attr *ep_attr,
sock_msg_ep_attr.max_order_waw_size)
return -FI_ENODATA;
if ((ep_attr->msg_order | SOCK_EP_MSG_ORDER) != SOCK_EP_MSG_ORDER)
return -FI_ENODATA;
if ((ep_attr->tx_ctx_cnt > SOCK_EP_MAX_TX_CNT) &&
ep_attr->tx_ctx_cnt != FI_SHARED_CONTEXT)
return -FI_ENODATA;
@ -240,7 +239,7 @@ static int sock_ep_cm_getpeer(struct fid_ep *ep, void *addr, size_t *addrlen)
return 0;
}
static int sock_ep_cm_create_socket()
static int sock_ep_cm_create_socket(void)
{
int sock, optval;
sock = socket(AF_INET, SOCK_DGRAM, 0);
@ -256,7 +255,8 @@ static int sock_ep_cm_create_socket()
static int sock_ep_cm_enqueue_msg(struct sock_cm_entry *cm,
const struct sockaddr_in *addr,
void *msg, size_t len)
void *msg, size_t len,
fid_t fid, struct sock_eq *eq)
{
char c = 0;
int ret = 0;
@ -269,6 +269,8 @@ static int sock_ep_cm_enqueue_msg(struct sock_cm_entry *cm,
list_entry->msg_len = len;
memcpy(&list_entry->msg[0], msg, len);
memcpy(&list_entry->addr, addr, sizeof(*addr));
list_entry->fid = fid;
list_entry->eq = eq;
fastlock_acquire(&cm->lock);
dlist_insert_tail(&list_entry->entry, &cm->msg_list);
@ -301,11 +303,36 @@ static int sock_ep_cm_send_msg(struct sock_cm_entry *cm,
return (ret == len) ? 0 : -1;
}
static void sock_ep_cm_release_entry(struct sock_cm_msg_list_entry *msg_entry)
{
struct sock_conn_hdr *msg_hdr;
struct fi_eq_cm_entry cm_entry;
struct sock_ep *sock_ep;
msg_hdr = (struct sock_conn_hdr*)msg_entry->msg;
if (msg_hdr->type == SOCK_CONN_SHUTDOWN) {
memset(&cm_entry, 0, sizeof cm_entry);
cm_entry.fid = msg_entry->fid;
sock_ep = container_of(cm_entry.fid, struct sock_ep, ep.fid);
if (sock_eq_report_event(msg_entry->eq, FI_SHUTDOWN, &cm_entry,
sizeof(cm_entry), 0))
SOCK_LOG_ERROR("Error in writing to EQ\n");
sock_ep->cm.shutdown_received = 1;
sock_ep_disable(&sock_ep->ep);
} else {
if (sock_eq_report_error(msg_entry->eq, msg_entry->fid, NULL,
0, FI_ETIMEDOUT, -FI_ETIMEDOUT, NULL, 0))
SOCK_LOG_ERROR("failed to report error\n");
}
dlist_remove(&msg_entry->entry);
free(msg_entry);
}
static void sock_ep_cm_flush_msg(struct sock_cm_entry *cm)
{
struct dlist_entry *entry, *next_entry;
struct sock_cm_msg_list_entry *msg_entry;
fastlock_acquire(&cm->lock);
for (entry = cm->msg_list.next; entry != &cm->msg_list;) {
msg_entry = container_of(entry,
@ -322,8 +349,7 @@ static void sock_ep_cm_flush_msg(struct sock_cm_entry *cm)
msg_entry->retry++;
if (msg_entry->retry > SOCK_EP_MAX_RETRY) {
dlist_remove(entry);
free(msg_entry);
sock_ep_cm_release_entry(msg_entry);
entry = next_entry;
continue;
}
@ -397,7 +423,6 @@ static void *sock_msg_ep_listener_thread(void *data)
struct sock_ep *ep = (struct sock_ep*)data;
struct sock_conn_response *conn_response;
struct fi_eq_cm_entry *cm_entry;
struct fi_eq_err_entry *cm_err_entry;
struct sockaddr_in from_addr;
socklen_t addr_len;
@ -501,26 +526,11 @@ static void *sock_msg_ep_listener_thread(void *data)
if (ep->is_disabled || ep->cm.shutdown_received)
break;
cm_err_entry = calloc(1, sizeof(*cm_err_entry) + user_data_sz);
if (!cm_err_entry) {
SOCK_LOG_ERROR("cannot allocate memory\n");
goto out;
}
memset(cm_err_entry, 0, sizeof(*cm_err_entry) + user_data_sz);
cm_err_entry->fid = &ep->ep.fid;
cm_err_entry->err = -FI_ECONNREFUSED;
if (user_data_sz > 0)
memcpy(cm_err_entry->err_data,
&conn_response->user_data, user_data_sz);
if (sock_eq_report_event(ep->eq, FI_ECONNREFUSED,
cm_err_entry,
sizeof(*cm_err_entry) +
user_data_sz, 0))
if (sock_eq_report_error(ep->eq, &ep->ep.fid, NULL, 0,
FI_ECONNREFUSED, -FI_ECONNREFUSED,
&conn_response->user_data,
user_data_sz))
SOCK_LOG_ERROR("Error in writing to EQ\n");
free(cm_err_entry);
goto out;
case SOCK_CONN_SHUTDOWN:
@ -533,6 +543,7 @@ static void *sock_msg_ep_listener_thread(void *data)
if (ep->cm.shutdown_received)
break;
sock_ep_disable(&ep->ep);
ep->cm.shutdown_received = 1;
if (sock_eq_report_event(ep->eq, FI_SHUTDOWN, cm_entry,
entry_sz, 0))
@ -588,7 +599,8 @@ static int sock_ep_cm_connect(struct fid_ep *ep, const void *addr,
memcpy(&_ep->cm_addr, addr, sizeof(struct sockaddr_in));
if (sock_ep_cm_enqueue_msg(&_ep->cm, addr, req,
sizeof (*req) + paramlen)) {
sizeof (*req) + paramlen,
&_ep->ep.fid, _eq)) {
ret = -FI_EIO;
goto err;
}
@ -642,7 +654,8 @@ static int sock_ep_cm_accept(struct fid_ep *ep, const void *param, size_t paraml
response->hdr.s_port = htons(atoi(_ep->listener.service));
if (sock_ep_cm_enqueue_msg(&_ep->cm, addr, response,
sizeof (*response) + paramlen)) {
sizeof (*response) + paramlen,
&_ep->ep.fid, _ep->eq)) {
ret = -FI_EIO;
goto out;
}
@ -660,7 +673,7 @@ out:
return ret;
}
int sock_ep_cm_shutdown(struct fid_ep *ep, uint64_t flags)
static int sock_ep_cm_shutdown(struct fid_ep *ep, uint64_t flags)
{
struct sock_conn_response response;
struct sock_ep *_ep;
@ -672,7 +685,7 @@ int sock_ep_cm_shutdown(struct fid_ep *ep, uint64_t flags)
response.hdr.msg_id = _ep->cm.next_msg_id++;
if (sock_ep_cm_enqueue_msg(&_ep->cm, &_ep->cm_addr, &response,
sizeof response)) {
sizeof response, &_ep->ep.fid, _ep->eq)) {
return -FI_EIO;
}
@ -691,7 +704,7 @@ struct fi_ops_cm sock_ep_cm_ops = {
.shutdown = sock_ep_cm_shutdown,
};
int sock_msg_endpoint(struct fid_domain *domain, struct fi_info *info,
static int sock_msg_endpoint(struct fid_domain *domain, struct fi_info *info,
struct sock_ep **ep, void *context, size_t fclass)
{
int ret;
@ -793,6 +806,7 @@ static int sock_pep_fi_close(fid_t fid)
close(pep->cm.signal_fds[0]);
close(pep->cm.signal_fds[1]);
fastlock_destroy(&pep->cm.lock);
free(pep);
return 0;
@ -922,17 +936,6 @@ static void *sock_pep_listener_thread (void *data)
SOCK_LOG_ERROR("Error in writing to EQ\n");
break;
case SOCK_CONN_SHUTDOWN:
SOCK_LOG_INFO("Received SOCK_CONN_SHUTDOWN\n");
entry_sz = sizeof(*cm_entry);
cm_entry->fid = &pep->pep.fid;
if (sock_eq_report_event(pep->eq, FI_SHUTDOWN, cm_entry,
entry_sz, 0))
SOCK_LOG_ERROR("Error in writing to EQ\n");
break;
default:
SOCK_LOG_ERROR("Invalid event: %d\n", conn_req->hdr.type);
goto out;
@ -1053,7 +1056,8 @@ static int sock_pep_reject(struct fid_pep *pep, fi_connreq_t connreq,
req->hdr.msg_id = _pep->cm.next_msg_id++;
if (sock_ep_cm_enqueue_msg(&_pep->cm, addr, req,
sizeof(struct sock_conn_response))) {
sizeof(struct sock_conn_response),
&_pep->pep.fid, _pep->eq)) {
ret = -FI_EIO;
goto out;
}
@ -1146,6 +1150,7 @@ int sock_msg_passive_ep(struct fid_fabric *fabric, struct fi_info *info,
_pep->pep.fid.ops = &sock_pep_fi_ops;
_pep->pep.cm = &sock_pep_cm_ops;
_pep->pep.ops = NULL;
fastlock_init(&_pep->cm.lock);
_pep->sock_fab = container_of(fabric, struct sock_fabric, fab_fid);
*pep = &_pep->pep;

Просмотреть файл

@ -56,6 +56,9 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_CTRL, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_CTRL, __VA_ARGS__)
const struct fi_ep_attr sock_rdm_ep_attr = {
.type = FI_EP_RDM,
.protocol = FI_PROTO_SOCK_TCP,
@ -64,14 +67,13 @@ const struct fi_ep_attr sock_rdm_ep_attr = {
.max_order_war_size = SOCK_EP_MAX_ORDER_WAR_SZ,
.max_order_waw_size = SOCK_EP_MAX_ORDER_WAW_SZ,
.mem_tag_format = SOCK_EP_MEM_TAG_FMT,
.msg_order = SOCK_EP_MSG_ORDER,
.tx_ctx_cnt = SOCK_EP_MAX_TX_CNT,
.rx_ctx_cnt = SOCK_EP_MAX_RX_CNT,
};
const struct fi_tx_attr sock_rdm_tx_attr = {
.caps = SOCK_EP_RDM_CAP,
.op_flags = 0,
.op_flags = FI_TRANSMIT_COMPLETE,
.msg_order = SOCK_EP_MSG_ORDER,
.inject_size = SOCK_EP_MAX_INJECT_SZ,
.size = SOCK_EP_TX_SZ,
@ -192,11 +194,6 @@ int sock_rdm_verify_ep_attr(struct fi_ep_attr *ep_attr,
return -FI_ENODATA;
}
if ((ep_attr->msg_order | SOCK_EP_MSG_ORDER) != SOCK_EP_MSG_ORDER) {
SOCK_LOG_INFO("Unsupported message ordering\n");
return -FI_ENODATA;
}
if ((ep_attr->tx_ctx_cnt > SOCK_EP_MAX_TX_CNT) &&
ep_attr->tx_ctx_cnt != FI_SHARED_CONTEXT)
return -FI_ENODATA;
@ -233,7 +230,7 @@ int sock_rdm_fi_info(void *src_addr, void *dest_addr, struct fi_info *hints,
return 0;
}
int sock_rdm_endpoint(struct fid_domain *domain, struct fi_info *info,
static int sock_rdm_endpoint(struct fid_domain *domain, struct fi_info *info,
struct sock_ep **ep, void *context, size_t fclass)
{
int ret;

Просмотреть файл

@ -47,7 +47,27 @@
#include "sock.h"
#include "sock_util.h"
ssize_t sock_eq_sread(struct fid_eq *eq, uint32_t *event, void *buf, size_t len,
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EQ, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EQ, __VA_ARGS__)
static void sock_eq_clean_err_data_list(struct sock_eq *eq, int free_all)
{
struct dlist_entry *entry, *next_entry;
struct sock_eq_err_data_entry *err_data_entry;
for (entry = eq->err_data_list.next; entry != &eq->err_data_list;) {
next_entry = entry->next;
err_data_entry = container_of(
entry, struct sock_eq_err_data_entry, entry);
if (free_all || err_data_entry->do_free) {
dlist_remove(entry);
free(err_data_entry);
}
entry = next_entry;
}
}
static ssize_t sock_eq_sread(struct fid_eq *eq, uint32_t *event, void *buf, size_t len,
int timeout, uint64_t flags)
{
int ret;
@ -56,6 +76,7 @@ ssize_t sock_eq_sread(struct fid_eq *eq, uint32_t *event, void *buf, size_t len,
struct sock_eq_entry *entry;
sock_eq = container_of(eq, struct sock_eq, eq);
sock_eq_clean_err_data_list(sock_eq, 0);
if (!dlistfd_empty(&sock_eq->err_list)) {
return -FI_EAVAIL;
}
@ -66,6 +87,9 @@ ssize_t sock_eq_sread(struct fid_eq *eq, uint32_t *event, void *buf, size_t len,
return -FI_EAGAIN;
}
ret = dlistfd_wait_avail(&sock_eq->list, timeout);
if (!dlistfd_empty(&sock_eq->err_list)) {
return -FI_EAVAIL;
}
if (ret <= 0)
return (ret == 0 || ret == -FI_ETIMEDOUT) ?
-FI_EAGAIN : ret;
@ -95,19 +119,21 @@ out:
}
ssize_t sock_eq_read(struct fid_eq *eq, uint32_t *event, void *buf, size_t len,
static ssize_t sock_eq_read(struct fid_eq *eq, uint32_t *event, void *buf, size_t len,
uint64_t flags)
{
return sock_eq_sread(eq, event, buf, len, 0, flags);
}
ssize_t sock_eq_readerr(struct fid_eq *eq, struct fi_eq_err_entry *buf,
static ssize_t sock_eq_readerr(struct fid_eq *eq, struct fi_eq_err_entry *buf,
uint64_t flags)
{
int ret;
struct sock_eq *sock_eq;
struct dlist_entry *list;
struct sock_eq_entry *entry;
struct fi_eq_err_entry *err_entry;
struct sock_eq_err_data_entry *err_data_entry;
sock_eq = container_of(eq, struct sock_eq, eq);
fastlock_acquire(&sock_eq->lock);
@ -123,6 +149,14 @@ ssize_t sock_eq_readerr(struct fid_eq *eq, struct fi_eq_err_entry *buf,
memcpy(buf, entry->event, entry->len);
if (!(flags & FI_PEEK)) {
err_entry = (struct fi_eq_err_entry *) entry->event;
if (err_entry->err_data) {
err_data_entry = container_of(
err_entry->err_data, struct sock_eq_err_data_entry,
err_data);
err_data_entry->do_free = 1;
}
dlistfd_remove(list, &sock_eq->err_list);
free(entry);
}
@ -155,10 +189,12 @@ ssize_t sock_eq_report_event(struct sock_eq *sock_eq, uint32_t event,
}
ssize_t sock_eq_report_error(struct sock_eq *sock_eq, fid_t fid, void *context,
int err, int prov_errno, void *err_data)
uint64_t data, int err, int prov_errno,
void *err_data, size_t err_data_size)
{
struct fi_eq_err_entry *err_entry;
struct sock_eq_entry *entry;
struct sock_eq_err_data_entry *err_data_entry;
entry = calloc(1, sizeof(*err_entry) + sizeof(*entry));
if (!entry)
@ -167,13 +203,30 @@ ssize_t sock_eq_report_error(struct sock_eq *sock_eq, fid_t fid, void *context,
err_entry = (struct fi_eq_err_entry *) entry->event;
err_entry->fid = fid;
err_entry->context = context;
err_entry->data = data;
err_entry->err = err;
err_entry->prov_errno = prov_errno;
err_entry->err_data = err_data;
err_entry->err_data_size = err_data_size;
entry->len = sizeof(*err_entry);
if (err_data) {
err_data_entry = (struct sock_eq_err_data_entry*)
calloc(1, sizeof(*err_data_entry) + err_data_size);
if (!err_data_entry) {
free(entry);
return -FI_ENOMEM;
}
err_data_entry->do_free = 0;
memcpy(err_data_entry->err_data, err_data, err_data_size);
err_entry->err_data = err_data_entry->err_data;
dlist_insert_tail(&err_data_entry->entry, &sock_eq->err_data_list);
}
fastlock_acquire(&sock_eq->lock);
dlistfd_insert_tail(&entry->entry, &sock_eq->err_list);
dlistfd_signal(&sock_eq->list);
if (sock_eq->signal)
sock_wait_signal(sock_eq->waitset);
fastlock_release(&sock_eq->lock);
@ -195,12 +248,12 @@ static ssize_t sock_eq_write(struct fid_eq *eq, uint32_t event,
}
const char * sock_eq_strerror(struct fid_eq *eq, int prov_errno,
static const char * sock_eq_strerror(struct fid_eq *eq, int prov_errno,
const void *err_data, char *buf, size_t len)
{
if (buf && len)
return strncpy(buf, strerror(prov_errno), len);
return strerror(prov_errno);
return strncpy(buf, strerror(-prov_errno), len);
return strerror(-prov_errno);
}
static struct fi_ops_eq sock_eq_ops = {
@ -212,11 +265,13 @@ static struct fi_ops_eq sock_eq_ops = {
.strerror = sock_eq_strerror,
};
int sock_eq_fi_close(struct fid *fid)
static int sock_eq_fi_close(struct fid *fid)
{
struct sock_eq *sock_eq;
sock_eq = container_of(fid, struct sock_eq, eq);
sock_eq_clean_err_data_list(sock_eq, 1);
dlistfd_head_free(&sock_eq->list);
dlistfd_head_free(&sock_eq->err_list);
fastlock_destroy(&sock_eq->lock);
@ -229,7 +284,7 @@ int sock_eq_fi_close(struct fid *fid)
return 0;
}
int sock_eq_control(struct fid *fid, int command, void *arg)
static int sock_eq_control(struct fid *fid, int command, void *arg)
{
int ret = 0;
struct sock_eq *eq;
@ -375,6 +430,7 @@ int sock_eq_open(struct fid_fabric *fabric, struct fi_eq_attr *attr,
else
memcpy(&sock_eq->attr, attr, sizeof(struct fi_eq_attr));
dlist_init(&sock_eq->err_data_list);
ret = dlistfd_head_init(&sock_eq->list);
if (ret)
goto err1;

Просмотреть файл

@ -47,6 +47,9 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_FABRIC, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_FABRIC, __VA_ARGS__)
const char sock_fab_name[] = "IP";
const char sock_dom_name[] = "sockets";
const char sock_prov_name[] = "sockets";
@ -289,6 +292,7 @@ static int sock_ep_getinfo(const char *node, const char *service, uint64_t flags
ai.ai_flags |= AI_NUMERICHOST;
if (flags & FI_SOURCE) {
ai.ai_flags |= AI_PASSIVE;
ret = getaddrinfo(node, service, &ai, &rai);
if (ret) {
SOCK_LOG_INFO("getaddrinfo failed!\n");

Просмотреть файл

@ -54,10 +54,12 @@
#include <arpa/inet.h>
#include <limits.h>
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_DATA, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_DATA, __VA_ARGS__)
static ssize_t sock_ep_recvmsg(struct fid_ep *ep, const struct fi_msg *msg,
uint64_t flags)
{

Просмотреть файл

@ -40,8 +40,10 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_CORE, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_CORE, __VA_ARGS__)
int sock_poll_add(struct fid_poll *pollset, struct fid *event_fid,
static int sock_poll_add(struct fid_poll *pollset, struct fid *event_fid,
uint64_t flags)
{
struct sock_poll *poll;
@ -58,7 +60,7 @@ int sock_poll_add(struct fid_poll *pollset, struct fid *event_fid,
return 0;
}
int sock_poll_del(struct fid_poll *pollset, struct fid *event_fid,
static int sock_poll_del(struct fid_poll *pollset, struct fid *event_fid,
uint64_t flags)
{
struct sock_poll *poll;
@ -108,12 +110,12 @@ static int sock_poll_poll(struct fid_poll *pollset, void **context, int count)
case FI_CLASS_CNTR:
cntr = container_of(list_item->fid, struct sock_cntr, cntr_fid);
sock_cntr_progress(cntr);
fastlock_acquire(&cntr->mut);
pthread_mutex_lock(&cntr->mut);
if (atomic_get(&cntr->value) >= atomic_get(&cntr->threshold)) {
*context++ = cntr->cntr_fid.fid.context;
ret_count++;
}
fastlock_release(&cntr->mut);
pthread_mutex_unlock(&cntr->mut);
break;
case FI_CLASS_EQ:

Просмотреть файл

@ -57,6 +57,8 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_DATA, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_DATA, __VA_ARGS__)
#define PE_INDEX(_pe, _e) (_e - &_pe->pe_table[0])
#define SOCK_GET_RX_ID(_addr, _bits) ((_bits) == 0) ? 0 : \
@ -112,7 +114,8 @@ static void sock_pe_release_entry(struct sock_pe *pe,
if (pe_entry->conn->tx_pe_entry == pe_entry)
pe_entry->conn->tx_pe_entry = NULL;
} else {
pe_entry->conn->rx_pe_entry = NULL;
if (pe_entry->conn->rx_pe_entry == pe_entry)
pe_entry->conn->rx_pe_entry = NULL;
}
pe->num_free_entries++;
@ -178,7 +181,7 @@ static void sock_pe_report_tx_completion(struct sock_pe_entry *pe_entry)
pe_entry->comp->eq,
&pe_entry->comp->send_cntr->cntr_fid.fid,
pe_entry->comp->send_cntr->cntr_fid.fid.context,
-FI_ENOSPC, -FI_ENOSPC, NULL);
0, FI_ENOSPC, -FI_ENOSPC, NULL, 0);
}
}
}
@ -206,7 +209,7 @@ static void sock_pe_report_rx_completion(struct sock_pe_entry *pe_entry)
pe_entry->comp->eq,
&pe_entry->comp->recv_cq->cq_fid.fid,
pe_entry->comp->recv_cq->cq_fid.fid.context,
-FI_ENOSPC, -FI_ENOSPC, NULL);
0, FI_ENOSPC, -FI_ENOSPC, NULL, 0);
}
}
}
@ -598,10 +601,6 @@ static int sock_pe_process_rx_read(struct sock_pe *pe, struct sock_rx_ctx *rx_ct
pe_entry->buf = pe_entry->pe.rx.rx_iov[0].iov.addr;
pe_entry->data_len = data_len;
if (pe_entry->flags & FI_REMOTE_SIGNAL) {
sock_pe_report_rx_completion(pe_entry);
}
sock_pe_report_remote_read(rx_ctx, pe_entry);
sock_pe_send_response(pe, rx_ctx, pe_entry, data_len,
SOCK_OP_READ_COMPLETE);
@ -669,8 +668,7 @@ static int sock_pe_process_rx_write(struct sock_pe *pe, struct sock_rx_ctx *rx_c
sock_pe_report_error(pe_entry, rem);
goto out;
} else {
if (pe_entry->flags & FI_REMOTE_SIGNAL ||
pe_entry->flags & FI_REMOTE_CQ_DATA) {
if (pe_entry->flags & FI_REMOTE_CQ_DATA) {
sock_pe_report_rx_completion(pe_entry);
}
}
@ -1087,8 +1085,7 @@ static int sock_pe_process_rx_atomic(struct sock_pe *pe, struct sock_rx_ctx *rx_
pe_entry->buf = pe_entry->pe.rx.rx_iov[0].iov.addr;
pe_entry->data_len = offset;
if (pe_entry->flags & FI_REMOTE_SIGNAL ||
pe_entry->flags & FI_REMOTE_CQ_DATA) {
if (pe_entry->flags & FI_REMOTE_CQ_DATA) {
sock_pe_report_rx_completion(pe_entry);
}
@ -1104,7 +1101,7 @@ err:
return -FI_EINVAL;
}
int sock_pe_progress_buffered_rx(struct sock_rx_ctx *rx_ctx)
static int sock_pe_progress_buffered_rx(struct sock_rx_ctx *rx_ctx)
{
struct dlist_entry *entry;
struct sock_pe_entry pe_entry;
@ -1323,7 +1320,7 @@ static int sock_pe_process_rx_send(struct sock_pe *pe, struct sock_rx_ctx *rx_ct
}
out:
if (pe_entry->msg_hdr.flags & FI_REMOTE_COMPLETE) {
if (pe_entry->msg_hdr.flags & FI_TRANSMIT_COMPLETE) {
sock_pe_send_response(pe, rx_ctx, pe_entry, 0,
SOCK_OP_SEND_COMPLETE);
}
@ -1677,7 +1674,7 @@ static int sock_pe_progress_tx_send(struct sock_pe *pe,
pe_entry->conn->tx_pe_entry = NULL;
SOCK_LOG_INFO("Send complete\n");
if (!(pe_entry->flags & FI_REMOTE_COMPLETE)) {
if (pe_entry->flags & FI_INJECT_COMPLETE) {
sock_pe_report_tx_completion(pe_entry);
pe_entry->is_complete = 1;
}
@ -1968,6 +1965,10 @@ static int sock_pe_new_tx_entry(struct sock_pe *pe, struct sock_tx_ctx *tx_ctx)
msg_hdr->rx_id = 0;
}
if (pe_entry->flags & FI_INJECT_COMPLETE) {
pe_entry->flags &= ~FI_TRANSMIT_COMPLETE;
}
msg_hdr->dest_iov_len = pe_entry->pe.tx.tx_op.dest_iov_len;
msg_hdr->flags = htonll(pe_entry->flags);
pe_entry->total_len = msg_hdr->msg_len;
@ -2006,7 +2007,7 @@ void sock_pe_remove_rx_ctx(struct sock_rx_ctx *rx_ctx)
fastlock_release(&rx_ctx->domain->pe->list_lock);
}
int sock_pe_progress_rx_ep(struct sock_pe *pe, struct sock_ep *ep,
static int sock_pe_progress_rx_ep(struct sock_pe *pe, struct sock_ep *ep,
struct sock_rx_ctx *rx_ctx)
{
struct sock_conn *conn;

Просмотреть файл

@ -54,10 +54,12 @@
#include <arpa/inet.h>
#include <limits.h>
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_DATA, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_DATA, __VA_ARGS__)
static ssize_t sock_ep_rma_readmsg(struct fid_ep *ep,
const struct fi_msg_rma *msg,
uint64_t flags)

Просмотреть файл

@ -46,6 +46,8 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_EP_DATA, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_EP_DATA, __VA_ARGS__)
/* FIXME: pool of rx_entry */
struct sock_rx_entry *sock_rx_new_entry(struct sock_rx_ctx *rx_ctx)

Просмотреть файл

@ -33,22 +33,16 @@
#ifndef _SOCK_UTIL_H_
#define _SOCK_UTIL_H_
#include "fi_log.h"
#define SOCK_ERROR (1)
#define SOCK_WARN (2)
#define SOCK_INFO (3)
#include <rdma/fi_log.h>
extern useconds_t sock_progress_thread_wait;
extern const char sock_fab_name[];
extern const char sock_dom_name[];
extern const char sock_prov_name[];
extern struct fi_provider sock_prov;
#define SOCK_LOG_INFO(...) FI_LOG(SOCK_INFO, sock_prov_name, __VA_ARGS__)
#define SOCK_LOG_WARN(...) FI_WARN(sock_prov_name, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) FI_WARN(sock_prov_name, __VA_ARGS__)
#define _SOCK_LOG_INFO(subsys, ...) FI_INFO(&sock_prov, subsys, __VA_ARGS__);
#define _SOCK_LOG_ERROR(subsys, ...) FI_WARN(&sock_prov, subsys, __VA_ARGS__);
#endif

Просмотреть файл

@ -41,6 +41,9 @@
#include "sock.h"
#include "sock_util.h"
#define SOCK_LOG_INFO(...) _SOCK_LOG_INFO(FI_LOG_CORE, __VA_ARGS__)
#define SOCK_LOG_ERROR(...) _SOCK_LOG_ERROR(FI_LOG_CORE, __VA_ARGS__)
enum {
WAIT_READ_FD = 0,
WAIT_WRITE_FD,

Просмотреть файл

@ -39,19 +39,22 @@
#include <sys/queue.h>
#include <pthread.h>
#include "fi_log.h"
#include <rdma/fi_log.h>
#include "usdf_progress.h"
#include "usd.h"
#define USDF_PROV_NAME "usnic"
#define USDF_MAJOR_VERS 1
#define USDF_MINOR_VERS 0
#define USDF_PROV_VERSION FI_VERSION(USDF_MAJOR_VERS, USDF_MINOR_VERS)
#define USDF_WARN(...) FI_WARN("usnic", __VA_ARGS__)
#define USDF_INFO(...) FI_LOG(3, "usnic", __VA_ARGS__)
#define USDF_DEBUG(...) FI_DEBUG("usnic", __VA_ARGS__)
extern struct fi_provider usdf_ops;
#define USDF_WARN(...) FI_WARN(&usdf_ops, FI_LOG_CORE, __VA_ARGS__ )
#define USDF_INFO(...) FI_INFO(&usdf_ops, FI_LOG_CORE, __VA_ARGS__ )
#define USDF_DEBUG(...) FI_DBG(&usdf_ops, FI_LOG_CORE, __VA_ARGS__ )
#define USDF_HDR_BUF_ENTRY 64
#define USDF_EP_CAP_PIO (1ULL << 63)

Просмотреть файл

@ -157,7 +157,6 @@ usdf_cq_read_common(struct fid_cq *fcq, void *buf, size_t count,
while (entry < last) {
ret = usd_poll_cq(cq->c.hard.cq_cq, &cq->cq_comp);
if (ret == -EAGAIN) {
ret = 0;
break;
}
if (cq->cq_comp.uc_status != 0) {
@ -428,7 +427,7 @@ usdf_cq_post_soft_data(struct usdf_cq_hard *hcq, void *context, size_t len)
usdf_cq_post_soft(hcq, context, len, FI_CQ_FORMAT_DATA);
}
ssize_t
static ssize_t
usdf_cq_sread_soft(struct fid_cq *cq, void *buf, size_t count, const void *cond,
int timeout)
{
@ -451,7 +450,6 @@ usdf_cq_read_common_soft(struct fid_cq *fcq, void *buf, size_t count,
uint8_t *last;
void *tail;
size_t entry_len;
ssize_t ret;
cq = cq_ftou(fcq);
if (cq->cq_comp.uc_status != 0) {
@ -472,10 +470,10 @@ usdf_cq_read_common_soft(struct fid_cq *fcq, void *buf, size_t count,
entry_len = sizeof(struct fi_cq_data_entry);
break;
default:
return 0;
USDF_WARN("unexpected CQ format, internal error\n");
return -FI_EOPNOTSUPP;
}
ret = 0;
entry = buf;
last = entry + (entry_len * count);
tail = cq->c.soft.cq_tail;
@ -495,7 +493,7 @@ usdf_cq_read_common_soft(struct fid_cq *fcq, void *buf, size_t count,
if (entry > (uint8_t *)buf) {
return (entry - (uint8_t *)buf) / entry_len;
} else {
return ret;
return -FI_EAGAIN;
}
}
@ -650,10 +648,9 @@ static struct fi_ops_cq usdf_cq_context_ops = {
.read = usdf_cq_read_context,
.readfrom = usdf_cq_readfrom_context,
.readerr = usdf_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = usdf_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal,
.strerror = usdf_cq_strerror,
};
@ -662,10 +659,9 @@ static struct fi_ops_cq usdf_cq_context_soft_ops = {
.read = usdf_cq_read_context_soft,
.readfrom = usdf_cq_readfrom_context_soft,
.readerr = usdf_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = usdf_cq_sread_soft,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal,
.strerror = usdf_cq_strerror,
};
@ -674,10 +670,9 @@ static struct fi_ops_cq usdf_cq_msg_ops = {
.read = usdf_cq_read_msg,
.readfrom = fi_no_cq_readfrom, /* XXX */
.readerr = usdf_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = usdf_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal,
.strerror = usdf_cq_strerror,
};
@ -686,10 +681,9 @@ static struct fi_ops_cq usdf_cq_msg_soft_ops = {
.read = usdf_cq_read_msg_soft,
.readfrom = fi_no_cq_readfrom, /* XXX */
.readerr = usdf_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = usdf_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal,
.strerror = usdf_cq_strerror,
};
@ -698,10 +692,9 @@ static struct fi_ops_cq usdf_cq_data_ops = {
.read = usdf_cq_read_data,
.readfrom = fi_no_cq_readfrom, /* XXX */
.readerr = usdf_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = usdf_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal,
.strerror = usdf_cq_strerror,
};
@ -710,10 +703,9 @@ static struct fi_ops_cq usdf_cq_data_soft_ops = {
.read = usdf_cq_read_data_soft,
.readfrom = fi_no_cq_readfrom, /* XXX */
.readerr = usdf_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = usdf_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal,
.strerror = usdf_cq_strerror,
};

Просмотреть файл

@ -220,19 +220,10 @@ fail:
return ret;
}
/*
* release queue resources
*/
void
usdf_ep_rdm_release_queues(struct usdf_ep *ep)
{
/* XXX */
}
/*
* Allocate any missing queue resources for this endpoint
*/
int
static int
usdf_ep_rdm_get_queues(struct usdf_ep *ep)
{
struct usdf_tx *tx;
@ -556,7 +547,7 @@ usdf_rdm_tx_ctx_close(fid_t fid)
return 0;
}
int
static int
usdf_rx_rdm_port_bind(struct usdf_rx *rx, struct fi_info *info)
{
struct sockaddr_in *sin;

Просмотреть файл

@ -327,7 +327,7 @@ retry:
if (ret < 0) {
return -errno;
} else if (ret == 0) {
return -FI_ETIMEDOUT;
return -FI_EAGAIN;
}
pthread_spin_lock(&eq->eq_lock);

Просмотреть файл

@ -658,6 +658,10 @@ usdf_getinfo(uint32_t version, const char *node, const char *service,
if (__usdf_devinfo == NULL) {
ret = usdf_get_devinfo();
if (ret != 0) {
USDF_WARN("failed to usdf_get_devinfo, ret=%d (%s)\n",
ret, fi_strerror(-ret));
if (ret == -FI_ENODEV)
ret = -FI_ENODATA;
goto fail;
}
}
@ -990,7 +994,7 @@ static void usdf_fini(void)
{
}
static struct fi_provider usdf_ops = {
struct fi_provider usdf_ops = {
.name = USDF_PROV_NAME,
.version = USDF_PROV_VERSION,
.fi_version = FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION),

Просмотреть файл

@ -65,7 +65,7 @@
#include "usdf_cm.h"
#include "usdf_msg.h"
int
static int
usdf_pep_bind(fid_t fid, fid_t bfid, uint64_t flags)
{
struct usdf_pep *pep;
@ -313,7 +313,7 @@ usdf_pep_listen_cb(void *v)
return 0;
}
int
static int
usdf_pep_listen(struct fid_pep *fpep)
{
struct usdf_pep *pep;
@ -341,17 +341,17 @@ usdf_pep_listen(struct fid_pep *fpep)
return 0;
}
ssize_t
static ssize_t
usdf_pep_cancel(fid_t fid, void *context)
{
return -FI_EINVAL;
}
int
static int
usdf_pep_reject(struct fid_pep *pep, fi_connreq_t connreq,
const void *param, size_t paramlen)
{
return 0;
return -FI_ENOSYS;
}
static void
@ -393,7 +393,7 @@ usdf_pep_grow_backlog(struct usdf_pep *pep)
return 0;
}
int
static int
usdf_pep_close(fid_t fid)
{
struct usdf_pep *pep;

Просмотреть файл

@ -57,16 +57,27 @@
#include "fi.h"
#include "fi_enosys.h"
#include "fi_log.h"
#include <rdma/fi_log.h>
#include "prov.h"
#include "fi_log.h"
static int fi_ibv_getinfo(uint32_t version, const char *node, const char *service,
uint64_t flags, struct fi_info *hints, struct fi_info **info);
static int fi_ibv_fabric(struct fi_fabric_attr *attr, struct fid_fabric **fabric,
void *context);
static void fi_ibv_fini(void);
#define VERBS_PROV_NAME "verbs"
#define VERBS_PROV_VERS FI_VERSION(1,0)
#define VERBS_WARN(...) FI_WARN(VERBS_PROV_NAME, __VA_ARGS__)
#define VERBS_INFO(...) FI_LOG(2, VERBS_PROV_NAME, __VA_ARGS__)
#define VERBS_DEBUG(...) FI_DEBUG(VERBS_PROV_NAME, __VA_ARGS__)
static struct fi_provider fi_ibv_prov = {
.name = VERBS_PROV_NAME,
.version = VERBS_PROV_VERS,
.fi_version = FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION),
.getinfo = fi_ibv_getinfo,
.fabric = fi_ibv_fabric,
.cleanup = fi_ibv_fini
};
#define VERBS_MSG_SIZE (1ULL << 31)
#define VERBS_IB_PREFIX "IB-0x"
@ -75,9 +86,11 @@
#define VERBS_CM_DATA_SIZE 56
#define VERBS_CAPS (FI_MSG | FI_RMA | FI_ATOMICS | FI_READ | FI_WRITE | \
FI_SEND | FI_RECV | FI_REMOTE_READ | FI_REMOTE_WRITE | \
FI_REMOTE_SIGNAL)
FI_SEND | FI_RECV | FI_REMOTE_READ | FI_REMOTE_WRITE)
#define VERBS_MODE (FI_LOCAL_MR | FI_PROV_MR_ATTR)
#define VERBS_TX_OP_FLAGS (FI_INJECT | FI_COMPLETION | FI_TRANSMIT_COMPLETE)
#define VERBS_TX_MODE VERBS_MODE
#define VERBS_RX_MODE (FI_LOCAL_MR | FI_PROV_MR_ATTR | FI_RX_CQ_DATA)
#define VERBS_MSG_ORDER (FI_ORDER_RAR | FI_ORDER_RAW | FI_ORDER_RAS | \
FI_ORDER_WAW | FI_ORDER_WAS | FI_ORDER_SAW | FI_ORDER_SAS )
@ -128,6 +141,8 @@ struct fi_ibv_msg_ep {
struct fi_ibv_eq *eq;
struct fi_ibv_cq *rcq;
struct fi_ibv_cq *scq;
uint64_t tx_op_flags;
uint64_t ep_flags;
uint32_t inline_size;
};
@ -162,14 +177,13 @@ const struct fi_ep_attr verbs_ep_attr = {
.max_order_war_size = 0,
.max_order_waw_size = VERBS_MSG_SIZE,
.mem_tag_format = 0,
.msg_order = VERBS_MSG_ORDER,
.tx_ctx_cnt = 1,
.rx_ctx_cnt = 1,
};
const struct fi_rx_attr verbs_rx_attr = {
.caps = VERBS_CAPS,
.mode = VERBS_MODE,
.mode = VERBS_RX_MODE,
.msg_order = VERBS_MSG_ORDER,
.total_buffered_recv = 0,
.size = 256,
@ -178,7 +192,8 @@ const struct fi_rx_attr verbs_rx_attr = {
const struct fi_tx_attr verbs_tx_attr = {
.caps = VERBS_CAPS,
.mode = VERBS_MODE,
.mode = VERBS_TX_MODE,
.op_flags = 0,
.msg_order = VERBS_MSG_ORDER,
.inject_size = 0,
.size = 256,
@ -202,24 +217,25 @@ static int fi_ibv_sockaddr_len(struct sockaddr *addr)
}
}
static int fi_ibv_check_fabric_attr(struct fi_fabric_attr *attr)
static int fi_ibv_check_fabric_attr(const struct fi_fabric_attr *attr)
{
if (attr->name && !(!strcmp(attr->name, VERBS_ANY_FABRIC) ||
!strncmp(attr->name, VERBS_IB_PREFIX, strlen(VERBS_IB_PREFIX)) ||
!strcmp(attr->name, VERBS_IWARP_FABRIC))) {
VERBS_INFO("Unknown fabric name\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE, "Unknown fabric name\n");
return -FI_ENODATA;
}
if (attr->prov_version > VERBS_PROV_VERS) {
VERBS_INFO("Unsupported provider version\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Unsupported provider version\n");
return -FI_ENODATA;
}
return 0;
}
static int fi_ibv_check_domain_attr(struct fi_domain_attr *attr)
static int fi_ibv_check_domain_attr(const struct fi_domain_attr *attr)
{
switch (attr->threading) {
case FI_THREAD_UNSPEC:
@ -229,7 +245,8 @@ static int fi_ibv_check_domain_attr(struct fi_domain_attr *attr)
case FI_THREAD_COMPLETION:
break;
default:
VERBS_INFO("Invalid threading model\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Invalid threading model\n");
return -FI_ENODATA;
}
@ -239,7 +256,8 @@ static int fi_ibv_check_domain_attr(struct fi_domain_attr *attr)
case FI_PROGRESS_MANUAL:
break;
default:
VERBS_INFO("Given control progress mode not supported\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given control progress mode not supported\n");
return -FI_ENODATA;
}
@ -249,31 +267,35 @@ static int fi_ibv_check_domain_attr(struct fi_domain_attr *attr)
case FI_PROGRESS_MANUAL:
break;
default:
VERBS_INFO("Given data progress mode not supported!\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given data progress mode not supported!\n");
return -FI_ENODATA;
}
if (attr->mr_key_size > sizeof_field(struct ibv_sge, lkey)) {
VERBS_INFO("MR key size too large\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"MR key size too large\n");
return -FI_ENODATA;
}
if (attr->cq_data_size > sizeof_field(struct ibv_send_wr, imm_data)) {
VERBS_INFO("CQ data size too large\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"CQ data size too large\n");
return -FI_ENODATA;
}
return 0;
}
static int fi_ibv_check_ep_attr(struct fi_ep_attr *attr)
static int fi_ibv_check_ep_attr(const struct fi_ep_attr *attr)
{
switch (attr->type) {
case FI_EP_UNSPEC:
case FI_EP_MSG:
break;
default:
VERBS_INFO("Unsupported endpoint type\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Unsupported endpoint type\n");
return -FI_ENODATA;
}
@ -284,111 +306,133 @@ static int fi_ibv_check_ep_attr(struct fi_ep_attr *attr)
case FI_PROTO_IB_UD:
break;
default:
VERBS_INFO("Unsupported protocol\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Unsupported protocol\n");
return -FI_ENODATA;
}
if (attr->protocol_version > 1) {
VERBS_INFO("Unsupported protocol version\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Unsupported protocol version\n");
return -FI_ENODATA;
}
if (attr->max_msg_size > verbs_ep_attr.max_msg_size) {
VERBS_INFO("Max message size too large\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Max message size too large\n");
return -FI_ENODATA;
}
if (attr->max_order_raw_size > verbs_ep_attr.max_order_raw_size) {
VERBS_INFO("max_order_raw_size exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"max_order_raw_size exceeds supported size\n");
return -FI_ENODATA;
}
if (attr->max_order_war_size) {
VERBS_INFO("max_order_war_size exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"max_order_war_size exceeds supported size\n");
return -FI_ENODATA;
}
if (attr->max_order_waw_size > verbs_ep_attr.max_order_waw_size) {
VERBS_INFO("max_order_waw_size exceeds supported size\n");
return -FI_ENODATA;
}
if (attr->msg_order & ~(verbs_ep_attr.msg_order)) {
VERBS_INFO("Given msg ordering not supported\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"max_order_waw_size exceeds supported size\n");
return -FI_ENODATA;
}
if (attr->tx_ctx_cnt > verbs_ep_attr.tx_ctx_cnt) {
VERBS_INFO("tx_ctx_cnt exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"tx_ctx_cnt exceeds supported size\n");
return -FI_ENODATA;
}
if (attr->rx_ctx_cnt > verbs_ep_attr.rx_ctx_cnt) {
VERBS_INFO("rx_ctx_cnt exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"rx_ctx_cnt exceeds supported size\n");
return -FI_ENODATA;
}
return 0;
}
static int fi_ibv_check_rx_attr(struct fi_rx_attr *attr, struct fi_info *info)
static int fi_ibv_check_rx_attr(const struct fi_rx_attr *attr, const struct fi_info *info)
{
uint64_t compare_mode, check_mode;
if (attr->caps & ~(verbs_rx_attr.caps)) {
VERBS_INFO("Given rx_attr->caps not supported\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given rx_attr->caps not supported\n");
return -FI_ENODATA;
}
if (((attr->mode ? attr->mode : info->mode) &
verbs_rx_attr.mode) != verbs_rx_attr.mode) {
VERBS_INFO("Given rx_attr->mode not supported\n");
compare_mode = attr->mode ? attr->mode : info->mode;
check_mode = info->domain_attr && info->domain_attr->cq_data_size ?
verbs_rx_attr.mode : VERBS_MODE;
if ((compare_mode & check_mode) != check_mode) {
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given rx_attr->mode not supported\n");
return -FI_ENODATA;
}
if (attr->msg_order & ~(verbs_rx_attr.msg_order)) {
VERBS_INFO("Given rx_attr->msg_order not supported\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given rx_attr->msg_order not supported\n");
return -FI_ENODATA;
}
if (attr->total_buffered_recv > verbs_rx_attr.total_buffered_recv) {
VERBS_INFO("Given rx_attr->total_buffered_recv exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given rx_attr->total_buffered_recv exceeds supported size\n");
return -FI_ENODATA;
}
return 0;
}
static int fi_ibv_check_tx_attr(struct fi_tx_attr *attr, struct fi_info *info)
static int fi_ibv_check_tx_attr(const struct fi_tx_attr *attr, const struct fi_info *info)
{
if (attr->caps & ~(verbs_tx_attr.caps)) {
VERBS_INFO("Given tx_attr->caps not supported\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given tx_attr->caps not supported\n");
return -FI_ENODATA;
}
if (((attr->mode ? attr->mode : info->mode) &
verbs_tx_attr.mode) != verbs_tx_attr.mode) {
VERBS_INFO("Given tx_attr->mode not supported\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given tx_attr->mode not supported\n");
return -FI_ENODATA;
}
if (attr->op_flags & ~(VERBS_TX_OP_FLAGS)) {
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given tx_attr->op_flags not supported\n");
return -FI_ENODATA;
}
if (attr->msg_order & ~(verbs_tx_attr.msg_order)) {
VERBS_INFO("Given tx_attr->msg_order not supported\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Given tx_attr->msg_order not supported\n");
return -FI_ENODATA;
}
return 0;
}
static int fi_ibv_check_info(struct fi_info *info)
static int fi_ibv_check_info(const struct fi_info *info)
{
int ret;
if (info->caps && (info->caps & ~VERBS_CAPS)) {
VERBS_INFO("Unsupported capabilities\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Unsupported capabilities\n");
return -FI_ENODATA;
}
if ((info->mode & VERBS_MODE) != VERBS_MODE) {
VERBS_INFO("Required mode bits not set\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Required mode bits not set\n");
return -FI_ENODATA;
}
@ -429,29 +473,33 @@ static int fi_ibv_check_dev_limits(struct fi_domain_attr *domain_attr,
struct ibv_device_attr *device_attr)
{
if (domain_attr->cq_cnt > device_attr->max_cq) {
VERBS_INFO("cq_cnt exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"cq_cnt exceeds supported size\n");
return -FI_ENODATA;
}
if (domain_attr->ep_cnt > device_attr->max_qp) {
VERBS_INFO("ep_cnt exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"ep_cnt exceeds supported size\n");
return -FI_ENODATA;
}
if (domain_attr->tx_ctx_cnt > device_attr->max_qp) {
VERBS_INFO("domain_attr: tx_ctx_cnt exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"domain_attr: tx_ctx_cnt exceeds supported size\n");
return -FI_ENODATA;
}
if (domain_attr->rx_ctx_cnt > device_attr->max_qp) {
VERBS_INFO("domain_attr: rx_ctx_cnt exceeds supported size\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"domain_attr: rx_ctx_cnt exceeds supported size\n");
return -FI_ENODATA;
}
return 0;
}
static int fi_ibv_fi_to_rai(struct fi_info *fi, uint64_t flags, struct rdma_addrinfo *rai)
static int fi_ibv_fi_to_rai(const struct fi_info *fi, uint64_t flags, struct rdma_addrinfo *rai)
{
memset(rai, 0, sizeof *rai);
if (flags & FI_SOURCE)
@ -503,7 +551,7 @@ static int fi_ibv_rai_to_fi(struct rdma_addrinfo *rai, struct fi_info *fi)
}
static int fi_ibv_fill_info_attr(struct ibv_context *ctx, struct ibv_qp *qp,
struct fi_info *hints,
const struct fi_info *hints,
struct fi_info *fi)
{
struct ibv_qp_init_attr qp_init_attr;
@ -569,7 +617,7 @@ static int fi_ibv_fill_info_attr(struct ibv_context *ctx, struct ibv_qp *qp,
fi->fabric_attr->name = strdup(VERBS_IWARP_FABRIC);
break;
default:
VERBS_INFO("Unknown transport type");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE, "Unknown transport type");
return -FI_ENODATA;
}
@ -595,12 +643,22 @@ static int fi_ibv_fill_info_attr(struct ibv_context *ctx, struct ibv_qp *qp,
fi->ep_attr->protocol_version = 1;
fi->ep_attr->max_msg_size = port_attr.max_msg_sz;
if (hints && hints->tx_attr) {
if ((ctx->device->transport_type == IBV_TRANSPORT_IWARP) &&
(hints->tx_attr->op_flags & FI_TRANSMIT_COMPLETE)) {
return -FI_ENODATA;
}
fi->tx_attr->op_flags = hints->tx_attr->op_flags;
} else {
fi->tx_attr->op_flags = 0;
}
return 0;
}
static int
fi_ibv_create_ep(const char *node, const char *service,
uint64_t flags, struct fi_info *hints,
uint64_t flags, const struct fi_info *hints,
struct rdma_addrinfo **rai, struct rdma_cm_id **id)
{
struct rdma_addrinfo rai_hints, *_rai;
@ -632,9 +690,9 @@ fi_ibv_create_ep(const char *node, const char *service,
if (ret) {
ret = -errno;
if (ret == -ENOENT) {
FI_LOG(1, "verbs",
"rdma_create_ep()-->ENOENT; likely usnic bug, "
"skipping verbs provider.\n");
FI_WARN(&fi_ibv_prov, FI_LOG_CORE,
"rdma_create_ep()-->ENOENT; "
"likely usnic bug, skipping verbs provider.\n");
ret = -FI_ENODATA;
}
goto err;
@ -668,7 +726,7 @@ static void fi_ibv_msg_ep_qp_init_attr(struct fi_ibv_msg_ep *ep,
attr->cap.max_recv_sge = atoi(def_recv_sge);
attr->srq = NULL;
attr->qp_type = IBV_QPT_RC;
attr->sq_sig_all = 1;
attr->sq_sig_all = 0;
if (ep) {
attr->cap.max_inline_data = ep->inline_size;
attr->qp_context = ep;
@ -704,7 +762,8 @@ static int fi_ibv_getinfo(uint32_t version, const char *node, const char *servic
ret = rdma_create_qp(id, NULL, &qp_init_attr);
if (ret) {
FI_LOG(3, "verbs", "Could not create queue pair with requested attributes\n");
FI_INFO(&fi_ibv_prov, FI_LOG_CORE,
"Could not create queue pair with requested attributes\n");
ret = -FI_ENODATA;
goto err1;
}
@ -757,7 +816,12 @@ static int fi_ibv_msg_ep_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
switch (bfid->fclass) {
case FI_CLASS_CQ:
if (!(flags & (FI_RECV|FI_SEND))) {
/* Must bind a CQ to either RECV or SEND completions, and
* the FI_COMPLETION flag is only valid when binding the
* FI_SEND CQ. */
if (!(flags & (FI_RECV|FI_SEND))
|| (flags & (FI_SEND|FI_COMPLETION))
== FI_COMPLETION) {
return -EINVAL;
}
if (flags & FI_RECV) {
@ -769,6 +833,10 @@ static int fi_ibv_msg_ep_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
if (ep->scq)
return -EINVAL;
ep->scq = container_of(bfid, struct fi_ibv_cq, cq_fid.fid);
if (flags & FI_COMPLETION)
ep->ep_flags |= FI_COMPLETION;
else
ep->tx_op_flags |= FI_COMPLETION;
}
break;
case FI_CLASS_EQ:
@ -790,6 +858,7 @@ fi_ibv_msg_ep_recvmsg(struct fid_ep *ep, const struct fi_msg *msg, uint64_t flag
struct fi_ibv_msg_ep *_ep;
struct ibv_recv_wr wr, *bad;
struct ibv_sge *sge = NULL;
ssize_t ret;
size_t i;
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
@ -807,7 +876,17 @@ fi_ibv_msg_ep_recvmsg(struct fid_ep *ep, const struct fi_msg *msg, uint64_t flag
wr.sg_list = sge;
wr.num_sge = msg->iov_count;
return -ibv_post_recv(_ep->id->qp, &wr, &bad);
ret = ibv_post_recv(_ep->id->qp, &wr, &bad);
switch (ret) {
case ENOMEM:
return -FI_EAGAIN;
case -1:
/* Deal with non-compliant libibverbs drivers which set errno
* instead of directly returning the error value */
return (errno == ENOMEM) ? -FI_EAGAIN : -errno;
default:
return -ret;
}
}
static ssize_t
@ -844,6 +923,24 @@ fi_ibv_msg_ep_recvv(struct fid_ep *ep, const struct iovec *iov, void **desc,
return fi_ibv_msg_ep_recvmsg(ep, &msg, 0);
}
static inline int
fi_ibv_post_send(struct ibv_qp *qp, struct ibv_send_wr *wr,
struct ibv_send_wr **bad_wr)
{
int ret;
ret = ibv_post_send(qp, wr, bad_wr);
switch (ret) {
case ENOMEM:
return -FI_EAGAIN;
case -1:
/* Deal with non-compliant libibverbs drivers which set errno
* instead of directly returning the error value */
return (errno == ENOMEM) ? -FI_EAGAIN : -errno;
default:
return -ret;
}
}
static ssize_t
fi_ibv_msg_ep_sendmsg(struct fid_ep *ep, const struct fi_msg *msg, uint64_t flags)
{
@ -854,6 +951,7 @@ fi_ibv_msg_ep_sendmsg(struct fid_ep *ep, const struct fi_msg *msg, uint64_t flag
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
wr.num_sge = msg->iov_count;
wr.send_flags = 0;
if (msg->iov_count) {
sge = alloca(sizeof(*sge) * msg->iov_count);
for (len = 0, i = 0; i < msg->iov_count; i++) {
@ -861,17 +959,19 @@ fi_ibv_msg_ep_sendmsg(struct fid_ep *ep, const struct fi_msg *msg, uint64_t flag
sge[i].length = (uint32_t) msg->msg_iov[i].iov_len;
len += sge[i].length;
}
if (!(flags & FI_INJECT)) {
if ((flags & FI_INJECT) || (len <= _ep->inline_size)) {
wr.send_flags |= IBV_SEND_INLINE;
} else {
for (i = 0; i < msg->iov_count; i++) {
sge[i].lkey = (uint32_t)(uintptr_t)(msg->desc[i]);
}
}
wr.sg_list = sge;
wr.send_flags = (flags & FI_INJECT) ? IBV_SEND_INLINE : 0;
} else {
wr.send_flags = 0;
}
if (!(_ep->ep_flags & FI_COMPLETION) ||
(flags & (FI_COMPLETION | FI_TRANSMIT_COMPLETE)))
wr.send_flags |= IBV_SEND_SIGNALED;
wr.wr_id = (uintptr_t) msg->context;
wr.next = NULL;
@ -882,13 +982,14 @@ fi_ibv_msg_ep_sendmsg(struct fid_ep *ep, const struct fi_msg *msg, uint64_t flag
wr.opcode = IBV_WR_SEND;
}
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
fi_ibv_msg_ep_send(struct fid_ep *ep, const void *buf, size_t len,
void *desc, fi_addr_t dest_addr, void *context)
{
struct fi_ibv_msg_ep *_ep;
struct iovec iov;
struct fi_msg msg;
@ -901,13 +1002,15 @@ fi_ibv_msg_ep_send(struct fid_ep *ep, const void *buf, size_t len,
msg.addr = dest_addr;
msg.context = context;
return fi_ibv_msg_ep_sendmsg(ep, &msg, 0);
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
return fi_ibv_msg_ep_sendmsg(ep, &msg, _ep->tx_op_flags);
}
static ssize_t
fi_ibv_msg_ep_senddata(struct fid_ep *ep, const void *buf, size_t len,
void *desc, uint64_t data, fi_addr_t dest_addr, void *context)
{
struct fi_ibv_msg_ep *_ep;
struct iovec iov;
struct fi_msg msg;
@ -921,13 +1024,16 @@ fi_ibv_msg_ep_senddata(struct fid_ep *ep, const void *buf, size_t len,
msg.context = context;
msg.data = data;
return fi_ibv_msg_ep_sendmsg(ep, &msg, FI_REMOTE_CQ_DATA);
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
return fi_ibv_msg_ep_sendmsg(ep, &msg,
FI_REMOTE_CQ_DATA | _ep->tx_op_flags);
}
static ssize_t
fi_ibv_msg_ep_sendv(struct fid_ep *ep, const struct iovec *iov, void **desc,
size_t count, fi_addr_t dest_addr, void *context)
{
struct fi_ibv_msg_ep *_ep;
struct fi_msg msg;
msg.msg_iov = iov;
@ -936,7 +1042,8 @@ fi_ibv_msg_ep_sendv(struct fid_ep *ep, const struct iovec *iov, void **desc,
msg.addr = dest_addr;
msg.context = context;
return fi_ibv_msg_ep_sendmsg(ep, &msg, 0);
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
return fi_ibv_msg_ep_sendmsg(ep, &msg, _ep->tx_op_flags);
}
static struct fi_ops_msg fi_ibv_msg_ep_msg_ops = {
@ -971,11 +1078,15 @@ fi_ibv_msg_ep_rma_write(struct fid_ep *ep, const void *buf, size_t len,
wr.sg_list = &sge;
wr.num_sge = 1;
wr.opcode = IBV_WR_RDMA_WRITE;
wr.send_flags = (len <= _ep->inline_size) ? IBV_SEND_INLINE : 0;
wr.send_flags = 0;
if ((_ep->tx_op_flags & FI_INJECT) || (len <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (_ep->tx_op_flags & FI_COMPLETION)
wr.send_flags |= IBV_SEND_SIGNALED;
wr.wr.rdma.remote_addr = addr;
wr.wr.rdma.rkey = (uint32_t) key;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -986,7 +1097,7 @@ fi_ibv_msg_ep_rma_writev(struct fid_ep *ep, const struct iovec *iov, void **desc
struct fi_ibv_msg_ep *_ep;
struct ibv_send_wr wr, *bad;
struct ibv_sge *sge;
size_t bytes = 0, i;
size_t len, i;
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
sge = alloca(count * sizeof(struct ibv_sge));
@ -999,15 +1110,21 @@ fi_ibv_msg_ep_rma_writev(struct fid_ep *ep, const struct iovec *iov, void **desc
wr.wr.rdma.remote_addr = addr;
wr.wr.rdma.rkey = (uint32_t) key;
for (i = 0; i < count; i++) {
for (len = 0, i = 0; i < count; i++) {
sge[i].addr = (uintptr_t) iov[i].iov_base;
sge[i].length = (uint32_t) iov[i].iov_len;
bytes += iov[i].iov_len;
sge[i].lkey = (uint32_t) (uintptr_t) desc[i];
len += iov[i].iov_len;
if (!(_ep->tx_op_flags & FI_INJECT))
sge[i].lkey = (uint32_t) (uintptr_t) desc[i];
}
wr.send_flags = (bytes <= _ep->inline_size) ? IBV_SEND_INLINE : 0;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
wr.send_flags = 0;
if ((_ep->tx_op_flags & FI_INJECT) || (len <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (_ep->tx_op_flags & FI_COMPLETION)
wr.send_flags |= IBV_SEND_SIGNALED;
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1031,14 +1148,17 @@ fi_ibv_msg_ep_rma_writemsg(struct fid_ep *ep, const struct fi_msg_rma *msg,
sge[i].length = (uint32_t) msg->msg_iov[i].iov_len;
len += sge[i].length;
}
if (!(flags & FI_INJECT)) {
if ((flags & FI_INJECT) || (len <= _ep->inline_size)) {
wr.send_flags |= IBV_SEND_INLINE;
} else {
for (i = 0; i < msg->iov_count; i++) {
sge[i].lkey = (uint32_t)(uintptr_t)(msg->desc[i]);
}
}
wr.send_flags = (flags & FI_INJECT) ? IBV_SEND_INLINE : 0;
}
if (!(_ep->ep_flags & FI_COMPLETION) ||
(flags & (FI_COMPLETION | FI_TRANSMIT_COMPLETE)))
wr.send_flags |= IBV_SEND_SIGNALED;
wr.sg_list = sge;
wr.opcode = IBV_WR_RDMA_WRITE;
@ -1050,7 +1170,7 @@ fi_ibv_msg_ep_rma_writemsg(struct fid_ep *ep, const struct fi_msg_rma *msg,
wr.wr.rdma.remote_addr = msg->rma_iov->addr;
wr.wr.rdma.rkey = (uint32_t) msg->rma_iov->key;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1071,12 +1191,14 @@ fi_ibv_msg_ep_rma_read(struct fid_ep *ep, void *buf, size_t len,
wr.sg_list = &sge;
wr.num_sge = 1;
wr.opcode = IBV_WR_RDMA_READ;
wr.send_flags = 0;
wr.wr.rdma.remote_addr = addr;
wr.wr.rdma.rkey = (uint32_t) key;
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
return -ibv_post_send(_ep->id->qp, &wr, &bad);
wr.send_flags = (_ep->tx_op_flags & FI_COMPLETION)
? IBV_SEND_SIGNALED : 0;
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1095,7 +1217,6 @@ fi_ibv_msg_ep_rma_readv(struct fid_ep *ep, const struct iovec *iov, void **desc,
wr.sg_list = sge;
wr.num_sge = count;
wr.opcode = IBV_WR_RDMA_READ;
wr.send_flags = 0;
wr.wr.rdma.remote_addr = addr;
wr.wr.rdma.rkey = (uint32_t) key;
@ -1106,7 +1227,10 @@ fi_ibv_msg_ep_rma_readv(struct fid_ep *ep, const struct iovec *iov, void **desc,
}
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
return -ibv_post_send(_ep->id->qp, &wr, &bad);
wr.send_flags = (_ep->tx_op_flags & FI_COMPLETION)
? IBV_SEND_SIGNALED : 0;
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1132,13 +1256,18 @@ fi_ibv_msg_ep_rma_readmsg(struct fid_ep *ep, const struct fi_msg_rma *msg,
}
wr.num_sge = msg->iov_count;
wr.opcode = IBV_WR_RDMA_READ;
wr.send_flags = 0;
wr.wr.rdma.remote_addr = msg->rma_iov->addr;
wr.wr.rdma.rkey = (uint32_t) msg->rma_iov->key;
_ep = container_of(ep, struct fi_ibv_msg_ep, ep_fid);
return -ibv_post_send(_ep->id->qp, &wr, &bad);
if (!(_ep->ep_flags & FI_COMPLETION) || (flags & (FI_COMPLETION))) {
wr.send_flags = IBV_SEND_SIGNALED;
} else {
wr.send_flags = 0;
}
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1160,13 +1289,17 @@ fi_ibv_msg_ep_rma_writedata(struct fid_ep *ep, const void *buf, size_t len,
wr.sg_list = &sge;
wr.num_sge = 1;
wr.opcode = IBV_WR_RDMA_WRITE_WITH_IMM;
wr.send_flags = (len <= _ep->inline_size) ? IBV_SEND_INLINE : 0;
wr.send_flags = 0;
if ((_ep->tx_op_flags & FI_INJECT) || (len <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (_ep->tx_op_flags & FI_COMPLETION)
wr.send_flags |= IBV_SEND_SIGNALED;
wr.imm_data = (uint32_t) data;
wr.wr.rdma.remote_addr = addr;
wr.wr.rdma.rkey = (uint32_t) key;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static struct fi_ops_rma fi_ibv_msg_ep_rma_ops = {
@ -1225,10 +1358,14 @@ fi_ibv_msg_ep_atomic_write(struct fid_ep *ep, const void *buf, size_t count,
wr.next = NULL;
wr.sg_list = &sge;
wr.num_sge = 1;
wr.send_flags = (sge.length <= _ep->inline_size) ? IBV_SEND_INLINE : 0;
wr.send_flags |= IBV_SEND_FENCE;
wr.send_flags = IBV_SEND_FENCE;
if ((_ep->tx_op_flags & FI_INJECT)
|| (sizeof(uint64_t) <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (_ep->tx_op_flags & FI_COMPLETION)
wr.send_flags |= IBV_SEND_SIGNALED;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1293,10 +1430,14 @@ fi_ibv_msg_ep_atomic_writemsg(struct fid_ep *ep,
wr.next = NULL;
wr.sg_list = &sge;
wr.num_sge = 1;
wr.send_flags = (flags & FI_INJECT) ? IBV_SEND_INLINE : 0;
wr.send_flags |= IBV_SEND_FENCE;
wr.send_flags = IBV_SEND_FENCE;
if ((_ep->tx_op_flags & FI_INJECT)
|| (sizeof(uint64_t) <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (!(_ep->ep_flags & FI_COMPLETION) || (flags & FI_COMPLETION))
wr.send_flags |= IBV_SEND_SIGNALED;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1353,8 +1494,13 @@ fi_ibv_msg_ep_atomic_readwrite(struct fid_ep *ep, const void *buf, size_t count,
wr.sg_list = &sge;
wr.num_sge = 1;
wr.send_flags = IBV_SEND_FENCE;
if ((_ep->tx_op_flags & FI_INJECT)
|| (sizeof(uint64_t) <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (_ep->tx_op_flags & FI_COMPLETION)
wr.send_flags |= IBV_SEND_SIGNALED;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1428,10 +1574,16 @@ fi_ibv_msg_ep_atomic_readwritemsg(struct fid_ep *ep,
wr.sg_list = &sge;
wr.num_sge = 1;
wr.send_flags = IBV_SEND_FENCE;
if ((_ep->tx_op_flags & FI_INJECT)
|| (sizeof(uint64_t) <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (!(_ep->ep_flags & FI_COMPLETION) ||
(flags & (FI_COMPLETION | FI_TRANSMIT_COMPLETE)))
wr.send_flags |= IBV_SEND_SIGNALED;
if (flags & FI_REMOTE_CQ_DATA)
wr.imm_data = (uint32_t) msg->data;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1482,8 +1634,13 @@ fi_ibv_msg_ep_atomic_compwrite(struct fid_ep *ep, const void *buf, size_t count,
wr.sg_list = &sge;
wr.num_sge = 1;
wr.send_flags = IBV_SEND_FENCE;
if ((_ep->tx_op_flags & FI_INJECT)
|| (sizeof(uint64_t) <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (_ep->tx_op_flags & FI_COMPLETION)
wr.send_flags |= IBV_SEND_SIGNALED;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static ssize_t
@ -1556,10 +1713,16 @@ fi_ibv_msg_ep_atomic_compwritemsg(struct fid_ep *ep,
wr.sg_list = &sge;
wr.num_sge = 1;
wr.send_flags = IBV_SEND_FENCE;
if ((_ep->tx_op_flags & FI_INJECT)
|| (sizeof(uint64_t) <= _ep->inline_size))
wr.send_flags |= IBV_SEND_INLINE;
if (!(_ep->ep_flags & FI_COMPLETION) ||
(flags & (FI_COMPLETION | FI_TRANSMIT_COMPLETE)))
wr.send_flags |= IBV_SEND_SIGNALED;
if (flags & FI_REMOTE_CQ_DATA)
wr.imm_data = (uint32_t) msg->data;
return -ibv_post_send(_ep->id->qp, &wr, &bad);
return -fi_ibv_post_send(_ep->id->qp, &wr, &bad);
}
static int
@ -1913,10 +2076,14 @@ fi_ibv_open_ep(struct fid_domain *domain, struct fi_info *info,
if (info->tx_attr) {
_ep->inline_size = info->tx_attr->inject_size;
_ep->tx_op_flags = info->tx_attr->op_flags;
if (_ep->tx_op_flags & FI_TRANSMIT_COMPLETE)
_ep->tx_op_flags |= FI_COMPLETION;
} else {
fi_read_file(FI_CONF_DIR, "def_inline_data",
def_inline_data, sizeof def_inline_data);
_ep->inline_size = atoi(def_inline_data);
_ep->tx_op_flags = 0;
}
*ep = &_ep->ep_fid;
@ -2228,7 +2395,7 @@ static int fi_ibv_cq_reset(struct fid_cq *cq, const void *cond)
if (!ret)
ibv_ack_cq_events(ibcq, 1);
return -ibv_req_notify_cq(_cq->cq, (_cq->flags & FI_REMOTE_SIGNAL) ? 1:0);
return -ibv_req_notify_cq(_cq->cq, 0);
}
static ssize_t
@ -2415,10 +2582,9 @@ static struct fi_ops_cq fi_ibv_cq_context_ops = {
.read = fi_ibv_cq_read_context,
.readfrom = fi_no_cq_readfrom,
.readerr = fi_ibv_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = fi_ibv_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal, /* TODO: write me */
.strerror = fi_ibv_cq_strerror
};
@ -2427,10 +2593,9 @@ static struct fi_ops_cq fi_ibv_cq_msg_ops = {
.read = fi_ibv_cq_read_msg,
.readfrom = fi_no_cq_readfrom,
.readerr = fi_ibv_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = fi_ibv_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal, /* TODO: write me */
.strerror = fi_ibv_cq_strerror
};
@ -2439,10 +2604,9 @@ static struct fi_ops_cq fi_ibv_cq_data_ops = {
.read = fi_ibv_cq_read_data,
.readfrom = fi_no_cq_readfrom,
.readerr = fi_ibv_cq_readerr,
.write = fi_no_cq_write,
.writeerr = fi_no_cq_writeerr,
.sread = fi_ibv_cq_sread,
.sreadfrom = fi_no_cq_sreadfrom,
.signal = fi_no_cq_signal, /* TODO: write me */
.strerror = fi_ibv_cq_strerror
};
@ -2866,7 +3030,8 @@ static struct fi_ops_fabric fi_ibv_ops_fabric = {
.wait_open = fi_no_wait_open,
};
int fi_ibv_fabric(struct fi_fabric_attr *attr, struct fid_fabric **fabric, void *context)
static int fi_ibv_fabric(struct fi_fabric_attr *attr, struct fid_fabric **fabric,
void *context)
{
struct fi_ibv_fabric *fab;
int ret;
@ -2891,15 +3056,6 @@ static void fi_ibv_fini(void)
{
}
static struct fi_provider fi_ibv_prov = {
.name = VERBS_PROV_NAME,
.version = VERBS_PROV_VERS,
.fi_version = FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION),
.getinfo = fi_ibv_getinfo,
.fabric = fi_ibv_fabric,
.cleanup = fi_ibv_fini
};
VERBS_INI
{
return &fi_ibv_prov;

Просмотреть файл

@ -389,15 +389,6 @@ ssize_t fi_no_cq_readfrom(struct fid_cq *cq, void *buf, size_t count,
{
return -FI_ENOSYS;
}
ssize_t fi_no_cq_write(struct fid_cq *cq, const void *buf, size_t len)
{
return -FI_ENOSYS;
}
ssize_t fi_no_cq_writeerr(struct fid_cq *cq, struct fi_cq_err_entry *buf,
size_t len, uint64_t flags)
{
return -FI_ENOSYS;
}
ssize_t fi_no_cq_sread(struct fid_cq *cq, void *buf, size_t count,
const void *cond, int timeout)
{
@ -408,6 +399,10 @@ ssize_t fi_no_cq_sreadfrom(struct fid_cq *cq, void *buf, size_t count,
{
return -FI_ENOSYS;
}
int fi_no_cq_signal(struct fid_cq *cq)
{
return -FI_ENOSYS;
}
/*
* struct fi_ops_cntr

Просмотреть файл

@ -45,7 +45,7 @@
#include <rdma/fi_errno.h>
#include "fi.h"
#include "prov.h"
#include "fi_log.h"
#include <rdma/fi_log.h>
#ifdef HAVE_LIBDL
#include <dlfcn.h>
@ -63,23 +63,35 @@ static struct fi_prov *prov_head, *prov_tail;
static volatile int init = 0;
static pthread_mutex_t ini_lock = PTHREAD_MUTEX_INITIALIZER;
static char **prov_name_filters = NULL;
static int prov_filter_negated = 0;
static struct fi_filter prov_filter;
/* returns 1 if the provider should be kept, 0 if it should be skipped */
static int filter_provider(struct fi_provider *provider)
struct fi_provider core_prov = {
.name = "core",
.version = 1,
.fi_version = FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION),
};
static int fi_find_name(char **names, const char *name)
{
int i;
if (prov_name_filters != NULL) {
for (i = 0; prov_name_filters[i] != NULL; ++i)
if (strcmp(provider->name, prov_name_filters[i]) == 0)
return prov_filter_negated ? 0 : 1;
return prov_filter_negated ? 1 : 0;
} else {
/* keep by default */
return 1;
for (i = 0; names[i]; i++) {
if (!strcmp(name, names[i]))
return i;
}
return -1;
}
int fi_apply_filter(struct fi_filter *filter, const char *name)
{
if (filter->names) {
if (fi_find_name(filter->names, name) >= 0)
return filter->negated ? 1 : 0;
return filter->negated ? 0 : 1;
}
return 0;
}
static void cleanup_provider(struct fi_provider *provider, void *dlhandle)
@ -95,46 +107,53 @@ static void cleanup_provider(struct fi_provider *provider, void *dlhandle)
static int fi_register_provider(struct fi_provider *provider, void *dlhandle)
{
struct fi_prov_context *ctx;
struct fi_prov *prov;
int ret;
int keep;
if (!provider) {
ret = -FI_EINVAL;
goto cleanup;
}
FI_LOG(2, NULL, "registering provider: %s (%d.%d)\n", provider->name,
FI_MAJOR(provider->version), FI_MINOR(provider->version));
FI_INFO(&core_prov, FI_LOG_CORE,
"registering provider: %s (%d.%d)\n", provider->name,
FI_MAJOR(provider->version), FI_MINOR(provider->version));
if (FI_MAJOR(provider->fi_version) != FI_MAJOR_VERSION ||
FI_MINOR(provider->fi_version) > FI_MINOR_VERSION) {
FI_LOG(2, NULL, "provider has unsupported FI version (provider %d.%d != libfabric %d.%d); ignoring\n",
FI_MAJOR(provider->fi_version),
FI_MINOR(provider->fi_version),
FI_MAJOR_VERSION, FI_MINOR_VERSION);
FI_INFO(&core_prov, FI_LOG_CORE,
"provider has unsupported FI version (provider %d.%d != libfabric %d.%d); ignoring\n",
FI_MAJOR(provider->fi_version),
FI_MINOR(provider->fi_version), FI_MAJOR_VERSION,
FI_MINOR_VERSION);
ret = -FI_ENOSYS;
goto cleanup;
}
keep = filter_provider(provider);
if (!keep) {
FI_LOG(2, NULL,
if (fi_apply_filter(&prov_filter, provider->name)) {
FI_INFO(&core_prov, FI_LOG_CORE,
"\"%s\" filtered by provider include/exclude list, skipping\n",
provider->name);
ret = -FI_ENODEV;
goto cleanup;
}
if (fi_apply_filter(&prov_log_filter, provider->name)) {
ctx = (struct fi_prov_context *) &provider->context;
ctx->disable_logging = 1;
}
prov = fi_getprov(provider->name);
if (prov) {
/* If this provider is older than an already-loaded
* provider of the same name, then discard this one.
*/
if (FI_VERSION_GE(prov->provider->version, provider->version)) {
FI_LOG(2, NULL, "a newer %s provider was already loaded; ignoring this one\n",
provider->name);
FI_INFO(&core_prov, FI_LOG_CORE,
"a newer %s provider was already loaded; ignoring this one\n",
provider->name);
ret = -FI_EALREADY;
goto cleanup;
}
@ -143,8 +162,9 @@ static int fi_register_provider(struct fi_provider *provider, void *dlhandle)
* provider of the same name, so discard the
* already-loaded one.
*/
FI_LOG(2, NULL, "an older %s provider was already loaded; keeping this one and ignoring the older one\n",
provider->name);
FI_INFO(&core_prov, FI_LOG_CORE,
"an older %s provider was already loaded; keeping this one and ignoring the older one\n",
provider->name);
cleanup_provider(prov->provider, prov->dlhandle);
prov->dlhandle = dlhandle;
@ -203,7 +223,7 @@ static char **split_and_alloc(const char *s, const char *delim)
dup = strdup(s);
if (!dup) {
FI_WARN(NULL, "failed to allocate memory\n");
FI_WARN(&core_prov, FI_LOG_CORE, "failed to allocate memory\n");
return NULL;
}
@ -221,7 +241,7 @@ static char **split_and_alloc(const char *s, const char *delim)
/* +1 to leave space for NULL terminating pointer */
arr = calloc(n + 1, sizeof(*arr));
if (!arr) {
FI_WARN(NULL, "failed to allocate memory\n");
FI_WARN(&core_prov, FI_LOG_CORE, "failed to allocate memory\n");
goto cleanup;
}
@ -251,77 +271,57 @@ static void free_string_array(char **s)
free(s);
}
/* parse any initialization-related environment variables */
static void fi_parse_ini_env()
void fi_free_filter(struct fi_filter *filter)
{
const char *raw_prov_filter;
raw_prov_filter = getenv("FI_PROVIDER");
if (raw_prov_filter == NULL)
return;
if (*raw_prov_filter == '^') {
prov_filter_negated = 1;
++raw_prov_filter;
}
prov_name_filters = split_and_alloc(raw_prov_filter, ",");
if (!prov_name_filters) {
FI_WARN(NULL, "unable to parse FI_PROVIDER env var\n");
return;
}
free_string_array(filter->names);
}
static void fi_fini_env()
void fi_create_filter(struct fi_filter *filter, const char *env_name)
{
free_string_array(prov_name_filters);
const char *raw_filter;
memset(filter, 0, sizeof *filter);
raw_filter = getenv(env_name);
if (raw_filter == NULL)
return;
if (*raw_filter == '^') {
filter->negated = 1;
++raw_filter;
}
filter->names = split_and_alloc(raw_filter, ",");
if (!filter->names)
FI_WARN(&core_prov, FI_LOG_CORE,
"unable to parse %s env var\n", env_name);
}
/*
* Initialize the sockets provider last. This will result in it being
* the least preferred provider.
*/
static void fi_ini(void)
{
pthread_mutex_lock(&ini_lock);
if (init)
goto unlock;
fi_log_init();
fi_parse_ini_env();
#ifdef HAVE_LIBDL
struct dirent **liblist = NULL;
static void fi_ini_dir(const char *dir)
{
int n = 0;
char *lib, *provdir;
char *lib;
void *dlhandle;
struct dirent **liblist = NULL;
struct fi_provider* (*inif)(void);
/* If dlopen fails, assume static linking and just return
without error */
dlhandle = dlopen(NULL, RTLD_NOW);
if (dlhandle == NULL) {
goto libdl_done;
}
dlclose(dlhandle);
provdir = PROVDLDIR;
n = scandir(provdir, &liblist, lib_filter, NULL);
n = scandir(dir, &liblist, lib_filter, NULL);
if (n < 0)
goto libdl_done;
while (n--) {
if (asprintf(&lib, "%s/%s", provdir, liblist[n]->d_name) < 0) {
FI_WARN(NULL, "asprintf failed to allocate memory\n");
if (asprintf(&lib, "%s/%s", dir, liblist[n]->d_name) < 0) {
FI_WARN(&core_prov, FI_LOG_CORE,
"asprintf failed to allocate memory\n");
goto libdl_done;
}
FI_DEBUG(NULL, "opening provider lib %s\n", lib);
FI_DBG(&core_prov, FI_LOG_CORE, "opening provider lib %s\n", lib);
dlhandle = dlopen(lib, RTLD_NOW);
free(liblist[n]);
if (dlhandle == NULL) {
FI_WARN(NULL, "dlopen(%s): %s\n", lib, dlerror());
FI_WARN(&core_prov, FI_LOG_CORE,
"dlopen(%s): %s\n", lib, dlerror());
free(lib);
continue;
}
@ -329,7 +329,7 @@ static void fi_ini(void)
inif = dlsym(dlhandle, "fi_prov_ini");
if (inif == NULL) {
FI_WARN(NULL, "dlsym: %s\n", dlerror());
FI_WARN(&core_prov, FI_LOG_CORE, "dlsym: %s\n", dlerror());
dlclose(dlhandle);
} else
fi_register_provider((inif)(), dlhandle);
@ -339,12 +339,49 @@ libdl_done:
while (n-- > 0)
free(liblist[n]);
free(liblist);
}
#endif
static void fi_ini(void)
{
pthread_mutex_lock(&ini_lock);
if (init)
goto unlock;
fi_log_init();
fi_create_filter(&prov_filter, "FI_PROVIDER");
#ifdef HAVE_LIBDL
int n = 0;
char **dirs;
char *provdir;
void *dlhandle;
/* If dlopen fails, assume static linking and just return
without error */
dlhandle = dlopen(NULL, RTLD_NOW);
if (dlhandle == NULL) {
goto libdl_done;
}
dlclose(dlhandle);
provdir = getenv("FI_PROVIDER_PATH");
if (!provdir)
provdir = PROVDLDIR;
dirs = split_and_alloc(provdir, ":");
for (n = 0; dirs[n]; ++n) {
fi_ini_dir(dirs[n]);
}
free_string_array(dirs);
libdl_done:
#endif
fi_register_provider(PSM_INIT, NULL);
fi_register_provider(USNIC_INIT, NULL);
fi_register_provider(VERBS_INIT, NULL);
/* Initialize the sockets provider last. This will result in
it being the least preferred provider. */
fi_register_provider(SOCKETS_INIT, NULL);
init = 1;
@ -363,7 +400,8 @@ static void __attribute__((destructor)) fi_fini(void)
free(prov);
}
fi_fini_env();
fi_free_filter(&prov_filter);
fi_log_fini();
}
static struct fi_prov *fi_getprov(const char *prov_name)
@ -411,7 +449,7 @@ int DEFAULT_SYMVER_PRE(fi_getinfo)(uint32_t version, const char *node, const cha
{
struct fi_prov *prov;
struct fi_info *tail, *cur;
int ret = -FI_ENOSYS;
int ret = -FI_ENODATA;
if (!init)
fi_ini();
@ -428,8 +466,9 @@ int DEFAULT_SYMVER_PRE(fi_getinfo)(uint32_t version, const char *node, const cha
ret = prov->provider->getinfo(version, node, service, flags,
hints, &cur);
if (ret) {
FI_LOG(1, NULL, "fi_getinfo: provider %s returned -%d (%s)\n",
prov->provider->name, -ret, fi_strerror(-ret));
FI_WARN(&core_prov, FI_LOG_CORE,
"fi_getinfo: provider %s returned -%d (%s)\n",
prov->provider->name, -ret, fi_strerror(-ret));
if (ret == -FI_ENODATA) {
continue;
} else {
@ -634,5 +673,3 @@ const char *DEFAULT_SYMVER_PRE(fi_strerror)(int errnum)
return errstr[FI_EOTHER - FI_ERRNO_OFFSET];
}
DEFAULT_SYMVER(fi_strerror_, fi_strerror);

Просмотреть файл

@ -101,8 +101,8 @@ static void fi_tostr_flags(char *buf, uint64_t flags)
IFFLAGSTR(flags, FI_REMOTE_CQ_DATA);
IFFLAGSTR(flags, FI_EVENT);
IFFLAGSTR(flags, FI_REMOTE_SIGNAL);
IFFLAGSTR(flags, FI_REMOTE_COMPLETE);
IFFLAGSTR(flags, FI_INJECT_COMPLETE);
IFFLAGSTR(flags, FI_TRANSMIT_COMPLETE);
IFFLAGSTR(flags, FI_CANCEL);
IFFLAGSTR(flags, FI_MORE);
IFFLAGSTR(flags, FI_PEEK);
@ -220,6 +220,7 @@ static void fi_tostr_mode(char *buf, uint64_t mode)
IFFLAGSTR(mode, FI_LOCAL_MR);
IFFLAGSTR(mode, FI_PROV_MR_ATTR);
IFFLAGSTR(mode, FI_MSG_PREFIX);
IFFLAGSTR(mode, FI_RX_CQ_DATA);
fi_remove_comma(buf);
}
@ -336,10 +337,6 @@ static void fi_tostr_ep_attr(char *buf, const struct fi_ep_attr *attr, const cha
strcatf(buf, "%s%smax_order_waw_size: %zd\n", prefix, TAB, attr->max_order_waw_size);
strcatf(buf, "%s%smem_tag_format: 0x%016llx\n", prefix, TAB, attr->mem_tag_format);
strcatf(buf, "%s%smsg_order: [ ", prefix, TAB);
fi_tostr_order(buf, attr->msg_order);
strcatf(buf, " ]\n");
strcatf(buf, "%s%stx_ctx_cnt: %zd\n", prefix, TAB, attr->tx_ctx_cnt);
strcatf(buf, "%s%srx_ctx_cnt: %zd\n", prefix, TAB, attr->rx_ctx_cnt);
}

Просмотреть файл

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015, Intel Corp., 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
@ -36,71 +37,121 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <rdma/fi_errno.h>
#include "fi.h"
#include "fi_log.h"
#include <rdma/fi_log.h>
/* General implementation note: these functions currently use multiple fprintfs
* in a row, which can render in an ugly fashion for multithreaded code and for
* some mpirun implementations. If this bugs anyone enough then we can convert
* them to snprintf to build up the printout in a single buffer.
*/
int fi_log_level = INT_MIN;
static const char * const log_subsys[] = {
[FI_LOG_CORE] = "core",
[FI_LOG_FABRIC] = "fabric",
[FI_LOG_DOMAIN] = "domain",
[FI_LOG_EP_CTRL] = "ep_ctrl",
[FI_LOG_EP_DATA] = "ep_data",
[FI_LOG_AV] = "av",
[FI_LOG_CQ] = "cq",
[FI_LOG_EQ] = "eq",
[FI_LOG_MR] = "mr",
[FI_LOG_SUBSYS_MAX] = NULL
};
static const char * const log_levels[] = {
[FI_LOG_WARN] = "warn",
[FI_LOG_TRACE] = "trace",
[FI_LOG_INFO] = "info",
[FI_LOG_DEBUG] = "debug",
[FI_LOG_MAX] = NULL
};
enum {
FI_LOG_SUBSYS_OFFSET = FI_LOG_MAX,
FI_LOG_PROV_OFFSET = FI_LOG_SUBSYS_OFFSET + FI_LOG_SUBSYS_MAX,
FI_LOG_LEVEL_MASK = ((1 << FI_LOG_MAX) - 1),
FI_LOG_SUBSYS_MASK = (((1 << FI_LOG_SUBSYS_MAX) - 1) <<
FI_LOG_SUBSYS_OFFSET),
// FI_LOG_PROV_MASK = (((1 << (64 - FI_LOG_PROV_OFFSET)) - 1) <<
// FI_LOG_PROV_OFFSET)
};
#define FI_LOG_TAG(prov, level, subsys) \
(((uint64_t) prov << FI_LOG_PROV_OFFSET) | \
((uint64_t) (1 << (subsys + FI_LOG_SUBSYS_OFFSET))) | \
((uint64_t) (1 << level)))
uint64_t log_mask;
struct fi_filter prov_log_filter;
static int fi_read_value(const char *env_name, const char * const names[])
{
const char *value;
int i;
value = getenv(env_name);
if (!value)
return -1;
for (i = 0; names[i]; i++) {
if (!strcasecmp(value, names[i]))
return i;
}
return 0;
}
void fi_log_init(void)
{
int ret;
struct fi_filter subsys_filter;
int level, i;
if (getenv("FI_LOG_LEVEL") != NULL) {
errno = 0;
ret = strtol(getenv("FI_LOG_LEVEL"), NULL, 10);
if (errno != 0)
fprintf(stderr,
"%s: invalid value specified for FI_LOG_LEVEL (%s)\n",
PACKAGE, strerror(errno));
else
fi_log_level = (int)ret;
level = fi_read_value("FI_LOG_LEVEL", log_levels);
if (level >= 0)
log_mask = ((1 << (level + 1)) - 1);
fi_create_filter(&prov_log_filter, "FI_LOG_PROV");
/* providers are selectively disabled */
fi_create_filter(&subsys_filter, "FI_LOG_SUBSYS");
for (i = 0; i < FI_LOG_SUBSYS_MAX; i++) {
if (!fi_apply_filter(&subsys_filter, log_subsys[i]))
log_mask |= (1 << (i + FI_LOG_SUBSYS_OFFSET));
}
fi_free_filter(&subsys_filter);
}
void fi_warn_impl(const char *prov, const char *fmt, ...)
void fi_log_fini(void)
{
fi_free_filter(&prov_log_filter);
}
int fi_log_enabled(const struct fi_provider *prov, enum fi_log_level level,
enum fi_log_subsys subsys)
{
struct fi_prov_context *ctx;
ctx = (struct fi_prov_context *) &prov->context;
return ((FI_LOG_TAG(ctx->disable_logging, level, subsys) & log_mask) ==
FI_LOG_TAG(ctx->disable_logging, level, subsys));
}
void fi_log(const struct fi_provider *prov, enum fi_log_level level,
enum fi_log_subsys subsys, const char *func, int line,
const char *fmt, ...)
{
char buf[1024];
int size;
va_list vargs;
if (prov != NULL)
fprintf(stderr, "%s:%s: ", PACKAGE, prov);
else
fprintf(stderr, "%s: ", PACKAGE);
size = snprintf(buf, sizeof(buf), "%s:%s:%s:%s():%d<%s> ", PACKAGE,
prov->name, log_subsys[subsys], func, line,
log_levels[level]);
va_start(vargs, fmt);
vfprintf(stderr, fmt, vargs);
va_end(vargs);
}
void fi_log_impl(int level, const char *prov, const char *func, int line,
const char *fmt, ...)
{
va_list vargs;
if (prov != NULL)
fprintf(stderr, "%s:%s:%s():%d<%d> ", PACKAGE, prov,
func, line, level);
else
fprintf(stderr, "%s:%s():%d<%d> ", PACKAGE, func, line, level);
va_start(vargs, fmt);
vfprintf(stderr, fmt, vargs);
va_end(vargs);
}
void fi_debug_impl(const char *prov, const char *func, int line, const char *fmt, ...)
{
va_list vargs;
if (prov != NULL)
fprintf(stderr, "%s:%s:%s():%d<DBG> ", PACKAGE, prov, func, line);
else
fprintf(stderr, "%s:%s():%d<DBG> ", PACKAGE, func, line);
va_start(vargs, fmt);
vfprintf(stderr, fmt, vargs);
vsnprintf(buf + size, sizeof(buf) - size, fmt, vargs);
va_end(vargs);
fprintf(stderr, "%s", buf);
}