提交 66274aac 编写于 作者: W Wei Xu 提交者: Zheng Zengkai

RDMA/hns: Set parameters of all the functions belong to a PF

mainline inclusion
from mainline-v5.12-rc1
commit accfc1af
category: feature
bugzilla: 174002
CVE:NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=accfc1affe9e8f25a393a53fdf9936d5bc3dc001

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

Switch parameters of all functions belong to a PF should be set including
VFs.

Link: https://lore.kernel.org/r/1617715514-29039-5-git-send-email-liweihang@huawei.comSigned-off-by: NWei Xu <xuwei5@hisilicon.com>
Signed-off-by: NShengming Shu <shushengming1@huawei.com>
Signed-off-by: NWeihang Li <liweihang@huawei.com>
Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nwangsirong <wangsirong@huawei.com>
Reviewed-by: NChunZhi Hu <huchunzhi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 74e1531c
......@@ -1700,7 +1700,8 @@ static int hns_roce_query_pf_timer_resource(struct hns_roce_dev *hr_dev)
return 0;
}
static int hns_roce_set_vf_switch_param(struct hns_roce_dev *hr_dev, int vf_id)
static int __hns_roce_set_vf_switch_param(struct hns_roce_dev *hr_dev,
u32 vf_id)
{
struct hns_roce_cmq_desc desc;
struct hns_roce_vf_switch *swt;
......@@ -1725,6 +1726,19 @@ static int hns_roce_set_vf_switch_param(struct hns_roce_dev *hr_dev, int vf_id)
return hns_roce_cmq_send(hr_dev, &desc, 1);
}
static int hns_roce_set_vf_switch_param(struct hns_roce_dev *hr_dev)
{
u32 vf_id;
int ret;
for (vf_id = 0; vf_id < hr_dev->func_num; vf_id++) {
ret = __hns_roce_set_vf_switch_param(hr_dev, vf_id);
if (ret)
return ret;
}
return 0;
}
static int __hns_roce_alloc_vf_resource(struct hns_roce_dev *hr_dev, int vf_id)
{
struct hns_roce_cmq_desc desc[2];
......@@ -2326,7 +2340,7 @@ static int hns_roce_v2_profile(struct hns_roce_dev *hr_dev)
return ret;
}
ret = hns_roce_set_vf_switch_param(hr_dev, 0);
ret = hns_roce_set_vf_switch_param(hr_dev);
if (ret) {
dev_err(hr_dev->dev,
"failed to set function switch param, ret = %d.\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册