diff mbox

[5/6] IB/rdmavt: Allow reserving just one qpn

Message ID 20160106181521.3238.96805.stgit@scvm10.sc.intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Dennis Dalessandro Jan. 6, 2016, 6:15 p.m. UTC
From: Harish Chegondi <harish.chegondi@intel.com>

qib needs to reserve only one qpn for non-verbs stuff. Also fixed the for
loop to reserve the end qpn.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
 drivers/infiniband/sw/rdmavt/qp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 44485ad..ee19eae 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -79,7 +79,7 @@  static int init_qpn_table(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt)
 	struct rvt_qpn_map *map;
 	int ret = 0;
 
-	if (!(rdi->dparms.qpn_res_end > rdi->dparms.qpn_res_start))
+	if (!(rdi->dparms.qpn_res_end >= rdi->dparms.qpn_res_start))
 		return -EINVAL;
 
 	spin_lock_init(&qpt->lock);
@@ -105,7 +105,7 @@  static int init_qpn_table(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt)
 
 	rvt_pr_info(rdi, "Reserving QPNs from 0x%x to 0x%x for non-verbs use\n",
 		    rdi->dparms.qpn_res_start, rdi->dparms.qpn_res_end);
-	for (i = rdi->dparms.qpn_res_start; i < rdi->dparms.qpn_res_end; i++) {
+	for (i = rdi->dparms.qpn_res_start; i <= rdi->dparms.qpn_res_end; i++) {
 		if (!map->page) {
 			get_map_page(qpt, map);
 			if (!map->page) {