mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL] please pull infiniband.git
@ 2007-11-27  6:21 Roland Dreier
  2007-11-27  8:59 ` [ofa-general] " Jack Morgenstein
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Dreier @ 2007-11-27  6:21 UTC (permalink / raw)
  To: torvalds; +Cc: general, linux-kernel

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

This will pull some small fixes for 2.6.24:

Erez Zilber (1):
      IB/iser: Add missing counter increment in iser_data_buf_aligned_len()

Jack Morgenstein (1):
      mlx4_core: Fix state check in mlx4_qp_modify()

Joachim Fenkes (1):
      IB/ehca: Fix static rate regression

Ralph Campbell (4):
      IB/ipath: Fix offset returned to ibv_resize_cq()
      IB/ipath: Fix error path in QP creation
      IB/ipath: Fix offset returned to ibv_modify_srq()
      IB/ipath: Normalize error return codes for posting work requests

 drivers/infiniband/hw/ehca/ehca_qp.c      |    4 +-
 drivers/infiniband/hw/ipath/ipath_cq.c    |   19 +++++++++---
 drivers/infiniband/hw/ipath/ipath_qp.c    |   15 ++++++----
 drivers/infiniband/hw/ipath/ipath_srq.c   |   44 +++++++++++++++++------------
 drivers/infiniband/hw/ipath/ipath_verbs.c |    8 +++--
 drivers/infiniband/ulp/iser/iser_memory.c |    6 ++-
 drivers/net/mlx4/qp.c                     |    2 +-
 7 files changed, 61 insertions(+), 37 deletions(-)


diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 2e3e654..dd12668 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -1203,7 +1203,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
 		mqpcb->service_level = attr->ah_attr.sl;
 		update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SERVICE_LEVEL, 1);
 
-		if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
+		if (ehca_calc_ipd(shca, mqpcb->prim_phys_port,
 				  attr->ah_attr.static_rate,
 				  &mqpcb->max_static_rate)) {
 			ret = -EINVAL;
@@ -1302,7 +1302,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
 		mqpcb->source_path_bits_al = attr->alt_ah_attr.src_path_bits;
 		mqpcb->service_level_al = attr->alt_ah_attr.sl;
 
-		if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
+		if (ehca_calc_ipd(shca, mqpcb->alt_phys_port,
 				  attr->alt_ah_attr.static_rate,
 				  &mqpcb->max_static_rate_al)) {
 			ret = -EINVAL;
diff --git a/drivers/infiniband/hw/ipath/ipath_cq.c b/drivers/infiniband/hw/ipath/ipath_cq.c
index 08d8ae1..d1380c7 100644
--- a/drivers/infiniband/hw/ipath/ipath_cq.c
+++ b/drivers/infiniband/hw/ipath/ipath_cq.c
@@ -395,12 +395,9 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 		goto bail;
 	}
 
-	/*
-	 * Return the address of the WC as the offset to mmap.
-	 * See ipath_mmap() for details.
-	 */
+	/* Check that we can write the offset to mmap. */
 	if (udata && udata->outlen >= sizeof(__u64)) {
-		__u64 offset = (__u64) wc;
+		__u64 offset = 0;
 
 		ret = ib_copy_to_udata(udata, &offset, sizeof(offset));
 		if (ret)
@@ -450,6 +447,18 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 		struct ipath_mmap_info *ip = cq->ip;
 
 		ipath_update_mmap_info(dev, ip, sz, wc);
+
+		/*
+		 * Return the offset to mmap.
+		 * See ipath_mmap() for details.
+		 */
+		if (udata && udata->outlen >= sizeof(__u64)) {
+			ret = ib_copy_to_udata(udata, &ip->offset,
+					       sizeof(ip->offset));
+			if (ret)
+				goto bail;
+		}
+
 		spin_lock_irq(&dev->pending_lock);
 		if (list_empty(&ip->pending_mmaps))
 			list_add(&ip->pending_mmaps, &dev->pending_mmaps);
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 6a41fdb..b997ff8 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -835,7 +835,8 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
 				      init_attr->qp_type);
 		if (err) {
 			ret = ERR_PTR(err);
-			goto bail_rwq;
+			vfree(qp->r_rq.wq);
+			goto bail_qp;
 		}
 		qp->ip = NULL;
 		ipath_reset_qp(qp);
@@ -863,7 +864,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
 					       sizeof(offset));
 			if (err) {
 				ret = ERR_PTR(err);
-				goto bail_rwq;
+				goto bail_ip;
 			}
 		} else {
 			u32 s = sizeof(struct ipath_rwq) +
@@ -875,7 +876,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
 						   qp->r_rq.wq);
 			if (!qp->ip) {
 				ret = ERR_PTR(-ENOMEM);
-				goto bail_rwq;
+				goto bail_ip;
 			}
 
 			err = ib_copy_to_udata(udata, &(qp->ip->offset),
@@ -907,9 +908,11 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
 	goto bail;
 
 bail_ip:
-	kfree(qp->ip);
-bail_rwq:
-	vfree(qp->r_rq.wq);
+	if (qp->ip)
+		kref_put(&qp->ip->ref, ipath_release_mmap_info);
+	else
+		vfree(qp->r_rq.wq);
+	ipath_free_qp(&dev->qp_table, qp);
 bail_qp:
 	kfree(qp);
 bail_swq:
diff --git a/drivers/infiniband/hw/ipath/ipath_srq.c b/drivers/infiniband/hw/ipath/ipath_srq.c
index 40c36ec..2fef36f 100644
--- a/drivers/infiniband/hw/ipath/ipath_srq.c
+++ b/drivers/infiniband/hw/ipath/ipath_srq.c
@@ -59,7 +59,7 @@ int ipath_post_srq_receive(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
 
 		if ((unsigned) wr->num_sge > srq->rq.max_sge) {
 			*bad_wr = wr;
-			ret = -ENOMEM;
+			ret = -EINVAL;
 			goto bail;
 		}
 
@@ -211,11 +211,11 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 		     struct ib_udata *udata)
 {
 	struct ipath_srq *srq = to_isrq(ibsrq);
+	struct ipath_rwq *wq;
 	int ret = 0;
 
 	if (attr_mask & IB_SRQ_MAX_WR) {
 		struct ipath_rwq *owq;
-		struct ipath_rwq *wq;
 		struct ipath_rwqe *p;
 		u32 sz, size, n, head, tail;
 
@@ -236,27 +236,20 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 			goto bail;
 		}
 
-		/*
-		 * Return the address of the RWQ as the offset to mmap.
-		 * See ipath_mmap() for details.
-		 */
+		/* Check that we can write the offset to mmap. */
 		if (udata && udata->inlen >= sizeof(__u64)) {
 			__u64 offset_addr;
-			__u64 offset = (__u64) wq;
+			__u64 offset = 0;
 
 			ret = ib_copy_from_udata(&offset_addr, udata,
 						 sizeof(offset_addr));
-			if (ret) {
-				vfree(wq);
-				goto bail;
-			}
+			if (ret)
+				goto bail_free;
 			udata->outbuf = (void __user *) offset_addr;
 			ret = ib_copy_to_udata(udata, &offset,
 					       sizeof(offset));
-			if (ret) {
-				vfree(wq);
-				goto bail;
-			}
+			if (ret)
+				goto bail_free;
 		}
 
 		spin_lock_irq(&srq->rq.lock);
@@ -277,10 +270,8 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 		else
 			n -= tail;
 		if (size <= n) {
-			spin_unlock_irq(&srq->rq.lock);
-			vfree(wq);
 			ret = -EINVAL;
-			goto bail;
+			goto bail_unlock;
 		}
 		n = 0;
 		p = wq->wq;
@@ -314,6 +305,18 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 			u32 s = sizeof(struct ipath_rwq) + size * sz;
 
 			ipath_update_mmap_info(dev, ip, s, wq);
+
+			/*
+			 * Return the offset to mmap.
+			 * See ipath_mmap() for details.
+			 */
+			if (udata && udata->inlen >= sizeof(__u64)) {
+				ret = ib_copy_to_udata(udata, &ip->offset,
+						       sizeof(ip->offset));
+				if (ret)
+					goto bail;
+			}
+
 			spin_lock_irq(&dev->pending_lock);
 			if (list_empty(&ip->pending_mmaps))
 				list_add(&ip->pending_mmaps,
@@ -328,7 +331,12 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 			srq->limit = attr->srq_limit;
 		spin_unlock_irq(&srq->rq.lock);
 	}
+	goto bail;
 
+bail_unlock:
+	spin_unlock_irq(&srq->rq.lock);
+bail_free:
+	vfree(wq);
 bail:
 	return ret;
 }
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 74f77e7..c4c9984 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -302,8 +302,10 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
 	next = qp->s_head + 1;
 	if (next >= qp->s_size)
 		next = 0;
-	if (next == qp->s_last)
-		goto bail_inval;
+	if (next == qp->s_last) {
+		ret = -ENOMEM;
+		goto bail;
+	}
 
 	wqe = get_swqe_ptr(qp, qp->s_head);
 	wqe->wr = *wr;
@@ -404,7 +406,7 @@ static int ipath_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
 
 		if ((unsigned) wr->num_sge > qp->r_rq.max_sge) {
 			*bad_wr = wr;
-			ret = -ENOMEM;
+			ret = -EINVAL;
 			goto bail;
 		}
 
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index d687980..4a17743 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -310,13 +310,15 @@ static unsigned int iser_data_buf_aligned_len(struct iser_data_buf *data,
 		if (i + 1 < data->dma_nents) {
 			next_addr = ib_sg_dma_address(ibdev, sg_next(sg));
 			/* are i, i+1 fragments of the same page? */
-			if (end_addr == next_addr)
+			if (end_addr == next_addr) {
+				cnt++;
 				continue;
-			else if (!IS_4K_ALIGNED(end_addr)) {
+			} else if (!IS_4K_ALIGNED(end_addr)) {
 				ret_len = cnt + 1;
 				break;
 			}
 		}
+		cnt++;
 	}
 	if (i == data->dma_nents)
 		ret_len = cnt;	/* loop ended */
diff --git a/drivers/net/mlx4/qp.c b/drivers/net/mlx4/qp.c
index 42b4763..fa24e65 100644
--- a/drivers/net/mlx4/qp.c
+++ b/drivers/net/mlx4/qp.c
@@ -113,7 +113,7 @@ int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
 	struct mlx4_cmd_mailbox *mailbox;
 	int ret = 0;
 
-	if (cur_state >= MLX4_QP_NUM_STATE || cur_state >= MLX4_QP_NUM_STATE ||
+	if (cur_state >= MLX4_QP_NUM_STATE || new_state >= MLX4_QP_NUM_STATE ||
 	    !op[cur_state][new_state])
 		return -EINVAL;
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ofa-general] [GIT PULL] please pull infiniband.git
  2007-11-27  6:21 [GIT PULL] please pull infiniband.git Roland Dreier
@ 2007-11-27  8:59 ` Jack Morgenstein
  0 siblings, 0 replies; 5+ messages in thread
From: Jack Morgenstein @ 2007-11-27  8:59 UTC (permalink / raw)
  To: general; +Cc: Roland Dreier, torvalds, linux-kernel

On Tuesday 27 November 2007 08:21, Roland Dreier wrote:
> Linus, please pull from
> 
>     master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
> 
> 
> Jack Morgenstein (1):
>       mlx4_core: Fix state check in mlx4_qp_modify()
> 
MUST also enter the patch I send yesterday:
[PATCH] ipoib: fix kernel Oops resulting from xmit when priv->broadcast is NULL.

(critical bug fix -- will get kernel Oopses whenever ports on the network go down!).
(patch given again below)

- Jack
======================================================================================================================
IPoIB: Fix kernel Oops resulting from xmit following dev_down.

If a port goes down, ipoib_ib_dev_down is invoked -- which flushed the mcasts (clearing
priv->broadcast) and clearing the path record cache. If ipoib_start_xmit is then invoked (before
the port is upped), a kernel Oops results from attempting to access priv->broadcast.

Returning NULL if priv->broadcast is NULL is a harmless way of bypassing the problem -- the
offending packet is simply discarded "without prejudice".

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index a03a65e..c9f6077 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -460,6 +460,9 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, void *gid)
 	struct ipoib_dev_priv *priv = netdev_priv(dev);
 	struct ipoib_path *path;
 
+	if (!priv->broadcast)
+		return NULL;
+
 	path = kzalloc(sizeof *path, GFP_ATOMIC);
 	if (!path)
 		return NULL;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ofa-general] [GIT PULL] please pull infiniband.git
  2009-06-25  5:22 ` [ofa-general] " Tziporet Koren
@ 2009-06-25  6:14   ` Roland Dreier
  0 siblings, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2009-06-25  6:14 UTC (permalink / raw)
  To: tziporet; +Cc: torvalds, akpm, linux-kernel, general


 > What about the patches from Yevgeny supporting our new ConnextX HW
 > coming soon?
 > 
 > I talk about:
 > http://lists.openfabrics.org/pipermail/general/2009-June/060225.html
 > http://lists.openfabrics.org/pipermail/general/2009-June/060226.html

Sorry, missed that going by the first time, will reply to the messages.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ofa-general] [GIT PULL] please pull infiniband.git
  2009-06-23 17:39 Roland Dreier
@ 2009-06-25  5:22 ` Tziporet Koren
  2009-06-25  6:14   ` Roland Dreier
  0 siblings, 1 reply; 5+ messages in thread
From: Tziporet Koren @ 2009-06-25  5:22 UTC (permalink / raw)
  To: Roland Dreier; +Cc: torvalds, akpm, linux-kernel, general

Roland Dreier wrote:
> 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
>
> This has a few more fixes for 2.6.31-rc1; however everything here
> should be a fix appropriate for -rc2 as well, so if this misses the
> end of the merge window then I think it should still be OK to pull.
>
>   

Roland
What about the patches from Yevgeny supporting our new ConnextX HW 
coming soon?

I talk about:
http://lists.openfabrics.org/pipermail/general/2009-June/060225.html
http://lists.openfabrics.org/pipermail/general/2009-June/060226.html

Since device ID is already in pci.ids I think it is important to have 
this code too, otherwise the driver will not load :-(

Thanks
Tziporet



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ofa-general] [GIT PULL] please pull infiniband.git
  2008-02-05  4:49 Roland Dreier
@ 2008-02-05 15:59 ` Tziporet Koren
  0 siblings, 0 replies; 5+ messages in thread
From: Tziporet Koren @ 2008-02-05 15:59 UTC (permalink / raw)
  To: Roland Dreier; +Cc: torvalds, linux-kernel, general

Roland Dreier wrote:
> 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
>
> This will get a second batch of InfiniBand/RDMA batches.  In addition
> to the usual motley crew of changes, this pull includes a new driver
> for NetEffect RNICs in drivers/infiniband/hw/nes.  The code could use
> some further cleaning, but I don't think it's worth holding off on the
> merge.
>
> David Dillow (1):
>       IB/srp: Retry stale connections
>
> Eli Cohen (2):
>       IB/mthca: Remove checks for srq->first_free < 0
>       IB/ib_mthca: Pre-link receive WQEs in Tavor mode
>
> Glenn Streiff (1):
>       RDMA/nes: Add a driver for NetEffect RNICs
>
> Hoang-Nam Nguyen (1):
>       IB/ehca: Add PMA support
>
> Jack Morgenstein (2):
>       IB/mthca: Don't read reserved fields in mthca_QUERY_ADAPTER()
>       mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
>
> Joachim Fenkes (2):
>       IB/ehca: Prevent sending UD packets to QP0
>       IB/ehca: Update sma_attr also in case of disruptive config change
>
> Olaf Kirch (1):
>       IB/mthca: Return proper error codes from mthca_fmr_alloc()
>
> Or Gerlitz (3):
>       IPoIB: Handle bonding failover race for connected neighbours too
>       IPoIB: Remove a misleading debug print
>       IB/fmr_pool: Allocate page list for pool FMRs only when caching enabled
>
> Roland Dreier (4):
>       mlx4_core: Fix more section mismatches
>       IB/mthca: Fix and simplify page size calculation in mthca_reg_phys_mr()
>       IB/mlx4: Actually print out the driver version
>       IB: Avoid marking __devinitdata as const
>
> Sean Hefty (1):
>       IB/cm: Add interim support for routed paths
>
>
>   

Does this means ConnectX WQE BB and stateless offload will not be in for 
2.6.25?

Tziporet


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-25  6:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-27  6:21 [GIT PULL] please pull infiniband.git Roland Dreier
2007-11-27  8:59 ` [ofa-general] " Jack Morgenstein
2008-02-05  4:49 Roland Dreier
2008-02-05 15:59 ` [ofa-general] " Tziporet Koren
2009-06-23 17:39 Roland Dreier
2009-06-25  5:22 ` [ofa-general] " Tziporet Koren
2009-06-25  6:14   ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome