aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2014-03-19 23:47:53 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-20 04:02:32 -0400
commitcdc04dcce0598fead6029a2f95e95a4d2ea419c2 (patch)
tree5f6bc1ebe2928f3a9b261d0fcbfb1fb8338c1ba2
parent7155d051077c94d972cc77ac68e45f3ec890763e (diff)
ixgbe: enable tx queues after link up
This patch moves the call to enable Tx queues after the link is established. Previously there was a chance for aggressive start_ndo_xmit() callers to sneak packets between enabling the Tx queues and the link coming up. In addition it replaces netif_tx_start_all_queues() with netif_tx_wake_all_queues() to allow for flushing of the qdisc. CC: Arun Sharma <asharma@fb.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 354771f169b6..9e5a36612432 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4655,8 +4655,6 @@ static void ixgbe_setup_gpie(struct ixgbe_adapter *adapter)
4655static void ixgbe_up_complete(struct ixgbe_adapter *adapter) 4655static void ixgbe_up_complete(struct ixgbe_adapter *adapter)
4656{ 4656{
4657 struct ixgbe_hw *hw = &adapter->hw; 4657 struct ixgbe_hw *hw = &adapter->hw;
4658 struct net_device *upper;
4659 struct list_head *iter;
4660 int err; 4658 int err;
4661 u32 ctrl_ext; 4659 u32 ctrl_ext;
4662 4660
@@ -4698,19 +4696,6 @@ static void ixgbe_up_complete(struct ixgbe_adapter *adapter)
4698 e_crit(drv, "Fan has stopped, replace the adapter\n"); 4696 e_crit(drv, "Fan has stopped, replace the adapter\n");
4699 } 4697 }
4700 4698
4701 /* enable transmits */
4702 netif_tx_start_all_queues(adapter->netdev);
4703
4704 /* enable any upper devices */
4705 netdev_for_each_all_upper_dev_rcu(adapter->netdev, upper, iter) {
4706 if (netif_is_macvlan(upper)) {
4707 struct macvlan_dev *vlan = netdev_priv(upper);
4708
4709 if (vlan->fwd_priv)
4710 netif_tx_start_all_queues(upper);
4711 }
4712 }
4713
4714 /* bring the link up in the watchdog, this could race with our first 4699 /* bring the link up in the watchdog, this could race with our first
4715 * link up interrupt but shouldn't be a problem */ 4700 * link up interrupt but shouldn't be a problem */
4716 adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; 4701 adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
@@ -6082,6 +6067,8 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
6082{ 6067{
6083 struct net_device *netdev = adapter->netdev; 6068 struct net_device *netdev = adapter->netdev;
6084 struct ixgbe_hw *hw = &adapter->hw; 6069 struct ixgbe_hw *hw = &adapter->hw;
6070 struct net_device *upper;
6071 struct list_head *iter;
6085 u32 link_speed = adapter->link_speed; 6072 u32 link_speed = adapter->link_speed;
6086 bool flow_rx, flow_tx; 6073 bool flow_rx, flow_tx;
6087 6074
@@ -6133,6 +6120,21 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
6133 netif_carrier_on(netdev); 6120 netif_carrier_on(netdev);
6134 ixgbe_check_vf_rate_limit(adapter); 6121 ixgbe_check_vf_rate_limit(adapter);
6135 6122
6123 /* enable transmits */
6124 netif_tx_wake_all_queues(adapter->netdev);
6125
6126 /* enable any upper devices */
6127 rtnl_lock();
6128 netdev_for_each_all_upper_dev_rcu(adapter->netdev, upper, iter) {
6129 if (netif_is_macvlan(upper)) {
6130 struct macvlan_dev *vlan = netdev_priv(upper);
6131
6132 if (vlan->fwd_priv)
6133 netif_tx_wake_all_queues(upper);
6134 }
6135 }
6136 rtnl_unlock();
6137
6136 /* update the default user priority for VFs */ 6138 /* update the default user priority for VFs */
6137 ixgbe_update_default_up(adapter); 6139 ixgbe_update_default_up(adapter);
6138 6140