aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Marchand Latifi <patrick.latifi@qlogic.com>2008-01-08 02:43:04 -0500
committerRoland Dreier <rolandd@cisco.com>2008-03-11 17:01:14 -0400
commit87d5aed85b2d79e4075ad2ca1449e9b98f657a09 (patch)
treefa8c4f5b110148b913c3f9b5663d7a95358d4fd4
parent140277e9a710202608914b5b731948d2769399bc (diff)
IB/ipath: Fix potentially wrong RNR retry counter returned in ipath_query_qp()
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@qlogic.com> Acked-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c2
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 80dc623cee40..8214c0905c75 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,
647 attr->port_num = 1; 647 attr->port_num = 1;
648 attr->timeout = qp->timeout; 648 attr->timeout = qp->timeout;
649 attr->retry_cnt = qp->s_retry_cnt; 649 attr->retry_cnt = qp->s_retry_cnt;
650 attr->rnr_retry = qp->s_rnr_retry; 650 attr->rnr_retry = qp->s_rnr_retry_cnt;
651 attr->alt_port_num = 0; 651 attr->alt_port_num = 0;
652 attr->alt_timeout = 0; 652 attr->alt_timeout = 0;
653 653