浏览代码

IB/rdmavt: Correct warning during QPN allocation

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@intel.com>
Signed-off-by: Brian Welty <brian.welty@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Brian Welty 9 年之前
父节点
当前提交
501edc4244
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/infiniband/sw/rdmavt/qp.c

+ 2 - 2
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 */
 			/* wrap to first map page, invert bit 0 */
 			offset = qpt->incr | ((offset & 1) ^ 1);
 			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);
 		qpn = mk_qpn(qpt, map, offset);
 	}
 	}