aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bfin_mac.h
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2010-06-11 05:44:31 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-15 18:04:10 -0400
commit4fcc3d3409b0ab37c1f790e04a1f7c984b436167 (patch)
treec05b3e27f61b3644cd3514d4bbf7443d7588803a /drivers/net/bfin_mac.h
parentaa1039e73cc2cf834e99c09d2033d5d2675357b9 (diff)
netdev:bfin_mac: reclaim and free tx skb as soon as possible after transfer
SKBs hold onto resources that can't be held indefinitely, such as TCP socket references and netfilter conntrack state. So if a packet is left in TX ring for a long time, there might be a TCP socket that cannot be closed and freed up. Current blackfin EMAC driver always reclaim and free used tx skbs in future transfers. The problem is that future transfer may not come as soon as possible. This patch start a timer after transfer to reclaim and free skb. There is nearly no performance drop with this patch. TX interrupt is not enabled because of a strange behavior of the Blackfin EMAC. If EMAC TX transfer control is turned on, endless TX interrupts are triggered no matter if TX DMA is enabled or not. Since DMA walks down the ring automatically, TX transfer control can't be turned off in the middle. The only way is to disable TX interrupt completely. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bfin_mac.h')
-rw-r--r--drivers/net/bfin_mac.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/bfin_mac.h b/drivers/net/bfin_mac.h
index 1ae7b82ceeee..04e4050df18b 100644
--- a/drivers/net/bfin_mac.h
+++ b/drivers/net/bfin_mac.h
@@ -13,9 +13,12 @@
13#include <linux/net_tstamp.h> 13#include <linux/net_tstamp.h>
14#include <linux/clocksource.h> 14#include <linux/clocksource.h>
15#include <linux/timecompare.h> 15#include <linux/timecompare.h>
16#include <linux/timer.h>
16 17
17#define BFIN_MAC_CSUM_OFFLOAD 18#define BFIN_MAC_CSUM_OFFLOAD
18 19
20#define TX_RECLAIM_JIFFIES (HZ / 5)
21
19struct dma_descriptor { 22struct dma_descriptor {
20 struct dma_descriptor *next_dma_desc; 23 struct dma_descriptor *next_dma_desc;
21 unsigned long start_addr; 24 unsigned long start_addr;
@@ -68,6 +71,8 @@ struct bfin_mac_local {
68 71
69 int wol; /* Wake On Lan */ 72 int wol; /* Wake On Lan */
70 int irq_wake_requested; 73 int irq_wake_requested;
74 struct timer_list tx_reclaim_timer;
75 struct net_device *ndev;
71 76
72 /* MII and PHY stuffs */ 77 /* MII and PHY stuffs */
73 int old_link; /* used by bf537_adjust_link */ 78 int old_link; /* used by bf537_adjust_link */