From: Junxian Huang huangjunxian6@hisilicon.com
driver inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I8O0QJ
--------------------------------------------------------------------------
check_vf_support() aims to prevent the init of roce vf whose corresponding pf is in a bond group. For devices that doesn't support bonding, there is no need to execute this checking.
Fixes: a1598d8616e7 ("RDMA/hns: fix the error of RoCE VF based on RoCE Bonding PF") Signed-off-by: Junxian Huang huangjunxian6@hisilicon.com Signed-off-by: Juan Zhou zhoujuan51@h-partners.com --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 978d26ba153e..2b474c22cafa 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -7650,7 +7650,8 @@ static int __hns_roce_hw_v2_init_instance(struct hnae3_handle *handle)
hns_roce_hw_v2_get_cfg(hr_dev, handle);
- if (hr_dev->is_vf && !check_vf_support(hr_dev->pci_dev)) { + if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_BOND && + hr_dev->is_vf && !check_vf_support(hr_dev->pci_dev)) { ret = -EOPNOTSUPP; goto error_failed_roce_init; }