summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-11-18 04:28:58 +0000
committerDavid S. Miller <davem@davemloft.net>2008-11-20 01:39:52 -0800
commit11b4aa03b212cbaa969df25e723fbd400a6e24b9 (patch)
treeb0ebca9928b2184fc498996a9871fad06542538a /drivers
parentbcb3336ce4354395e38df7e2da110fca61f86a84 (diff)
downloadlinux-3.10-11b4aa03b212cbaa969df25e723fbd400a6e24b9.tar.gz
linux-3.10-11b4aa03b212cbaa969df25e723fbd400a6e24b9.tar.bz2
linux-3.10-11b4aa03b212cbaa969df25e723fbd400a6e24b9.zip
mv643xx_eth: fix recycle check bound
When mv643xx_eth allocates skbuffs, it adds 'dma_get_cache_alignment() - 1' to the length it needs, so that it can align the skb's ->data pointer to a cache boundary. When checking whether a transmitted skbuff can be reused as a receive buffer, these bytes needs to be included into the minimum bound for the recycle check. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/mv643xx_eth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index baa7e845a01..e513f76f2a9 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -899,7 +899,8 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
if (skb != NULL) {
if (skb_queue_len(&mp->rx_recycle) <
mp->default_rx_ring_size &&
- skb_recycle_check(skb, mp->skb_size))
+ skb_recycle_check(skb, mp->skb_size +
+ dma_get_cache_alignment() - 1))
__skb_queue_head(&mp->rx_recycle, skb);
else
dev_kfree_skb(skb);