IB/hfi1: Mask the path bits with the LMC for 16B RC Acks
authorDon Hiatt <don.hiatt@intel.com>
Tue, 14 Nov 2017 12:34:16 +0000 (04:34 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 11 Dec 2017 23:01:08 +0000 (16:01 -0700)
16B packets require that the path bits are masked with the LMC.
This mask is done correctly in all 16B header creation but was
left out for the RC Acknowledge.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Don Hiatt <don.hiatt@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/rc.c

index fd01a760259fa1887d2f233a2fcbb3ee581e6f5f..e6fa9365de49cff75494f427911768610a6d2352 100644 (file)
@@ -843,11 +843,11 @@ static inline void hfi1_make_rc_ack_16B(struct rvt_qp *qp,
        /* Convert dwords to flits */
        len = (*hwords + *nwords) >> 1;
 
-       hfi1_make_16b_hdr(hdr,
-                         ppd->lid | rdma_ah_get_path_bits(&qp->remote_ah_attr),
+       hfi1_make_16b_hdr(hdr, ppd->lid |
+                         (rdma_ah_get_path_bits(&qp->remote_ah_attr) &
+                         ((1 << ppd->lmc) - 1)),
                          opa_get_lid(rdma_ah_get_dlid(&qp->remote_ah_attr),
-                                     16B),
-                         len, pkey, becn, 0, l4, sc5);
+                                     16B), len, pkey, becn, 0, l4, sc5);
 
        bth0 = pkey | (OP(ACKNOWLEDGE) << 24);
        bth0 |= extra_bytes << 20;