summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-25 20:46:37 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-10-17 14:35:06 +0100
commit78ae10037e799d649ac0421943fa62b1d10d0081 (patch)
treeaf7e19a7b680703877b83743521a483ad8a8ef0e
parentdc8d9ba5042c821a027194ec12d5c903bac7e5e5 (diff)
net: fec: move netif_wake_queue() out of transmit loop
It is wasteful to keep checking whether we're stopped, and the number of free packets to see whether we should restart the queue for each entry in the ring which we process. Move this to the end of the processing so we check once per ring clean. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 3fedb5f6cb7a..d48e16da198a 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1200,12 +1200,6 @@ fec_enet_tx(struct net_device *ndev)
/* Update pointer to next buffer descriptor to be transmitted */
bdp = fec_enet_get_nextdesc(bdp, fep);
-
- /* Since we have freed up a buffer, the ring is no longer full
- */
- if (netif_queue_stopped(ndev) &&
- fec_enet_get_free_txdesc_num(fep) >= fep->tx_wake_threshold)
- netif_wake_queue(ndev);
}
netdev_completed_queue(ndev, pkts_compl, bytes_compl);
@@ -1213,6 +1207,10 @@ fec_enet_tx(struct net_device *ndev)
/* ERR006538: Keep the transmitter going */
if (bdp != fep->cur_tx && readl(fep->hwp + FEC_X_DES_ACTIVE) == 0)
writel(0, fep->hwp + FEC_X_DES_ACTIVE);
+
+ if (netif_queue_stopped(ndev) &&
+ fec_enet_get_free_txdesc_num(fep) >= fep->tx_wake_threshold)
+ netif_wake_queue(ndev);
}
/* During a receive, the cur_rx points to the current incoming buffer.