Commit c796c547 authored by Pawel Wodkowski's avatar Pawel Wodkowski Committed by Jim Harris
Browse files

configure: detect IBV_WR_SEND_WITH_INV instead checking version



Checking version of libibverbs is error prone as custom version might be
installed that implements needed features but version number is not
incremented. Instead test if we can compile with needed features.

Fixes #524

Change-Id: I18e9ca923eea92b124e95a5f660955a01afad5c4
Signed-off-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443387


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 06ccc49e
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -359,20 +359,9 @@ fi

if [ "${CONFIG[RDMA]}" = "y" ]; then
	if [ "$OSTYPE" != "FreeBSD"* ]; then
		ibv_lib_file="$(ldconfig -p | grep 'libibverbs.so ' || true)"
		if [ ! -z "$ibv_lib_file" ]; then
			ibv_lib_file="${ibv_lib_file##*=> }"
			ibv_lib_file="$(readlink -f $ibv_lib_file)" || true
		fi

		if [ -z $ibv_lib_file ]; then
			ibv_lib_file="libibverbs.so.0.0.0"
		fi

		ibv_ver_str="$(basename $ibv_lib_file)"
		ibv_maj_ver=`echo $ibv_ver_str | cut -d. -f3`
		ibv_min_ver=`echo $ibv_ver_str | cut -d. -f4`
		if [[ "$ibv_maj_var" -gt 1 || ("$ibv_maj_ver" -eq 1 && "$ibv_min_ver" -ge 1) ]]; then
		if echo -e '#include <infiniband/verbs.h>\n \
			int main(void){ return !!IBV_WR_SEND_WITH_INV; }\n' \
			| ${CC:-cc} ${CFLAGS} -x c -c -o /dev/null - 2>/dev/null; then
			CONFIG[RDMA_SEND_WITH_INVAL]="y"
		else
			CONFIG[RDMA_SEND_WITH_INVAL]="n"