aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVineet Gupta <Vineet.Gupta1@synopsys.com>2013-09-04 07:47:15 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-05 14:25:10 -0400
commit27082ee1b92f4d41e78b85fe40f6ab39673fba00 (patch)
treef71d1548ade88d3f1484f59aca8fb04ec2524679 /drivers
parent7bf6630523a4fddcc3e37bc37dadbe0cf2362354 (diff)
ethernet/arc/arc_emac: Fix huge delays in large file copies
copying large files to a NFS mounted host was taking absurdly large time. Turns out that TX BD reclaim had a sublte bug. Loop starts off from @txbd_dirty cursor and stops when it hits a BD still in use by controller. However when it stops it needs to keep the cursor at that very BD to resume scanning in next iteration. However it was erroneously incrementing the cursor, causing the next scan(s) to fail too, unless the BD chain was completely drained out. [ARCLinux]$ ls -l -sh /disk/log.txt 17976 -rw-r--r-- 1 root root 17.5M Sep /disk/log.txt ========== Before ===================== [ARCLinux]$ time cp /disk/log.txt /mnt/. real 31m 7.95s user 0m 0.00s sys 0m 0.10s ========== After ===================== [ARCLinux]$ time cp /disk/log.txt /mnt/. real 0m 24.33s user 0m 0.00s sys 0m 0.19s Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> (commit_signer:3/4=75%) Cc: "David S. Miller" <davem@davemloft.net> (commit_signer:3/4=75%) Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: arc-linux-dev@synopsys.com Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/arc/emac_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index 55d79cb53a79..9e1601487263 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -149,8 +149,6 @@ static void arc_emac_tx_clean(struct net_device *ndev)
149 struct sk_buff *skb = tx_buff->skb; 149 struct sk_buff *skb = tx_buff->skb;
150 unsigned int info = le32_to_cpu(txbd->info); 150 unsigned int info = le32_to_cpu(txbd->info);
151 151
152 *txbd_dirty = (*txbd_dirty + 1) % TX_BD_NUM;
153
154 if ((info & FOR_EMAC) || !txbd->data) 152 if ((info & FOR_EMAC) || !txbd->data)
155 break; 153 break;
156 154
@@ -180,6 +178,8 @@ static void arc_emac_tx_clean(struct net_device *ndev)
180 txbd->data = 0; 178 txbd->data = 0;
181 txbd->info = 0; 179 txbd->info = 0;
182 180
181 *txbd_dirty = (*txbd_dirty + 1) % TX_BD_NUM;
182
183 if (netif_queue_stopped(ndev)) 183 if (netif_queue_stopped(ndev))
184 netif_wake_queue(ndev); 184 netif_wake_queue(ndev);
185 } 185 }