Commit b64581ad authored by Don Hiatt's avatar Don Hiatt Committed by Doug Ledford

IB/hfi1: Mask upper 16Bits of Extended LID prior to rvt_cq_entry

Pass only the lower 16Bits of an Extended LIDs to rvt_cq_entry
to avoid triggering a WARN_ON_ONCE during conversion there.
These upper 16Bits are okay to drop as they are obtained elsewhere.

Fixes: 62ede777 ("Add OPA extended LID support")
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarDon Hiatt <don.hiatt@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 19b57c6c
...@@ -2219,7 +2219,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) ...@@ -2219,7 +2219,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
wc.opcode = IB_WC_RECV; wc.opcode = IB_WC_RECV;
wc.qp = &qp->ibqp; wc.qp = &qp->ibqp;
wc.src_qp = qp->remote_qpn; wc.src_qp = qp->remote_qpn;
wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr); wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr) & U16_MAX;
/* /*
* It seems that IB mandates the presence of an SL in a * It seems that IB mandates the presence of an SL in a
* work completion only for the UD transport (see section * work completion only for the UD transport (see section
......
...@@ -560,7 +560,7 @@ static void ruc_loopback(struct rvt_qp *sqp) ...@@ -560,7 +560,7 @@ static void ruc_loopback(struct rvt_qp *sqp)
wc.byte_len = wqe->length; wc.byte_len = wqe->length;
wc.qp = &qp->ibqp; wc.qp = &qp->ibqp;
wc.src_qp = qp->remote_qpn; wc.src_qp = qp->remote_qpn;
wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr); wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr) & U16_MAX;
wc.sl = rdma_ah_get_sl(&qp->remote_ah_attr); wc.sl = rdma_ah_get_sl(&qp->remote_ah_attr);
wc.port_num = 1; wc.port_num = 1;
/* Signal completion event if the solicited bit is set. */ /* Signal completion event if the solicited bit is set. */
......
...@@ -462,7 +462,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -462,7 +462,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
wc.status = IB_WC_SUCCESS; wc.status = IB_WC_SUCCESS;
wc.qp = &qp->ibqp; wc.qp = &qp->ibqp;
wc.src_qp = qp->remote_qpn; wc.src_qp = qp->remote_qpn;
wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr); wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr) & U16_MAX;
/* /*
* It seems that IB mandates the presence of an SL in a * It seems that IB mandates the presence of an SL in a
* work completion only for the UD transport (see section * work completion only for the UD transport (see section
......
...@@ -265,8 +265,8 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) ...@@ -265,8 +265,8 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
} else { } else {
wc.pkey_index = 0; wc.pkey_index = 0;
} }
wc.slid = ppd->lid | (rdma_ah_get_path_bits(ah_attr) & wc.slid = (ppd->lid | (rdma_ah_get_path_bits(ah_attr) &
((1 << ppd->lmc) - 1)); ((1 << ppd->lmc) - 1))) & U16_MAX;
/* Check for loopback when the port lid is not set */ /* Check for loopback when the port lid is not set */
if (wc.slid == 0 && sqp->ibqp.qp_type == IB_QPT_GSI) if (wc.slid == 0 && sqp->ibqp.qp_type == IB_QPT_GSI)
wc.slid = be16_to_cpu(IB_LID_PERMISSIVE); wc.slid = be16_to_cpu(IB_LID_PERMISSIVE);
...@@ -1037,7 +1037,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) ...@@ -1037,7 +1037,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
} }
if (slid_is_permissive) if (slid_is_permissive)
slid = be32_to_cpu(OPA_LID_PERMISSIVE); slid = be32_to_cpu(OPA_LID_PERMISSIVE);
wc.slid = slid; wc.slid = slid & U16_MAX;
wc.sl = sl_from_sc; wc.sl = sl_from_sc;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment