ixgbe: Save VF info and take references
Subsystems (2)
PATCH 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.
Signed-off-by Mark Rustad <[email protected]>
---
0 files changed
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 +9 -21
@@ -6611,10 +6611,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 ;
@@ -6631,26 +6629,16 @@ 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 &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