From 6d6b8848c882b22e3170cc9f217101773e8bd8d2 Mon Sep 17 00:00:00 2001 From: Sebastian Sanchez Date: Thu, 1 Feb 2018 10:46:23 -0800 Subject: 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 Reviewed-by: Mike Marciniszyn Signed-off-by: Sebastian Sanchez Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe --- include/rdma/ib_hdrs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/rdma') diff --git a/include/rdma/ib_hdrs.h b/include/rdma/ib_hdrs.h index 6b1e8039971d..6ee985494acf 100644 --- a/include/rdma/ib_hdrs.h +++ b/include/rdma/ib_hdrs.h @@ -335,4 +335,9 @@ static inline bool ib_bth_is_solicited(struct ib_other_headers *ohdr) { return ohdr->bth[0] & cpu_to_be32(IB_BTH_SOLICITED); } + +static inline bool ib_bth_is_migration(struct ib_other_headers *ohdr) +{ + return ohdr->bth[0] & cpu_to_be32(IB_BTH_MIG_REQ); +} #endif /* IB_HDRS_H */ -- cgit v1.2.3