From 78ae10037e799d649ac0421943fa62b1d10d0081 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 25 Mar 2014 20:46:37 +0000 Subject: 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 --- drivers/net/ethernet/freescale/fec_main.c | 10 ++++------ 1 file 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. -- cgit