aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2013-11-09 07:52:32 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-11 00:19:36 -0500
commit170e85430bcbe4d18e81b5a70bb163c741381092 (patch)
tree5f599f0abec66a765d187025215564f57a831a4d /drivers/net/ethernet
parent0123713957a1977fcb5fc93173122d8af58e0c2c (diff)
ixgbe: add warning when max_vfs is out of range.
The max_vfs parameter has a limit of 63 and silently fails (adding 0 vfs) when it is out of range. This patch adds a warning so that the user knows something went wrong. Also, this patch moves the warning in ixgbe_enable_sriov() to where max_vfs is checked, so that even an out of range value will show the deprecated warning. Previously, an out of range parameter didn't even warn the user to use the new sysfs interface instead. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c17
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c4
2 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index ec1bf3edb063..bd8f5239dfe6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -133,7 +133,7 @@ static struct notifier_block dca_notifier = {
133static unsigned int max_vfs; 133static unsigned int max_vfs;
134module_param(max_vfs, uint, 0); 134module_param(max_vfs, uint, 0);
135MODULE_PARM_DESC(max_vfs, 135MODULE_PARM_DESC(max_vfs,
136 "Maximum number of virtual functions to allocate per physical function - default is zero and maximum value is 63"); 136 "Maximum number of virtual functions to allocate per physical function - default is zero and maximum value is 63. (Deprecated)");
137#endif /* CONFIG_PCI_IOV */ 137#endif /* CONFIG_PCI_IOV */
138 138
139static unsigned int allow_unsupported_sfp; 139static unsigned int allow_unsupported_sfp;
@@ -5023,11 +5023,20 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
5023 hw->fc.disable_fc_autoneg = ixgbe_device_supports_autoneg_fc(hw); 5023 hw->fc.disable_fc_autoneg = ixgbe_device_supports_autoneg_fc(hw);
5024 5024
5025#ifdef CONFIG_PCI_IOV 5025#ifdef CONFIG_PCI_IOV
5026 if (max_vfs > 0)
5027 e_dev_warn("Enabling SR-IOV VFs using the max_vfs module parameter is deprecated - please use the pci sysfs interface instead.\n");
5028
5026 /* assign number of SR-IOV VFs */ 5029 /* assign number of SR-IOV VFs */
5027 if (hw->mac.type != ixgbe_mac_82598EB) 5030 if (hw->mac.type != ixgbe_mac_82598EB) {
5028 adapter->num_vfs = (max_vfs > 63) ? 0 : max_vfs; 5031 if (max_vfs > 63) {
5032 adapter->num_vfs = 0;
5033 e_dev_warn("max_vfs parameter out of range. Not assigning any SR-IOV VFs\n");
5034 } else {
5035 adapter->num_vfs = max_vfs;
5036 }
5037 }
5038#endif /* CONFIG_PCI_IOV */
5029 5039
5030#endif
5031 /* enable itr by default in dynamic mode */ 5040 /* enable itr by default in dynamic mode */
5032 adapter->rx_itr_setting = 1; 5041 adapter->rx_itr_setting = 1;
5033 adapter->tx_itr_setting = 1; 5042 adapter->tx_itr_setting = 1;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index a8571e488ea4..d6f0c0d8cf11 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -129,10 +129,6 @@ void ixgbe_enable_sriov(struct ixgbe_adapter *adapter)
129 if (!pre_existing_vfs && !adapter->num_vfs) 129 if (!pre_existing_vfs && !adapter->num_vfs)
130 return; 130 return;
131 131
132 if (!pre_existing_vfs)
133 dev_warn(&adapter->pdev->dev,
134 "Enabling SR-IOV VFs using the module parameter is deprecated - please use the pci sysfs interface.\n");
135
136 /* If there are pre-existing VFs then we have to force 132 /* If there are pre-existing VFs then we have to force
137 * use of that many - over ride any module parameter value. 133 * use of that many - over ride any module parameter value.
138 * This may result from the user unloading the PF driver 134 * This may result from the user unloading the PF driver