Patch "IB/hfi1: Correct issues with sc5 computation" has been added to the 4.6-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
IB/hfi1: Correct issues with sc5 computation
to the 4.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-hfi1-correct-issues-with-sc5-computation.patch
and it can be found in the queue-4.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
896ce45da2c2f4abc508d443fdecde7de0b3fa7eMon Sep 17 00:00:00 2001
From: Mike Marciniszyn <[email protected]>
Date: Fri, 1 Jul 2016 15:57:02 -0700
Subject: IB/hfi1: Correct issues with sc5 computation
From: Mike Marciniszyn <[email protected]>
commit 896ce45da2c2f4abc508d443fdecde7de0b3fa7e upstream.
There are several computatations of the sc in the
ud receive routine.
Besides the code duplication, all are wrong when the
sc is greater than 15. In that case the code incorrectly
or's a 1 into the computed sc instead of 1 shifted left by 4.
Fix precomputed sc5 by using an already implemented routine hdr2sc() and deleting flawed duplicated code.
--- drivers/staging/rdma/hfi1/ud.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-)
drivers/staging/rdma/hfi1/ud.c +3 -20
@@ -678,8 +678,7 @@ void hfi1_ud_rcv(struct hfi1_packet *pacu32 tlen = packet->tlen;struct rvt_qp *qp = packet->qp;bool has_grh = rcv_flags &HFI1_HAS_GRH ; -bool sc4_bit =has_sc4_bit (packet); -u8 sc; +u8 sc5 =hdr2sc ((struct hfi1_message_header *)hdr, packet->rhf);u32 bth1;int is_mcast;struct ib_grh *grh =NULL ;
@@ -697,10 +696,8 @@ void hfi1_ud_rcv(struct hfi1_packet *pac*/ struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);u32 lqpn =be32_to_cpu (ohdr->bth[1 ]) &RVT_QPN_MASK ; -u8 sl, sc5; +u8 sl; - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit; sl = ibp->sc_to_sl[sc5];process_becn (ppd, sl,0 , lqpn,0 ,IB_CC_SVCTYPE_UD );
@@ -717,10 +714,6 @@ void hfi1_ud_rcv(struct hfi1_packet *pacif (!is_mcast && (opcode !=IB_OPCODE_CNP ) && bth1 &HFI1_FECN_SMASK ) {u16 slid =be16_to_cpu (hdr->lrh[3 ]); -u8 sc5; - - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit;return_cnp (ibp, qp, src_qp, pkey, dlid, slid, sc5, grh); }
@@ -745,10 +738,6 @@ void hfi1_ud_rcv(struct hfi1_packet *pacif (qp->ibqp.qp_num >1 ) {struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);u16 slid; -u8 sc5; - - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit; slid =be16_to_cpu (hdr->lrh[3 ]);if (unlikely (rcv_pkey_check (ppd, pkey, sc5, slid))) {
@@ -790,10 +779,6 @@ void hfi1_ud_rcv(struct hfi1_packet *pac/* Received on QP0, and so by definition, this is an SMP */ struct opa_smp *smp = (struct opa_smp *)data;u16 slid =be16_to_cpu (hdr->lrh[3 ]); -u8 sc5; - - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit;if (opa_smp_check (ibp, pkey, sc5, qp, slid, smp)) goto drop;
@@ -890,9 +875,7 @@ void hfi1_ud_rcv(struct hfi1_packet *pac } wc.slid =be16_to_cpu (hdr->lrh[3 ]); - sc = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc |= sc4_bit; - wc.sl = ibp->sc_to_sl[sc]; + wc.sl = ibp->sc_to_sl[sc5];/* * Save the LMC lower bits if the destination LID is a unicast LID.
Patches currently in stable-queue which might be from [email protected] are
queue-4.6/ib-hfi1-correct-issues-with-sc5-computation.patch queue-4.6/ib-hfi1-fix-deadlock-with-txreq-allocation-slow-path.patch