diff --git a/srpt/Makefile b/srpt/Makefile index a97d930df..8453081f1 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -78,10 +78,12 @@ OFED_SRPT_PATH:=/lib/modules/$(KVER)/updates/kernel/drivers/infiniband/ulp/srpt/ # Whether or not the OFED ib_srpt.ko kernel module has been installed. OFED_SRPT_INSTALLED:=$(shell if [ -e $(OFED_SRPT_PATH) ]; then echo true; else echo false; fi) +AUTOCONF_FLAGS=$(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >&/dev/null && echo -DHAVE_IB_EVENT_GID_CHANGE) + all: src/$(MODULE_SYMVERS) $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \ - PRE_CFLAGS="$(OFED_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules + PRE_CFLAGS="$(OFED_CFLAGS) $(AUTOCONF_FLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules install: all src/ib_srpt.ko $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \ diff --git a/srpt/conftest/gid_change/Makefile b/srpt/conftest/gid_change/Makefile new file mode 100644 index 000000000..e81c05753 --- /dev/null +++ b/srpt/conftest/gid_change/Makefile @@ -0,0 +1 @@ +obj-m += gid_change.o diff --git a/srpt/conftest/gid_change/gid_change.c b/srpt/conftest/gid_change/gid_change.c new file mode 100644 index 000000000..bb60773fb --- /dev/null +++ b/srpt/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/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index 6596c0634..0e30e16ea 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -142,12 +142,7 @@ enum { }; #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) && \ - !(defined(CONFIG_SUSE_KERNEL) && \ - LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 76)) && \ - !(defined(RHEL_MAJOR) && \ - (RHEL_MAJOR -0 > 6 || \ - RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 >= 5 || \ - RHEL_MAJOR -0 == 5 && RHEL_MINOR -0 >= 9)) + !defined(HAVE_IB_EVENT_GID_CHANGE) /* See also patch "IB/core: Add GID change event" (commit 761d90ed4). */ enum { IB_EVENT_GID_CHANGE = 18 }; #endif