Commit 6953154d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] smc91x: release on-chip RX packet memory ASAP

From: Nicolas Pitre <nico@cam.org>

We are desperately in need of on-chip memory so free it as soon as we have
fetched its content.  Suggested by Marc Singer.
Signed-off-by: default avatarNicolas Pitre <nico@cam.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent c2f804e1
...@@ -481,6 +481,8 @@ static inline void smc_rcv(struct net_device *dev) ...@@ -481,6 +481,8 @@ static inline void smc_rcv(struct net_device *dev)
packet_len, packet_len); packet_len, packet_len);
if (unlikely(status & RS_ERRORS)) { if (unlikely(status & RS_ERRORS)) {
SMC_WAIT_MMU_BUSY();
SMC_SET_MMU_CMD(MC_RELEASE);
lp->stats.rx_errors++; lp->stats.rx_errors++;
if (status & RS_ALGNERR) if (status & RS_ALGNERR)
lp->stats.rx_frame_errors++; lp->stats.rx_frame_errors++;
...@@ -509,8 +511,10 @@ static inline void smc_rcv(struct net_device *dev) ...@@ -509,8 +511,10 @@ static inline void smc_rcv(struct net_device *dev)
if (unlikely(skb == NULL)) { if (unlikely(skb == NULL)) {
printk(KERN_NOTICE "%s: Low memory, packet dropped.\n", printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
dev->name); dev->name);
SMC_WAIT_MMU_BUSY();
SMC_SET_MMU_CMD(MC_RELEASE);
lp->stats.rx_dropped++; lp->stats.rx_dropped++;
goto done; return;
} }
/* Align IP header to 32 bits */ /* Align IP header to 32 bits */
...@@ -529,6 +533,9 @@ static inline void smc_rcv(struct net_device *dev) ...@@ -529,6 +533,9 @@ static inline void smc_rcv(struct net_device *dev)
data = skb_put(skb, data_len); data = skb_put(skb, data_len);
SMC_PULL_DATA(data, packet_len - 4); SMC_PULL_DATA(data, packet_len - 4);
SMC_WAIT_MMU_BUSY();
SMC_SET_MMU_CMD(MC_RELEASE);
PRINT_PKT(data, packet_len - 4); PRINT_PKT(data, packet_len - 4);
dev->last_rx = jiffies; dev->last_rx = jiffies;
...@@ -538,10 +545,6 @@ static inline void smc_rcv(struct net_device *dev) ...@@ -538,10 +545,6 @@ static inline void smc_rcv(struct net_device *dev)
lp->stats.rx_packets++; lp->stats.rx_packets++;
lp->stats.rx_bytes += data_len; lp->stats.rx_bytes += data_len;
} }
done:
SMC_WAIT_MMU_BUSY();
SMC_SET_MMU_CMD(MC_RELEASE);
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment