Merged revisions 6693-6701 via svnmerge from

svn://svn.code.sf.net/p/scst/svn/trunk

........
  r6693 | vlnb | 2015-11-17 19:59:30 -0800 (Tue, 17 Nov 2015) | 5 lines
  
  scst: Add user space control for suspend/resume activities
  
  Useful to speed up mass management
........
  r6694 | vlnb | 2015-11-17 20:09:50 -0800 (Tue, 17 Nov 2015) | 6 lines
  
  scst: Rework Copy Manager's sysfs interface
  
  The old version had management incompatible with scstadmin and had
  issues with LUNs management.
........
  r6695 | bvassche | 2015-11-18 11:36:01 -0800 (Wed, 18 Nov 2015) | 8 lines
  
  scst: Make it easier to build without DLM support
  
  With this change all that is required to build without DLM support
  is to add the following in scst_priv.h:
  
  #undef CONFIG_DLM
  #undef CONFIG_DLM_MODULE
........
  r6696 | bvassche | 2015-11-18 14:10:03 -0800 (Wed, 18 Nov 2015) | 2 lines
  
  scst_pres: Suppress a compiler warning when building against a kernel with no DLM support
........
  r6697 | bvassche | 2015-11-18 14:10:33 -0800 (Wed, 18 Nov 2015) | 1 line
  
  scst_vdisk: Kernel v4.4 build fix
........
  r6698 | bvassche | 2015-11-18 14:10:54 -0800 (Wed, 18 Nov 2015) | 1 line
  
  ib_srpt: Kernel v4.4 build fix
........
  r6699 | bvassche | 2015-11-18 14:11:37 -0800 (Wed, 18 Nov 2015) | 1 line
  
  isert-scst: Port to Linux kernel v4.4
........
  r6700 | bvassche | 2015-11-18 14:44:29 -0800 (Wed, 18 Nov 2015) | 1 line
  
  scst: Do not build cluster PR support if CONFIG_SCST_NO_DLM has been set
........
  r6701 | vlnb | 2015-11-18 21:20:43 -0800 (Wed, 18 Nov 2015) | 3 lines
  
  scst: fix explicit ALUA disabled DIF type 2 handling
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.1.x@6702 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2015-11-19 05:21:59 +00:00
parent 7a043f2618
commit e35e79706e
17 changed files with 453 additions and 249 deletions
+60 -4
View File
@@ -3356,7 +3356,11 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
struct srpt_send_ioctx *ioctx,
scst_data_direction dir)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
struct ib_send_wr wr;
#else
struct ib_rdma_wr wr;
#endif
struct ib_send_wr *bad_wr;
struct rdma_iu *riu;
int i;
@@ -3377,6 +3381,7 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
memset(&wr, 0, sizeof(wr));
for (i = 0; i < n_rdma; ++i, ++riu) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
if (dir == SCST_DATA_READ) {
wr.opcode = IB_WR_RDMA_WRITE;
wr.wr_id = encode_wr_id(i == n_rdma - 1 ?
@@ -3401,6 +3406,32 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
wr.send_flags = IB_SEND_SIGNALED;
ret = ib_post_send(ch->qp, &wr, &bad_wr);
#else
if (dir == SCST_DATA_READ) {
wr.wr.opcode = IB_WR_RDMA_WRITE;
wr.wr.wr_id = encode_wr_id(i == n_rdma - 1 ?
SRPT_RDMA_WRITE_LAST :
SRPT_RDMA_MID,
ioctx->ioctx.index);
} else {
wr.wr.opcode = IB_WR_RDMA_READ;
wr.wr.wr_id = encode_wr_id(i == n_rdma - 1 ?
SRPT_RDMA_READ_LAST :
SRPT_RDMA_MID,
ioctx->ioctx.index);
}
wr.wr.next = NULL;
wr.remote_addr = riu->raddr;
wr.rkey = riu->rkey;
wr.wr.num_sge = riu->sge_cnt;
wr.wr.sg_list = riu->sge;
/* only get completion event for the last rdma wr */
if (i == (n_rdma - 1) && dir == SCST_DATA_WRITE)
wr.wr.send_flags = IB_SEND_SIGNALED;
ret = ib_post_send(ch->qp, &wr.wr, &bad_wr);
#endif
if (ret)
break;
}
@@ -3409,6 +3440,7 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
pr_err("%s: ib_post_send() returned %d for %d/%d\n", __func__,
ret, i, n_rdma);
if (ret && i > 0) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
wr.num_sge = 0;
wr.wr_id = encode_wr_id(SRPT_RDMA_ABORT, ioctx->ioctx.index);
wr.send_flags = IB_SEND_SIGNALED;
@@ -3420,13 +3452,34 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
ioctx->ioctx.index);
msleep(1000);
}
#else
wr.wr.num_sge = 0;
wr.wr.wr_id = encode_wr_id(SRPT_RDMA_ABORT, ioctx->ioctx.index);
wr.wr.send_flags = IB_SEND_SIGNALED;
pr_info("Trying to abort failed RDMA transfer [%d]\n",
ioctx->ioctx.index);
while (ch->state == CH_LIVE &&
ib_post_send(ch->qp, &wr.wr, &bad_wr) != 0) {
pr_info("Trying to abort failed RDMA transfer [%d]\n",
ioctx->ioctx.index);
msleep(1000);
}
#endif
pr_info("Waiting until RDMA abort finished [%d]\n",
ioctx->ioctx.index);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
while (ch->state < CH_DISCONNECTED && !ioctx->rdma_aborted) {
pr_info("Waiting until RDMA abort finished [%d]\n",
ioctx->ioctx.index);
msleep(1000);
}
#else
while (ch->state < CH_DISCONNECTED && !ioctx->rdma_aborted) {
pr_info("Waiting until RDMA abort finished [%d]\n",
ioctx->ioctx.index);
msleep(1000);
}
#endif
pr_info("%s[%d]: done\n", __func__, __LINE__);
}
@@ -4480,13 +4533,16 @@ static int __init srpt_init_module(void)
if (rdma_cm_port) {
struct sockaddr_in addr;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) || \
defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 6
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) && \
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6)
rdma_cm_id = rdma_create_id(srpt_rdma_cm_handler, NULL,
RDMA_PS_TCP);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
rdma_cm_id = rdma_create_id(srpt_rdma_cm_handler, NULL,
RDMA_PS_TCP, IB_QPT_RC);
#else
rdma_cm_id = rdma_create_id(srpt_rdma_cm_handler, NULL,
RDMA_PS_TCP);
rdma_cm_id = rdma_create_id(&init_net, srpt_rdma_cm_handler,
NULL, RDMA_PS_TCP, IB_QPT_RC);
#endif
if (IS_ERR(rdma_cm_id)) {
rdma_cm_id = NULL;