public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: frank zago <fzago-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [patch 5/8] ehca - ib_post_recv fixes Always set ib_post_recv()s bad_wr.
Date: Tue, 24 Nov 2009 11:36:46 -0600	[thread overview]
Message-ID: <4B0C19AE.6030006@systemfabricworks.com> (raw)
In-Reply-To: <20091124043323.927819053-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>

Signed-off-by: Frank Zago <fzago-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
Index: linux-2.6.31/drivers/infiniband/hw/ehca/ehca_reqs.c
===================================================================
--- linux-2.6.31.orig/drivers/infiniband/hw/ehca/ehca_reqs.c	2009-11-23 
21:23:08.000000000 -0600
+++ linux-2.6.31/drivers/infiniband/hw/ehca/ehca_reqs.c	2009-11-23 
21:25:48.000000000 -0600
@@ -519,7 +519,7 @@
  	if (unlikely(!HAS_RQ(my_qp))) {
  		ehca_err(dev, "QP has no RQ  ehca_qp=%p qp_num=%x ext_type=%d",
  			 my_qp, my_qp->real_qp_num, my_qp->ext_type);
-		return -ENODEV;
+		ret = -ENODEV;
  	}

  	/* LOCK the QUEUE */
@@ -533,13 +533,9 @@
  		wqe_p = ipz_qeit_get_inc(&my_qp->ipz_rqueue);
  		if (unlikely(!wqe_p)) {
  			/* too many posted work requests: queue overflow */
-			if (bad_recv_wr)
-				*bad_recv_wr = cur_recv_wr;
-			if (wqe_cnt == 0) {
-				ret = -ENOMEM;
-				ehca_err(dev, "Too many posted WQEs "
-					 "qp_num=%x", my_qp->real_qp_num);
-			}
+			ret = -ENOMEM;
+			ehca_err(dev, "Too many posted WQEs "
+				"qp_num=%x", my_qp->real_qp_num);
  			goto post_recv_exit0;
  		}
  		/*
@@ -558,11 +554,9 @@
  		if (unlikely(ret)) {
  			my_qp->ipz_rqueue.current_q_offset = start_offset;
  			*bad_recv_wr = cur_recv_wr;
-			if (wqe_cnt == 0) {
-				ret = -EINVAL;
-				ehca_err(dev, "Could not write WQE "
-					 "qp_num=%x", my_qp->real_qp_num);
-			}
+			ret = -EINVAL;
+			ehca_err(dev, "Could not write WQE "
+				"qp_num=%x", my_qp->real_qp_num);
  			goto post_recv_exit0;
  		}

@@ -581,6 +575,11 @@
  	    ehca_dbg(dev, "ehca_qp=%p qp_num=%x wqe_cnt=%d ret=%i",
  		     my_qp, my_qp->real_qp_num, wqe_cnt, ret);
  	spin_unlock_irqrestore(&my_qp->spinlock_r, flags);
+
+out:
+	if (ret)
+		*bad_recv_wr = cur_recv_wr;
+
  	return ret;
  }


-- 

--
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-11-24 17:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20091124043323.927819053@systemfabricworks.com>
     [not found] ` <20091124043323.927819053-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2009-11-24 17:36   ` [patch 1/8] Ammasso - ib_post_send fix frank zago
     [not found]     ` <4B0C19A1.1050008-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2009-12-02 17:34       ` Roland Dreier
2009-11-24 17:36   ` [patch 2/8] ehca - ib_post_send fixes Always set ib_post_send()s bad_wr. Do not report success if an error occurred frank zago
2009-11-24 17:36   ` [patch 3/8] cxgb3 - ib_post_send fixes frank zago
2009-11-24 17:36   ` [patch 4/8] cxgb3 - ib_post_recv fixes frank zago
2009-11-24 17:36   ` frank zago [this message]
     [not found]     ` <4B0C19AE.6030006-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2009-11-24 23:06       ` [patch 5/8] ehca - ib_post_recv fixes Always set ib_post_recv()s bad_wr Alexander Schmidt
2009-11-24 23:28         ` frank zago
2009-11-24 17:36   ` [patch 7/8] NES - ib_post_send fixes frank zago
     [not found]     ` <4B0C19B1.8030304-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2009-11-24 20:00       ` Tung, Chien Tin
2009-11-24 17:36   ` [patch 6/8] ammasso - ib_post_recv fix frank zago
2009-11-24 17:36   ` [patch 8/8] NES - ib_post_recv fixes frank zago
     [not found]     ` <4B0C19B8.8010807-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2009-11-24 20:00       ` Tung, Chien Tin

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=4B0C19AE.6030006@systemfabricworks.com \
    --to=fzago-klaocwyjdxkshymvu7je4pqqe7ycjdx5@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