public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Frank Zago <frank-6OywahBdSro@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [patch 3/6] RDMA/cxgb3 - ib_post_send fixes
Date: Wed, 02 Dec 2009 20:36:05 -0600	[thread overview]
Message-ID: <4B172415.90808@zago.net> (raw)
In-Reply-To: <20091203023350.646158428-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>

Always set ib_post_send()'s bad_wr when an error occurred.

Signed-off-by: Frank Zago <fzago-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
---
 drivers/infiniband/hw/cxgb3/iwch_qp.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Index: linux-2.6.31/drivers/infiniband/hw/cxgb3/iwch_qp.c
===================================================================
--- linux-2.6.31.orig/drivers/infiniband/hw/cxgb3/iwch_qp.c	2009-12-02
19:20:53.000000000 -0600
+++ linux-2.6.31/drivers/infiniband/hw/cxgb3/iwch_qp.c	2009-12-02
19:23:20.000000000 -0600
@@ -365,18 +365,19 @@
 	spin_lock_irqsave(&qhp->lock, flag);
 	if (qhp->attr.state > IWCH_QP_STATE_RTS) {
 		spin_unlock_irqrestore(&qhp->lock, flag);
-		return -EINVAL;
+		err = -EINVAL;
+		goto out;
 	}
 	num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr,
 		  qhp->wq.sq_size_log2);
 	if (num_wrs <= 0) {
 		spin_unlock_irqrestore(&qhp->lock, flag);
-		return -ENOMEM;
+		err = -ENOMEM;
+		goto out;
 	}
 	while (wr) {
 		if (num_wrs == 0) {
 			err = -ENOMEM;
-			*bad_wr = wr;
 			break;
 		}
 		idx = Q_PTR2IDX(qhp->wq.wptr, qhp->wq.size_log2);
@@ -428,10 +429,8 @@
 			     wr->opcode);
 			err = -EINVAL;
 		}
-		if (err) {
-			*bad_wr = wr;
+		if (err)
 			break;
-		}
 		wqe->send.wrid.id0.hi = qhp->wq.sq_wptr;
 		sqp->wr_id = wr->wr_id;
 		sqp->opcode = wr2opcode(t3_wr_opcode);
@@ -454,6 +453,10 @@
 	}
 	spin_unlock_irqrestore(&qhp->lock, flag);
 	ring_doorbell(qhp->wq.doorbell, qhp->wq.qpid);
+
+out:
+	if (err)
+		*bad_wr = wr;
 	return err;
 }


-- 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-12-03  2:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20091203023350.646158428@systemfabricworks.com>
     [not found] ` <20091203023350.646158428-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2009-12-03  2:35   ` [patch 1/6] RDMA/amso1100 - ib_post_send fix Frank Zago
     [not found]     ` <4B172407.3080204-6OywahBdSro@public.gmane.org>
2009-12-09 22:57       ` Roland Dreier
2009-12-03  2:35   ` [patch 2/6] RDMA/ehca - ib_post_send fixes, v2 Frank Zago
     [not found]     ` <4B17240D.8060906-6OywahBdSro@public.gmane.org>
2009-12-09 23:08       ` Roland Dreier
2009-12-03  2:36   ` Frank Zago [this message]
2009-12-03  2:36   ` [patch 4/6] RDMA/cxgb3 - ib_post_recv fixes Frank Zago
2009-12-03  2:36   ` [patch 5/6] RDMA/ehca - ib_post_recv fixes, v2 Frank Zago
2009-12-03  2:36   ` [patch 6/6] RDMA/amso1100 - ib_post_recv fix Frank Zago

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B172415.90808@zago.net \
    --to=frank-6oywahbdsro@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox