summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/ud.c
diff options
context:
space:
mode:
authorSebastian Sanchez2018-02-01 19:46:15 +0100
committerJason Gunthorpe2018-02-01 23:43:28 +0100
commitf150e2736f346a3171f002e660c3dfc653cc11cd (patch)
tree72dd1e10ecd6f5566d3d03d7b5362c24ac203ed5 /drivers/infiniband/hw/hfi1/ud.c
parentIB/hfi1: Remove dependence on qp->s_hdrwords (diff)
downloadkernel-qcow2-linux-f150e2736f346a3171f002e660c3dfc653cc11cd.tar.gz
kernel-qcow2-linux-f150e2736f346a3171f002e660c3dfc653cc11cd.tar.xz
kernel-qcow2-linux-f150e2736f346a3171f002e660c3dfc653cc11cd.zip
IB/hfi1: Compute BTH only for RDMA_WRITE_LAST/SEND_LAST packet
In hfi1_rc_rcv(), BTH is computed for all packets received. However, it's only used for packets received with opcodes RDMA_WRITE_LAST and SEND_LAST, and it is a costly operation. Compute BTH only in the RDMA_WRITE_LAST/SEND_LAST code path and let the compiler handle endianness conversion for bitwise operations. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/ud.c')
-rw-r--r--drivers/infiniband/hw/hfi1/ud.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c
index 6b5cd3a86be4..cff2fd8907f5 100644
--- a/drivers/infiniband/hw/hfi1/ud.c
+++ b/drivers/infiniband/hw/hfi1/ud.c
@@ -1045,8 +1045,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
wc.port_num = qp->port_num;
/* Signal completion event if the solicited bit is set. */
rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
- (ohdr->bth[0] &
- cpu_to_be32(IB_BTH_SOLICITED)) != 0);
+ ib_bth_is_solicited(ohdr));
return;
drop: