mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland Dreier <roland@topspin.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH 06/14] IB/mthca: Set RDMA/atomic capabilities correctly
Date: Thu, 23 Jun 2005 21:04:20 -0700	[thread overview]
Message-ID: <2005623214.rtUVEh14lfm8dUC3@topspin.com> (raw)
In-Reply-To: <2005623214.ZulWzVKl5lpV91f5@topspin.com>

mthca apparently had the meanings of the max_rd_atomic and
max_dest_rd_atomic QP attributes backwards.  max_rd_atomic limits the
maximum number of outstanding RDMA/atomic requests as an initiator (on
a send queue), and max_dest_rd_atomic specifies the resources
allocated to handle RMDA/atomic requests from the remote end of the
connection.  We were programming our QP context with these values
swapped.

Signed-off-by: Roland Dreier <roland@topspin.com>

---

 linux.git/drivers/infiniband/hw/mthca/mthca_qp.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)



--- linux.git.orig/drivers/infiniband/hw/mthca/mthca_qp.c	2005-06-23 13:03:05.234984039 -0700
+++ linux.git/drivers/infiniband/hw/mthca/mthca_qp.c	2005-06-23 13:03:05.636897055 -0700
@@ -724,9 +724,9 @@ int mthca_modify_qp(struct ib_qp *ibqp, 
 		qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RETRY_COUNT);
 	}
 
-	if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) {
-		qp_context->params1 |= cpu_to_be32(min(attr->max_dest_rd_atomic ?
-						       ffs(attr->max_dest_rd_atomic) - 1 : 0,
+	if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) {
+		qp_context->params1 |= cpu_to_be32(min(attr->max_rd_atomic ?
+						       ffs(attr->max_rd_atomic) - 1 : 0,
 						       7) << 21);
 		qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_SRA_MAX);
 	}
@@ -764,10 +764,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, 
 		qp->atomic_rd_en = attr->qp_access_flags;
 	}
 
-	if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) {
+	if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) {
 		u8 rra_max;
 
-		if (qp->resp_depth && !attr->max_rd_atomic) {
+		if (qp->resp_depth && !attr->max_dest_rd_atomic) {
 			/*
 			 * Lowering our responder resources to zero.
 			 * Turn off RDMA/atomics as responder.
@@ -778,7 +778,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, 
 								MTHCA_QP_OPTPAR_RAE);
 		}
 
-		if (!qp->resp_depth && attr->max_rd_atomic) {
+		if (!qp->resp_depth && attr->max_dest_rd_atomic) {
 			/*
 			 * Increasing our responder resources from
 			 * zero.  Turn on RDMA/atomics as appropriate.
@@ -799,7 +799,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, 
 		}
 
 		for (rra_max = 0;
-		     1 << rra_max < attr->max_rd_atomic &&
+		     1 << rra_max < attr->max_dest_rd_atomic &&
 			     rra_max < dev->qp_table.rdb_shift;
 		     ++rra_max)
 			; /* nothing */
@@ -807,7 +807,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, 
 		qp_context->params2      |= cpu_to_be32(rra_max << 21);
 		qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRA_MAX);
 
-		qp->resp_depth = attr->max_rd_atomic;
+		qp->resp_depth = attr->max_dest_rd_atomic;
 	}
 
 	qp_context->params2 |= cpu_to_be32(MTHCA_QP_BIT_RSC);


  reply	other threads:[~2005-06-24  4:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24  4:04 [PATCH 00/14] IB/mthca: merge Roland Dreier
2005-06-24  4:04 ` [PATCH 01/14] IB/mthca: Add Sun copyright notice Roland Dreier
2005-06-24  4:04   ` [PATCH 02/14] IB/mthca: Clean up error messages Roland Dreier
2005-06-24  4:04     ` [PATCH 03/14] IB/mthca: Clean up CQ debug Roland Dreier
2005-06-24  4:04       ` [PATCH 04/14] IB/mthca: Use dma_alloc_coherent instead of pci_alloc_consistent Roland Dreier
2005-06-24  4:04         ` [PATCH 05/14] IB/mthca: Set QP static rate correctly Roland Dreier
2005-06-24  4:04           ` Roland Dreier [this message]
2005-06-24  4:04             ` [PATCH 07/14] IB/mthca: Enable unreliable connected transport Roland Dreier
2005-06-24  4:04               ` [PATCH 08/14] IB/mthca: Fix memset size Roland Dreier
2005-06-24  4:04                 ` [PATCH 09/14] IB/mthca: Move mthca_is_memfree checks Roland Dreier
2005-06-24  4:04                   ` [PATCH 10/14] IB/mthca: Split off MTT allocation Roland Dreier
2005-06-24  4:04                     ` [PATCH 11/14] IB/mthca: Fix memory leak on error path Roland Dreier
2005-06-24  4:04                       ` [PATCH 12/14] IB/mthca: Encapsulate command interface init Roland Dreier
2005-06-24  4:04                         ` [PATCH 13/14] IB/mthca: Align FW command mailboxes to 4K Roland Dreier
2005-06-24  4:04                           ` [PATCH 14/14] IB/mthca: Bump version Roland Dreier

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=2005623214.rtUVEh14lfm8dUC3@topspin.com \
    --to=roland@topspin.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.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

all inboxes | Powered by JetHome®