]> Pileus Git - ~andy/linux/commitdiff
ixgbe: Make mailbox ops initialization unconditional
authorGreg Rose <gregory.v.rose@intel.com>
Tue, 11 Dec 2012 08:26:33 +0000 (08:26 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 23 Jan 2013 22:33:53 +0000 (14:33 -0800)
There is no actual dependency on initialization of the mailbox ops on
whether SR-IOV is enabled or not and it doesn't hurt to go ahead and
initialize ops unconditionally.  Move the initialization into the device
probe so that the mailbox ops are initialized at the time we have the
board info necessary to do it.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Don Dutile <ddutile@redhat.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <Sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h

index 7e0bb9536b1d51bf45ced059b891d6f8f7a0cd2b..2472dc85db0d3b070b3ad6ec58a119ff7f09a33a 100644 (file)
@@ -7362,7 +7362,14 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
 #ifdef CONFIG_PCI_IOV
-       ixgbe_enable_sriov(adapter, ii);
+       /* SR-IOV not supported on the 82598 */
+       if (adapter->hw.mac.type == ixgbe_mac_82598EB)
+               goto skip_sriov;
+       /* Mailbox */
+       ixgbe_init_mbx_params_pf(hw);
+       memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops));
+       ixgbe_enable_sriov(adapter);
+skip_sriov:
 
 #endif
        netdev->features = NETIF_F_SG |
index 647734b73202af5c1acf9c19df8e11856e9f5888..029c863cac8149d3732ace764f9f0e805e25a924 100644 (file)
@@ -44,8 +44,7 @@
 #include "ixgbe_sriov.h"
 
 #ifdef CONFIG_PCI_IOV
-void ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
-                        const struct ixgbe_info *ii)
+void ixgbe_enable_sriov(struct ixgbe_adapter *adapter)
 {
        struct ixgbe_hw *hw = &adapter->hw;
        int num_vf_macvlans, i;
@@ -128,12 +127,6 @@ void ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
                kcalloc(adapter->num_vfs,
                        sizeof(struct vf_data_storage), GFP_KERNEL);
        if (adapter->vfinfo) {
-               /* Now that we're sure SR-IOV is enabled
-                * and memory allocated set up the mailbox parameters
-                */
-               ixgbe_init_mbx_params_pf(hw);
-               memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops));
-
                /* limit trafffic classes based on VFs enabled */
                if ((adapter->hw.mac.type == ixgbe_mac_82599EB) &&
                    (adapter->num_vfs < 16)) {
index 21bc1dd1d33e0b0d564e3922de07d5e2f405c102..f693469b81ef061760f1f916de83a67a57e76129 100644 (file)
@@ -43,8 +43,7 @@ int ixgbe_ndo_get_vf_config(struct net_device *netdev,
 void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter);
 void ixgbe_disable_sriov(struct ixgbe_adapter *adapter);
 #ifdef CONFIG_PCI_IOV
-void ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
-                       const struct ixgbe_info *ii);
+void ixgbe_enable_sriov(struct ixgbe_adapter *adapter);
 #endif
 
 static inline void ixgbe_set_vmvir(struct ixgbe_adapter *adapter,