Skip to content

Commit 93f8df5

Browse files
zhuyjjgunthorpe
authored andcommitted
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]>
1 parent 18451db commit 93f8df5

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4485,14 +4485,6 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp,
44854485
return 0;
44864486
}
44874487

4488-
static inline u16 get_udp_sport(u32 fl, u32 lqpn, u32 rqpn)
4489-
{
4490-
if (!fl)
4491-
fl = rdma_calc_flow_label(lqpn, rqpn);
4492-
4493-
return rdma_flow_label_to_udp_sport(fl);
4494-
}
4495-
44964488
static int get_dip_ctx_idx(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
44974489
u32 *dip_idx)
44984490
{
@@ -4709,8 +4701,9 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp,
47094701
}
47104702

47114703
hr_reg_write(context, QPC_UDPSPN,
4712-
is_udp ? get_udp_sport(grh->flow_label, ibqp->qp_num,
4713-
attr->dest_qp_num) : 0);
4704+
is_udp ? rdma_get_udp_sport(grh->flow_label, ibqp->qp_num,
4705+
attr->dest_qp_num) :
4706+
0);
47144707

47154708
hr_reg_clear(qpc_mask, QPC_UDPSPN);
47164709

0 commit comments

Comments
 (0)