mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
pthread missing.
This commit is contained in:
parent
303d60c437
commit
eb76db19a2
611 changed files with 2229 additions and 142352 deletions
|
@ -150,10 +150,6 @@ add_dependencies(hermit libiomp)
|
|||
build_external(ircce ${HERMIT_ROOT}/usr/ircce "")
|
||||
add_dependencies(hermit ircce)
|
||||
|
||||
## Infiniband
|
||||
build_external(rdma ${HERMIT_ROOT}/usr/rdma-core "")
|
||||
add_dependencies(hermit rdma)
|
||||
|
||||
## XRay profiler
|
||||
build_external(xray ${HERMIT_ROOT}/usr/xray "")
|
||||
add_dependencies(hermit xray)
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#ifndef __IBV_H__
|
||||
#define __IBV_H__
|
||||
|
||||
//#include <verbs.h> // GEHT NICHT aus x86_64-hermit/include heraus.
|
||||
#include <hermit/verbs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
146
include/hermit/limits.h
Normal file
146
include/hermit/limits.h
Normal file
|
@ -0,0 +1,146 @@
|
|||
#ifndef _LIBC_LIMITS_H_
|
||||
# define _LIBC_LIMITS_H_ 1
|
||||
|
||||
#include <newlib.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
# ifdef _MB_LEN_MAX
|
||||
# define MB_LEN_MAX _MB_LEN_MAX
|
||||
# else
|
||||
# define MB_LEN_MAX 1
|
||||
# endif
|
||||
|
||||
/* Maximum number of positional arguments, if _WANT_IO_POS_ARGS. */
|
||||
# ifndef NL_ARGMAX
|
||||
# define NL_ARGMAX 32
|
||||
# endif
|
||||
|
||||
/* if do not have #include_next support, then we
|
||||
have to define the limits here. */
|
||||
# if !defined __GNUC__ || __GNUC__ < 2
|
||||
|
||||
# ifndef _LIMITS_H
|
||||
# define _LIMITS_H 1
|
||||
|
||||
# include <sys/config.h>
|
||||
|
||||
/* Number of bits in a `char'. */
|
||||
# undef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
|
||||
/* Minimum and maximum values a `signed char' can hold. */
|
||||
# undef SCHAR_MIN
|
||||
# define SCHAR_MIN (-128)
|
||||
# undef SCHAR_MAX
|
||||
# define SCHAR_MAX 127
|
||||
|
||||
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
|
||||
# undef UCHAR_MAX
|
||||
# define UCHAR_MAX 255
|
||||
|
||||
/* Minimum and maximum values a `char' can hold. */
|
||||
# ifdef __CHAR_UNSIGNED__
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN 0
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX 255
|
||||
# else
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN (-128)
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX 127
|
||||
# endif
|
||||
|
||||
/* Minimum and maximum values a `signed short int' can hold. */
|
||||
# undef SHRT_MIN
|
||||
/* For the sake of 16 bit hosts, we may not use -32768 */
|
||||
# define SHRT_MIN (-32767-1)
|
||||
# undef SHRT_MAX
|
||||
# define SHRT_MAX 32767
|
||||
|
||||
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
|
||||
# undef USHRT_MAX
|
||||
# define USHRT_MAX 65535
|
||||
|
||||
/* Minimum and maximum values a `signed int' can hold. */
|
||||
# ifndef __INT_MAX__
|
||||
# define __INT_MAX__ 2147483647
|
||||
# endif
|
||||
# undef INT_MIN
|
||||
# define INT_MIN (-INT_MAX-1)
|
||||
# undef INT_MAX
|
||||
# define INT_MAX __INT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
|
||||
# undef UINT_MAX
|
||||
# define UINT_MAX (INT_MAX * 2U + 1)
|
||||
|
||||
/* Minimum and maximum values a `signed long int' can hold.
|
||||
(Same as `int'). */
|
||||
# ifndef __LONG_MAX__
|
||||
# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
|
||||
# define __LONG_MAX__ 9223372036854775807L
|
||||
# else
|
||||
# define __LONG_MAX__ 2147483647L
|
||||
# endif /* __alpha__ || sparc64 */
|
||||
# endif
|
||||
# undef LONG_MIN
|
||||
# define LONG_MIN (-LONG_MAX-1)
|
||||
# undef LONG_MAX
|
||||
# define LONG_MAX __LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_MAX
|
||||
# define ULONG_MAX (LONG_MAX * 2UL + 1)
|
||||
|
||||
# ifndef __LONG_LONG_MAX__
|
||||
# define __LONG_LONG_MAX__ 9223372036854775807LL
|
||||
# endif
|
||||
|
||||
# if __ISO_C_VISIBLE >= 1999
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LLONG_MIN
|
||||
# define LLONG_MIN (-LLONG_MAX-1)
|
||||
# undef LLONG_MAX
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
|
||||
# endif
|
||||
|
||||
# if __GNU_VISIBLE
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LONG_LONG_MIN
|
||||
# define LONG_LONG_MIN (-LONG_LONG_MAX-1)
|
||||
# undef LONG_LONG_MAX
|
||||
# define LONG_LONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
|
||||
# endif
|
||||
|
||||
# endif /* _LIMITS_H */
|
||||
# endif /* GCC 2. */
|
||||
|
||||
#endif /* !_LIBC_LIMITS_H_ */
|
||||
|
||||
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
|
||||
/* `_GCC_LIMITS_H_' is what GCC's file defines. */
|
||||
# include_next <limits.h>
|
||||
#endif /* __GNUC__ && !_GCC_LIMITS_H_ */
|
||||
|
||||
#ifndef _POSIX2_RE_DUP_MAX
|
||||
/* The maximum number of repeated occurrences of a regular expression
|
||||
* permitted when using the interval notation `\{M,N\}'. */
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
#endif /* _POSIX2_RE_DUP_MAX */
|
||||
|
||||
#ifndef ARG_MAX
|
||||
#define ARG_MAX 4096
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
12
include/hermit/pte_types.h
Normal file
12
include/hermit/pte_types.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* pte_types.h */
|
||||
|
||||
#ifndef PTE_TYPES_H
|
||||
#define PTE_TYPES_H
|
||||
|
||||
#include <hermit/errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
typedef unsigned int tid_t;
|
||||
|
||||
#endif /* PTE_TYPES_H */
|
1014
include/hermit/pthread.h
Normal file
1014
include/hermit/pthread.h
Normal file
File diff suppressed because it is too large
Load diff
97
include/hermit/sched.h
Normal file
97
include/hermit/sched.h
Normal file
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
* Written by Joel Sherrill <joel@OARcorp.com>.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2010.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose without fee is hereby granted, provided that this entire notice
|
||||
* is included in all copies of any software which is or includes a copy
|
||||
* or modification of this software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION
|
||||
* OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
|
||||
* SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef _SCHED_H_
|
||||
#define _SCHED_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sched.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_PRIORITY_SCHEDULING)
|
||||
/*
|
||||
* XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803
|
||||
*/
|
||||
int sched_setparam(
|
||||
pid_t __pid,
|
||||
const struct sched_param *__param
|
||||
);
|
||||
|
||||
/*
|
||||
* XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800
|
||||
*/
|
||||
int sched_getparam(
|
||||
pid_t __pid,
|
||||
struct sched_param *__param
|
||||
);
|
||||
|
||||
/*
|
||||
* XBD 13 - Set Scheduling Policy and Scheduling Parameters,
|
||||
* P1003.1b-2008, p. 1805
|
||||
*/
|
||||
int sched_setscheduler(
|
||||
pid_t __pid,
|
||||
int __policy,
|
||||
const struct sched_param *__param
|
||||
);
|
||||
|
||||
/*
|
||||
* XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801
|
||||
*/
|
||||
int sched_getscheduler(
|
||||
pid_t __pid
|
||||
);
|
||||
|
||||
/*
|
||||
* XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799
|
||||
*/
|
||||
int sched_get_priority_max(
|
||||
int __policy
|
||||
);
|
||||
|
||||
int sched_get_priority_min(
|
||||
int __policy
|
||||
);
|
||||
|
||||
/*
|
||||
* XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802
|
||||
*/
|
||||
int sched_rr_get_interval(
|
||||
pid_t __pid,
|
||||
struct timespec *__interval
|
||||
);
|
||||
#endif /* _POSIX_PRIORITY_SCHEDULING */
|
||||
|
||||
#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
|
||||
|
||||
/*
|
||||
* XBD 13 - Yield Processor, P1003.1b-2008, p. 1807
|
||||
*/
|
||||
int sched_yield( void );
|
||||
|
||||
#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SCHED_H_ */
|
25
include/hermit/setjmp.h
Normal file
25
include/hermit/setjmp.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
setjmp.h
|
||||
stubs for future use.
|
||||
*/
|
||||
|
||||
#ifndef _SETJMP_H_
|
||||
#define _SETJMP_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
#ifdef __GNUC__
|
||||
void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval))
|
||||
__attribute__ ((__noreturn__));
|
||||
#else
|
||||
void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval));
|
||||
#endif
|
||||
int _EXFUN(setjmp,(jmp_buf __jmpb));
|
||||
|
||||
_END_STD_C
|
||||
|
||||
#endif /* _SETJMP_H_ */
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,70 +0,0 @@
|
|||
language: c
|
||||
# We need at least cmake 2.12, this means we need to use trusty.
|
||||
# Precise's glibc, etc predates what we are willing to support.
|
||||
# sudo is required to get the trusty image, and at present to enable new llvm
|
||||
sudo: required
|
||||
dist: trusty
|
||||
addons:
|
||||
# We run our builds sequentially in one VM rather than try and use the
|
||||
# matrix feature. This is because Travis is unreasonably inefficient
|
||||
# doing this APT setup pass.
|
||||
apt:
|
||||
sources:
|
||||
# sourceline because travis won't white list trusty builds, and hasn't
|
||||
# whitelisted 4.0
|
||||
- sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main"
|
||||
key_url: "http://apt.llvm.org/llvm-snapshot.gpg.key"
|
||||
- ubuntu-toolchain-r-test
|
||||
# Multiverse is not on by default and we need it to get sparse
|
||||
- sourceline: "deb http://archive.ubuntu.com/ubuntu/ trusty multiverse"
|
||||
packages:
|
||||
- build-essential
|
||||
- clang-4.0
|
||||
- cmake
|
||||
- debhelper
|
||||
- dh-systemd
|
||||
- fakeroot
|
||||
- gcc
|
||||
- gcc-7
|
||||
- git
|
||||
- libnl-3-dev
|
||||
- libnl-route-3-dev
|
||||
- libudev-dev
|
||||
- make
|
||||
- ninja-build
|
||||
- pkg-config
|
||||
- python
|
||||
- valgrind
|
||||
- sparse
|
||||
- wget
|
||||
|
||||
# 32 bit support packages
|
||||
- gcc-multilib
|
||||
- lib32gcc-7-dev
|
||||
|
||||
before_script:
|
||||
- export LATEST_GCC_LINARO_URL=`wget -qO - https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/ | grep -o '<a href=['"'"'"].*gcc-linaro-.*x86_64_aarch64-linux-gnu.tar.xz['"'"'"]' | sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//'`
|
||||
- export LATEST_GCC_LINARO_TAR=`basename $LATEST_GCC_LINARO_URL`
|
||||
- wget -q http://releases.linaro.org/$LATEST_GCC_LINARO_URL
|
||||
- mkdir $HOME/aarch64 && tar xf $LATEST_GCC_LINARO_TAR -C $HOME/aarch64 --strip 1
|
||||
- rm $LATEST_GCC_LINARO_TAR
|
||||
script:
|
||||
- buildlib/travis-build
|
||||
- buildlib/travis-checkpatch
|
||||
- buildlib/github-release
|
||||
deploy:
|
||||
# Deploy assets to Github releases
|
||||
# https://docs.travis-ci.com/user/deployment/releases/
|
||||
provider: releases
|
||||
api_key:
|
||||
# This is encrypted OAth token generated by
|
||||
# Travis CLI tool (travis setup releases) limited to specific repo.
|
||||
secure: ok/WMzFgsSnk+NZ850QEUESHRfJ4Ae7T8eA4dcx4fuw2RqybAh8wjxrLP5GKR27WrzB3hKHHTi7fgE0VtBY024kGJ/+wlQXHN1p89JvCiQlGOKkxy5YIlS4GUhwwkqgoU+hmifxl1i+9yCuowHPIM4WoP+NR+IZgvMahlrdPCS2OleFtrqyaHZbC/Usdt0WZLeQzG+rVLec/NvPnVOn81e17yuAuluHAzu+qcV94szqe/zwDzG8RUUKXaeDEQ3JQja4bCLL/kTkWR8JGsfwvcqc9Ut4Ry2b7uEWp5/FIcxUGWviKRgRzEdcT40iMMiJbIrH7gYp66Ymr/dypqUfc4u/xSb4AmpTMcYGUXJxsdzKyL6d/7HbuHIIVc5o1V/L5mdaIjeO5KjTFjMMD5KoSXfBlNIGk2as1JD/99lxJ3VlpQGwI5390+Tyl8o4Ao4aBXSCG96PDK4+UkYFht/wrw+UoYdV07u3x7zz21O3N3Lu5733hDvcvyOW6uIzoeLQ5O62/3Pq+DOFRs/nnRiW8/gjIkEQAyj/GGxw/taslpFJFcdVt/MSueV4t5OCI2YdGA/NxG/c4FIGy+dntV5BB6Gld8KkP/PP74yzJ1o/PRDRExTbsQzrdisDrVIf0r4pxTTsw1gXRE5r6S0tQ5aNoXAQ5h4xiwAIGqqBF4HESJjA=
|
||||
file: rdma-core-*.tar.gz
|
||||
# Allow asterisks in file names.
|
||||
file_glob: true
|
||||
skip_cleanup: true
|
||||
# Limit scope of deploy to specific repo.
|
||||
on:
|
||||
repo: linux-rdma/rdma-core
|
||||
tags: true
|
|
@ -1,529 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
|
||||
# Run cmake as:
|
||||
# mkdir build
|
||||
# cmake -GNinja ..
|
||||
# ninja
|
||||
#
|
||||
# Common options passed to cmake are:
|
||||
# -DIN_PLACE=1
|
||||
# Configure the build to be run from the build directory, this results in something
|
||||
# that is not installable.
|
||||
# -DCMAKE_EXPORT_COMPILE_COMMANDS=1
|
||||
# Write a compile_commands.json file for clang tooling
|
||||
# -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
# Change the optimization level, Debug disables optimization,
|
||||
# Release is for packagers
|
||||
# -DENABLE_VALGRIND=0 (default enabled)
|
||||
# Disable valgrind notations, this has a tiny positive performance impact
|
||||
# -DENABLE_RESOLVE_NEIGH=0 (default enabled)
|
||||
# Do not link to libnl and do not resolve neighbours internally for Ethernet,
|
||||
# and do not build iwpmd.
|
||||
# -DENABLE_STATIC=1 (default disabled)
|
||||
# Produce static libraries along with the usual shared libraries.
|
||||
# -DVERBS_PROVIDER_DIR='' (default /usr/lib.../libibverbs)
|
||||
# Use the historical search path for providers, in the standard system library.
|
||||
# -DKERNEL_DIR='.../linux' (default '')
|
||||
# If set use the kernel UAPI headers from this kernel source tree.
|
||||
# -DNO_COMPAT_SYMS=1 (default disabled)
|
||||
# Do not generate backwards compatibility symbols in the shared
|
||||
# libraries. This may is necessary if using a dynmic linker that does
|
||||
# not support symbol versions, such as uclibc.
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
|
||||
|
||||
set(TARGET_ARCH x86_64-hermit) # defined in HermitCore-Toolchain-x86.cmake. workaround.
|
||||
#include(../../cmake/HermitCore.cmake) # results in go lang error and fopen() error
|
||||
#include(../../cmake/HermitCore-Toolchain-x86.cmake) # results in fopen() missing.
|
||||
include(../../cmake/HermitCore-Paths.cmake)
|
||||
|
||||
project(rdma-core C)
|
||||
|
||||
# CMake likes to use -rdynamic too much, they fixed it in 3.4.
|
||||
if(POLICY CMP0065)
|
||||
cmake_policy(SET CMP0065 NEW)
|
||||
else()
|
||||
# .. but we really do want to opt out.
|
||||
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Make RDMA_CHECK_C_LINKER_FLAG work better
|
||||
if(POLICY CMP0056)
|
||||
cmake_policy(SET CMP0056 NEW)
|
||||
endif()
|
||||
|
||||
set(PACKAGE_NAME "RDMA")
|
||||
|
||||
# See Documentation/versioning.md
|
||||
set(PACKAGE_VERSION "16")
|
||||
# When this is changed the values in these files need changing too:
|
||||
# debian/libibverbs1.symbols
|
||||
# libibverbs/libibverbs.map
|
||||
set(IBVERBS_PABI_VERSION "16")
|
||||
set(IBVERBS_PROVIDER_SUFFIX "-rdmav${IBVERBS_PABI_VERSION}.so")
|
||||
|
||||
#-------------------------
|
||||
# Basic standard paths
|
||||
|
||||
# Override the CMAKE_INSTALL_ dirs to be under the build/ directory
|
||||
if (IN_PLACE)
|
||||
set(CMAKE_INSTALL_SYSCONFDIR "${CMAKE_BINARY_DIR}/etc")
|
||||
set(CMAKE_INSTALL_BINDIR "${CMAKE_BINARY_DIR}/bin")
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
# C include root
|
||||
set(BUILD_INCLUDE ${CMAKE_BINARY_DIR}/include)
|
||||
# Executables
|
||||
set(BUILD_BIN ${CMAKE_BINARY_DIR}/bin)
|
||||
# Libraries
|
||||
set(BUILD_LIB ${CMAKE_BINARY_DIR}/lib)
|
||||
# Used for IN_PLACE configuration
|
||||
set(BUILD_ETC ${CMAKE_BINARY_DIR}/etc)
|
||||
|
||||
set(CMAKE_INSTALL_INITDDIR "${CMAKE_INSTALL_SYSCONFDIR}/init.d"
|
||||
CACHE PATH "Location for init.d files")
|
||||
set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
|
||||
CACHE PATH "Location for systemd service files")
|
||||
set(CMAKE_INSTALL_SYSTEMD_BINDIR "/lib/systemd"
|
||||
CACHE PATH "Location for systemd extra binaries")
|
||||
|
||||
set(ACM_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/ibacm"
|
||||
CACHE PATH "Location for ibacm provider plugin shared library files.")
|
||||
|
||||
# Location to find the provider plugin shared library files
|
||||
set(VERBS_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/libibverbs"
|
||||
CACHE PATH "Location for provider plugin shared library files. If set to empty the system search path is used.")
|
||||
|
||||
# Allow the 'run' dir to be configurable, this historically has been /var/run, but
|
||||
# some systems now use /run/
|
||||
set(CMAKE_INSTALL_RUNDIR "var/run"
|
||||
CACHE PATH "Location for runtime information, typically /var/run, or /run")
|
||||
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_RUNDIR})
|
||||
set(CMAKE_INSTALL_FULL_RUNDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_RUNDIR}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_FULL_RUNDIR "${CMAKE_INSTALL_RUNDIR}")
|
||||
endif()
|
||||
|
||||
# Allow the udev rules.d dir to be configurable, this has historically been
|
||||
# /lib/udev/rules.d/, but some systems now prefix /usr/
|
||||
set(CMAKE_INSTALL_UDEV_RULESDIR "lib/udev/rules.d"
|
||||
CACHE PATH "Location for system udev rules, typically /lib/udev/rules.d or /usr/lib/udev/rules.d")
|
||||
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_UDEV_RULESDIR})
|
||||
set(CMAKE_INSTALL_FULL_UDEV_RULESDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_UDEV_RULESDIR}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_FULL_UDEV_RULESDIR "${CMAKE_INSTALL_UDEV_RULESDIR}")
|
||||
endif()
|
||||
|
||||
# Location to place provider .driver files
|
||||
if (IN_PLACE)
|
||||
set(CONFIG_DIR "${BUILD_ETC}/libibverbs.d")
|
||||
set(VERBS_PROVIDER_DIR "${BUILD_LIB}")
|
||||
set(ACM_PROVIDER_DIR "${BUILD_LIB}/ibacm")
|
||||
else()
|
||||
set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/libibverbs.d")
|
||||
endif()
|
||||
|
||||
set(DISTRO_FLAVOUR "None" CACHE
|
||||
STRING "Flavour of distribution to install for. This primarily impacts the init.d scripts installed.")
|
||||
|
||||
#-------------------------
|
||||
# Load CMake components
|
||||
set(BUILDLIB "${CMAKE_SOURCE_DIR}/buildlib")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${BUILDLIB}")
|
||||
|
||||
include(FindPkgConfig)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckTypeSize)
|
||||
include(RDMA_EnableCStd)
|
||||
include(RDMA_Sparse)
|
||||
include(RDMA_BuildType)
|
||||
include(RDMA_DoFixup)
|
||||
include(publish_headers)
|
||||
include(rdma_functions)
|
||||
|
||||
if (NOT DEFINED ENABLE_STATIC)
|
||||
set(ENABLE_STATIC "OFF" CACHE BOOL "Produce static linking libraries as well as shared libraries.")
|
||||
endif()
|
||||
|
||||
#-------------------------
|
||||
# Setup the basic C compiler
|
||||
RDMA_BuildType()
|
||||
include_directories(${BUILD_INCLUDE})
|
||||
|
||||
RDMA_CheckSparse()
|
||||
|
||||
# Require GNU99 mode
|
||||
RDMA_EnableCStd()
|
||||
|
||||
# Extra warnings. Turn on -Wextra to keep aware of interesting developments from gcc,
|
||||
# but turn off some that are not terribly useful for this source.
|
||||
# FIXME: I wonder how many of the signed compares are bugs?
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WARNINGS
|
||||
"-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter")
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_PROTOTYPES "-Wmissing-prototypes")
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarations")
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WFORMAT_2 "-Wformat=2")
|
||||
|
||||
# At some point after 4.4 gcc fixed shadow to ignore function vs variable
|
||||
# conflicts
|
||||
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wshadow")
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <unistd.h>
|
||||
int main(int argc,const char *argv[]) { int access = 1; return access; }"
|
||||
HAVE_C_WORKING_SHADOW
|
||||
FAIL_REGEX "warning")
|
||||
if (HAVE_C_WORKING_SHADOW)
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WORKING_SHADOW "-Wshadow")
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||
|
||||
# At some point around 5.4 gcc fixed missing-field-initializers to ignore this
|
||||
# common idiom we use extensively. Since this is a useful warning for
|
||||
# developers try and leave it on if the compiler supports it.
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
struct foo { int a; int b; };
|
||||
int main(int argc,const char *argv[]) { struct foo tmp = {}; return tmp.a; }"
|
||||
HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS
|
||||
FAIL_REGEX "warning")
|
||||
if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WNO_MISSING_FIELD_INITIALIZERS "-Wno-missing-field-initializers")
|
||||
endif()
|
||||
|
||||
# Check that the compiler supports -fno-strict-aliasing.
|
||||
# The use of this flag in the source is discouraged
|
||||
set(NO_STRICT_ALIASING_FLAGS "")
|
||||
RDMA_AddOptCFlag(NO_STRICT_ALIASING_FLAGS HAVE_NO_STRICT_ALIASING
|
||||
"-fno-strict-aliasing")
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <unistd.h>
|
||||
|
||||
void entry(void);
|
||||
|
||||
static void do_entry(void) {}
|
||||
void entry(void) __attribute__((ifunc(\"resolve_entry\")));
|
||||
static void *resolve_entry(void) {return &do_entry;}
|
||||
|
||||
int main(int argc,const char *argv[]) { entry(); }"
|
||||
HAVE_FUNC_ATTRIBUTE_IFUNC
|
||||
FAIL_REGEX "warning")
|
||||
|
||||
# The code does not do the racy fcntl if the various CLOEXEC's are not
|
||||
# supported so it really doesn't work right if this isn't available. Thus hard
|
||||
# require it.
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
#include <fcntl.h>
|
||||
int main(int argc,const char *argv[]) {
|
||||
open(\".\",O_RDONLY | O_CLOEXEC);
|
||||
socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||
return 0;
|
||||
}" HAS_CLOEXEC)
|
||||
|
||||
if (NOT HAS_CLOEXEC)
|
||||
# At least uclibc wrongly hides this POSIX constant behind _GNU_SOURCE
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#define _GNU_SOURCE
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
#include <fcntl.h>
|
||||
int main(int argc,const char *argv[]) {
|
||||
open(\".\",O_RDONLY | O_CLOEXEC);
|
||||
socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||
return 0;
|
||||
}" HAS_CLOEXEC_GNU_SOURCE)
|
||||
if (HAS_CLOEXEC_GNU_SOURCE)
|
||||
set(HAS_CLOEXEC 1)
|
||||
add_definitions("-D_GNU_SOURCE=")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT HAS_CLOEXEC)
|
||||
message(FATAL_ERROR "O_CLOEXEC/SOCK_CLOEXEC/fopen(..,\"e\") support is required but not found")
|
||||
endif()
|
||||
|
||||
# always_inline is supported
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
int foo(void);
|
||||
inline __attribute__((always_inline)) int foo(void) {return 0;}
|
||||
int main(int argc,const char *argv[]) { return foo(); }"
|
||||
HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE
|
||||
FAIL_REGEX "warning")
|
||||
|
||||
# Provide a shim if C11 stdatomic.h is not supported.
|
||||
if (NOT HAVE_SPARSE)
|
||||
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC)
|
||||
RDMA_DoFixup("${HAVE_STDATOMIC}" "stdatomic.h")
|
||||
endif()
|
||||
|
||||
# Enable development support features
|
||||
# Prune unneeded shared libraries during linking
|
||||
RDMA_AddOptLDFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
|
||||
RDMA_AddOptLDFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
|
||||
RDMA_AddOptLDFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
|
||||
|
||||
# Ensure all shared ELFs have fully described linking
|
||||
RDMA_AddOptLDFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
|
||||
RDMA_AddOptLDFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
|
||||
|
||||
# Enable gold linker - gold has different linking checks
|
||||
#RDMA_AddOptLDFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
|
||||
#RDMA_AddOptLDFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
|
||||
#RDMA_AddOptLDFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
|
||||
|
||||
# Verify that GNU --version-script and asm(".symver") works
|
||||
find_package(LDSymVer REQUIRED)
|
||||
if (NO_COMPAT_SYMS)
|
||||
set(HAVE_LIMITED_SYMBOL_VERSIONS 1)
|
||||
else()
|
||||
set(HAVE_FULL_SYMBOL_VERSIONS 1)
|
||||
endif()
|
||||
|
||||
#-------------------------
|
||||
# Find libraries
|
||||
# pthread
|
||||
FIND_PACKAGE (Threads REQUIRED)
|
||||
|
||||
# libnl
|
||||
if (NOT DEFINED ENABLE_RESOLVE_NEIGH)
|
||||
set(ENABLE_RESOLVE_NEIGH "ON" CACHE BOOL "Enable internal resolution of neighbours for Etherent")
|
||||
endif()
|
||||
if (ENABLE_RESOLVE_NEIGH)
|
||||
# FIXME use of pkgconfig is discouraged
|
||||
pkg_check_modules(NL3 libnl-3.0 libnl-route-3.0)
|
||||
if (NL3_FOUND)
|
||||
set(NL_KIND 3)
|
||||
set(NL_INCLUDE_DIRS ${NL3_INCLUDE_DIRS})
|
||||
set(NL_LIBRARIES ${NL3_LIBRARIES})
|
||||
else()
|
||||
# FIXME: I don't know why we have this fallback, all supported distros
|
||||
# have libnl3
|
||||
pkg_check_modules(NL1 libnl-1)
|
||||
if (NL1_FOUND)
|
||||
set(NL_KIND 1)
|
||||
set(NL_INCLUDE_DIRS ${NL1_INCLUDE_DIRS})
|
||||
set(NL_LIBRARIES ${NL1_LIBRARIES})
|
||||
else()
|
||||
message(FATAL_ERROR "Cannot find libnl-3.0 or libnl-1")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories(${NL_INCLUDE_DIRS})
|
||||
else()
|
||||
set(NL_KIND 0)
|
||||
set(NL_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
# Older stuff blows up if these headers are included together
|
||||
if (NOT NL_KIND EQUAL 0)
|
||||
set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
|
||||
set(CMAKE_REQUIRED_INCLUDES "${NL_INCLUDE_DIRS}")
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <netlink/route/link.h>
|
||||
#include <net/if.h>
|
||||
int main(int argc,const char *argv[]) {return 0;}"
|
||||
HAVE_WORKING_IF_H)
|
||||
set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
|
||||
endif()
|
||||
|
||||
# udev
|
||||
find_package(UDev)
|
||||
include_directories(${UDEV_INCLUDE_DIRS})
|
||||
|
||||
# Statically determine sizeof(long), this is largely unnecessary, no new code
|
||||
# should rely on this.
|
||||
check_type_size("long" SIZEOF_LONG BUILTIN_TYPES_ONLY LANGUAGE C)
|
||||
|
||||
include(RDMA_LinuxHeaders)
|
||||
|
||||
# Determine if this arch supports cache coherent DMA. This isn't really an
|
||||
# arch specific property, but for our purposes arches that do not support it
|
||||
# also do not define wmb/etc which breaks our compile.
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include \"${CMAKE_CURRENT_SOURCE_DIR}/util/udma_barrier.h\"
|
||||
int main(int argc,const char *argv[]) {return 0;}"
|
||||
HAVE_COHERENT_DMA)
|
||||
|
||||
find_package(Systemd)
|
||||
include_directories(${SYSTEMD_INCLUDE_DIRS})
|
||||
RDMA_DoFixup("${SYSTEMD_FOUND}" "systemd/sd-daemon.h")
|
||||
|
||||
#-------------------------
|
||||
# Apply fixups
|
||||
|
||||
# We prefer to build with valgrind memcheck.h present, but if not, or the user
|
||||
# requested valgrind disabled, then replace it with our dummy stub.
|
||||
if (NOT DEFINED ENABLE_VALGRIND)
|
||||
set(ENABLE_VALGRIND "ON" CACHE BOOL "Enable use of valgrind annotations")
|
||||
endif()
|
||||
if (ENABLE_VALGRIND)
|
||||
CHECK_INCLUDE_FILE("valgrind/memcheck.h" HAVE_VALGRIND_MEMCHECK)
|
||||
CHECK_INCLUDE_FILE("valgrind/drd.h" HAVE_VALGRIND_DRD)
|
||||
else()
|
||||
set(HAVE_VALGRIND_MEMCHECK 0)
|
||||
set(HAVE_VALGRIND_DRD 0)
|
||||
endif()
|
||||
RDMA_DoFixup("${HAVE_VALGRIND_MEMCHECK}" "valgrind/memcheck.h")
|
||||
RDMA_DoFixup("${HAVE_VALGRIND_DRD}" "valgrind/drd.h")
|
||||
|
||||
# Older glibc does not include librt
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <time.h>
|
||||
int main(int argc,const char *argv[]) {
|
||||
clock_gettime(CLOCK_MONOTONIC,0);
|
||||
clock_nanosleep(CLOCK_MONOTONIC,0,0,0);
|
||||
return 0;
|
||||
};" LIBC_HAS_LIBRT)
|
||||
if (NOT LIBC_HAS_LIBRT)
|
||||
set(RT_LIBRARIES "rt")
|
||||
endif()
|
||||
|
||||
#-------------------------
|
||||
# Final warning flags
|
||||
|
||||
# Old version of cmake used 'main(){..}' as their test program which breaks with -Werror.
|
||||
# So set this flag last.
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WSTRICT_PROTOTYPES "-Wstrict-prototypes")
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WOLD_STYLE_DEFINITION "-Wold-style-definition")
|
||||
|
||||
# Old versions of libnl have a duplicated rtnl_route_put, disbale the warning on those
|
||||
# systems
|
||||
if (NOT NL_KIND EQUAL 0)
|
||||
set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
|
||||
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_INCLUDES "${NL_INCLUDE_DIRS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wredundant-decls")
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <netlink/route/route.h>
|
||||
int main(int argc,const char *argv[]) { return 0; }"
|
||||
HAVE_C_WREDUNDANT_DECLS
|
||||
FAIL_REGEX "warning")
|
||||
set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||
endif()
|
||||
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WREDUNDANT_DECLS "-Wredundant-decls")
|
||||
|
||||
#-------------------------
|
||||
# Build Prep
|
||||
# Write out a git ignore file to the build directory if it isn't the source
|
||||
# directory. For developer convenience
|
||||
if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/.gitignore "*")
|
||||
endif()
|
||||
|
||||
configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOTES @ONLY)
|
||||
|
||||
#-------------------------
|
||||
# Sub-directories
|
||||
add_subdirectory(ccan)
|
||||
add_subdirectory(util)
|
||||
add_subdirectory(Documentation)
|
||||
add_subdirectory(kernel-boot)
|
||||
# Libraries
|
||||
add_subdirectory(libibumad)
|
||||
add_subdirectory(libibumad/man)
|
||||
add_subdirectory(libibverbs)
|
||||
add_subdirectory(libibverbs/man)
|
||||
add_subdirectory(librdmacm)
|
||||
add_subdirectory(librdmacm/man)
|
||||
add_subdirectory(libibcm)
|
||||
|
||||
# Providers
|
||||
if (HAVE_COHERENT_DMA)
|
||||
add_subdirectory(providers/bnxt_re)
|
||||
add_subdirectory(providers/cxgb3) # NO SPARSE
|
||||
add_subdirectory(providers/cxgb4) # NO SPARSE
|
||||
add_subdirectory(providers/hns) # NO SPARSE
|
||||
add_subdirectory(providers/i40iw) # NO SPARSE
|
||||
add_subdirectory(providers/mlx4)
|
||||
add_subdirectory(providers/mlx4/man)
|
||||
add_subdirectory(providers/mlx5)
|
||||
add_subdirectory(providers/mlx5/man)
|
||||
add_subdirectory(providers/mthca)
|
||||
add_subdirectory(providers/nes) # NO SPARSE
|
||||
add_subdirectory(providers/ocrdma)
|
||||
add_subdirectory(providers/qedr)
|
||||
add_subdirectory(providers/vmw_pvrdma)
|
||||
endif()
|
||||
|
||||
add_subdirectory(providers/hfi1verbs)
|
||||
add_subdirectory(providers/ipathverbs)
|
||||
add_subdirectory(providers/rxe)
|
||||
add_subdirectory(providers/rxe/man)
|
||||
|
||||
# Binaries
|
||||
add_subdirectory(ibacm) # NO SPARSE
|
||||
if (NOT NL_KIND EQUAL 0)
|
||||
add_subdirectory(iwpmd)
|
||||
endif()
|
||||
add_subdirectory(libibcm/examples)
|
||||
add_subdirectory(libibumad/tests)
|
||||
add_subdirectory(libibverbs/examples)
|
||||
add_subdirectory(librdmacm/examples)
|
||||
if (UDEV_FOUND)
|
||||
add_subdirectory(rdma-ndd)
|
||||
endif()
|
||||
add_subdirectory(srp_daemon)
|
||||
|
||||
rdma_finalize_libs()
|
||||
|
||||
#-------------------------
|
||||
# Display a summary
|
||||
# Only report things that are non-ideal.
|
||||
message(STATUS "Missing Optional Items:")
|
||||
if (NOT HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE)
|
||||
message(STATUS " Compiler attribute always_inline NOT supported")
|
||||
endif()
|
||||
if (NOT HAVE_FUNC_ATTRIBUTE_IFUNC)
|
||||
message(STATUS " Compiler attribute ifunc NOT supported")
|
||||
endif()
|
||||
if (NOT HAVE_COHERENT_DMA)
|
||||
message(STATUS " Architecture NOT able to do coherent DMA (check util/udma_barrier.h) some providers disabled!")
|
||||
endif()
|
||||
if (NOT HAVE_STDATOMIC)
|
||||
message(STATUS " C11 stdatomic.h NOT available (old compiler)")
|
||||
endif()
|
||||
if (NOT HAVE_VALGRIND_MEMCHECK)
|
||||
message(STATUS " Valgrind memcheck.h NOT enabled")
|
||||
endif()
|
||||
if (NOT HAVE_VALGRIND_DRD)
|
||||
message(STATUS " Valgrind drd.h NOT enabled")
|
||||
endif()
|
||||
if (NL_KIND EQUAL 1)
|
||||
message(STATUS " libnl 3 NOT found (using libnl 1 compat)")
|
||||
endif()
|
||||
if (NL_KIND EQUAL 0)
|
||||
message(STATUS " neighbour resolution NOT enabled")
|
||||
else()
|
||||
if (NOT HAVE_WORKING_IF_H)
|
||||
message(STATUS " netlink/route/link.h and net/if.h NOT co-includable (old headers)")
|
||||
endif()
|
||||
endif()
|
||||
if (NOT SYSTEMD_FOUND)
|
||||
message(STATUS " libsystemd NOT found (disabling features)")
|
||||
endif()
|
||||
if (NOT UDEV_FOUND)
|
||||
message(STATUS " libudev NOT found (disabling features)")
|
||||
endif()
|
||||
rdma_report_missing_kheaders()
|
||||
if (NOT HAVE_C_WARNINGS)
|
||||
message(STATUS " extended C warnings NOT supported")
|
||||
endif()
|
||||
if (NOT HAVE_NO_STRICT_ALIASING)
|
||||
message(STATUS " -fno-strict-aliasing NOT supported")
|
||||
endif()
|
||||
if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
|
||||
message(STATUS " -Wmissing-field-initializers does NOT work")
|
||||
endif()
|
||||
if (NOT HAVE_C_WORKING_SHADOW)
|
||||
message(STATUS " -Wshadow does NOT work")
|
||||
endif()
|
||||
if (NOT HAVE_C_WREDUNDANT_DECLS)
|
||||
message(STATUS " -Wredundant-decls does NOT work")
|
||||
endif()
|
|
@ -1,22 +0,0 @@
|
|||
OpenIB.org BSD license (FreeBSD Variant)
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,20 +0,0 @@
|
|||
OpenIB.org BSD license (MIT variant)
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -1,339 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
|
@ -1,65 +0,0 @@
|
|||
# Default Dual License
|
||||
|
||||
Unless otherwise stated 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
|
||||
OpenIB.org BSD (MIT variant) license (see COPYING.BSD_MIT) or the GNU General
|
||||
Public License (GPL) Version 2 (see COPYING.GPL2), both included in this
|
||||
package.
|
||||
|
||||
Files marked 'See COPYING file' are licensed under the above Dual License.
|
||||
|
||||
# Other Options
|
||||
|
||||
Individual source files may use a license different from the above Defaul Dual
|
||||
License. If a license is declared in the file then it supersedes the Default
|
||||
License.
|
||||
|
||||
If a directory contains a COPYING file then the License from that file becomes
|
||||
the Default License for files in that directory and below.
|
||||
|
||||
# Copyright Holders
|
||||
|
||||
Refer to individual files for information on the copyright holders.
|
||||
|
||||
# License Catalog (Informative, Non Binding)
|
||||
|
||||
## Utilities
|
||||
|
||||
Utility source code that may be linked into any binary are available under
|
||||
several licenses:
|
||||
|
||||
- MIT license (see ccan/LICENSE.MIT)
|
||||
- Creative Commons CC0 1.0 Universal License (see ccan/LICENSE.CC0)
|
||||
|
||||
## Providers
|
||||
|
||||
The following providers use a different license than the Default Dual
|
||||
License. Refer to files in each directory for details.
|
||||
|
||||
hfi1verbs
|
||||
: Dual License: GPLv2 or Intel 3 clause BSD license
|
||||
|
||||
ipathverbs
|
||||
: Dual License: GPLv2 or PathScale BSD Patent license
|
||||
|
||||
ocrdma
|
||||
: Dual License: GPLv2 or OpenIB.org BSD (FreeBSD variant), See COPYING.BSD_FB
|
||||
|
||||
## Libraries
|
||||
|
||||
All library compilable source code (.c and .h files) are available under the
|
||||
Default Dual License.
|
||||
|
||||
Unmarked ancillary files may be available under a Dual License: GPLv2 or
|
||||
OpenIB.org BSD (FreeBSD variant).
|
||||
|
||||
## Tools (iwpmd, srp_daemon, ibacm)
|
||||
|
||||
All compilable source code (.c and .h files) are available under the Default
|
||||
Dual License.
|
||||
|
||||
Unmarked ancillary files may be available under a Dual License: GPLv2 or
|
||||
OpenIB.org BSD (FreeBSD variant).
|
||||
|
||||
srp_daemon/srp_daemon/srp_daemon.sh: Any one of the GPLv2, a 2 clause BSD
|
||||
license or the CPLv1.
|
|
@ -1,11 +0,0 @@
|
|||
install(FILES
|
||||
ibacm.md
|
||||
ibsrpdm.md
|
||||
libibcm.md
|
||||
libibverbs.md
|
||||
librdmacm.md
|
||||
rxe.md
|
||||
udev.md
|
||||
../README.md
|
||||
../MAINTAINERS
|
||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}")
|
|
@ -1,109 +0,0 @@
|
|||
# The Assistant for InfiniBand Communication Management (IB ACM)
|
||||
|
||||
The IB ACM library implements and provides a framework for name, address, and
|
||||
route resolution services over InfiniBand. The IB ACM provides information
|
||||
needed to establish a connection, but does not implement the CM protocol.
|
||||
|
||||
IB ACM services are used by librdmacm to implement the rdma_resolve_addr,
|
||||
rdma_resolve_route, and rdma_getaddrinfo routines.
|
||||
|
||||
The IB ACM is focused on being scalable and efficient. The current
|
||||
implementation limits network traffic, SA interactions, and centralized
|
||||
services. ACM supports multiple resolution protocols in order to handle
|
||||
different fabric topologies.
|
||||
|
||||
This release is limited in its handling of dynamic changes.
|
||||
|
||||
The IB ACM package is comprised of two components: the ibacm service
|
||||
and a test/configuration utility - ib_acme.
|
||||
|
||||
# Details
|
||||
|
||||
### ib_acme
|
||||
|
||||
The ib_acme program serves a dual role. It acts as a utility to test
|
||||
ibacm operation and help verify if the ibacm service and selected
|
||||
protocol is usable for a given cluster configuration. Additionally,
|
||||
it automatically generates ibacm configuration files to assist with
|
||||
or eliminate manual setup.
|
||||
|
||||
|
||||
### acm configuration files
|
||||
|
||||
The ibacm service relies on two configuration files.
|
||||
|
||||
The acm_addr.cfg file contains name and address mappings for each IB
|
||||
<device, port, pkey> endpoint. Although the names in the acm_addr.cfg
|
||||
file can be anything, ib_acme maps the host name and IP addresses to
|
||||
the IB endpoints.
|
||||
|
||||
The acm_opts.cfg file provides a set of configurable options for the
|
||||
ibacm service, such as timeout, number of retries, logging level, etc.
|
||||
ib_acme generates the acm_opts.cfg file using static information. A
|
||||
future enhancement would adjust options based on the current system
|
||||
and cluster size.
|
||||
|
||||
### ibacm
|
||||
|
||||
The ibacm service is responsible for resolving names and addresses to
|
||||
InfiniBand path information and caching such data. It is implemented as a
|
||||
daemon that execute with administrative privileges.
|
||||
|
||||
The ibacm implements a client interface over TCP sockets, which is
|
||||
abstracted by the librdmacm library. One or more back-end protocols are
|
||||
used by the ibacm service to satisfy user requests. Although the
|
||||
ibacm supports standard SA path record queries on the back-end, it
|
||||
provides an experimental multicast resolution protocol in hope of
|
||||
achieving greater scalability. The latter is not usable on all fabric
|
||||
topologies, specifically ones that may not have reversible paths.
|
||||
Users should use the ib_acme utility to verify that multicast protocol
|
||||
is usable before running other applications.
|
||||
|
||||
Conceptually, the ibacm service implements an ARP like protocol and either
|
||||
uses IB multicast records to construct path record data or queries the
|
||||
SA directly, depending on the selected route protocol. By default, the
|
||||
ibacm services uses and caches SA path record queries.
|
||||
|
||||
Specifically, all IB endpoints join a number of multicast groups.
|
||||
Multicast groups differ based on rates, mtu, sl, etc., and are prioritized.
|
||||
All participating endpoints must be able to communicate on the lowest
|
||||
priority multicast group. The ibacm assigns one or more names/addresses
|
||||
to each IB endpoint using the acm_addr.cfg file. Clients provide source
|
||||
and destination names or addresses as input to the service, and receive
|
||||
as output path record data.
|
||||
|
||||
The service maps a client's source name/address to a local IB endpoint.
|
||||
If a client does not provide a source address, then the ibacm service
|
||||
will select one based on the destination and local routing tables. If the
|
||||
destination name/address is not cached locally, it sends a multicast
|
||||
request out on the lowest priority multicast group on the local endpoint.
|
||||
The request carries a list of multicast groups that the sender can use.
|
||||
The recipient of the request selects the highest priority multicast group
|
||||
that it can use as well and returns that information directly to the sender.
|
||||
The request data is cached by all endpoints that receive the multicast
|
||||
request message. The source endpoint also caches the response and uses
|
||||
the multicast group that was selected to construct or obtain path record
|
||||
data, which is returned to the client.
|
||||
|
||||
The current implementation of the IB ACM has several additional restrictions:
|
||||
- The ibacm is limited in its handling of dynamic changes;
|
||||
the ibacm should be stopped and restarted if a cluster is reconfigured.
|
||||
- Support for IPv6 has not been verified.
|
||||
- The number of addresses that can be assigned to a single endpoint is
|
||||
limited to 4.
|
||||
- The number of multicast groups that an endpoint can support is limited to 2.
|
||||
|
||||
The ibacm contains several internal caches. These include caches for
|
||||
GID and LID destination addresses. These caches can be optionally
|
||||
preloaded. ibacm supports the OpenSM dump_pr plugin "full" PathRecord
|
||||
format which is used to preload these caches. The file format is specified
|
||||
in the ibacm_opts.cfg file via the route_preload setting which should
|
||||
be set to opensm_full_v1 for this file format. Default format is
|
||||
none which does not preload these caches. See dump_pr.notes.txt in dump_pr
|
||||
for more information on the opensm_full_v1 file format and how to configure
|
||||
OpenSM to generate this file.
|
||||
|
||||
Additionally, the name, IPv4, and IPv6 caches can be be preloaded by using
|
||||
the addr_preload option. The default is none which does not preload these
|
||||
caches. To preload these caches, set this option to acm_hosts and
|
||||
configure the addr_data_file appropriately.
|
|
@ -1,41 +0,0 @@
|
|||
# Using ibsrpdm
|
||||
|
||||
ibsrpdm is used for discovering and connecting to SRP SCSI targets on
|
||||
InfiniBand fabrics. These targets can be accessed with the InfiniBand SRP
|
||||
initiator module, "ib_srp," included in Linux kernels 2.6.15 and newer.
|
||||
|
||||
To run ibsrpdm, the ib_umad module must be loaded, as well as an appropriate
|
||||
low-level driver for the installed IB hardware.
|
||||
|
||||
With no command line parameters, ibsrpdm displays information about
|
||||
SRP targets in human-readable form:
|
||||
|
||||
# ibsrpdm
|
||||
IO Unit Info:
|
||||
port LID: 0009
|
||||
port GID: fe800000000000000005ad00000013e9
|
||||
change ID: 73b0
|
||||
max controllers: 0x01
|
||||
|
||||
controller[ 1]
|
||||
GUID: 0005ad00000013e7
|
||||
vendor ID: 0005ad
|
||||
device ID: 0005ad
|
||||
IO class : 0100
|
||||
ID: Topspin SRP/FC TCA
|
||||
service entries: 2
|
||||
service[ 0]: 0000000000000066 / SRP.T10:20030003BA27CC7A
|
||||
service[ 1]: 0000000000000066 / SRP.T10:20030003BA27CF53
|
||||
|
||||
With the "-c" flag, ibsrpdm displays information in a form that can be
|
||||
written to the kernel SRP initiators add_target file to connect to the
|
||||
SRP targets. For example:
|
||||
|
||||
# ibsrpdm -c
|
||||
id_ext=20030003BA27CC7A,ioc_guid=0005ad00000013e7,dgid=fe800000000000000005ad00000013e9,pkey=ffff,service_id=0000000000000066
|
||||
id_ext=20030003BA27CF53,ioc_guid=0005ad00000013e7,dgid=fe800000000000000005ad00000013e9,pkey=ffff,service_id=0000000000000066
|
||||
|
||||
Given this, the command below will connect to the first target
|
||||
discovered from the first port of the local HCA device "mthca0":
|
||||
|
||||
# echo -n id_ext=20030003BA27CC7A,ioc_guid=0005ad00000013e7,dgid=fe800000000000000005ad00000013e9,pkey=ffff,service_id=0000000000000066 > /sys/class/infiniband_srp/srp-mthca0-1/add_target
|
|
@ -1,16 +0,0 @@
|
|||
# Device files
|
||||
|
||||
The userspace CM uses a device file per adapter present.
|
||||
|
||||
To create the appropriate character device file automatically with
|
||||
udev, a rule like
|
||||
|
||||
KERNEL="ucm*", NAME="infiniband/%k", MODE="0666"
|
||||
|
||||
can be used. This will create the device node named
|
||||
|
||||
/dev/infiniband/ucm0
|
||||
|
||||
for the first HCA in the system, or you can create it manually
|
||||
|
||||
mknod /dev/infiniband/ucm0 c 231 224
|
|
@ -1,58 +0,0 @@
|
|||
# Introduction
|
||||
|
||||
libibverbs is a library that allows programs to use RDMA "verbs" for
|
||||
direct access to RDMA (currently InfiniBand and iWARP) hardware from
|
||||
userspace. For more information on RDMA verbs, see the InfiniBand
|
||||
Architecture Specification vol. 1, especially chapter 11, and the RDMA
|
||||
Consortium's RDMA Protocol Verbs Specification.
|
||||
|
||||
# Using libibverbs
|
||||
|
||||
### Device nodes
|
||||
|
||||
The verbs library expects special character device files named
|
||||
/dev/infiniband/uverbsN to be created. When you load the kernel
|
||||
modules, including both the low-level driver for your IB hardware as
|
||||
well as the ib_uverbs module, you should see one or more uverbsN
|
||||
entries in /sys/class/infiniband_verbs in addition to the
|
||||
/dev/infiniband/uverbsN character device files.
|
||||
|
||||
To create the appropriate character device files automatically with
|
||||
udev, a rule like
|
||||
|
||||
KERNEL="uverbs*", NAME="infiniband/%k"
|
||||
|
||||
can be used. This will create device nodes named
|
||||
|
||||
/dev/infiniband/uverbs0
|
||||
|
||||
and so on. Since the RDMA userspace verbs should be safe for use by
|
||||
non-privileged users, you may want to add an appropriate MODE or GROUP
|
||||
to your udev rule.
|
||||
|
||||
### Permissions
|
||||
|
||||
To use IB verbs from userspace, a process must be able to access the
|
||||
appropriate /dev/infiniband/uverbsN special device file. You can
|
||||
check the permissions on this file with the command
|
||||
|
||||
ls -l /dev/infiniband/uverbs*
|
||||
|
||||
Make sure that the permissions on these files are such that the
|
||||
user/group that your verbs program runs as can access the device file.
|
||||
|
||||
To use IB verbs from userspace, a process must also have permission to
|
||||
tell the kernel to lock sufficient memory for all of your registered
|
||||
memory regions as well as the memory used internally by IB resources
|
||||
such as queue pairs (QPs) and completion queues (CQs). To check your
|
||||
resource limits, use the command
|
||||
|
||||
ulimit -l
|
||||
|
||||
(or "limit memorylocked" for csh-like shells).
|
||||
|
||||
If you see a small number such as 32 (the units are KB) then you will
|
||||
need to increase this limit. This is usually done for ordinary users
|
||||
via the file /etc/security/limits.conf. More configuration may be
|
||||
necessary if you are logging in via OpenSSH and your sshd is
|
||||
configured to use privilege separation.
|
|
@ -1,46 +0,0 @@
|
|||
# Device files
|
||||
|
||||
The userspace CMA uses a single device file regardless of the number
|
||||
of adapters or ports present.
|
||||
|
||||
To create the appropriate character device file automatically with
|
||||
udev, a rule like
|
||||
|
||||
KERNEL="rdma_cm", NAME="infiniband/%k", MODE="0666"
|
||||
|
||||
can be used. This will create the device node named
|
||||
|
||||
/dev/infiniband/rdma_cm
|
||||
|
||||
or you can create it manually
|
||||
|
||||
mknod /dev/infiniband/rdma_cm c 231 255
|
||||
|
||||
|
||||
# Common issues
|
||||
|
||||
Using multiple interfaces
|
||||
: The librdmacm does support multiple interfaces. To make use
|
||||
of multiple interfaces, however, you need to instruct linux
|
||||
to only send ARP reples on the interface targetted in the ARP
|
||||
request. This can be done using a command similar to the
|
||||
following:
|
||||
|
||||
sysctl -w net.ipv4.conf.all.arp_ignore=2
|
||||
|
||||
Without this change, it's possible for linux to resopnd to ARP
|
||||
requests on a different interface (IP address) than the IP
|
||||
address carried in the ARP request. This causes the RDMA stack
|
||||
to incorrectly map the remote IP address to the wrong RDMA
|
||||
device.
|
||||
|
||||
Using loopback
|
||||
: The librdmacm relies on ARP to resolve IP address to RDMA
|
||||
addresses. To support loopback connections between different
|
||||
ports on the same system, ARP must be enabled for local
|
||||
resolution:
|
||||
|
||||
sysctl net.ipv4.conf.all.accept_local=1
|
||||
|
||||
Without this setting, loopback connections may timeout
|
||||
during address resolution.
|
|
@ -1,99 +0,0 @@
|
|||
# Release Process
|
||||
|
||||
Release process of rdma-core library consists from three stages
|
||||
|
||||
1. Change library version, according to [Overall Pacakge Version](versioning.md) guide.
|
||||
2. Push the change above to master branch and ensure that Travis CI reports successful build.
|
||||
3. Create local annotated signed tag vX.X.X (`git tag vX.X.X -a -s`).
|
||||
4. Issue `git release` command which will push tag, trigger Travis CI to upload
|
||||
release tar.gz file and create release notes based on tag context with release notes in it.
|
||||
|
||||
## git release
|
||||
|
||||
There are many implmentations of different `git release` commands. We recommend you to use
|
||||
the command from [this](https://github.com/mpalmer/github-release) repository due to its simplicity.
|
||||
|
||||
---
|
||||
Copy&Paste from relevant [README](https://github.com/mpalmer/github-release/blob/master/README.md)
|
||||
|
||||
---
|
||||
|
||||
This very simple gem provides a `git release` command, which will
|
||||
automatically fill out any and all "release tags" into fully-blown "Github
|
||||
Releases", complete with release notes, a heading, and all the other good
|
||||
things in life.
|
||||
|
||||
Using this gem, you can turn the following tag annotation:
|
||||
|
||||
First Release
|
||||
|
||||
It is with much fanfare and blowing of horns that I bequeath the
|
||||
awesomeness of `git release` upon the world.
|
||||
|
||||
Features in this release include:
|
||||
|
||||
* Ability to create a release from a tag annotation or commit message;
|
||||
* Automatically generates an OAuth token if needed;
|
||||
* Feeds your cat while you're hacking(*)
|
||||
|
||||
You should install it now! `gem install github-release`
|
||||
|
||||
Into [this](https://github.com/mpalmer/github-release/releases/tag/v0.1.0)
|
||||
simply by running
|
||||
|
||||
git release
|
||||
|
||||
### Installation
|
||||
|
||||
Simply install the gem:
|
||||
|
||||
gem install github-release
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
Using `git release` is very simple. Just make sure that your `origin`
|
||||
remote points to your Github repo, and then run `git release`. All tags
|
||||
that look like a "version tag" (see "Configuration", below) will be created
|
||||
as Github releases (if they don't already exist) and the message from the
|
||||
tag will be used as the release notes.
|
||||
|
||||
The format of the release notes is quite straightforward -- the first line
|
||||
of the message associated with the commit will be used as the "name" of the
|
||||
release, with the rest of the message used as the "body" of the release.
|
||||
The body will be interpreted as Github-flavoured markdown, so if you'd like
|
||||
to get fancy, go for your life.
|
||||
|
||||
The message associated with the "release tag" is either the tag's annotation
|
||||
message (if it is an annotated tag) or else the commit log of the commit on
|
||||
which the tag is placed. I *strongly* recommend annotated tags (but then
|
||||
again, [I'm biased...](http://theshed.hezmatt.org/git-version-bump))
|
||||
|
||||
The first time you use `git release`, it will ask you for your Github
|
||||
username and password. This is used to request an OAuth token to talk to
|
||||
the Github API, which is then stored in your global git config. Hence you
|
||||
*shouldn't* be asked for your credentials every time you use `git release`.
|
||||
If you need to use multiple github accounts for different repos, you can
|
||||
override the `release.api-token` config parameter in your repo configuration
|
||||
(but you'll have to get your own OAuth token).
|
||||
|
||||
|
||||
### Configuration
|
||||
|
||||
There are a few things you can configure to make `git release` work slightly
|
||||
differently. None of them should be required for normal, sane use.
|
||||
|
||||
* `release.remote` (default `origin`) -- The name of the remote which is
|
||||
used to determine what github repository to send release notes to.
|
||||
|
||||
* `release.api-token` (default is runtime generated) -- The OAuth token
|
||||
to use to authenticate access to the Github API. When you first run `git
|
||||
release`, you'll be prompted for a username and password to use to
|
||||
generate an initial token; if you need to override it on a per-repo
|
||||
basis, this is the key you'll use.
|
||||
|
||||
* `release.tag-regex` (default `v\d+\.\d+(\.\d+)?$`) -- The regular
|
||||
expression to filter which tags denote releases, as opposed to other tags
|
||||
you might have decided to make. Only tags which match this regular
|
||||
expression will be pushed up by `git release`, and only those tags will
|
||||
be marked as releases.
|
|
@ -1,22 +0,0 @@
|
|||
# Configure Soft-RoCE (RXE):
|
||||
|
||||
Load rdma_rxe kernel module using the rxe_cfg script included in the librxe RPM:
|
||||
|
||||
# rxe_cfg start (this might require sudo or root privileges)
|
||||
|
||||
Create RXE device over network interface (e.g. eth0):
|
||||
|
||||
# rxe_cfg add eth0
|
||||
|
||||
Use the status command to display the current configuration:
|
||||
rxe_cfg status
|
||||
|
||||
If configured successfully, you should see output similar to the following:
|
||||
|
||||
```
|
||||
Name Link Driver Speed NMTU IPv4_addr RDEV RMTU
|
||||
eth0 yes mlx4_en rxe0 1024 (3)
|
||||
```
|
||||
|
||||
If you are using a Mellanox HCA: Need to make sure that the mlx4_ib kernel module is not loaded (modprobe –rv mlx4_ib) in the soft-RoCE machine.
|
||||
Now you have an Infiniband device called “rxe0” that can be used to run any RoCE app.
|
|
@ -1,149 +0,0 @@
|
|||
# Kernel Module Loading
|
||||
|
||||
The RDMA subsystem relies on the kernel, udev and systemd to load modules on
|
||||
demand when RDMA hardware is present. The RDMA subsystem is unique since it
|
||||
does not do not load the optional RDMA hardware modules unless the system has
|
||||
the rdma-core package installed.
|
||||
|
||||
This is to avoid exposing systems not using RDMA from having RDMA enabled, for
|
||||
instance if a system has a multi-protocol ethernet adapter, but is only using
|
||||
the net stack interface.
|
||||
|
||||
## Boot ordering with systemd
|
||||
|
||||
systemd assumes everything is hot pluggable and runs in an event driven
|
||||
manner. This creates a chain of hot plug events as each part of the system
|
||||
autoloads based on earlier parts. The first step in the process is udev
|
||||
loading the physical hardware driver.
|
||||
|
||||
This can happen in several spots along the bootup:
|
||||
|
||||
- From the initrd or built into the kernel. If hardware modules are present
|
||||
in the initrd then they are loaded into the kernel before booting the
|
||||
system. This is done largely synchronously with the boot process.
|
||||
|
||||
- From udev when it auto detects PCI hardware or otherwise.
|
||||
This happens asynchronously in the boot process, systemd does not wait for
|
||||
udev to finish loading modules before it continues on.
|
||||
|
||||
This path makes it very likely the system will experience a RDMA 'hot plug'
|
||||
scenario.
|
||||
|
||||
- From systemd's fixed module loader systemd-modules-load.service, e.g. from
|
||||
the list in /etc/modules-load.d/. In this case the modules load happens
|
||||
synchronously within systemd and it will hold off sysinit.target until
|
||||
modules are loaded
|
||||
|
||||
Once the hardware module is loaded it may be necessary to load a protocol
|
||||
module, e.g. to enable RDMA support on an ethernet device.
|
||||
|
||||
This is triggered automatically by udev rules that match the master devices
|
||||
and load the protocol module with udev's module loader. This happens
|
||||
asynchronously to the rest of the systemd startup.
|
||||
|
||||
Once a RDMA device is created by the kernel then udev will cause systemd to
|
||||
schedule ULP module loading services (e.g. rdma-load-modules@.service) specific
|
||||
to the plugged hardware. If sysinit.target has not yet been passed then these
|
||||
loaders will defer sysinit.target until they complete, otherwise this is a hot
|
||||
plug event and things will load asynchronously to the boot up process.
|
||||
|
||||
Finally udev will cause systemd to start RDMA specific daemons like
|
||||
srp_daemon, rdma-ndd and iwpmd. These starts are linked to the detection of
|
||||
the first RDMA hardware, and the daemons internally handle hot plug events for
|
||||
other hardware.
|
||||
|
||||
## Hot Plug compatible services
|
||||
|
||||
Services using RDMA need to have device specific systemd dependencies in their
|
||||
unit files, either created by hand by the admin or by using udev rules.
|
||||
|
||||
For instance, a service that uses /dev/infiniband/umad0 requires:
|
||||
|
||||
```
|
||||
After=dev-infiniband-umad0.device
|
||||
BindsTo=dev-infiniband-umad0.device
|
||||
```
|
||||
|
||||
Which will ensure the service will not run until the required umad device
|
||||
appears, and will be stopped if the umad device is unplugged.
|
||||
|
||||
This is similar to how systemd handles mounting filesystems and configuring
|
||||
ethernet devices.
|
||||
|
||||
## Interaction with legacy non-hotplug services
|
||||
|
||||
Services that cannot handle hot plug must be ordered after
|
||||
systemd-udev-settle.service, which will wait for udev to complete loading
|
||||
modules and scheduling systemd services. This ensures that all RDMA hardware
|
||||
present at boot is setup before proceeding to run the le.g.acy service.
|
||||
|
||||
Admins using le.g.acy services can also place their RDMA hardware modules
|
||||
(e.g. mlx4_ib) directly in /etc/modules-load.d/ or in their initrd which will
|
||||
cause systemd to defer passing to sysinit.target until all RDMA hardware is
|
||||
setup, this is usually sufficient for le.g.acy services. This is probably the
|
||||
default behavior in many configurations.
|
||||
|
||||
# Systemd Ordering
|
||||
|
||||
Within rdma-core we have a series of units which run in the pre `basic.target`
|
||||
world to setup kernel services:
|
||||
|
||||
- `iwpmd`
|
||||
- `rdma-ndd`
|
||||
- `rdma-load-modules@.service`
|
||||
- `ibacmd.socket`
|
||||
|
||||
These special units use DefaultDependencies=no and order before any other unit that
|
||||
uses DefaultDependencies=yes. This will happen even in the case of hotplug.
|
||||
|
||||
Units for normal rdma-using daemons should use DefaultDependencies=yes, and
|
||||
either this pattern for 'any RDMA device':
|
||||
|
||||
```
|
||||
[Unit]
|
||||
# Order after rdma-hw.target has become active and setup the kernel services
|
||||
Requires=rdma-hw.target
|
||||
After=rdma-hw.target
|
||||
|
||||
[Install]
|
||||
# Autostart when RDMA hardware is present
|
||||
WantedBy=rdma-hw.target
|
||||
```
|
||||
|
||||
Or this pattern for a specific RDMA device:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
# Order after RDMA services are setup
|
||||
After=rdma-hw.target
|
||||
# Run only while a specific umad device is present
|
||||
After=dev-infiniband-umad0.device
|
||||
BindsTo=dev-infiniband-umad0.device
|
||||
|
||||
[Install]
|
||||
# Schedual the unit to be runnable when RDMA hardware is present, but
|
||||
# it will only start once the requested device actuall appears.
|
||||
WantedBy=rdma-hw.target
|
||||
```
|
||||
|
||||
Note, the above does explicitly reference `After=rdma-hw.target` even though
|
||||
all the current constituents of that target order before
|
||||
`sysinit.target`. This is to provide greater flexibility in the future.
|
||||
|
||||
## rdma-hw.target
|
||||
|
||||
This target is Wanted automatically by udev as soon as any RDMA hardware is
|
||||
plugged in or becomes available at boot.
|
||||
|
||||
This may be used to pull in rdma management daemons dynamically when RDMA
|
||||
hardware is found. Such daemons should use:
|
||||
|
||||
```
|
||||
[Install]
|
||||
WantedBy=rdma-hw.target
|
||||
```
|
||||
|
||||
In their unit files.
|
||||
|
||||
`rdma-hw.target` is also a synchronization point that orders after the low level,
|
||||
pre `sysinit.target` RDMA related units have been started.
|
|
@ -1,165 +0,0 @@
|
|||
# Overall Package Version
|
||||
|
||||
This version number is set in the top level CMakeLists.txt:
|
||||
|
||||
```sh
|
||||
set(PACKAGE_VERSION "11")
|
||||
````
|
||||
|
||||
For upstream releases this is a single integer showing the release
|
||||
ordering. We do not attempt to encode any 'ABI' information in this version.
|
||||
|
||||
Branched stabled releases can append an additional counter eg `11.2`.
|
||||
|
||||
Unofficial releases should include a distributor tag, eg '11.vendor2'.
|
||||
|
||||
When the PACKAGE_VERSION is changed, the packaging files should be updated:
|
||||
|
||||
```diff
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index a2464ec5..cf237904 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -44,7 +44,7 @@ endif()
|
||||
set(PACKAGE_NAME "RDMA")
|
||||
|
||||
# See Documentation/versioning.md
|
||||
-set(PACKAGE_VERSION "15")
|
||||
+set(PACKAGE_VERSION "16")
|
||||
# When this is changed the values in these files need changing too:
|
||||
# debian/libibverbs1.symbols
|
||||
# libibverbs/libibverbs.map
|
||||
diff --git a/debian/changelog b/debian/changelog
|
||||
index 86b402f4..9ee7fe16 100644
|
||||
--- a/debian/changelog
|
||||
+++ b/debian/changelog
|
||||
@@ -1,4 +1,4 @@
|
||||
-rdma-core (15-1) unstable; urgency=low
|
||||
+rdma-core (16-1) unstable; urgency=low
|
||||
|
||||
* New version.
|
||||
* Adding debian/copyright.
|
||||
diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec
|
||||
index cc0c3ba0..62334730 100644
|
||||
--- a/redhat/rdma-core.spec
|
||||
+++ b/redhat/rdma-core.spec
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: rdma-core
|
||||
-Version: 15
|
||||
+Version: 16
|
||||
Release: 1%{?dist}
|
||||
Summary: RDMA core userspace libraries and daemons
|
||||
|
||||
diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec
|
||||
index 76ca7286..a19f9e01 100644
|
||||
--- a/suse/rdma-core.spec
|
||||
+++ b/suse/rdma-core.spec
|
||||
@@ -19,7 +19,7 @@
|
||||
%bcond_without systemd
|
||||
%define git_ver %{nil}
|
||||
Name: rdma-core
|
||||
-Version: 15
|
||||
+Version: 16
|
||||
Release: 0
|
||||
Summary: RDMA core userspace libraries and daemons
|
||||
License: GPL-2.0 or BSD-2-Clause
|
||||
|
||||
```
|
||||
|
||||
# Shared Library Versions
|
||||
|
||||
The shared libraries use the typical semantic versioning scheme, eg
|
||||
*libibumad* has a version like `3.1.11`.
|
||||
|
||||
The version number is broken up into three fields:
|
||||
- '3' is called the SONAME and is embedded into the ELF:
|
||||
```sh
|
||||
$ readelf -ds build/lib/libibumad.so.3.1.11
|
||||
0x000000000000000e (SONAME) Library soname: [libibumad.so.3]
|
||||
```
|
||||
|
||||
We do not expect this value to ever change for our libraries. It indicates
|
||||
the overall ABI, changing it means the library will not dynamically to old
|
||||
programs link anymore.
|
||||
|
||||
- '1' is called the ABI level and is used within the ELF as the last component
|
||||
symbol version tag. This version must be changed every time a new symbol
|
||||
is introduced. It allows the user to see what version of the ABI the
|
||||
library provides.
|
||||
|
||||
- '11' is the overall release number and is copied from `PACKAGE_VERSION` This
|
||||
version increases with every package release, even if the library code did
|
||||
not change. It allows the user to see what upstream source was used to build
|
||||
the library.
|
||||
|
||||
This version is encoded into the filename `build/lib/libibumad.so.3.1.11` and
|
||||
a symlink from `libibumad.so.3` to `build/lib/libibumad.so.3.1.11` is created.
|
||||
|
||||
## Shared Library Symbol Versions
|
||||
|
||||
Symbol versions are a linker technique that lets the library author provide
|
||||
two symbols with different ABIs that have the same API name. The linker
|
||||
differentiates the two cases internally. This allows the library author to
|
||||
change the ABI that the API uses. This project typically does not make use of
|
||||
this feature.
|
||||
|
||||
As a secondary feature, the symbol version is also used by package managers
|
||||
like RPM to manage the ABI level. To make this work properly the ABI level
|
||||
must be correctly encoded into the symbol version.
|
||||
|
||||
## Adding a new symbol
|
||||
|
||||
First, increase the ABI level of the library. It is safe to re-use the ABI
|
||||
level for multiple new functions within a single release, but once a release
|
||||
is tagged the ABI level becomes *immutable*. The maintainer can provide
|
||||
guidence on what ABI level to use for each series.
|
||||
|
||||
```diff
|
||||
rdma_library(ibumad libibumad.map
|
||||
# See Documentation/versioning.md
|
||||
- 3 3.1.${PACKAGE_VERSION}
|
||||
+ 3 3.2.${PACKAGE_VERSION}
|
||||
```
|
||||
|
||||
Next, add your new symbol to the symbol version file:
|
||||
|
||||
```diff
|
||||
+ IBUMAD_3.2 {
|
||||
+ global:
|
||||
+ umad_new_symbol;
|
||||
+ } IBUMAD_1.0;
|
||||
```
|
||||
|
||||
NOTE: Once a release is made the stanzas in the map file are *immutable* and
|
||||
cannot be changed. Do not add your new symbol to old stanzas.
|
||||
|
||||
The new symbol should appear in the ELF:
|
||||
|
||||
```sh
|
||||
$ readelf -s build/lib/libibumad.so.3.1.11
|
||||
35: 00000000000031e0 450 FUNC GLOBAL DEFAULT 12 umad_new_symbol@@IBUMAD_3.2
|
||||
```
|
||||
|
||||
Finally update the `debian/libibumad3.symbols` file.
|
||||
|
||||
## Private symbols in libibverbs
|
||||
|
||||
Many symbols in libibverbs are private to rdma-core, they are being marked in
|
||||
the map file using the IBVERBS_PRIVATE_ prefix.
|
||||
|
||||
For simplicity, there is only one version of the private symbol version
|
||||
stanza, and it is bumped whenever any change (add/remove/modify) to any of the
|
||||
private ABI is done. This makes it very clear if an incompatible provider is
|
||||
being used with libibverbs.
|
||||
|
||||
Due to this there is no reason to provide compat symbol versions for the
|
||||
private ABI.
|
||||
|
||||
### Use of private symbols between component packages
|
||||
|
||||
A distribution packaging system still must have the correct dependencies
|
||||
between libraries within rdma-core that may use these private symbols.
|
||||
|
||||
For this reason the private symbols can only be used by provider libraries and
|
||||
the distribution must ensure that a matched set of provider libraries and
|
||||
libibverbs are installed.
|
|
@ -1,178 +0,0 @@
|
|||
List of maintainers
|
||||
|
||||
Generally patches should be submitted to the main development mailing list:
|
||||
|
||||
linux-rdma@vger.kernel.org
|
||||
|
||||
Descriptions of section entries:
|
||||
F: Files and directories with wildcard patterns.
|
||||
A trailing slash includes all files and subdirectory files.
|
||||
F: providers/mlx4/ all files in and below providers/mlx4/
|
||||
F: providers/* all files in providers, but not below
|
||||
F: */net/* all files in "any top level directory"/net
|
||||
One pattern per line. Multiple F: lines acceptable.
|
||||
H: Historical authors
|
||||
L: Mailing list that is relevant to this area
|
||||
M: Designated reviewer: FullName <address@domain>
|
||||
These reviewers should be CCed on patches.
|
||||
S: Status, one of the following:
|
||||
Supported: Someone is actually paid to look after this.
|
||||
Maintained: Someone actually looks after it.
|
||||
Odd Fixes: It has a maintainer but they don't have time to do
|
||||
much other than throw the odd patch in. See below..
|
||||
Orphan: No current maintainer [but maybe you could take the
|
||||
role as you write your new code].
|
||||
Obsolete: Old code. Something tagged obsolete generally means
|
||||
it has been replaced by a better system and you
|
||||
should be using that.
|
||||
|
||||
-----------------------------------
|
||||
|
||||
* OVERALL PACKAGE
|
||||
M: Doug Ledford <dledford@redhat.com>
|
||||
M: Leon Romanovsky <leon@kernel.org>
|
||||
S: Supported
|
||||
|
||||
BUILD SYSTEM
|
||||
M: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
|
||||
S: Supported
|
||||
F: */CMakeLists.txt
|
||||
F: */lib*.map
|
||||
F: buildlib/
|
||||
|
||||
BNXT_RE USERSPACE PROVIDER (for bnxt_re.ko)
|
||||
M: Devesh Sharma <Devesh.sharma@broadcom.com>
|
||||
S: Supported
|
||||
F: providers/bnxt_re/
|
||||
|
||||
CXGB3 USERSPACE PROVIDER (for iw_cxgb3.ko)
|
||||
M: Steve Wise <swise@opengridcomputing.com>
|
||||
S: Supported
|
||||
F: providers/cxgb3/
|
||||
|
||||
CXGB4 USERSPACE PROVIDER (for iw_cxgb4.ko)
|
||||
M: Steve Wise <swise@opengridcomputing.com>
|
||||
S: Supported
|
||||
F: providers/cxgb4/
|
||||
|
||||
HF1 USERSPACE PROVIDER (for hf1.ko)
|
||||
M: Mike Marciniszyn <mike.marciniszyn@intel.com>
|
||||
M: Dennis Dalessandro <dennis.dalessandro@intel.com>
|
||||
S: Supported
|
||||
L: intel-opa@lists.01.org (moderated for non-subscribers)
|
||||
F: providers/hfi1verbs/
|
||||
|
||||
HNS USERSPACE PROVIDER (for hns-roce.ko)
|
||||
M: Lijun Ou <oulijun@huawei.com>
|
||||
M: Wei Hu(Xavier) <xavier.huwei@huawei.com>
|
||||
S: Supported
|
||||
F: providers/hns/
|
||||
|
||||
I40IW USERSPACE PROVIDER (for i40iw.ko)
|
||||
M: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
|
||||
S: Supported
|
||||
F: providers/i40iw/
|
||||
|
||||
RDMA Communication Manager Assistant (for librdmacm.so)
|
||||
M: Sean Hefty <sean.hefty@intel.com>
|
||||
M: Hal Rosenstock <hal@dev.mellanox.co.il>
|
||||
S: Supported
|
||||
F: ibacm/*
|
||||
|
||||
IPATH/QIB USERSPACE PROVIDER (for ib_qib.ko)
|
||||
M: Mike Marciniszyn <mike.marciniszyn@intel.com>
|
||||
M: Dennis Dalessandro <dennis.dalessandro@intel.com>
|
||||
L: infinipath@intel.com
|
||||
S: Supported
|
||||
F: providers/ipathverbs/
|
||||
|
||||
IWARP PORT MAPPER DAEMON (for iwarp kernel providers)
|
||||
M: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
|
||||
M: Steve Wise <swise@opengridcomputing.com>
|
||||
H: Robert Sharp <robert.o.sharp@intel.com>
|
||||
S: Supported
|
||||
F: iwpmd/
|
||||
|
||||
LIBIBCM USERSPACE LIBRARY FOR IB CONNECTION MANAGEMENT (/dev/infiniband/ucmX)
|
||||
M: Sean Hefty <sean.hefty@intel.com>
|
||||
H: Libor Michalek <libor@topspin.com>
|
||||
S: Obsolete
|
||||
F: libibcm/
|
||||
|
||||
LIBIBUMAD USERSPACE LIBRARY FOR SMP AND GMP MAD PROCESSING (/dev/infiniband/umadX)
|
||||
M: Hal Rosenstock <hal@dev.mellanox.co.il>
|
||||
H: Sasha Khapyorsky <sashak@voltaire.com>
|
||||
H: Shahar Frank <shahar@voltaire.com>
|
||||
S: Supported
|
||||
F: libibumad/
|
||||
|
||||
LIBIBVERBS USERSPACE LIBRARY FOR RDMA VERBS (/dev/infiniband/uverbsX)
|
||||
M: Doug Ledford <dledford@redhat.com>
|
||||
M: Yishai Hadas <yishaih@dev.mellanox.co.il>
|
||||
H: Michael S. Tsirkin <mst@mellanox.co.il>
|
||||
H: Sean Hefty <sean.hefty@intel.com>
|
||||
H: Dotan Barak <dotanba@gmail.com>
|
||||
H: Roland Dreier <roland@topspin.com>
|
||||
S: Supported
|
||||
F: libibverbs/
|
||||
|
||||
LIBRDMACM USERSPACE LIBRARY FOR RDMA CONNECTION MANAGEMENT (/dev/infiniband/rdma_cm)
|
||||
M: Sean Hefty <sean.hefty@intel.com>
|
||||
S: Supported
|
||||
F: librdmacm/
|
||||
|
||||
MLX4 USERSPACE PROVIDER (for mlx4_ib.ko)
|
||||
M: Yishai Hadas <yishaih@mellanox.com>
|
||||
H: Roland Dreier <rolandd@cisco.com>
|
||||
S: Supported
|
||||
F: providers/mlx4/
|
||||
|
||||
MLX5 USERSPACE PROVIDER (for mlx5_ib.ko)
|
||||
M: Yishai Hadas <yishaih@mellanox.com>
|
||||
H: Eli Cohen <eli@mellanox.com>
|
||||
S: Supported
|
||||
F: providers/mlx5/
|
||||
|
||||
MTHCA USERSPACE PROVIDER (for ib_mthca.ko)
|
||||
M: Vladimir Sokolovsky <vlad@mellanox.com>
|
||||
H: Michael S. Tsirkin <mst@mellanox.co.il>
|
||||
H: Roland Dreier <roland@topspin.com>
|
||||
S: Supported
|
||||
F: providers/mthca/
|
||||
|
||||
NES USERSPACE PROVIDER (for iw_nes.ko)
|
||||
M: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
|
||||
S: Supported
|
||||
F: providers/nes/
|
||||
|
||||
OCRDMA USERSPACE PROVIDER (for ocrdma.ko)
|
||||
M: Devesh Sharma <Devesh.sharma@broadcom.com>
|
||||
S: Supported
|
||||
F: providers/ocrdma/
|
||||
|
||||
QEDR USERSPACE PROVIDER (for qedr.ko)
|
||||
M: Ram Amrani <Ram.Amrani@cavium.com>
|
||||
M: Ariel Elior <Ariel.Elior@cavium.com>
|
||||
S: Supported
|
||||
F: providers/qedr/
|
||||
|
||||
RXE SOFT ROCEE USERSPACE PROVIDER (for rdma_rxe.ko)
|
||||
M: Moni Shoua <monis@mellanox.com>
|
||||
S: Supported
|
||||
F: providers/rxe/
|
||||
|
||||
SRP DAEMON (for ib_srp.ko)
|
||||
M: Bart Van Assche <bvanassche@acm.org>
|
||||
S: Supported
|
||||
F: srp_daemon/
|
||||
|
||||
SUSE PACKAGING
|
||||
M: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.de>
|
||||
S: Supported
|
||||
F: suse/
|
||||
|
||||
VMWARE PVRDMA USERSPACE PROVIDER (for vmw_pvrdma.ko)
|
||||
M: Adit Ranadive <aditr@vmware.com>
|
||||
L: pv-drivers@vmware.com
|
||||
S: Supported
|
||||
F: providers/vmw_pvrdma/
|
|
@ -1,129 +0,0 @@
|
|||
[](https://travis-ci.org/linux-rdma/rdma-core)
|
||||
|
||||
# RDMA Core Userspace Libraries and Daemons
|
||||
|
||||
This is the userspace components for the Linux Kernel's drivers/infiniband
|
||||
subsystem. Specifically this contains the userspace libraries for the
|
||||
following device nodes:
|
||||
|
||||
- /dev/infiniband/uverbsX (libibverbs)
|
||||
- /dev/infiniband/rdma_cm (librdmacm)
|
||||
- /dev/infiniband/umadX (libibumad)
|
||||
- /dev/infiniband/ucmX (libibcm, deprecated)
|
||||
|
||||
The userspace component of the libibverbs RDMA kernel drivers are included
|
||||
under the providers/ directory. Support for the following Kernel RDMA drivers
|
||||
is included:
|
||||
|
||||
- iw_cxgb3.ko
|
||||
- iw_cxgb4.ko
|
||||
- hfi1.ko
|
||||
- hns-roce.ko
|
||||
- i40iw.ko
|
||||
- ib_qib.ko
|
||||
- mlx4_ib.ko
|
||||
- mlx5_ib.ko
|
||||
- ib_mthca.ko
|
||||
- iw_nes.ko
|
||||
- ocrdma.ko
|
||||
- qedr.ko
|
||||
- rdma_rxe.ko
|
||||
- vmw_pvrdma.ko
|
||||
|
||||
Additional service daemons are provided for:
|
||||
- srp_daemon (ib_srp.ko)
|
||||
- iwpmd (for iwarp kernel providers)
|
||||
- ibacm (for InfiniBand communication management assistant)
|
||||
|
||||
# Building
|
||||
|
||||
This project uses a cmake based build system. Quick start:
|
||||
|
||||
```sh
|
||||
$ bash build.sh
|
||||
```
|
||||
|
||||
*build/bin* will contain the sample programs and *build/lib* will contain the
|
||||
shared libraries. The build is configured to run all the programs 'in-place'
|
||||
and cannot be installed.
|
||||
|
||||
NOTE: It is not currently easy to run from the build directory, the plugins
|
||||
only load from the system path.
|
||||
|
||||
### Debian Derived
|
||||
|
||||
```sh
|
||||
$ apt-get install build-essential cmake gcc libudev-dev libnl-3-dev libnl-route-3-dev ninja-build pkg-config valgrind
|
||||
```
|
||||
|
||||
### Fedora
|
||||
|
||||
```sh
|
||||
$ dnf install cmake gcc libnl3-devel libudev-devel pkgconfig valgrind-devel ninja-build
|
||||
```
|
||||
|
||||
NOTE: Fedora Core uses the name 'ninja-build' for the 'ninja' command.
|
||||
|
||||
### OpenSuSE
|
||||
|
||||
```sh
|
||||
$ zypper install cmake gcc libnl3-devel libudev-devel ninja pkg-config valgrind-devel
|
||||
```
|
||||
|
||||
## Building on CentOS 6/7
|
||||
|
||||
Install required packages:
|
||||
|
||||
```sh
|
||||
$ yum install cmake gcc libnl3-devel libudev-devel make pkgconfig valgrind-devel
|
||||
```
|
||||
|
||||
Developers on CentOS 7 are suggested to install more modern tooling for the
|
||||
best experience.
|
||||
|
||||
```sh
|
||||
$ yum install epel-release
|
||||
$ yum install cmake3 unzip ninja-build
|
||||
```
|
||||
|
||||
NOTE: EPEL uses the name 'ninja-build' for the 'ninja' command, and 'cmake3'
|
||||
for the 'cmake' command.
|
||||
|
||||
# Reporting bugs
|
||||
|
||||
Bugs should be reported to the <linux-rdma@vger.kernel.org> mailing list
|
||||
In your bug report, please include:
|
||||
|
||||
* Information about your system:
|
||||
- Linux distribution and version
|
||||
- Linux kernel and version
|
||||
- InfiniBand hardware and firmware version
|
||||
- ... any other relevant information
|
||||
|
||||
* How to reproduce the bug.
|
||||
|
||||
* If the bug is a crash, the exact output printed out when the crash
|
||||
occurred, including any kernel messages produced.
|
||||
|
||||
# Submitting patches
|
||||
|
||||
Patches should also be submitted to the <linux-rdma@vger.kernel.org>
|
||||
mailing list. Please use unified diff form (the -u option to GNU diff),
|
||||
and include a good description of what your patch does and why it should
|
||||
be applied. If your patch fixes a bug, please make sure to describe the
|
||||
bug and how your fix works.
|
||||
|
||||
Make sure that your contribution can be licensed under the same
|
||||
license as the original code you are patching, and that you have all
|
||||
necessary permissions to release your work.
|
||||
|
||||
## TravisCI
|
||||
|
||||
Submitted patches must pass the TravisCI automatic builds without warnings.
|
||||
A build similar to TravisCI can be run locally using docker and the
|
||||
'buildlib/cbuild' script.
|
||||
|
||||
```sh
|
||||
$ buildlib/cbuild build-images travis
|
||||
$ buildlib/cbuild pkg travis
|
||||
```
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SRCDIR=`dirname $0`
|
||||
BUILDDIR="$SRCDIR/build"
|
||||
|
||||
mkdir -p "$BUILDDIR"
|
||||
|
||||
if hash cmake3 2>/dev/null; then
|
||||
# CentOS users are encouraged to install cmake3 from EPEL
|
||||
CMAKE=cmake3
|
||||
else
|
||||
CMAKE=cmake
|
||||
fi
|
||||
|
||||
if hash ninja-build 2>/dev/null; then
|
||||
# Fedora uses this name
|
||||
NINJA=ninja-build
|
||||
elif hash ninja 2>/dev/null; then
|
||||
NINJA=ninja
|
||||
fi
|
||||
|
||||
cd "$BUILDDIR"
|
||||
|
||||
if [ "x$NINJA" == "x" ]; then
|
||||
$CMAKE -DIN_PLACE=1 ..
|
||||
make
|
||||
else
|
||||
$CMAKE -DIN_PLACE=1 -GNinja ..
|
||||
$NINJA
|
||||
fi
|
|
@ -1,52 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
# find_package helper to detect symbol version support in the compiler and
|
||||
# linker. If supported then LDSYMVER_MODE will be set to GNU
|
||||
|
||||
# Basic sample GNU style map file
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test.map" "
|
||||
IBVERBS_1.0 {
|
||||
global:
|
||||
ibv_get_device_list;
|
||||
local: *;
|
||||
};
|
||||
|
||||
IBVERBS_1.1 {
|
||||
global:
|
||||
ibv_get_device_list;
|
||||
} IBVERBS_1.0;
|
||||
")
|
||||
|
||||
# See RDMA_CHECK_C_LINKER_FLAG
|
||||
set(SAFE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
set(SAFE_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||
if (POLICY CMP0056)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/test.map")
|
||||
else()
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/test.map")
|
||||
endif()
|
||||
|
||||
# And matching source, this also checks that .symver asm works
|
||||
check_c_source_compiles("
|
||||
void ibv_get_device_list_1(void);
|
||||
void ibv_get_device_list_1(void){}
|
||||
asm(\".symver ibv_get_device_list_1, ibv_get_device_list@IBVERBS_1.1\");
|
||||
void ibv_get_device_list_0(void);
|
||||
void ibv_get_device_list_0(void){}
|
||||
asm(\".symver ibv_get_device_list_0, ibv_get_device_list@@IBVERBS_1.0\");
|
||||
|
||||
int main(int argc,const char *argv[]){return 0;}" _LDSYMVER_SUCCESS)
|
||||
|
||||
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test.map")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${SAFE_CMAKE_EXE_LINKER_FLAGS}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${SAFE_CMAKE_REQUIRED_LIBRARIES}")
|
||||
|
||||
if (_LDSYMVER_SUCCESS)
|
||||
set(LDSYMVER_MODE "GNU" CACHE INTERNAL "How to set symbol versions on shared libraries")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
LDSymVer
|
||||
REQUIRED_VARS LDSYMVER_MODE
|
||||
)
|
|
@ -1,30 +0,0 @@
|
|||
# COPYRIGHT (c) 2015 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
find_path(LIBSYSTEMD_INCLUDE_DIRS "systemd/sd-journal.h")
|
||||
|
||||
if (LIBSYSTEMD_INCLUDE_DIRS)
|
||||
set(SYSTEMD_INCLUDE_DIRS ${LIBSYSTEMD_INCLUDE_DIRS})
|
||||
find_library(LIBSYSTEMD_LIBRARY NAMES systemd libsystemd)
|
||||
# Older systemd uses a split library
|
||||
if (NOT LIBSYSTEMD_LIBRARY)
|
||||
find_library(LIBSYSTEMD_JOURNAL_LIBRARY NAMES systemd-journal libsystemd-journal)
|
||||
find_library(LIBSYSTEMD_ID128_LIBRARY NAMES systemd-id128 libsystemd-id128)
|
||||
find_library(LIBSYSTEMD_DAEMON_LIBRARY NAMES systemd-daemon libsystemd-daemon)
|
||||
|
||||
if (LIBSYSTEMD_JOURNAL_LIBRARY AND LIBSYSTEMD_ID128_LIBRARY AND LIBSYSTEMD_DAEMON_LIBRARY)
|
||||
set(SYSTEMD_LIBRARIES
|
||||
${LIBSYSTEMD_JOURNAL_LIBRARY}
|
||||
${LIBSYSTEMD_ID128_LIBRARY}
|
||||
${LIBSYSTEMD_DAEMON_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
set(SYSTEMD_LIBRARIES ${LIBSYSTEMD_LIBRARY})
|
||||
endif()
|
||||
set(SYSTEMD_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Systemd REQUIRED_VARS SYSTEMD_LIBRARIES LIBSYSTEMD_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(LIBSYSTEMD_LIBRARY LIBSYSTEMD_JOURNAL_LIBRARY LIBSYSTEMD_ID128_LIBRARY LIBSYSTEMD_DAEMON_LIBRARY)
|
|
@ -1,11 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
find_library(LIBUDEV_LIBRARY NAMES udev libudev)
|
||||
|
||||
set(UDEV_LIBRARIES ${LIBUDEV_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(UDev REQUIRED_VARS LIBUDEV_LIBRARY)
|
||||
|
||||
mark_as_advanced(LIBUDEV_LIBRARY)
|
|
@ -1,42 +0,0 @@
|
|||
# COPYRIGHT (c) 2015 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
function(RDMA_BuildType)
|
||||
set(build_types Debug Release RelWithDebInfo MinSizeRel)
|
||||
|
||||
# Set the default build type to RelWithDebInfo. Since RDMA is typically used
|
||||
# in performance contexts it doesn't make much sense to have the default build
|
||||
# turn off the optimizer.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE String
|
||||
"Options are ${build_types}"
|
||||
FORCE
|
||||
)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${build_types})
|
||||
endif()
|
||||
|
||||
# Release should be used by packagers, it is the same as the default RelWithDebInfo,
|
||||
# this means it uses -O2 and -DNDEBUG (not -O3)
|
||||
foreach (language CXX C)
|
||||
set(VAR_TO_MODIFY "CMAKE_${language}_FLAGS_RELEASE")
|
||||
if ("${${VAR_TO_MODIFY}}" STREQUAL "${${VAR_TO_MODIFY}_INIT}")
|
||||
set(${VAR_TO_MODIFY} "${CMAKE_${language}_FLAGS_RELWITHDEBINFO_INIT}"
|
||||
CACHE STRING "Default flags for Release configuration" FORCE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# RelWithDebInfo should be used by developers, it is the same as Release but
|
||||
# with the -DNDEBUG removed
|
||||
foreach (language CXX C)
|
||||
set(VAR_TO_MODIFY "CMAKE_${language}_FLAGS_RELWITHDEBINFO")
|
||||
if (${${VAR_TO_MODIFY}} STREQUAL ${${VAR_TO_MODIFY}_INIT})
|
||||
string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )"
|
||||
" "
|
||||
replacement
|
||||
"${${VAR_TO_MODIFY}}"
|
||||
)
|
||||
set(${VAR_TO_MODIFY} "${replacement}"
|
||||
CACHE STRING "Default flags for RelWithDebInfo configuration" FORCE)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
|
@ -1,38 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
# Execute a header fixup based on NOT_NEEDED for HEADER
|
||||
|
||||
# The buildlib includes alternate header file shims for several scenarios, if
|
||||
# the build system detects a feature is present then it should call RDMA_DoFixup
|
||||
# with the test as true. If false then the shim header will be installed.
|
||||
|
||||
# Typically the shim header will replace a missing header with stubs, or it
|
||||
# will augment an existing header with include_next.
|
||||
function(RDMA_DoFixup not_needed header)
|
||||
cmake_parse_arguments(ARGS "NO_SHIM" "" "" ${ARGN})
|
||||
string(REPLACE / - header-bl ${header})
|
||||
|
||||
if (NOT EXISTS "${BUILDLIB}/fixup-include/${header-bl}")
|
||||
# NO_SHIM lets cmake succeed if the header exists in the system but no
|
||||
# shim is provided, but this will always fail if the shim is needed but
|
||||
# does not exist.
|
||||
if (NOT ARGS_NO_SHIM OR NOT "${not_needed}")
|
||||
message(FATAL_ERROR "Fixup header ${BUILDLIB}/fixup-include/${header-bl} is not present")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(DEST "${BUILD_INCLUDE}/${header}")
|
||||
if (NOT "${not_needed}")
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.12")
|
||||
get_filename_component(DIR ${DEST} PATH)
|
||||
else()
|
||||
get_filename_component(DIR ${DEST} DIRECTORY)
|
||||
endif()
|
||||
file(MAKE_DIRECTORY "${DIR}")
|
||||
|
||||
rdma_create_symlink("${BUILDLIB}/fixup-include/${header-bl}" "${DEST}")
|
||||
else()
|
||||
file(REMOVE ${DEST})
|
||||
endif()
|
||||
endfunction()
|
|
@ -1,57 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
# cmake does not have way to do this even slightly sanely until CMP0056
|
||||
function(RDMA_CHECK_C_LINKER_FLAG FLAG CACHE_VAR)
|
||||
set(SAFE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
set(SAFE_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||
|
||||
if (POLICY CMP0056)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}")
|
||||
else()
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${FLAG}")
|
||||
endif()
|
||||
|
||||
CHECK_C_COMPILER_FLAG("" ${CACHE_VAR})
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${SAFE_CMAKE_EXE_LINKER_FLAGS}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${SAFE_CMAKE_REQUIRED_LIBRARIES}")
|
||||
endfunction()
|
||||
|
||||
# Test if the CC compiler supports the linker flag and if so add it to TO_VAR
|
||||
function(RDMA_AddOptLDFlag TO_VAR CACHE_VAR FLAG)
|
||||
RDMA_CHECK_C_LINKER_FLAG("${FLAG}" ${CACHE_VAR})
|
||||
if (${CACHE_VAR})
|
||||
SET(${TO_VAR} "${${TO_VAR}} ${FLAG}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Test if the CC compiler supports the flag and if so add it to TO_VAR
|
||||
function(RDMA_AddOptCFlag TO_VAR CACHE_VAR FLAG)
|
||||
CHECK_C_COMPILER_FLAG("${FLAG}" ${CACHE_VAR})
|
||||
if (${CACHE_VAR})
|
||||
SET(${TO_VAR} "${${TO_VAR}} ${FLAG}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Enable the minimum required gnu11 standard in the compiler
|
||||
# This was introduced in GCC 4.7
|
||||
function(RDMA_EnableCStd)
|
||||
if (HAVE_SPARSE)
|
||||
# Sparse doesn't support gnu11, but doesn't fail if the option is present,
|
||||
# force gnu99 instead.
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||
# Check for support of the usual flag
|
||||
CHECK_C_COMPILER_FLAG("-std=gnu11" SUPPORTS_GNU11)
|
||||
if (SUPPORTS_GNU11)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11" PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
# Newer cmake can do this internally
|
||||
set(CMAKE_C_STANDARD 11 PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
|
@ -1,98 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
# Check that the system kernel headers are new enough, if not replace the
|
||||
# headers with our internal copy.
|
||||
|
||||
set(DEFAULT_TEST "int main(int argc,const char *argv[]) {return 1;}")
|
||||
set(MISSING_HEADERS "")
|
||||
|
||||
function(rdma_canon_header PATH OUT_VAR)
|
||||
string(TOUPPER "${PATH}" HAVE)
|
||||
string(REPLACE " " "_" HAVE "${HAVE}")
|
||||
string(REPLACE "/" "_" HAVE "${HAVE}")
|
||||
string(REPLACE "." "_" HAVE "${HAVE}")
|
||||
set("${OUT_VAR}" "HAVE_${HAVE}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(rdma_check_kheader PATH C_TEST)
|
||||
cmake_parse_arguments(ARGS "NO_SHIM;OPTIONAL" "" "" ${ARGN})
|
||||
|
||||
rdma_canon_header("${PATH}" HAVE)
|
||||
|
||||
if(KERNEL_DIR)
|
||||
# Drop a symlink back to the kernel into our include/ directory
|
||||
if (EXISTS "${KERNEL_DIR}/include/uapi/${PATH}")
|
||||
set(DEST "${BUILD_INCLUDE}/${PATH}")
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.12")
|
||||
get_filename_component(DIR ${DEST} PATH)
|
||||
else()
|
||||
get_filename_component(DIR ${DEST} DIRECTORY)
|
||||
endif()
|
||||
file(MAKE_DIRECTORY "${DIR}")
|
||||
|
||||
# We cannot just -I the kernel UAPI dir, it depends on some
|
||||
# post-processing of things like linux/stddef.h. Instead we symlink the
|
||||
# kernel headers into our tree and rely on the distro's fixup of
|
||||
# non-rdma headers. The RDMA headers are all compatible with this
|
||||
# scheme.
|
||||
rdma_create_symlink("${KERNEL_DIR}/include/uapi/${PATH}" "${DEST}")
|
||||
else()
|
||||
message(FATAL_ERROR "Kernel tree does not contain expected UAPI header"
|
||||
"${KERNEL_DIR}/include/uapi/${PATH}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES "${BUILD_INCLUDE}")
|
||||
endif()
|
||||
|
||||
# Note: The RDMA kernel headers use sockaddr{_in,_in6,}/etc so we have to
|
||||
# include system headers to define sockaddrs before testing any of them.
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <${PATH}>
|
||||
${C_TEST}" "${HAVE}")
|
||||
|
||||
if(KERNEL_DIR)
|
||||
if (NOT "${${HAVE}}")
|
||||
# Run the compile test against the linked kernel header, this is to help
|
||||
# make sure the compile tests work before the headers hit the distro
|
||||
message(FATAL_ERROR "Kernel UAPI header failed compile test" "${PATH}")
|
||||
endif()
|
||||
else()
|
||||
# NO_SHIM - means the header must exist in the system
|
||||
# NO_SHIM OPTIONAL - menas the header will be linked from KERNEL_DIR, but is ignored otherwise
|
||||
if (NOT ARGS_OPTIONAL)
|
||||
# because it is only used for setting up the kernel headers.
|
||||
if (ARGS_NO_SHIM)
|
||||
RDMA_DoFixup("${${HAVE}}" "${PATH}" NO_SHIM)
|
||||
else()
|
||||
RDMA_DoFixup("${${HAVE}}" "${PATH}")
|
||||
endif()
|
||||
|
||||
if (NOT "${${HAVE}}")
|
||||
list(APPEND MISSING_HEADERS "${PATH}")
|
||||
set(MISSING_HEADERS "${MISSING_HEADERS}" PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(rdma_report_missing_kheaders)
|
||||
foreach(I IN LISTS MISSING_HEADERS)
|
||||
message(STATUS " ${I} NOT found (old system kernel headers)")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# This list is topologically sorted
|
||||
rdma_check_kheader("rdma/ib_user_verbs.h" "${DEFAULT_TEST}" NO_SHIM OPTIONAL)
|
||||
rdma_check_kheader("rdma/ib_user_sa.h" "${DEFAULT_TEST}" NO_SHIM)
|
||||
rdma_check_kheader("rdma/ib_user_cm.h" "${DEFAULT_TEST}" NO_SHIM)
|
||||
rdma_check_kheader("rdma/hfi/hfi1_ioctl.h" "${DEFAULT_TEST}" NO_SHIM OPTIONAL)
|
||||
rdma_check_kheader("rdma/rdma_user_ioctl.h" "${DEFAULT_TEST}" NO_SHIM OPTIONAL)
|
||||
rdma_check_kheader("rdma/ib_user_mad.h" "${DEFAULT_TEST}" NO_SHIM OPTIONAL)
|
||||
rdma_check_kheader("rdma/rdma_netlink.h" "int main(int argc,const char *argv[]) { return RDMA_NL_IWPM_REMOTE_INFO && RDMA_NL_IWCM; }")
|
||||
rdma_check_kheader("rdma/rdma_user_cm.h" "${DEFAULT_TEST}" NO_SHIM OPTIONAL)
|
||||
rdma_check_kheader("rdma/rdma_user_rxe.h" "${DEFAULT_TEST}")
|
||||
rdma_check_kheader("rdma/vmw_pvrdma-abi.h" "${DEFAULT_TEST}")
|
|
@ -1,34 +0,0 @@
|
|||
# COPYRIGHT (c) 2017 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
function(RDMA_CheckSparse)
|
||||
# Sparse defines __CHECKER__, but only for the 'sparse pass', which has no
|
||||
# way to fail the compiler.
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#if __CHECKER__
|
||||
#warning \"SPARSE DETECTED\"
|
||||
#endif
|
||||
int main(int argc,const char *argv[]) {return 0;}
|
||||
"
|
||||
HAVE_NO_SPARSE
|
||||
FAIL_REGEX "SPARSE DETECTED")
|
||||
|
||||
if (HAVE_NO_SPARSE)
|
||||
set(HAVE_SPARSE FALSE PARENT_SCOPE)
|
||||
else()
|
||||
set(HAVE_SPARSE TRUE PARENT_SCOPE)
|
||||
|
||||
# Replace various glibc headers with our own versions that have embedded sparse annotations.
|
||||
execute_process(COMMAND "${BUILDLIB}/gen-sparse.py"
|
||||
"--out" "${BUILD_INCLUDE}/"
|
||||
"--src" "${CMAKE_SOURCE_DIR}/"
|
||||
RESULT_VARIABLE retcode)
|
||||
if(NOT "${retcode}" STREQUAL "0")
|
||||
message(FATAL_ERROR "glibc header file patching for sparse failed. Review include/*.rej and fix the rejects, then do "
|
||||
"${BUILDLIB}/gen-sparse.py -out ${BUILD_INCLUDE}/ --src ${CMAKE_SOURCE_DIR}/ --save")
|
||||
endif()
|
||||
|
||||
# Enable endian analysis in sparse
|
||||
add_definitions("-D__CHECK_ENDIAN__")
|
||||
endif()
|
||||
endfunction()
|
|
@ -1,789 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright 2015-2016 Obsidian Research Corp.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
# PYTHON_ARGCOMPLETE_OK
|
||||
"""cbuild - Build in a docker container
|
||||
|
||||
This script helps using docker containers to run software builds. This allows
|
||||
building for a wide range of distributions without having to install them.
|
||||
|
||||
Each target distribution has a base docker image and a set of packages to
|
||||
install. The first step is to build the customized docker container:
|
||||
|
||||
$ buildlib/cbuild build-images fc25
|
||||
|
||||
This will download the base image and customize it with the required packages.
|
||||
|
||||
Next, a build can be performed 'in place'. This is useful to do edit/compile
|
||||
cycles with an alternate distribution.
|
||||
|
||||
$ buildlib/cbuild make fc25
|
||||
|
||||
The build output will be placed in build-fc25
|
||||
|
||||
Finally, a full package build can be performed inside the container. Note this
|
||||
mode actually creates a source tree inside the container based on the current
|
||||
git HEAD commit, so any uncommitted edits will be lost.
|
||||
|
||||
$ buildlib/cbuild pkg fc25
|
||||
|
||||
In this case only the final package results are copied outside the container
|
||||
(to ..) and everything else is discarded.
|
||||
|
||||
In all cases the containers that are spun up are deleted after they are
|
||||
finished, only the base container created during 'build-images' is kept. The
|
||||
'--run-shell' option can be used to setup the container to the point of
|
||||
running the build command and instead run an interactive bash shell. This is
|
||||
useful for debugging certain kinds of build problems."""
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
import grp
|
||||
import imp
|
||||
import inspect
|
||||
import json
|
||||
import multiprocessing
|
||||
import os
|
||||
import pipes
|
||||
import pwd
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import yaml
|
||||
from contextlib import contextmanager;
|
||||
|
||||
project = "rdma-core";
|
||||
|
||||
def get_version():
|
||||
"""Return the version string for the project, this gets automatically written
|
||||
into the packaging files."""
|
||||
with open("CMakeLists.txt","r") as F:
|
||||
for ln in F:
|
||||
g = re.match(r'^set\(PACKAGE_VERSION "(.+)"\)',ln)
|
||||
if g is None:
|
||||
continue;
|
||||
return g.group(1);
|
||||
raise RuntimeError("Could not find version");
|
||||
|
||||
class DockerFile(object):
|
||||
def __init__(self,src):
|
||||
self.lines = ["FROM %s"%(src)];
|
||||
|
||||
class Environment(object):
|
||||
aliases = set();
|
||||
use_make = False;
|
||||
proxy = True;
|
||||
|
||||
def image_name(self):
|
||||
return "build-%s/%s"%(project,self.name);
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
class YumEnvironment(Environment):
|
||||
is_rpm = True;
|
||||
def get_docker_file(self):
|
||||
res = DockerFile(self.docker_parent);
|
||||
res.lines.append("RUN yum install -y %s && yum clean all"%(
|
||||
" ".join(sorted(self.pkgs))));
|
||||
return res;
|
||||
|
||||
class centos6(YumEnvironment):
|
||||
docker_parent = "centos:6";
|
||||
pkgs = {
|
||||
'cmake',
|
||||
'gcc',
|
||||
'libnl3-devel',
|
||||
'libudev-devel',
|
||||
'make',
|
||||
'pkgconfig',
|
||||
'python',
|
||||
'rpm-build',
|
||||
'valgrind-devel',
|
||||
};
|
||||
name = "centos6";
|
||||
use_make = True;
|
||||
|
||||
class centos7(YumEnvironment):
|
||||
docker_parent = "centos:7";
|
||||
pkgs = centos6.pkgs | {'systemd-devel'};
|
||||
name = "centos7";
|
||||
use_make = True;
|
||||
specfile = "redhat/rdma-core.spec";
|
||||
|
||||
class centos7_epel(centos7):
|
||||
pkgs = (centos7.pkgs - {"cmake","make"}) | {"ninja-build","cmake3"};
|
||||
name = "centos7_epel";
|
||||
use_make = False;
|
||||
ninja_cmd = "ninja-build";
|
||||
# Our spec file does not know how to cope with cmake3
|
||||
is_rpm = False;
|
||||
|
||||
def get_docker_file(self):
|
||||
res = YumEnvironment.get_docker_file(self);
|
||||
res.lines.insert(1,"RUN yum install -y epel-release");
|
||||
res.lines.append("RUN ln -s /usr/bin/cmake3 /usr/local/bin/cmake");
|
||||
return res;
|
||||
|
||||
class fc26(Environment):
|
||||
docker_parent = "fedora:26";
|
||||
pkgs = (centos7.pkgs - {"make"}) | {"ninja-build"};
|
||||
name = "fc26";
|
||||
specfile = "redhat/rdma-core.spec";
|
||||
ninja_cmd = "ninja-build";
|
||||
is_rpm = True;
|
||||
|
||||
def get_docker_file(self):
|
||||
res = DockerFile(self.docker_parent);
|
||||
res.lines.append("RUN dnf install -y %s && dnf clean all"%(
|
||||
" ".join(sorted(self.pkgs))));
|
||||
return res;
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
class APTEnvironment(Environment):
|
||||
is_deb = True;
|
||||
def get_docker_file(self):
|
||||
res = DockerFile(self.docker_parent);
|
||||
res.lines.append("RUN apt-get update && apt-get install -y --no-install-recommends %s && apt-get clean"%(
|
||||
" ".join(sorted(self.pkgs))));
|
||||
return res;
|
||||
|
||||
class trusty(APTEnvironment):
|
||||
docker_parent = "ubuntu:14.04";
|
||||
common_pkgs = {
|
||||
'build-essential',
|
||||
'cmake',
|
||||
'debhelper',
|
||||
'dh-systemd',
|
||||
'gcc',
|
||||
'libnl-3-dev',
|
||||
'libnl-route-3-dev',
|
||||
'libudev-dev',
|
||||
'make',
|
||||
'ninja-build',
|
||||
'pkg-config',
|
||||
'python',
|
||||
'valgrind',
|
||||
};
|
||||
pkgs = common_pkgs | {
|
||||
'libsystemd-daemon-dev',
|
||||
'libsystemd-id128-dev',
|
||||
'libsystemd-journal-dev',
|
||||
};
|
||||
name = "ubuntu-14.04";
|
||||
aliases = {"trusty"};
|
||||
|
||||
class xenial(APTEnvironment):
|
||||
docker_parent = "ubuntu:16.04"
|
||||
pkgs = trusty.common_pkgs | {"libsystemd-dev"};
|
||||
name = "ubuntu-16.04";
|
||||
aliases = {"xenial"};
|
||||
|
||||
class jessie(APTEnvironment):
|
||||
docker_parent = "debian:8"
|
||||
pkgs = xenial.pkgs;
|
||||
name = "debian-8";
|
||||
aliases = {"jessie"};
|
||||
|
||||
class stretch(APTEnvironment):
|
||||
docker_parent = "debian:9"
|
||||
pkgs = jessie.pkgs;
|
||||
name = "debian-9";
|
||||
aliases = {"stretch"};
|
||||
|
||||
class debian_experimental(APTEnvironment):
|
||||
docker_parent = "debian:experimental"
|
||||
pkgs = (stretch.pkgs ^ {"gcc"}) | {"gcc-7"};
|
||||
name = "debian-experimental";
|
||||
|
||||
def get_docker_file(self):
|
||||
res = DockerFile(self.docker_parent);
|
||||
res.lines.append("RUN apt-get update && apt-get -t experimental install -y --no-install-recommends %s && apt-get clean"%(
|
||||
" ".join(sorted(self.pkgs))));
|
||||
return res;
|
||||
|
||||
class travis(APTEnvironment):
|
||||
"""This parses the .travis.yml "apt" add on and converts it to a dockerfile,
|
||||
basically creating a container that is similar to what travis would
|
||||
use. Note this does not use the base travis image, nor does it install the
|
||||
typical travis packages."""
|
||||
docker_parent = "ubuntu:14.04";
|
||||
name = "travis";
|
||||
is_deb = True;
|
||||
_yaml = None;
|
||||
|
||||
def get_yaml(self):
|
||||
if self._yaml:
|
||||
return self._yaml;
|
||||
|
||||
# Load the commands from the travis file
|
||||
with open(".travis.yml") as F:
|
||||
self._yaml = yaml.load(F);
|
||||
return self._yaml;
|
||||
yaml = property(get_yaml);
|
||||
|
||||
def get_repos(self):
|
||||
"""Return a list of things to add with apt-add-repository"""
|
||||
Source = collections.namedtuple("Source",["sourceline","key_url"]);
|
||||
|
||||
# See https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
|
||||
pre_defined = {
|
||||
"ubuntu-toolchain-r-test": Source("ppa:ubuntu-toolchain-r/test",None),
|
||||
};
|
||||
|
||||
# Unique the sources
|
||||
res = set();
|
||||
for src in self.yaml["addons"]["apt"]["sources"]:
|
||||
if isinstance(src,dict):
|
||||
res.add(Source(sourceline=src["sourceline"],
|
||||
key_url=src.get("key_url",None)));
|
||||
else:
|
||||
res.add(pre_defined[src]);
|
||||
|
||||
# Add the sources
|
||||
scmds = [];
|
||||
scmds.extend("apt-key add /etc/apt/trusted.gpg.d/%s"%(os.path.basename(I.key_url))
|
||||
for I in res if I.key_url is not None);
|
||||
scmds.extend("http_proxy= apt-add-repository -y %s"%(pipes.quote(I.sourceline))
|
||||
for I in res);
|
||||
|
||||
# Download the keys
|
||||
cmds = ["ADD %s /etc/apt/trusted.gpg.d/"%(I.key_url)
|
||||
for I in res if I.key_url is not None];
|
||||
|
||||
cmds.append("RUN " + " && ".join(scmds));
|
||||
return cmds;
|
||||
|
||||
def get_before_script(self):
|
||||
"""Return a list of commands to run from before_script"""
|
||||
cmds = ["RUN useradd -ms /bin/bash travis && \\"
|
||||
"su -l -c %s"%(pipes.quote(" && ".join(self.yaml["before_script"]))) + " travis"];
|
||||
return cmds
|
||||
|
||||
def get_docker_file(self):
|
||||
# First this to get apt-add-repository
|
||||
self.pkgs = {"software-properties-common"}
|
||||
res = APTEnvironment.get_docker_file(self);
|
||||
|
||||
# Sources list from the travis.yml
|
||||
res.lines.extend(self.get_repos());
|
||||
|
||||
# Package list from the travis.yml
|
||||
res.lines.append("RUN apt-get update && apt-get install -y --no-install-recommends %s"%(
|
||||
" ".join(sorted(self.yaml["addons"]["apt"]["packages"]))));
|
||||
|
||||
# Adding before_script commands
|
||||
res.lines.extend(self.get_before_script())
|
||||
|
||||
return res;
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
class ZypperEnvironment(Environment):
|
||||
is_rpm = True;
|
||||
def get_docker_file(self):
|
||||
res = DockerFile(self.docker_parent);
|
||||
res.lines.append("RUN zypper --non-interactive refresh");
|
||||
res.lines.append("RUN zypper --non-interactive dist-upgrade");
|
||||
res.lines.append("RUN zypper --non-interactive install %s"%(
|
||||
" ".join(sorted(self.pkgs))));
|
||||
return res;
|
||||
|
||||
class leap(ZypperEnvironment):
|
||||
docker_parent = "opensuse:42.2";
|
||||
specfile = "suse/rdma-core.spec";
|
||||
pkgs = {
|
||||
'cmake',
|
||||
'gcc',
|
||||
'libnl3-devel',
|
||||
'libudev-devel',
|
||||
'make',
|
||||
'ninja',
|
||||
'pkg-config',
|
||||
'python',
|
||||
'rpm-build',
|
||||
'systemd-devel',
|
||||
'valgrind-devel',
|
||||
};
|
||||
name = "opensuse-42.2";
|
||||
aliases = {"leap"};
|
||||
|
||||
class tumbleweed(ZypperEnvironment):
|
||||
docker_parent = "opensuse:tumbleweed";
|
||||
pkgs = leap.pkgs;
|
||||
name = "tumbleweed";
|
||||
specfile = "suse/rdma-core.spec";
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
environments = [centos6(),
|
||||
centos7(),
|
||||
centos7_epel(),
|
||||
travis(),
|
||||
trusty(),
|
||||
xenial(),
|
||||
jessie(),
|
||||
stretch(),
|
||||
fc26(),
|
||||
leap(),
|
||||
tumbleweed(),
|
||||
debian_experimental(),
|
||||
];
|
||||
|
||||
class ToEnvAction(argparse.Action):
|
||||
"""argparse helper to parse environment lists into environment classes"""
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
if not isinstance(values,list):
|
||||
values = [values];
|
||||
|
||||
res = set();
|
||||
for I in values:
|
||||
if I == "all":
|
||||
res.update(environments);
|
||||
else:
|
||||
for env in environments:
|
||||
if env.name == I or I in env.aliases:
|
||||
res.add(env);
|
||||
setattr(namespace, self.dest, sorted(res,key=lambda x:x.name))
|
||||
|
||||
def env_choices():
|
||||
"""All the names that can be used with ToEnvAction"""
|
||||
envs = set(("all",));
|
||||
for I in environments:
|
||||
envs.add(I.name);
|
||||
envs.update(I.aliases);
|
||||
return envs;
|
||||
|
||||
def docker_cmd(env,*cmd):
|
||||
"""Invoke docker"""
|
||||
cmd = list(cmd);
|
||||
if env.sudo:
|
||||
return subprocess.check_call(["sudo","docker"] + cmd);
|
||||
return subprocess.check_call(["docker"] + cmd);
|
||||
|
||||
def docker_cmd_str(env,*cmd):
|
||||
"""Invoke docker"""
|
||||
cmd = list(cmd);
|
||||
if env.sudo:
|
||||
return subprocess.check_output(["sudo","docker"] + cmd);
|
||||
return subprocess.check_output(["docker"] + cmd);
|
||||
|
||||
@contextmanager
|
||||
def private_tmp(args):
|
||||
"""Simple version of Python 3's tempfile.TemporaryDirectory"""
|
||||
dfn = tempfile.mkdtemp();
|
||||
try:
|
||||
yield dfn;
|
||||
finally:
|
||||
try:
|
||||
shutil.rmtree(dfn);
|
||||
except:
|
||||
# The debian builds result in root owned files because we don't use fakeroot
|
||||
subprocess.check_call(['sudo','rm','-rf',dfn]);
|
||||
|
||||
@contextmanager
|
||||
def inDirectory(dir):
|
||||
cdir = os.getcwd();
|
||||
try:
|
||||
os.chdir(dir);
|
||||
yield True;
|
||||
finally:
|
||||
os.chdir(cdir);
|
||||
|
||||
def get_image_id(args,image_name):
|
||||
img = json.loads(docker_cmd_str(args,"inspect",image_name));
|
||||
image_id = img[0]["Id"];
|
||||
# Newer dockers put a prefix
|
||||
if ":" in image_id:
|
||||
image_id = image_id.partition(':')[2];
|
||||
return image_id;
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def run_rpm_build(args,spec_file,env):
|
||||
with open(spec_file,"r") as F:
|
||||
for ln in F:
|
||||
if ln.startswith("Version:"):
|
||||
ver = ln.strip().partition(' ')[2].strip();
|
||||
assert(ver == get_version());
|
||||
|
||||
if ln.startswith("Source:"):
|
||||
tarfn = ln.strip().partition(' ')[2].strip();
|
||||
|
||||
image_id = get_image_id(args,env.image_name());
|
||||
with private_tmp(args) as tmpdir:
|
||||
os.mkdir(os.path.join(tmpdir,"SOURCES"));
|
||||
os.mkdir(os.path.join(tmpdir,"tmp"));
|
||||
|
||||
subprocess.check_call(["git","archive",
|
||||
# This must match the prefix generated buildlib/github-release
|
||||
"--prefix","%s-%s/"%(project,get_version()),
|
||||
"--output",os.path.join(tmpdir,"SOURCES",tarfn),
|
||||
"HEAD"]);
|
||||
|
||||
with open(spec_file,"r") as inF:
|
||||
spec = list(inF);
|
||||
tspec_file = os.path.basename(spec_file);
|
||||
with open(os.path.join(tmpdir,tspec_file),"w") as outF:
|
||||
outF.write("".join(spec));
|
||||
|
||||
home = os.path.join(os.path.sep,"home",os.getenv("LOGNAME"));
|
||||
vdir = os.path.join(home,"rpmbuild");
|
||||
|
||||
opts = [
|
||||
"run",
|
||||
"--rm=true",
|
||||
"-v","%s:%s"%(tmpdir,vdir),
|
||||
"-w",vdir,
|
||||
"-h","builder-%s"%(image_id[:12]),
|
||||
"-e","HOME=%s"%(home),
|
||||
"-e","TMPDIR=%s"%(os.path.join(vdir,"tmp")),
|
||||
];
|
||||
|
||||
# rpmbuild complains if we do not have an entry in passwd and group
|
||||
# for the user we are going to use to do the build.
|
||||
with open(os.path.join(tmpdir,"go.py"),"w") as F:
|
||||
print >> F,"""
|
||||
import os,subprocess;
|
||||
with open("/etc/passwd","a") as F:
|
||||
print >> F, {passwd!r};
|
||||
with open("/etc/group","a") as F:
|
||||
print >> F, {group!r};
|
||||
os.setgid({gid:d});
|
||||
os.setuid({uid:d});
|
||||
|
||||
# Get RPM to tell us the expected tar filename.
|
||||
for ln in subprocess.check_output(["rpmspec","-P",{tspec_file!r}]).splitlines():
|
||||
if ln.startswith("Source:"):
|
||||
tarfn = ln.strip().partition(' ')[2].strip();
|
||||
os.symlink({tarfn!r},os.path.join("SOURCES",tarfn));
|
||||
""".format(passwd=":".join(str(I) for I in pwd.getpwuid(os.getuid())),
|
||||
group=":".join(str(I) for I in grp.getgrgid(os.getgid())),
|
||||
uid=os.getuid(),
|
||||
gid=os.getgid(),
|
||||
tarfn=tarfn,
|
||||
tspec_file=tspec_file);
|
||||
|
||||
bopts = ["-bb",tspec_file];
|
||||
|
||||
print >> F,'os.execlp("rpmbuild","rpmbuild",%s)'%(
|
||||
",".join(repr(I) for I in bopts));
|
||||
|
||||
if args.run_shell:
|
||||
opts.append("-ti");
|
||||
opts.append(env.image_name());
|
||||
|
||||
if args.run_shell:
|
||||
opts.append("/bin/bash");
|
||||
else:
|
||||
opts.extend(["python","go.py"]);
|
||||
|
||||
docker_cmd(args,*opts)
|
||||
|
||||
print
|
||||
for path,jnk,files in os.walk(os.path.join(tmpdir,"RPMS")):
|
||||
for I in files:
|
||||
print "Final RPM: ",os.path.join("..",I);
|
||||
shutil.move(os.path.join(path,I),
|
||||
os.path.join("..",I));
|
||||
|
||||
def run_deb_build(args,env):
|
||||
image_id = get_image_id(args,env.image_name());
|
||||
with private_tmp(args) as tmpdir:
|
||||
os.mkdir(os.path.join(tmpdir,"src"));
|
||||
os.mkdir(os.path.join(tmpdir,"tmp"));
|
||||
|
||||
opwd = os.getcwd();
|
||||
with inDirectory(os.path.join(tmpdir,"src")):
|
||||
subprocess.check_call(["git",
|
||||
"--git-dir",os.path.join(opwd,".git"),
|
||||
"reset","--hard","HEAD"]);
|
||||
|
||||
home = os.path.join(os.path.sep,"home",os.getenv("LOGNAME"));
|
||||
|
||||
opts = [
|
||||
"run",
|
||||
"--read-only",
|
||||
"--rm=true",
|
||||
"-v","%s:%s"%(tmpdir,home),
|
||||
"-w",os.path.join(home,"src"),
|
||||
"-h","builder-%s"%(image_id[:12]),
|
||||
"-e","HOME=%s"%(home),
|
||||
"-e","TMPDIR=%s"%(os.path.join(home,"tmp")),
|
||||
"-e","DEB_BUILD_OPTIONS=parallel=%u"%(multiprocessing.cpu_count()),
|
||||
];
|
||||
|
||||
# Create a go.py that will let us run the compilation as the user and
|
||||
# then switch to root only for the packaging step.
|
||||
with open(os.path.join(tmpdir,"go.py"),"w") as F:
|
||||
print >> F,"""
|
||||
import subprocess,os;
|
||||
def to_user():
|
||||
os.setgid({gid:d});
|
||||
os.setuid({uid:d});
|
||||
subprocess.check_call(["debian/rules","debian/rules","build"],
|
||||
preexec_fn=to_user);
|
||||
subprocess.check_call(["debian/rules","debian/rules","binary"]);
|
||||
""".format(uid=os.getuid(),
|
||||
gid=os.getgid());
|
||||
|
||||
if args.run_shell:
|
||||
opts.append("-ti");
|
||||
opts.append(env.image_name());
|
||||
|
||||
if args.run_shell:
|
||||
opts.append("/bin/bash");
|
||||
else:
|
||||
opts.extend(["python",os.path.join(home,"go.py")]);
|
||||
|
||||
docker_cmd(args,*opts);
|
||||
|
||||
print
|
||||
for I in os.listdir(tmpdir):
|
||||
if I.endswith(".deb"):
|
||||
print "Final DEB: ",os.path.join("..",I);
|
||||
shutil.move(os.path.join(tmpdir,I),
|
||||
os.path.join("..",I));
|
||||
|
||||
def run_travis_build(args,env):
|
||||
with private_tmp(args) as tmpdir:
|
||||
os.mkdir(os.path.join(tmpdir,"src"));
|
||||
os.mkdir(os.path.join(tmpdir,"tmp"));
|
||||
|
||||
opwd = os.getcwd();
|
||||
with inDirectory(os.path.join(tmpdir,"src")):
|
||||
subprocess.check_call(["git",
|
||||
"--git-dir",os.path.join(opwd,".git"),
|
||||
"reset","--hard","HEAD"]);
|
||||
subprocess.check_call(["git",
|
||||
"--git-dir",os.path.join(opwd,".git"),
|
||||
"fetch",
|
||||
"--no-tags",
|
||||
"https://github.com/linux-rdma/rdma-core.git","HEAD",
|
||||
"master"]);
|
||||
base = subprocess.check_output(["git",
|
||||
"--git-dir",os.path.join(opwd,".git"),
|
||||
"merge-base",
|
||||
"HEAD","FETCH_HEAD"]).strip();
|
||||
|
||||
home = os.path.join(os.path.sep,"home","travis");
|
||||
home_build = os.path.join(os.path.sep,home,"build");
|
||||
|
||||
opts = [
|
||||
"run",
|
||||
"--read-only",
|
||||
"--rm=true",
|
||||
"-v","%s:%s"%(tmpdir, home_build),
|
||||
"-v","%s:%s:ro"%(os.path.join(opwd,".git"),os.path.join(home_build,"src",".git")),
|
||||
"-w",os.path.join(home_build,"src"),
|
||||
"-u",str(os.getuid()),
|
||||
"-e","TRAVIS_COMMIT_RANGE=%s..HEAD"%(base),
|
||||
"-e","TRAVIS_BRANCH=%s"%(base),
|
||||
"-e","TRAVIS_EVENT_TYPE=pull_request",
|
||||
"-e","HOME=%s"%(home),
|
||||
"-e","TMPDIR=%s"%(os.path.join(home_build,"tmp")),
|
||||
];
|
||||
|
||||
# Load the commands from the travis file
|
||||
with open(os.path.join(opwd,".travis.yml")) as F:
|
||||
cmds = yaml.load(F)["script"];
|
||||
|
||||
with open(os.path.join(tmpdir,"go.sh"),"w") as F:
|
||||
print >> F,"#!/bin/bash";
|
||||
print >> F,"set -e";
|
||||
for I in cmds:
|
||||
print >> F,I;
|
||||
|
||||
if args.run_shell:
|
||||
opts.append("-ti");
|
||||
opts.append(env.image_name());
|
||||
|
||||
if args.run_shell:
|
||||
opts.append("/bin/bash");
|
||||
else:
|
||||
opts.extend(["/bin/bash",os.path.join(home_build,"go.sh")]);
|
||||
|
||||
docker_cmd(args,*opts);
|
||||
|
||||
def args_pkg(parser):
|
||||
parser.add_argument("ENV",action=ToEnvAction,choices=env_choices());
|
||||
parser.add_argument("--run-shell",default=False,action="store_true",
|
||||
help="Instead of running the build, enter a shell");
|
||||
def cmd_pkg(args):
|
||||
"""Build a package in the given environment."""
|
||||
for env in args.ENV:
|
||||
if env.name == "travis":
|
||||
run_travis_build(args,env);
|
||||
elif getattr(env,"is_deb",False):
|
||||
run_deb_build(args,env);
|
||||
elif getattr(env,"is_rpm",False):
|
||||
run_rpm_build(args,
|
||||
getattr(env,"specfile","%s.spec"%(project)),
|
||||
env);
|
||||
else:
|
||||
print "%s does not support packaging"%(env.name);
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def args_make(parser):
|
||||
parser.add_argument("--run-shell",default=False,action="store_true",
|
||||
help="Instead of running the build, enter a shell");
|
||||
parser.add_argument("ENV",action=ToEnvAction,choices=env_choices());
|
||||
parser.add_argument('ARGS', nargs=argparse.REMAINDER);
|
||||
def cmd_make(args):
|
||||
"""Run cmake and ninja within a docker container. If cmake has not yet been
|
||||
run then this runs it with the given environment variables, then invokes ninja.
|
||||
Otherwise ninja is invoked without calling cmake."""
|
||||
SRC = os.getcwd();
|
||||
|
||||
for env in args.ENV:
|
||||
BUILD = "build-%s"%(env.name)
|
||||
if not os.path.exists(BUILD):
|
||||
os.mkdir(BUILD);
|
||||
|
||||
home = os.path.join(os.path.sep,"home",os.getenv("LOGNAME"));
|
||||
|
||||
dirs = [os.getcwd(),"/tmp"];
|
||||
# Import the symlink target too if BUILD is a symlink
|
||||
BUILD_r = os.path.realpath(BUILD);
|
||||
if not BUILD_r.startswith(os.path.realpath(SRC)):
|
||||
dirs.append(BUILD_r);
|
||||
|
||||
cmake_args = []
|
||||
cmake_envs = []
|
||||
ninja_args = []
|
||||
for I in args.ARGS:
|
||||
if I.startswith("-D"):
|
||||
cmake_args.append(I);
|
||||
elif I.find('=') != -1:
|
||||
cmake_envs.append(I);
|
||||
else:
|
||||
ninja_args.append(I);
|
||||
|
||||
if env.use_make:
|
||||
need_cmake = not os.path.exists(os.path.join(BUILD_r,"Makefile"));
|
||||
else:
|
||||
need_cmake = not os.path.exists(os.path.join(BUILD_r,"build.ninja"));
|
||||
opts = ["run",
|
||||
"--read-only",
|
||||
"--rm=true",
|
||||
"-ti",
|
||||
"-u",str(os.getuid()),
|
||||
"-e","HOME=%s"%(home),
|
||||
"-w",BUILD_r,
|
||||
];
|
||||
for I in dirs:
|
||||
opts.append("-v");
|
||||
opts.append("%s:%s"%(I,I));
|
||||
for I in cmake_envs:
|
||||
opts.append("-e");
|
||||
opts.append(I);
|
||||
if args.run_shell:
|
||||
opts.append("-ti");
|
||||
opts.append(env.image_name());
|
||||
|
||||
if args.run_shell:
|
||||
os.execlp("sudo","sudo","docker",*(opts + ["/bin/bash"]));
|
||||
|
||||
if need_cmake:
|
||||
if env.use_make:
|
||||
prog_args = ["cmake",SRC] + cmake_args;
|
||||
else:
|
||||
prog_args = ["cmake","-GNinja",SRC] + cmake_args;
|
||||
docker_cmd(args,*(opts + prog_args));
|
||||
|
||||
if env.use_make:
|
||||
prog_args = ["make","-C",BUILD_r] + ninja_args;
|
||||
else:
|
||||
prog_args = [getattr(env,"ninja_cmd","ninja"),
|
||||
"-C",BUILD_r] + ninja_args;
|
||||
|
||||
if len(args.ENV) <= 1:
|
||||
os.execlp("sudo","sudo","docker",*(opts + prog_args));
|
||||
else:
|
||||
docker_cmd(args,*(opts + prog_args));
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def get_build_args(args,env):
|
||||
"""Return extra docker arguments for building. This is the system APT proxy."""
|
||||
res = [];
|
||||
if args.pull:
|
||||
res.append("--pull");
|
||||
|
||||
if env.proxy and os.path.exists("/etc/apt/apt.conf.d/01proxy"):
|
||||
# The line in this file must be 'Acquire::http { Proxy "http://xxxx:3142"; };'
|
||||
with open("/etc/apt/apt.conf.d/01proxy") as F:
|
||||
proxy = F.read().strip().split('"')[1];
|
||||
res.append("--build-arg");
|
||||
res.append('http_proxy=%s'%(proxy));
|
||||
return res;
|
||||
|
||||
def args_build_images(parser):
|
||||
parser.add_argument("ENV",nargs="+",action=ToEnvAction,choices=env_choices());
|
||||
parser.add_argument("--no-pull",default=True,action="store_false",
|
||||
dest="pull",
|
||||
help="Instead of running the build, enter a shell");
|
||||
def cmd_build_images(args):
|
||||
"""Run from the top level source directory to make the docker images that are
|
||||
needed for building. This only needs to be run once."""
|
||||
for env in args.ENV:
|
||||
df = env.get_docker_file();
|
||||
with private_tmp(args) as tmpdir:
|
||||
fn = os.path.join(tmpdir,"Dockerfile");
|
||||
with open(fn,"wt") as F:
|
||||
for ln in df.lines:
|
||||
print >> F,ln;
|
||||
opts = (["build"] +
|
||||
get_build_args(args,env) +
|
||||
["-f",fn,
|
||||
"-t",env.image_name(),
|
||||
tmpdir]);
|
||||
docker_cmd(args,*opts);
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
def args_docker_gc(parser):
|
||||
pass;
|
||||
def cmd_docker_gc(args):
|
||||
"""Run garbage collection on docker images and containers."""
|
||||
|
||||
containers = set(docker_cmd_str(args,"ps","-a","-q","--filter","status=exited").split());
|
||||
images = set(docker_cmd_str(args,"images","-q","--filter","dangling=true").split());
|
||||
|
||||
if containers:
|
||||
docker_cmd(args,"rm",*sorted(containers));
|
||||
if images:
|
||||
docker_cmd(args,"rmi",*sorted(images));
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Operate docker for building this package')
|
||||
subparsers = parser.add_subparsers(title="Sub Commands");
|
||||
|
||||
funcs = globals();
|
||||
for k,v in funcs.items():
|
||||
if k.startswith("cmd_") and inspect.isfunction(v):
|
||||
sparser = subparsers.add_parser(k[4:].replace('_','-'),
|
||||
help=v.__doc__);
|
||||
funcs["args_" + k[4:]](sparser);
|
||||
sparser.set_defaults(func=v);
|
||||
|
||||
try:
|
||||
import argcomplete;
|
||||
argcomplete.autocomplete(parser);
|
||||
except ImportError:
|
||||
pass;
|
||||
|
||||
args = parser.parse_args();
|
||||
args.sudo = True;
|
||||
|
||||
# This script must always run from the top of the git tree, and a git
|
||||
# checkout is mandatory.
|
||||
git_top = subprocess.check_output(["git","rev-parse","--git-dir"]).strip();
|
||||
if git_top != ".git":
|
||||
os.chdir(os.path.dirname(git_top));
|
||||
|
||||
args.func(args);
|
|
@ -1,205 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright 2017 Obsidian Research Corp.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
"""check-build - Run static checks on a build"""
|
||||
import argparse
|
||||
import inspect
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from contextlib import contextmanager;
|
||||
|
||||
def get_src_dir():
|
||||
"""Get the source directory using git"""
|
||||
git_top = subprocess.check_output(["git","rev-parse","--git-dir"]).strip();
|
||||
if git_top == ".git":
|
||||
return ".";
|
||||
return os.path.dirname(git_top);
|
||||
|
||||
def get_package_version(args):
|
||||
"""Return PACKAGE_VERSION from CMake"""
|
||||
with open(os.path.join(args.SRC,"CMakeLists.txt")) as F:
|
||||
for ln in F:
|
||||
g = re.match(r'^set\(PACKAGE_VERSION "(.+)"\)',ln)
|
||||
if g is None:
|
||||
continue;
|
||||
return g.group(1);
|
||||
raise RuntimeError("Could not find version");
|
||||
|
||||
@contextmanager
|
||||
def inDirectory(dir):
|
||||
cdir = os.getcwd();
|
||||
try:
|
||||
os.chdir(dir);
|
||||
yield True;
|
||||
finally:
|
||||
os.chdir(cdir);
|
||||
|
||||
@contextmanager
|
||||
def private_tmp():
|
||||
"""Simple version of Python 3's tempfile.TemporaryDirectory"""
|
||||
dfn = tempfile.mkdtemp();
|
||||
try:
|
||||
yield dfn;
|
||||
finally:
|
||||
shutil.rmtree(dfn);
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def get_symbol_vers(fn,exported=True):
|
||||
"""Return the symbol version suffixes from the ELF file, eg IB_VERBS_1.0, etc"""
|
||||
syms = subprocess.check_output(["readelf","--wide","-s",fn]);
|
||||
go = False;
|
||||
res = set();
|
||||
for I in syms.splitlines():
|
||||
if I.startswith("Symbol table '.dynsym'"):
|
||||
go = True;
|
||||
continue;
|
||||
|
||||
if I.startswith(" ") and go:
|
||||
itms = I.split();
|
||||
if exported:
|
||||
if (len(itms) == 8 and itms[3] == "OBJECT" and
|
||||
itms[4] == "GLOBAL" and itms[6] == "ABS"):
|
||||
res.add(itms[7]);
|
||||
else:
|
||||
if (len(itms) >= 8 and itms[3] == "FUNC" and
|
||||
itms[4] == "GLOBAL" and itms[6] == "UND"):
|
||||
res.add(itms[7]);
|
||||
else:
|
||||
go = False;
|
||||
if not res:
|
||||
raise ValueError("Failed to read ELF symbol versions from %r"%(fn));
|
||||
return res;
|
||||
|
||||
def check_lib_symver(args,fn):
|
||||
g = re.match(r"lib([^.]+)\.so\.(\d+)\.(\d+)\.(.*)",fn);
|
||||
if g.group(4) != args.PACKAGE_VERSION:
|
||||
raise ValueError("Shared Library filename %r does not have the package version %r (%r)%"(
|
||||
fn,args.PACKAGE_VERSION,g.groups()));
|
||||
|
||||
# umad used the wrong symbol version name when they moved to soname 3.0
|
||||
if g.group(1) == "ibumad":
|
||||
newest_symver = "%s_%s.%s"%(g.group(1).upper(),'1',g.group(3));
|
||||
else:
|
||||
newest_symver = "%s_%s.%s"%(g.group(1).upper(),g.group(2),g.group(3));
|
||||
|
||||
syms = get_symbol_vers(fn);
|
||||
if newest_symver not in syms:
|
||||
raise ValueError("Symbol version %r implied by filename %r not in ELF (%r)"%(
|
||||
newest_symver,fn,syms));
|
||||
|
||||
# The private symbol tag should also be older than the package version
|
||||
private = set(I for I in syms if "PRIVATE" in I)
|
||||
if len(private) > 1:
|
||||
raise ValueError("Too many private symbol versions in ELF %r (%r)"%(fn,private));
|
||||
if private:
|
||||
private_rel = list(private)[0].split('_')[-1];
|
||||
if private_rel > args.PACKAGE_VERSION:
|
||||
raise ValueError("Private Symbol Version %r is newer than the package version %r"%(
|
||||
private,args.PACKAGE_VERSION));
|
||||
|
||||
syms = list(syms - private);
|
||||
syms.sort(key=lambda x:re.split('[._]',x));
|
||||
if newest_symver != syms[-1]:
|
||||
raise ValueError("Symbol version %r implied by filename %r not the newest in ELF (%r)"%(
|
||||
newest_symver,fn,syms));
|
||||
|
||||
def test_lib_names(args):
|
||||
"""Check that the library filename matches the symbol versions"""
|
||||
libd = os.path.join(args.BUILD,"lib");
|
||||
|
||||
# List of shlibs that follow the ABI guidelines
|
||||
libs = {};
|
||||
with inDirectory(libd):
|
||||
for fn in os.listdir("."):
|
||||
if os.path.islink(fn):
|
||||
lfn = os.readlink(fn);
|
||||
if not os.path.islink(lfn):
|
||||
check_lib_symver(args,lfn);
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def check_verbs_abi(args,fn):
|
||||
g = re.match(r"lib([^-]+)-rdmav(\d+).so",fn);
|
||||
if g is None:
|
||||
raise ValueError("Provider library has unknown file name format %r"%(fn));
|
||||
|
||||
private_ver = int(g.group(2));
|
||||
syms = get_symbol_vers(fn,exported=False);
|
||||
syms = {I.partition("@")[2] for I in syms};
|
||||
assert "IBVERBS_PRIVATE_%u"%(private_ver) in syms;
|
||||
assert len([I for I in syms if I.startswith("IBVERBS_PRIVATE")]) == 1;
|
||||
|
||||
def test_verbs_private(args):
|
||||
"""Check that the IBVERBS_PRIVATE symbols match the library name, eg that the
|
||||
map file and the cmake stuff are in sync."""
|
||||
libd = os.path.join(args.BUILD,"lib");
|
||||
with inDirectory(libd):
|
||||
for fn in os.listdir("."):
|
||||
if not os.path.islink(fn) and "rdmav" in fn:
|
||||
check_verbs_abi(args,fn);
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def is_obsolete(fn):
|
||||
"""True if the header is obsolete and should not be compiled anyhow."""
|
||||
with open(fn) as F:
|
||||
for ln in F.readlines():
|
||||
if re.search(r"#warning.*This header is obsolete",ln):
|
||||
return True;
|
||||
return False;
|
||||
|
||||
def is_fixup(fn):
|
||||
"""True if this is a fixup header, fixup headers are exempted because they
|
||||
required includes are not the same for kernel headers (eg netinet/in.h)"""
|
||||
if os.path.islink(fn):
|
||||
return "buildlib/fixup-include/" in os.readlink(fn);
|
||||
return False;
|
||||
|
||||
def test_public_headers(args):
|
||||
"""Test that every header file can be included on its own, and has no obvious
|
||||
implicit dependencies. This is mainly intended to check the public
|
||||
headers, but this sweeps in published internal headers too."""
|
||||
incdir = os.path.abspath(os.path.join(args.BUILD,"include"));
|
||||
includes = set();
|
||||
for root,dirs,files in os.walk(incdir):
|
||||
for I in files:
|
||||
if I.endswith(".h"):
|
||||
includes.add(os.path.join(root,I));
|
||||
|
||||
# Make a little ninja file to compile each header
|
||||
with private_tmp() as tmpd:
|
||||
with open(os.path.join(tmpd,"build.ninja"),"wt") as F:
|
||||
print >> F,"rule comp";
|
||||
print >> F," command = %s -Werror -c -I %s $in -o $out"%(args.CC,incdir);
|
||||
print >> F," description=Header check for $in";
|
||||
count = 0;
|
||||
for I in sorted(includes):
|
||||
if is_obsolete(I) or is_fixup(I):
|
||||
continue;
|
||||
print >> F,"build %s : comp %s"%("out%d.o"%(count),I);
|
||||
print >> F,"default %s"%("out%d.o"%(count));
|
||||
count = count + 1;
|
||||
subprocess.check_call(["ninja"],cwd=tmpd);
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
parser = argparse.ArgumentParser(description='Run build time tests')
|
||||
parser.add_argument("--build",default=os.getcwd(),dest="BUILD",
|
||||
help="Build directory to inpsect");
|
||||
parser.add_argument("--src",default=None,dest="SRC",
|
||||
help="Top of the source tree");
|
||||
parser.add_argument("--cc",default="cc",dest="CC",
|
||||
help="C compiler to use");
|
||||
args = parser.parse_args();
|
||||
|
||||
if args.SRC is None:
|
||||
args.SRC = get_src_dir();
|
||||
args.PACKAGE_VERSION = get_package_version(args);
|
||||
|
||||
funcs = globals();
|
||||
for k,v in funcs.items():
|
||||
if k.startswith("test_") and inspect.isfunction(v):
|
||||
v(args);
|
|
@ -1,51 +0,0 @@
|
|||
#ifndef CONFIG_H_IN
|
||||
#define CONFIG_H_IN
|
||||
|
||||
#define HAVE_STATEMENT_EXPR 1
|
||||
#define HAVE_BUILTIN_TYPES_COMPATIBLE_P 1
|
||||
#define HAVE_TYPEOF 1
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
// FIXME: Remove this, The cmake version hard-requires new style CLOEXEC support
|
||||
#define STREAM_CLOEXEC "e"
|
||||
|
||||
#define IBV_CONFIG_DIR "@CONFIG_DIR@"
|
||||
#define RS_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma/rsocket"
|
||||
#define IWPM_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf"
|
||||
|
||||
#define SRP_DEAMON_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf"
|
||||
#define SRP_DEAMON_LOCK_PREFIX "@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon"
|
||||
|
||||
#define ACM_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma"
|
||||
#define IBACM_LIB_PATH "@ACM_PROVIDER_DIR@"
|
||||
#define IBACM_BIN_PATH "@CMAKE_INSTALL_FULL_BINDIR@"
|
||||
#define IBACM_PID_FILE "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.pid"
|
||||
#define IBACM_PORT_FILE "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.port"
|
||||
#define IBACM_LOG_FILE "@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/ibacm.log"
|
||||
|
||||
#define VERBS_PROVIDER_DIR "@VERBS_PROVIDER_DIR@"
|
||||
#define VERBS_PROVIDER_SUFFIX "@IBVERBS_PROVIDER_SUFFIX@"
|
||||
#define IBVERBS_PABI_VERSION @IBVERBS_PABI_VERSION@
|
||||
|
||||
// FIXME This has been supported in compilers forever, we should just fail to build on such old systems.
|
||||
#cmakedefine HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE 1
|
||||
|
||||
#cmakedefine HAVE_FUNC_ATTRIBUTE_IFUNC 1
|
||||
|
||||
#cmakedefine HAVE_WORKING_IF_H 1
|
||||
|
||||
// Operating mode for symbol versions
|
||||
#cmakedefine HAVE_FULL_SYMBOL_VERSIONS 1
|
||||
#cmakedefine HAVE_LIMITED_SYMBOL_VERSIONS 1
|
||||
|
||||
@SIZEOF_LONG_CODE@
|
||||
|
||||
#if @NL_KIND@ == 3
|
||||
# define HAVE_LIBNL3 1
|
||||
#elif @NL_KIND@ == 1
|
||||
# define HAVE_LIBNL1 1
|
||||
#elif @NL_KIND@ == 0
|
||||
# define NRESOLVE_NEIGH 1
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,225 +0,0 @@
|
|||
#ifndef _UAPI_RDMA_NETLINK_H
|
||||
#define _UAPI_RDMA_NETLINK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum {
|
||||
RDMA_NL_RDMA_CM = 1,
|
||||
RDMA_NL_IWCM,
|
||||
RDMA_NL_RSVD,
|
||||
RDMA_NL_LS, /* RDMA Local Services */
|
||||
RDMA_NL_I40IW,
|
||||
RDMA_NL_NUM_CLIENTS
|
||||
};
|
||||
|
||||
enum {
|
||||
RDMA_NL_GROUP_CM = 1,
|
||||
RDMA_NL_GROUP_IWPM,
|
||||
RDMA_NL_GROUP_LS,
|
||||
RDMA_NL_NUM_GROUPS
|
||||
};
|
||||
|
||||
#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
|
||||
#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
|
||||
#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
|
||||
|
||||
enum {
|
||||
RDMA_NL_RDMA_CM_ID_STATS = 0,
|
||||
RDMA_NL_RDMA_CM_NUM_OPS
|
||||
};
|
||||
|
||||
enum {
|
||||
RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1,
|
||||
RDMA_NL_RDMA_CM_ATTR_DST_ADDR,
|
||||
RDMA_NL_RDMA_CM_NUM_ATTR,
|
||||
};
|
||||
|
||||
/* iwarp port mapper op-codes */
|
||||
enum {
|
||||
RDMA_NL_IWPM_REG_PID = 0,
|
||||
RDMA_NL_IWPM_ADD_MAPPING,
|
||||
RDMA_NL_IWPM_QUERY_MAPPING,
|
||||
RDMA_NL_IWPM_REMOVE_MAPPING,
|
||||
RDMA_NL_IWPM_REMOTE_INFO,
|
||||
RDMA_NL_IWPM_HANDLE_ERR,
|
||||
RDMA_NL_IWPM_MAPINFO,
|
||||
RDMA_NL_IWPM_MAPINFO_NUM,
|
||||
RDMA_NL_IWPM_NUM_OPS
|
||||
};
|
||||
|
||||
struct rdma_cm_id_stats {
|
||||
__u32 qp_num;
|
||||
__u32 bound_dev_if;
|
||||
__u32 port_space;
|
||||
__s32 pid;
|
||||
__u8 cm_state;
|
||||
__u8 node_type;
|
||||
__u8 port_num;
|
||||
__u8 qp_type;
|
||||
};
|
||||
|
||||
enum {
|
||||
IWPM_NLA_REG_PID_UNSPEC = 0,
|
||||
IWPM_NLA_REG_PID_SEQ,
|
||||
IWPM_NLA_REG_IF_NAME,
|
||||
IWPM_NLA_REG_IBDEV_NAME,
|
||||
IWPM_NLA_REG_ULIB_NAME,
|
||||
IWPM_NLA_REG_PID_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
IWPM_NLA_RREG_PID_UNSPEC = 0,
|
||||
IWPM_NLA_RREG_PID_SEQ,
|
||||
IWPM_NLA_RREG_IBDEV_NAME,
|
||||
IWPM_NLA_RREG_ULIB_NAME,
|
||||
IWPM_NLA_RREG_ULIB_VER,
|
||||
IWPM_NLA_RREG_PID_ERR,
|
||||
IWPM_NLA_RREG_PID_MAX
|
||||
|
||||
};
|
||||
|
||||
enum {
|
||||
IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
|
||||
IWPM_NLA_MANAGE_MAPPING_SEQ,
|
||||
IWPM_NLA_MANAGE_ADDR,
|
||||
IWPM_NLA_MANAGE_MAPPED_LOC_ADDR,
|
||||
IWPM_NLA_RMANAGE_MAPPING_ERR,
|
||||
IWPM_NLA_RMANAGE_MAPPING_MAX
|
||||
};
|
||||
|
||||
#define IWPM_NLA_MANAGE_MAPPING_MAX 3
|
||||
#define IWPM_NLA_QUERY_MAPPING_MAX 4
|
||||
#define IWPM_NLA_MAPINFO_SEND_MAX 3
|
||||
|
||||
enum {
|
||||
IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
|
||||
IWPM_NLA_QUERY_MAPPING_SEQ,
|
||||
IWPM_NLA_QUERY_LOCAL_ADDR,
|
||||
IWPM_NLA_QUERY_REMOTE_ADDR,
|
||||
IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
|
||||
IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
|
||||
IWPM_NLA_RQUERY_MAPPING_ERR,
|
||||
IWPM_NLA_RQUERY_MAPPING_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
IWPM_NLA_MAPINFO_REQ_UNSPEC = 0,
|
||||
IWPM_NLA_MAPINFO_ULIB_NAME,
|
||||
IWPM_NLA_MAPINFO_ULIB_VER,
|
||||
IWPM_NLA_MAPINFO_REQ_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
IWPM_NLA_MAPINFO_UNSPEC = 0,
|
||||
IWPM_NLA_MAPINFO_LOCAL_ADDR,
|
||||
IWPM_NLA_MAPINFO_MAPPED_ADDR,
|
||||
IWPM_NLA_MAPINFO_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
IWPM_NLA_MAPINFO_NUM_UNSPEC = 0,
|
||||
IWPM_NLA_MAPINFO_SEQ,
|
||||
IWPM_NLA_MAPINFO_SEND_NUM,
|
||||
IWPM_NLA_MAPINFO_ACK_NUM,
|
||||
IWPM_NLA_MAPINFO_NUM_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
IWPM_NLA_ERR_UNSPEC = 0,
|
||||
IWPM_NLA_ERR_SEQ,
|
||||
IWPM_NLA_ERR_CODE,
|
||||
IWPM_NLA_ERR_MAX
|
||||
};
|
||||
|
||||
/*
|
||||
* Local service operations:
|
||||
* RESOLVE - The client requests the local service to resolve a path.
|
||||
* SET_TIMEOUT - The local service requests the client to set the timeout.
|
||||
* IP_RESOLVE - The client requests the local service to resolve an IP to GID.
|
||||
*/
|
||||
enum {
|
||||
RDMA_NL_LS_OP_RESOLVE = 0,
|
||||
RDMA_NL_LS_OP_SET_TIMEOUT,
|
||||
RDMA_NL_LS_OP_IP_RESOLVE,
|
||||
RDMA_NL_LS_NUM_OPS
|
||||
};
|
||||
|
||||
/* Local service netlink message flags */
|
||||
#define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */
|
||||
|
||||
/*
|
||||
* Local service resolve operation family header.
|
||||
* The layout for the resolve operation:
|
||||
* nlmsg header
|
||||
* family header
|
||||
* attributes
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local service path use:
|
||||
* Specify how the path(s) will be used.
|
||||
* ALL - For connected CM operation (6 pathrecords)
|
||||
* UNIDIRECTIONAL - For unidirectional UD (1 pathrecord)
|
||||
* GMP - For miscellaneous GMP like operation (at least 1 reversible
|
||||
* pathrecord)
|
||||
*/
|
||||
enum {
|
||||
LS_RESOLVE_PATH_USE_ALL = 0,
|
||||
LS_RESOLVE_PATH_USE_UNIDIRECTIONAL,
|
||||
LS_RESOLVE_PATH_USE_GMP,
|
||||
LS_RESOLVE_PATH_USE_MAX
|
||||
};
|
||||
|
||||
#define LS_DEVICE_NAME_MAX 64
|
||||
|
||||
struct rdma_ls_resolve_header {
|
||||
__u8 device_name[LS_DEVICE_NAME_MAX];
|
||||
__u8 port_num;
|
||||
__u8 path_use;
|
||||
};
|
||||
|
||||
struct rdma_ls_ip_resolve_header {
|
||||
__u32 ifindex;
|
||||
};
|
||||
|
||||
/* Local service attribute type */
|
||||
#define RDMA_NLA_F_MANDATORY (1 << 13)
|
||||
#define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \
|
||||
RDMA_NLA_F_MANDATORY))
|
||||
|
||||
/*
|
||||
* Local service attributes:
|
||||
* Attr Name Size Byte order
|
||||
* -----------------------------------------------------
|
||||
* PATH_RECORD struct ib_path_rec_data
|
||||
* TIMEOUT u32 cpu
|
||||
* SERVICE_ID u64 cpu
|
||||
* DGID u8[16] BE
|
||||
* SGID u8[16] BE
|
||||
* TCLASS u8
|
||||
* PKEY u16 cpu
|
||||
* QOS_CLASS u16 cpu
|
||||
* IPV4 u32 BE
|
||||
* IPV6 u8[16] BE
|
||||
*/
|
||||
enum {
|
||||
LS_NLA_TYPE_UNSPEC = 0,
|
||||
LS_NLA_TYPE_PATH_RECORD,
|
||||
LS_NLA_TYPE_TIMEOUT,
|
||||
LS_NLA_TYPE_SERVICE_ID,
|
||||
LS_NLA_TYPE_DGID,
|
||||
LS_NLA_TYPE_SGID,
|
||||
LS_NLA_TYPE_TCLASS,
|
||||
LS_NLA_TYPE_PKEY,
|
||||
LS_NLA_TYPE_QOS_CLASS,
|
||||
LS_NLA_TYPE_IPV4,
|
||||
LS_NLA_TYPE_IPV6,
|
||||
LS_NLA_TYPE_MAX
|
||||
};
|
||||
|
||||
/* Local service DGID/SGID attribute: big endian */
|
||||
struct rdma_nla_ls_gid {
|
||||
__u8 gid[16];
|
||||
};
|
||||
|
||||
#endif /* _UAPI_RDMA_NETLINK_H */
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef RDMA_USER_RXE_H
|
||||
#define RDMA_USER_RXE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
union rxe_gid {
|
||||
__u8 raw[16];
|
||||
struct {
|
||||
__be64 subnet_prefix;
|
||||
__be64 interface_id;
|
||||
} global;
|
||||
};
|
||||
|
||||
struct rxe_global_route {
|
||||
union rxe_gid dgid;
|
||||
__u32 flow_label;
|
||||
__u8 sgid_index;
|
||||
__u8 hop_limit;
|
||||
__u8 traffic_class;
|
||||
};
|
||||
|
||||
struct rxe_av {
|
||||
__u8 port_num;
|
||||
__u8 network_type;
|
||||
struct rxe_global_route grh;
|
||||
union {
|
||||
struct sockaddr _sockaddr;
|
||||
struct sockaddr_in _sockaddr_in;
|
||||
struct sockaddr_in6 _sockaddr_in6;
|
||||
} sgid_addr, dgid_addr;
|
||||
};
|
||||
|
||||
struct rxe_send_wr {
|
||||
__u64 wr_id;
|
||||
__u32 num_sge;
|
||||
__u32 opcode;
|
||||
__u32 send_flags;
|
||||
union {
|
||||
__be32 imm_data;
|
||||
__u32 invalidate_rkey;
|
||||
} ex;
|
||||
union {
|
||||
struct {
|
||||
__u64 remote_addr;
|
||||
__u32 rkey;
|
||||
} rdma;
|
||||
struct {
|
||||
__u64 remote_addr;
|
||||
__u64 compare_add;
|
||||
__u64 swap;
|
||||
__u32 rkey;
|
||||
} atomic;
|
||||
struct {
|
||||
__u32 remote_qpn;
|
||||
__u32 remote_qkey;
|
||||
__u16 pkey_index;
|
||||
} ud;
|
||||
struct {
|
||||
struct ib_mr *mr;
|
||||
__u32 key;
|
||||
int access;
|
||||
} reg;
|
||||
} wr;
|
||||
};
|
||||
|
||||
struct rxe_sge {
|
||||
__u64 addr;
|
||||
__u32 length;
|
||||
__u32 lkey;
|
||||
};
|
||||
|
||||
struct mminfo {
|
||||
__u64 offset;
|
||||
__u32 size;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
struct rxe_dma_info {
|
||||
__u32 length;
|
||||
__u32 resid;
|
||||
__u32 cur_sge;
|
||||
__u32 num_sge;
|
||||
__u32 sge_offset;
|
||||
union {
|
||||
__u8 inline_data[0];
|
||||
struct rxe_sge sge[0];
|
||||
};
|
||||
};
|
||||
|
||||
struct rxe_send_wqe {
|
||||
struct rxe_send_wr wr;
|
||||
struct rxe_av av;
|
||||
__u32 status;
|
||||
__u32 state;
|
||||
__u64 iova;
|
||||
__u32 mask;
|
||||
__u32 first_psn;
|
||||
__u32 last_psn;
|
||||
__u32 ack_length;
|
||||
__u32 ssn;
|
||||
__u32 has_rd_atomic;
|
||||
struct rxe_dma_info dma;
|
||||
};
|
||||
|
||||
struct rxe_recv_wqe {
|
||||
__u64 wr_id;
|
||||
__u32 num_sge;
|
||||
__u32 padding;
|
||||
struct rxe_dma_info dma;
|
||||
};
|
||||
|
||||
#endif /* RDMA_USER_RXE_H */
|
|
@ -1,289 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2016 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of EITHER the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation or the BSD
|
||||
* 2-Clause License. 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 version 2 for more details at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program available in the file COPYING in the main
|
||||
* directory of this source tree.
|
||||
*
|
||||
* The BSD 2-Clause License
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __VMW_PVRDMA_ABI_H__
|
||||
#define __VMW_PVRDMA_ABI_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define PVRDMA_UVERBS_ABI_VERSION 3 /* ABI Version. */
|
||||
#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */
|
||||
#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell. */
|
||||
#define PVRDMA_UAR_QP_SEND BIT(30) /* Send bit. */
|
||||
#define PVRDMA_UAR_QP_RECV BIT(31) /* Recv bit. */
|
||||
#define PVRDMA_UAR_CQ_OFFSET 4 /* CQ doorbell. */
|
||||
#define PVRDMA_UAR_CQ_ARM_SOL BIT(29) /* Arm solicited bit. */
|
||||
#define PVRDMA_UAR_CQ_ARM BIT(30) /* Arm bit. */
|
||||
#define PVRDMA_UAR_CQ_POLL BIT(31) /* Poll bit. */
|
||||
|
||||
enum pvrdma_wr_opcode {
|
||||
PVRDMA_WR_RDMA_WRITE,
|
||||
PVRDMA_WR_RDMA_WRITE_WITH_IMM,
|
||||
PVRDMA_WR_SEND,
|
||||
PVRDMA_WR_SEND_WITH_IMM,
|
||||
PVRDMA_WR_RDMA_READ,
|
||||
PVRDMA_WR_ATOMIC_CMP_AND_SWP,
|
||||
PVRDMA_WR_ATOMIC_FETCH_AND_ADD,
|
||||
PVRDMA_WR_LSO,
|
||||
PVRDMA_WR_SEND_WITH_INV,
|
||||
PVRDMA_WR_RDMA_READ_WITH_INV,
|
||||
PVRDMA_WR_LOCAL_INV,
|
||||
PVRDMA_WR_FAST_REG_MR,
|
||||
PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP,
|
||||
PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD,
|
||||
PVRDMA_WR_BIND_MW,
|
||||
PVRDMA_WR_REG_SIG_MR,
|
||||
};
|
||||
|
||||
enum pvrdma_wc_status {
|
||||
PVRDMA_WC_SUCCESS,
|
||||
PVRDMA_WC_LOC_LEN_ERR,
|
||||
PVRDMA_WC_LOC_QP_OP_ERR,
|
||||
PVRDMA_WC_LOC_EEC_OP_ERR,
|
||||
PVRDMA_WC_LOC_PROT_ERR,
|
||||
PVRDMA_WC_WR_FLUSH_ERR,
|
||||
PVRDMA_WC_MW_BIND_ERR,
|
||||
PVRDMA_WC_BAD_RESP_ERR,
|
||||
PVRDMA_WC_LOC_ACCESS_ERR,
|
||||
PVRDMA_WC_REM_INV_REQ_ERR,
|
||||
PVRDMA_WC_REM_ACCESS_ERR,
|
||||
PVRDMA_WC_REM_OP_ERR,
|
||||
PVRDMA_WC_RETRY_EXC_ERR,
|
||||
PVRDMA_WC_RNR_RETRY_EXC_ERR,
|
||||
PVRDMA_WC_LOC_RDD_VIOL_ERR,
|
||||
PVRDMA_WC_REM_INV_RD_REQ_ERR,
|
||||
PVRDMA_WC_REM_ABORT_ERR,
|
||||
PVRDMA_WC_INV_EECN_ERR,
|
||||
PVRDMA_WC_INV_EEC_STATE_ERR,
|
||||
PVRDMA_WC_FATAL_ERR,
|
||||
PVRDMA_WC_RESP_TIMEOUT_ERR,
|
||||
PVRDMA_WC_GENERAL_ERR,
|
||||
};
|
||||
|
||||
enum pvrdma_wc_opcode {
|
||||
PVRDMA_WC_SEND,
|
||||
PVRDMA_WC_RDMA_WRITE,
|
||||
PVRDMA_WC_RDMA_READ,
|
||||
PVRDMA_WC_COMP_SWAP,
|
||||
PVRDMA_WC_FETCH_ADD,
|
||||
PVRDMA_WC_BIND_MW,
|
||||
PVRDMA_WC_LSO,
|
||||
PVRDMA_WC_LOCAL_INV,
|
||||
PVRDMA_WC_FAST_REG_MR,
|
||||
PVRDMA_WC_MASKED_COMP_SWAP,
|
||||
PVRDMA_WC_MASKED_FETCH_ADD,
|
||||
PVRDMA_WC_RECV = 1 << 7,
|
||||
PVRDMA_WC_RECV_RDMA_WITH_IMM,
|
||||
};
|
||||
|
||||
enum pvrdma_wc_flags {
|
||||
PVRDMA_WC_GRH = 1 << 0,
|
||||
PVRDMA_WC_WITH_IMM = 1 << 1,
|
||||
PVRDMA_WC_WITH_INVALIDATE = 1 << 2,
|
||||
PVRDMA_WC_IP_CSUM_OK = 1 << 3,
|
||||
PVRDMA_WC_WITH_SMAC = 1 << 4,
|
||||
PVRDMA_WC_WITH_VLAN = 1 << 5,
|
||||
PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_VLAN,
|
||||
};
|
||||
|
||||
struct pvrdma_alloc_ucontext_resp {
|
||||
__u32 qp_tab_size;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct pvrdma_alloc_pd_resp {
|
||||
__u32 pdn;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct pvrdma_create_cq {
|
||||
__u64 buf_addr;
|
||||
__u32 buf_size;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct pvrdma_create_cq_resp {
|
||||
__u32 cqn;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct pvrdma_resize_cq {
|
||||
__u64 buf_addr;
|
||||
__u32 buf_size;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct pvrdma_create_srq {
|
||||
__u64 buf_addr;
|
||||
};
|
||||
|
||||
struct pvrdma_create_srq_resp {
|
||||
__u32 srqn;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct pvrdma_create_qp {
|
||||
__u64 rbuf_addr;
|
||||
__u64 sbuf_addr;
|
||||
__u32 rbuf_size;
|
||||
__u32 sbuf_size;
|
||||
__u64 qp_addr;
|
||||
};
|
||||
|
||||
/* PVRDMA masked atomic compare and swap */
|
||||
struct pvrdma_ex_cmp_swap {
|
||||
__u64 swap_val;
|
||||
__u64 compare_val;
|
||||
__u64 swap_mask;
|
||||
__u64 compare_mask;
|
||||
};
|
||||
|
||||
/* PVRDMA masked atomic fetch and add */
|
||||
struct pvrdma_ex_fetch_add {
|
||||
__u64 add_val;
|
||||
__u64 field_boundary;
|
||||
};
|
||||
|
||||
/* PVRDMA address vector. */
|
||||
struct pvrdma_av {
|
||||
__u32 port_pd;
|
||||
__u32 sl_tclass_flowlabel;
|
||||
__u8 dgid[16];
|
||||
__u8 src_path_bits;
|
||||
__u8 gid_index;
|
||||
__u8 stat_rate;
|
||||
__u8 hop_limit;
|
||||
__u8 dmac[6];
|
||||
__u8 reserved[6];
|
||||
};
|
||||
|
||||
/* PVRDMA scatter/gather entry */
|
||||
struct pvrdma_sge {
|
||||
__u64 addr;
|
||||
__u32 length;
|
||||
__u32 lkey;
|
||||
};
|
||||
|
||||
/* PVRDMA receive queue work request */
|
||||
struct pvrdma_rq_wqe_hdr {
|
||||
__u64 wr_id; /* wr id */
|
||||
__u32 num_sge; /* size of s/g array */
|
||||
__u32 total_len; /* reserved */
|
||||
};
|
||||
/* Use pvrdma_sge (ib_sge) for receive queue s/g array elements. */
|
||||
|
||||
/* PVRDMA send queue work request */
|
||||
struct pvrdma_sq_wqe_hdr {
|
||||
__u64 wr_id; /* wr id */
|
||||
__u32 num_sge; /* size of s/g array */
|
||||
__u32 total_len; /* reserved */
|
||||
__u32 opcode; /* operation type */
|
||||
__u32 send_flags; /* wr flags */
|
||||
union {
|
||||
__be32 imm_data;
|
||||
__u32 invalidate_rkey;
|
||||
} ex;
|
||||
__u32 reserved;
|
||||
union {
|
||||
struct {
|
||||
__u64 remote_addr;
|
||||
__u32 rkey;
|
||||
__u8 reserved[4];
|
||||
} rdma;
|
||||
struct {
|
||||
__u64 remote_addr;
|
||||
__u64 compare_add;
|
||||
__u64 swap;
|
||||
__u32 rkey;
|
||||
__u32 reserved;
|
||||
} atomic;
|
||||
struct {
|
||||
__u64 remote_addr;
|
||||
__u32 log_arg_sz;
|
||||
__u32 rkey;
|
||||
union {
|
||||
struct pvrdma_ex_cmp_swap cmp_swap;
|
||||
struct pvrdma_ex_fetch_add fetch_add;
|
||||
} wr_data;
|
||||
} masked_atomics;
|
||||
struct {
|
||||
__u64 iova_start;
|
||||
__u64 pl_pdir_dma;
|
||||
__u32 page_shift;
|
||||
__u32 page_list_len;
|
||||
__u32 length;
|
||||
__u32 access_flags;
|
||||
__u32 rkey;
|
||||
} fast_reg;
|
||||
struct {
|
||||
__u32 remote_qpn;
|
||||
__u32 remote_qkey;
|
||||
struct pvrdma_av av;
|
||||
} ud;
|
||||
} wr;
|
||||
};
|
||||
/* Use pvrdma_sge (ib_sge) for send queue s/g array elements. */
|
||||
|
||||
/* Completion queue element. */
|
||||
struct pvrdma_cqe {
|
||||
__u64 wr_id;
|
||||
__u64 qp;
|
||||
__u32 opcode;
|
||||
__u32 status;
|
||||
__u32 byte_len;
|
||||
__be32 imm_data;
|
||||
__u32 src_qp;
|
||||
__u32 wc_flags;
|
||||
__u32 vendor_err;
|
||||
__u16 pkey_index;
|
||||
__u16 slid;
|
||||
__u8 sl;
|
||||
__u8 dlid_path_bits;
|
||||
__u8 port_num;
|
||||
__u8 smac[6];
|
||||
__u8 reserved2[7]; /* Pad to next power of 2 (64). */
|
||||
};
|
||||
|
||||
#endif /* __VMW_PVRDMA_ABI_H__ */
|
|
@ -1,369 +0,0 @@
|
|||
/*
|
||||
* An implementation of C11 stdatomic.h directly borrowed from FreeBSD
|
||||
* (original copyright follows), with minor modifications for
|
||||
* portability to other systems. Works for recent Clang (that
|
||||
* implement the feature c_atomic) and GCC 4.7+; includes
|
||||
* compatibility for GCC below 4.7 but I wouldn't recommend it.
|
||||
*
|
||||
* Caveats and limitations:
|
||||
* - Only the ``_Atomic parentheses'' notation is implemented, while
|
||||
* the ``_Atomic space'' one is not.
|
||||
* - _Atomic types must be typedef'ed, or programs using them will
|
||||
* not type check correctly (incompatible anonymous structure
|
||||
* types).
|
||||
* - Non-scalar _Atomic types would require runtime support for
|
||||
* runtime locking, which, as far as I know, is not currently
|
||||
* available on any system.
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2011 Ed Schouten <ed@FreeBSD.org>
|
||||
* David Chisnall <theraven@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: src/include/stdatomic.h,v 1.10.2.2 2012/05/30 19:21:54 theraven Exp $
|
||||
*/
|
||||
|
||||
#ifndef _STDATOMIC_H_
|
||||
#define _STDATOMIC_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined(__has_feature)
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_builtin)
|
||||
#define __has_builtin(x) 0
|
||||
#endif
|
||||
#if !defined(__GNUC_PREREQ__)
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||
#define __GNUC_PREREQ__(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
#define __GNUC_PREREQ__(maj, min) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__CLANG_ATOMICS) && !defined(__GNUC_ATOMICS)
|
||||
#if __has_feature(c_atomic)
|
||||
#define __CLANG_ATOMICS
|
||||
#elif __GNUC_PREREQ__(4, 7)
|
||||
#define __GNUC_ATOMICS
|
||||
#elif !defined(__GNUC__)
|
||||
#error "stdatomic.h does not support your compiler"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__CLANG_ATOMICS)
|
||||
#define _Atomic(T) struct { volatile __typeof__(T) __val; }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 7.17.2 Initialization.
|
||||
*/
|
||||
|
||||
#if defined(__CLANG_ATOMICS)
|
||||
#define ATOMIC_VAR_INIT(value) (value)
|
||||
#define atomic_init(obj, value) __c11_atomic_init(obj, value)
|
||||
#else
|
||||
#define ATOMIC_VAR_INIT(value) { .__val = (value) }
|
||||
#define atomic_init(obj, value) do { \
|
||||
(obj)->__val = (value); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Clang and recent GCC both provide predefined macros for the memory
|
||||
* orderings. If we are using a compiler that doesn't define them, use the
|
||||
* clang values - these will be ignored in the fallback path.
|
||||
*/
|
||||
|
||||
#ifndef __ATOMIC_RELAXED
|
||||
#define __ATOMIC_RELAXED 0
|
||||
#endif
|
||||
#ifndef __ATOMIC_CONSUME
|
||||
#define __ATOMIC_CONSUME 1
|
||||
#endif
|
||||
#ifndef __ATOMIC_ACQUIRE
|
||||
#define __ATOMIC_ACQUIRE 2
|
||||
#endif
|
||||
#ifndef __ATOMIC_RELEASE
|
||||
#define __ATOMIC_RELEASE 3
|
||||
#endif
|
||||
#ifndef __ATOMIC_ACQ_REL
|
||||
#define __ATOMIC_ACQ_REL 4
|
||||
#endif
|
||||
#ifndef __ATOMIC_SEQ_CST
|
||||
#define __ATOMIC_SEQ_CST 5
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 7.17.3 Order and consistency.
|
||||
*
|
||||
* The memory_order_* constants that denote the barrier behaviour of the
|
||||
* atomic operations.
|
||||
*/
|
||||
|
||||
enum memory_order {
|
||||
memory_order_relaxed = __ATOMIC_RELAXED,
|
||||
memory_order_consume = __ATOMIC_CONSUME,
|
||||
memory_order_acquire = __ATOMIC_ACQUIRE,
|
||||
memory_order_release = __ATOMIC_RELEASE,
|
||||
memory_order_acq_rel = __ATOMIC_ACQ_REL,
|
||||
memory_order_seq_cst = __ATOMIC_SEQ_CST
|
||||
};
|
||||
|
||||
typedef enum memory_order memory_order;
|
||||
|
||||
/*
|
||||
* 7.17.4 Fences.
|
||||
*/
|
||||
|
||||
#ifdef __CLANG_ATOMICS
|
||||
#define atomic_thread_fence(order) __c11_atomic_thread_fence(order)
|
||||
#define atomic_signal_fence(order) __c11_atomic_signal_fence(order)
|
||||
#elif defined(__GNUC_ATOMICS)
|
||||
#define atomic_thread_fence(order) __atomic_thread_fence(order)
|
||||
#define atomic_signal_fence(order) __atomic_signal_fence(order)
|
||||
#else
|
||||
#define atomic_thread_fence(order) __sync_synchronize()
|
||||
#define atomic_signal_fence(order) __asm volatile ("" : : : "memory")
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 7.17.5 Lock-free property.
|
||||
*/
|
||||
|
||||
#if defined(__CLANG_ATOMICS)
|
||||
#define atomic_is_lock_free(obj) \
|
||||
__c11_atomic_is_lock_free(sizeof(obj))
|
||||
#elif defined(__GNUC_ATOMICS)
|
||||
#define atomic_is_lock_free(obj) \
|
||||
__atomic_is_lock_free(sizeof((obj)->__val))
|
||||
#else
|
||||
#define atomic_is_lock_free(obj) \
|
||||
(sizeof((obj)->__val) <= sizeof(void *))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 7.17.6 Atomic integer types.
|
||||
*/
|
||||
|
||||
typedef _Atomic(_Bool) atomic_bool;
|
||||
typedef _Atomic(char) atomic_char;
|
||||
typedef _Atomic(signed char) atomic_schar;
|
||||
typedef _Atomic(unsigned char) atomic_uchar;
|
||||
typedef _Atomic(short) atomic_short;
|
||||
typedef _Atomic(unsigned short) atomic_ushort;
|
||||
typedef _Atomic(int) atomic_int;
|
||||
typedef _Atomic(unsigned int) atomic_uint;
|
||||
typedef _Atomic(long) atomic_long;
|
||||
typedef _Atomic(unsigned long) atomic_ulong;
|
||||
typedef _Atomic(long long) atomic_llong;
|
||||
typedef _Atomic(unsigned long long) atomic_ullong;
|
||||
#if 0
|
||||
typedef _Atomic(char16_t) atomic_char16_t;
|
||||
typedef _Atomic(char32_t) atomic_char32_t;
|
||||
#endif
|
||||
typedef _Atomic(wchar_t) atomic_wchar_t;
|
||||
typedef _Atomic(int_least8_t) atomic_int_least8_t;
|
||||
typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
|
||||
typedef _Atomic(int_least16_t) atomic_int_least16_t;
|
||||
typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
|
||||
typedef _Atomic(int_least32_t) atomic_int_least32_t;
|
||||
typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
|
||||
typedef _Atomic(int_least64_t) atomic_int_least64_t;
|
||||
typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
|
||||
typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
|
||||
typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
|
||||
typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
|
||||
typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
|
||||
typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
|
||||
typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
|
||||
typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
|
||||
typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
|
||||
typedef _Atomic(intptr_t) atomic_intptr_t;
|
||||
typedef _Atomic(uintptr_t) atomic_uintptr_t;
|
||||
typedef _Atomic(size_t) atomic_size_t;
|
||||
typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
|
||||
typedef _Atomic(intmax_t) atomic_intmax_t;
|
||||
typedef _Atomic(uintmax_t) atomic_uintmax_t;
|
||||
|
||||
/*
|
||||
* 7.17.7 Operations on atomic types.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compiler-specific operations.
|
||||
*/
|
||||
|
||||
#if defined(__CLANG_ATOMICS)
|
||||
#define atomic_compare_exchange_strong_explicit(object, expected, \
|
||||
desired, success, failure) \
|
||||
__c11_atomic_compare_exchange_strong(object, expected, desired, \
|
||||
success, failure)
|
||||
#define atomic_compare_exchange_weak_explicit(object, expected, \
|
||||
desired, success, failure) \
|
||||
__c11_atomic_compare_exchange_weak(object, expected, desired, \
|
||||
success, failure)
|
||||
#define atomic_exchange_explicit(object, desired, order) \
|
||||
__c11_atomic_exchange(object, desired, order)
|
||||
#define atomic_fetch_add_explicit(object, operand, order) \
|
||||
__c11_atomic_fetch_add(object, operand, order)
|
||||
#define atomic_fetch_and_explicit(object, operand, order) \
|
||||
__c11_atomic_fetch_and(object, operand, order)
|
||||
#define atomic_fetch_or_explicit(object, operand, order) \
|
||||
__c11_atomic_fetch_or(object, operand, order)
|
||||
#define atomic_fetch_sub_explicit(object, operand, order) \
|
||||
__c11_atomic_fetch_sub(object, operand, order)
|
||||
#define atomic_fetch_xor_explicit(object, operand, order) \
|
||||
__c11_atomic_fetch_xor(object, operand, order)
|
||||
#define atomic_load_explicit(object, order) \
|
||||
__c11_atomic_load(object, order)
|
||||
#define atomic_store_explicit(object, desired, order) \
|
||||
__c11_atomic_store(object, desired, order)
|
||||
#elif defined(__GNUC_ATOMICS)
|
||||
#define atomic_compare_exchange_strong_explicit(object, expected, \
|
||||
desired, success, failure) \
|
||||
__atomic_compare_exchange_n(&(object)->__val, expected, \
|
||||
desired, 0, success, failure)
|
||||
#define atomic_compare_exchange_weak_explicit(object, expected, \
|
||||
desired, success, failure) \
|
||||
__atomic_compare_exchange_n(&(object)->__val, expected, \
|
||||
desired, 1, success, failure)
|
||||
#define atomic_exchange_explicit(object, desired, order) \
|
||||
__atomic_exchange_n(&(object)->__val, desired, order)
|
||||
#define atomic_fetch_add_explicit(object, operand, order) \
|
||||
__atomic_fetch_add(&(object)->__val, operand, order)
|
||||
#define atomic_fetch_and_explicit(object, operand, order) \
|
||||
__atomic_fetch_and(&(object)->__val, operand, order)
|
||||
#define atomic_fetch_or_explicit(object, operand, order) \
|
||||
__atomic_fetch_or(&(object)->__val, operand, order)
|
||||
#define atomic_fetch_sub_explicit(object, operand, order) \
|
||||
__atomic_fetch_sub(&(object)->__val, operand, order)
|
||||
#define atomic_fetch_xor_explicit(object, operand, order) \
|
||||
__atomic_fetch_xor(&(object)->__val, operand, order)
|
||||
#define atomic_load_explicit(object, order) \
|
||||
__atomic_load_n(&(object)->__val, order)
|
||||
#define atomic_store_explicit(object, desired, order) \
|
||||
__atomic_store_n(&(object)->__val, desired, order)
|
||||
#else
|
||||
#define atomic_compare_exchange_strong_explicit(object, expected, \
|
||||
desired, success, failure) ({ \
|
||||
__typeof__((object)->__val) __v; \
|
||||
_Bool __r; \
|
||||
__v = __sync_val_compare_and_swap(&(object)->__val, \
|
||||
*(expected), desired); \
|
||||
__r = *(expected) == __v; \
|
||||
*(expected) = __v; \
|
||||
__r; \
|
||||
})
|
||||
|
||||
#define atomic_compare_exchange_weak_explicit(object, expected, \
|
||||
desired, success, failure) \
|
||||
atomic_compare_exchange_strong_explicit(object, expected, \
|
||||
desired, success, failure)
|
||||
#if __has_builtin(__sync_swap)
|
||||
/* Clang provides a full-barrier atomic exchange - use it if available. */
|
||||
#define atomic_exchange_explicit(object, desired, order) \
|
||||
__sync_swap(&(object)->__val, desired)
|
||||
#else
|
||||
/*
|
||||
* __sync_lock_test_and_set() is only an acquire barrier in theory (although in
|
||||
* practice it is usually a full barrier) so we need an explicit barrier after
|
||||
* it.
|
||||
*/
|
||||
#define atomic_exchange_explicit(object, desired, order) ({ \
|
||||
__typeof__((object)->__val) __v; \
|
||||
__v = __sync_lock_test_and_set(&(object)->__val, desired); \
|
||||
__sync_synchronize(); \
|
||||
__v; \
|
||||
})
|
||||
#endif
|
||||
#define atomic_fetch_add_explicit(object, operand, order) \
|
||||
__sync_fetch_and_add(&(object)->__val, operand)
|
||||
#define atomic_fetch_and_explicit(object, operand, order) \
|
||||
__sync_fetch_and_and(&(object)->__val, operand)
|
||||
#define atomic_fetch_or_explicit(object, operand, order) \
|
||||
__sync_fetch_and_or(&(object)->__val, operand)
|
||||
#define atomic_fetch_sub_explicit(object, operand, order) \
|
||||
__sync_fetch_and_sub(&(object)->__val, operand)
|
||||
#define atomic_fetch_xor_explicit(object, operand, order) \
|
||||
__sync_fetch_and_xor(&(object)->__val, operand)
|
||||
#define atomic_load_explicit(object, order) \
|
||||
__sync_fetch_and_add(&(object)->__val, 0)
|
||||
#define atomic_store_explicit(object, desired, order) do { \
|
||||
__sync_synchronize(); \
|
||||
(object)->__val = (desired); \
|
||||
__sync_synchronize(); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Convenience functions.
|
||||
*/
|
||||
|
||||
#define atomic_compare_exchange_strong(object, expected, desired) \
|
||||
atomic_compare_exchange_strong_explicit(object, expected, \
|
||||
desired, memory_order_seq_cst, memory_order_seq_cst)
|
||||
#define atomic_compare_exchange_weak(object, expected, desired) \
|
||||
atomic_compare_exchange_weak_explicit(object, expected, \
|
||||
desired, memory_order_seq_cst, memory_order_seq_cst)
|
||||
#define atomic_exchange(object, desired) \
|
||||
atomic_exchange_explicit(object, desired, memory_order_seq_cst)
|
||||
#define atomic_fetch_add(object, operand) \
|
||||
atomic_fetch_add_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_and(object, operand) \
|
||||
atomic_fetch_and_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_or(object, operand) \
|
||||
atomic_fetch_or_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_sub(object, operand) \
|
||||
atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_xor(object, operand) \
|
||||
atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_load(object) \
|
||||
atomic_load_explicit(object, memory_order_seq_cst)
|
||||
#define atomic_store(object, desired) \
|
||||
atomic_store_explicit(object, desired, memory_order_seq_cst)
|
||||
|
||||
/*
|
||||
* 7.17.8 Atomic flag type and operations.
|
||||
*/
|
||||
|
||||
typedef atomic_bool atomic_flag;
|
||||
|
||||
#define ATOMIC_FLAG_INIT ATOMIC_VAR_INIT(0)
|
||||
|
||||
#define atomic_flag_clear_explicit(object, order) \
|
||||
atomic_store_explicit(object, 0, order)
|
||||
#define atomic_flag_test_and_set_explicit(object, order) \
|
||||
atomic_compare_exchange_strong_explicit(object, 0, 1, order, order)
|
||||
|
||||
#define atomic_flag_clear(object) \
|
||||
atomic_flag_clear_explicit(object, memory_order_seq_cst)
|
||||
#define atomic_flag_test_and_set(object) \
|
||||
atomic_flag_test_and_set_explicit(object, memory_order_seq_cst)
|
||||
|
||||
#endif /* !_STDATOMIC_H_ */
|
|
@ -1,16 +0,0 @@
|
|||
#define SD_LISTEN_FDS_START 3
|
||||
|
||||
static inline int sd_listen_fds(int unset_environment)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int sd_is_socket(int fd, int family, int type, int listening)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int sd_notify(int unset_environment, const char *state)
|
||||
{
|
||||
return 0;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
static inline void ANNOTATE_BENIGN_RACE_SIZED(const void *mem,size_t len,const char *desc) {}
|
||||
#define ANNOTATE_BENIGN_RACE_SIZED ANNOTATE_BENIGN_RACE_SIZED
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
static inline void VALGRIND_MAKE_MEM_DEFINED(const void *mem,size_t len) {}
|
||||
#define VALGRIND_MAKE_MEM_DEFINED VALGRIND_MAKE_MEM_DEFINED
|
||||
|
||||
static inline void VALGRIND_MAKE_MEM_UNDEFINED(const void *mem,size_t len) {}
|
||||
#define VALGRIND_MAKE_MEM_UNDEFINED VALGRIND_MAKE_MEM_UNDEFINED
|
|
@ -1,137 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright 2015-2017 Obsidian Research Corp.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
import argparse
|
||||
import subprocess
|
||||
import os
|
||||
import collections
|
||||
|
||||
headers = {
|
||||
"endian.h",
|
||||
"netinet/in.h",
|
||||
"pthread.h",
|
||||
"sys/socket.h",
|
||||
"stdatomic.h",
|
||||
};
|
||||
|
||||
def norm_header(fn):
|
||||
for I in headers:
|
||||
flat = I.replace("/","-");
|
||||
if fn.endswith(flat):
|
||||
return I;
|
||||
if fn.endswith(flat + ".diff"):
|
||||
return I;
|
||||
return None;
|
||||
|
||||
def get_buildlib_patches(dfn):
|
||||
"""Within the buildlib directory we store patches for the glibc headers. Each
|
||||
patch is in a numbered sub directory that indicates the order to try, the
|
||||
number should match the glibc version used to make the diff."""
|
||||
res = [];
|
||||
for d,_,files in os.walk(dfn):
|
||||
for I in files:
|
||||
if d != dfn:
|
||||
bn = int(os.path.basename(d));
|
||||
else:
|
||||
bn = 0;
|
||||
|
||||
res.append((bn,os.path.join(d,I)));
|
||||
res.sort(reverse=True);
|
||||
|
||||
ret = collections.defaultdict(list);
|
||||
for _,I in res:
|
||||
ret[norm_header(I)].append(I);
|
||||
return ret;
|
||||
|
||||
def is_patch(fn):
|
||||
with open(fn) as F:
|
||||
return F.read(10).startswith("-- /");
|
||||
|
||||
def apply_patch(src,patch,dest):
|
||||
"""Patch a single system header. The output goes into our include search path
|
||||
and takes precedence over the system version."""
|
||||
dfn = os.path.dirname(dest);
|
||||
if not os.path.isdir(dfn):
|
||||
os.makedirs(dfn);
|
||||
|
||||
if not patch.endswith(".diff"):
|
||||
if not os.path.exists(dest):
|
||||
os.symlink(patch,dest);
|
||||
return True;
|
||||
|
||||
try:
|
||||
if os.path.exists(dest + ".rej"):
|
||||
os.unlink(dest + ".rej");
|
||||
|
||||
subprocess.check_output(["patch","-f","--follow-symlinks","-V","never","-i",patch,"-o",dest,src]);
|
||||
|
||||
if os.path.exists(dest + ".rej"):
|
||||
print "Patch from %r failed"%(patch);
|
||||
return False;
|
||||
except subprocess.CalledProcessError:
|
||||
print "Patch from %r failed"%(patch);
|
||||
return False;
|
||||
return True;
|
||||
|
||||
def replace_header(fn):
|
||||
tries = 0;
|
||||
for pfn in patches[fn]:
|
||||
if apply_patch(os.path.join(args.REF,fn),
|
||||
pfn,os.path.join(args.INCLUDE,fn)):
|
||||
return;
|
||||
tries = tries + 1;
|
||||
|
||||
print "Unable to apply any patch to %r, tries %u"%(fn,tries);
|
||||
global failed;
|
||||
failed = True;
|
||||
|
||||
def save(fn,outdir):
|
||||
"""Diff the header file in our include directory against the system header and
|
||||
store the diff into buildlib. This makes it fairly easy to maintain the
|
||||
replacement headers."""
|
||||
if os.path.islink(os.path.join(args.INCLUDE,fn)):
|
||||
return;
|
||||
|
||||
flatfn = fn.replace("/","-") + ".diff";
|
||||
flatfn = os.path.join(outdir,flatfn);
|
||||
|
||||
with open(flatfn,"wt") as F:
|
||||
try:
|
||||
subprocess.check_call(["diff","-u",
|
||||
os.path.join(args.REF,fn),
|
||||
os.path.join(args.INCLUDE,fn)],
|
||||
stdout=F);
|
||||
except subprocess.CalledProcessError as ex:
|
||||
if ex.returncode == 1:
|
||||
return;
|
||||
raise;
|
||||
|
||||
parser = argparse.ArgumentParser(description='Produce sparse shim header files')
|
||||
parser.add_argument("--out",dest="INCLUDE",required=True,
|
||||
help="Directory to write header files to");
|
||||
parser.add_argument("--src",dest="SRC",required=True,
|
||||
help="Top of the source tree");
|
||||
parser.add_argument("--ref",dest="REF",default="/usr/include/",
|
||||
help="System headers to manipulate");
|
||||
parser.add_argument("--save",action="store_true",default=False,
|
||||
help="Save mode will write the current content of the headers to buildlib as a diff.");
|
||||
args = parser.parse_args();
|
||||
|
||||
if args.save:
|
||||
# Get the glibc version string
|
||||
ver = subprocess.check_output(["ldd","--version"]).splitlines()[0].split(' ')[-1];
|
||||
ver = ver.partition(".")[-1];
|
||||
outdir = os.path.join(args.SRC,"buildlib","sparse-include",ver);
|
||||
if not os.path.isdir(outdir):
|
||||
os.makedirs(outdir);
|
||||
|
||||
for I in headers:
|
||||
save(I,outdir);
|
||||
else:
|
||||
failed = False;
|
||||
patches = get_buildlib_patches(os.path.join(args.SRC,"buildlib","sparse-include"));
|
||||
for I in headers:
|
||||
replace_header(I);
|
||||
|
||||
if failed:
|
||||
raise ValueError("Patch applications failed");
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ $TRAVIS_TAG == v* ]] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Let's create release for vX tags only.
|
||||
# Strip the v from the TRAVIS_TAG for our prefix and output items
|
||||
REL_TAG=`echo $TRAVIS_TAG | sed -e 's/^v//'`
|
||||
git archive --prefix rdma-core-$REL_TAG/ --output rdma-core-$REL_TAG.tar.gz $TRAVIS_TAG
|
||||
fi
|
|
@ -1,6 +0,0 @@
|
|||
/* The providers do not export any symbols at all. Instead they rely on
|
||||
attribute(constructor) to cause their init function to run at dlopen
|
||||
time. */
|
||||
{
|
||||
local: *;
|
||||
};
|
|
@ -1,31 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
# Same as publish_headers but does not install them during the install phase
|
||||
function(publish_internal_headers DEST)
|
||||
if(NOT ARGN)
|
||||
message(SEND_ERROR "Error: publish_internal_headers called without any files")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(DDIR "${BUILD_INCLUDE}/${DEST}")
|
||||
#message(STATUS "BUILD_INCLUDE: ${BUILD_INCLUDE}")
|
||||
file(MAKE_DIRECTORY "${DDIR}")
|
||||
|
||||
foreach(SFIL ${ARGN})
|
||||
get_filename_component(FIL ${SFIL} NAME)
|
||||
rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/${SFIL}" "${DDIR}/${FIL}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Copy headers from the source directory to the proper place in the
|
||||
# build/include directory. This also installs them into /usr/include/xx during
|
||||
# the install phase
|
||||
function(publish_headers DEST)
|
||||
publish_internal_headers("${DEST}" ${ARGN})
|
||||
|
||||
foreach(SFIL ${ARGN})
|
||||
get_filename_component(FIL ${SFIL} NAME)
|
||||
install(FILES "${SFIL}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${DEST}/" RENAME "${FIL}")
|
||||
endforeach()
|
||||
endfunction()
|
|
@ -1,296 +0,0 @@
|
|||
# COPYRIGHT (c) 2016 Obsidian Research Corporation.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
# Helper functions for use in the sub CMakeLists files to make them simpler
|
||||
# and more uniform.
|
||||
|
||||
# Global list of pairs of (SHARED STATIC) libary target names
|
||||
set(RDMA_STATIC_LIBS "" CACHE INTERNAL "Doc" FORCE)
|
||||
|
||||
set(COMMON_LIBS_PIC ccan_pic rdma_util_pic)
|
||||
set(COMMON_LIBS ccan rdma_util)
|
||||
|
||||
# Create a symlink at filename DEST
|
||||
# If the directory containing DEST does not exist then it is created
|
||||
# automatically.
|
||||
function(rdma_create_symlink LINK_CONTENT DEST)
|
||||
if(NOT LINK_CONTENT)
|
||||
message(FATAL_ERROR "Failed to provide LINK_CONTENT")
|
||||
endif()
|
||||
|
||||
# Make sure the directory exists, cmake doesn't create target DESTINATION
|
||||
# directories until everything is finished, do it manually here if necessary
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.12")
|
||||
get_filename_component(DDIR "${DEST}" PATH)
|
||||
else()
|
||||
get_filename_component(DDIR "${DEST}" DIRECTORY)
|
||||
endif()
|
||||
|
||||
IF(NOT EXISTS "${DDIR}/")
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "make_directory"
|
||||
"${BUILD_LIB}" RESULT_VARIABLE retcode)
|
||||
if(NOT "${retcode}" STREQUAL "0")
|
||||
message(FATAL_ERROR "Failed to create directory ${DDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Newer versions of cmake can use "${CMAKE_COMMAND}" "-E" "create_symlink"
|
||||
# however it is broken weirdly on older versions.
|
||||
execute_process(COMMAND "ln" "-Tsf"
|
||||
"${LINK_CONTENT}" "${DEST}" RESULT_VARIABLE retcode)
|
||||
if(NOT "${retcode}" STREQUAL "0")
|
||||
message(FATAL_ERROR "Failed to create symlink in ${DEST}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Install a symlink during 'make install'
|
||||
function(rdma_install_symlink LINK_CONTENT DEST)
|
||||
# Create a link in the build tree with the right content
|
||||
get_filename_component(FN "${DEST}" NAME)
|
||||
rdma_create_symlink("${LINK_CONTENT}" "${CMAKE_CURRENT_BINARY_DIR}/${FN}")
|
||||
|
||||
# Have cmake install it. Doing it this way lets cpack work if we ever wish
|
||||
# to use that.
|
||||
get_filename_component(DIR "${DEST}" PATH)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${FN}"
|
||||
DESTINATION "${DIR}")
|
||||
endfunction()
|
||||
|
||||
# Wrapper for install() that runs the single file through configure_file first.
|
||||
# This only works with the basic single file install(FILE file ARGS..) pattern
|
||||
function(rdma_subst_install ARG1 file)
|
||||
if (NOT "${ARG1}" STREQUAL "FILES")
|
||||
message(FATAL_ERROR "Bad use of rdma_subst_install")
|
||||
endif()
|
||||
configure_file("${file}" "${CMAKE_CURRENT_BINARY_DIR}/${file}" @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${file}" ${ARGN})
|
||||
endfunction()
|
||||
|
||||
# Modify shared library target DEST to use VERSION_SCRIPT as the linker map file
|
||||
function(rdma_set_library_map DEST VERSION_SCRIPT)
|
||||
if (NOT IS_ABSOLUTE ${VERSION_SCRIPT})
|
||||
set(VERSION_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/${VERSION_SCRIPT}")
|
||||
endif()
|
||||
set_property(TARGET ${DEST} APPEND_STRING PROPERTY
|
||||
LINK_FLAGS " -Wl,--version-script,${VERSION_SCRIPT}")
|
||||
|
||||
# NOTE: This won't work with ninja prior to cmake 3.4
|
||||
set_property(TARGET ${DEST} APPEND_STRING PROPERTY
|
||||
LINK_DEPENDS ${VERSION_SCRIPT})
|
||||
endfunction()
|
||||
|
||||
# Basic function to produce a standard libary with a GNU LD version script.
|
||||
function(rdma_library DEST VERSION_SCRIPT SOVERSION VERSION)
|
||||
# Create a static library
|
||||
if (ENABLE_STATIC)
|
||||
add_library(${DEST}-static STATIC ${ARGN})
|
||||
set_target_properties(${DEST}-static PROPERTIES
|
||||
OUTPUT_NAME ${DEST}
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_LIB}")
|
||||
target_compile_definitions(${DEST}-static PRIVATE _STATIC_LIBRARY_BUILD_=1)
|
||||
install(TARGETS ${DEST}-static DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
list(APPEND RDMA_STATIC_LIBS ${DEST} ${DEST}-static)
|
||||
set(RDMA_STATIC_LIBS "${RDMA_STATIC_LIBS}" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# Create a shared library
|
||||
add_library(${DEST} SHARED ${ARGN})
|
||||
rdma_set_library_map(${DEST} ${VERSION_SCRIPT})
|
||||
target_link_libraries(${DEST} LINK_PRIVATE ${COMMON_LIBS_PIC})
|
||||
set_target_properties(${DEST} PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${VERSION}
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
|
||||
install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
endfunction()
|
||||
|
||||
# Create a special provider with exported symbols in it The shared provider
|
||||
# exists as a normal system library with the normal shared library SONAME and
|
||||
# other convections. The system library is symlinked into the
|
||||
# VERBS_PROVIDER_DIR so it can be dlopened as a provider as well.
|
||||
function(rdma_shared_provider DEST VERSION_SCRIPT SOVERSION VERSION)
|
||||
# Installed driver file
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${DEST}.driver" "driver ${DEST}\n")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${DEST}.driver" DESTINATION "${CONFIG_DIR}")
|
||||
|
||||
# Uninstalled driver file
|
||||
file(MAKE_DIRECTORY "${BUILD_ETC}/libibverbs.d/")
|
||||
file(WRITE "${BUILD_ETC}/libibverbs.d/${DEST}.driver" "driver ${BUILD_LIB}/lib${DEST}\n")
|
||||
|
||||
# Create a static provider library
|
||||
if (ENABLE_STATIC)
|
||||
add_library(${DEST}-static STATIC ${ARGN})
|
||||
set_target_properties(${DEST}-static PROPERTIES OUTPUT_NAME ${DEST})
|
||||
set_target_properties(${DEST}-static PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${BUILD_LIB}")
|
||||
target_compile_definitions(${DEST}-static PRIVATE _STATIC_LIBRARY_BUILD_=1)
|
||||
install(TARGETS ${DEST}-static DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
list(APPEND RDMA_STATIC_LIBS ${DEST} ${DEST}-static)
|
||||
set(RDMA_STATIC_LIBS "${RDMA_STATIC_LIBS}" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# Create the plugin shared library
|
||||
add_library(${DEST} SHARED ${ARGN})
|
||||
rdma_set_library_map(${DEST} ${VERSION_SCRIPT})
|
||||
|
||||
target_link_libraries(${DEST} LINK_PRIVATE ${COMMON_LIBS_PIC})
|
||||
target_link_libraries(${DEST} LINK_PRIVATE ibverbs)
|
||||
target_link_libraries(${DEST} LINK_PRIVATE ${CMAKE_THREAD_LIBS_INIT})
|
||||
set_target_properties(${DEST} PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${VERSION}
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
|
||||
install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
# Compute a relative symlink from VERBS_PROVIDER_DIR to LIBDIR
|
||||
execute_process(COMMAND python ${CMAKE_SOURCE_DIR}/buildlib/relpath
|
||||
"${CMAKE_INSTALL_FULL_LIBDIR}/lib${DEST}.so.${VERSION}"
|
||||
"${VERBS_PROVIDER_DIR}"
|
||||
OUTPUT_VARIABLE DEST_LINK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE retcode)
|
||||
if(NOT "${retcode}" STREQUAL "0")
|
||||
message(FATAL_ERROR "Unable to run buildlib/relpath, do you have python?")
|
||||
endif()
|
||||
|
||||
rdma_install_symlink("${DEST_LINK_PATH}" "${VERBS_PROVIDER_DIR}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}")
|
||||
rdma_create_symlink("lib${DEST}.so.${VERSION}" "${BUILD_LIB}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}")
|
||||
endfunction()
|
||||
|
||||
# Create a provider shared library for libibverbs
|
||||
function(rdma_provider DEST)
|
||||
# Installed driver file
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${DEST}.driver" "driver ${DEST}\n")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${DEST}.driver" DESTINATION "${CONFIG_DIR}")
|
||||
|
||||
# Uninstalled driver file
|
||||
file(MAKE_DIRECTORY "${BUILD_ETC}/libibverbs.d/")
|
||||
file(WRITE "${BUILD_ETC}/libibverbs.d/${DEST}.driver" "driver ${BUILD_LIB}/lib${DEST}\n")
|
||||
|
||||
# Create a static provider library
|
||||
# FIXME: This is probably pointless, the provider library has no symbols so
|
||||
# what good is it? Presumably it should be used with -Wl,--whole-archive,
|
||||
# but we don't have any directions on how to make static linking work..
|
||||
if (ENABLE_STATIC)
|
||||
add_library(${DEST} STATIC ${ARGN})
|
||||
set_target_properties(${DEST} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${BUILD_LIB}")
|
||||
target_compile_definitions(${DEST} PRIVATE _STATIC_LIBRARY_BUILD_=1)
|
||||
install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
list(APPEND RDMA_STATIC_LIBS "${DEST}-rdmav${IBVERBS_PABI_VERSION}" ${DEST})
|
||||
set(RDMA_STATIC_LIBS "${RDMA_STATIC_LIBS}" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# Create the plugin shared library
|
||||
set(DEST "${DEST}-rdmav${IBVERBS_PABI_VERSION}")
|
||||
add_library(${DEST} MODULE ${ARGN})
|
||||
# Even though these are modules we still want to use Wl,--no-undefined
|
||||
set_target_properties(${DEST} PROPERTIES LINK_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
|
||||
rdma_set_library_map(${DEST} ${BUILDLIB}/provider.map)
|
||||
target_link_libraries(${DEST} LINK_PRIVATE ${COMMON_LIBS_PIC})
|
||||
target_link_libraries(${DEST} LINK_PRIVATE ibverbs)
|
||||
target_link_libraries(${DEST} LINK_PRIVATE ${CMAKE_THREAD_LIBS_INIT})
|
||||
set_target_properties(${DEST} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
|
||||
# Provider Plugins do not use SONAME versioning, there is no reason to
|
||||
# create the usual symlinks.
|
||||
|
||||
if (VERBS_PROVIDER_DIR)
|
||||
install(TARGETS ${DEST} DESTINATION "${VERBS_PROVIDER_DIR}")
|
||||
else()
|
||||
install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
# FIXME: This symlink is provided for compat with the old build, but it
|
||||
# never should have existed in the first place, nothing should use this
|
||||
# name, we can probably remove it.
|
||||
rdma_install_symlink("lib${DEST}${IBVERBS_PROVIDER_SUFFIX}" "${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Create an installed executable
|
||||
function(rdma_executable EXEC)
|
||||
add_executable(${EXEC} ${ARGN})
|
||||
target_link_libraries(${EXEC} LINK_PRIVATE ${COMMON_LIBS})
|
||||
set_target_properties(${EXEC} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BUILD_BIN}")
|
||||
install(TARGETS ${EXEC} DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endfunction()
|
||||
|
||||
# Create an installed executable (under sbin)
|
||||
function(rdma_sbin_executable EXEC)
|
||||
add_executable(${EXEC} ${ARGN})
|
||||
target_link_libraries(${EXEC} LINK_PRIVATE ${COMMON_LIBS})
|
||||
set_target_properties(${EXEC} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BUILD_BIN}")
|
||||
install(TARGETS ${EXEC} DESTINATION "${CMAKE_INSTALL_SBINDIR}")
|
||||
endfunction()
|
||||
|
||||
# Create an test executable (not-installed)
|
||||
function(rdma_test_executable EXEC)
|
||||
add_executable(${EXEC} ${ARGN})
|
||||
target_link_libraries(${EXEC} LINK_PRIVATE ${COMMON_LIBS})
|
||||
set_target_properties(${EXEC} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BUILD_BIN}")
|
||||
endfunction()
|
||||
|
||||
# Install man pages. This deduces the section from the trailing integer in the
|
||||
# filename
|
||||
function(rdma_man_pages)
|
||||
foreach(I ${ARGN})
|
||||
if ("${I}" MATCHES "\\.in$")
|
||||
string(REGEX REPLACE "^.+[.](.+)\\.in$" "\\1" MAN_SECT "${I}")
|
||||
string(REGEX REPLACE "^(.+)\\.in$" "\\1" BASE_NAME "${I}")
|
||||
get_filename_component(BASE_NAME "${BASE_NAME}" NAME)
|
||||
rdma_subst_install(FILES "${I}"
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/"
|
||||
RENAME "${BASE_NAME}")
|
||||
else()
|
||||
string(REGEX REPLACE "^.+[.](.+)$" "\\1" MAN_SECT "${I}")
|
||||
install(FILES "${I}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Create an alias for a man page, using a symlink.
|
||||
# Input is a list of pairs of names (MAN_PAGE ALIAS)
|
||||
# NOTE: The section must currently be the same for both.
|
||||
function(rdma_alias_man_pages)
|
||||
list(LENGTH ARGN LEN)
|
||||
math(EXPR LEN ${LEN}-1)
|
||||
foreach(I RANGE 0 ${LEN} 2)
|
||||
list(GET ARGN ${I} FROM)
|
||||
math(EXPR I ${I}+1)
|
||||
list(GET ARGN ${I} TO)
|
||||
string(REGEX REPLACE "^.+[.](.+)$" "\\1" MAN_SECT ${FROM})
|
||||
rdma_install_symlink("${FROM}" "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/${TO}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Finalize the setup of the static libraries by copying the meta information
|
||||
# from the shared and setting up the libtool .la files.
|
||||
function(rdma_finalize_libs)
|
||||
list(LENGTH RDMA_STATIC_LIBS LEN)
|
||||
if (LEN LESS 2)
|
||||
return()
|
||||
endif()
|
||||
|
||||
math(EXPR LEN ${LEN}-1)
|
||||
foreach(I RANGE 0 ${LEN} 2)
|
||||
list(GET RDMA_STATIC_LIBS ${I} SHARED)
|
||||
math(EXPR I ${I}+1)
|
||||
list(GET RDMA_STATIC_LIBS ${I} STATIC)
|
||||
|
||||
# PUBLIC libraries
|
||||
set(LIBS "")
|
||||
get_property(TMP TARGET ${SHARED} PROPERTY INTERFACE_LINK_LIBRARIES SET)
|
||||
if (TMP)
|
||||
get_target_property(TMP ${SHARED} INTERFACE_LINK_LIBRARIES)
|
||||
set_target_properties(${STATIC} PROPERTIES INTERFACE_LINK_LIBRARIES "${TMP}")
|
||||
set(LIBS "${TMP}")
|
||||
endif()
|
||||
|
||||
# PRIVATE libraries
|
||||
get_property(TMP TARGET ${SHARED} PROPERTY LINK_LIBRARIES SET)
|
||||
if (TMP)
|
||||
get_target_property(TMP ${SHARED} LINK_LIBRARIES)
|
||||
set_target_properties(${STATIC} PROPERTIES LINK_LIBRARIES "${TMP}")
|
||||
list(APPEND LIBS "${TMP}")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
|
@ -1,8 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright 2017 Mellanox Technologies, Inc.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
print(os.path.relpath(sys.argv[1], sys.argv[2]))
|
|
@ -1,121 +0,0 @@
|
|||
--- /usr/include/netinet/in.h 2016-05-26 10:27:23.000000000 +0000
|
||||
+++ build-sparse/include/netinet/in.h 2017-03-15 21:50:20.436860311 +0000
|
||||
@@ -22,12 +22,12 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/socket.h>
|
||||
#include <bits/types.h>
|
||||
-
|
||||
+#include <linux/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Internet address. */
|
||||
-typedef uint32_t in_addr_t;
|
||||
+typedef __be32 in_addr_t;
|
||||
struct in_addr
|
||||
{
|
||||
in_addr_t s_addr;
|
||||
@@ -114,7 +114,7 @@
|
||||
#endif /* !__USE_KERNEL_IPV6_DEFS */
|
||||
|
||||
/* Type to represent a port. */
|
||||
-typedef uint16_t in_port_t;
|
||||
+typedef __be16 in_port_t;
|
||||
|
||||
/* Standard well-known ports. */
|
||||
enum
|
||||
@@ -173,36 +173,36 @@
|
||||
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
|
||||
#define IN_CLASSB_MAX 65536
|
||||
|
||||
-#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
|
||||
+#define IN_CLASSC(a) ((((uint32_t)(a)) & 0xe0000000) == 0xc0000000)
|
||||
#define IN_CLASSC_NET 0xffffff00
|
||||
#define IN_CLASSC_NSHIFT 8
|
||||
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
|
||||
|
||||
-#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
|
||||
+#define IN_CLASSD(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000)
|
||||
#define IN_MULTICAST(a) IN_CLASSD(a)
|
||||
|
||||
-#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
|
||||
-#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
|
||||
+#define IN_EXPERIMENTAL(a) ((((uint32_t)(a)) & 0xe0000000) == 0xe0000000)
|
||||
+#define IN_BADCLASS(a) ((((uint32_t)(a)) & 0xf0000000) == 0xf0000000)
|
||||
|
||||
/* Address to accept any incoming messages. */
|
||||
-#define INADDR_ANY ((in_addr_t) 0x00000000)
|
||||
+#define INADDR_ANY ((uint32_t) 0x00000000)
|
||||
/* Address to send to all hosts. */
|
||||
-#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
|
||||
+#define INADDR_BROADCAST ((uint32_t) 0xffffffff)
|
||||
/* Address indicating an error return. */
|
||||
-#define INADDR_NONE ((in_addr_t) 0xffffffff)
|
||||
+#define INADDR_NONE ((uint32_t) 0xffffffff)
|
||||
|
||||
/* Network number for local host loopback. */
|
||||
#define IN_LOOPBACKNET 127
|
||||
/* Address to loopback in software to local host. */
|
||||
#ifndef INADDR_LOOPBACK
|
||||
-# define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */
|
||||
+# define INADDR_LOOPBACK ((uint32_t) 0x7f000001) /* Inet 127.0.0.1. */
|
||||
#endif
|
||||
|
||||
/* Defines for Multicast INADDR. */
|
||||
-#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */
|
||||
-#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */
|
||||
-#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
|
||||
-#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
|
||||
+#define INADDR_UNSPEC_GROUP ((uint32_t) 0xe0000000) /* 224.0.0.0 */
|
||||
+#define INADDR_ALLHOSTS_GROUP ((uint32_t) 0xe0000001) /* 224.0.0.1 */
|
||||
+#define INADDR_ALLRTRS_GROUP ((uint32_t) 0xe0000002) /* 224.0.0.2 */
|
||||
+#define INADDR_MAX_LOCAL_GROUP ((uint32_t) 0xe00000ff) /* 224.0.0.255 */
|
||||
|
||||
#ifndef __USE_KERNEL_IPV6_DEFS
|
||||
/* IPv6 address */
|
||||
@@ -212,8 +212,8 @@
|
||||
{
|
||||
uint8_t __u6_addr8[16];
|
||||
#if defined __USE_MISC || defined __USE_GNU
|
||||
- uint16_t __u6_addr16[8];
|
||||
- uint32_t __u6_addr32[4];
|
||||
+ __be16 __u6_addr16[8];
|
||||
+ __be32 __u6_addr32[4];
|
||||
#endif
|
||||
} __in6_u;
|
||||
#define s6_addr __in6_u.__u6_addr8
|
||||
@@ -253,7 +253,7 @@
|
||||
{
|
||||
__SOCKADDR_COMMON (sin6_);
|
||||
in_port_t sin6_port; /* Transport layer port # */
|
||||
- uint32_t sin6_flowinfo; /* IPv6 flow information */
|
||||
+ __be32 sin6_flowinfo; /* IPv6 flow information */
|
||||
struct in6_addr sin6_addr; /* IPv6 address */
|
||||
uint32_t sin6_scope_id; /* IPv6 scope-id */
|
||||
};
|
||||
@@ -371,12 +371,12 @@
|
||||
this was a short-sighted decision since on different systems the types
|
||||
may have different representations but the values are always the same. */
|
||||
|
||||
-extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
|
||||
-extern uint16_t ntohs (uint16_t __netshort)
|
||||
+extern uint32_t ntohl (__be32 __netlong) __THROW __attribute__ ((__const__));
|
||||
+extern uint16_t ntohs (__be16 __netshort)
|
||||
__THROW __attribute__ ((__const__));
|
||||
-extern uint32_t htonl (uint32_t __hostlong)
|
||||
+extern __be32 htonl (uint32_t __hostlong)
|
||||
__THROW __attribute__ ((__const__));
|
||||
-extern uint16_t htons (uint16_t __hostshort)
|
||||
+extern __be16 htons (uint16_t __hostshort)
|
||||
__THROW __attribute__ ((__const__));
|
||||
|
||||
#include <endian.h>
|
||||
@@ -384,7 +384,7 @@
|
||||
/* Get machine dependent optimized versions of byte swapping functions. */
|
||||
#include <bits/byteswap.h>
|
||||
|
||||
-#ifdef __OPTIMIZE__
|
||||
+#ifdef __disabled_OPTIMIZE__
|
||||
/* We can optimize calls to the conversion functions. Either nothing has
|
||||
to be done or we are using directly the byte-swapping functions which
|
||||
often can be inlined. */
|
|
@ -1,121 +0,0 @@
|
|||
--- /usr/include/netinet/in.h 2016-11-16 15:44:03.000000000 -0700
|
||||
+++ build-sparse/include/netinet/in.h 2017-03-15 13:55:43.865288477 -0600
|
||||
@@ -22,12 +22,12 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/socket.h>
|
||||
#include <bits/types.h>
|
||||
-
|
||||
+#include <linux/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Internet address. */
|
||||
-typedef uint32_t in_addr_t;
|
||||
+typedef __be32 in_addr_t;
|
||||
struct in_addr
|
||||
{
|
||||
in_addr_t s_addr;
|
||||
@@ -116,7 +116,7 @@
|
||||
#endif /* !__USE_KERNEL_IPV6_DEFS */
|
||||
|
||||
/* Type to represent a port. */
|
||||
-typedef uint16_t in_port_t;
|
||||
+typedef __be16 in_port_t;
|
||||
|
||||
/* Standard well-known ports. */
|
||||
enum
|
||||
@@ -175,36 +175,36 @@
|
||||
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
|
||||
#define IN_CLASSB_MAX 65536
|
||||
|
||||
-#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
|
||||
+#define IN_CLASSC(a) ((((uint32_t)(a)) & 0xe0000000) == 0xc0000000)
|
||||
#define IN_CLASSC_NET 0xffffff00
|
||||
#define IN_CLASSC_NSHIFT 8
|
||||
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
|
||||
|
||||
-#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
|
||||
+#define IN_CLASSD(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000)
|
||||
#define IN_MULTICAST(a) IN_CLASSD(a)
|
||||
|
||||
-#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
|
||||
-#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
|
||||
+#define IN_EXPERIMENTAL(a) ((((uint32_t)(a)) & 0xe0000000) == 0xe0000000)
|
||||
+#define IN_BADCLASS(a) ((((uint32_t)(a)) & 0xf0000000) == 0xf0000000)
|
||||
|
||||
/* Address to accept any incoming messages. */
|
||||
-#define INADDR_ANY ((in_addr_t) 0x00000000)
|
||||
+#define INADDR_ANY ((uint32_t) 0x00000000)
|
||||
/* Address to send to all hosts. */
|
||||
-#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
|
||||
+#define INADDR_BROADCAST ((uint32_t) 0xffffffff)
|
||||
/* Address indicating an error return. */
|
||||
-#define INADDR_NONE ((in_addr_t) 0xffffffff)
|
||||
+#define INADDR_NONE ((uint32_t) 0xffffffff)
|
||||
|
||||
/* Network number for local host loopback. */
|
||||
#define IN_LOOPBACKNET 127
|
||||
/* Address to loopback in software to local host. */
|
||||
#ifndef INADDR_LOOPBACK
|
||||
-# define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */
|
||||
+# define INADDR_LOOPBACK ((uint32_t) 0x7f000001) /* Inet 127.0.0.1. */
|
||||
#endif
|
||||
|
||||
/* Defines for Multicast INADDR. */
|
||||
-#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */
|
||||
-#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */
|
||||
-#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
|
||||
-#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
|
||||
+#define INADDR_UNSPEC_GROUP ((uint32_t) 0xe0000000) /* 224.0.0.0 */
|
||||
+#define INADDR_ALLHOSTS_GROUP ((uint32_t) 0xe0000001) /* 224.0.0.1 */
|
||||
+#define INADDR_ALLRTRS_GROUP ((uint32_t) 0xe0000002) /* 224.0.0.2 */
|
||||
+#define INADDR_MAX_LOCAL_GROUP ((uint32_t) 0xe00000ff) /* 224.0.0.255 */
|
||||
|
||||
#ifndef __USE_KERNEL_IPV6_DEFS
|
||||
/* IPv6 address */
|
||||
@@ -214,8 +214,8 @@
|
||||
{
|
||||
uint8_t __u6_addr8[16];
|
||||
#ifdef __USE_MISC
|
||||
- uint16_t __u6_addr16[8];
|
||||
- uint32_t __u6_addr32[4];
|
||||
+ __be16 __u6_addr16[8];
|
||||
+ __be32 __u6_addr32[4];
|
||||
#endif
|
||||
} __in6_u;
|
||||
#define s6_addr __in6_u.__u6_addr8
|
||||
@@ -255,7 +255,7 @@
|
||||
{
|
||||
__SOCKADDR_COMMON (sin6_);
|
||||
in_port_t sin6_port; /* Transport layer port # */
|
||||
- uint32_t sin6_flowinfo; /* IPv6 flow information */
|
||||
+ __be32 sin6_flowinfo; /* IPv6 flow information */
|
||||
struct in6_addr sin6_addr; /* IPv6 address */
|
||||
uint32_t sin6_scope_id; /* IPv6 scope-id */
|
||||
};
|
||||
@@ -373,12 +373,12 @@
|
||||
this was a short-sighted decision since on different systems the types
|
||||
may have different representations but the values are always the same. */
|
||||
|
||||
-extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
|
||||
-extern uint16_t ntohs (uint16_t __netshort)
|
||||
+extern uint32_t ntohl (__be32 __netlong) __THROW __attribute__ ((__const__));
|
||||
+extern uint16_t ntohs (__be16 __netshort)
|
||||
__THROW __attribute__ ((__const__));
|
||||
-extern uint32_t htonl (uint32_t __hostlong)
|
||||
+extern __be32 htonl (uint32_t __hostlong)
|
||||
__THROW __attribute__ ((__const__));
|
||||
-extern uint16_t htons (uint16_t __hostshort)
|
||||
+extern __be16 htons (uint16_t __hostshort)
|
||||
__THROW __attribute__ ((__const__));
|
||||
|
||||
#include <endian.h>
|
||||
@@ -386,7 +386,7 @@
|
||||
/* Get machine dependent optimized versions of byte swapping functions. */
|
||||
#include <bits/byteswap.h>
|
||||
|
||||
-#ifdef __OPTIMIZE__
|
||||
+#ifdef __disabled_OPTIMIZE__
|
||||
/* We can optimize calls to the conversion functions. Either nothing has
|
||||
to be done or we are using directly the byte-swapping functions which
|
||||
often can be inlined. */
|
|
@ -1,11 +0,0 @@
|
|||
--- /usr/include/sys/socket.h 2016-11-16 15:43:53.000000000 -0700
|
||||
+++ build-sparse/include/sys/socket.h 2017-03-15 12:43:28.736376893 -0600
|
||||
@@ -65,7 +65,7 @@
|
||||
uses with any of the listed types to be allowed without complaint.
|
||||
G++ 2.7 does not support transparent unions so there we want the
|
||||
old-style declaration, too. */
|
||||
-#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU
|
||||
+#if 1
|
||||
# define __SOCKADDR_ARG struct sockaddr *__restrict
|
||||
# define __CONST_SOCKADDR_ARG const struct sockaddr *
|
||||
#else
|
|
@ -1,121 +0,0 @@
|
|||
--- /usr/include/netinet/in.h 2017-03-09 00:51:29.000000000 +0000
|
||||
+++ build-tumbleweed/include/netinet/in.h 2017-03-21 18:13:51.951339197 +0000
|
||||
@@ -22,12 +22,12 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/socket.h>
|
||||
#include <bits/types.h>
|
||||
-
|
||||
+#include <linux/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Internet address. */
|
||||
-typedef uint32_t in_addr_t;
|
||||
+typedef __be32 in_addr_t;
|
||||
struct in_addr
|
||||
{
|
||||
in_addr_t s_addr;
|
||||
@@ -116,7 +116,7 @@
|
||||
#endif /* !__USE_KERNEL_IPV6_DEFS */
|
||||
|
||||
/* Type to represent a port. */
|
||||
-typedef uint16_t in_port_t;
|
||||
+typedef __be16 in_port_t;
|
||||
|
||||
/* Standard well-known ports. */
|
||||
enum
|
||||
@@ -175,36 +175,36 @@
|
||||
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
|
||||
#define IN_CLASSB_MAX 65536
|
||||
|
||||
-#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
|
||||
+#define IN_CLASSC(a) ((((uint32_t)(a)) & 0xe0000000) == 0xc0000000)
|
||||
#define IN_CLASSC_NET 0xffffff00
|
||||
#define IN_CLASSC_NSHIFT 8
|
||||
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
|
||||
|
||||
-#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
|
||||
+#define IN_CLASSD(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000)
|
||||
#define IN_MULTICAST(a) IN_CLASSD(a)
|
||||
|
||||
-#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
|
||||
-#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
|
||||
+#define IN_EXPERIMENTAL(a) ((((uint32_t)(a)) & 0xe0000000) == 0xe0000000)
|
||||
+#define IN_BADCLASS(a) ((((uint32_t)(a)) & 0xf0000000) == 0xf0000000)
|
||||
|
||||
/* Address to accept any incoming messages. */
|
||||
-#define INADDR_ANY ((in_addr_t) 0x00000000)
|
||||
+#define INADDR_ANY ((uint32_t) 0x00000000)
|
||||
/* Address to send to all hosts. */
|
||||
-#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
|
||||
+#define INADDR_BROADCAST ((uint32_t) 0xffffffff)
|
||||
/* Address indicating an error return. */
|
||||
-#define INADDR_NONE ((in_addr_t) 0xffffffff)
|
||||
+#define INADDR_NONE ((uint32_t) 0xffffffff)
|
||||
|
||||
/* Network number for local host loopback. */
|
||||
#define IN_LOOPBACKNET 127
|
||||
/* Address to loopback in software to local host. */
|
||||
#ifndef INADDR_LOOPBACK
|
||||
-# define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */
|
||||
+# define INADDR_LOOPBACK ((uint32_t) 0x7f000001) /* Inet 127.0.0.1. */
|
||||
#endif
|
||||
|
||||
/* Defines for Multicast INADDR. */
|
||||
-#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */
|
||||
-#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */
|
||||
-#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
|
||||
-#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
|
||||
+#define INADDR_UNSPEC_GROUP ((uint32_t) 0xe0000000) /* 224.0.0.0 */
|
||||
+#define INADDR_ALLHOSTS_GROUP ((uint32_t) 0xe0000001) /* 224.0.0.1 */
|
||||
+#define INADDR_ALLRTRS_GROUP ((uint32_t) 0xe0000002) /* 224.0.0.2 */
|
||||
+#define INADDR_MAX_LOCAL_GROUP ((uint32_t) 0xe00000ff) /* 224.0.0.255 */
|
||||
|
||||
#if !__USE_KERNEL_IPV6_DEFS
|
||||
/* IPv6 address */
|
||||
@@ -213,8 +213,8 @@
|
||||
union
|
||||
{
|
||||
uint8_t __u6_addr8[16];
|
||||
- uint16_t __u6_addr16[8];
|
||||
- uint32_t __u6_addr32[4];
|
||||
+ __be16 __u6_addr16[8];
|
||||
+ __be32 __u6_addr32[4];
|
||||
} __in6_u;
|
||||
#define s6_addr __in6_u.__u6_addr8
|
||||
#ifdef __USE_MISC
|
||||
@@ -253,7 +253,7 @@
|
||||
{
|
||||
__SOCKADDR_COMMON (sin6_);
|
||||
in_port_t sin6_port; /* Transport layer port # */
|
||||
- uint32_t sin6_flowinfo; /* IPv6 flow information */
|
||||
+ __be32 sin6_flowinfo; /* IPv6 flow information */
|
||||
struct in6_addr sin6_addr; /* IPv6 address */
|
||||
uint32_t sin6_scope_id; /* IPv6 scope-id */
|
||||
};
|
||||
@@ -371,12 +371,12 @@
|
||||
this was a short-sighted decision since on different systems the types
|
||||
may have different representations but the values are always the same. */
|
||||
|
||||
-extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
|
||||
-extern uint16_t ntohs (uint16_t __netshort)
|
||||
+extern uint32_t ntohl (__be32 __netlong) __THROW __attribute__ ((__const__));
|
||||
+extern uint16_t ntohs (__be16 __netshort)
|
||||
__THROW __attribute__ ((__const__));
|
||||
-extern uint32_t htonl (uint32_t __hostlong)
|
||||
+extern __be32 htonl (uint32_t __hostlong)
|
||||
__THROW __attribute__ ((__const__));
|
||||
-extern uint16_t htons (uint16_t __hostshort)
|
||||
+extern __be16 htons (uint16_t __hostshort)
|
||||
__THROW __attribute__ ((__const__));
|
||||
|
||||
#include <endian.h>
|
||||
@@ -385,7 +385,7 @@
|
||||
#include <bits/byteswap.h>
|
||||
#include <bits/uintn-identity.h>
|
||||
|
||||
-#ifdef __OPTIMIZE__
|
||||
+#ifdef __disabled_OPTIMIZE__
|
||||
/* We can optimize calls to the conversion functions. Either nothing has
|
||||
to be done or we are using directly the byte-swapping functions which
|
||||
often can be inlined. */
|
|
@ -1,44 +0,0 @@
|
|||
/* COPYRIGHT (c) 2017 Obsidian Research Corporation.
|
||||
Licensed under BSD (MIT variant) or GPLv2. See COPYING. */
|
||||
|
||||
#ifndef _SPARSE_ENDIAN_H_
|
||||
#define _SPARSE_ENDIAN_H_
|
||||
|
||||
#include_next <endian.h>
|
||||
|
||||
#include <util/compiler.h>
|
||||
|
||||
#undef htobe16
|
||||
#undef htole16
|
||||
#undef be16toh
|
||||
#undef le16toh
|
||||
|
||||
#undef htobe32
|
||||
#undef htole32
|
||||
#undef be32toh
|
||||
#undef le32toh
|
||||
|
||||
#undef htobe64
|
||||
#undef htole64
|
||||
#undef be64toh
|
||||
#undef le64toh
|
||||
|
||||
/* These do not actually work, but this trivially ensures that sparse sees all
|
||||
* the types. */
|
||||
|
||||
#define htobe16(x) ((__force __be16)__builtin_bswap16(x))
|
||||
#define htole16(x) ((__force __le16)__builtin_bswap16(x))
|
||||
#define be16toh(x) ((uint16_t)__builtin_bswap16((__force uint16_t)(__be16)(x)))
|
||||
#define le16toh(x) ((uint16_t)__builtin_bswap16((__force uint16_t)(__le16)(x)))
|
||||
|
||||
#define htobe32(x) ((__force __be32)__builtin_bswap32(x))
|
||||
#define htole32(x) ((__force __le32)__builtin_bswap32(x))
|
||||
#define be32toh(x) ((uint32_t)__builtin_bswap32((__force uint32_t)(__be32)(x)))
|
||||
#define le32toh(x) ((uint32_t)__builtin_bswap32((__force uint32_t)(__le32)(x)))
|
||||
|
||||
#define htobe64(x) ((__force __be64)__builtin_bswap64(x))
|
||||
#define htole64(x) ((__force __le64)__builtin_bswap64(x))
|
||||
#define be64toh(x) ((uint64_t)__builtin_bswap64((__force uint64_t)(__be64)(x)))
|
||||
#define le64toh(x) ((uint64_t)__builtin_bswap64((__force uint64_t)(__le64)(x)))
|
||||
|
||||
#endif
|
|
@ -1,13 +0,0 @@
|
|||
/* COPYRIGHT (c) 2017 Obsidian Research Corporation.
|
||||
Licensed under BSD (MIT variant) or GPLv2. See COPYING. */
|
||||
|
||||
#ifndef _SPARSE_PTHREAD_H_
|
||||
#define _SPARSE_PTHREAD_H_
|
||||
|
||||
#include_next <pthread.h>
|
||||
|
||||
/* Sparse complains that the glibc version of this has 0 instead of NULL */
|
||||
#undef PTHREAD_MUTEX_INITIALIZER
|
||||
#define PTHREAD_MUTEX_INITIALIZER {}
|
||||
|
||||
#endif
|
|
@ -1,176 +0,0 @@
|
|||
/* COPYRIGHT (c) 2017 Obsidian Research Corporation.
|
||||
* Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
*
|
||||
* A version of C11 stdatomic.h that doesn't make spare angry. This doesn't
|
||||
* actually work.
|
||||
*/
|
||||
|
||||
#ifndef _SPARSE_STDATOMIC_H_
|
||||
#define _SPARSE_STDATOMIC_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define _Atomic(T) struct {volatile __typeof__(T) __val; }
|
||||
|
||||
#define ATOMIC_VAR_INIT(value) \
|
||||
{ \
|
||||
.__val = (value) \
|
||||
}
|
||||
#define atomic_init(obj, value) \
|
||||
do { \
|
||||
(obj)->__val = (value); \
|
||||
} while (0)
|
||||
|
||||
enum memory_order {
|
||||
memory_order_relaxed,
|
||||
memory_order_consume,
|
||||
memory_order_acquire,
|
||||
memory_order_release,
|
||||
memory_order_acq_rel,
|
||||
memory_order_seq_cst,
|
||||
};
|
||||
|
||||
typedef enum memory_order memory_order;
|
||||
|
||||
#define atomic_thread_fence(order) __asm volatile("" : : : "memory")
|
||||
#define atomic_signal_fence(order) __asm volatile("" : : : "memory")
|
||||
|
||||
#define atomic_is_lock_free(obj) (sizeof((obj)->__val) <= sizeof(void *))
|
||||
|
||||
typedef _Atomic(_Bool) atomic_bool;
|
||||
typedef _Atomic(char) atomic_char;
|
||||
typedef _Atomic(signed char) atomic_schar;
|
||||
typedef _Atomic(unsigned char) atomic_uchar;
|
||||
typedef _Atomic(short) atomic_short;
|
||||
typedef _Atomic(unsigned short) atomic_ushort;
|
||||
typedef _Atomic(int) atomic_int;
|
||||
typedef _Atomic(unsigned int) atomic_uint;
|
||||
typedef _Atomic(long) atomic_long;
|
||||
typedef _Atomic(unsigned long) atomic_ulong;
|
||||
typedef _Atomic(long long) atomic_llong;
|
||||
typedef _Atomic(unsigned long long) atomic_ullong;
|
||||
typedef _Atomic(wchar_t) atomic_wchar_t;
|
||||
typedef _Atomic(int_least8_t) atomic_int_least8_t;
|
||||
typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
|
||||
typedef _Atomic(int_least16_t) atomic_int_least16_t;
|
||||
typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
|
||||
typedef _Atomic(int_least32_t) atomic_int_least32_t;
|
||||
typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
|
||||
typedef _Atomic(int_least64_t) atomic_int_least64_t;
|
||||
typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
|
||||
typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
|
||||
typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
|
||||
typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
|
||||
typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
|
||||
typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
|
||||
typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
|
||||
typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
|
||||
typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
|
||||
typedef _Atomic(intptr_t) atomic_intptr_t;
|
||||
typedef _Atomic(uintptr_t) atomic_uintptr_t;
|
||||
typedef _Atomic(size_t) atomic_size_t;
|
||||
typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
|
||||
typedef _Atomic(intmax_t) atomic_intmax_t;
|
||||
typedef _Atomic(uintmax_t) atomic_uintmax_t;
|
||||
|
||||
#define atomic_compare_exchange_strong_explicit(object, expected, desired, \
|
||||
success, failure) \
|
||||
({ \
|
||||
__typeof__((object)->__val) __v = (object)->__val; \
|
||||
bool __r; \
|
||||
if (__v == *(expected)) { \
|
||||
r = true; \
|
||||
(object)->__val = (desired); \
|
||||
} else { \
|
||||
r = false; \
|
||||
*(expected) = __val; \
|
||||
} \
|
||||
__r; \
|
||||
})
|
||||
|
||||
#define atomic_compare_exchange_weak_explicit(object, expected, desired, \
|
||||
success, failure) \
|
||||
atomic_compare_exchange_strong_explicit(object, expected, desired, \
|
||||
success, failure)
|
||||
|
||||
#define atomic_exchange_explicit(object, desired, order) \
|
||||
({ \
|
||||
__typeof__((object)->__val) __v = (object)->__val; \
|
||||
(object)->__val = (operand); \
|
||||
__v; \
|
||||
})
|
||||
#define atomic_fetch_add_explicit(object, operand, order) \
|
||||
({ \
|
||||
__typeof__((object)->__val) __v = (object)->__val; \
|
||||
(object)->__val += (operand); \
|
||||
__v; \
|
||||
})
|
||||
#define atomic_fetch_and_explicit(object, operand, order) \
|
||||
({ \
|
||||
__typeof__((object)->__val) __v = (object)->__val; \
|
||||
(object)->__val &= (operand); \
|
||||
__v; \
|
||||
})
|
||||
#define atomic_fetch_or_explicit(object, operand, order) \
|
||||
({ \
|
||||
__typeof__((object)->__val) __v = (object)->__val; \
|
||||
(object)->__val |= (operand); \
|
||||
__v; \
|
||||
})
|
||||
#define atomic_fetch_sub_explicit(object, operand, order) \
|
||||
({ \
|
||||
__typeof__((object)->__val) __v = (object)->__val; \
|
||||
(object)->__val -= (operand); \
|
||||
__v; \
|
||||
})
|
||||
#define atomic_fetch_xor_explicit(object, operand, order) \
|
||||
({ \
|
||||
__typeof__((object)->__val) __v = (object)->__val; \
|
||||
(object)->__val ^= (operand); \
|
||||
__v; \
|
||||
})
|
||||
|
||||
#define atomic_load_explicit(object, order) ((object)->__val)
|
||||
#define atomic_store_explicit(object, desired, order) \
|
||||
({ (object)->__val = (desired); })
|
||||
|
||||
#define atomic_compare_exchange_strong(object, expected, desired) \
|
||||
atomic_compare_exchange_strong_explicit(object, expected, desired, \
|
||||
memory_order_seq_cst, \
|
||||
memory_order_seq_cst)
|
||||
#define atomic_compare_exchange_weak(object, expected, desired) \
|
||||
atomic_compare_exchange_weak_explicit(object, expected, desired, \
|
||||
memory_order_seq_cst, \
|
||||
memory_order_seq_cst)
|
||||
#define atomic_exchange(object, desired) \
|
||||
atomic_exchange_explicit(object, desired, memory_order_seq_cst)
|
||||
#define atomic_fetch_add(object, operand) \
|
||||
atomic_fetch_add_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_and(object, operand) \
|
||||
atomic_fetch_and_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_or(object, operand) \
|
||||
atomic_fetch_or_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_sub(object, operand) \
|
||||
atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_fetch_xor(object, operand) \
|
||||
atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst)
|
||||
#define atomic_load(object) atomic_load_explicit(object, memory_order_seq_cst)
|
||||
#define atomic_store(object, desired) \
|
||||
atomic_store_explicit(object, desired, memory_order_seq_cst)
|
||||
|
||||
typedef atomic_bool atomic_flag;
|
||||
|
||||
#define ATOMIC_FLAG_INIT ATOMIC_VAR_INIT(0)
|
||||
|
||||
#define atomic_flag_clear_explicit(object, order) \
|
||||
atomic_store_explicit(object, 0, order)
|
||||
#define atomic_flag_test_and_set_explicit(object, order) \
|
||||
atomic_compare_exchange_strong_explicit(object, 0, 1, order, order)
|
||||
|
||||
#define atomic_flag_clear(object) \
|
||||
atomic_flag_clear_explicit(object, memory_order_seq_cst)
|
||||
#define atomic_flag_test_and_set(object) \
|
||||
atomic_flag_test_and_set_explicit(object, memory_order_seq_cst)
|
||||
|
||||
#endif
|
|
@ -1,61 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Stop on error
|
||||
set -e
|
||||
# Echo all commands to Travis log
|
||||
set -x
|
||||
|
||||
mkdir build-clang build32 build-sparse build-aarch64
|
||||
|
||||
# Build with latest clang first
|
||||
cd build-clang
|
||||
CC=clang-4.0 CFLAGS=-Werror cmake -GNinja ..
|
||||
ninja
|
||||
../buildlib/check-build --src .. --cc clang-4.0
|
||||
|
||||
# 32 bit build to check format strings/etc
|
||||
cd ../build32
|
||||
# travis's trusty is not configured in a way that enables all 32 bit
|
||||
# packages. We could fix this with some sudo stuff.. For now turn off libnl
|
||||
CC=gcc-7 CFLAGS="-Werror -m32" cmake -GNinja .. -DENABLE_RESOLVE_NEIGH=0
|
||||
ninja
|
||||
|
||||
# aarch64 build to check compilation on ARM 64bit platform
|
||||
cd ../build-aarch64
|
||||
CC=$HOME/aarch64/bin/aarch64-linux-gnu-gcc CFLAGS="-Werror -Wno-maybe-uninitialized" cmake -GNinja .. -DENABLE_RESOLVE_NEIGH=0
|
||||
ninja
|
||||
|
||||
# Run sparse on the subdirectories which are sparse clean
|
||||
cd ../build-sparse
|
||||
mv ../CMakeLists.txt ../CMakeLists-orig.txt
|
||||
grep -v "# NO SPARSE" ../CMakeLists-orig.txt > ../CMakeLists.txt
|
||||
CC=cgcc CFLAGS="-Werror" cmake -GNinja ..
|
||||
ninja > out
|
||||
# sparse does not fail gcc on messages
|
||||
if grep -v '^\[' out; then
|
||||
false
|
||||
fi
|
||||
mv ../CMakeLists-orig.txt ../CMakeLists.txt
|
||||
|
||||
# Test with coherent DMA mode disabled (ie as would be on ARM32, etc)
|
||||
cd ../build-clang
|
||||
cp ../util/udma_barrier.h ../util/udma_barrier.h.old
|
||||
echo "#error Fail" >> ../util/udma_barrier.h
|
||||
rm CMakeCache.txt
|
||||
CC=clang-4.0 CFLAGS=-Werror cmake -GNinja ..
|
||||
ninja
|
||||
cp ../util/udma_barrier.h.old ../util/udma_barrier.h
|
||||
|
||||
# Finally run through gcc-7 64 bit through the debian packaging This gives a
|
||||
# good clue if patches are changing packaging related things, the RPM stuff
|
||||
# will have to be audited by hand.
|
||||
|
||||
# When running cmake through debian/rules it is hard to set -Werror,
|
||||
# instead force it on by changing the CMakeLists.txt
|
||||
cd ..
|
||||
echo 'set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")' >> buildlib/RDMA_EnableCStd.cmake
|
||||
sed -i -e 's/-DCMAKE_BUILD_TYPE=Release//g' debian/rules
|
||||
sed -i -e 's/ninja \(.*\)-v/ninja \1/g' debian/rules
|
||||
|
||||
CC=gcc-7 debian/rules build
|
||||
fakeroot debian/rules binary
|
|
@ -1,30 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2017 Mellanox Technologies Ltd.
|
||||
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
|
||||
|
||||
|
||||
if [ "x$TRAVIS_EVENT_TYPE" != "xpull_request" ]; then
|
||||
# Peform checkpatch checks on pull requests only
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# The below "set" is commented, because the checkpatch.pl returns 1 (error) for warnings too.
|
||||
# And the rdma-core code is not mature enough to be warning safe
|
||||
# set -e
|
||||
|
||||
if [ "x$TRAVIS_COMMIT_RANGE" != "x" ]; then
|
||||
cd buildlib/
|
||||
wget -q https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl \
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/spelling.txt
|
||||
DIR_FOR_PATCHES_TO_CHECK=$(mktemp -d)
|
||||
git format-patch --no-cover-letter $TRAVIS_COMMIT_RANGE ^$TRAVIS_BRANCH -o $DIR_FOR_PATCHES_TO_CHECK/
|
||||
CHECKPATCH_OPT="--no-tree --ignore PREFER_KERNEL_TYPES,FILE_PATH_CHANGES,EXECUTE_PERMISSIONS,USE_NEGATIVE_ERRNO,CONST_STRUCT $DIR_FOR_PATCHES_TO_CHECK/*"
|
||||
perl checkpatch.pl $CHECKPATCH_OPT
|
||||
if [ $? -ne 0 ]; then
|
||||
# We rerun checkpatch to simplify parsing and to understand if we failed for errors
|
||||
# For example, the output on some arbitrary patchset of the following line without awk is:
|
||||
# total: 1 errors, 3 warnings, 42 lines checked
|
||||
NUMB_ERRRORS=$(perl checkpatch.pl --terse $CHECKPATCH_OPT | awk 'BEGIN {FS = "total:"} ; {sum+=$2} END {print sum}')
|
||||
exit $NUMB_ERRRORS
|
||||
fi
|
||||
fi
|
|
@ -1,17 +0,0 @@
|
|||
publish_internal_headers(ccan
|
||||
build_assert.h
|
||||
check_type.h
|
||||
container_of.h
|
||||
list.h
|
||||
minmax.h
|
||||
str.h
|
||||
str_debug.h
|
||||
)
|
||||
|
||||
set(C_FILES
|
||||
list.c
|
||||
str.c
|
||||
)
|
||||
add_library(ccan STATIC ${C_FILES})
|
||||
add_library(ccan_pic STATIC ${C_FILES})
|
||||
set_property(TARGET ccan_pic PROPERTY POSITION_INDEPENDENT_CODE TRUE)
|
|
@ -1,97 +0,0 @@
|
|||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator and
|
||||
subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for the
|
||||
purpose of contributing to a commons of creative, cultural and scientific works
|
||||
("Commons") that the public can reliably and without fear of later claims of
|
||||
infringement build upon, modify, incorporate in other works, reuse and
|
||||
redistribute as freely as possible in any form whatsoever and for any purposes,
|
||||
including without limitation commercial purposes. These owners may contribute
|
||||
to the Commons to promote the ideal of a free culture and the further
|
||||
production of creative, cultural and scientific works, or to gain reputation or
|
||||
greater distribution for their Work in part through the use and efforts of
|
||||
others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any expectation of
|
||||
additional consideration or compensation, the person associating CC0 with a
|
||||
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
|
||||
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
|
||||
publicly distribute the Work under its terms, with knowledge of his or her
|
||||
Copyright and Related Rights in the Work and the meaning and intended legal
|
||||
effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not limited to,
|
||||
the following:
|
||||
|
||||
the right to reproduce, adapt, distribute, perform, display, communicate,
|
||||
and translate a Work; moral rights retained by the original author(s) and/or
|
||||
performer(s); publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work; rights protecting against unfair competition in
|
||||
regards to a Work, subject to the limitations in paragraph 4(a), below; rights
|
||||
protecting the extraction, dissemination, use and reuse of data in a Work;
|
||||
database rights (such as those arising under Directive 96/9/EC of the European
|
||||
Parliament and of the Council of 11 March 1996 on the legal protection of
|
||||
databases, and under any national implementation thereof, including any amended
|
||||
or successor version of such directive); and other similar, equivalent or
|
||||
corresponding rights throughout the world based on applicable law or treaty,
|
||||
and any national implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention of,
|
||||
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
|
||||
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
|
||||
and Related Rights and associated claims and causes of action, whether now
|
||||
known or unknown (including existing as well as future claims and causes of
|
||||
action), in the Work (i) in all territories worldwide, (ii) for the maximum
|
||||
duration provided by applicable law or treaty (including future time
|
||||
extensions), (iii) in any current or future medium and for any number of
|
||||
copies, and (iv) for any purpose whatsoever, including without limitation
|
||||
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
|
||||
the Waiver for the benefit of each member of the public at large and to the
|
||||
detriment of Affirmer's heirs and successors, fully intending that such Waiver
|
||||
shall not be subject to revocation, rescission, cancellation, termination, or
|
||||
any other legal or equitable action to disrupt the quiet enjoyment of the Work
|
||||
by the public as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason be
|
||||
judged legally invalid or ineffective under applicable law, then the Waiver
|
||||
shall be preserved to the maximum extent permitted taking into account
|
||||
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
|
||||
is so judged Affirmer hereby grants to each affected person a royalty-free, non
|
||||
transferable, non sublicensable, non exclusive, irrevocable and unconditional
|
||||
license to exercise Affirmer's Copyright and Related Rights in the Work (i) in
|
||||
all territories worldwide, (ii) for the maximum duration provided by applicable
|
||||
law or treaty (including future time extensions), (iii) in any current or
|
||||
future medium and for any number of copies, and (iv) for any purpose
|
||||
whatsoever, including without limitation commercial, advertising or promotional
|
||||
purposes (the "License"). The License shall be deemed effective as of the date
|
||||
CC0 was applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder of the
|
||||
License, and in such case Affirmer hereby affirms that he or she will not (i)
|
||||
exercise any of his or her remaining Copyright and Related Rights in the Work
|
||||
or (ii) assert any associated claims and causes of action with respect to the
|
||||
Work, in either case contrary to Affirmer's express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document. Affirmer offers
|
||||
the Work as-is and makes no representations or warranties of any kind
|
||||
concerning the Work, express, implied, statutory or otherwise, including
|
||||
without limitation warranties of title, merchantability, fitness for a
|
||||
particular purpose, non infringement, or the absence of latent or other
|
||||
defects, accuracy, or the present or absence of errors, whether or not
|
||||
discoverable, all to the greatest extent permissible under applicable law.
|
||||
Affirmer disclaims responsibility for clearing rights of other persons that may
|
||||
apply to the Work or any use thereof, including without limitation any person's
|
||||
Copyright and Related Rights in the Work. Further, Affirmer disclaims
|
||||
responsibility for obtaining any necessary consents, permissions or other
|
||||
rights required for any use of the Work. Affirmer understands and acknowledges
|
||||
that Creative Commons is not a party to this document and has no duty or
|
||||
obligation with respect to this CC0 or use of the Work.
|
|
@ -1,17 +0,0 @@
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -1,40 +0,0 @@
|
|||
/* CC0 (Public domain) - see LICENSE.CC0 file for details */
|
||||
#ifndef CCAN_BUILD_ASSERT_H
|
||||
#define CCAN_BUILD_ASSERT_H
|
||||
|
||||
/**
|
||||
* BUILD_ASSERT - assert a build-time dependency.
|
||||
* @cond: the compile-time condition which must be true.
|
||||
*
|
||||
* Your compile will fail if the condition isn't true, or can't be evaluated
|
||||
* by the compiler. This can only be used within a function.
|
||||
*
|
||||
* Example:
|
||||
* #include <stddef.h>
|
||||
* ...
|
||||
* static char *foo_to_char(struct foo *foo)
|
||||
* {
|
||||
* // This code needs string to be at start of foo.
|
||||
* BUILD_ASSERT(offsetof(struct foo, string) == 0);
|
||||
* return (char *)foo;
|
||||
* }
|
||||
*/
|
||||
#define BUILD_ASSERT(cond) \
|
||||
do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
|
||||
|
||||
/**
|
||||
* BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
|
||||
* @cond: the compile-time condition which must be true.
|
||||
*
|
||||
* Your compile will fail if the condition isn't true, or can't be evaluated
|
||||
* by the compiler. This can be used in an expression: its value is "0".
|
||||
*
|
||||
* Example:
|
||||
* #define foo_to_char(foo) \
|
||||
* ((char *)(foo) \
|
||||
* + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
|
||||
*/
|
||||
#define BUILD_ASSERT_OR_ZERO(cond) \
|
||||
(sizeof(char [1 - 2*!(cond)]) - 1)
|
||||
|
||||
#endif /* CCAN_BUILD_ASSERT_H */
|
|
@ -1,64 +0,0 @@
|
|||
/* CC0 (Public domain) - see LICENSE.CC0 file for details */
|
||||
#ifndef CCAN_CHECK_TYPE_H
|
||||
#define CCAN_CHECK_TYPE_H
|
||||
#include "config.h"
|
||||
|
||||
/**
|
||||
* check_type - issue a warning or build failure if type is not correct.
|
||||
* @expr: the expression whose type we should check (not evaluated).
|
||||
* @type: the exact type we expect the expression to be.
|
||||
*
|
||||
* This macro is usually used within other macros to try to ensure that a macro
|
||||
* argument is of the expected type. No type promotion of the expression is
|
||||
* done: an unsigned int is not the same as an int!
|
||||
*
|
||||
* check_type() always evaluates to 0.
|
||||
*
|
||||
* If your compiler does not support typeof, then the best we can do is fail
|
||||
* to compile if the sizes of the types are unequal (a less complete check).
|
||||
*
|
||||
* Example:
|
||||
* // They should always pass a 64-bit value to _set_some_value!
|
||||
* #define set_some_value(expr) \
|
||||
* _set_some_value((check_type((expr), uint64_t), (expr)))
|
||||
*/
|
||||
|
||||
/**
|
||||
* check_types_match - issue a warning or build failure if types are not same.
|
||||
* @expr1: the first expression (not evaluated).
|
||||
* @expr2: the second expression (not evaluated).
|
||||
*
|
||||
* This macro is usually used within other macros to try to ensure that
|
||||
* arguments are of identical types. No type promotion of the expressions is
|
||||
* done: an unsigned int is not the same as an int!
|
||||
*
|
||||
* check_types_match() always evaluates to 0.
|
||||
*
|
||||
* If your compiler does not support typeof, then the best we can do is fail
|
||||
* to compile if the sizes of the types are unequal (a less complete check).
|
||||
*
|
||||
* Example:
|
||||
* // Do subtraction to get to enclosing type, but make sure that
|
||||
* // pointer is of correct type for that member.
|
||||
* #define container_of(mbr_ptr, encl_type, mbr) \
|
||||
* (check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
|
||||
* ((encl_type *) \
|
||||
* ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
|
||||
*/
|
||||
#if HAVE_TYPEOF
|
||||
#define check_type(expr, type) \
|
||||
((typeof(expr) *)0 != (type *)0)
|
||||
|
||||
#define check_types_match(expr1, expr2) \
|
||||
((typeof(expr1) *)0 != (typeof(expr2) *)0)
|
||||
#else
|
||||
#include <ccan/build_assert.h>
|
||||
/* Without typeof, we can only test the sizes. */
|
||||
#define check_type(expr, type) \
|
||||
BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
|
||||
|
||||
#define check_types_match(expr1, expr2) \
|
||||
BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
|
||||
#endif /* HAVE_TYPEOF */
|
||||
|
||||
#endif /* CCAN_CHECK_TYPE_H */
|
|
@ -1,146 +0,0 @@
|
|||
/* CC0 (Public domain) - see LICENSE.CC0 file for details */
|
||||
#ifndef CCAN_CONTAINER_OF_H
|
||||
#define CCAN_CONTAINER_OF_H
|
||||
#include <stddef.h>
|
||||
|
||||
#include "config.h"
|
||||
#include <ccan/check_type.h>
|
||||
|
||||
/**
|
||||
* container_of - get pointer to enclosing structure
|
||||
* @member_ptr: pointer to the structure member
|
||||
* @containing_type: the type this member is within
|
||||
* @member: the name of this member within the structure.
|
||||
*
|
||||
* Given a pointer to a member of a structure, this macro does pointer
|
||||
* subtraction to return the pointer to the enclosing type.
|
||||
*
|
||||
* Example:
|
||||
* struct foo {
|
||||
* int fielda, fieldb;
|
||||
* // ...
|
||||
* };
|
||||
* struct info {
|
||||
* int some_other_field;
|
||||
* struct foo my_foo;
|
||||
* };
|
||||
*
|
||||
* static struct info *foo_to_info(struct foo *foo)
|
||||
* {
|
||||
* return container_of(foo, struct info, my_foo);
|
||||
* }
|
||||
*/
|
||||
#ifndef container_of
|
||||
#define container_of(member_ptr, containing_type, member) \
|
||||
((containing_type *) \
|
||||
((char *)(member_ptr) \
|
||||
- container_off(containing_type, member)) \
|
||||
+ check_types_match(*(member_ptr), ((containing_type *)0)->member))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* container_of_or_null - get pointer to enclosing structure, or NULL
|
||||
* @member_ptr: pointer to the structure member
|
||||
* @containing_type: the type this member is within
|
||||
* @member: the name of this member within the structure.
|
||||
*
|
||||
* Given a pointer to a member of a structure, this macro does pointer
|
||||
* subtraction to return the pointer to the enclosing type, unless it
|
||||
* is given NULL, in which case it also returns NULL.
|
||||
*
|
||||
* Example:
|
||||
* struct foo {
|
||||
* int fielda, fieldb;
|
||||
* // ...
|
||||
* };
|
||||
* struct info {
|
||||
* int some_other_field;
|
||||
* struct foo my_foo;
|
||||
* };
|
||||
*
|
||||
* static struct info *foo_to_info_allowing_null(struct foo *foo)
|
||||
* {
|
||||
* return container_of_or_null(foo, struct info, my_foo);
|
||||
* }
|
||||
*/
|
||||
static inline char *container_of_or_null_(void *member_ptr, size_t offset)
|
||||
{
|
||||
return member_ptr ? (char *)member_ptr - offset : NULL;
|
||||
}
|
||||
#define container_of_or_null(member_ptr, containing_type, member) \
|
||||
((containing_type *) \
|
||||
container_of_or_null_(member_ptr, \
|
||||
container_off(containing_type, member)) \
|
||||
+ check_types_match(*(member_ptr), ((containing_type *)0)->member))
|
||||
|
||||
/**
|
||||
* container_off - get offset to enclosing structure
|
||||
* @containing_type: the type this member is within
|
||||
* @member: the name of this member within the structure.
|
||||
*
|
||||
* Given a pointer to a member of a structure, this macro does
|
||||
* typechecking and figures out the offset to the enclosing type.
|
||||
*
|
||||
* Example:
|
||||
* struct foo {
|
||||
* int fielda, fieldb;
|
||||
* // ...
|
||||
* };
|
||||
* struct info {
|
||||
* int some_other_field;
|
||||
* struct foo my_foo;
|
||||
* };
|
||||
*
|
||||
* static struct info *foo_to_info(struct foo *foo)
|
||||
* {
|
||||
* size_t off = container_off(struct info, my_foo);
|
||||
* return (void *)((char *)foo - off);
|
||||
* }
|
||||
*/
|
||||
#define container_off(containing_type, member) \
|
||||
offsetof(containing_type, member)
|
||||
|
||||
/**
|
||||
* container_of_var - get pointer to enclosing structure using a variable
|
||||
* @member_ptr: pointer to the structure member
|
||||
* @container_var: a pointer of same type as this member's container
|
||||
* @member: the name of this member within the structure.
|
||||
*
|
||||
* Given a pointer to a member of a structure, this macro does pointer
|
||||
* subtraction to return the pointer to the enclosing type.
|
||||
*
|
||||
* Example:
|
||||
* static struct info *foo_to_i(struct foo *foo)
|
||||
* {
|
||||
* struct info *i = container_of_var(foo, i, my_foo);
|
||||
* return i;
|
||||
* }
|
||||
*/
|
||||
#if HAVE_TYPEOF
|
||||
#define container_of_var(member_ptr, container_var, member) \
|
||||
container_of(member_ptr, typeof(*container_var), member)
|
||||
#else
|
||||
#define container_of_var(member_ptr, container_var, member) \
|
||||
((void *)((char *)(member_ptr) - \
|
||||
container_off_var(container_var, member)))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* container_off_var - get offset of a field in enclosing structure
|
||||
* @container_var: a pointer to a container structure
|
||||
* @member: the name of a member within the structure.
|
||||
*
|
||||
* Given (any) pointer to a structure and a its member name, this
|
||||
* macro does pointer subtraction to return offset of member in a
|
||||
* structure memory layout.
|
||||
*
|
||||
*/
|
||||
#if HAVE_TYPEOF
|
||||
#define container_off_var(var, member) \
|
||||
container_off(typeof(*var), member)
|
||||
#else
|
||||
#define container_off_var(var, member) \
|
||||
((const char *)&(var)->member - (const char *)(var))
|
||||
#endif
|
||||
|
||||
#endif /* CCAN_CONTAINER_OF_H */
|
|
@ -1,43 +0,0 @@
|
|||
/* Licensed under MIT - see LICENSE.MIT file for details */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "list.h"
|
||||
|
||||
static void *corrupt(const char *abortstr,
|
||||
const struct list_node *head,
|
||||
const struct list_node *node,
|
||||
unsigned int count)
|
||||
{
|
||||
if (abortstr) {
|
||||
fprintf(stderr,
|
||||
"%s: prev corrupt in node %p (%u) of %p\n",
|
||||
abortstr, node, count, head);
|
||||
abort();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct list_node *list_check_node(const struct list_node *node,
|
||||
const char *abortstr)
|
||||
{
|
||||
const struct list_node *p, *n;
|
||||
int count = 0;
|
||||
|
||||
for (p = node, n = node->next; n != node; p = n, n = n->next) {
|
||||
count++;
|
||||
if (n->prev != p)
|
||||
return corrupt(abortstr, node, n, count);
|
||||
}
|
||||
/* Check prev on head node. */
|
||||
if (node->prev != p)
|
||||
return corrupt(abortstr, node, node, 0);
|
||||
|
||||
return (struct list_node *)node;
|
||||
}
|
||||
|
||||
struct list_head *list_check(const struct list_head *h, const char *abortstr)
|
||||
{
|
||||
if (!list_check_node(&h->n, abortstr))
|
||||
return NULL;
|
||||
return (struct list_head *)h;
|
||||
}
|
|
@ -1,842 +0,0 @@
|
|||
/* Licensed under MIT - see LICENSE.MIT file for details */
|
||||
#ifndef CCAN_LIST_H
|
||||
#define CCAN_LIST_H
|
||||
//#define CCAN_LIST_DEBUG 1
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <ccan/str.h>
|
||||
#include <ccan/container_of.h>
|
||||
#include <ccan/check_type.h>
|
||||
|
||||
/**
|
||||
* struct list_node - an entry in a doubly-linked list
|
||||
* @next: next entry (self if empty)
|
||||
* @prev: previous entry (self if empty)
|
||||
*
|
||||
* This is used as an entry in a linked list.
|
||||
* Example:
|
||||
* struct child {
|
||||
* const char *name;
|
||||
* // Linked list of all us children.
|
||||
* struct list_node list;
|
||||
* };
|
||||
*/
|
||||
struct list_node
|
||||
{
|
||||
struct list_node *next, *prev;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct list_head - the head of a doubly-linked list
|
||||
* @h: the list_head (containing next and prev pointers)
|
||||
*
|
||||
* This is used as the head of a linked list.
|
||||
* Example:
|
||||
* struct parent {
|
||||
* const char *name;
|
||||
* struct list_head children;
|
||||
* unsigned int num_children;
|
||||
* };
|
||||
*/
|
||||
struct list_head
|
||||
{
|
||||
struct list_node n;
|
||||
};
|
||||
|
||||
/**
|
||||
* list_check - check head of a list for consistency
|
||||
* @h: the list_head
|
||||
* @abortstr: the location to print on aborting, or NULL.
|
||||
*
|
||||
* Because list_nodes have redundant information, consistency checking between
|
||||
* the back and forward links can be done. This is useful as a debugging check.
|
||||
* If @abortstr is non-NULL, that will be printed in a diagnostic if the list
|
||||
* is inconsistent, and the function will abort.
|
||||
*
|
||||
* Returns the list head if the list is consistent, NULL if not (it
|
||||
* can never return NULL if @abortstr is set).
|
||||
*
|
||||
* See also: list_check_node()
|
||||
*
|
||||
* Example:
|
||||
* static void dump_parent(struct parent *p)
|
||||
* {
|
||||
* struct child *c;
|
||||
*
|
||||
* printf("%s (%u children):\n", p->name, p->num_children);
|
||||
* list_check(&p->children, "bad child list");
|
||||
* list_for_each(&p->children, c, list)
|
||||
* printf(" -> %s\n", c->name);
|
||||
* }
|
||||
*/
|
||||
struct list_head *list_check(const struct list_head *h, const char *abortstr);
|
||||
|
||||
/**
|
||||
* list_check_node - check node of a list for consistency
|
||||
* @n: the list_node
|
||||
* @abortstr: the location to print on aborting, or NULL.
|
||||
*
|
||||
* Check consistency of the list node is in (it must be in one).
|
||||
*
|
||||
* See also: list_check()
|
||||
*
|
||||
* Example:
|
||||
* static void dump_child(const struct child *c)
|
||||
* {
|
||||
* list_check_node(&c->list, "bad child list");
|
||||
* printf("%s\n", c->name);
|
||||
* }
|
||||
*/
|
||||
struct list_node *list_check_node(const struct list_node *n,
|
||||
const char *abortstr);
|
||||
|
||||
#define LIST_LOC __FILE__ ":" stringify(__LINE__)
|
||||
#ifdef CCAN_LIST_DEBUG
|
||||
#define list_debug(h, loc) list_check((h), loc)
|
||||
#define list_debug_node(n, loc) list_check_node((n), loc)
|
||||
#else
|
||||
#define list_debug(h, loc) ((void)loc, h)
|
||||
#define list_debug_node(n, loc) ((void)loc, n)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIST_HEAD_INIT - initializer for an empty list_head
|
||||
* @name: the name of the list.
|
||||
*
|
||||
* Explicit initializer for an empty list.
|
||||
*
|
||||
* See also:
|
||||
* LIST_HEAD, list_head_init()
|
||||
*
|
||||
* Example:
|
||||
* static struct list_head my_list = LIST_HEAD_INIT(my_list);
|
||||
*/
|
||||
#define LIST_HEAD_INIT(name) { { &(name).n, &(name).n } }
|
||||
|
||||
/**
|
||||
* LIST_HEAD - define and initialize an empty list_head
|
||||
* @name: the name of the list.
|
||||
*
|
||||
* The LIST_HEAD macro defines a list_head and initializes it to an empty
|
||||
* list. It can be prepended by "static" to define a static list_head.
|
||||
*
|
||||
* See also:
|
||||
* LIST_HEAD_INIT, list_head_init()
|
||||
*
|
||||
* Example:
|
||||
* static LIST_HEAD(my_global_list);
|
||||
*/
|
||||
#define LIST_HEAD(name) \
|
||||
struct list_head name = LIST_HEAD_INIT(name)
|
||||
|
||||
/**
|
||||
* list_head_init - initialize a list_head
|
||||
* @h: the list_head to set to the empty list
|
||||
*
|
||||
* Example:
|
||||
* ...
|
||||
* struct parent *parent = malloc(sizeof(*parent));
|
||||
*
|
||||
* list_head_init(&parent->children);
|
||||
* parent->num_children = 0;
|
||||
*/
|
||||
static inline void list_head_init(struct list_head *h)
|
||||
{
|
||||
h->n.next = h->n.prev = &h->n;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_node_init - initialize a list_node
|
||||
* @n: the list_node to link to itself.
|
||||
*
|
||||
* You don't need to use this normally! But it lets you list_del(@n)
|
||||
* safely.
|
||||
*/
|
||||
static inline void list_node_init(struct list_node *n)
|
||||
{
|
||||
n->next = n->prev = n;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_add_after - add an entry after an existing node in a linked list
|
||||
* @h: the list_head to add the node to (for debugging)
|
||||
* @p: the existing list_node to add the node after
|
||||
* @n: the new list_node to add to the list.
|
||||
*
|
||||
* The existing list_node must already be a member of the list.
|
||||
* The new list_node does not need to be initialized; it will be overwritten.
|
||||
*
|
||||
* Example:
|
||||
* struct child c1, c2, c3;
|
||||
* LIST_HEAD(h);
|
||||
*
|
||||
* list_add_tail(&h, &c1.list);
|
||||
* list_add_tail(&h, &c3.list);
|
||||
* list_add_after(&h, &c1.list, &c2.list);
|
||||
*/
|
||||
#define list_add_after(h, p, n) list_add_after_(h, p, n, LIST_LOC)
|
||||
static inline void list_add_after_(struct list_head *h,
|
||||
struct list_node *p,
|
||||
struct list_node *n,
|
||||
const char *abortstr)
|
||||
{
|
||||
n->next = p->next;
|
||||
n->prev = p;
|
||||
p->next->prev = n;
|
||||
p->next = n;
|
||||
(void)list_debug(h, abortstr);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_add - add an entry at the start of a linked list.
|
||||
* @h: the list_head to add the node to
|
||||
* @n: the list_node to add to the list.
|
||||
*
|
||||
* The list_node does not need to be initialized; it will be overwritten.
|
||||
* Example:
|
||||
* struct child *child = malloc(sizeof(*child));
|
||||
*
|
||||
* child->name = "marvin";
|
||||
* list_add(&parent->children, &child->list);
|
||||
* parent->num_children++;
|
||||
*/
|
||||
#define list_add(h, n) list_add_(h, n, LIST_LOC)
|
||||
static inline void list_add_(struct list_head *h,
|
||||
struct list_node *n,
|
||||
const char *abortstr)
|
||||
{
|
||||
list_add_after_(h, &h->n, n, abortstr);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_add_before - add an entry before an existing node in a linked list
|
||||
* @h: the list_head to add the node to (for debugging)
|
||||
* @p: the existing list_node to add the node before
|
||||
* @n: the new list_node to add to the list.
|
||||
*
|
||||
* The existing list_node must already be a member of the list.
|
||||
* The new list_node does not need to be initialized; it will be overwritten.
|
||||
*
|
||||
* Example:
|
||||
* list_head_init(&h);
|
||||
* list_add_tail(&h, &c1.list);
|
||||
* list_add_tail(&h, &c3.list);
|
||||
* list_add_before(&h, &c3.list, &c2.list);
|
||||
*/
|
||||
#define list_add_before(h, p, n) list_add_before_(h, p, n, LIST_LOC)
|
||||
static inline void list_add_before_(struct list_head *h,
|
||||
struct list_node *p,
|
||||
struct list_node *n,
|
||||
const char *abortstr)
|
||||
{
|
||||
n->next = p;
|
||||
n->prev = p->prev;
|
||||
p->prev->next = n;
|
||||
p->prev = n;
|
||||
(void)list_debug(h, abortstr);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_add_tail - add an entry at the end of a linked list.
|
||||
* @h: the list_head to add the node to
|
||||
* @n: the list_node to add to the list.
|
||||
*
|
||||
* The list_node does not need to be initialized; it will be overwritten.
|
||||
* Example:
|
||||
* list_add_tail(&parent->children, &child->list);
|
||||
* parent->num_children++;
|
||||
*/
|
||||
#define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)
|
||||
static inline void list_add_tail_(struct list_head *h,
|
||||
struct list_node *n,
|
||||
const char *abortstr)
|
||||
{
|
||||
list_add_before_(h, &h->n, n, abortstr);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_empty - is a list empty?
|
||||
* @h: the list_head
|
||||
*
|
||||
* If the list is empty, returns true.
|
||||
*
|
||||
* Example:
|
||||
* assert(list_empty(&parent->children) == (parent->num_children == 0));
|
||||
*/
|
||||
#define list_empty(h) list_empty_(h, LIST_LOC)
|
||||
static inline bool list_empty_(const struct list_head *h, const char* abortstr)
|
||||
{
|
||||
(void)list_debug(h, abortstr);
|
||||
return h->n.next == &h->n;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_empty_nodebug - is a list empty (and don't perform debug checks)?
|
||||
* @h: the list_head
|
||||
*
|
||||
* If the list is empty, returns true.
|
||||
* This differs from list_empty() in that if CCAN_LIST_DEBUG is set it
|
||||
* will NOT perform debug checks. Only use this function if you REALLY
|
||||
* know what you're doing.
|
||||
*
|
||||
* Example:
|
||||
* assert(list_empty_nodebug(&parent->children) == (parent->num_children == 0));
|
||||
*/
|
||||
#ifndef CCAN_LIST_DEBUG
|
||||
#define list_empty_nodebug(h) list_empty(h)
|
||||
#else
|
||||
static inline bool list_empty_nodebug(const struct list_head *h)
|
||||
{
|
||||
return h->n.next == &h->n;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* list_empty_nocheck - is a list empty?
|
||||
* @h: the list_head
|
||||
*
|
||||
* If the list is empty, returns true. This doesn't perform any
|
||||
* debug check for list consistency, so it can be called without
|
||||
* locks, racing with the list being modified. This is ok for
|
||||
* checks where an incorrect result is not an issue (optimized
|
||||
* bail out path for example).
|
||||
*/
|
||||
static inline bool list_empty_nocheck(const struct list_head *h)
|
||||
{
|
||||
return h->n.next == &h->n;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_del - delete an entry from an (unknown) linked list.
|
||||
* @n: the list_node to delete from the list.
|
||||
*
|
||||
* Note that this leaves @n in an undefined state; it can be added to
|
||||
* another list, but not deleted again.
|
||||
*
|
||||
* See also:
|
||||
* list_del_from(), list_del_init()
|
||||
*
|
||||
* Example:
|
||||
* list_del(&child->list);
|
||||
* parent->num_children--;
|
||||
*/
|
||||
#define list_del(n) list_del_(n, LIST_LOC)
|
||||
static inline void list_del_(struct list_node *n, const char* abortstr)
|
||||
{
|
||||
(void)list_debug_node(n, abortstr);
|
||||
n->next->prev = n->prev;
|
||||
n->prev->next = n->next;
|
||||
#ifdef CCAN_LIST_DEBUG
|
||||
/* Catch use-after-del. */
|
||||
n->next = n->prev = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* list_del_init - delete a node, and reset it so it can be deleted again.
|
||||
* @n: the list_node to be deleted.
|
||||
*
|
||||
* list_del(@n) or list_del_init() again after this will be safe,
|
||||
* which can be useful in some cases.
|
||||
*
|
||||
* See also:
|
||||
* list_del_from(), list_del()
|
||||
*
|
||||
* Example:
|
||||
* list_del_init(&child->list);
|
||||
* parent->num_children--;
|
||||
*/
|
||||
#define list_del_init(n) list_del_init_(n, LIST_LOC)
|
||||
static inline void list_del_init_(struct list_node *n, const char *abortstr)
|
||||
{
|
||||
list_del_(n, abortstr);
|
||||
list_node_init(n);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_del_from - delete an entry from a known linked list.
|
||||
* @h: the list_head the node is in.
|
||||
* @n: the list_node to delete from the list.
|
||||
*
|
||||
* This explicitly indicates which list a node is expected to be in,
|
||||
* which is better documentation and can catch more bugs.
|
||||
*
|
||||
* See also: list_del()
|
||||
*
|
||||
* Example:
|
||||
* list_del_from(&parent->children, &child->list);
|
||||
* parent->num_children--;
|
||||
*/
|
||||
static inline void list_del_from(struct list_head *h, struct list_node *n)
|
||||
{
|
||||
#ifdef CCAN_LIST_DEBUG
|
||||
{
|
||||
/* Thorough check: make sure it was in list! */
|
||||
struct list_node *i;
|
||||
for (i = h->n.next; i != n; i = i->next)
|
||||
assert(i != &h->n);
|
||||
}
|
||||
#endif /* CCAN_LIST_DEBUG */
|
||||
|
||||
/* Quick test that catches a surprising number of bugs. */
|
||||
assert(!list_empty(h));
|
||||
list_del(n);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_swap - swap out an entry from an (unknown) linked list for a new one.
|
||||
* @o: the list_node to replace from the list.
|
||||
* @n: the list_node to insert in place of the old one.
|
||||
*
|
||||
* Note that this leaves @o in an undefined state; it can be added to
|
||||
* another list, but not deleted/swapped again.
|
||||
*
|
||||
* See also:
|
||||
* list_del()
|
||||
*
|
||||
* Example:
|
||||
* struct child x1, x2;
|
||||
* LIST_HEAD(xh);
|
||||
*
|
||||
* list_add(&xh, &x1.list);
|
||||
* list_swap(&x1.list, &x2.list);
|
||||
*/
|
||||
#define list_swap(o, n) list_swap_(o, n, LIST_LOC)
|
||||
static inline void list_swap_(struct list_node *o,
|
||||
struct list_node *n,
|
||||
const char* abortstr)
|
||||
{
|
||||
(void)list_debug_node(o, abortstr);
|
||||
*n = *o;
|
||||
n->next->prev = n;
|
||||
n->prev->next = n;
|
||||
#ifdef CCAN_LIST_DEBUG
|
||||
/* Catch use-after-del. */
|
||||
o->next = o->prev = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* list_entry - convert a list_node back into the structure containing it.
|
||||
* @n: the list_node
|
||||
* @type: the type of the entry
|
||||
* @member: the list_node member of the type
|
||||
*
|
||||
* Example:
|
||||
* // First list entry is children.next; convert back to child.
|
||||
* child = list_entry(parent->children.n.next, struct child, list);
|
||||
*
|
||||
* See Also:
|
||||
* list_top(), list_for_each()
|
||||
*/
|
||||
#define list_entry(n, type, member) container_of(n, type, member)
|
||||
|
||||
/**
|
||||
* list_top - get the first entry in a list
|
||||
* @h: the list_head
|
||||
* @type: the type of the entry
|
||||
* @member: the list_node member of the type
|
||||
*
|
||||
* If the list is empty, returns NULL.
|
||||
*
|
||||
* Example:
|
||||
* struct child *first;
|
||||
* first = list_top(&parent->children, struct child, list);
|
||||
* if (!first)
|
||||
* printf("Empty list!\n");
|
||||
*/
|
||||
#define list_top(h, type, member) \
|
||||
((type *)list_top_((h), list_off_(type, member)))
|
||||
|
||||
static inline const void *list_top_(const struct list_head *h, size_t off)
|
||||
{
|
||||
if (list_empty(h))
|
||||
return NULL;
|
||||
return (const char *)h->n.next - off;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_pop - remove the first entry in a list
|
||||
* @h: the list_head
|
||||
* @type: the type of the entry
|
||||
* @member: the list_node member of the type
|
||||
*
|
||||
* If the list is empty, returns NULL.
|
||||
*
|
||||
* Example:
|
||||
* struct child *one;
|
||||
* one = list_pop(&parent->children, struct child, list);
|
||||
* if (!one)
|
||||
* printf("Empty list!\n");
|
||||
*/
|
||||
#define list_pop(h, type, member) \
|
||||
((type *)list_pop_((h), list_off_(type, member)))
|
||||
|
||||
static inline const void *list_pop_(const struct list_head *h, size_t off)
|
||||
{
|
||||
struct list_node *n;
|
||||
|
||||
if (list_empty(h))
|
||||
return NULL;
|
||||
n = h->n.next;
|
||||
list_del(n);
|
||||
return (const char *)n - off;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_tail - get the last entry in a list
|
||||
* @h: the list_head
|
||||
* @type: the type of the entry
|
||||
* @member: the list_node member of the type
|
||||
*
|
||||
* If the list is empty, returns NULL.
|
||||
*
|
||||
* Example:
|
||||
* struct child *last;
|
||||
* last = list_tail(&parent->children, struct child, list);
|
||||
* if (!last)
|
||||
* printf("Empty list!\n");
|
||||
*/
|
||||
#define list_tail(h, type, member) \
|
||||
((type *)list_tail_((h), list_off_(type, member)))
|
||||
|
||||
static inline const void *list_tail_(const struct list_head *h, size_t off)
|
||||
{
|
||||
if (list_empty(h))
|
||||
return NULL;
|
||||
return (const char *)h->n.prev - off;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_for_each - iterate through a list.
|
||||
* @h: the list_head (warning: evaluated multiple times!)
|
||||
* @i: the structure containing the list_node
|
||||
* @member: the list_node member of the structure
|
||||
*
|
||||
* This is a convenient wrapper to iterate @i over the entire list. It's
|
||||
* a for loop, so you can break and continue as normal.
|
||||
*
|
||||
* Example:
|
||||
* list_for_each(&parent->children, child, list)
|
||||
* printf("Name: %s\n", child->name);
|
||||
*/
|
||||
#define list_for_each(h, i, member) \
|
||||
list_for_each_off(h, i, list_off_var_(i, member))
|
||||
|
||||
/**
|
||||
* list_for_each_rev - iterate through a list backwards.
|
||||
* @h: the list_head
|
||||
* @i: the structure containing the list_node
|
||||
* @member: the list_node member of the structure
|
||||
*
|
||||
* This is a convenient wrapper to iterate @i over the entire list. It's
|
||||
* a for loop, so you can break and continue as normal.
|
||||
*
|
||||
* Example:
|
||||
* list_for_each_rev(&parent->children, child, list)
|
||||
* printf("Name: %s\n", child->name);
|
||||
*/
|
||||
#define list_for_each_rev(h, i, member) \
|
||||
list_for_each_rev_off(h, i, list_off_var_(i, member))
|
||||
|
||||
/**
|
||||
* list_for_each_rev_safe - iterate through a list backwards,
|
||||
* maybe during deletion
|
||||
* @h: the list_head
|
||||
* @i: the structure containing the list_node
|
||||
* @nxt: the structure containing the list_node
|
||||
* @member: the list_node member of the structure
|
||||
*
|
||||
* This is a convenient wrapper to iterate @i over the entire list backwards.
|
||||
* It's a for loop, so you can break and continue as normal. The extra
|
||||
* variable * @nxt is used to hold the next element, so you can delete @i
|
||||
* from the list.
|
||||
*
|
||||
* Example:
|
||||
* struct child *next;
|
||||
* list_for_each_rev_safe(&parent->children, child, next, list) {
|
||||
* printf("Name: %s\n", child->name);
|
||||
* }
|
||||
*/
|
||||
#define list_for_each_rev_safe(h, i, nxt, member) \
|
||||
list_for_each_rev_safe_off(h, i, nxt, list_off_var_(i, member))
|
||||
|
||||
/**
|
||||
* list_for_each_safe - iterate through a list, maybe during deletion
|
||||
* @h: the list_head
|
||||
* @i: the structure containing the list_node
|
||||
* @nxt: the structure containing the list_node
|
||||
* @member: the list_node member of the structure
|
||||
*
|
||||
* This is a convenient wrapper to iterate @i over the entire list. It's
|
||||
* a for loop, so you can break and continue as normal. The extra variable
|
||||
* @nxt is used to hold the next element, so you can delete @i from the list.
|
||||
*
|
||||
* Example:
|
||||
* list_for_each_safe(&parent->children, child, next, list) {
|
||||
* list_del(&child->list);
|
||||
* parent->num_children--;
|
||||
* }
|
||||
*/
|
||||
#define list_for_each_safe(h, i, nxt, member) \
|
||||
list_for_each_safe_off(h, i, nxt, list_off_var_(i, member))
|
||||
|
||||
/**
|
||||
* list_next - get the next entry in a list
|
||||
* @h: the list_head
|
||||
* @i: a pointer to an entry in the list.
|
||||
* @member: the list_node member of the structure
|
||||
*
|
||||
* If @i was the last entry in the list, returns NULL.
|
||||
*
|
||||
* Example:
|
||||
* struct child *second;
|
||||
* second = list_next(&parent->children, first, list);
|
||||
* if (!second)
|
||||
* printf("No second child!\n");
|
||||
*/
|
||||
#define list_next(h, i, member) \
|
||||
((list_typeof(i))list_entry_or_null(list_debug(h, \
|
||||
__FILE__ ":" stringify(__LINE__)), \
|
||||
(i)->member.next, \
|
||||
list_off_var_((i), member)))
|
||||
|
||||
/**
|
||||
* list_prev - get the previous entry in a list
|
||||
* @h: the list_head
|
||||
* @i: a pointer to an entry in the list.
|
||||
* @member: the list_node member of the structure
|
||||
*
|
||||
* If @i was the first entry in the list, returns NULL.
|
||||
*
|
||||
* Example:
|
||||
* first = list_prev(&parent->children, second, list);
|
||||
* if (!first)
|
||||
* printf("Can't go back to first child?!\n");
|
||||
*/
|
||||
#define list_prev(h, i, member) \
|
||||
((list_typeof(i))list_entry_or_null(list_debug(h, \
|
||||
__FILE__ ":" stringify(__LINE__)), \
|
||||
(i)->member.prev, \
|
||||
list_off_var_((i), member)))
|
||||
|
||||
/**
|
||||
* list_append_list - empty one list onto the end of another.
|
||||
* @to: the list to append into
|
||||
* @from: the list to empty.
|
||||
*
|
||||
* This takes the entire contents of @from and moves it to the end of
|
||||
* @to. After this @from will be empty.
|
||||
*
|
||||
* Example:
|
||||
* struct list_head adopter;
|
||||
*
|
||||
* list_append_list(&adopter, &parent->children);
|
||||
* assert(list_empty(&parent->children));
|
||||
* parent->num_children = 0;
|
||||
*/
|
||||
#define list_append_list(t, f) list_append_list_(t, f, \
|
||||
__FILE__ ":" stringify(__LINE__))
|
||||
static inline void list_append_list_(struct list_head *to,
|
||||
struct list_head *from,
|
||||
const char *abortstr)
|
||||
{
|
||||
struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
|
||||
struct list_node *to_tail = list_debug(to, abortstr)->n.prev;
|
||||
|
||||
/* Sew in head and entire list. */
|
||||
to->n.prev = from_tail;
|
||||
from_tail->next = &to->n;
|
||||
to_tail->next = &from->n;
|
||||
from->n.prev = to_tail;
|
||||
|
||||
/* Now remove head. */
|
||||
list_del(&from->n);
|
||||
list_head_init(from);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_prepend_list - empty one list into the start of another.
|
||||
* @to: the list to prepend into
|
||||
* @from: the list to empty.
|
||||
*
|
||||
* This takes the entire contents of @from and moves it to the start
|
||||
* of @to. After this @from will be empty.
|
||||
*
|
||||
* Example:
|
||||
* list_prepend_list(&adopter, &parent->children);
|
||||
* assert(list_empty(&parent->children));
|
||||
* parent->num_children = 0;
|
||||
*/
|
||||
#define list_prepend_list(t, f) list_prepend_list_(t, f, LIST_LOC)
|
||||
static inline void list_prepend_list_(struct list_head *to,
|
||||
struct list_head *from,
|
||||
const char *abortstr)
|
||||
{
|
||||
struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
|
||||
struct list_node *to_head = list_debug(to, abortstr)->n.next;
|
||||
|
||||
/* Sew in head and entire list. */
|
||||
to->n.next = &from->n;
|
||||
from->n.prev = &to->n;
|
||||
to_head->prev = from_tail;
|
||||
from_tail->next = to_head;
|
||||
|
||||
/* Now remove head. */
|
||||
list_del(&from->n);
|
||||
list_head_init(from);
|
||||
}
|
||||
|
||||
/* internal macros, do not use directly */
|
||||
#define list_for_each_off_dir_(h, i, off, dir) \
|
||||
for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.dir, \
|
||||
(off)); \
|
||||
list_node_from_off_((void *)i, (off)) != &(h)->n; \
|
||||
i = list_node_to_off_(list_node_from_off_((void *)i, (off))->dir, \
|
||||
(off)))
|
||||
|
||||
#define list_for_each_safe_off_dir_(h, i, nxt, off, dir) \
|
||||
for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.dir, \
|
||||
(off)), \
|
||||
nxt = list_node_to_off_(list_node_from_off_(i, (off))->dir, \
|
||||
(off)); \
|
||||
list_node_from_off_(i, (off)) != &(h)->n; \
|
||||
i = nxt, \
|
||||
nxt = list_node_to_off_(list_node_from_off_(i, (off))->dir, \
|
||||
(off)))
|
||||
|
||||
/**
|
||||
* list_for_each_off - iterate through a list of memory regions.
|
||||
* @h: the list_head
|
||||
* @i: the pointer to a memory region wich contains list node data.
|
||||
* @off: offset(relative to @i) at which list node data resides.
|
||||
*
|
||||
* This is a low-level wrapper to iterate @i over the entire list, used to
|
||||
* implement all oher, more high-level, for-each constructs. It's a for loop,
|
||||
* so you can break and continue as normal.
|
||||
*
|
||||
* WARNING! Being the low-level macro that it is, this wrapper doesn't know
|
||||
* nor care about the type of @i. The only assumtion made is that @i points
|
||||
* to a chunk of memory that at some @offset, relative to @i, contains a
|
||||
* properly filled `struct node_list' which in turn contains pointers to
|
||||
* memory chunks and it's turtles all the way down. Whith all that in mind
|
||||
* remember that given the wrong pointer/offset couple this macro will
|
||||
* happilly churn all you memory untill SEGFAULT stops it, in other words
|
||||
* caveat emptor.
|
||||
*
|
||||
* It is worth mentioning that one of legitimate use-cases for that wrapper
|
||||
* is operation on opaque types with known offset for `struct list_node'
|
||||
* member(preferably 0), because it allows you not to disclose the type of
|
||||
* @i.
|
||||
*
|
||||
* Example:
|
||||
* list_for_each_off(&parent->children, child,
|
||||
* offsetof(struct child, list))
|
||||
* printf("Name: %s\n", child->name);
|
||||
*/
|
||||
#define list_for_each_off(h, i, off) \
|
||||
list_for_each_off_dir_((h),(i),(off),next)
|
||||
|
||||
/**
|
||||
* list_for_each_rev_off - iterate through a list of memory regions backwards
|
||||
* @h: the list_head
|
||||
* @i: the pointer to a memory region wich contains list node data.
|
||||
* @off: offset(relative to @i) at which list node data resides.
|
||||
*
|
||||
* See list_for_each_off for details
|
||||
*/
|
||||
#define list_for_each_rev_off(h, i, off) \
|
||||
list_for_each_off_dir_((h),(i),(off),prev)
|
||||
|
||||
/**
|
||||
* list_for_each_safe_off - iterate through a list of memory regions, maybe
|
||||
* during deletion
|
||||
* @h: the list_head
|
||||
* @i: the pointer to a memory region wich contains list node data.
|
||||
* @nxt: the structure containing the list_node
|
||||
* @off: offset(relative to @i) at which list node data resides.
|
||||
*
|
||||
* For details see `list_for_each_off' and `list_for_each_safe'
|
||||
* descriptions.
|
||||
*
|
||||
* Example:
|
||||
* list_for_each_safe_off(&parent->children, child,
|
||||
* next, offsetof(struct child, list))
|
||||
* printf("Name: %s\n", child->name);
|
||||
*/
|
||||
#define list_for_each_safe_off(h, i, nxt, off) \
|
||||
list_for_each_safe_off_dir_((h),(i),(nxt),(off),next)
|
||||
|
||||
/**
|
||||
* list_for_each_rev_safe_off - iterate backwards through a list of
|
||||
* memory regions, maybe during deletion
|
||||
* @h: the list_head
|
||||
* @i: the pointer to a memory region wich contains list node data.
|
||||
* @nxt: the structure containing the list_node
|
||||
* @off: offset(relative to @i) at which list node data resides.
|
||||
*
|
||||
* For details see `list_for_each_rev_off' and `list_for_each_rev_safe'
|
||||
* descriptions.
|
||||
*
|
||||
* Example:
|
||||
* list_for_each_rev_safe_off(&parent->children, child,
|
||||
* next, offsetof(struct child, list))
|
||||
* printf("Name: %s\n", child->name);
|
||||
*/
|
||||
#define list_for_each_rev_safe_off(h, i, nxt, off) \
|
||||
list_for_each_safe_off_dir_((h),(i),(nxt),(off),prev)
|
||||
|
||||
/* Other -off variants. */
|
||||
#define list_entry_off(n, type, off) \
|
||||
((type *)list_node_from_off_((n), (off)))
|
||||
|
||||
#define list_head_off(h, type, off) \
|
||||
((type *)list_head_off((h), (off)))
|
||||
|
||||
#define list_tail_off(h, type, off) \
|
||||
((type *)list_tail_((h), (off)))
|
||||
|
||||
#define list_add_off(h, n, off) \
|
||||
list_add((h), list_node_from_off_((n), (off)))
|
||||
|
||||
#define list_del_off(n, off) \
|
||||
list_del(list_node_from_off_((n), (off)))
|
||||
|
||||
#define list_del_from_off(h, n, off) \
|
||||
list_del_from(h, list_node_from_off_((n), (off)))
|
||||
|
||||
/* Offset helper functions so we only single-evaluate. */
|
||||
static inline void *list_node_to_off_(struct list_node *node, size_t off)
|
||||
{
|
||||
return (void *)((char *)node - off);
|
||||
}
|
||||
static inline struct list_node *list_node_from_off_(void *ptr, size_t off)
|
||||
{
|
||||
return (struct list_node *)((char *)ptr + off);
|
||||
}
|
||||
|
||||
/* Get the offset of the member, but make sure it's a list_node. */
|
||||
#define list_off_(type, member) \
|
||||
(container_off(type, member) + \
|
||||
check_type(((type *)0)->member, struct list_node))
|
||||
|
||||
#define list_off_var_(var, member) \
|
||||
(container_off_var(var, member) + \
|
||||
check_type(var->member, struct list_node))
|
||||
|
||||
#if HAVE_TYPEOF
|
||||
#define list_typeof(var) typeof(var)
|
||||
#else
|
||||
#define list_typeof(var) void *
|
||||
#endif
|
||||
|
||||
/* Returns member, or NULL if at end of list. */
|
||||
static inline void *list_entry_or_null(const struct list_head *h,
|
||||
const struct list_node *n,
|
||||
size_t off)
|
||||
{
|
||||
if (n == &h->n)
|
||||
return NULL;
|
||||
return (char *)n - off;
|
||||
}
|
||||
#endif /* CCAN_LIST_H */
|
|
@ -1,65 +0,0 @@
|
|||
/* CC0 (Public domain) - see LICENSE.CC0 file for details */
|
||||
#ifndef CCAN_MINMAX_H
|
||||
#define CCAN_MINMAX_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <ccan/build_assert.h>
|
||||
|
||||
#if !HAVE_STATEMENT_EXPR || !HAVE_TYPEOF
|
||||
/*
|
||||
* Without these, there's no way to avoid unsafe double evaluation of
|
||||
* the arguments
|
||||
*/
|
||||
#error Sorry, minmax module requires statement expressions and typeof
|
||||
#endif
|
||||
|
||||
#if HAVE_BUILTIN_TYPES_COMPATIBLE_P
|
||||
#define MINMAX_ASSERT_COMPATIBLE(a, b) \
|
||||
BUILD_ASSERT(__builtin_types_compatible_p(a, b))
|
||||
#else
|
||||
#define MINMAX_ASSERT_COMPATIBLE(a, b) \
|
||||
do { } while (0)
|
||||
#endif
|
||||
|
||||
#define min(a, b) \
|
||||
({ \
|
||||
typeof(a) _a = (a); \
|
||||
typeof(b) _b = (b); \
|
||||
MINMAX_ASSERT_COMPATIBLE(typeof(_a), typeof(_b)); \
|
||||
_a < _b ? _a : _b; \
|
||||
})
|
||||
|
||||
#define max(a, b) \
|
||||
({ \
|
||||
typeof(a) _a = (a); \
|
||||
typeof(b) _b = (b); \
|
||||
MINMAX_ASSERT_COMPATIBLE(typeof(_a), typeof(_b)); \
|
||||
_a > _b ? _a : _b; \
|
||||
})
|
||||
|
||||
#define clamp(v, f, c) (max(min((v), (c)), (f)))
|
||||
|
||||
|
||||
#define min_t(t, a, b) \
|
||||
({ \
|
||||
t _ta = (a); \
|
||||
t _tb = (b); \
|
||||
min(_ta, _tb); \
|
||||
})
|
||||
#define max_t(t, a, b) \
|
||||
({ \
|
||||
t _ta = (a); \
|
||||
t _tb = (b); \
|
||||
max(_ta, _tb); \
|
||||
})
|
||||
|
||||
#define clamp_t(t, v, f, c) \
|
||||
({ \
|
||||
t _tv = (v); \
|
||||
t _tf = (f); \
|
||||
t _tc = (c); \
|
||||
clamp(_tv, _tf, _tc); \
|
||||
})
|
||||
|
||||
#endif /* CCAN_MINMAX_H */
|
|
@ -1,13 +0,0 @@
|
|||
/* CC0 (Public domain) - see LICENSE.CC0 file for details */
|
||||
#include <ccan/str.h>
|
||||
|
||||
size_t strcount(const char *haystack, const char *needle)
|
||||
{
|
||||
size_t i = 0, nlen = strlen(needle);
|
||||
|
||||
while ((haystack = strstr(haystack, needle)) != NULL) {
|
||||
i++;
|
||||
haystack += nlen;
|
||||
}
|
||||
return i;
|
||||
}
|
|
@ -1,228 +0,0 @@
|
|||
/* CC0 (Public domain) - see LICENSE.CC0 file for details */
|
||||
#ifndef CCAN_STR_H
|
||||
#define CCAN_STR_H
|
||||
#include "config.h"
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/**
|
||||
* streq - Are two strings equal?
|
||||
* @a: first string
|
||||
* @b: first string
|
||||
*
|
||||
* This macro is arguably more readable than "!strcmp(a, b)".
|
||||
*
|
||||
* Example:
|
||||
* if (streq(somestring, ""))
|
||||
* printf("String is empty!\n");
|
||||
*/
|
||||
#define streq(a,b) (strcmp((a),(b)) == 0)
|
||||
|
||||
/**
|
||||
* strstarts - Does this string start with this prefix?
|
||||
* @str: string to test
|
||||
* @prefix: prefix to look for at start of str
|
||||
*
|
||||
* Example:
|
||||
* if (strstarts(somestring, "foo"))
|
||||
* printf("String %s begins with 'foo'!\n", somestring);
|
||||
*/
|
||||
#define strstarts(str,prefix) (strncmp((str),(prefix),strlen(prefix)) == 0)
|
||||
|
||||
/**
|
||||
* strends - Does this string end with this postfix?
|
||||
* @str: string to test
|
||||
* @postfix: postfix to look for at end of str
|
||||
*
|
||||
* Example:
|
||||
* if (strends(somestring, "foo"))
|
||||
* printf("String %s end with 'foo'!\n", somestring);
|
||||
*/
|
||||
static inline bool strends(const char *str, const char *postfix)
|
||||
{
|
||||
if (strlen(str) < strlen(postfix))
|
||||
return false;
|
||||
|
||||
return streq(str + strlen(str) - strlen(postfix), postfix);
|
||||
}
|
||||
|
||||
/**
|
||||
* stringify - Turn expression into a string literal
|
||||
* @expr: any C expression
|
||||
*
|
||||
* Example:
|
||||
* #define PRINT_COND_IF_FALSE(cond) \
|
||||
* ((cond) || printf("%s is false!", stringify(cond)))
|
||||
*/
|
||||
#define stringify(expr) stringify_1(expr)
|
||||
/* Double-indirection required to stringify expansions */
|
||||
#define stringify_1(expr) #expr
|
||||
|
||||
/**
|
||||
* strcount - Count number of (non-overlapping) occurrences of a substring.
|
||||
* @haystack: a C string
|
||||
* @needle: a substring
|
||||
*
|
||||
* Example:
|
||||
* assert(strcount("aaa aaa", "a") == 6);
|
||||
* assert(strcount("aaa aaa", "ab") == 0);
|
||||
* assert(strcount("aaa aaa", "aa") == 2);
|
||||
*/
|
||||
size_t strcount(const char *haystack, const char *needle);
|
||||
|
||||
/**
|
||||
* STR_MAX_CHARS - Maximum possible size of numeric string for this type.
|
||||
* @type_or_expr: a pointer or integer type or expression.
|
||||
*
|
||||
* This provides enough space for a nul-terminated string which represents the
|
||||
* largest possible value for the type or expression.
|
||||
*
|
||||
* Note: The implementation adds extra space so hex values or negative
|
||||
* values will fit (eg. sprintf(... "%p"). )
|
||||
*
|
||||
* Example:
|
||||
* char str[STR_MAX_CHARS(int)];
|
||||
*
|
||||
* sprintf(str, "%i", 7);
|
||||
*/
|
||||
#define STR_MAX_CHARS(type_or_expr) \
|
||||
((sizeof(type_or_expr) * CHAR_BIT + 8) / 9 * 3 + 2 \
|
||||
+ STR_MAX_CHARS_TCHECK_(type_or_expr))
|
||||
|
||||
#if HAVE_TYPEOF
|
||||
/* Only a simple type can have 0 assigned, so test that. */
|
||||
#define STR_MAX_CHARS_TCHECK_(type_or_expr) \
|
||||
({ typeof(type_or_expr) x = 0; (void)x; 0; })
|
||||
#else
|
||||
#define STR_MAX_CHARS_TCHECK_(type_or_expr) 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* cisalnum - isalnum() which takes a char (and doesn't accept EOF)
|
||||
* @c: a character
|
||||
*
|
||||
* Surprisingly, the standard ctype.h isalnum() takes an int, which
|
||||
* must have the value of EOF (-1) or an unsigned char. This variant
|
||||
* takes a real char, and doesn't accept EOF.
|
||||
*/
|
||||
static inline bool cisalnum(char c)
|
||||
{
|
||||
return isalnum((unsigned char)c);
|
||||
}
|
||||
static inline bool cisalpha(char c)
|
||||
{
|
||||
return isalpha((unsigned char)c);
|
||||
}
|
||||
static inline bool cisascii(char c)
|
||||
{
|
||||
return isascii((unsigned char)c);
|
||||
}
|
||||
#if HAVE_ISBLANK
|
||||
static inline bool cisblank(char c)
|
||||
{
|
||||
return isblank((unsigned char)c);
|
||||
}
|
||||
#endif
|
||||
static inline bool ciscntrl(char c)
|
||||
{
|
||||
return iscntrl((unsigned char)c);
|
||||
}
|
||||
static inline bool cisdigit(char c)
|
||||
{
|
||||
return isdigit((unsigned char)c);
|
||||
}
|
||||
static inline bool cisgraph(char c)
|
||||
{
|
||||
return isgraph((unsigned char)c);
|
||||
}
|
||||
static inline bool cislower(char c)
|
||||
{
|
||||
return islower((unsigned char)c);
|
||||
}
|
||||
static inline bool cisprint(char c)
|
||||
{
|
||||
return isprint((unsigned char)c);
|
||||
}
|
||||
static inline bool cispunct(char c)
|
||||
{
|
||||
return ispunct((unsigned char)c);
|
||||
}
|
||||
static inline bool cisspace(char c)
|
||||
{
|
||||
return isspace((unsigned char)c);
|
||||
}
|
||||
static inline bool cisupper(char c)
|
||||
{
|
||||
return isupper((unsigned char)c);
|
||||
}
|
||||
static inline bool cisxdigit(char c)
|
||||
{
|
||||
return isxdigit((unsigned char)c);
|
||||
}
|
||||
|
||||
#include <ccan/str_debug.h>
|
||||
|
||||
/* These checks force things out of line, hence they are under DEBUG. */
|
||||
#ifdef CCAN_STR_DEBUG
|
||||
#include <ccan/build_assert.h>
|
||||
|
||||
/* These are commonly misused: they take -1 or an *unsigned* char value. */
|
||||
#undef isalnum
|
||||
#undef isalpha
|
||||
#undef isascii
|
||||
#undef isblank
|
||||
#undef iscntrl
|
||||
#undef isdigit
|
||||
#undef isgraph
|
||||
#undef islower
|
||||
#undef isprint
|
||||
#undef ispunct
|
||||
#undef isspace
|
||||
#undef isupper
|
||||
#undef isxdigit
|
||||
|
||||
/* You can use a char if char is unsigned. */
|
||||
#if HAVE_BUILTIN_TYPES_COMPATIBLE_P && HAVE_TYPEOF
|
||||
#define str_check_arg_(i) \
|
||||
((i) + BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(typeof(i), \
|
||||
char) \
|
||||
|| (char)255 > 0))
|
||||
#else
|
||||
#define str_check_arg_(i) (i)
|
||||
#endif
|
||||
|
||||
#define isalnum(i) str_isalnum(str_check_arg_(i))
|
||||
#define isalpha(i) str_isalpha(str_check_arg_(i))
|
||||
#define isascii(i) str_isascii(str_check_arg_(i))
|
||||
#if HAVE_ISBLANK
|
||||
#define isblank(i) str_isblank(str_check_arg_(i))
|
||||
#endif
|
||||
#define iscntrl(i) str_iscntrl(str_check_arg_(i))
|
||||
#define isdigit(i) str_isdigit(str_check_arg_(i))
|
||||
#define isgraph(i) str_isgraph(str_check_arg_(i))
|
||||
#define islower(i) str_islower(str_check_arg_(i))
|
||||
#define isprint(i) str_isprint(str_check_arg_(i))
|
||||
#define ispunct(i) str_ispunct(str_check_arg_(i))
|
||||
#define isspace(i) str_isspace(str_check_arg_(i))
|
||||
#define isupper(i) str_isupper(str_check_arg_(i))
|
||||
#define isxdigit(i) str_isxdigit(str_check_arg_(i))
|
||||
|
||||
#if HAVE_TYPEOF
|
||||
/* With GNU magic, we can make const-respecting standard string functions. */
|
||||
#undef strstr
|
||||
#undef strchr
|
||||
#undef strrchr
|
||||
|
||||
/* + 0 is needed to decay array into pointer. */
|
||||
#define strstr(haystack, needle) \
|
||||
((typeof((haystack) + 0))str_strstr((haystack), (needle)))
|
||||
#define strchr(haystack, c) \
|
||||
((typeof((haystack) + 0))str_strchr((haystack), (c)))
|
||||
#define strrchr(haystack, c) \
|
||||
((typeof((haystack) + 0))str_strrchr((haystack), (c)))
|
||||
#endif
|
||||
#endif /* CCAN_STR_DEBUG */
|
||||
|
||||
#endif /* CCAN_STR_H */
|
|
@ -1,30 +0,0 @@
|
|||
/* CC0 (Public domain) - see LICENSE.CC0 file for details */
|
||||
#ifndef CCAN_STR_DEBUG_H
|
||||
#define CCAN_STR_DEBUG_H
|
||||
|
||||
/* #define CCAN_STR_DEBUG 1 */
|
||||
|
||||
#ifdef CCAN_STR_DEBUG
|
||||
/* Because we mug the real ones with macros, we need our own wrappers. */
|
||||
int str_isalnum(int i);
|
||||
int str_isalpha(int i);
|
||||
int str_isascii(int i);
|
||||
#if HAVE_ISBLANK
|
||||
int str_isblank(int i);
|
||||
#endif
|
||||
int str_iscntrl(int i);
|
||||
int str_isdigit(int i);
|
||||
int str_isgraph(int i);
|
||||
int str_islower(int i);
|
||||
int str_isprint(int i);
|
||||
int str_ispunct(int i);
|
||||
int str_isspace(int i);
|
||||
int str_isupper(int i);
|
||||
int str_isxdigit(int i);
|
||||
|
||||
char *str_strstr(const char *haystack, const char *needle);
|
||||
char *str_strchr(const char *s, int c);
|
||||
char *str_strrchr(const char *s, int c);
|
||||
#endif /* CCAN_STR_DEBUG */
|
||||
|
||||
#endif /* CCAN_STR_DEBUG_H */
|
|
@ -1,7 +0,0 @@
|
|||
rdma-core (16-1) unstable; urgency=low
|
||||
|
||||
* New version.
|
||||
* Adding debian/copyright.
|
||||
* Close ITP (Closes: #848971).
|
||||
|
||||
-- Jason Gunthorpe <jgg@obsidianresearch.com> Mon, 12 Sep 2016 13:44:24 -0600
|
|
@ -1 +0,0 @@
|
|||
9
|
|
@ -1,348 +0,0 @@
|
|||
Source: rdma-core
|
||||
Maintainer: Linux RDMA Mailing List <linux-rdma@vger.kernel.org>
|
||||
Uploaders: Benjamin Drung <benjamin.drung@profitbricks.com>,
|
||||
Talat Batheesh <talatb@mellanox.com>
|
||||
Section: net
|
||||
Priority: optional
|
||||
Build-Depends: cmake (>= 2.8.11),
|
||||
debhelper (>= 9),
|
||||
dh-systemd,
|
||||
dpkg-dev (>= 1.17),
|
||||
libnl-3-dev,
|
||||
libnl-route-3-dev,
|
||||
libsystemd-dev,
|
||||
libudev-dev,
|
||||
ninja-build,
|
||||
pkg-config,
|
||||
python,
|
||||
valgrind
|
||||
Standards-Version: 4.1.0
|
||||
Vcs-Git: https://github.com/linux-rdma/rdma-core.git
|
||||
Vcs-Browser: https://github.com/linux-rdma/rdma-core
|
||||
Homepage: https://github.com/linux-rdma/rdma-core
|
||||
|
||||
Package: rdma-core
|
||||
Architecture: linux-any
|
||||
Depends: lsb-base (>= 3.2-14~),
|
||||
${misc:Depends},
|
||||
${perl:Depends},
|
||||
${shlibs:Depends}
|
||||
Recommends: dmidecode, ethtool, net-tools
|
||||
Breaks: infiniband-diags (<< 2.0.0)
|
||||
Replaces: infiniband-diags (<< 2.0.0)
|
||||
Description: RDMA core userspace infrastructure and documentation
|
||||
This package provides the basic boot time support for systems that use the
|
||||
Linux kernel's remote direct memory access (RDMA) subystem which includes
|
||||
InfiniBand, iWARP, and RDMA over Converged Ethernet (RoCE).
|
||||
.
|
||||
Several kernel RDMA support daemons are included:
|
||||
- The rdma-ndd daemon which watches for RDMA device changes and/or hostname
|
||||
changes and updates the Node Description of the RDMA devices based on
|
||||
those changes.
|
||||
- The iWARP Port Mapper Daemon (iwpmd) which provides a kernel support
|
||||
service in userspace for iWARP drivers to claim TCP ports through the
|
||||
standard socket interface.
|
||||
|
||||
Package: ibacm
|
||||
Architecture: any
|
||||
Depends: lsb-base (>= 3.2-14~),
|
||||
rdma-core (>= 15),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Description: InfiniBand Communication Manager Assistant (ACM)
|
||||
The IB ACM implements and provides a framework for name, address, and
|
||||
route (path) resolution services over InfiniBand.
|
||||
It is intended to address connection setup scalability issues running
|
||||
MPI applications on large clusters. The IB ACM provides information
|
||||
needed to establish a connection, but does not implement the CM protocol.
|
||||
A primary user of the ibacm service is the librdmacm library.
|
||||
|
||||
Package: ibverbs-providers
|
||||
Architecture: linux-any
|
||||
Multi-Arch: same
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Provides: libcxgb3-1, libipathverbs1, libmlx4-1, libmlx5-1, libmthca1, libnes1
|
||||
Replaces: libcxgb3-1, libipathverbs1, libmlx4-1, libmlx5-1, libmthca1, libnes1
|
||||
Breaks: libcxgb3-1, libipathverbs1, libmlx4-1, libmlx5-1, libmthca1, libnes1
|
||||
Description: User space provider drivers for libibverbs
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
A RDMA driver consists of a kernel portion and a user space portion.
|
||||
This package contains the user space verbs drivers:
|
||||
.
|
||||
- bnxt_re: Broadcom NetXtreme-E RoCE HCAs
|
||||
- cxgb3: Chelsio T3 iWARP HCAs
|
||||
- cxgb4: Chelsio T4 iWARP HCAs
|
||||
- hfi1verbs: Intel Omni-Path HFI
|
||||
- hns: HiSilicon Hip06 SoC
|
||||
- i40iw: Intel Ethernet Connection X722 RDMA
|
||||
- ipathverbs: QLogic InfiniPath HCAs
|
||||
- mlx4: Mellanox ConnectX-3 InfiniBand HCAs
|
||||
- mlx5: Mellanox Connect-IB/X-4+ InfiniBand HCAs
|
||||
- mthca: Mellanox InfiniBand HCAs
|
||||
- nes: Intel NetEffect NE020-based iWARP adapters
|
||||
- ocrdma: Emulex OneConnect RDMA/RoCE device
|
||||
- qedr: QLogic QL4xxx RoCE HCAs
|
||||
- rxe: A software implementation of the RoCE protocol
|
||||
- vmw_pvrdma: VMware paravirtual RDMA device
|
||||
|
||||
Package: ibverbs-utils
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: Examples for the libibverbs library
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
This package contains useful libibverbs1 example programs such as
|
||||
ibv_devinfo, which displays information about InfiniBand devices.
|
||||
|
||||
Package: libibverbs-dev
|
||||
Section: libdevel
|
||||
Architecture: linux-any
|
||||
Multi-Arch: same
|
||||
Depends: ibverbs-providers (= ${binary:Version}),
|
||||
libibverbs1 (= ${binary:Version}),
|
||||
${misc:Depends}
|
||||
Description: Development files for the libibverbs library
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
This package is needed to compile programs against libibverbs1.
|
||||
It contains the header files and static libraries (optionally)
|
||||
needed for compiling.
|
||||
|
||||
Package: libibverbs1
|
||||
Architecture: linux-any
|
||||
Multi-Arch: same
|
||||
Section: libs
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: adduser, ${misc:Depends}, ${shlibs:Depends}
|
||||
Recommends: ibverbs-providers
|
||||
Breaks: ibverbs-providers (<< 14)
|
||||
Description: Library for direct userspace use of RDMA (InfiniBand/iWARP)
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
For this library to be useful, a device-specific plug-in module
|
||||
should also be installed.
|
||||
.
|
||||
This package contains the shared library.
|
||||
|
||||
Package: libibverbs1-dbg
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Architecture: linux-any
|
||||
Multi-Arch: same
|
||||
Depends: libibverbs1 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the libibverbs library
|
||||
libibverbs is a library that allows userspace processes to use RDMA
|
||||
"verbs" as described in the InfiniBand Architecture Specification and
|
||||
the RDMA Protocol Verbs Specification. iWARP ethernet NICs support
|
||||
RDMA over hardware-offloaded TCP/IP, while InfiniBand is a
|
||||
high-throughput, low-latency networking technology. InfiniBand host
|
||||
channel adapters (HCAs) and iWARP NICs commonly support direct
|
||||
hardware access from userspace (kernel bypass), and libibverbs
|
||||
supports this when available.
|
||||
.
|
||||
This package contains the debug symbols associated with
|
||||
libibverbs1. They will automatically be used by gdb for debugging
|
||||
libibverbs-related issues.
|
||||
|
||||
Package: libibcm-dev
|
||||
Section: libdevel
|
||||
Architecture: linux-any
|
||||
Depends: libibcm1 (= ${binary:Version}), libibverbs-dev, ${misc:Depends}
|
||||
Description: Development files for the libibcm library
|
||||
libibcm provides a userspace implementation of an InfiniBand
|
||||
Communication Manager (CM). The CM handles both connection
|
||||
establishment as well as service ID resolution.
|
||||
.
|
||||
This package is needed to compile programs against libibcm1.
|
||||
It contains the header files and static libraries (optionally)
|
||||
needed for compiling.
|
||||
|
||||
Package: libibcm1
|
||||
Architecture: linux-any
|
||||
Section: libs
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: InfiniBand Communication Manager (CM) library
|
||||
libibcm provides a userspace implementation of an InfiniBand
|
||||
Communication Manager (CM). The CM handles both connection
|
||||
establishment as well as service ID resolution.
|
||||
.
|
||||
This package contains the shared library.
|
||||
|
||||
Package: libibcm1-dbg
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Architecture: linux-any
|
||||
Depends: libibcm1 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the libibcm1 library
|
||||
libibcm provides a userspace implementation of an InfiniBand
|
||||
Communication Manager (CM). The CM handles both connection
|
||||
establishment as well as service ID resolution.
|
||||
.
|
||||
This package contains the debug symbols associated with
|
||||
libibcm1. They will automatically be used by gdb for debugging
|
||||
libibcm-related issues.
|
||||
|
||||
Package: libibumad-dev
|
||||
Section: libdevel
|
||||
Architecture: linux-any
|
||||
Depends: libibumad3 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Development files for libibumad
|
||||
libibumad provides userspace Infiniband Management Datagram (uMAD)
|
||||
functions which sit on top of the uMAD modules in the kernel.
|
||||
These are used by InfiniBand diagnostic and management tools.
|
||||
.
|
||||
This package is needed to compile programs against libibumad.
|
||||
It contains the header files and static libraries (optionally)
|
||||
needed for compiling.
|
||||
|
||||
Package: libibumad3
|
||||
Architecture: linux-any
|
||||
Section: libs
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: InfiniBand Userspace Management Datagram (uMAD) library
|
||||
libibumad provides userspace Infiniband Management Datagram (uMAD)
|
||||
functions which sit on top of the uMAD modules in the kernel.
|
||||
These are used by InfiniBand diagnostic and management tools.
|
||||
.
|
||||
This package contains the shared library.
|
||||
|
||||
Package: libibumad3-dbg
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Architecture: linux-any
|
||||
Depends: libibumad3 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the libibumad3 library
|
||||
libibumad provides userspace Infiniband Management Datagram (uMAD)
|
||||
functions which sit on top of the uMAD modules in the kernel.
|
||||
These are used by InfiniBand diagnostic and management tools.
|
||||
.
|
||||
This package contains the debug symbols associated with
|
||||
libibumad3. They will automatically be used by gdb for debugging
|
||||
libibumad-related issues.
|
||||
|
||||
Package: librdmacm-dev
|
||||
Section: libdevel
|
||||
Architecture: linux-any
|
||||
Depends: libibverbs-dev, librdmacm1 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Development files for the librdmacm library
|
||||
librdmacm is a library that allows applications to set up reliable
|
||||
connected and unreliable datagram transfers when using RDMA adapters.
|
||||
It provides a transport-neutral interface in the sense that the same
|
||||
code can be used for both InfiniBand and iWARP adapters. The
|
||||
interface is based on sockets, but adapted for queue pair (QP) based
|
||||
semantics: communication must use a specific RDMA device, and data
|
||||
transfers are message-based.
|
||||
.
|
||||
librdmacm only provides communication management (connection setup
|
||||
and tear-down) and works in conjunction with the verbs interface
|
||||
provided by libibverbs, which provides the interface used to actually
|
||||
transfer data.
|
||||
.
|
||||
This package is needed to compile programs against librdmacm1.
|
||||
It contains the header files and static libraries (optionally)
|
||||
needed for compiling.
|
||||
|
||||
Package: librdmacm1
|
||||
Architecture: linux-any
|
||||
Section: libs
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: Library for managing RDMA connections
|
||||
librdmacm is a library that allows applications to set up reliable
|
||||
connected and unreliable datagram transfers when using RDMA adapters.
|
||||
It provides a transport-neutral interface in the sense that the same
|
||||
code can be used for both InfiniBand and iWARP adapters. The
|
||||
interface is based on sockets, but adapted for queue pair (QP) based
|
||||
semantics: communication must use a specific RDMA device, and data
|
||||
transfers are message-based.
|
||||
.
|
||||
librdmacm only provides communication management (connection setup
|
||||
and tear-down) and works in conjunction with the verbs interface
|
||||
provided by libibverbs, which provides the interface used to actually
|
||||
transfer data.
|
||||
.
|
||||
This package contains the shared library.
|
||||
|
||||
Package: librdmacm1-dbg
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Architecture: linux-any
|
||||
Depends: librdmacm1 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the librdmacm library
|
||||
librdmacm is a library that allows applications to set up reliable
|
||||
connected and unreliable datagram transfers when using RDMA adapters.
|
||||
It provides a transport-neutral interface in the sense that the same
|
||||
code can be used for both InfiniBand and iWARP adapters. The
|
||||
interface is based on sockets, but adapted for queue pair (QP) based
|
||||
semantics: communication must use a specific RDMA device, and data
|
||||
transfers are message-based.
|
||||
.
|
||||
librdmacm only provides communication management (connection setup
|
||||
and tear-down) and works in conjunction with the verbs interface
|
||||
provided by libibverbs, which provides the interface used to actually
|
||||
transfer data.
|
||||
.
|
||||
This package contains the debug symbols associated with
|
||||
librdmacm1. They will automatically be used by gdb for debugging
|
||||
librdmacm-related issues.
|
||||
|
||||
Package: rdmacm-utils
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: Examples for the librdmacm library
|
||||
librdmacm is a library that allows applications to set up reliable
|
||||
connected and unreliable datagram transfers when using RDMA adapters.
|
||||
It provides a transport-neutral interface in the sense that the same
|
||||
code can be used for both InfiniBand and iWARP adapters. The
|
||||
interface is based on sockets, but adapted for queue pair (QP) based
|
||||
semantics: communication must use a specific RDMA device, and data
|
||||
transfers are message-based.
|
||||
.
|
||||
librdmacm only provides communication management (connection setup
|
||||
and tear-down) and works in conjunction with the verbs interface
|
||||
provided by libibverbs, which provides the interface used to actually
|
||||
transfer data.
|
||||
.
|
||||
This package contains useful librdmacm1 example programs such as
|
||||
rping and udaddy.
|
||||
|
||||
Package: srptools
|
||||
Architecture: linux-any
|
||||
Depends: lsb-base (>= 3.2-14~),
|
||||
rdma-core (>= 15),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Description: Tools for Infiniband attached storage (SRP)
|
||||
In conjunction with the kernel ib_srp driver, srptools allows you to
|
||||
discover and use Infiniband attached storage devices which use the
|
||||
SCSI RDMA Protocol (SRP).
|
|
@ -1,663 +0,0 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: rdma-core
|
||||
Upstream-Contact: Doug Ledford <dledford@redhat.com>,
|
||||
Leon Romanovsky <Leon@kernel.org>
|
||||
Source: https://github.com/linux-rdma/rdma-core
|
||||
|
||||
Files: *
|
||||
Copyright: disclaimed
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2008, Genome Research Ltd
|
||||
2014, Ana Beatriz Guerrero Lopez <ana@debian.org>
|
||||
2015-2016, Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
|
||||
2016-2017, Benjamin Drung <benjamin.drung@profitbricks.com>
|
||||
2016-2017, Talat Batheesh <talatb@mellanox.com>
|
||||
License: GPL-2+
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
.
|
||||
On Debian systems, the full text of the GNU General Public License
|
||||
version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
Files: CMakeLists.txt
|
||||
Copyright: 2015-2017, Obsidian Research Corporation.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: buildlib/*
|
||||
Copyright: 2015-2017, Obsidian Research Corporation.
|
||||
2016-2017 Mellanox Technologies, Inc
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: buildlib/fixup-include/rdma-vmw_pvrdma-abi.h
|
||||
Copyright: 2012-2016 VMware, Inc.
|
||||
License: BSD-2-clause or GPL-2
|
||||
|
||||
Files: buildlib/fixup-include/stdatomic.h
|
||||
Copyright: 2011 Ed Schouten <ed@FreeBSD.org>
|
||||
David Chisnall <theraven@FreeBSD.org>
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: ccan/*
|
||||
Copyright: unspecified
|
||||
License: CC0
|
||||
|
||||
Files: ccan/list.*
|
||||
Copyright: unspecified
|
||||
License: MIT
|
||||
|
||||
Files: ibacm/*
|
||||
Copyright: 2009-2014, Intel Corporation.
|
||||
2013, Mellanox Technologies LTD.
|
||||
License: BSD-MIT
|
||||
|
||||
Files: ibacm/man/*
|
||||
ibacm/ibacm.init.in
|
||||
Copyright: disclaimed
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: ibacm/CMakeLists.txt
|
||||
ibacm/ibacm_hosts.data
|
||||
Copyright: disclaimed
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: iwpmd/*
|
||||
Copyright: 2013-2016, Intel Corporation.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: libibcm/*
|
||||
Copyright: 2004-2006, Intel Corporation.
|
||||
2004-2005, Topspin Communications.
|
||||
2004, Voltaire Corporation.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: libibumad/*
|
||||
Copyright: 2004-2017, Mellanox Technologies Ltd.
|
||||
2004, Infinicon Corporation.
|
||||
2004-2014, Intel Corporation.
|
||||
2004, Topspin Corporation.
|
||||
2004-2009, Voltaire Inc.
|
||||
2013 Lawrence Livermore National Security
|
||||
2013, Oracle and/or its affiliates.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: libibumad/man/*
|
||||
Copyright: disclaimed
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: libibverbs/*
|
||||
Copyright: 2004-2012, Intel Corporation.
|
||||
2004-2005, Topspin Communications.
|
||||
2005-2007, Cisco Systems, Inc.
|
||||
2005, PathScale, Inc.
|
||||
2005, Mellanox Technologies Ltd.
|
||||
2005, Voltaire, Inc.
|
||||
2008, Lawrence Livermore National Laboratory.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: libibverbs/man/*
|
||||
libibverbs/neigh.h
|
||||
libibverbs/nl1_compat.h
|
||||
libibverbs/neigh.c
|
||||
Copyright: disclaimed
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: librdmacm/*
|
||||
Copyright: 2005-2014, Intel Corporation.
|
||||
2005, Ammasso, Inc.
|
||||
2005, Voltaire Inc.
|
||||
2006, Open Grid Computing, Inc.
|
||||
2014-2015, Mellanox Technologies LTD.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: librdmacm/examples/cmtime.c
|
||||
librdmacm/examples/rcopy.c
|
||||
librdmacm/examples/rdma_client.c
|
||||
librdmacm/examples/rdma_server.c
|
||||
librdmacm/examples/rdma_xclient.c
|
||||
librdmacm/examples/rdma_xserver.c
|
||||
librdmacm/examples/riostream.c
|
||||
librdmacm/examples/rstream.c
|
||||
librdmacm/examples/udpong.c
|
||||
Copyright: 2005-2014, Intel Corporation.
|
||||
2014-2015, Mellanox Technologies LTD.
|
||||
License: BSD-MIT
|
||||
|
||||
Files: librdmacm/docs/rsocket
|
||||
Copyright: disclaimed
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: librdmacm/man/*
|
||||
Copyright: disclaimed
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: providers/bnxt_re/*
|
||||
Copyright: 2015-2017, Broadcom Limited and/or its subsidiaries
|
||||
License: BSD-2-clause or GPL-2
|
||||
|
||||
Files: providers/cxgb3/*
|
||||
providers/cxgb4/*
|
||||
Copyright: 2003-2016, Chelsio Communications, Inc.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/hfi1verbs/*
|
||||
Copyright: 2005 PathScale, Inc.
|
||||
2006-2009 QLogic Corporation
|
||||
2015 Intel Corporation
|
||||
License: BSD-3-clause or GPL-2
|
||||
|
||||
Files: providers/hns/*
|
||||
Copyright: 2016, Hisilicon Limited.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/i40iw/*
|
||||
Copyright: 2015-2016, Intel Corporation.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/ipathverbs/*
|
||||
Copyright: 2006-2010, QLogic Corp.
|
||||
2005, PathScale, Inc.
|
||||
2013, Intel Corporation
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/mlx4/*
|
||||
Copyright: 2004-2005, Topspin Communications.
|
||||
2005-2007, Cisco, Inc.
|
||||
2005-2017, Mellanox Technologies Ltd.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/mlx5/*
|
||||
Copyright: 2010-2017, Mellanox Technologies, Inc.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/mlx5/man/*.3
|
||||
providers/mlx5/man/*.7
|
||||
Copyright: disclaimed
|
||||
License: BSD-MIT
|
||||
|
||||
Files: providers/mthca/*
|
||||
Copyright: 2004-2005, Topspin Communications.
|
||||
2005-2006, Cisco Systems.
|
||||
2005, Mellanox Technologies Ltd.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/nes/*
|
||||
Copyright: 2006-2010, Intel Corporation.
|
||||
2006, Open Grid Computing, Inc.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/ocrdma/*
|
||||
Copyright: 2008-2013, Emulex.
|
||||
License: BSD-2-clause or GPL-2
|
||||
|
||||
Files: providers/qedr/*
|
||||
Copyright: 2015-2016, QLogic Corporation.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/rxe/*
|
||||
Copyright: 2009-2011, System Fabric Works, Inc.
|
||||
2009-2011, Mellanox Technologies Ltd.
|
||||
2006-2007, QLogic Corporation.
|
||||
2005, PathScale, Inc.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: providers/vmw_pvrdma/*
|
||||
Copyright: 2012-2016 VMware, Inc.
|
||||
License: BSD-2-clause or GPL-2
|
||||
|
||||
Files: rdma-ndd/*
|
||||
Copyright: 2004-2016, Intel Corporation.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: redhat/*
|
||||
Copyright: 1996-2013, Red Hat, Inc.
|
||||
License: GPL-2
|
||||
|
||||
Files: srp_daemon/*
|
||||
Copyright: 2005, Topspin Communications.
|
||||
2006, Cisco Systems, Inc.
|
||||
2006, Mellanox Technologies Ltd.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
Files: srp_daemon/srp_daemon.1.in
|
||||
Copyright: 2006 Mellanox Technologies.
|
||||
License: CPL-1.0 or BSD-2-clause or GPL-2
|
||||
|
||||
Files: srp_daemon/srpd.in
|
||||
srp_daemon/ibsrpdm.1
|
||||
Copyright: disclaimed
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: util/udma_barrier.h
|
||||
Copyright: 2005 Topspin Communications.
|
||||
License: BSD-MIT or GPL-2
|
||||
|
||||
License: BSD-MIT
|
||||
OpenIB.org BSD license (MIT variant)
|
||||
.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
.
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
License: BSD-2-clause
|
||||
OpenIB.org BSD license (FreeBSD Variant)
|
||||
.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
.
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
License: BSD-3-clause
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
.
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
License: GPL-2
|
||||
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; version 2 of the License.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
.
|
||||
On Debian systems, the full text of the GNU General Public License
|
||||
version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
License: CC0
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator and
|
||||
subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
.
|
||||
Certain owners wish to permanently relinquish those rights to a Work for the
|
||||
purpose of contributing to a commons of creative, cultural and scientific works
|
||||
("Commons") that the public can reliably and without fear of later claims of
|
||||
infringement build upon, modify, incorporate in other works, reuse and
|
||||
redistribute as freely as possible in any form whatsoever and for any purposes,
|
||||
including without limitation commercial purposes. These owners may contribute
|
||||
to the Commons to promote the ideal of a free culture and the further
|
||||
production of creative, cultural and scientific works, or to gain reputation or
|
||||
greater distribution for their Work in part through the use and efforts of
|
||||
others.
|
||||
.
|
||||
For these and/or other purposes and motivations, and without any expectation of
|
||||
additional consideration or compensation, the person associating CC0 with a
|
||||
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
|
||||
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
|
||||
publicly distribute the Work under its terms, with knowledge of his or her
|
||||
Copyright and Related Rights in the Work and the meaning and intended legal
|
||||
effect of CC0 on those rights.
|
||||
.
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not limited to,
|
||||
the following:
|
||||
.
|
||||
the right to reproduce, adapt, distribute, perform, display, communicate,
|
||||
and translate a Work; moral rights retained by the original author(s) and/or
|
||||
performer(s); publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work; rights protecting against unfair competition in
|
||||
regards to a Work, subject to the limitations in paragraph 4(a), below; rights
|
||||
protecting the extraction, dissemination, use and reuse of data in a Work;
|
||||
database rights (such as those arising under Directive 96/9/EC of the European
|
||||
Parliament and of the Council of 11 March 1996 on the legal protection of
|
||||
databases, and under any national implementation thereof, including any amended
|
||||
or successor version of such directive); and other similar, equivalent or
|
||||
corresponding rights throughout the world based on applicable law or treaty,
|
||||
and any national implementations thereof.
|
||||
.
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention of,
|
||||
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
|
||||
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
|
||||
and Related Rights and associated claims and causes of action, whether now
|
||||
known or unknown (including existing as well as future claims and causes of
|
||||
action), in the Work (i) in all territories worldwide, (ii) for the maximum
|
||||
duration provided by applicable law or treaty (including future time
|
||||
extensions), (iii) in any current or future medium and for any number of
|
||||
copies, and (iv) for any purpose whatsoever, including without limitation
|
||||
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
|
||||
the Waiver for the benefit of each member of the public at large and to the
|
||||
detriment of Affirmer's heirs and successors, fully intending that such Waiver
|
||||
shall not be subject to revocation, rescission, cancellation, termination, or
|
||||
any other legal or equitable action to disrupt the quiet enjoyment of the Work
|
||||
by the public as contemplated by Affirmer's express Statement of Purpose.
|
||||
.
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason be
|
||||
judged legally invalid or ineffective under applicable law, then the Waiver
|
||||
shall be preserved to the maximum extent permitted taking into account
|
||||
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
|
||||
is so judged Affirmer hereby grants to each affected person a royalty-free, non
|
||||
transferable, non sublicensable, non exclusive, irrevocable and unconditional
|
||||
license to exercise Affirmer's Copyright and Related Rights in the Work (i) in
|
||||
all territories worldwide, (ii) for the maximum duration provided by applicable
|
||||
law or treaty (including future time extensions), (iii) in any current or
|
||||
future medium and for any number of copies, and (iv) for any purpose
|
||||
whatsoever, including without limitation commercial, advertising or promotional
|
||||
purposes (the "License"). The License shall be deemed effective as of the date
|
||||
CC0 was applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder of the
|
||||
License, and in such case Affirmer hereby affirms that he or she will not (i)
|
||||
exercise any of his or her remaining Copyright and Related Rights in the Work
|
||||
or (ii) assert any associated claims and causes of action with respect to the
|
||||
Work, in either case contrary to Affirmer's express Statement of Purpose.
|
||||
.
|
||||
4. Limitations and Disclaimers.
|
||||
.
|
||||
No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document. Affirmer offers
|
||||
the Work as-is and makes no representations or warranties of any kind
|
||||
concerning the Work, express, implied, statutory or otherwise, including
|
||||
without limitation warranties of title, merchantability, fitness for a
|
||||
particular purpose, non infringement, or the absence of latent or other
|
||||
defects, accuracy, or the present or absence of errors, whether or not
|
||||
discoverable, all to the greatest extent permissible under applicable law.
|
||||
Affirmer disclaims responsibility for clearing rights of other persons that may
|
||||
apply to the Work or any use thereof, including without limitation any person's
|
||||
Copyright and Related Rights in the Work. Further, Affirmer disclaims
|
||||
responsibility for obtaining any necessary consents, permissions or other
|
||||
rights required for any use of the Work. Affirmer understands and acknowledges
|
||||
that Creative Commons is not a party to this document and has no duty or
|
||||
obligation with respect to this CC0 or use of the Work.
|
||||
|
||||
License: MIT
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
License: CPL-1.0
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
|
||||
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
|
||||
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
.
|
||||
1. DEFINITIONS
|
||||
.
|
||||
"Contribution" means:
|
||||
.
|
||||
a) in the case of the initial Contributor, the initial code and
|
||||
documentation distributed under this Agreement, and
|
||||
.
|
||||
b) in the case of each subsequent Contributor:
|
||||
.
|
||||
i) changes to the Program, and
|
||||
.
|
||||
ii) additions to the Program;
|
||||
.
|
||||
where such changes and/or additions to the Program originate from and are
|
||||
distributed by that particular Contributor. A Contribution 'originates' from a
|
||||
Contributor if it was added to the Program by such Contributor itself or anyone
|
||||
acting on such Contributor's behalf. Contributions do not include additions to
|
||||
the Program which: (i) are separate modules of software distributed in
|
||||
conjunction with the Program under their own license agreement, and (ii) are not
|
||||
derivative works of the Program.
|
||||
.
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
.
|
||||
"Licensed Patents " mean patent claims licensable by a Contributor which are
|
||||
necessarily infringed by the use or sale of its Contribution alone or when
|
||||
combined with the Program.
|
||||
.
|
||||
"Program" means the Contributions distributed in accordance with this Agreement.
|
||||
.
|
||||
"Recipient" means anyone who receives the Program under this Agreement,
|
||||
including all Contributors.
|
||||
.
|
||||
2. GRANT OF RIGHTS
|
||||
.
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby grants
|
||||
Recipient a non-exclusive, worldwide, royalty-free copyright license to
|
||||
reproduce, prepare derivative works of, publicly display, publicly perform,
|
||||
distribute and sublicense the Contribution of such Contributor, if any, and such
|
||||
derivative works, in source code and object code form.
|
||||
.
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby grants
|
||||
Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
|
||||
Patents to make, use, sell, offer to sell, import and otherwise transfer the
|
||||
Contribution of such Contributor, if any, in source code and object code form.
|
||||
This patent license shall apply to the combination of the Contribution and the
|
||||
Program if, at the time the Contribution is added by the Contributor, such
|
||||
addition of the Contribution causes such combination to be covered by the
|
||||
Licensed Patents. The patent license shall not apply to any other combinations
|
||||
which include the Contribution. No hardware per se is licensed hereunder.
|
||||
.
|
||||
c) Recipient understands that although each Contributor grants the licenses
|
||||
to its Contributions set forth herein, no assurances are provided by any
|
||||
Contributor that the Program does not infringe the patent or other intellectual
|
||||
property rights of any other entity. Each Contributor disclaims any liability to
|
||||
Recipient for claims brought by any other entity based on infringement of
|
||||
intellectual property rights or otherwise. As a condition to exercising the
|
||||
rights and licenses granted hereunder, each Recipient hereby assumes sole
|
||||
responsibility to secure any other intellectual property rights needed, if any.
|
||||
For example, if a third party patent license is required to allow Recipient to
|
||||
distribute the Program, it is Recipient's responsibility to acquire that license
|
||||
before distributing the Program.
|
||||
.
|
||||
d) Each Contributor represents that to its knowledge it has sufficient
|
||||
copyright rights in its Contribution, if any, to grant the copyright license set
|
||||
forth in this Agreement.
|
||||
.
|
||||
3. REQUIREMENTS
|
||||
.
|
||||
A Contributor may choose to distribute the Program in object code form under its
|
||||
own license agreement, provided that:
|
||||
.
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
.
|
||||
b) its license agreement:
|
||||
.
|
||||
i) effectively disclaims on behalf of all Contributors all warranties and
|
||||
conditions, express and implied, including warranties or conditions of title and
|
||||
non-infringement, and implied warranties or conditions of merchantability and
|
||||
fitness for a particular purpose;
|
||||
.
|
||||
ii) effectively excludes on behalf of all Contributors all liability for
|
||||
damages, including direct, indirect, special, incidental and consequential
|
||||
damages, such as lost profits;
|
||||
.
|
||||
iii) states that any provisions which differ from this Agreement are offered
|
||||
by that Contributor alone and not by any other party; and
|
||||
.
|
||||
iv) states that source code for the Program is available from such
|
||||
Contributor, and informs licensees how to obtain it in a reasonable manner on or
|
||||
through a medium customarily used for software exchange.
|
||||
.
|
||||
When the Program is made available in source code form:
|
||||
.
|
||||
a) it must be made available under this Agreement; and
|
||||
.
|
||||
b) a copy of this Agreement must be included with each copy of the Program.
|
||||
.
|
||||
Contributors may not remove or alter any copyright notices contained within the
|
||||
Program.
|
||||
.
|
||||
Each Contributor must identify itself as the originator of its Contribution, if
|
||||
any, in a manner that reasonably allows subsequent Recipients to identify the
|
||||
originator of the Contribution.
|
||||
.
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
.
|
||||
Commercial distributors of software may accept certain responsibilities with
|
||||
respect to end users, business partners and the like. While this license is
|
||||
intended to facilitate the commercial use of the Program, the Contributor who
|
||||
includes the Program in a commercial product offering should do so in a manner
|
||||
which does not create potential liability for other Contributors. Therefore, if
|
||||
a Contributor includes the Program in a commercial product offering, such
|
||||
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
|
||||
every other Contributor ("Indemnified Contributor") against any losses, damages
|
||||
and costs (collectively "Losses") arising from claims, lawsuits and other legal
|
||||
actions brought by a third party against the Indemnified Contributor to the
|
||||
extent caused by the acts or omissions of such Commercial Contributor in
|
||||
connection with its distribution of the Program in a commercial product
|
||||
offering. The obligations in this section do not apply to any claims or Losses
|
||||
relating to any actual or alleged intellectual property infringement. In order
|
||||
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
|
||||
Contributor in writing of such claim, and b) allow the Commercial Contributor to
|
||||
control, and cooperate with the Commercial Contributor in, the defense and any
|
||||
related settlement negotiations. The Indemnified Contributor may participate in
|
||||
any such claim at its own expense.
|
||||
.
|
||||
For example, a Contributor might include the Program in a commercial product
|
||||
offering, Product X. That Contributor is then a Commercial Contributor. If that
|
||||
Commercial Contributor then makes performance claims, or offers warranties
|
||||
related to Product X, those performance claims and warranties are such
|
||||
Commercial Contributor's responsibility alone. Under this section, the
|
||||
Commercial Contributor would have to defend claims against the other
|
||||
Contributors related to those performance claims and warranties, and if a court
|
||||
requires any other Contributor to pay any damages as a result, the Commercial
|
||||
Contributor must pay those damages.
|
||||
.
|
||||
5. NO WARRANTY
|
||||
.
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
|
||||
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
|
||||
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
|
||||
Recipient is solely responsible for determining the appropriateness of using and
|
||||
distributing the Program and assumes all risks associated with its exercise of
|
||||
rights under this Agreement, including but not limited to the risks and costs of
|
||||
program errors, compliance with applicable laws, damage to or loss of data,
|
||||
programs or equipment, and unavailability or interruption of operations.
|
||||
.
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
.
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
|
||||
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
|
||||
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
|
||||
GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
.
|
||||
7. GENERAL
|
||||
.
|
||||
If any provision of this Agreement is invalid or unenforceable under applicable
|
||||
law, it shall not affect the validity or enforceability of the remainder of the
|
||||
terms of this Agreement, and without further action by the parties hereto, such
|
||||
provision shall be reformed to the minimum extent necessary to make such
|
||||
provision valid and enforceable.
|
||||
.
|
||||
If Recipient institutes patent litigation against a Contributor with respect to
|
||||
a patent applicable to software (including a cross-claim or counterclaim in a
|
||||
lawsuit), then any patent licenses granted by that Contributor to such Recipient
|
||||
under this Agreement shall terminate as of the date such litigation is filed. In
|
||||
addition, if Recipient institutes patent litigation against any entity
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
|
||||
itself (excluding combinations of the Program with other software or hardware)
|
||||
infringes such Recipient's patent(s), then such Recipient's rights granted under
|
||||
Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
.
|
||||
All Recipient's rights under this Agreement shall terminate if it fails to
|
||||
comply with any of the material terms or conditions of this Agreement and does
|
||||
not cure such failure in a reasonable period of time after becoming aware of
|
||||
such noncompliance. If all Recipient's rights under this Agreement terminate,
|
||||
Recipient agrees to cease use and distribution of the Program as soon as
|
||||
reasonably practicable. However, Recipient's obligations under this Agreement
|
||||
and any licenses granted by Recipient relating to the Program shall continue and
|
||||
survive.
|
||||
.
|
||||
Everyone is permitted to copy and distribute copies of this Agreement, but in
|
||||
order to avoid inconsistency the Agreement is copyrighted and may only be
|
||||
modified in the following manner. The Agreement Steward reserves the right to
|
||||
publish new versions (including revisions) of this Agreement from time to time.
|
||||
No one other than the Agreement Steward has the right to modify this Agreement.
|
||||
IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
|
||||
as the Agreement Steward to a suitable separate entity. Each new version of the
|
||||
Agreement will be given a distinguishing version number. The Program (including
|
||||
Contributions) may always be distributed subject to the version of the Agreement
|
||||
under which it was received. In addition, after a new version of the Agreement
|
||||
is published, Contributor may elect to distribute the Program (including its
|
||||
Contributions) under the new version. Except as expressly stated in Sections
|
||||
2(a) and 2(b) above, Recipient receives no rights or licenses to the
|
||||
intellectual property of any Contributor under this Agreement, whether
|
||||
expressly, by implication, estoppel or otherwise. All rights in the Program not
|
||||
expressly granted under this Agreement are reserved.
|
||||
.
|
||||
This Agreement is governed by the laws of the State of New York and the
|
||||
intellectual property laws of the United States of America. No party to this
|
||||
Agreement will bring a legal action under this Agreement more than one year
|
||||
after the cause of action arose. Each party waives its rights to a jury trial in
|
||||
any resulting litigation.
|
|
@ -1,13 +0,0 @@
|
|||
etc/init.d/ibacm
|
||||
lib/systemd/system/ibacm.service
|
||||
lib/systemd/system/ibacm.socket
|
||||
usr/bin/ib_acme
|
||||
usr/include/infiniband/acm.h
|
||||
usr/include/infiniband/acm_prov.h
|
||||
usr/lib/*/ibacm/libibacmp.so
|
||||
usr/sbin/ibacm
|
||||
usr/share/doc/rdma-core/ibacm.md usr/share/doc/ibacm/
|
||||
usr/share/man/man1/ib_acme.1
|
||||
usr/share/man/man1/ibacm.1
|
||||
usr/share/man/man7/ibacm.7
|
||||
usr/share/man/man7/ibacm_prov.7
|
|
@ -1,4 +0,0 @@
|
|||
etc/libibverbs.d/
|
||||
usr/lib/*/libibverbs/lib*-rdmav*.so
|
||||
usr/lib/*/libmlx4.so.*
|
||||
usr/lib/*/libmlx5.so.*
|
|
@ -1,2 +0,0 @@
|
|||
# libmlx4 and libmlx5 are ibverbs provider that provides more functions.
|
||||
ibverbs-providers: package-name-doesnt-match-sonames libmlx4-1 libmlx5-1
|
|
@ -1,15 +0,0 @@
|
|||
libmlx4.so.1 ibverbs-providers #MINVER#
|
||||
MLX4_1.0@MLX4_1.0 15
|
||||
mlx4dv_init_obj@MLX4_1.0 15
|
||||
mlx4dv_query_device@MLX4_1.0 15
|
||||
mlx4dv_create_qp@MLX4_1.0 15
|
||||
mlx4dv_set_context_attr@MLX4_1.0 15
|
||||
libmlx5.so.1 ibverbs-providers #MINVER#
|
||||
MLX5_1.0@MLX5_1.0 13
|
||||
MLX5_1.1@MLX5_1.1 14
|
||||
MLX5_1.2@MLX5_1.2 15
|
||||
mlx5dv_init_obj@MLX5_1.0 13
|
||||
mlx5dv_init_obj@MLX5_1.2 15
|
||||
mlx5dv_query_device@MLX5_1.0 13
|
||||
mlx5dv_create_cq@MLX5_1.1 14
|
||||
mlx5dv_set_context_attr@MLX5_1.2 15
|
|
@ -1,16 +0,0 @@
|
|||
usr/bin/ibv_asyncwatch
|
||||
usr/bin/ibv_devices
|
||||
usr/bin/ibv_devinfo
|
||||
usr/bin/ibv_rc_pingpong
|
||||
usr/bin/ibv_srq_pingpong
|
||||
usr/bin/ibv_uc_pingpong
|
||||
usr/bin/ibv_ud_pingpong
|
||||
usr/bin/ibv_xsrq_pingpong
|
||||
usr/share/man/man1/ibv_asyncwatch.1
|
||||
usr/share/man/man1/ibv_devices.1
|
||||
usr/share/man/man1/ibv_devinfo.1
|
||||
usr/share/man/man1/ibv_rc_pingpong.1
|
||||
usr/share/man/man1/ibv_srq_pingpong.1
|
||||
usr/share/man/man1/ibv_uc_pingpong.1
|
||||
usr/share/man/man1/ibv_ud_pingpong.1
|
||||
usr/share/man/man1/ibv_xsrq_pingpong.1
|
|
@ -1,3 +0,0 @@
|
|||
usr/include/infiniband/cm.h
|
||||
usr/include/infiniband/cm_abi.h
|
||||
usr/lib/*/libibcm*.so
|
|
@ -1,2 +0,0 @@
|
|||
usr/lib/*/libibcm*.so.*
|
||||
usr/share/doc/rdma-core/libibcm.md usr/share/doc/libibcm1/
|
|
@ -1,23 +0,0 @@
|
|||
libibcm.so.1 libibcm1 #MINVER#
|
||||
IBCM_1.0@IBCM_1.0 12
|
||||
ib_cm_ack_event@IBCM_1.0 12
|
||||
ib_cm_attr_id@IBCM_1.0 12
|
||||
ib_cm_close_device@IBCM_1.0 12
|
||||
ib_cm_create_id@IBCM_1.0 12
|
||||
ib_cm_destroy_id@IBCM_1.0 12
|
||||
ib_cm_get_event@IBCM_1.0 12
|
||||
ib_cm_init_qp_attr@IBCM_1.0 12
|
||||
ib_cm_listen@IBCM_1.0 12
|
||||
ib_cm_notify@IBCM_1.0 12
|
||||
ib_cm_open_device@IBCM_1.0 12
|
||||
ib_cm_send_apr@IBCM_1.0 12
|
||||
ib_cm_send_drep@IBCM_1.0 12
|
||||
ib_cm_send_dreq@IBCM_1.0 12
|
||||
ib_cm_send_lap@IBCM_1.0 12
|
||||
ib_cm_send_mra@IBCM_1.0 12
|
||||
ib_cm_send_rej@IBCM_1.0 12
|
||||
ib_cm_send_rep@IBCM_1.0 12
|
||||
ib_cm_send_req@IBCM_1.0 12
|
||||
ib_cm_send_rtu@IBCM_1.0 12
|
||||
ib_cm_send_sidr_rep@IBCM_1.0 12
|
||||
ib_cm_send_sidr_req@IBCM_1.0 12
|
|
@ -1,3 +0,0 @@
|
|||
usr/include/infiniband/umad*.h
|
||||
usr/lib/*/libibumad*.so
|
||||
usr/share/man/man3/umad_*
|
|
@ -1,3 +0,0 @@
|
|||
# False positive for Certificate Authoritys (CAs)
|
||||
libibumad-dev: spelling-error-in-manpage usr/share/man/man3/umad_get_cas_names.3.gz cas case
|
||||
libibumad-dev: spelling-error-in-manpage usr/share/man/man3/umad_get_cas_names.3.gz CAs Case
|
|
@ -1 +0,0 @@
|
|||
usr/lib/*/libibumad*.so.*
|
|
@ -1,2 +0,0 @@
|
|||
# False positive for Certificate Authoritys (CAs)
|
||||
libibumad3: spelling-error-in-binary usr/lib/x86_64-linux-gnu/libibumad.so.3.0.15 cas case
|
|
@ -1,38 +0,0 @@
|
|||
libibumad.so.3 libibumad3 #MINVER#
|
||||
IBUMAD_1.0@IBUMAD_1.0 1.3.9
|
||||
umad_addr_dump@IBUMAD_1.0 1.3.9
|
||||
umad_attribute_str@IBUMAD_1.0 1.3.10.2
|
||||
umad_class_str@IBUMAD_1.0 1.3.10.2
|
||||
umad_close_port@IBUMAD_1.0 1.3.9
|
||||
umad_common_mad_status_str@IBUMAD_1.0 1.3.10.2
|
||||
umad_debug@IBUMAD_1.0 1.3.9
|
||||
umad_done@IBUMAD_1.0 1.3.9
|
||||
umad_dump@IBUMAD_1.0 1.3.9
|
||||
umad_get_ca@IBUMAD_1.0 1.3.9
|
||||
umad_get_ca_portguids@IBUMAD_1.0 1.3.9
|
||||
umad_get_cas_names@IBUMAD_1.0 1.3.9
|
||||
umad_get_fd@IBUMAD_1.0 1.3.9
|
||||
umad_get_issm_path@IBUMAD_1.0 1.3.9
|
||||
umad_get_mad@IBUMAD_1.0 1.3.9
|
||||
umad_get_mad_addr@IBUMAD_1.0 1.3.9
|
||||
umad_get_pkey@IBUMAD_1.0 1.3.9
|
||||
umad_get_port@IBUMAD_1.0 1.3.9
|
||||
umad_init@IBUMAD_1.0 1.3.9
|
||||
umad_method_str@IBUMAD_1.0 1.3.10.2
|
||||
umad_open_port@IBUMAD_1.0 1.3.9
|
||||
umad_poll@IBUMAD_1.0 1.3.9
|
||||
umad_recv@IBUMAD_1.0 1.3.9
|
||||
umad_register2@IBUMAD_1.0 1.3.10.2
|
||||
umad_register@IBUMAD_1.0 1.3.9
|
||||
umad_register_oui@IBUMAD_1.0 1.3.9
|
||||
umad_release_ca@IBUMAD_1.0 1.3.9
|
||||
umad_release_port@IBUMAD_1.0 1.3.9
|
||||
umad_sa_mad_status_str@IBUMAD_1.0 1.3.10.2
|
||||
umad_send@IBUMAD_1.0 1.3.9
|
||||
umad_set_addr@IBUMAD_1.0 1.3.9
|
||||
umad_set_addr_net@IBUMAD_1.0 1.3.9
|
||||
umad_set_grh@IBUMAD_1.0 1.3.9
|
||||
umad_set_pkey@IBUMAD_1.0 1.3.9
|
||||
umad_size@IBUMAD_1.0 1.3.9
|
||||
umad_status@IBUMAD_1.0 1.3.9
|
||||
umad_unregister@IBUMAD_1.0 1.3.9
|
|
@ -1,18 +0,0 @@
|
|||
usr/include/infiniband/arch.h
|
||||
usr/include/infiniband/kern-abi.h
|
||||
usr/include/infiniband/mlx4dv.h
|
||||
usr/include/infiniband/mlx5dv.h
|
||||
usr/include/infiniband/opcode.h
|
||||
usr/include/infiniband/sa-kern-abi.h
|
||||
usr/include/infiniband/sa.h
|
||||
usr/include/infiniband/verbs.h
|
||||
usr/lib/*/libibverbs*.so
|
||||
usr/lib/*/libmlx4.so
|
||||
usr/lib/*/libmlx5.so
|
||||
usr/share/man/man3/ibv_*
|
||||
usr/share/man/man3/mbps_to_ibv_rate.3
|
||||
usr/share/man/man3/mlx4dv_*.3
|
||||
usr/share/man/man3/mlx5dv_*.3
|
||||
usr/share/man/man3/mult_to_ibv_rate.3
|
||||
usr/share/man/man7/mlx4dv.7
|
||||
usr/share/man/man7/mlx5dv.7
|
|
@ -1,2 +0,0 @@
|
|||
usr/lib/*/libibverbs*.so.*
|
||||
usr/share/doc/rdma-core/libibverbs.md usr/share/doc/libibverbs1/
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
# postinst script for libibverbs1
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = configure ]; then
|
||||
getent group rdma > /dev/null 2>&1 || addgroup --system --quiet rdma
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
|
@ -1,94 +0,0 @@
|
|||
libibverbs.so.1 libibverbs1 #MINVER#
|
||||
IBVERBS_1.0@IBVERBS_1.0 1.1.6
|
||||
IBVERBS_1.1@IBVERBS_1.1 1.1.6
|
||||
(symver)IBVERBS_PRIVATE_16 16
|
||||
ibv_ack_async_event@IBVERBS_1.0 1.1.6
|
||||
ibv_ack_async_event@IBVERBS_1.1 1.1.6
|
||||
ibv_ack_cq_events@IBVERBS_1.0 1.1.6
|
||||
ibv_ack_cq_events@IBVERBS_1.1 1.1.6
|
||||
ibv_alloc_pd@IBVERBS_1.0 1.1.6
|
||||
ibv_alloc_pd@IBVERBS_1.1 1.1.6
|
||||
ibv_attach_mcast@IBVERBS_1.0 1.1.6
|
||||
ibv_attach_mcast@IBVERBS_1.1 1.1.6
|
||||
ibv_close_device@IBVERBS_1.0 1.1.6
|
||||
ibv_close_device@IBVERBS_1.1 1.1.6
|
||||
ibv_copy_ah_attr_from_kern@IBVERBS_1.1 1.1.6
|
||||
ibv_copy_path_rec_from_kern@IBVERBS_1.0 1.1.6
|
||||
ibv_copy_path_rec_to_kern@IBVERBS_1.0 1.1.6
|
||||
ibv_copy_qp_attr_from_kern@IBVERBS_1.0 1.1.6
|
||||
ibv_create_ah@IBVERBS_1.0 1.1.6
|
||||
ibv_create_ah@IBVERBS_1.1 1.1.6
|
||||
ibv_create_ah_from_wc@IBVERBS_1.1 1.1.6
|
||||
ibv_create_comp_channel@IBVERBS_1.0 1.1.6
|
||||
ibv_create_cq@IBVERBS_1.0 1.1.6
|
||||
ibv_create_cq@IBVERBS_1.1 1.1.6
|
||||
ibv_create_qp@IBVERBS_1.0 1.1.6
|
||||
ibv_create_qp@IBVERBS_1.1 1.1.6
|
||||
ibv_create_srq@IBVERBS_1.0 1.1.6
|
||||
ibv_create_srq@IBVERBS_1.1 1.1.6
|
||||
ibv_dealloc_pd@IBVERBS_1.0 1.1.6
|
||||
ibv_dealloc_pd@IBVERBS_1.1 1.1.6
|
||||
ibv_dereg_mr@IBVERBS_1.0 1.1.6
|
||||
ibv_dereg_mr@IBVERBS_1.1 1.1.6
|
||||
ibv_destroy_ah@IBVERBS_1.0 1.1.6
|
||||
ibv_destroy_ah@IBVERBS_1.1 1.1.6
|
||||
ibv_destroy_comp_channel@IBVERBS_1.0 1.1.6
|
||||
ibv_destroy_cq@IBVERBS_1.0 1.1.6
|
||||
ibv_destroy_cq@IBVERBS_1.1 1.1.6
|
||||
ibv_destroy_qp@IBVERBS_1.0 1.1.6
|
||||
ibv_destroy_qp@IBVERBS_1.1 1.1.6
|
||||
ibv_destroy_srq@IBVERBS_1.0 1.1.6
|
||||
ibv_destroy_srq@IBVERBS_1.1 1.1.6
|
||||
ibv_detach_mcast@IBVERBS_1.0 1.1.6
|
||||
ibv_detach_mcast@IBVERBS_1.1 1.1.6
|
||||
ibv_dofork_range@IBVERBS_1.1 1.1.6
|
||||
ibv_dontfork_range@IBVERBS_1.1 1.1.6
|
||||
ibv_event_type_str@IBVERBS_1.1 1.1.6
|
||||
ibv_fork_init@IBVERBS_1.1 1.1.6
|
||||
ibv_free_device_list@IBVERBS_1.0 1.1.6
|
||||
ibv_free_device_list@IBVERBS_1.1 1.1.6
|
||||
ibv_get_async_event@IBVERBS_1.0 1.1.6
|
||||
ibv_get_async_event@IBVERBS_1.1 1.1.6
|
||||
ibv_get_cq_event@IBVERBS_1.0 1.1.6
|
||||
ibv_get_cq_event@IBVERBS_1.1 1.1.6
|
||||
ibv_get_device_guid@IBVERBS_1.0 1.1.6
|
||||
ibv_get_device_guid@IBVERBS_1.1 1.1.6
|
||||
ibv_get_device_list@IBVERBS_1.0 1.1.6
|
||||
ibv_get_device_list@IBVERBS_1.1 1.1.6
|
||||
ibv_get_device_name@IBVERBS_1.0 1.1.6
|
||||
ibv_get_device_name@IBVERBS_1.1 1.1.6
|
||||
ibv_get_sysfs_path@IBVERBS_1.0 1.1.6
|
||||
ibv_init_ah_from_wc@IBVERBS_1.1 1.1.6
|
||||
ibv_modify_qp@IBVERBS_1.0 1.1.6
|
||||
ibv_modify_qp@IBVERBS_1.1 1.1.6
|
||||
ibv_modify_srq@IBVERBS_1.0 1.1.6
|
||||
ibv_modify_srq@IBVERBS_1.1 1.1.6
|
||||
ibv_node_type_str@IBVERBS_1.1 1.1.6
|
||||
ibv_open_device@IBVERBS_1.0 1.1.6
|
||||
ibv_open_device@IBVERBS_1.1 1.1.6
|
||||
ibv_port_state_str@IBVERBS_1.1 1.1.6
|
||||
ibv_query_device@IBVERBS_1.0 1.1.6
|
||||
ibv_query_device@IBVERBS_1.1 1.1.6
|
||||
ibv_query_gid@IBVERBS_1.0 1.1.6
|
||||
ibv_query_gid@IBVERBS_1.1 1.1.6
|
||||
ibv_query_pkey@IBVERBS_1.0 1.1.6
|
||||
ibv_query_pkey@IBVERBS_1.1 1.1.6
|
||||
ibv_query_port@IBVERBS_1.0 1.1.6
|
||||
ibv_query_port@IBVERBS_1.1 1.1.6
|
||||
ibv_query_qp@IBVERBS_1.0 1.1.6
|
||||
ibv_query_qp@IBVERBS_1.1 1.1.6
|
||||
ibv_query_srq@IBVERBS_1.0 1.1.6
|
||||
ibv_query_srq@IBVERBS_1.1 1.1.6
|
||||
ibv_rate_to_mbps@IBVERBS_1.1 1.1.8
|
||||
ibv_rate_to_mult@IBVERBS_1.0 1.1.6
|
||||
ibv_read_sysfs_file@IBVERBS_1.0 1.1.6
|
||||
ibv_reg_mr@IBVERBS_1.0 1.1.6
|
||||
ibv_reg_mr@IBVERBS_1.1 1.1.6
|
||||
ibv_register_driver@IBVERBS_1.1 1.1.6
|
||||
ibv_rereg_mr@IBVERBS_1.1 1.2.1
|
||||
ibv_resize_cq@IBVERBS_1.0 1.1.6
|
||||
ibv_resize_cq@IBVERBS_1.1 1.1.6
|
||||
ibv_resolve_eth_l2_from_gid@IBVERBS_1.1 1.2.0
|
||||
ibv_wc_status_str@IBVERBS_1.1 1.1.6
|
||||
mbps_to_ibv_rate@IBVERBS_1.1 1.1.8
|
||||
mult_to_ibv_rate@IBVERBS_1.0 1.1.6
|
|
@ -1,57 +0,0 @@
|
|||
usr/include/infiniband/ib.h
|
||||
usr/include/rdma/rdma_cma.h
|
||||
usr/include/rdma/rdma_cma_abi.h
|
||||
usr/include/rdma/rdma_verbs.h
|
||||
usr/include/rdma/rsocket.h
|
||||
usr/lib/*/librdmacm*.so
|
||||
usr/share/man/man3/rdma_accept.3
|
||||
usr/share/man/man3/rdma_ack_cm_event.3
|
||||
usr/share/man/man3/rdma_bind_addr.3
|
||||
usr/share/man/man3/rdma_connect.3
|
||||
usr/share/man/man3/rdma_create_ep.3
|
||||
usr/share/man/man3/rdma_create_event_channel.3
|
||||
usr/share/man/man3/rdma_create_id.3
|
||||
usr/share/man/man3/rdma_create_qp.3
|
||||
usr/share/man/man3/rdma_create_srq.3
|
||||
usr/share/man/man3/rdma_dereg_mr.3
|
||||
usr/share/man/man3/rdma_destroy_ep.3
|
||||
usr/share/man/man3/rdma_destroy_event_channel.3
|
||||
usr/share/man/man3/rdma_destroy_id.3
|
||||
usr/share/man/man3/rdma_destroy_qp.3
|
||||
usr/share/man/man3/rdma_destroy_srq.3
|
||||
usr/share/man/man3/rdma_disconnect.3
|
||||
usr/share/man/man3/rdma_event_str.3
|
||||
usr/share/man/man3/rdma_free_devices.3
|
||||
usr/share/man/man3/rdma_get_cm_event.3
|
||||
usr/share/man/man3/rdma_get_devices.3
|
||||
usr/share/man/man3/rdma_get_dst_port.3
|
||||
usr/share/man/man3/rdma_get_local_addr.3
|
||||
usr/share/man/man3/rdma_get_peer_addr.3
|
||||
usr/share/man/man3/rdma_get_recv_comp.3
|
||||
usr/share/man/man3/rdma_get_request.3
|
||||
usr/share/man/man3/rdma_get_send_comp.3
|
||||
usr/share/man/man3/rdma_get_src_port.3
|
||||
usr/share/man/man3/rdma_getaddrinfo.3
|
||||
usr/share/man/man3/rdma_join_multicast.3
|
||||
usr/share/man/man3/rdma_leave_multicast.3
|
||||
usr/share/man/man3/rdma_listen.3
|
||||
usr/share/man/man3/rdma_migrate_id.3
|
||||
usr/share/man/man3/rdma_notify.3
|
||||
usr/share/man/man3/rdma_post_read.3
|
||||
usr/share/man/man3/rdma_post_readv.3
|
||||
usr/share/man/man3/rdma_post_recv.3
|
||||
usr/share/man/man3/rdma_post_recvv.3
|
||||
usr/share/man/man3/rdma_post_send.3
|
||||
usr/share/man/man3/rdma_post_sendv.3
|
||||
usr/share/man/man3/rdma_post_ud_send.3
|
||||
usr/share/man/man3/rdma_post_write.3
|
||||
usr/share/man/man3/rdma_post_writev.3
|
||||
usr/share/man/man3/rdma_reg_msgs.3
|
||||
usr/share/man/man3/rdma_reg_read.3
|
||||
usr/share/man/man3/rdma_reg_write.3
|
||||
usr/share/man/man3/rdma_reject.3
|
||||
usr/share/man/man3/rdma_resolve_addr.3
|
||||
usr/share/man/man3/rdma_resolve_route.3
|
||||
usr/share/man/man3/rdma_set_option.3
|
||||
usr/share/man/man7/rdma_cm.7
|
||||
usr/share/man/man7/rsocket.7
|
|
@ -1,3 +0,0 @@
|
|||
usr/lib/*/librdmacm*.so.*
|
||||
usr/lib/*/rsocket/librspreload*.so*
|
||||
usr/share/doc/rdma-core/librdmacm.md usr/share/doc/librdmacm1/
|
|
@ -1,64 +0,0 @@
|
|||
librdmacm.so.1 librdmacm1 #MINVER#
|
||||
RDMACM_1.0@RDMACM_1.0 1.0.15
|
||||
raccept@RDMACM_1.0 1.0.16
|
||||
rbind@RDMACM_1.0 1.0.16
|
||||
rclose@RDMACM_1.0 1.0.16
|
||||
rconnect@RDMACM_1.0 1.0.16
|
||||
rdma_accept@RDMACM_1.0 1.0.15
|
||||
rdma_ack_cm_event@RDMACM_1.0 1.0.15
|
||||
rdma_bind_addr@RDMACM_1.0 1.0.15
|
||||
rdma_connect@RDMACM_1.0 1.0.15
|
||||
rdma_create_ep@RDMACM_1.0 1.0.15
|
||||
rdma_create_event_channel@RDMACM_1.0 1.0.15
|
||||
rdma_create_id@RDMACM_1.0 1.0.15
|
||||
rdma_create_qp@RDMACM_1.0 1.0.15
|
||||
rdma_create_qp_ex@RDMACM_1.0 1.0.19
|
||||
rdma_create_srq@RDMACM_1.0 1.0.15
|
||||
rdma_create_srq_ex@RDMACM_1.0 1.0.19
|
||||
rdma_destroy_ep@RDMACM_1.0 1.0.15
|
||||
rdma_destroy_event_channel@RDMACM_1.0 1.0.15
|
||||
rdma_destroy_id@RDMACM_1.0 1.0.15
|
||||
rdma_destroy_qp@RDMACM_1.0 1.0.15
|
||||
rdma_destroy_srq@RDMACM_1.0 1.0.15
|
||||
rdma_disconnect@RDMACM_1.0 1.0.15
|
||||
rdma_event_str@RDMACM_1.0 1.0.15
|
||||
rdma_free_devices@RDMACM_1.0 1.0.15
|
||||
rdma_freeaddrinfo@RDMACM_1.0 1.0.15
|
||||
rdma_get_cm_event@RDMACM_1.0 1.0.15
|
||||
rdma_get_devices@RDMACM_1.0 1.0.15
|
||||
rdma_get_dst_port@RDMACM_1.0 1.0.19
|
||||
rdma_get_request@RDMACM_1.0 1.0.15
|
||||
rdma_get_src_port@RDMACM_1.0 1.0.19
|
||||
rdma_getaddrinfo@RDMACM_1.0 1.0.15
|
||||
rdma_join_multicast@RDMACM_1.0 1.0.15
|
||||
rdma_leave_multicast@RDMACM_1.0 1.0.15
|
||||
rdma_listen@RDMACM_1.0 1.0.15
|
||||
rdma_migrate_id@RDMACM_1.0 1.0.15
|
||||
rdma_notify@RDMACM_1.0 1.0.15
|
||||
rdma_reject@RDMACM_1.0 1.0.15
|
||||
rdma_resolve_addr@RDMACM_1.0 1.0.15
|
||||
rdma_resolve_route@RDMACM_1.0 1.0.15
|
||||
rdma_set_option@RDMACM_1.0 1.0.15
|
||||
rfcntl@RDMACM_1.0 1.0.16
|
||||
rgetpeername@RDMACM_1.0 1.0.16
|
||||
rgetsockname@RDMACM_1.0 1.0.16
|
||||
rgetsockopt@RDMACM_1.0 1.0.16
|
||||
riomap@RDMACM_1.0 1.0.19
|
||||
riounmap@RDMACM_1.0 1.0.19
|
||||
riowrite@RDMACM_1.0 1.0.19
|
||||
rlisten@RDMACM_1.0 1.0.16
|
||||
rpoll@RDMACM_1.0 1.0.16
|
||||
rread@RDMACM_1.0 1.0.16
|
||||
rreadv@RDMACM_1.0 1.0.16
|
||||
rrecv@RDMACM_1.0 1.0.16
|
||||
rrecvfrom@RDMACM_1.0 1.0.16
|
||||
rrecvmsg@RDMACM_1.0 1.0.16
|
||||
rselect@RDMACM_1.0 1.0.16
|
||||
rsend@RDMACM_1.0 1.0.16
|
||||
rsendmsg@RDMACM_1.0 1.0.16
|
||||
rsendto@RDMACM_1.0 1.0.16
|
||||
rsetsockopt@RDMACM_1.0 1.0.16
|
||||
rshutdown@RDMACM_1.0 1.0.16
|
||||
rsocket@RDMACM_1.0 1.0.16
|
||||
rwrite@RDMACM_1.0 1.0.16
|
||||
rwritev@RDMACM_1.0 1.0.16
|
|
@ -1,34 +0,0 @@
|
|||
etc/init.d/iwpmd
|
||||
etc/iwpmd.conf
|
||||
etc/modprobe.d/mlx4.conf
|
||||
etc/modprobe.d/truescale.conf
|
||||
etc/rdma/modules/infiniband.conf
|
||||
etc/rdma/modules/iwarp.conf
|
||||
etc/rdma/modules/iwpmd.conf
|
||||
etc/rdma/modules/opa.conf
|
||||
etc/rdma/modules/rdma.conf
|
||||
etc/rdma/modules/roce.conf
|
||||
etc/udev/rules.d/70-persistent-ipoib.rules
|
||||
lib/systemd/system/iwpmd.service
|
||||
lib/systemd/system/rdma-hw.target
|
||||
lib/systemd/system/rdma-load-modules@.service
|
||||
lib/systemd/system/rdma-ndd.service
|
||||
lib/udev/rules.d/60-rdma-ndd.rules
|
||||
lib/udev/rules.d/75-rdma-description.rules
|
||||
lib/udev/rules.d/90-iwpmd.rules
|
||||
lib/udev/rules.d/90-rdma-hw-modules.rules
|
||||
lib/udev/rules.d/90-rdma-ulp-modules.rules
|
||||
lib/udev/rules.d/90-rdma-umad.rules
|
||||
usr/bin/rxe_cfg
|
||||
usr/lib/truescale-serdes.cmds
|
||||
usr/sbin/iwpmd
|
||||
usr/sbin/rdma-ndd
|
||||
usr/share/doc/rdma-core/MAINTAINERS
|
||||
usr/share/doc/rdma-core/README.md
|
||||
usr/share/doc/rdma-core/rxe.md
|
||||
usr/share/doc/rdma-core/udev.md
|
||||
usr/share/man/man5/iwpmd.conf.5
|
||||
usr/share/man/man7/rxe.7
|
||||
usr/share/man/man8/iwpmd.8
|
||||
usr/share/man/man8/rdma-ndd.8
|
||||
usr/share/man/man8/rxe_cfg.8
|
|
@ -1,5 +0,0 @@
|
|||
# The rdma-ndd service is started by udev.
|
||||
rdma-core: systemd-service-file-missing-install-key lib/systemd/system/iwpmd.service
|
||||
rdma-core: systemd-service-file-missing-install-key lib/systemd/system/rdma-ndd.service
|
||||
# Example/documentary udev rules file
|
||||
rdma-core: udev-rule-in-etc etc/udev/rules.d/70-persistent-ipoib.rules
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
if [ "$1" = "configure" ]; then
|
||||
# we ship udev rules, so trigger an update. This has to be done after
|
||||
# DEBHELPER restarts systemd to get our new service files loaded.
|
||||
udevadm trigger --subsystem-match=infiniband --action=change || true
|
||||
udevadm trigger --subsystem-match=net --action=change || true
|
||||
udevadm trigger --subsystem-match=infiniband_mad --action=change || true
|
||||
fi
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue