diff options
author | Anjali Singhai Jain <anjali.singhai@intel.com> | 2015-05-27 12:06:14 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-06-04 23:14:23 -0400 |
commit | fa11cb3d16a9b9b296a2b811a49faf1356240348 (patch) | |
tree | 6b7aa1f0eae8779290e441a729ce516d66334af9 /drivers/net/ethernet | |
parent | fc60861e9b00388fd11d7995a60bf0b1e61dba93 (diff) |
i40e: Make sure to be in VEB mode if SRIOV is enabled at probe
If SRIOV is enabled we need to be in VEB mode not VEPA mode at probe.
This fixes an NPAR bug when SRIOV is enabled in the BIOS.
Change-ID: Ibf006abafd9a0ca3698ec24848cd771cf345cbbc
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 853eb2f7e558..5b5bea159bd5 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -8756,9 +8756,14 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type, | |||
8756 | __func__); | 8756 | __func__); |
8757 | return NULL; | 8757 | return NULL; |
8758 | } | 8758 | } |
8759 | /* We come up by default in VEPA mode */ | 8759 | /* We come up by default in VEPA mode if SRIOV is not |
8760 | veb->bridge_mode = BRIDGE_MODE_VEPA; | 8760 | * already enabled, in which case we can't force VEPA |
8761 | pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; | 8761 | * mode. |
8762 | */ | ||
8763 | if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) { | ||
8764 | veb->bridge_mode = BRIDGE_MODE_VEPA; | ||
8765 | pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; | ||
8766 | } | ||
8762 | i40e_config_bridge_mode(veb); | 8767 | i40e_config_bridge_mode(veb); |
8763 | } | 8768 | } |
8764 | for (i = 0; i < I40E_MAX_VEB && !veb; i++) { | 8769 | for (i = 0; i < I40E_MAX_VEB && !veb; i++) { |
@@ -9869,6 +9874,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
9869 | goto err_switch_setup; | 9874 | goto err_switch_setup; |
9870 | } | 9875 | } |
9871 | 9876 | ||
9877 | #ifdef CONFIG_PCI_IOV | ||
9878 | /* prep for VF support */ | ||
9879 | if ((pf->flags & I40E_FLAG_SRIOV_ENABLED) && | ||
9880 | (pf->flags & I40E_FLAG_MSIX_ENABLED) && | ||
9881 | !test_bit(__I40E_BAD_EEPROM, &pf->state)) { | ||
9882 | if (pci_num_vf(pdev)) | ||
9883 | pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; | ||
9884 | } | ||
9885 | #endif | ||
9872 | err = i40e_setup_pf_switch(pf, false); | 9886 | err = i40e_setup_pf_switch(pf, false); |
9873 | if (err) { | 9887 | if (err) { |
9874 | dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err); | 9888 | dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err); |