mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
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:
@@ -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
|
||||
|
||||
3
srpt/conftest/dev_attr_max_send_sge/Makefile
Normal file
3
srpt/conftest/dev_attr_max_send_sge/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += dev_attr_max_send_sge.o
|
||||
10
srpt/conftest/dev_attr_max_send_sge/dev_attr_max_send_sge.c
Normal file
10
srpt/conftest/dev_attr_max_send_sge/dev_attr_max_send_sge.c
Normal 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);
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user