Commit 956deb0f authored by Sergey Gorenko's avatar Sergey Gorenko Committed by Oleg Drokin
Browse files

LU-13761 o2ib: Fix compilation with MOFED 5.1



A new argument was added to rdma_reject() in MOFED 5.1 and
Linux 5.8.

Add a cofigure check and support both versions of rdma_reject().

Test-Parameters: trivial
Signed-off-by: default avatarSergey Gorenko <sergeygo@mellanox.com>
Change-Id: I2b28991f335658b651b21a09899b7b17ab2a9d57
Reviewed-on: https://review.whamcloud.com/39323

Reviewed-by: default avatarNeil Brown <neilb@suse.de>
Reviewed-by: default avatarAlexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
parent b8faae37
......@@ -522,6 +522,29 @@ AS_IF([test $ENABLEO2IB != "no"], [
# 5.1
LN_IB_SG_DMA_ADDRESS_EXISTS
# A reason argument was added to rdma_reject() in Linux 5.8,
# commit 8094ba0ace7f6cd1e31ea8b151fba3594cadfa9a
LB_CHECK_COMPILE([if 4arg 'rdma_reject' exists],
rdma_reject, [
#ifdef HAVE_COMPAT_RDMA
#undef PACKAGE_NAME
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_STRING
#undef PACKAGE_BUGREPORT
#undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <rdma/ib_verbs.h>
#include <rdma/ib_cm.h>
#include <rdma/rdma_cm.h>
],[
rdma_reject(NULL, NULL, 0, 0);
],[
AC_DEFINE(HAVE_RDMA_REJECT_4ARGS, 1,
[rdma_reject has 4 arguments])
])
EXTRA_CHECK_INCLUDE=""
AC_DEFUN([LN_CONFIG_O2IB_SRC], [])
AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [])
......
......@@ -2293,7 +2293,11 @@ kiblnd_reject(struct rdma_cm_id *cmid, struct kib_rej *rej)
{
int rc;
#ifdef HAVE_RDMA_REJECT_4ARGS
rc = rdma_reject(cmid, rej, sizeof(*rej), IB_CM_REJ_CONSUMER_DEFINED);
#else
rc = rdma_reject(cmid, rej, sizeof(*rej));
#endif
if (rc != 0)
CWARN("Error %d sending reject\n", rc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment