* [git pull] IB updates for 2.6.15
@ 2005-11-18 22:23 Roland Dreier
0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2005-11-18 22:23 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, openib-general
Linus, please pull from
master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
This tree is also available from kernel.org mirrors at:
git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
The pull will get the following changes:
Michael S. Tsirkin:
IB/mthca: Safer max_send_sge/max_recv_sge calculation
Roland Dreier:
[IB] srp: increase max_luns
[IB] srp: don't post receive if no send buf available
[IB] mthca: don't disable RDMA writes if no responder resources
IB/umad: make sure write()s have sufficient data
drivers/infiniband/core/user_mad.c | 2 +-
drivers/infiniband/hw/mthca/mthca_qp.c | 37 ++++++++++++++++----------------
drivers/infiniband/ulp/srp/ib_srp.c | 17 ++++++++++-----
drivers/infiniband/ulp/srp/ib_srp.h | 1 +
4 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 5ea741f..e73f81c 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -312,7 +312,7 @@ static ssize_t ib_umad_write(struct file
int ret, length, hdr_len, copy_offset;
int rmpp_active = 0;
- if (count < sizeof (struct ib_user_mad))
+ if (count < sizeof (struct ib_user_mad) + IB_MGMT_RMPP_HDR)
return -EINVAL;
length = count - sizeof (struct ib_user_mad);
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 760c418..dd4e133 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -730,15 +730,16 @@ int mthca_modify_qp(struct ib_qp *ibqp,
}
if (attr_mask & IB_QP_ACCESS_FLAGS) {
+ qp_context->params2 |=
+ cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_WRITE ?
+ MTHCA_QP_BIT_RWE : 0);
+
/*
- * Only enable RDMA/atomics if we have responder
- * resources set to a non-zero value.
+ * Only enable RDMA reads and atomics if we have
+ * responder resources set to a non-zero value.
*/
if (qp->resp_depth) {
qp_context->params2 |=
- cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_WRITE ?
- MTHCA_QP_BIT_RWE : 0);
- qp_context->params2 |=
cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_READ ?
MTHCA_QP_BIT_RRE : 0);
qp_context->params2 |=
@@ -759,31 +760,27 @@ int mthca_modify_qp(struct ib_qp *ibqp,
if (qp->resp_depth && !attr->max_dest_rd_atomic) {
/*
* Lowering our responder resources to zero.
- * Turn off RDMA/atomics as responder.
- * (RWE/RRE/RAE in params2 already zero)
+ * Turn off reads RDMA and atomics as responder.
+ * (RRE/RAE in params2 already zero)
*/
- qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE |
- MTHCA_QP_OPTPAR_RRE |
+ qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE |
MTHCA_QP_OPTPAR_RAE);
}
if (!qp->resp_depth && attr->max_dest_rd_atomic) {
/*
* Increasing our responder resources from
- * zero. Turn on RDMA/atomics as appropriate.
+ * zero. Turn on RDMA reads and atomics as
+ * appropriate.
*/
qp_context->params2 |=
- cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_WRITE ?
- MTHCA_QP_BIT_RWE : 0);
- qp_context->params2 |=
cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_READ ?
MTHCA_QP_BIT_RRE : 0);
qp_context->params2 |=
cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_ATOMIC ?
MTHCA_QP_BIT_RAE : 0);
- qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE |
- MTHCA_QP_OPTPAR_RRE |
+ qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE |
MTHCA_QP_OPTPAR_RAE);
}
@@ -921,10 +918,12 @@ static void mthca_adjust_qp_caps(struct
else
qp->max_inline_data = max_data_size - MTHCA_INLINE_HEADER_SIZE;
- qp->sq.max_gs = max_data_size / sizeof (struct mthca_data_seg);
- qp->rq.max_gs = (min(dev->limits.max_desc_sz, 1 << qp->rq.wqe_shift) -
- sizeof (struct mthca_next_seg)) /
- sizeof (struct mthca_data_seg);
+ qp->sq.max_gs = min_t(int, dev->limits.max_sg,
+ max_data_size / sizeof (struct mthca_data_seg));
+ qp->rq.max_gs = min_t(int, dev->limits.max_sg,
+ (min(dev->limits.max_desc_sz, 1 << qp->rq.wqe_shift) -
+ sizeof (struct mthca_next_seg)) /
+ sizeof (struct mthca_data_seg));
}
/*
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 321a3a1..ee9fe22 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -802,13 +802,21 @@ static int srp_post_recv(struct srp_targ
/*
* Must be called with target->scsi_host->host_lock held to protect
- * req_lim and tx_head.
+ * req_lim and tx_head. Lock cannot be dropped between call here and
+ * call to __srp_post_send().
*/
static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target)
{
if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE)
return NULL;
+ if (unlikely(target->req_lim < 1)) {
+ if (printk_ratelimit())
+ printk(KERN_DEBUG PFX "Target has req_lim %d\n",
+ target->req_lim);
+ return NULL;
+ }
+
return target->tx_ring[target->tx_head & SRP_SQ_SIZE];
}
@@ -823,11 +831,6 @@ static int __srp_post_send(struct srp_ta
struct ib_send_wr wr, *bad_wr;
int ret = 0;
- if (target->req_lim < 1) {
- printk(KERN_ERR PFX "Target has req_lim %d\n", target->req_lim);
- return -EAGAIN;
- }
-
list.addr = iu->dma;
list.length = len;
list.lkey = target->srp_host->mr->lkey;
@@ -1417,6 +1420,8 @@ static ssize_t srp_create_target(struct
if (!target_host)
return -ENOMEM;
+ target_host->max_lun = SRP_MAX_LUN;
+
target = host_to_target(target_host);
memset(target, 0, sizeof *target);
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 4fec28a..b564f18 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -54,6 +54,7 @@ enum {
SRP_PORT_REDIRECT = 1,
SRP_DLID_REDIRECT = 2,
+ SRP_MAX_LUN = 512,
SRP_MAX_IU_LEN = 256,
SRP_RQ_SHIFT = 6,
^ permalink raw reply related [flat|nested] 2+ messages in thread* [git pull] IB updates for 2.6.15
@ 2005-11-10 20:18 Roland Dreier
0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2005-11-10 20:18 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, openib-general
Linus, please pull from
master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
This tree is also available from kernel.org mirrors at:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
The pull will get the following changes:
Jack Morgenstein:
[IB] mthca: report page size capability
[IB] uverbs: have kernel return QP capabilities
Michael S. Tsirkin:
[IB] umad: two small fixes
[IB] mthca: fix posting of atomic operations
[IB] mthca: fix posting long lists of receive work requests
Roland Dreier:
[IPoIB] add path record information in debugfs
[IB] umad: avoid potential deadlock when unregistering MAD agents
[IPoIB] no need to set skb->dev right before freeing skb
[IB] mthca: fix typo in catastrophic error polling
[IB] Have cq_resize() method take an int, not int*
[IB] umad: get rid of unused mr array
[IB] mthca: fix wraparound handling in mthca_cq_clean()
[IB] umad: further ib_unregister_mad_agent() deadlock fixes
drivers/infiniband/core/user_mad.c | 129 ++++++++++-------
drivers/infiniband/core/uverbs_cmd.c | 12 +-
drivers/infiniband/core/verbs.c | 12 --
drivers/infiniband/hw/mthca/mthca_catas.c | 2
drivers/infiniband/hw/mthca/mthca_cmd.c | 2
drivers/infiniband/hw/mthca/mthca_cq.c | 16 +-
drivers/infiniband/hw/mthca/mthca_dev.h | 2
drivers/infiniband/hw/mthca/mthca_main.c | 2
drivers/infiniband/hw/mthca/mthca_provider.c | 3
drivers/infiniband/hw/mthca/mthca_provider.h | 1
drivers/infiniband/hw/mthca/mthca_qp.c | 113 +++++++++++++--
drivers/infiniband/hw/mthca/mthca_srq.c | 22 +++
drivers/infiniband/hw/mthca/mthca_wqe.h | 3
drivers/infiniband/ulp/ipoib/ipoib.h | 15 +-
drivers/infiniband/ulp/ipoib/ipoib_fs.c | 179 ++++++++++++++++++++----
drivers/infiniband/ulp/ipoib/ipoib_main.c | 72 +++++++++-
drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 26 +--
drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 7 -
include/rdma/ib_user_verbs.h | 9 +
include/rdma/ib_verbs.h | 2
20 files changed, 466 insertions(+), 163 deletions(-)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-18 22:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-18 22:23 [git pull] IB updates for 2.6.15 Roland Dreier
-- strict thread matches above, loose matches on Subject: below --
2005-11-10 20:18 Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox