netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: buytenh@wantstofly.org
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] mv643xx_eth: don't include cache padding in rx desc buffer size
Date: Thu, 07 Jan 2010 01:11:22 -0800 (PST)	[thread overview]
Message-ID: <20100107.011122.67574781.davem@davemloft.net> (raw)
In-Reply-To: <20100105191532.GU1735@mail.wantstofly.org>

From: Lennert Buytenhek <buytenh@wantstofly.org>
Date: Tue, 5 Jan 2010 20:15:32 +0100

> From: Saeed Bishara <saeed@marvell.com>
> 
> If NET_SKB_PAD is not a multiple of the cache line size, mv643xx_eth 
> allocates a couple of extra bytes at the start of each receive buffer
> to make the data payload end up on a cache line boundary.
> 
> These extra bytes are skb_reserve()'d before DMA mapping, so they
> should not be included in the DMA map byte count (as the mapping is
> done starting at skb->data), nor should they be included in the
> receive descriptor buffer size field, or the hardware can end up
> DMAing beyond the end of the buffer, which can happen if someone
> sends us a larger-than-MTU sized packet.
> 
> This problem was introduced in commit 7fd96ce47ff ("mv643xx_eth:
> rework receive skb cache alignment", May 6 2009), but hasn't appeared
> to be problematic so far, probably as the main users of mv643xx_eth
> all have NET_SKB_PAD == L1_CACHE_BYTES.
> 
> Signed-off-by: Saeed Bishara <saeed@marvell.com>
> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>

Applied, thanks.

      reply	other threads:[~2010-01-07  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-05 19:15 [PATCH] mv643xx_eth: don't include cache padding in rx desc buffer size Lennert Buytenhek
2010-01-07  9:11 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100107.011122.67574781.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=buytenh@wantstofly.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).