IB/hfi1: Fix QOS num_vl bit width
authorDean Luick <dean.luick@intel.com>
Tue, 12 Apr 2016 17:50:10 +0000 (10:50 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 28 Apr 2016 20:32:27 +0000 (16:32 -0400)
The bit width for num_vls, n, needs to be calculated based on
the pow2 rounded up of the number of vls.  Otherwise num_vls of 3,
5, 6, and 7 will have misplaced QOS RSM map entries.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/chip.c

index 16eb653903e0b873909f3cf3175cf597fae88ea8..f1efbe56536a9ba87ecaca1c55c0cb3935402234 100644 (file)
@@ -13508,7 +13508,7 @@ static void init_qos(struct hfi1_devdata *dd, u32 first_ctxt)
                goto bail;
        qpns_per_vl = __roundup_pow_of_two(max_by_vl);
        /* determine bits vl */
-       n = ilog2(num_vls);
+       n = ilog2(__roundup_pow_of_two(num_vls));
        /* determine bits for qpn */
        m = ilog2(qpns_per_vl);
        if ((m + n) > 7)