From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Li Yang <leoli@freescale.com>
Cc: bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
Li Yang <leoli@freescale.com>
Subject: Re: [PATCH] net/bridge: use the maximum hard_header_len of ports for bridging device
Date: Mon, 23 Mar 2009 08:51:22 -0700 [thread overview]
Message-ID: <20090323085122.4c9d21f2@nehalam> (raw)
In-Reply-To: <1237539869-30721-1-git-send-email-leoli@freescale.com>
On Fri, 20 Mar 2009 17:04:29 +0800
Li Yang <leoli@freescale.com> wrote:
> The bridging device used a constant hard_header_len. This will cause
> headroom shortage for ports with additional hardware header. The patch
> makes bridging device to use the maximum value of all ports.
>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
That ensures big enough header for locally generated packets, but
any drivers that need bigger headroom still must handle bridged packets
that come in with smaller space. When bridging packets, the skb comes
from the allocation by the receiving driver. Almost all drivers will
use dev_alloc_skb() which will allocate NET_SKB_PAD (16) bytes of
additional headroom. This is used to hold copy of ethernet header for
the bridge/netfilter code.
So your patch is fine as an optimization but a driver can not safely
depend on any additional headroom. The driver must check if there
is space, and if no space is available, reallocate and copy.
next prev parent reply other threads:[~2009-03-23 15:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-20 9:04 [PATCH] net/bridge: use the maximum hard_header_len of ports for bridging device Li Yang
2009-03-23 7:59 ` Li Yang
2009-03-23 8:02 ` David Miller
2009-03-23 8:15 ` Li Yang
2009-03-23 8:16 ` David Miller
2009-03-23 15:51 ` Stephen Hemminger [this message]
2009-03-23 22:20 ` David Miller
2009-03-23 22:45 ` Stephen Hemminger
2009-03-23 22:47 ` David Miller
2009-03-25 8:43 ` Li Yang
2009-03-25 21:35 ` David Miller
2009-03-25 6:40 ` David Miller
2009-03-25 7:05 ` Li Yang
2009-03-25 7:06 ` David Miller
2009-03-25 8:38 ` Li Yang
2009-03-25 9:15 ` [PATCH] gianfar: reallocate skb when headroom is not enough for fcb Li Yang
2009-03-25 15:53 ` Stephen Hemminger
2009-03-25 21:49 ` David Miller
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=20090323085122.4c9d21f2@nehalam \
--to=shemminger@linux-foundation.org \
--cc=bridge@lists.linux-foundation.org \
--cc=leoli@freescale.com \
--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).