IB/hfi1: Compute BTH only for RDMA_WRITE_LAST/SEND_LAST packet
authorSebastian Sanchez <sebastian.sanchez@intel.com>
Thu, 1 Feb 2018 18:46:15 +0000 (10:46 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 1 Feb 2018 22:43:28 +0000 (15:43 -0700)
commitf150e2736f346a3171f002e660c3dfc653cc11cd
tree72dd1e10ecd6f5566d3d03d7b5362c24ac203ed5
parent9636258f103bac6853e280beecf9e85674736a6a
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>
drivers/infiniband/hw/hfi1/rc.c
drivers/infiniband/hw/hfi1/uc.c
drivers/infiniband/hw/hfi1/ud.c
drivers/infiniband/hw/qib/qib_rc.c
drivers/infiniband/hw/qib/qib_uc.c
drivers/infiniband/hw/qib/qib_ud.c
include/rdma/ib_hdrs.h