aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-12-09 20:24:16 -0500
committerBen Hutchings <bhutchings@solarflare.com>2010-12-10 14:53:46 -0500
commitc04bfc6b223662c42a77727342c1df7d39e686a2 (patch)
tree96f8623e13366b677f8437ba678f617231942d58 /drivers/net/sfc/efx.c
parent6ecfd0c70c05531b2850649d0cec46833cd6c381 (diff)
sfc: Remove ancient support for nesting of TX stop
Long before this driver went into mainline, it had support for multiple TX queues per port, with lockless TX enabled. Since Linux did not know anything of this, filling up any hardware TX queue would stop the core TX queue and multiple hardware TX queues could fill up before the scheduler reacted. Thus it was necessary to keep a count of how many TX queues were stopped and to wake the core TX queue only when all had free space again. The driver also previously (ab)used the per-hardware-queue stopped flag as a counter to deal with various things that can inhibit TX, but it no longer does that. Remove the per-channel tx_stop_count, tx_stop_lock and per-hardware-queue stopped count and just use the networking core queue state directly. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r--drivers/net/sfc/efx.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 2166c1d0a533..711449c6e675 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -461,9 +461,6 @@ efx_alloc_channel(struct efx_nic *efx, int i, struct efx_channel *old_channel)
461 } 461 }
462 } 462 }
463 463
464 spin_lock_init(&channel->tx_stop_lock);
465 atomic_set(&channel->tx_stop_count, 1);
466
467 rx_queue = &channel->rx_queue; 464 rx_queue = &channel->rx_queue;
468 rx_queue->efx = efx; 465 rx_queue->efx = efx;
469 setup_timer(&rx_queue->slow_fill, efx_rx_slow_fill, 466 setup_timer(&rx_queue->slow_fill, efx_rx_slow_fill,
@@ -1406,11 +1403,11 @@ static void efx_start_all(struct efx_nic *efx)
1406 * restart the transmit interface early so the watchdog timer stops */ 1403 * restart the transmit interface early so the watchdog timer stops */
1407 efx_start_port(efx); 1404 efx_start_port(efx);
1408 1405
1409 efx_for_each_channel(channel, efx) { 1406 if (efx_dev_registered(efx))
1410 if (efx_dev_registered(efx)) 1407 netif_tx_wake_all_queues(efx->net_dev);
1411 efx_wake_queue(channel); 1408
1409 efx_for_each_channel(channel, efx)
1412 efx_start_channel(channel); 1410 efx_start_channel(channel);
1413 }
1414 1411
1415 if (efx->legacy_irq) 1412 if (efx->legacy_irq)
1416 efx->legacy_irq_enabled = true; 1413 efx->legacy_irq_enabled = true;
@@ -1498,9 +1495,7 @@ static void efx_stop_all(struct efx_nic *efx)
1498 /* Stop the kernel transmit interface late, so the watchdog 1495 /* Stop the kernel transmit interface late, so the watchdog
1499 * timer isn't ticking over the flush */ 1496 * timer isn't ticking over the flush */
1500 if (efx_dev_registered(efx)) { 1497 if (efx_dev_registered(efx)) {
1501 struct efx_channel *channel; 1498 netif_tx_stop_all_queues(efx->net_dev);
1502 efx_for_each_channel(channel, efx)
1503 efx_stop_queue(channel);
1504 netif_tx_lock_bh(efx->net_dev); 1499 netif_tx_lock_bh(efx->net_dev);
1505 netif_tx_unlock_bh(efx->net_dev); 1500 netif_tx_unlock_bh(efx->net_dev);
1506 } 1501 }
@@ -1896,6 +1891,7 @@ static DEVICE_ATTR(phy_type, 0644, show_phy_type, NULL);
1896static int efx_register_netdev(struct efx_nic *efx) 1891static int efx_register_netdev(struct efx_nic *efx)
1897{ 1892{
1898 struct net_device *net_dev = efx->net_dev; 1893 struct net_device *net_dev = efx->net_dev;
1894 struct efx_channel *channel;
1899 int rc; 1895 int rc;
1900 1896
1901 net_dev->watchdog_timeo = 5 * HZ; 1897 net_dev->watchdog_timeo = 5 * HZ;
@@ -1918,6 +1914,14 @@ static int efx_register_netdev(struct efx_nic *efx)
1918 if (rc) 1914 if (rc)
1919 goto fail_locked; 1915 goto fail_locked;
1920 1916
1917 efx_for_each_channel(channel, efx) {
1918 struct efx_tx_queue *tx_queue;
1919 efx_for_each_channel_tx_queue(tx_queue, channel) {
1920 tx_queue->core_txq = netdev_get_tx_queue(
1921 efx->net_dev, tx_queue->queue / EFX_TXQ_TYPES);
1922 }
1923 }
1924
1921 /* Always start with carrier off; PHY events will detect the link */ 1925 /* Always start with carrier off; PHY events will detect the link */
1922 netif_carrier_off(efx->net_dev); 1926 netif_carrier_off(efx->net_dev);
1923 1927