ib_srpt: Merge build and login fixes from trunk

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5580 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2014-06-11 14:33:30 +00:00
parent f7bd8e034b
commit 68489e57f9
9 changed files with 52 additions and 17 deletions
+10 -8
View File
@@ -78,10 +78,15 @@ 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)
HAVE_KCFLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/kcflags KCFLAGS=-DKCFLAGS_MACRO=1 >/dev/null 2>&1 && echo true || echo false)
HAVE_PRE_CFLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/pre_cflags PRE_CFLAGS=-DPRE_CFLAGS_MACRO=1 >/dev/null 2>&1 && echo true || echo false)
AUTOCONF_FLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >/dev/null 2>&1 && 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)" \
KCFLAGS="$(AUTOCONF_FLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules
install: all src/ib_srpt.ko
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \
@@ -93,6 +98,10 @@ uninstall:
-/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER)
src/Module.symvers src/Modules.symvers: $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS)
@if [ $(HAVE_KCFLAGS) = false -a $(HAVE_PRE_CFLAGS) = false ]; then \
echo "Error: the kernel build system has not yet been patched.";\
false; \
fi
@if [ -n "$(OFED_KERNEL_IB_RPM)" ]; then \
if [ -z "$(OFED_KERNEL_IB_DEVEL_RPM)" ]; then \
echo "Error: the OFED package $(OFED_KERNEL_IB_RPM)-devel has" \
@@ -107,13 +116,6 @@ src/Module.symvers src/Modules.symvers: $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS)
echo "Error: OFED has been built with srpt=y in ofed.conf."; \
echo "Rebuild OFED with srpt=n."; \
false; \
elif [ -e $(KDIR)/scripts/Makefile.lib ] \
&& ! grep -wq '^c_flags .*PRE_CFLAGS' \
$(KDIR)/scripts/Makefile.lib \
&& ! grep -wq '^LINUXINCLUDE .*PRE_CFLAGS' \
$(KDIR)/Makefile; then \
echo "Error: the kernel build system has not yet been patched.";\
false; \
else \
echo " Building against $(OFED_KERNEL_IB_RPM) InfiniBand" \
"kernel headers."; \
+1
View File
@@ -0,0 +1 @@
obj-m += gid_change.o
+9
View File
@@ -0,0 +1,9 @@
#include <linux/module.h>
#include <rdma/ib_verbs.h>
static int modinit(void)
{
return IB_EVENT_GID_CHANGE;
}
module_init(modinit);
+1
View File
@@ -0,0 +1 @@
obj-m += kcflags.o
+8
View File
@@ -0,0 +1,8 @@
#include <linux/module.h>
static int modinit(void)
{
return KCFLAGS_MACRO;
}
module_init(modinit);
+1
View File
@@ -0,0 +1 @@
obj-m += pre_cflags.o
+8
View File
@@ -0,0 +1,8 @@
#include <linux/module.h>
static int modinit(void)
{
return PRE_CFLAGS_MACRO;
}
module_init(modinit);
+13 -3
View File
@@ -1938,9 +1938,11 @@ static void srpt_process_send_completion(struct ib_cq *cq,
} else if (opcode == SRPT_RDMA_READ_LAST ||
opcode == SRPT_RDMA_WRITE_LAST) {
PRINT_INFO("RDMA t %d for idx %u failed with status %d."
"%s", opcode, index, wc->status,
wc->status == IB_WC_WR_FLUSH_ERR ?
" If this has not been triggered by a cable"
" pull, please check the involved IB HCA's"
" and cables.", opcode, index, wc->status);
" and cables." : "");
srpt_handle_rdma_err_comp(ch, ch->ioctx_ring[index],
opcode, srpt_xmt_rsp_context);
} else if (opcode == SRPT_RDMA_ZEROLENGTH_WRITE) {
@@ -2057,6 +2059,16 @@ static int srpt_compl_thread(void *arg)
ch = arg;
BUG_ON(!ch);
while (ch->state < CH_LIVE) {
set_current_state(TASK_INTERRUPTIBLE);
if (srpt_process_completion(ch, poll_budget) >= poll_budget)
cond_resched();
else
schedule();
}
srpt_process_wait_list(ch);
while (ch->state < CH_DISCONNECTED) {
set_current_state(TASK_INTERRUPTIBLE);
if (srpt_process_completion(ch, poll_budget) >= poll_budget)
@@ -2247,9 +2259,7 @@ static void __srpt_close_all_ch(struct srpt_tgt *srpt_tgt)
struct srpt_nexus *nexus;
struct srpt_rdma_ch *ch;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
lockdep_assert_held(&srpt_tgt->mutex);
#endif
list_for_each_entry(nexus, &srpt_tgt->nexus_list, entry) {
list_for_each_entry(ch, &nexus->ch_list, list) {
+1 -6
View File
@@ -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