ixgbe: Save VF info and take references
Subsystems (2)
PATCH v2 1/1 ixgbe: Save VF info and take references
Save VF device pointers and take references to speed accesses used to monitor the device behavior to avoid slot resets. The saved information avoids lock contention during the search used to access each of the VFs.
---
Changes in V2:
- Added check for a status register of 0xffff as suggested by Don Dutile at RedHat.
--- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 31 +++++---------- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 50 +++++++++++++++++++++++- 3 files changed, 59 insertions(+), 23 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe.h +1 -0
@@ -139,6 +139,7 @@ enum ixgbe_tx_flags {#define IXGBE_X540_VF_DEVICE_ID 0x1515struct vf_data_storage { +struct pci_dev *vfdev;unsigned char vf_mac_addresses[ETH_ALEN ];u16 vf_mc_hashes[IXGBE_MAX_VF_MC_ENTRIES ];u16 num_vf_mc_hashes;
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +10 -21
@@ -6613,10 +6613,8 @@ static void ixgbe_check_for_bad_vf(struct ixgbe_adapter *adapter) {struct ixgbe_hw *hw = &adapter->hw;struct pci_dev *pdev = adapter->pdev; -struct pci_dev *vfdev; +unsigned int vf;u32 gpc; -int pos; -unsigned short vf_id;if (!(netif_carrier_ok (adapter->netdev)))return ;
@@ -6633,26 +6631,17 @@ static void ixgbe_check_for_bad_vf(struct ixgbe_adapter *adapter)if (!pdev)return ; - pos =pci_find_ext_capability (pdev,PCI_EXT_CAP_ID_SRIOV ); -if (!pos) -return ; - -/* get the device ID for the VF */ -pci_read_config_word (pdev, pos +PCI_SRIOV_VF_DID , &vf_id); -/* check status reg for all VFs owned by this PF */ - vfdev =pci_get_device (pdev->vendor, vf_id,NULL ); -while (vfdev) { -if (vfdev->is_virtfn && (vfdev->physfn == pdev)) { -u16 status_reg; - -pci_read_config_word (vfdev,PCI_STATUS , &status_reg); -if (status_reg &PCI_STATUS_REC_MASTER_ABORT ) -/* issue VFLR */ -ixgbe_issue_vf_flr (adapter, vfdev); - } +for (vf =0 ; vf < adapter->num_vfs; ++vf) { +struct pci_dev *vfdev = adapter->vfinfo[vf].vfdev; +u16 status_reg; - vfdev =pci_get_device (pdev->vendor, vf_id, vfdev); +if (!vfdev) +continue ; +pci_read_config_word (vfdev,PCI_STATUS , &status_reg); +if (status_reg !=IXGBE_FAILED_READ_CFG_WORD && + status_reg &PCI_STATUS_REC_MASTER_ABORT ) +ixgbe_issue_vf_flr (adapter, vfdev); } }
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +48 -2
87 lines not on this page · raw message
Miller
PATCH v2 1/1 ixgbe: Save VF info and take references
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Mark D Rustad
Sent: Friday, October 30, 2015 3:30 PM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH V2] ixgbe: Save VF info and take references
Save VF device pointers and take references to speed accesses used to monitor the device behavior to avoid slot resets. The saved information avoids lock contention during the search used to access each of the VFs.
---
Changes in V2:
- Added check for a status register of 0xffff as suggested by Don Dutile at RedHat.
--- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 31 +++++---------- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 50 +++++++++++++++++++++++- 3 files changed, 59 insertions(+), 23 deletions(-)
Schmitt
PATCH v2 1/1 ixgbe: Save VF info and take references
In reply to Mark D RustadQuoted 18 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Mark D Rustad
Sent: Friday, October 30, 2015 3:30 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH V2] ixgbe: Save VF info and take referencesSave VF device pointers and take references to speed accesses used to monitor the device behavior to avoid slot resets. The saved information avoids lock contention during the search used to access each of the VFs.
Signed-off-by Mark Rustad <[email protected]>---
Changes in V2:
- Added check for a status register of0xffffas suggested by Don Dutile at RedHat.
Quoted 7 lines
--- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 31 +++++---------- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 50 +++++++++++++++++++++++- 3 files changed, 59 insertions(+), 23 deletions(-)