提交 243bdeb1 编写于 作者: W Wei Xu 提交者: Zheng Zengkai

RDMA/hns: Query the number of functions supported by the PF

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

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

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

Query how many functions are supported by the PF from the FW and store it
in the hns_roce_dev structure which will be used to support the
configuration of virtual functions.

Link: https://lore.kernel.org/r/1617715514-29039-3-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>
上级 22d22623
......@@ -986,6 +986,7 @@ struct hns_roce_dev {
void *priv;
struct workqueue_struct *irq_workq;
const struct hns_roce_dfx_hw *dfx;
u32 func_num;
u32 cong_algo_tmpl_id;
};
......
......@@ -1614,15 +1614,20 @@ static int hns_roce_query_func_info(struct hns_roce_dev *hr_dev)
struct hns_roce_cmq_desc desc;
int ret;
if (hr_dev->pci_dev->revision < PCI_REVISION_ID_HIP09)
if (hr_dev->pci_dev->revision < PCI_REVISION_ID_HIP09) {
hr_dev->func_num = 1;
return 0;
}
hns_roce_cmq_setup_basic_desc(&desc, HNS_ROCE_OPC_QUERY_FUNC_INFO,
true);
ret = hns_roce_cmq_send(hr_dev, &desc, 1);
if (ret)
if (ret) {
hr_dev->func_num = 1;
return ret;
}
hr_dev->func_num = le32_to_cpu(desc.func_info.own_func_num);
hr_dev->cong_algo_tmpl_id = le32_to_cpu(desc.func_info.own_mac_id);
return 0;
......
......@@ -1710,9 +1710,9 @@ struct hns_roce_cmq_desc {
union {
__le32 data[6];
struct {
__le32 rsv1;
__le32 own_func_num;
__le32 own_mac_id;
__le32 rsv2[4];
__le32 rsv[4];
} func_info;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册