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> --- providers/hns/hns_roce_u_hw_v2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index 9f34fb4b3..20b95b8e5 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -85,8 +85,10 @@ static inline void set_data_seg_v2(struct hns_roce_v2_wqe_data_seg *dseg, 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; -- 2.33.0