mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 19:21:26 +00:00
isert-scst: Fix CentOS 7.3 build
This commit is contained in:
@@ -114,8 +114,38 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
CREATE_CQ_FLAG = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/create_cq PRE_CFLAGS="$(OFED_CFLAGS) -Werror" >/dev/null 2>&1 && echo -DIB_CREATE_CQ_HAS_INIT_ATTR)
|
||||
PRE_CFLAGS=$(OFED_CFLAGS) $(CREATE_CQ_FLAG) -DOFED_FLAVOR=$(OFED_FLAVOR)
|
||||
GOALS:=$(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)
|
||||
OTHER_GOALS:=$(foreach goal,$(MAKECMDGOALS),$(subst all,,$(goal)))
|
||||
# echo:=$(shell echo 'GOALS = $(GOALS)' >&2)
|
||||
# echo:=$(shell echo 'OTHER_GOALS = $(OTHER_GOALS)' >&2)
|
||||
ifneq ("$(GOALS)","$(OTHER_GOALS)")
|
||||
run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if $(MAKE) -C $(KDIR) V=$(V) SUBDIRS="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" 1>&2 2>$${output}; then echo "$2"; else echo "$3"; fi)
|
||||
USE_PRE_440_WR_STRUCTURE := $(call run_conftest,use_pre_440_wr_structure,-DUSE_PRE_440_WR_STRUCTURE)
|
||||
CREATE_CQ_FLAG := $(call run_conftest,create_cq,-DIB_CREATE_CQ_HAS_INIT_ATTR)
|
||||
CLIENT_REMOVE := $(call run_conftest,ib_client_remove,-DIB_CLIENT_REMOVE_TAKES_TWO_ARGS)
|
||||
HAVE_IB_DMA_MAP_OPS := $(call run_conftest,ib_dma_map_ops,-DHAVE_IB_DMA_MAP_OPS)
|
||||
HAVE_IB_SET_CPI_RESP_TIME := $(call run_conftest,ib_set_cpi_resp_time,-DHAVE_IB_SET_CPI_RESP_TIME)
|
||||
GID_CHANGE_FLAG := $(call run_conftest,gid_change,-DHAVE_IB_EVENT_GID_CHANGE)
|
||||
PD_HAS_LOCAL_DMA_LKEY := $(call run_conftest,pd_has_local_dma_lkey,-DIB_PD_HAS_LOCAL_DMA_LKEY)
|
||||
RDMA_CREATE_ID := $(call run_conftest,rdma_create_id_net,-DRDMA_CREATE_ID_TAKES_NET_ARG=1,-DRDMA_CREATE_ID_TAKES_NET_ARG=0)
|
||||
QUERY_DEVICE := $(call run_conftest,query_device,-DHAVE_IB_QUERY_DEVICE)
|
||||
QUERY_DEVICE_HAS_ATTR_ARG := $(call run_conftest,query_device_attr_arg,-DIB_QUERY_DEVICE_HAS_ATTR_ARG)
|
||||
QUERY_GID_FLAG := $(call run_conftest,query_gid,-DIB_QUERY_GID_HAS_ATTR_ARG)
|
||||
PRE_CFLAGS=$(OFED_CFLAGS) \
|
||||
$(USE_PRE_440_WR_STRUCTURE) \
|
||||
$(CLIENT_REMOVE) \
|
||||
$(CREATE_CQ_FLAG) \
|
||||
$(IB_CLIENT_REMOVE_TAKES_TWO_ARGS) \
|
||||
$(HAVE_IB_DMA_MAP_OPS) \
|
||||
$(HAVE_IB_SET_CPI_RESP_TIME) \
|
||||
$(GID_CHANGE_FLAG) \
|
||||
$(PD_HAS_LOCAL_DMA_LKEY) \
|
||||
$(RDMA_CREATE_ID) \
|
||||
$(QUERY_GID_FLAG) \
|
||||
$(QUERY_DEVICE) \
|
||||
$(QUERY_DEVICE_HAS_ATTR_ARG) \
|
||||
-DOFED_FLAVOR=$(OFED_FLAVOR)
|
||||
endif
|
||||
|
||||
mods: include/iscsi_scst_itf_ver.h Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(KMOD) modules
|
||||
|
||||
3
iscsi-scst/conftest/cm_listen/Makefile
Normal file
3
iscsi-scst/conftest/cm_listen/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += cm_listen.o
|
||||
9
iscsi-scst/conftest/cm_listen/cm_listen.c
Normal file
9
iscsi-scst/conftest/cm_listen/cm_listen.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_cm.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return ib_cm_listen(NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/create_send_mad_ah/Makefile
Normal file
3
iscsi-scst/conftest/create_send_mad_ah/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += create_send_mad_ah.o
|
||||
13
iscsi-scst/conftest/create_send_mad_ah/create_send_mad_ah.c
Normal file
13
iscsi-scst/conftest/create_send_mad_ah/create_send_mad_ah.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_mad_send_buf *b;
|
||||
|
||||
b = ib_create_send_mad(NULL, 0, 0, NULL, 0, 0, 0, 0);
|
||||
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/create_send_mad_base/Makefile
Normal file
3
iscsi-scst/conftest/create_send_mad_base/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += create_send_mad_base.o
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_mad_send_buf *b;
|
||||
|
||||
b = ib_create_send_mad(NULL, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/gid_change/Makefile
Normal file
3
iscsi-scst/conftest/gid_change/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += gid_change.o
|
||||
9
iscsi-scst/conftest/gid_change/gid_change.c
Normal file
9
iscsi-scst/conftest/gid_change/gid_change.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return IB_EVENT_GID_CHANGE;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/ib_client_remove/Makefile
Normal file
3
iscsi-scst/conftest/ib_client_remove/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += ib_client_remove.o
|
||||
15
iscsi-scst/conftest/ib_client_remove/ib_client_remove.c
Normal file
15
iscsi-scst/conftest/ib_client_remove/ib_client_remove.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static void client_remove(struct ib_device *dev, void *client_data)
|
||||
{
|
||||
}
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_client c = { .remove = client_remove };
|
||||
|
||||
return (uintptr_t)c.remove;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/ib_dma_map_ops/Makefile
Normal file
3
iscsi-scst/conftest/ib_dma_map_ops/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += ib_dma_map_ops.o
|
||||
11
iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c
Normal file
11
iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static struct ib_device *dev;
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return dev->dma_ops != NULL;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/ib_set_cpi_resp_time/Makefile
Normal file
3
iscsi-scst/conftest/ib_set_cpi_resp_time/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += ib_set_cpi_resp_time.o
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return (uintptr_t)ib_set_cpi_resp_time;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/mad_handler_takes_send_buf/Makefile
Normal file
3
iscsi-scst/conftest/mad_handler_takes_send_buf/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += mad_handler_takes_send_buf.o
|
||||
@@ -0,0 +1,17 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
static void imrh(struct ib_mad_agent *mad_agent,
|
||||
struct ib_mad_send_buf *send_buf,
|
||||
struct ib_mad_recv_wc *mad_recv_wc)
|
||||
{
|
||||
}
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
ib_mad_recv_handler h = imrh;
|
||||
|
||||
return !!h;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/pd_has_local_dma_lkey/Makefile
Normal file
3
iscsi-scst/conftest/pd_has_local_dma_lkey/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += pd_has_local_dma_lkey.o
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return offsetof(struct ib_pd, local_dma_lkey);
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/query_device/Makefile
Normal file
3
iscsi-scst/conftest/query_device/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += query_device.o
|
||||
9
iscsi-scst/conftest/query_device/query_device.c
Normal file
9
iscsi-scst/conftest/query_device/query_device.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return (uintptr_t)ib_query_device;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/query_device_attr_arg/Makefile
Normal file
3
iscsi-scst/conftest/query_device_attr_arg/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += query_device_attr_arg.o
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return ib_query_device(NULL, NULL);
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/query_gid/Makefile
Normal file
3
iscsi-scst/conftest/query_gid/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += query_gid.o
|
||||
9
iscsi-scst/conftest/query_gid/query_gid.c
Normal file
9
iscsi-scst/conftest/query_gid/query_gid.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return ib_query_gid(NULL, 0, 0, NULL, NULL);
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/rdma_create_id_net/Makefile
Normal file
3
iscsi-scst/conftest/rdma_create_id_net/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += rdma_create_id_net.o
|
||||
10
iscsi-scst/conftest/rdma_create_id_net/rdma_create_id_net.c
Normal file
10
iscsi-scst/conftest/rdma_create_id_net/rdma_create_id_net.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/rdma_cm.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return rdma_create_id(NULL, NULL, NULL, 0, 0) != NULL;
|
||||
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/register_mad_agent/Makefile
Normal file
3
iscsi-scst/conftest/register_mad_agent/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += register_mad_agent.o
|
||||
13
iscsi-scst/conftest/register_mad_agent/register_mad_agent.c
Normal file
13
iscsi-scst/conftest/register_mad_agent/register_mad_agent.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_mad_agent *a;
|
||||
|
||||
a = ib_register_mad_agent(NULL, 0, 0, NULL, 0, NULL, NULL, NULL, 0);
|
||||
|
||||
return a != 0;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
iscsi-scst/conftest/use_pre_440_wr_structure/Makefile
Normal file
3
iscsi-scst/conftest/use_pre_440_wr_structure/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += use_pre_440_wr_structure.o
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_send_wr wr = { };
|
||||
|
||||
return wr.wr.rdma.rkey;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
@@ -99,7 +99,7 @@ struct isert_wr {
|
||||
struct ib_sge *sge_list;
|
||||
union {
|
||||
struct ib_recv_wr recv_wr;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
struct ib_send_wr send_wr;
|
||||
#else
|
||||
struct ib_rdma_wr send_wr;
|
||||
@@ -233,7 +233,7 @@ struct isert_connection {
|
||||
struct isert_device {
|
||||
struct ib_device *ib_dev;
|
||||
struct ib_pd *pd;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
||||
#ifndef IB_PD_HAS_LOCAL_DMA_LKEY
|
||||
struct ib_mr *mr;
|
||||
#endif
|
||||
u32 lkey;
|
||||
|
||||
@@ -238,7 +238,7 @@ int isert_wr_init(struct isert_wr *wr,
|
||||
buff_offset = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
wr->send_wr.wr.rdma.remote_addr = pdu->rem_write_va +
|
||||
buff_offset;
|
||||
wr->send_wr.wr.rdma.rkey = pdu->rem_write_stag;
|
||||
@@ -255,7 +255,7 @@ int isert_wr_init(struct isert_wr *wr,
|
||||
buff_offset = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
wr->send_wr.wr.rdma.remote_addr = pdu->rem_read_va +
|
||||
buff_offset;
|
||||
wr->send_wr.wr.rdma.rkey = pdu->rem_read_stag;
|
||||
@@ -288,7 +288,7 @@ int isert_wr_init(struct isert_wr *wr,
|
||||
wr->recv_wr.sg_list = wr->sge_list;
|
||||
wr->recv_wr.num_sge = sg_cnt;
|
||||
} else {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
wr->send_wr.next = NULL;
|
||||
wr->send_wr.wr_id = _ptr_to_u64(wr);
|
||||
wr->send_wr.sg_list = wr->sge_list;
|
||||
|
||||
@@ -214,7 +214,7 @@ out:
|
||||
static inline void isert_link_send_wrs(struct isert_wr *from_wr,
|
||||
struct isert_wr *to_wr)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
from_wr->send_wr.next = &to_wr->send_wr;
|
||||
#else
|
||||
from_wr->send_wr.wr.next = &to_wr->send_wr.wr;
|
||||
@@ -226,7 +226,7 @@ static inline void isert_link_send_pdu_wrs(struct isert_cmnd *from_pdu,
|
||||
int wr_cnt)
|
||||
{
|
||||
isert_link_send_wrs(&from_pdu->wr[wr_cnt - 1], &to_pdu->wr[0]);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
to_pdu->wr[0].send_wr.next = NULL;
|
||||
#else
|
||||
to_pdu->wr[0].send_wr.wr.next = NULL;
|
||||
@@ -289,7 +289,7 @@ int isert_prepare_rdma(struct isert_cmnd *isert_pdu,
|
||||
isert_link_send_wrs(&isert_pdu->wr[i - 1], &isert_pdu->wr[i]);
|
||||
|
||||
if (op == ISER_WR_RDMA_READ) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
isert_pdu->wr[wr_cnt - 1].send_wr.send_flags = IB_SEND_SIGNALED;
|
||||
isert_pdu->wr[wr_cnt - 1].send_wr.next = NULL;
|
||||
#else
|
||||
@@ -588,7 +588,7 @@ int isert_pdu_send(struct isert_connection *isert_conn,
|
||||
#endif
|
||||
|
||||
wr = &tx_pdu->wr[0];
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
wr->send_wr.num_sge = isert_pdu_prepare_send(isert_conn, tx_pdu);
|
||||
#else
|
||||
wr->send_wr.wr.num_sge = isert_pdu_prepare_send(isert_conn, tx_pdu);
|
||||
@@ -613,7 +613,7 @@ int isert_pdu_post_rdma_write(struct isert_connection *isert_conn,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
isert_rsp->wr[0].send_wr.num_sge = isert_pdu_prepare_send(isert_conn,
|
||||
isert_rsp);
|
||||
#else
|
||||
|
||||
@@ -111,7 +111,7 @@ int isert_post_send(struct isert_connection *isert_conn,
|
||||
struct isert_wr *first_wr,
|
||||
int num_wr)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
struct ib_send_wr *first_ib_wr = &first_wr->send_wr;
|
||||
#else
|
||||
struct ib_send_wr *first_ib_wr = &first_wr->send_wr.wr;
|
||||
@@ -150,7 +150,7 @@ static void isert_post_drain_sq(struct isert_connection *isert_conn)
|
||||
|
||||
isert_wr_set_fields(drain_wr_sq, isert_conn, NULL);
|
||||
drain_wr_sq->wr_op = ISER_WR_SEND;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
drain_wr_sq->send_wr.wr_id = _ptr_to_u64(drain_wr_sq);
|
||||
drain_wr_sq->send_wr.opcode = IB_WR_SEND;
|
||||
err = ib_post_send(isert_conn->qp,
|
||||
@@ -704,7 +704,7 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
|
||||
switch (wr->wr_op) {
|
||||
case ISER_WR_SEND:
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef USE_PRE_440_WR_STRUCTURE
|
||||
num_sge = wr->send_wr.num_sge;
|
||||
#else
|
||||
num_sge = wr->send_wr.wr.num_sge;
|
||||
@@ -951,7 +951,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
struct isert_device *isert_dev;
|
||||
int cqe_num, err;
|
||||
struct ib_pd *pd;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
||||
#ifndef IB_PD_HAS_LOCAL_DMA_LKEY
|
||||
struct ib_mr *mr;
|
||||
#endif
|
||||
struct ib_cq *cq;
|
||||
@@ -967,7 +967,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) || defined(MOFED_MAJOR)
|
||||
#ifdef HAVE_IB_QUERY_DEVICE
|
||||
err = ib_query_device(ib_dev, &isert_dev->device_attr);
|
||||
if (unlikely(err)) {
|
||||
PRINT_ERROR("Failed to query device, err: %d", err);
|
||||
@@ -1005,7 +1005,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
goto fail_pd;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
||||
#ifndef IB_PD_HAS_LOCAL_DMA_LKEY
|
||||
mr = ib_get_dma_mr(pd, IB_ACCESS_LOCAL_WRITE);
|
||||
if (unlikely(IS_ERR(mr))) {
|
||||
err = PTR_ERR(mr);
|
||||
@@ -1054,8 +1054,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
goto fail_cq;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) || defined(MOFED_MAJOR)) && \
|
||||
!defined(IB_CREATE_CQ_HAS_INIT_ATTR)
|
||||
#ifndef IB_CREATE_CQ_HAS_INIT_ATTR
|
||||
cq = ib_create_cq(ib_dev,
|
||||
isert_cq_comp_handler,
|
||||
isert_async_evt_handler,
|
||||
@@ -1095,7 +1094,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
|
||||
isert_dev->ib_dev = ib_dev;
|
||||
isert_dev->pd = pd;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
||||
#ifndef IB_PD_HAS_LOCAL_DMA_LKEY
|
||||
isert_dev->mr = mr;
|
||||
isert_dev->lkey = mr->lkey;
|
||||
#else
|
||||
@@ -1118,7 +1117,7 @@ fail_cq:
|
||||
if (isert_dev->cq_desc[j].cq_workqueue)
|
||||
destroy_workqueue(isert_dev->cq_desc[j].cq_workqueue);
|
||||
}
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
||||
#ifndef IB_PD_HAS_LOCAL_DMA_LKEY
|
||||
ib_dereg_mr(mr);
|
||||
fail_mr:
|
||||
#endif
|
||||
@@ -1164,7 +1163,7 @@ static void isert_device_release(struct isert_device *isert_dev)
|
||||
destroy_workqueue(cq_desc->cq_workqueue);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
||||
#ifndef IB_PD_HAS_LOCAL_DMA_LKEY
|
||||
err = ib_dereg_mr(isert_dev->mr);
|
||||
if (unlikely(err))
|
||||
PRINT_ERROR("Failed to destroy mr, err:%d", err);
|
||||
@@ -1796,7 +1795,7 @@ struct isert_portal *isert_portal_create(void)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 <= 5)
|
||||
cm_id = rdma_create_id(isert_cm_evt_handler, portal, RDMA_PS_TCP);
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || defined(MOFED_MAJOR)
|
||||
#elif !RDMA_CREATE_ID_TAKES_NET_ARG
|
||||
cm_id = rdma_create_id(isert_cm_evt_handler, portal, RDMA_PS_TCP,
|
||||
IB_QPT_RC);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user