public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Brian Welty <brian.welty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 03/10] IB/rdmavt: Correct warning during QPN allocation
Date: Thu, 09 Jun 2016 07:51:20 -0700	[thread overview]
Message-ID: <20160609145119.12702.42941.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20160609144644.12702.4832.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

From: Brian Welty <brian.welty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Correct calculation of the low order bits which should be unset
based on use of qos_shift parameter when assigning QPN.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Brian Welty <brian.welty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/sw/rdmavt/qp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 7de5134..c3e0d61 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -369,8 +369,8 @@ static int alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt,
 			/* wrap to first map page, invert bit 0 */
 			offset = qpt->incr | ((offset & 1) ^ 1);
 		}
-		/* there can be no bits at shift and below */
-		WARN_ON(offset & (rdi->dparms.qos_shift - 1));
+		/* there can be no set bits in low-order QoS bits */
+		WARN_ON(offset & (BIT(rdi->dparms.qos_shift) - 1));
 		qpn = mk_qpn(qpt, map, offset);
 	}
 

--
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:[~2016-06-09 14:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 14:51 [PATCH 00/10] IB/hfi1,qib,rdmavt: Fixes for 4.7 rc Dennis Dalessandro
     [not found] ` <20160609144644.12702.4832.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-06-09 14:51   ` [PATCH 01/10] IB/hfi1: Fix credit return threshold adjustment Dennis Dalessandro
2016-06-09 14:51   ` [PATCH 02/10] IB/rdmavt: Correct required callback functions for MODIFY_QP Dennis Dalessandro
2016-06-09 14:51   ` Dennis Dalessandro [this message]
2016-06-09 14:51   ` [PATCH 04/10] IB/hfi1: Increase packet egress timeout Dennis Dalessandro
2016-06-09 14:51   ` [PATCH 05/10] IB/hfi1: Prevent context loss Dennis Dalessandro
2016-06-09 14:51   ` [PATCH 06/10] IB/qib: " Dennis Dalessandro
2016-06-09 14:51   ` [PATCH 07/10] IB/hfi1: Fix potential NULL ptr dereference Dennis Dalessandro
2016-06-09 14:51   ` [PATCH 08/10] IB/hfi1: Fix potential buffer overflow Dennis Dalessandro
2016-06-09 14:51   ` [PATCH 09/10] IB/hfi1: Remove FULL_MGMT_P_KEY from pkey table at link up Dennis Dalessandro
2016-06-09 14:52   ` [PATCH 10/10] IB/hfi1: Send a pkey change event on driver pkey update Dennis Dalessandro
2016-06-18  0:11   ` [PATCH 00/10] IB/hfi1,qib,rdmavt: Fixes for 4.7 rc Doug Ledford

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=20160609145119.12702.42941.stgit@scvm10.sc.intel.com \
    --to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=brian.welty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@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