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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200421145300.16278-3-skalluru@marvell.com>
Date:   Tue, 21 Apr 2020 07:52:59 -0700
From:   Sudarsana Reddy Kalluru <skalluru@...vell.com>
To:     <davem@...emloft.net>
CC:     <netdev@...r.kernel.org>, <aelior@...vell.com>,
        <irusskikh@...vell.com>, <mkalderon@...vell.com>
Subject: [PATCH net-next 2/3] qede: Cache num configured VFs on a PF.

The patch add changes to cache the number of VFs configured on a PF.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@...vell.com>
Signed-off-by: Ariel Elior <aelior@...vell.com>
Signed-off-by: Igor Russkikh <irusskikh@...vell.com>
---
 drivers/net/ethernet/qlogic/qede/qede.h      |  1 +
 drivers/net/ethernet/qlogic/qede/qede_main.c | 15 +++++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede.h b/drivers/net/ethernet/qlogic/qede/qede.h
index 234c6f3..bf8b8ad 100644
--- a/drivers/net/ethernet/qlogic/qede/qede.h
+++ b/drivers/net/ethernet/qlogic/qede/qede.h
@@ -198,6 +198,7 @@ struct qede_dev {
 	struct net_device		*ndev;
 	struct pci_dev			*pdev;
 
+	int				num_vfs;
 	u32				dp_module;
 	u8				dp_level;
 
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 34fa391..9c4d9cd 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -190,12 +190,15 @@ static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param)
 	rc = edev->ops->iov->configure(edev->cdev, num_vfs_param);
 
 	/* Enable/Disable Tx switching for PF */
-	if ((rc == num_vfs_param) && netif_running(edev->ndev) &&
-	    !qed_info->b_inter_pf_switch && qed_info->tx_switching) {
-		vport_params->vport_id = 0;
-		vport_params->update_tx_switching_flg = 1;
-		vport_params->tx_switching_flg = num_vfs_param ? 1 : 0;
-		edev->ops->vport_update(edev->cdev, vport_params);
+	if (rc == num_vfs_param) {
+		edev->num_vfs = rc;
+		if (netif_running(edev->ndev) &&
+		    !qed_info->b_inter_pf_switch && qed_info->tx_switching) {
+			vport_params->vport_id = 0;
+			vport_params->update_tx_switching_flg = 1;
+			vport_params->tx_switching_flg = num_vfs_param ? 1 : 0;
+			edev->ops->vport_update(edev->cdev, vport_params);
+		}
 	}
 
 	vfree(vport_params);
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ