summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/verbs.c
diff options
context:
space:
mode:
authorDasaratharaman Chandramouli2016-07-25 22:40:34 +0200
committerDoug Ledford2016-08-02 22:00:58 +0200
commitb736a469f96a28805296f0e8f0c6aa5206f694d0 (patch)
tree1d62470d0c5f34820eac7a6130ecc35f9582cd7f /drivers/infiniband/hw/hfi1/verbs.c
parentIB/hfi1: Cleanup UD packet handler. (diff)
downloadkernel-qcow2-linux-b736a469f96a28805296f0e8f0c6aa5206f694d0.tar.gz
kernel-qcow2-linux-b736a469f96a28805296f0e8f0c6aa5206f694d0.tar.xz
kernel-qcow2-linux-b736a469f96a28805296f0e8f0c6aa5206f694d0.zip
IB/hfi1: Use hdr2sc function to calculate 5-bit SC
The interface is used to compute the 5-bit SC field from the LRH and the RHF bits. Modify code to use the interface instead. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Don Hiatt <don.hiatt@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/verbs.c')
-rw-r--r--drivers/infiniband/hw/hfi1/verbs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index 67810e33f754..5265d160fa63 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -1743,8 +1743,7 @@ void hfi1_cnp_rcv(struct hfi1_packet *packet)
struct rvt_qp *qp = packet->qp;
u32 lqpn, rqpn = 0;
u16 rlid = 0;
- u8 sl, sc5, sc4_bit, svc_type;
- bool sc4_set = has_sc4_bit(packet);
+ u8 sl, sc5, svc_type;
switch (packet->qp->ibqp.qp_type) {
case IB_QPT_UC:
@@ -1767,9 +1766,7 @@ void hfi1_cnp_rcv(struct hfi1_packet *packet)
return;
}
- sc4_bit = sc4_set << 4;
- sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf;
- sc5 |= sc4_bit;
+ sc5 = hdr2sc((struct hfi1_message_header *)hdr, packet->rhf);
sl = ibp->sc_to_sl[sc5];
lqpn = qp->ibqp.qp_num;