From f09274f3651b8a93c18fc1cac7486f4cfb1faf5c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 7 Dec 2016 23:52:41 +0000 Subject: [PATCH 01/30] ib_srpt: Simplify a debug statement It is likely that ib_device.dma_ops will be removed sooner or later. Hence make sure that the ib_srpt driver does not depend on it. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7049 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index d3384758d..52a66b8bf 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -4336,7 +4336,7 @@ static void srpt_add_one(struct ib_device *device) struct ib_srq_init_attr srq_attr; int i, ret; - pr_debug("device = %p, device->dma_ops = %p\n", device, device->dma_ops); + pr_debug("device = %p\n", device); sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); if (!sdev) From 3749ca972b08e40f28239e413442a78d7b76c878 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 14 Dec 2016 12:31:23 +0000 Subject: [PATCH 02/30] ib_srpt: Create QP on the RDMA port the initiator logged in to git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7050 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 52a66b8bf..2d4f7340a 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2267,6 +2267,7 @@ retry: sdev->dev_attr.max_sge - max_sge_delta)); qp_init->cap.max_send_sge = ch->max_sge; qp_init->cap.max_recv_sge = ch->max_sge; + qp_init->port_num = ch->sport->port; if (sdev->use_srq) { qp_init->srq = sdev->srq; } else { From 55b7684bb7bdf1e80e3bc118aecfd32e7e7fad04 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 16 Dec 2016 02:46:49 +0000 Subject: [PATCH 03/30] fileio_tgt: avoid warnings about casting between pointers and integers of different size git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7053 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- usr/fileio/common.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr/fileio/common.c b/usr/fileio/common.c index 8d0f1b9c8..d40caafbf 100644 --- a/usr/fileio/common.c +++ b/usr/fileio/common.c @@ -809,7 +809,7 @@ void *main_loop(void *arg) pl.events = POLLIN; cmd.preply = 0; - multi.multi_cmd.preplies = (uint64_t)&multi.replies[0]; + multi.multi_cmd.preplies = (uintptr_t)&multi.replies[0]; multi.multi_cmd.replies_cnt = 0; multi.multi_cmd.cmds_cnt = MULTI_CMDS_CNT; @@ -829,7 +829,7 @@ void *main_loop(void *arg) if (use_multi) { TRACE_DBG("preplies %p (first: %p), replies_cnt %d, " - "replies_done %d, cmds_cnt %d", (void *)multi.multi_cmd.preplies, + "replies_done %d, cmds_cnt %d", (void *)(uintptr_t)multi.multi_cmd.preplies, &multi.replies[0], multi.multi_cmd.replies_cnt, multi.multi_cmd.replies_done, multi.multi_cmd.cmds_cnt); res = ioctl(scst_usr_fd, SCST_USER_REPLY_AND_GET_MULTI, &multi.multi_cmd); @@ -842,7 +842,7 @@ void *main_loop(void *arg) case EBUSY: TRACE_MGMT_DBG("SCST_USER returned %d (%s)", res, strerror(res)); cmd.preply = 0; - multi.multi_cmd.preplies = (uint64_t)&multi.replies[0]; + multi.multi_cmd.preplies = (uintptr_t)&multi.replies[0]; multi.multi_cmd.replies_cnt = 0; multi.multi_cmd.cmds_cnt = MULTI_CMDS_CNT; case EINTR: @@ -850,7 +850,7 @@ void *main_loop(void *arg) case EAGAIN: TRACE_DBG("SCST_USER returned EAGAIN (%d)", res); cmd.preply = 0; - multi.multi_cmd.preplies = (uint64_t)&multi.replies[0]; + multi.multi_cmd.preplies = (uintptr_t)&multi.replies[0]; multi.multi_cmd.replies_cnt = 0; multi.multi_cmd.cmds_cnt = MULTI_CMDS_CNT; if (dev->non_blocking) @@ -861,7 +861,7 @@ void *main_loop(void *arg) PRINT_ERROR("SCST_USER failed: %s (%d)", strerror(res), res); #if 1 cmd.preply = 0; - multi.multi_cmd.preplies = (uint64_t)&multi.replies[0]; + multi.multi_cmd.preplies = (uintptr_t)&multi.replies[0]; multi.multi_cmd.replies_cnt = 0; multi.multi_cmd.cmds_cnt = MULTI_CMDS_CNT; continue; @@ -900,13 +900,13 @@ again_poll: if (multi.multi_cmd.replies_done < multi.multi_cmd.replies_cnt) { TRACE_MGMT_DBG("replies_done %d < replies_cnt %d (dev %s)", multi.multi_cmd.replies_done, multi.multi_cmd.replies_cnt, dev->name); - multi.multi_cmd.preplies = (uint64_t)&multi.replies[multi.multi_cmd.replies_done]; + multi.multi_cmd.preplies = (uintptr_t)&multi.replies[multi.multi_cmd.replies_done]; multi.multi_cmd.replies_cnt = multi.multi_cmd.replies_cnt - multi.multi_cmd.replies_done; multi.multi_cmd.cmds_cnt = MULTI_CMDS_CNT; continue; } TRACE_DBG("cmds_cnt %d", multi.multi_cmd.cmds_cnt); - multi.multi_cmd.preplies = (uint64_t)&multi.replies[0]; + multi.multi_cmd.preplies = (uintptr_t)&multi.replies[0]; for (i = 0, j = 0; i < multi.multi_cmd.cmds_cnt; i++, j++) { vcmd.cmd = &multi.cmds[i]; vcmd.reply = &multi.replies[j]; From 53c0c00bf4c6a040c087b32273952d2e6bbe455a Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 16 Dec 2016 02:49:45 +0000 Subject: [PATCH 04/30] Add user space pieces to scst-dist-gzip. They now essential part of the distribution git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7054 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 104403592..ff8d4913f 100644 --- a/Makefile +++ b/Makefile @@ -419,7 +419,7 @@ scst-dist-gzip: else \ scripts/list-source-files; \ fi | \ - grep -E '^doc/|^fcst/|^iscsi-scst/|^Makefile|^qla2x00t(|_git)/|^scst.spec|^scst/|^scst_local/|^srpt/'|\ + grep -E '^doc/|^fcst/|^iscsi-scst/|^Makefile|^qla2x00t(|_git)/|^scst.spec|^scst/|^scst_local/|^srpt/|^usr/'|\ tar -T- -cf- | \ tar -C $${name}-$(VERSION) -xf-; \ } && \ From 4abce7a7f32db15e79873de72d3d35bacdedfc0f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 16 Dec 2016 03:03:59 +0000 Subject: [PATCH 05/30] Update SVN_TAGS for 3.2.0 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7059 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- SVN_TAGS | 1 + 1 file changed, 1 insertion(+) diff --git a/SVN_TAGS b/SVN_TAGS index 5666e0680..c4987e73d 100644 --- a/SVN_TAGS +++ b/SVN_TAGS @@ -22,3 +22,4 @@ SRPT 1.0.0 450 3.1.x branch start 6591, which is a copy of trunk r6590 3.1.0 6783 on the 3.1.x branch 3.2.x branch start 6925, which is a copy of trunk r6921 +3.2.0 7058 on the 3.2.x branch From b3e84925c42257cf1e59705414a4dbd9a0fd7464 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 16 Dec 2016 04:25:04 +0000 Subject: [PATCH 06/30] Web updates git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7060 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- www/downloads.html | 20 ++------------------ www/handler_fileio_tgt.html | 1 - www/scst_admin.html | 2 -- www/target_fcoe.html | 2 +- www/target_iscsi.html | 2 -- www/target_local.html | 2 +- www/target_qla2x00t.html | 2 +- www/target_srp.html | 1 - 8 files changed, 5 insertions(+), 27 deletions(-) diff --git a/www/downloads.html b/www/downloads.html index 940abb502..1c4d34ccd 100644 --- a/www/downloads.html +++ b/www/downloads.html @@ -35,8 +35,8 @@

SCST Downloads

-

The latest stable version of SCST is 3.1. The latest updates for it - you can find it in the SVN branch 3.1.x.

+

The latest stable version of SCST is 3.2. The latest updates for it + you can find it in the SVN branch 3.2.x.

You can also download prebuilt SCST modules for Scientific Linux CERN 5 (RHEL5-based), @@ -70,22 +70,6 @@ Unofficial git mirror

-
-

SCST Releases

-

scst

- -

scstadmin

- -

iscsi-scst

- -

qla2x00t

- -

srpt

- -

fcoe

- -

scst_local

-
diff --git a/www/handler_fileio_tgt.html b/www/handler_fileio_tgt.html index 466a9577b..ff4624cce 100644 --- a/www/handler_fileio_tgt.html +++ b/www/handler_fileio_tgt.html @@ -66,7 +66,6 @@ All the words about BLOCKIO mode from SCST's README file apply to O_DIRECT mode as well.

-

The latest stable version is 3.1 (as part of the SCST package). Requires SCST version 3.1 or higher.

You can find the latest development version of this handler in the SCST SVN. See the download page how to setup access to it.

-

The latest stable version is 3.1.

- -

The latest stable version is 3.1. You can download the latest development version from the SCST SVN repository. See the download +

You can download the latest development version from the SCST SVN repository. See the download page how to setup access to it.





-

The latest stable version is 3.1. Requires Linux kernel version 2.6.18.x or higher and SCST version 3.1 or higher. - Tested mostly on i386 and x86_64, but should work on any other supported by Linux platform.

You can find the latest development version of this driver in the SCST SVN. See the download page how to setup access to it.

diff --git a/www/target_local.html b/www/target_local.html index 3ad8add68..6d3f97b39 100644 --- a/www/target_local.html +++ b/www/target_local.html @@ -68,7 +68,7 @@

This driver was made by Richard Sharpe.

-

It is on the beta stage. The latest stabe version is 3.1. You can download +

You can download the latest development version from the SCST SVN repository. See the download page how to setup access to it.




SCST QLogic This is target driver for QLogic qla2xxx (22xx++) Fibre Channel adapters.

-

This driver in version 3.1 supports 16G Hilda QLogic +

This driver starting from version 3.1 supports 16G Hilda QLogic chip based adapters (post-Hilda QLogic chips not supported) and has many other important improvements. This driver should also support FCoE, but that has never been verified. It has passed intensive internal SanDisk tests. It is stable and production ready. diff --git a/www/target_srp.html b/www/target_srp.html index 67aa8b22c..d3a3681b5 100644 --- a/www/target_srp.html +++ b/www/target_srp.html @@ -61,7 +61,6 @@ It is maintained by Bart Van Assche.

This driver is mainline Linux kernel ready and going to be pushed to it together with other SCST patches.

-

The latest stable version is 3.1.




The latest stable version of SCST is 3.2. The latest updates for it you can find it in the SVN branch 3.2.x.

+

Since version 3.2 SCST is available for download as a single "all-in-one" package.

+

You can also download prebuilt SCST modules for Scientific Linux CERN 5 (RHEL5-based), Ubuntu, From a24bf679b8084cbd844aa2a962ecee4963439caf Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 22 Dec 2016 03:07:19 +0000 Subject: [PATCH 25/30] Cleanup git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7080 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- www/downloads.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/www/downloads.html b/www/downloads.html index f1919afbc..1c4d34ccd 100644 --- a/www/downloads.html +++ b/www/downloads.html @@ -38,8 +38,6 @@

The latest stable version of SCST is 3.2. The latest updates for it you can find it in the SVN branch 3.2.x.

-

Since version 3.2 SCST is available for download as a single "all-in-one" package.

-

You can also download prebuilt SCST modules for Scientific Linux CERN 5 (RHEL5-based), Ubuntu, From 6912463c2e7fff149c226f1afd9efa585106ac43 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 27 Dec 2016 20:21:53 +0000 Subject: [PATCH 26/30] ib_srpt: Fix nightly build git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7081 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/run-regression-tests | 15 ++++++++- scripts/specialize-patch | 60 ++++++++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index 79648564b..5fbd9b2bf 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -629,7 +629,20 @@ do download_kernel $k || continue generate_kernel_patch $k "${generate_kernel_patch_options}" || continue - ( cd "${outputdir}" && extract_kernel_tree $k ) || continue + ( + cd "${outputdir}" && + extract_kernel_tree $k && + cd linux-$k/include/linux && + if [ ! -e compiler-gcc6.h ]; then + for f in compiler-gcc5.h compiler-gcc4.h; do + if [ -e "$f" ]; then + cp "$f" compiler-gcc6.h + break + fi + done + fi + ) || + continue if [ "${run_checkpatch}" = "true" ]; then run_checkpatch $k fi diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 493528002..74256335c 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -63,6 +63,48 @@ function evaluate(stmnt, pattern, arg, op, result) { stmnt = "+#if !defined(" arg[1] ")" } + gsub("defined\\(REGISTER_MAD_AGENT_HAS_FLAGS_ARG\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))", stmnt) + + gsub("defined\\(USE_PRE_440_WR_STRUCTURE\\)", + "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))", stmnt) + + gsub("defined\\(IB_CREATE_CQ_HAS_INIT_ATTR\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0))", stmnt) + + gsub("defined\\(CREATE_SEND_MAD_HAS_BASE_ARG\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0))", stmnt) + + gsub("defined\\(IB_CM_LISTEN_TAKES_FOURTH_ARG\\)", + "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0))", stmnt) + + gsub("defined\\(IB_CLIENT_REMOVE_TAKES_TWO_ARGS\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0))", stmnt) + + gsub("defined\\(IB_QUERY_GID_HAS_ATTR_ARG\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))", stmnt) + + gsub("RDMA_CREATE_ID_TAKES_NET_ARG", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))", stmnt) + + gsub("defined\\(USE_PRE_440_WR_STRUCTURE\\)", + "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))", stmnt) + + gsub("defined\\(HAVE_IB_QUERY_DEVICE\\)", + "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0))", stmnt) + + gsub("defined\\(MAD_HANDLER_TAKES_SEND_BUF\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0))", stmnt) + + gsub("defined\\(HAVE_IB_SET_CPI_RESP_TIME\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))", stmnt) + + gsub("defined\\(IB_PD_HAS_LOCAL_DMA_LKEY\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))", stmnt) + + gsub("defined\\(HAVE_IB_DMA_MAP_OPS\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(0, 0, 0))", stmnt) + gsub("LINUX_VERSION_CODE", LINUX_VERSION_CODE, stmnt) pattern="KERNEL_VERSION\\([[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*\\)" @@ -290,12 +332,26 @@ function handle_if(evaluated) # Only act on preprocessor conditional expressions with regard to the Linux # kernel version, and do not interpret other expressions. if ($0 ~ "LINUX_VERSION_CODE" \ - || $0 ~ "INSIDE_KERNEL_TREE" \ || $0 ~ "CONFIG_SCST_PROC" \ + || $0 ~ "CREATE_SEND_MAD_HAS_BASE_ARG" \ + || $0 ~ "HAVE_IB_SET_CPI_RESP_TIME" \ + || $0 ~ "HAVE_IB_DMA_MAP_OPS" \ + || $0 ~ "HAVE_IB_QUERY_DEVICE" \ + || $0 ~ "IB_CLIENT_REMOVE_TAKES_TWO_ARGS" \ + || $0 ~ "IB_CM_LISTEN_TAKES_FOURTH_ARG" \ + || $0 ~ "IB_CREATE_CQ_HAS_INIT_ATTR" \ + || $0 ~ "IB_PD_HAS_LOCAL_DMA_LKEY" \ + || $0 ~ "IB_PD_HAS_LOCAL_DMA_LKEY" \ + || $0 ~ "IB_QUERY_GID_HAS_ATTR_ARG" \ + || $0 ~ "INSIDE_KERNEL_TREE" \ + || $0 ~ "MAD_HANDLER_TAKES_SEND_BUF" \ + || $0 ~ "MOFED_MAJOR" \ + || $0 ~ "REGISTER_MAD_AGENT_HAS_FLAGS_ARG" \ + || $0 ~ "RDMA_CREATE_ID_TAKES_NET_ARG" \ || $0 ~ "RHEL_MAJOR" \ || $0 ~ "RHEL_MINOR" \ || $0 ~ "RHEL_RELEASE_CODE" \ - || $0 ~ "MOFED_MAJOR" \ + || $0 ~ "USE_PRE_440_WR_STRUCTURE" \ || generating_upstream_patch_defined \ && $0 ~ "GENERATING_UPSTREAM_PATCH" \ || $0 ~ "CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION" \ From db5426169b328d3e4a43f03aaae0c5c51794a8da Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 27 Dec 2016 20:23:31 +0000 Subject: [PATCH 27/30] ib_srpt: Improve portability git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7082 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/Makefile | 23 +++++++++++------ srpt/conftest/ib_dma_map_ops/Makefile | 3 +++ srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c | 11 ++++++++ srpt/conftest/pd_has_local_dma_lkey/Makefile | 3 +++ .../pd_has_local_dma_lkey.c | 10 ++++++++ srpt/src/ib_srpt.c | 25 +++++++------------ srpt/src/ib_srpt.h | 2 +- 7 files changed, 53 insertions(+), 24 deletions(-) create mode 100644 srpt/conftest/ib_dma_map_ops/Makefile create mode 100644 srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c create mode 100644 srpt/conftest/pd_has_local_dma_lkey/Makefile create mode 100644 srpt/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c diff --git a/srpt/Makefile b/srpt/Makefile index b25d0de72..e0d819eb4 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -5,12 +5,18 @@ ifndef PREFIX PREFIX=/usr/local endif -SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ - then echo "$$PWD/../scst/include"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) -SCST_SYMVERS_DIR := $(shell if [ -e $$PWD/../scst ]; then \ - echo $$PWD/../scst/src; \ - else echo $(DESTDIR)$(PREFIX)/include/scst; fi) +SCST_INC_DIR := $(shell \ + if [ -e "$$PWD/../scst" ]; then \ + echo "$$PWD/../scst/include"; \ + else \ + echo "$(DESTDIR)$(PREFIX)/include/scst"; \ + fi) +SCST_SYMVERS_DIR := $(shell \ + if [ -e "$$PWD/../scst" ]; then \ + echo "$$PWD/../scst/src"; \ + else \ + echo "$(DESTDIR)$(PREFIX)/include/scst"; \ + fi) ifeq ($(KVER),) ifeq ($(KDIR),) @@ -66,7 +72,6 @@ ifeq ($(OFED_FLAVOR),MOFED) # , include that header file explicitly. OFED_KERNEL_DIR:=/usr/src/ofa_kernel/default OFED_VERS=$(shell rpm -q --qf '%{version}\n' mlnx-ofa_kernel-devel 2>/dev/null) -CKVER:=$(shell echo "$(KVER)" | sed 's/^\(\(2\.6\|[3-9]\)\.[0-9]*\).*/\1/') OFED_CFLAGS:=-I$(OFED_KERNEL_DIR)/include -include "linux/compat-2.6.h" OFED_CFLAGS+=-DMOFED_MAJOR=$(shell echo $(OFED_VERS) | cut -f1 -d.) OFED_CFLAGS+=-DMOFED_MINOR=$(shell echo $(OFED_VERS) | cut -f2 -d.) @@ -96,8 +101,10 @@ endif CLIENT_REMOVE := $(call run_conftest,ib_client_remove,-DIB_CLIENT_REMOVE_TAKES_TWO_ARGS) CM_LISTEN := $(call run_conftest,cm_listen,-DIB_CM_LISTEN_TAKES_FOURTH_ARG) MAD_HANDLER_TAKES_SEND_BUF := $(call run_conftest,mad_handler_takes_send_buf,-DMAD_HANDLER_TAKES_SEND_BUF) +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) REGISTER_MAD_AGENT_FLAG := $(call run_conftest,register_mad_agent,-DREGISTER_MAD_AGENT_HAS_FLAGS_ARG) QUERY_DEVICE := $(call run_conftest,query_device,-DHAVE_IB_QUERY_DEVICE) @@ -112,8 +119,10 @@ PRE_CFLAGS=$(OFED_CFLAGS) \ $(IB_CLIENT_REMOVE_TAKES_TWO_ARGS) \ $(CM_LISTEN) \ $(MAD_HANDLER_TAKES_SEND_BUF) \ + $(HAVE_IB_DMA_MAP_OPS) \ $(HAVE_IB_SET_CPI_RESP_TIME) \ $(GID_CHANGE_FLAG) \ + $(PD_HAS_LOCAL_DMA_LKEY) \ $(RDMA_CREATE_ID) \ $(REGISTER_MAD_AGENT_FLAG) \ $(QUERY_GID_FLAG) \ diff --git a/srpt/conftest/ib_dma_map_ops/Makefile b/srpt/conftest/ib_dma_map_ops/Makefile new file mode 100644 index 000000000..fc43ac8af --- /dev/null +++ b/srpt/conftest/ib_dma_map_ops/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += ib_dma_map_ops.o diff --git a/srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c b/srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c new file mode 100644 index 000000000..2aeb8bbf2 --- /dev/null +++ b/srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c @@ -0,0 +1,11 @@ +#include +#include + +static struct ib_device *dev; + +static int modinit(void) +{ + return dev->dma_ops != NULL; +} + +module_init(modinit); diff --git a/srpt/conftest/pd_has_local_dma_lkey/Makefile b/srpt/conftest/pd_has_local_dma_lkey/Makefile new file mode 100644 index 000000000..7e203aff4 --- /dev/null +++ b/srpt/conftest/pd_has_local_dma_lkey/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += pd_has_local_dma_lkey.o diff --git a/srpt/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c b/srpt/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c new file mode 100644 index 000000000..b6889c165 --- /dev/null +++ b/srpt/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c @@ -0,0 +1,10 @@ +#include +#include +#include + +static int modinit(void) +{ + return offsetof(struct ib_pd, local_dma_lkey); +} + +module_init(modinit); diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 0da84d2cf..426c5aaf4 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -135,8 +135,7 @@ static int use_srq; static bool use_srq; #endif module_param(use_srq, bool, S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(use_srq, - "Whether or not to use SRQ"); +MODULE_PARM_DESC(use_srq, "Whether or not to use SRQ"); static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE; module_param(srpt_srq_size, int, S_IRUGO | S_IWUSR); @@ -145,8 +144,7 @@ MODULE_PARM_DESC(srpt_srq_size, static int srpt_sq_size = DEF_SRPT_SQ_SIZE; module_param(srpt_sq_size, int, 0444); -MODULE_PARM_DESC(srpt_sq_size, - "Per-channel send queue (SQ) size."); +MODULE_PARM_DESC(srpt_sq_size, "Per-channel send queue (SQ) size."); #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) \ || defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 5 @@ -626,8 +624,7 @@ static void srpt_mad_recv_handler(struct ib_mad_agent *mad_agent, #endif 0, IB_MGMT_DEVICE_HDR, IB_MGMT_DEVICE_DATA, GFP_KERNEL -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) && !defined(MOFED_MAJOR) || \ - defined(CREATE_SEND_MAD_HAS_BASE_ARG) +#ifdef CREATE_SEND_MAD_HAS_BASE_ARG , 0 #endif ); @@ -702,8 +699,7 @@ static int srpt_refresh_port(struct srpt_port *sport) sport->lid = port_attr.lid; ret = ib_query_gid(sport->sdev->device, sport->port, 0, &sport->gid -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) || \ - defined(IB_QUERY_GID_HAS_ATTR_ARG) +#ifdef IB_QUERY_GID_HAS_ATTR_ARG , NULL #endif ); @@ -724,8 +720,7 @@ static int srpt_refresh_port(struct srpt_port *sport) srpt_mad_send_handler, srpt_mad_recv_handler, sport -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) || \ - defined(REGISTER_MAD_AGENT_HAS_FLAGS_ARG) +#ifdef REGISTER_MAD_AGENT_HAS_FLAGS_ARG , 0 #endif ); @@ -2227,9 +2222,7 @@ retry: !defined(RHEL_RELEASE_CODE) ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch, ch->rq_size + sq_size); -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) || \ - defined(MOFED_MAJOR)) && \ - !defined(IB_CREATE_CQ_HAS_INIT_ATTR) +#elif !defined(IB_CREATE_CQ_HAS_INIT_ATTR) ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch, ch->rq_size + sq_size, ch->comp_vector); #else @@ -4360,7 +4353,7 @@ static void srpt_add_one(struct ib_device *device) goto free_dev; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) +#ifndef IB_PD_HAS_LOCAL_DMA_LKEY sdev->mr = ib_get_dma_mr(sdev->pd, IB_ACCESS_LOCAL_WRITE); if (IS_ERR(sdev->mr)) { pr_err("ib_get_dma_mr() failed: %ld\n", PTR_ERR(sdev->mr)); @@ -4493,7 +4486,7 @@ err_ring: if (sdev->use_srq) ib_destroy_srq(sdev->srq); err_mr: -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) +#ifndef IB_PD_HAS_LOCAL_DMA_LKEY ib_dereg_mr(sdev->mr); err_pd: #endif @@ -4568,7 +4561,7 @@ static void srpt_remove_one(struct ib_device *device, void *client_data) if (sdev->use_srq) ib_destroy_srq(sdev->srq); -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) +#ifndef IB_PD_HAS_LOCAL_DMA_LKEY ib_dereg_mr(sdev->mr); #endif ib_dealloc_pd(sdev->pd); diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index b410dd69e..5ff8869dc 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -457,7 +457,7 @@ struct srpt_port { struct srpt_device { struct ib_device *device; 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_srq *srq; From db36d29932b03699a640f850eee376db346e8b35 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 27 Dec 2016 20:25:13 +0000 Subject: [PATCH 28/30] isert-scst: Rename SCST_DIR into SCST_SYMVERS_DIR Additionally, align shell code. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7083 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/Makefile | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 421b77325..5b1826182 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -6,18 +6,25 @@ # unless it's something special (not a .c file). ifndef PREFIX - PREFIX=/usr/local + PREFIX=/usr/local endif SHELL=/bin/bash SUBDIRS := $(shell pwd) -SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ - then echo "$$PWD/../scst/include"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) -SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; then echo "$$PWD/../scst/src"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) +SCST_INC_DIR := $(shell \ + if [ -e "$$PWD/../scst" ]; then \ + echo "$$PWD/../scst/include"; \ + else \ + echo "$(DESTDIR)$(PREFIX)/include/scst"; \ + fi) +SCST_SYMVERS_DIR := $(shell \ + if [ -e "$$PWD/../scst" ]; then \ + echo "$$PWD/../scst/src"; \ + else \ + echo "$(DESTDIR)$(PREFIX)/include/scst"; \ + fi) SBINDIR := $(PREFIX)/sbin INITDIR := /etc/init.d RCDIR := /etc/rc.d @@ -156,26 +163,26 @@ uninstall: $(INSTALL_DIR)/isert-scst.ko -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) -SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null) +SCST_MOD_VERS := $(shell ls $(SCST_SYMVERS_DIR)/Modules.symvers 2>/dev/null) ifneq ($(SCST_MOD_VERS),) -Modules.symvers: $(SCST_DIR)/Modules.symvers +Modules.symvers: $(SCST_SYMVERS_DIR)/Modules.symvers echo $(SCST_MOD_VERS) - cp $(SCST_DIR)/Modules.symvers kernel/ + cp $(SCST_SYMVERS_DIR)/Modules.symvers kernel/ echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" - if $(INFINIBAND_ENABLED); then \ - cp $(SCST_DIR)/Modules.symvers kernel/isert-scst; \ + if $(INFINIBAND_ENABLED); then \ + cp $(SCST_SYMVERS_DIR)/Modules.symvers kernel/isert-scst; \ fi else .PHONY: Modules.symvers endif # It's renamed in 2.6.18 -SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Module.symvers 2>/dev/null) +SCST_MOD_VERS := $(shell ls $(SCST_SYMVERS_DIR)/Module.symvers 2>/dev/null) ifneq ($(SCST_MOD_VERS),) -Module.symvers: $(SCST_DIR)/Module.symvers - cp $(SCST_DIR)/Module.symvers kernel/ - if $(INFINIBAND_ENABLED); then \ - cp $(SCST_DIR)/Module.symvers kernel/isert-scst; \ +Module.symvers: $(SCST_SYMVERS_DIR)/Module.symvers + cp $(SCST_SYMVERS_DIR)/Module.symvers kernel/ + if $(INFINIBAND_ENABLED); then \ + cp $(SCST_SYMVERS_DIR)/Module.symvers kernel/isert-scst; \ fi else .PHONY: Module.symvers From 9cbe881f2fa77a933ade61cc1146ab1b0bff8480 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 27 Dec 2016 20:26:11 +0000 Subject: [PATCH 29/30] isert-scst: Fix CentOS 7.3 build git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7084 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/Makefile | 34 ++++++++++++++++++++++-- iscsi-scst/kernel/isert-scst/iser.h | 4 +-- iscsi-scst/kernel/isert-scst/iser_buf.c | 6 ++--- iscsi-scst/kernel/isert-scst/iser_pdu.c | 10 +++---- iscsi-scst/kernel/isert-scst/iser_rdma.c | 23 ++++++++-------- 5 files changed, 53 insertions(+), 24 deletions(-) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 5b1826182..3ff356e99 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -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 diff --git a/iscsi-scst/kernel/isert-scst/iser.h b/iscsi-scst/kernel/isert-scst/iser.h index 8531896ba..2a842172d 100644 --- a/iscsi-scst/kernel/isert-scst/iser.h +++ b/iscsi-scst/kernel/isert-scst/iser.h @@ -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; diff --git a/iscsi-scst/kernel/isert-scst/iser_buf.c b/iscsi-scst/kernel/isert-scst/iser_buf.c index ae8b8c462..b1756f2f8 100644 --- a/iscsi-scst/kernel/isert-scst/iser_buf.c +++ b/iscsi-scst/kernel/isert-scst/iser_buf.c @@ -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; diff --git a/iscsi-scst/kernel/isert-scst/iser_pdu.c b/iscsi-scst/kernel/isert-scst/iser_pdu.c index 7a0810185..729061f66 100644 --- a/iscsi-scst/kernel/isert-scst/iser_pdu.c +++ b/iscsi-scst/kernel/isert-scst/iser_pdu.c @@ -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 diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index c35ccbbb5..39bb9c576 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -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 From 81fd21577203bae61f998d3ae0c9d312c941bd31 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 27 Dec 2016 20:42:22 +0000 Subject: [PATCH 30/30] isert-scst: Follow-up for r7084 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7085 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/conftest/cm_listen/Makefile | 3 +++ iscsi-scst/conftest/cm_listen/cm_listen.c | 9 +++++++++ iscsi-scst/conftest/create_send_mad_ah/Makefile | 3 +++ .../create_send_mad_ah/create_send_mad_ah.c | 13 +++++++++++++ .../conftest/create_send_mad_base/Makefile | 3 +++ .../create_send_mad_base/create_send_mad_base.c | 13 +++++++++++++ iscsi-scst/conftest/gid_change/Makefile | 3 +++ iscsi-scst/conftest/gid_change/gid_change.c | 9 +++++++++ iscsi-scst/conftest/ib_client_remove/Makefile | 3 +++ .../ib_client_remove/ib_client_remove.c | 15 +++++++++++++++ iscsi-scst/conftest/ib_dma_map_ops/Makefile | 3 +++ .../conftest/ib_dma_map_ops/ib_dma_map_ops.c | 11 +++++++++++ .../conftest/ib_set_cpi_resp_time/Makefile | 3 +++ .../ib_set_cpi_resp_time/ib_set_cpi_resp_time.c | 9 +++++++++ .../mad_handler_takes_send_buf/Makefile | 3 +++ .../mad_handler_takes_send_buf.c | 17 +++++++++++++++++ .../conftest/pd_has_local_dma_lkey/Makefile | 3 +++ .../pd_has_local_dma_lkey.c | 10 ++++++++++ iscsi-scst/conftest/query_device/Makefile | 3 +++ iscsi-scst/conftest/query_device/query_device.c | 9 +++++++++ .../conftest/query_device_attr_arg/Makefile | 3 +++ .../query_device_attr_arg.c | 9 +++++++++ iscsi-scst/conftest/query_gid/Makefile | 3 +++ iscsi-scst/conftest/query_gid/query_gid.c | 9 +++++++++ iscsi-scst/conftest/rdma_create_id_net/Makefile | 3 +++ .../rdma_create_id_net/rdma_create_id_net.c | 10 ++++++++++ iscsi-scst/conftest/register_mad_agent/Makefile | 3 +++ .../register_mad_agent/register_mad_agent.c | 13 +++++++++++++ .../conftest/use_pre_440_wr_structure/Makefile | 3 +++ .../use_pre_440_wr_structure.c | 11 +++++++++++ 30 files changed, 212 insertions(+) create mode 100644 iscsi-scst/conftest/cm_listen/Makefile create mode 100644 iscsi-scst/conftest/cm_listen/cm_listen.c create mode 100644 iscsi-scst/conftest/create_send_mad_ah/Makefile create mode 100644 iscsi-scst/conftest/create_send_mad_ah/create_send_mad_ah.c create mode 100644 iscsi-scst/conftest/create_send_mad_base/Makefile create mode 100644 iscsi-scst/conftest/create_send_mad_base/create_send_mad_base.c create mode 100644 iscsi-scst/conftest/gid_change/Makefile create mode 100644 iscsi-scst/conftest/gid_change/gid_change.c create mode 100644 iscsi-scst/conftest/ib_client_remove/Makefile create mode 100644 iscsi-scst/conftest/ib_client_remove/ib_client_remove.c create mode 100644 iscsi-scst/conftest/ib_dma_map_ops/Makefile create mode 100644 iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c create mode 100644 iscsi-scst/conftest/ib_set_cpi_resp_time/Makefile create mode 100644 iscsi-scst/conftest/ib_set_cpi_resp_time/ib_set_cpi_resp_time.c create mode 100644 iscsi-scst/conftest/mad_handler_takes_send_buf/Makefile create mode 100644 iscsi-scst/conftest/mad_handler_takes_send_buf/mad_handler_takes_send_buf.c create mode 100644 iscsi-scst/conftest/pd_has_local_dma_lkey/Makefile create mode 100644 iscsi-scst/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c create mode 100644 iscsi-scst/conftest/query_device/Makefile create mode 100644 iscsi-scst/conftest/query_device/query_device.c create mode 100644 iscsi-scst/conftest/query_device_attr_arg/Makefile create mode 100644 iscsi-scst/conftest/query_device_attr_arg/query_device_attr_arg.c create mode 100644 iscsi-scst/conftest/query_gid/Makefile create mode 100644 iscsi-scst/conftest/query_gid/query_gid.c create mode 100644 iscsi-scst/conftest/rdma_create_id_net/Makefile create mode 100644 iscsi-scst/conftest/rdma_create_id_net/rdma_create_id_net.c create mode 100644 iscsi-scst/conftest/register_mad_agent/Makefile create mode 100644 iscsi-scst/conftest/register_mad_agent/register_mad_agent.c create mode 100644 iscsi-scst/conftest/use_pre_440_wr_structure/Makefile create mode 100644 iscsi-scst/conftest/use_pre_440_wr_structure/use_pre_440_wr_structure.c diff --git a/iscsi-scst/conftest/cm_listen/Makefile b/iscsi-scst/conftest/cm_listen/Makefile new file mode 100644 index 000000000..e9f8cb9f7 --- /dev/null +++ b/iscsi-scst/conftest/cm_listen/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += cm_listen.o diff --git a/iscsi-scst/conftest/cm_listen/cm_listen.c b/iscsi-scst/conftest/cm_listen/cm_listen.c new file mode 100644 index 000000000..f03fddabb --- /dev/null +++ b/iscsi-scst/conftest/cm_listen/cm_listen.c @@ -0,0 +1,9 @@ +#include +#include + +static int modinit(void) +{ + return ib_cm_listen(NULL, 0, 0, NULL); +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/create_send_mad_ah/Makefile b/iscsi-scst/conftest/create_send_mad_ah/Makefile new file mode 100644 index 000000000..37fdb6e9f --- /dev/null +++ b/iscsi-scst/conftest/create_send_mad_ah/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += create_send_mad_ah.o diff --git a/iscsi-scst/conftest/create_send_mad_ah/create_send_mad_ah.c b/iscsi-scst/conftest/create_send_mad_ah/create_send_mad_ah.c new file mode 100644 index 000000000..529a00858 --- /dev/null +++ b/iscsi-scst/conftest/create_send_mad_ah/create_send_mad_ah.c @@ -0,0 +1,13 @@ +#include +#include + +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); diff --git a/iscsi-scst/conftest/create_send_mad_base/Makefile b/iscsi-scst/conftest/create_send_mad_base/Makefile new file mode 100644 index 000000000..92f153d51 --- /dev/null +++ b/iscsi-scst/conftest/create_send_mad_base/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += create_send_mad_base.o diff --git a/iscsi-scst/conftest/create_send_mad_base/create_send_mad_base.c b/iscsi-scst/conftest/create_send_mad_base/create_send_mad_base.c new file mode 100644 index 000000000..2f48902e3 --- /dev/null +++ b/iscsi-scst/conftest/create_send_mad_base/create_send_mad_base.c @@ -0,0 +1,13 @@ +#include +#include + +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); diff --git a/iscsi-scst/conftest/gid_change/Makefile b/iscsi-scst/conftest/gid_change/Makefile new file mode 100644 index 000000000..ef14a136e --- /dev/null +++ b/iscsi-scst/conftest/gid_change/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += gid_change.o diff --git a/iscsi-scst/conftest/gid_change/gid_change.c b/iscsi-scst/conftest/gid_change/gid_change.c new file mode 100644 index 000000000..bb60773fb --- /dev/null +++ b/iscsi-scst/conftest/gid_change/gid_change.c @@ -0,0 +1,9 @@ +#include +#include + +static int modinit(void) +{ + return IB_EVENT_GID_CHANGE; +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/ib_client_remove/Makefile b/iscsi-scst/conftest/ib_client_remove/Makefile new file mode 100644 index 000000000..dbb92ba16 --- /dev/null +++ b/iscsi-scst/conftest/ib_client_remove/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += ib_client_remove.o diff --git a/iscsi-scst/conftest/ib_client_remove/ib_client_remove.c b/iscsi-scst/conftest/ib_client_remove/ib_client_remove.c new file mode 100644 index 000000000..77cac3525 --- /dev/null +++ b/iscsi-scst/conftest/ib_client_remove/ib_client_remove.c @@ -0,0 +1,15 @@ +#include +#include + +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); diff --git a/iscsi-scst/conftest/ib_dma_map_ops/Makefile b/iscsi-scst/conftest/ib_dma_map_ops/Makefile new file mode 100644 index 000000000..fc43ac8af --- /dev/null +++ b/iscsi-scst/conftest/ib_dma_map_ops/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += ib_dma_map_ops.o diff --git a/iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c b/iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c new file mode 100644 index 000000000..2aeb8bbf2 --- /dev/null +++ b/iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c @@ -0,0 +1,11 @@ +#include +#include + +static struct ib_device *dev; + +static int modinit(void) +{ + return dev->dma_ops != NULL; +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/ib_set_cpi_resp_time/Makefile b/iscsi-scst/conftest/ib_set_cpi_resp_time/Makefile new file mode 100644 index 000000000..8ba270a73 --- /dev/null +++ b/iscsi-scst/conftest/ib_set_cpi_resp_time/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += ib_set_cpi_resp_time.o diff --git a/iscsi-scst/conftest/ib_set_cpi_resp_time/ib_set_cpi_resp_time.c b/iscsi-scst/conftest/ib_set_cpi_resp_time/ib_set_cpi_resp_time.c new file mode 100644 index 000000000..eb544bd0f --- /dev/null +++ b/iscsi-scst/conftest/ib_set_cpi_resp_time/ib_set_cpi_resp_time.c @@ -0,0 +1,9 @@ +#include +#include + +static int modinit(void) +{ + return (uintptr_t)ib_set_cpi_resp_time; +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/mad_handler_takes_send_buf/Makefile b/iscsi-scst/conftest/mad_handler_takes_send_buf/Makefile new file mode 100644 index 000000000..03f96f272 --- /dev/null +++ b/iscsi-scst/conftest/mad_handler_takes_send_buf/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += mad_handler_takes_send_buf.o diff --git a/iscsi-scst/conftest/mad_handler_takes_send_buf/mad_handler_takes_send_buf.c b/iscsi-scst/conftest/mad_handler_takes_send_buf/mad_handler_takes_send_buf.c new file mode 100644 index 000000000..348d67121 --- /dev/null +++ b/iscsi-scst/conftest/mad_handler_takes_send_buf/mad_handler_takes_send_buf.c @@ -0,0 +1,17 @@ +#include +#include + +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); diff --git a/iscsi-scst/conftest/pd_has_local_dma_lkey/Makefile b/iscsi-scst/conftest/pd_has_local_dma_lkey/Makefile new file mode 100644 index 000000000..7e203aff4 --- /dev/null +++ b/iscsi-scst/conftest/pd_has_local_dma_lkey/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += pd_has_local_dma_lkey.o diff --git a/iscsi-scst/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c b/iscsi-scst/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c new file mode 100644 index 000000000..b6889c165 --- /dev/null +++ b/iscsi-scst/conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c @@ -0,0 +1,10 @@ +#include +#include +#include + +static int modinit(void) +{ + return offsetof(struct ib_pd, local_dma_lkey); +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/query_device/Makefile b/iscsi-scst/conftest/query_device/Makefile new file mode 100644 index 000000000..7f907d2b3 --- /dev/null +++ b/iscsi-scst/conftest/query_device/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += query_device.o diff --git a/iscsi-scst/conftest/query_device/query_device.c b/iscsi-scst/conftest/query_device/query_device.c new file mode 100644 index 000000000..b32717ce5 --- /dev/null +++ b/iscsi-scst/conftest/query_device/query_device.c @@ -0,0 +1,9 @@ +#include +#include + +static int modinit(void) +{ + return (uintptr_t)ib_query_device; +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/query_device_attr_arg/Makefile b/iscsi-scst/conftest/query_device_attr_arg/Makefile new file mode 100644 index 000000000..1998c3bc1 --- /dev/null +++ b/iscsi-scst/conftest/query_device_attr_arg/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += query_device_attr_arg.o diff --git a/iscsi-scst/conftest/query_device_attr_arg/query_device_attr_arg.c b/iscsi-scst/conftest/query_device_attr_arg/query_device_attr_arg.c new file mode 100644 index 000000000..339d155d4 --- /dev/null +++ b/iscsi-scst/conftest/query_device_attr_arg/query_device_attr_arg.c @@ -0,0 +1,9 @@ +#include +#include + +static int modinit(void) +{ + return ib_query_device(NULL, NULL); +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/query_gid/Makefile b/iscsi-scst/conftest/query_gid/Makefile new file mode 100644 index 000000000..7a7bba1f2 --- /dev/null +++ b/iscsi-scst/conftest/query_gid/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += query_gid.o diff --git a/iscsi-scst/conftest/query_gid/query_gid.c b/iscsi-scst/conftest/query_gid/query_gid.c new file mode 100644 index 000000000..2db08ef62 --- /dev/null +++ b/iscsi-scst/conftest/query_gid/query_gid.c @@ -0,0 +1,9 @@ +#include +#include + +static int modinit(void) +{ + return ib_query_gid(NULL, 0, 0, NULL, NULL); +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/rdma_create_id_net/Makefile b/iscsi-scst/conftest/rdma_create_id_net/Makefile new file mode 100644 index 000000000..3b054d037 --- /dev/null +++ b/iscsi-scst/conftest/rdma_create_id_net/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += rdma_create_id_net.o diff --git a/iscsi-scst/conftest/rdma_create_id_net/rdma_create_id_net.c b/iscsi-scst/conftest/rdma_create_id_net/rdma_create_id_net.c new file mode 100644 index 000000000..fd6b874d9 --- /dev/null +++ b/iscsi-scst/conftest/rdma_create_id_net/rdma_create_id_net.c @@ -0,0 +1,10 @@ +#include +#include + +static int modinit(void) +{ + return rdma_create_id(NULL, NULL, NULL, 0, 0) != NULL; + +} + +module_init(modinit); diff --git a/iscsi-scst/conftest/register_mad_agent/Makefile b/iscsi-scst/conftest/register_mad_agent/Makefile new file mode 100644 index 000000000..11f6f4506 --- /dev/null +++ b/iscsi-scst/conftest/register_mad_agent/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += register_mad_agent.o diff --git a/iscsi-scst/conftest/register_mad_agent/register_mad_agent.c b/iscsi-scst/conftest/register_mad_agent/register_mad_agent.c new file mode 100644 index 000000000..c464f1443 --- /dev/null +++ b/iscsi-scst/conftest/register_mad_agent/register_mad_agent.c @@ -0,0 +1,13 @@ +#include +#include + +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); diff --git a/iscsi-scst/conftest/use_pre_440_wr_structure/Makefile b/iscsi-scst/conftest/use_pre_440_wr_structure/Makefile new file mode 100644 index 000000000..ea82d5d19 --- /dev/null +++ b/iscsi-scst/conftest/use_pre_440_wr_structure/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += use_pre_440_wr_structure.o diff --git a/iscsi-scst/conftest/use_pre_440_wr_structure/use_pre_440_wr_structure.c b/iscsi-scst/conftest/use_pre_440_wr_structure/use_pre_440_wr_structure.c new file mode 100644 index 000000000..3205a489b --- /dev/null +++ b/iscsi-scst/conftest/use_pre_440_wr_structure/use_pre_440_wr_structure.c @@ -0,0 +1,11 @@ +#include +#include + +static int modinit(void) +{ + struct ib_send_wr wr = { }; + + return wr.wr.rdma.rkey; +} + +module_init(modinit);