ib_srpt: Add a configure test for dev_attr.max_send_sge

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7420 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2018-07-14 00:42:07 +00:00
parent caf0571c3f
commit a4b443cc78
4 changed files with 20 additions and 1 deletions

View File

@@ -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

View File

@@ -0,0 +1,3 @@
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
obj-m += dev_attr_max_send_sge.o

View File

@@ -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_device_attr, max_send_sge);
}
module_init(modinit);

View File

@@ -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