提交 64336966 编写于 作者: Z Zhu Yanjun 提交者: Zheng Zengkai

RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport

mainline inclusion
from mainline-v5.16-rc6
commit 93f8df54
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4QOTS
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=93f8df548187f6aca50d3398a88cf5ebf130525e

---------------------------------------------------------------------

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/20220106180359.2915060-3-yanjun.zhu@linux.devSigned-off-by: NZhu Yanjun <yanjun.zhu@linux.dev>
Reviewed-by: NLeon Romanovsky <leonro@nvidia.com>
Acked-by: NWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
sigend-off-by: NGuofeng Yue <yueguofeng@hisilicon.com>
Reviewed-by: NYangyang Li <liyangyang20@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f2b1ef7e
......@@ -4467,14 +4467,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)
{
......@@ -4691,8 +4683,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册