Commit 798e381a authored by Don Skidmore's avatar Don Skidmore Committed by David S. Miller

ixgbevf: move API neg to reset path

After this patch the API negotiation will occur in the reset path.  So now
the PF will be informed of the API version earlier.  This will also require
the mailbox lock to be initialize sooner as well.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarDon Skidmore <donald.c.skidmore@intel.com>
Tested-by: default avatarStephen Ko <stephen.s.ko@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 858c3dda
...@@ -1544,8 +1544,6 @@ void ixgbevf_up(struct ixgbevf_adapter *adapter) ...@@ -1544,8 +1544,6 @@ void ixgbevf_up(struct ixgbevf_adapter *adapter)
{ {
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
ixgbevf_negotiate_api(adapter);
ixgbevf_reset_queues(adapter); ixgbevf_reset_queues(adapter);
ixgbevf_configure(adapter); ixgbevf_configure(adapter);
...@@ -1735,10 +1733,12 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter) ...@@ -1735,10 +1733,12 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter)
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
if (hw->mac.ops.reset_hw(hw)) if (hw->mac.ops.reset_hw(hw)) {
hw_dbg(hw, "PF still resetting\n"); hw_dbg(hw, "PF still resetting\n");
else } else {
hw->mac.ops.init_hw(hw); hw->mac.ops.init_hw(hw);
ixgbevf_negotiate_api(adapter);
}
if (is_valid_ether_addr(adapter->hw.mac.addr)) { if (is_valid_ether_addr(adapter->hw.mac.addr)) {
memcpy(netdev->dev_addr, adapter->hw.mac.addr, memcpy(netdev->dev_addr, adapter->hw.mac.addr,
...@@ -2074,6 +2074,9 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter) ...@@ -2074,6 +2074,9 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter)
hw->mac.max_tx_queues = 2; hw->mac.max_tx_queues = 2;
hw->mac.max_rx_queues = 2; hw->mac.max_rx_queues = 2;
/* lock to protect mailbox accesses */
spin_lock_init(&adapter->mbx_lock);
err = hw->mac.ops.reset_hw(hw); err = hw->mac.ops.reset_hw(hw);
if (err) { if (err) {
dev_info(&pdev->dev, dev_info(&pdev->dev,
...@@ -2084,6 +2087,7 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter) ...@@ -2084,6 +2087,7 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter)
pr_err("init_shared_code failed: %d\n", err); pr_err("init_shared_code failed: %d\n", err);
goto out; goto out;
} }
ixgbevf_negotiate_api(adapter);
err = hw->mac.ops.get_mac_addr(hw, hw->mac.addr); err = hw->mac.ops.get_mac_addr(hw, hw->mac.addr);
if (err) if (err)
dev_info(&pdev->dev, "Error reading MAC address\n"); dev_info(&pdev->dev, "Error reading MAC address\n");
...@@ -2099,9 +2103,6 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter) ...@@ -2099,9 +2103,6 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter)
memcpy(hw->mac.addr, netdev->dev_addr, netdev->addr_len); memcpy(hw->mac.addr, netdev->dev_addr, netdev->addr_len);
} }
/* lock to protect mailbox accesses */
spin_lock_init(&adapter->mbx_lock);
/* Enable dynamic interrupt throttling rates */ /* Enable dynamic interrupt throttling rates */
adapter->rx_itr_setting = 1; adapter->rx_itr_setting = 1;
adapter->tx_itr_setting = 1; adapter->tx_itr_setting = 1;
...@@ -2622,8 +2623,6 @@ static int ixgbevf_open(struct net_device *netdev) ...@@ -2622,8 +2623,6 @@ static int ixgbevf_open(struct net_device *netdev)
} }
} }
ixgbevf_negotiate_api(adapter);
/* setup queue reg_idx and Rx queue count */ /* setup queue reg_idx and Rx queue count */
err = ixgbevf_setup_queues(adapter); err = ixgbevf_setup_queues(adapter);
if (err) if (err)
...@@ -3218,6 +3217,8 @@ static int ixgbevf_resume(struct pci_dev *pdev) ...@@ -3218,6 +3217,8 @@ static int ixgbevf_resume(struct pci_dev *pdev)
} }
pci_set_master(pdev); pci_set_master(pdev);
ixgbevf_reset(adapter);
rtnl_lock(); rtnl_lock();
err = ixgbevf_init_interrupt_scheme(adapter); err = ixgbevf_init_interrupt_scheme(adapter);
rtnl_unlock(); rtnl_unlock();
...@@ -3226,8 +3227,6 @@ static int ixgbevf_resume(struct pci_dev *pdev) ...@@ -3226,8 +3227,6 @@ static int ixgbevf_resume(struct pci_dev *pdev)
return err; return err;
} }
ixgbevf_reset(adapter);
if (netif_running(netdev)) { if (netif_running(netdev)) {
err = ixgbevf_open(netdev); err = ixgbevf_open(netdev);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment