lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221125071958.276454-1-shaozhengchao@huawei.com>
Date:   Fri, 25 Nov 2022 15:19:58 +0800
From:   Zhengchao Shao <shaozhengchao@...wei.com>
To:     <netdev@...r.kernel.org>, <ecree.xilinx@...il.com>,
        <habetsm.xilinx@...il.com>, <davem@...emloft.net>,
        <edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>
CC:     <pieter.jansen-van-vuuren@....com>, <weiyongjun1@...wei.com>,
        <yuehaibing@...wei.com>, <shaozhengchao@...wei.com>
Subject: [PATCH net] sfc: fix error process in efx_ef100_pci_sriov_enable()

There are two issues in efx_ef100_pci_sriov_enable():
1. When it doesn't have MAE Privilege, it doesn't disable pci sriov.
2. When creating VF successfully, it should return vf nums instead of 0.
Compiled test only.

Fixes: 08135eecd07f ("sfc: add skeleton ef100 VF representors")
Fixes: 78a9b3c47bef ("sfc: add EF100 VF support via a write to sriov_numvfs")
Signed-off-by: Zhengchao Shao <shaozhengchao@...wei.com>
---
 drivers/net/ethernet/sfc/ef100_sriov.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ef100_sriov.c b/drivers/net/ethernet/sfc/ef100_sriov.c
index 94bdbfcb47e8..adf7fb09940e 100644
--- a/drivers/net/ethernet/sfc/ef100_sriov.c
+++ b/drivers/net/ethernet/sfc/ef100_sriov.c
@@ -25,15 +25,17 @@ static int efx_ef100_pci_sriov_enable(struct efx_nic *efx, int num_vfs)
 	if (rc)
 		goto fail1;
 
-	if (!nic_data->grp_mae)
+	if (!nic_data->grp_mae) {
+		pci_disable_sriov(dev);
 		return 0;
+	}
 
 	for (i = 0; i < num_vfs; i++) {
 		rc = efx_ef100_vfrep_create(efx, i);
 		if (rc)
 			goto fail2;
 	}
-	return 0;
+	return num_vfs;
 
 fail2:
 	list_for_each_entry_safe(efv, next, &efx->vf_reps, list)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ