mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 03:31:26 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/in.h>
|
||||
#include <linux/in6.h>
|
||||
@@ -870,12 +871,26 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
goto fail_cq;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
|
||||
cq = ib_create_cq(ib_dev,
|
||||
isert_cq_comp_handler,
|
||||
isert_async_evt_handler,
|
||||
cq_desc, /* context */
|
||||
cqe_num,
|
||||
i); /* completion vector */
|
||||
#else
|
||||
{
|
||||
struct ib_cq_init_attr ia = {
|
||||
.cqe = cqe_num,
|
||||
.comp_vector = i,
|
||||
};
|
||||
cq = ib_create_cq(ib_dev,
|
||||
isert_cq_comp_handler,
|
||||
isert_async_evt_handler,
|
||||
cq_desc, /* context */
|
||||
&ia);
|
||||
}
|
||||
#endif
|
||||
if (unlikely(IS_ERR(cq))) {
|
||||
cq_desc->cq = NULL;
|
||||
err = PTR_ERR(cq);
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <linux/fs.h> /* everything... */
|
||||
#include <linux/errno.h> /* error codes */
|
||||
#include <linux/poll.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
|
||||
#include <linux/freezer.h>
|
||||
|
||||
@@ -523,7 +523,7 @@ ssize_t iscsi_sysfs_send_event(uint32_t tid, enum iscsi_kern_event_code code,
|
||||
goto out;
|
||||
|
||||
TRACE_DBG("Sending event %d (tid %d, param1 %s, param2 %s, cookie %d, "
|
||||
"info %p)", tid, code, param1, param2, info->info_cookie, info);
|
||||
"info %p)", code, tid, param1, param2, info->info_cookie, info);
|
||||
|
||||
res = event_send(tid, 0, 0, info->info_cookie, code, param1, param2);
|
||||
if (res <= 0) {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/ktime.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <scsi/sg.h>
|
||||
|
||||
#ifdef INSIDE_KERNEL_TREE
|
||||
|
||||
@@ -159,8 +159,7 @@ parse_scst_conf() {
|
||||
x86_64|i686)
|
||||
SCST_OPT_MODULES="crc32c-intel $SCST_OPT_MODULES";;
|
||||
esac
|
||||
SCST_MODULES="$SCST_MODULES isert_scst"
|
||||
SCST_OPT_MODULES="crc32c $SCST_OPT_MODULES"
|
||||
SCST_OPT_MODULES="crc32c isert_scst $SCST_OPT_MODULES"
|
||||
SCST_DAEMONS="${ISCSI_DAEMON} $SCST_DAEMONS"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -77,9 +77,14 @@ endif
|
||||
OFED_MODULE_SYMVERS:=$(OFED_KERNEL_DIR)/$(MODULE_SYMVERS)
|
||||
endif
|
||||
|
||||
CREATE_CQ_FLAG = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/create_cq PRE_CFLAGS="$(OFED_CFLAGS) -Werror" >/dev/null 2>&1 && echo -DIB_CREATE_CQ_HAS_INIT_ATTR)
|
||||
CREATE_SEND_MAD_AH_FLAG := $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/create_send_mad_ah PRE_CFLAGS="$(OFED_CFLAGS) -Werror" >/dev/null 2>&1 && echo -DCREATE_SEND_MAD_HAS_AH_ARG)
|
||||
ifeq ($(CREATE_SEND_MAD_AH_FLAG),)
|
||||
CREATE_SEND_MAD_BASE_FLAG := $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/create_send_mad_base PRE_CFLAGS="$(OFED_CFLAGS) -Werror" >/dev/null 2>&1 && echo -DCREATE_SEND_MAD_HAS_BASE_ARG)
|
||||
endif
|
||||
GID_CHANGE_FLAG = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >/dev/null 2>&1 && echo -DHAVE_IB_EVENT_GID_CHANGE)
|
||||
REGISTER_MAD_AGENT_FLAG = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/register_mad_agent PRE_CFLAGS="$(OFED_CFLAGS) -Werror" >/dev/null 2>&1 && echo -DREGISTER_MAD_AGENT_HAS_FLAGS_ARG)
|
||||
PRE_CFLAGS=$(OFED_CFLAGS) $(GID_CHANGE_FLAG) $(REGISTER_MAD_AGENT_FLAG) -DOFED_FLAVOR=$(OFED_FLAVOR)
|
||||
PRE_CFLAGS=$(OFED_CFLAGS) $(CREATE_CQ_FLAG) $(CREATE_SEND_MAD_AH_FLAG) $(CREATE_SEND_MAD_BASE_FLAG) $(GID_CHANGE_FLAG) $(REGISTER_MAD_AGENT_FLAG) -DOFED_FLAVOR=$(OFED_FLAVOR)
|
||||
|
||||
all: src/$(MODULE_SYMVERS)
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \
|
||||
|
||||
3
srpt/conftest/create_cq/Makefile
Normal file
3
srpt/conftest/create_cq/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += create_cq.o
|
||||
13
srpt/conftest/create_cq/create_cq.c
Normal file
13
srpt/conftest/create_cq/create_cq.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_cq *q;
|
||||
|
||||
q = ib_create_cq(NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
return q != 0;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
srpt/conftest/create_send_mad_ah/Makefile
Normal file
3
srpt/conftest/create_send_mad_ah/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += create_send_mad_ah.o
|
||||
13
srpt/conftest/create_send_mad_ah/create_send_mad_ah.c
Normal file
13
srpt/conftest/create_send_mad_ah/create_send_mad_ah.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_mad_send_buf *b;
|
||||
|
||||
b = ib_create_send_mad(NULL, 0, 0, NULL, 0, 0, 0, 0);
|
||||
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
3
srpt/conftest/create_send_mad_base/Makefile
Normal file
3
srpt/conftest/create_send_mad_base/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += create_send_mad_base.o
|
||||
13
srpt/conftest/create_send_mad_base/create_send_mad_base.c
Normal file
13
srpt/conftest/create_send_mad_base/create_send_mad_base.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
struct ib_mad_send_buf *b;
|
||||
|
||||
b = ib_create_send_mad(NULL, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
@@ -621,9 +621,16 @@ static void srpt_mad_recv_handler(struct ib_mad_agent *mad_agent,
|
||||
BUILD_BUG_ON(offsetof(struct ib_dm_mad, data) != IB_MGMT_DEVICE_HDR);
|
||||
|
||||
rsp = ib_create_send_mad(mad_agent, mad_wc->wc->src_qp,
|
||||
mad_wc->wc->pkey_index, 0,
|
||||
IB_MGMT_DEVICE_HDR, IB_MGMT_DEVICE_DATA,
|
||||
GFP_KERNEL);
|
||||
mad_wc->wc->pkey_index,
|
||||
#ifdef CREATE_SEND_MAD_HAS_AH_ARG
|
||||
NULL,
|
||||
#endif
|
||||
0, IB_MGMT_DEVICE_HDR, IB_MGMT_DEVICE_DATA,
|
||||
GFP_KERNEL
|
||||
#ifdef CREATE_SEND_MAD_HAS_BASE_ARG
|
||||
, 0
|
||||
#endif
|
||||
);
|
||||
if (IS_ERR(rsp))
|
||||
goto err_rsp;
|
||||
|
||||
@@ -2174,9 +2181,17 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
|
||||
&& !defined(RHEL_RELEASE_CODE)
|
||||
ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch,
|
||||
ch->rq_size + srpt_sq_size);
|
||||
#else
|
||||
#elif !defined(IB_CREATE_CQ_HAS_INIT_ATTR)
|
||||
ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch,
|
||||
ch->rq_size + srpt_sq_size, ch->comp_vector);
|
||||
#else
|
||||
{
|
||||
struct ib_cq_init_attr ia = { };
|
||||
|
||||
ia.cqe = ch->rq_size + srpt_sq_size;
|
||||
ia.comp_vector = ch->comp_vector;
|
||||
ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch, &ia);
|
||||
}
|
||||
#endif
|
||||
if (IS_ERR(ch->cq)) {
|
||||
ret = PTR_ERR(ch->cq);
|
||||
|
||||
Reference in New Issue
Block a user