aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-17 04:56:23 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-17 22:21:07 -0400
commitfd2ea0a79faad824258af5dcec1927aa24d81c16 (patch)
tree644fd4ce92227cc319c7a54c63ea07a96b8c6b8d /drivers/net/ixgbe
parent24344d2600108b9b79a60c0e4c43b3c499856d14 (diff)
net: Use queue aware tests throughout.
This effectively "flips the switch" by making the core networking and multiqueue-aware drivers use the new TX multiqueue structures. Non-multiqueue drivers need no changes. The interfaces they use such as netif_stop_queue() degenerate into an operation on TX queue zero. So everything "just works" for them. Code that really wants to do "X" to all TX queues now invokes a routine that does so, such as netif_tx_wake_all_queues(), netif_tx_stop_all_queues(), etc. pktgen and netpoll required a little bit more surgery than the others. In particular the pktgen changes, whilst functional, could be largely improved. The initial check in pktgen_xmit() will sometimes check the wrong queue, which is mostly harmless. The thing to do is probably to invoke fill_packet() earlier. The bulk of the netpoll changes is to make the code operate solely on the TX queue indicated by by the SKB queue mapping. Setting of the SKB queue mapping is entirely confined inside of net/core/dev.c:dev_pick_tx(). If we end up needing any kind of special semantics (drops, for example) it will be implemented here. Finally, we now have a "real_num_tx_queues" which is where the driver indicates how many TX queues are actually active. With IGB changes from Jeff Kirsher. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c10
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c15
2 files changed, 7 insertions, 18 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 81b769093d22..3efe5dda10af 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -252,16 +252,10 @@ static int ixgbe_set_tso(struct net_device *netdev, u32 data)
252 netdev->features |= NETIF_F_TSO; 252 netdev->features |= NETIF_F_TSO;
253 netdev->features |= NETIF_F_TSO6; 253 netdev->features |= NETIF_F_TSO6;
254 } else { 254 } else {
255 struct ixgbe_adapter *adapter = netdev_priv(netdev); 255 netif_tx_stop_all_queues(netdev);
256 int i;
257 netif_stop_queue(netdev);
258 for (i = 0; i < adapter->num_tx_queues; i++)
259 netif_stop_subqueue(netdev, i);
260 netdev->features &= ~NETIF_F_TSO; 256 netdev->features &= ~NETIF_F_TSO;
261 netdev->features &= ~NETIF_F_TSO6; 257 netdev->features &= ~NETIF_F_TSO6;
262 for (i = 0; i < adapter->num_tx_queues; i++) 258 netif_tx_start_all_queues(netdev);
263 netif_start_subqueue(netdev, i);
264 netif_start_queue(netdev);
265 } 259 }
266 return 0; 260 return 0;
267} 261}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index e6df9233f5ef..6af8fb5c4b5f 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2013,7 +2013,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
2013 del_timer_sync(&adapter->watchdog_timer); 2013 del_timer_sync(&adapter->watchdog_timer);
2014 2014
2015 netif_carrier_off(netdev); 2015 netif_carrier_off(netdev);
2016 netif_stop_queue(netdev); 2016 netif_tx_stop_all_queues(netdev);
2017 2017
2018 if (!pci_channel_offline(adapter->pdev)) 2018 if (!pci_channel_offline(adapter->pdev))
2019 ixgbe_reset(adapter); 2019 ixgbe_reset(adapter);
@@ -2359,7 +2359,7 @@ try_msi:
2359 2359
2360out: 2360out:
2361 /* Notify the stack of the (possibly) reduced Tx Queue count. */ 2361 /* Notify the stack of the (possibly) reduced Tx Queue count. */
2362 adapter->netdev->egress_subqueue_count = adapter->num_tx_queues; 2362 adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
2363 2363
2364 return err; 2364 return err;
2365} 2365}
@@ -2896,7 +2896,6 @@ static void ixgbe_watchdog(unsigned long data)
2896 struct net_device *netdev = adapter->netdev; 2896 struct net_device *netdev = adapter->netdev;
2897 bool link_up; 2897 bool link_up;
2898 u32 link_speed = 0; 2898 u32 link_speed = 0;
2899 int i;
2900 2899
2901 adapter->hw.mac.ops.check_link(&adapter->hw, &(link_speed), &link_up); 2900 adapter->hw.mac.ops.check_link(&adapter->hw, &(link_speed), &link_up);
2902 2901
@@ -2917,9 +2916,7 @@ static void ixgbe_watchdog(unsigned long data)
2917 (FLOW_TX ? "TX" : "None")))); 2916 (FLOW_TX ? "TX" : "None"))));
2918 2917
2919 netif_carrier_on(netdev); 2918 netif_carrier_on(netdev);
2920 netif_wake_queue(netdev); 2919 netif_tx_wake_all_queues(netdev);
2921 for (i = 0; i < adapter->num_tx_queues; i++)
2922 netif_wake_subqueue(netdev, i);
2923 } else { 2920 } else {
2924 /* Force detection of hung controller */ 2921 /* Force detection of hung controller */
2925 adapter->detect_tx_hung = true; 2922 adapter->detect_tx_hung = true;
@@ -2928,7 +2925,7 @@ static void ixgbe_watchdog(unsigned long data)
2928 if (netif_carrier_ok(netdev)) { 2925 if (netif_carrier_ok(netdev)) {
2929 DPRINTK(LINK, INFO, "NIC Link is Down\n"); 2926 DPRINTK(LINK, INFO, "NIC Link is Down\n");
2930 netif_carrier_off(netdev); 2927 netif_carrier_off(netdev);
2931 netif_stop_queue(netdev); 2928 netif_tx_stop_all_queues(netdev);
2932 } 2929 }
2933 } 2930 }
2934 2931
@@ -3631,9 +3628,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
3631 ixgbe_start_hw(hw); 3628 ixgbe_start_hw(hw);
3632 3629
3633 netif_carrier_off(netdev); 3630 netif_carrier_off(netdev);
3634 netif_stop_queue(netdev); 3631 netif_tx_stop_all_queues(netdev);
3635 for (i = 0; i < adapter->num_tx_queues; i++)
3636 netif_stop_subqueue(netdev, i);
3637 3632
3638 ixgbe_napi_add_all(adapter); 3633 ixgbe_napi_add_all(adapter);
3639 3634