aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/rdma/ib_hdrs.h
diff options
context:
space:
mode:
authorSebastian Sanchez <sebastian.sanchez@intel.com>2018-02-01 10:46:15 -0800
committerJason Gunthorpe <jgg@mellanox.com>2018-02-01 15:43:28 -0700
commitf150e2736f346a3171f002e660c3dfc653cc11cd (patch)
tree72dd1e10ecd6f5566d3d03d7b5362c24ac203ed5 /include/rdma/ib_hdrs.h
parentIB/hfi1: Remove dependence on qp->s_hdrwords (diff)
downloadwireguard-linux-f150e2736f346a3171f002e660c3dfc653cc11cd.tar.xz
wireguard-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 'include/rdma/ib_hdrs.h')
-rw-r--r--include/rdma/ib_hdrs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/rdma/ib_hdrs.h b/include/rdma/ib_hdrs.h
index c124d515f7d5..6b1e8039971d 100644
--- a/include/rdma/ib_hdrs.h
+++ b/include/rdma/ib_hdrs.h
@@ -331,4 +331,8 @@ static inline u8 ib_bth_get_tver(struct ib_other_headers *ohdr)
IB_BTH_TVER_MASK);
}
+static inline bool ib_bth_is_solicited(struct ib_other_headers *ohdr)
+{
+ return ohdr->bth[0] & cpu_to_be32(IB_BTH_SOLICITED);
+}
#endif /* IB_HDRS_H */