libhns: Inline set extend atomic seg() to improve performance
Commit ca944a322f9b ("libhns: Fix immediately error sign type in data
path.") changed return values from negative errno to positive errno
in the data path. While semantically correct, this changed GCC's
inline cost estimate for set_extend_atomic_seg(), causing it to no longer
be inlined into hns_roce_u_v2_post_send() and resulting in performance
loss. The GCC version we used is 10.3.1.
Add inline explicitly to restores GCC's inlining decision.
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index 9f34fb4..20b95b8 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -85,8 +85,10 @@
dseg->len = htole32(sg->length);
}
-static void set_extend_atomic_seg(struct hns_roce_qp *qp, unsigned int sge_cnt,
- struct hns_roce_sge_info *sge_info, void *buf)
+static inline void set_extend_atomic_seg(struct hns_roce_qp *qp,
+ unsigned int sge_cnt,
+ struct hns_roce_sge_info *sge_info,
+ void *buf)
{
unsigned int sge_mask = qp->ex_sge.sge_cnt - 1;
unsigned int i;