aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_main.c')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a54c14491e3b..5b5bea159bd5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6097,6 +6097,10 @@ static int i40e_reconstitute_veb(struct i40e_veb *veb)
6097 if (ret) 6097 if (ret)
6098 goto end_reconstitute; 6098 goto end_reconstitute;
6099 6099
6100 if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)
6101 veb->bridge_mode = BRIDGE_MODE_VEB;
6102 else
6103 veb->bridge_mode = BRIDGE_MODE_VEPA;
6100 i40e_config_bridge_mode(veb); 6104 i40e_config_bridge_mode(veb);
6101 6105
6102 /* create the remaining VSIs attached to this VEB */ 6106 /* create the remaining VSIs attached to this VEB */
@@ -8031,7 +8035,12 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,
8031 } else if (mode != veb->bridge_mode) { 8035 } else if (mode != veb->bridge_mode) {
8032 /* Existing HW bridge but different mode needs reset */ 8036 /* Existing HW bridge but different mode needs reset */
8033 veb->bridge_mode = mode; 8037 veb->bridge_mode = mode;
8034 i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED)); 8038 /* TODO: If no VFs or VMDq VSIs, disallow VEB mode */
8039 if (mode == BRIDGE_MODE_VEB)
8040 pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
8041 else
8042 pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
8043 i40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));
8035 break; 8044 break;
8036 } 8045 }
8037 } 8046 }
@@ -8343,11 +8352,12 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
8343 ctxt.uplink_seid = vsi->uplink_seid; 8352 ctxt.uplink_seid = vsi->uplink_seid;
8344 ctxt.connection_type = I40E_AQ_VSI_CONN_TYPE_NORMAL; 8353 ctxt.connection_type = I40E_AQ_VSI_CONN_TYPE_NORMAL;
8345 ctxt.flags = I40E_AQ_VSI_TYPE_PF; 8354 ctxt.flags = I40E_AQ_VSI_TYPE_PF;
8346 if (i40e_is_vsi_uplink_mode_veb(vsi)) { 8355 if ((pf->flags & I40E_FLAG_VEB_MODE_ENABLED) &&
8356 (i40e_is_vsi_uplink_mode_veb(vsi))) {
8347 ctxt.info.valid_sections |= 8357 ctxt.info.valid_sections |=
8348 cpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID); 8358 cpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID);
8349 ctxt.info.switch_id = 8359 ctxt.info.switch_id =
8350 cpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); 8360 cpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB);
8351 } 8361 }
8352 i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, true); 8362 i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, true);
8353 break; 8363 break;
@@ -8746,6 +8756,14 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
8746 __func__); 8756 __func__);
8747 return NULL; 8757 return NULL;
8748 } 8758 }
8759 /* We come up by default in VEPA mode if SRIOV is not
8760 * already enabled, in which case we can't force VEPA
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 }
8749 i40e_config_bridge_mode(veb); 8767 i40e_config_bridge_mode(veb);
8750 } 8768 }
8751 for (i = 0; i < I40E_MAX_VEB && !veb; i++) { 8769 for (i = 0; i < I40E_MAX_VEB && !veb; i++) {
@@ -9856,6 +9874,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
9856 goto err_switch_setup; 9874 goto err_switch_setup;
9857 } 9875 }
9858 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
9859 err = i40e_setup_pf_switch(pf, false); 9886 err = i40e_setup_pf_switch(pf, false);
9860 if (err) { 9887 if (err) {
9861 dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err); 9888 dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err);