Commit 2185e651 authored by Junxian Huang's avatar Junxian Huang Committed by Juan Zhou
Browse files

RDMA/hns: Add cap_flag check for check_vf_support()

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: a1598d86 ("RDMA/hns: fix the error of RoCE VF based on RoCE Bonding PF")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent 04180b7a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
	}