diff options
author | Zhu Yanjun <[email protected]> | 2022-01-06 13:03:57 -0500 |
---|---|---|
committer | Jason Gunthorpe <[email protected]> | 2022-01-07 19:34:55 -0400 |
commit | 93f8df548187f6aca50d3398a88cf5ebf130525e (patch) | |
tree | aff78dd2e523732ac51917c5575dd67d0e88ca0d | |
parent | 18451db82ef7f943c60a7fce685f16172bda5106 (diff) |
RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport
Several drivers have the same function xxx_get_udp_sport. So this
function is moved to ib_verbs.h.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Zhu Yanjun <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Acked-by: Wenpeng Liang <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index f25a2036b608..1e539e228315 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4485,14 +4485,6 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp, return 0; } -static inline u16 get_udp_sport(u32 fl, u32 lqpn, u32 rqpn) -{ - if (!fl) - fl = rdma_calc_flow_label(lqpn, rqpn); - - return rdma_flow_label_to_udp_sport(fl); -} - static int get_dip_ctx_idx(struct ib_qp *ibqp, const struct ib_qp_attr *attr, u32 *dip_idx) { @@ -4709,8 +4701,9 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp, } hr_reg_write(context, QPC_UDPSPN, - is_udp ? get_udp_sport(grh->flow_label, ibqp->qp_num, - attr->dest_qp_num) : 0); + is_udp ? rdma_get_udp_sport(grh->flow_label, ibqp->qp_num, + attr->dest_qp_num) : + 0); hr_reg_clear(qpc_mask, QPC_UDPSPN); |