[ofa-general] [PATCH 2/5] IB/ipath -- potentially wrong rnr retry counter returned in ipath_query_qp

Ralph Campbell ralph.campbell at qlogic.com
Tue Mar 11 11:51:04 PDT 2008


From: Patrick Marchand Latifi <patrick.latifi at qlogic.com>

There can be a case where the requester's rnr retry counter (s_rnr_retry) is
less than the number of rnr retries allowed per QP (s_rnr_retry_cnt). This can
happen if the s_rnr_retry counter is being decremented and an ipath_query_qp
call is issued during that time frame.  The fix is to always return the number
of rnr retries allowed per QP instead of the requester's rnr counter. Found by
code review.

Signed-off-by: Patrick Marchand Latifi <patrick.latifi at qlogic.com>
Acked-by: Ralph Campbell <ralph.campbell at qlogic.com>
---

 drivers/infiniband/hw/ipath/ipath_qp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 80dc623..8214c09 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -647,7 +647,7 @@ int ipath_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	attr->port_num = 1;
 	attr->timeout = qp->timeout;
 	attr->retry_cnt = qp->s_retry_cnt;
-	attr->rnr_retry = qp->s_rnr_retry;
+	attr->rnr_retry = qp->s_rnr_retry_cnt;
 	attr->alt_port_num = 0;
 	attr->alt_timeout = 0;
 




More information about the general mailing list