diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 52d9410c0..f5ac07faf 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -273,6 +273,12 @@ conftest/query_device_attr_arg/result-$(KVER).txt: \ echo "$(call run_conftest,query_device_attr_arg, \ -DIB_QUERY_DEVICE_HAS_ATTR_ARG)" >"$@" +conftest/dev_attr_max_recv_sge/result-$(KVER).txt: \ + conftest/dev_attr_max_recv_sge/dev_attr_max_recv_sge.c \ + conftest/dev_attr_max_recv_sge/Makefile + echo "$(call run_conftest,dev_attr_max_recv_sge, \ + -DHAVE_DEV_ATTR_MAX_RECV_SGE)" >"$@" + conftest/query_gid/result-$(KVER).txt: \ conftest/query_gid/query_gid.c \ conftest/query_gid/Makefile diff --git a/iscsi-scst/conftest/dev_attr_max_recv_sge/Makefile b/iscsi-scst/conftest/dev_attr_max_recv_sge/Makefile new file mode 100644 index 000000000..01d1ba7d9 --- /dev/null +++ b/iscsi-scst/conftest/dev_attr_max_recv_sge/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += dev_attr_max_recv_sge.o diff --git a/iscsi-scst/conftest/dev_attr_max_recv_sge/dev_attr_max_recv_sge.c b/iscsi-scst/conftest/dev_attr_max_recv_sge/dev_attr_max_recv_sge.c new file mode 100644 index 000000000..2a70a2ebe --- /dev/null +++ b/iscsi-scst/conftest/dev_attr_max_recv_sge/dev_attr_max_recv_sge.c @@ -0,0 +1,10 @@ +#include +#include +#include + +static int modinit(void) +{ + return offsetof(struct ib_device_attr, max_recv_sge); +} + +module_init(modinit); diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 69bc08be2..4f896c0eb 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -1295,8 +1295,7 @@ static struct isert_connection *isert_conn_create(struct rdma_cm_id *cm_id, * In mem-free devices, RC QPs can be created with a maximum of * (max_sge - 3) entries only. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8) +#ifndef HAVE_DEV_ATTR_MAX_RECV_SGE isert_conn->max_sge = isert_dev->device_attr.max_sge - 3; #else isert_conn->max_sge = isert_dev->device_attr.max_recv_sge - 3; diff --git a/srpt/Makefile b/srpt/Makefile index d262a64dc..acd2fcc9f 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -69,6 +69,7 @@ OFED_CFLAGS:=-I$(OFED_KERNEL_DIR)/include \ -include "linux/compat-2.6.h" OFED_CFLAGS+=-DMOFED_MAJOR=$(shell echo "$(OFED_VERS)" | sed 's/\([0-9]\+\)[^0-9]\+\([0-9]\+\).*/\1/g') OFED_CFLAGS+=-DMOFED_MINOR=$(shell echo "$(OFED_VERS)" | sed 's/\([0-9]\+\)[^0-9]\+\([0-9]\+\).*/\2/g') +OFED_CONFIG:=CONFIG_DTRACE= else # OFED 1.5 OFED_KERNEL_DIR:=/usr/src/ofa_kernel @@ -81,7 +82,7 @@ OFED_MODULE_SYMVERS:=$(OFED_KERNEL_DIR)/$(MODULE_SYMVERS) endif # Use make instead of $(MAKE) to get rid of command-line option -i -run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if MAKEFLAGS= make -C $(KDIR) V=$(V) M="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" 1>&2 2>$${output}; then echo "$(strip $2)"; else echo "$(strip $3)"; fi) +run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if MAKEFLAGS= make -C $(KDIR) V=$(V) M="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" $(OFED_CONFIG) 1>&2 2>$${output}; then echo "$(strip $2)"; else echo "$(strip $3)"; fi) run_conftest_bool = $(call run_conftest,$1,-D$(strip $2)=1,-D$(strip $2)=0) CONFTESTS = $(shell ls -d conftest/*) @@ -97,7 +98,7 @@ PRE_CFLAGS = $(OFED_CFLAGS) \ done) all: check src/$(MODULE_SYMVERS) $(CONFTEST_OUTPUTS) - $(MAKE) -C $(KDIR) M=$(shell pwd)/src PRE_CFLAGS="$(PRE_CFLAGS)" modules + $(MAKE) -C $(KDIR) M=$(shell pwd)/src PRE_CFLAGS="$(PRE_CFLAGS)" $(OFED_CONFIG) modules src/$(MODULE_SYMVERS): $(SCST_DIR)/$(MODULE_SYMVERS) $(OFED_MODULE_SYMVERS) cat $^ | \