diff --git a/scst/include/backport.h b/scst/include/backport.h index 897288ee5..8fcd87edc 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -90,16 +90,6 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) -static inline void blk_queue_flag_set(unsigned int flag, - struct request_queue *q) -{ -#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6 - queue_flag_set_unlocked(flag, q); -#endif -} -#endif - /* */ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) diff --git a/scst/include/scst.h b/scst/include/scst.h index 9f5248dae..3ffa3f0a0 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -4971,7 +4971,7 @@ static inline struct scatterlist *sg_next_inline(struct scatterlist *sg) static inline void sg_clear(struct scatterlist *sg) { memset(sg, 0, sizeof(*sg)); -#ifdef CONFIG_DEBUG_SG +#if 0 // def CONFIG_DEBUG_SG sg->sg_magic = SG_MAGIC; #endif } diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index eef75fa97..df41160e5 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1230,7 +1230,14 @@ static int scst_local_change_queue_depth(struct scsi_device *sdev, int qdepth) static int scst_local_slave_alloc(struct scsi_device *sdev) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) +#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6 + queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdev->request_queue); +#endif +#else blk_queue_flag_set(QUEUE_FLAG_BIDI, sdev->request_queue); +#endif + return 0; } diff --git a/srpt/Makefile b/srpt/Makefile index 31c92659a..0b1399676 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -184,6 +184,12 @@ conftest/create_send_mad_base/result-$(KVER).txt: \ echo "$(call run_conftest,create_send_mad_base, \ -DCREATE_SEND_MAD_HAS_BASE_ARG)" >"$@" +conftest/dev_attr_max_send_sge/result-$(KVER).txt: \ + conftest/dev_attr_max_send_sge/dev_attr_max_send_sge.c \ + conftest/dev_attr_max_send_sge/Makefile + echo "$(call run_conftest_bool,dev_attr_max_send_sge, \ + HAVE_DEV_ATTR_MAX_SEND_SGE)" >"$@" + conftest/gid_change/result-$(KVER).txt: \ conftest/gid_change/gid_change.c \ conftest/gid_change/Makefile diff --git a/srpt/conftest/dev_attr_max_send_sge/Makefile b/srpt/conftest/dev_attr_max_send_sge/Makefile new file mode 100644 index 000000000..48187159e --- /dev/null +++ b/srpt/conftest/dev_attr_max_send_sge/Makefile @@ -0,0 +1,3 @@ +LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) + +obj-m += dev_attr_max_send_sge.o diff --git a/srpt/conftest/dev_attr_max_send_sge/dev_attr_max_send_sge.c b/srpt/conftest/dev_attr_max_send_sge/dev_attr_max_send_sge.c new file mode 100644 index 000000000..8e0530411 --- /dev/null +++ b/srpt/conftest/dev_attr_max_send_sge/dev_attr_max_send_sge.c @@ -0,0 +1,10 @@ +#include +#include +#include + +static int modinit(void) +{ + return offsetof(struct ib_device_attr, max_send_sge); +} + +module_init(modinit); diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index d2ad5f262..47529915b 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2249,7 +2249,7 @@ retry: * max_sge values < max_sge_delta, use max_sge. For intermediate * max_sge values, use max_sge_delta. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) +#if HAVE_DEV_ATTR_MAX_SEND_SGE ch->max_send_sge = sdev->dev_attr.max_send_sge; ch->max_recv_sge = sdev->dev_attr.max_recv_sge; #else