summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/verbs.h
diff options
context:
space:
mode:
authorSebastian Sanchez <sebastian.sanchez@intel.com>2018-02-01 10:46:23 -0800
committerJason Gunthorpe <jgg@mellanox.com>2018-02-01 15:43:28 -0700
commit6d6b8848c882b22e3170cc9f217101773e8bd8d2 (patch)
tree4e694d7e1ac69e73dcc01d11515189991fce8f76 /drivers/infiniband/hw/hfi1/verbs.h
parentf150e2736f346a3171f002e660c3dfc653cc11cd (diff)
downloadlinux-6d6b8848c882b22e3170cc9f217101773e8bd8d2.tar.gz
linux-6d6b8848c882b22e3170cc9f217101773e8bd8d2.tar.bz2
linux-6d6b8848c882b22e3170cc9f217101773e8bd8d2.zip
IB/hfi1: Optimize packet type comparison using 9B and bypass code paths
The packet type comparison used to find out if a packet is a bypass packet in the hot path is an expensive operation as seen in a profile. Determine packet's pkey and migration bit through the bypass and 9B code paths instead. Reviewed-by: Don Hiatt <don.hiatt@intel.com> 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/verbs.h')
-rw-r--r--drivers/infiniband/hw/hfi1/verbs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs.h b/drivers/infiniband/hw/hfi1/verbs.h
index c2aeb32bf482..ffc933ea146f 100644
--- a/drivers/infiniband/hw/hfi1/verbs.h
+++ b/drivers/infiniband/hw/hfi1/verbs.h
@@ -405,6 +405,11 @@ static inline void cacheless_memcpy(void *dst, void *src, size_t n)
__copy_user_nocache(dst, (void __user *)src, n, 0);
}
+static inline bool opa_bth_is_migration(struct ib_other_headers *ohdr)
+{
+ return ohdr->bth[1] & cpu_to_be32(OPA_BTH_MIG_REQ);
+}
+
extern const enum ib_wc_opcode ib_hfi1_wc_opcode[];
extern const u8 hdr_len_by_opcode[];