From patchwork Tue Nov 18 14:28:58 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lennert Buytenhek X-Patchwork-Id: 9419 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 199D6DDDFB for ; Wed, 19 Nov 2008 01:29:05 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751385AbYKRO3A (ORCPT ); Tue, 18 Nov 2008 09:29:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751321AbYKRO27 (ORCPT ); Tue, 18 Nov 2008 09:28:59 -0500 Received: from xi.wantstofly.org ([80.101.37.227]:41511 "EHLO xi.wantstofly.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751271AbYKRO27 (ORCPT ); Tue, 18 Nov 2008 09:28:59 -0500 Received: by xi.wantstofly.org (Postfix, from userid 500) id 343717FAB1; Tue, 18 Nov 2008 15:28:58 +0100 (CET) Date: Tue, 18 Nov 2008 15:28:58 +0100 From: Lennert Buytenhek To: jeff@garzik.org, netdev@vger.kernel.org Subject: [PATCH 2/2] mv643xx_eth: fix recycle check bound Message-ID: <20081118142858.GQ5006@xi.wantstofly.org> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 7a6b37b..4d183af 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -898,7 +898,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);