netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Florian Fainelli" <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com,
	vyasevic@redhat.com, davem@davemloft.net
Subject: Re: [RFC PATCH] bridge: inherit slave devices needed_headroom
Date: Wed, 21 Aug 2013 21:58:29 -0700	[thread overview]
Message-ID: <20130821215829.1d65d38e@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <1376990505-15708-1-git-send-email-f.fainelli@gmail.com>

On Tue, 20 Aug 2013 10:21:45 +0100
"Florian Fainelli" <f.fainelli@gmail.com> wrote:

> Some slave devices may have set a dev->needed_headroom value which is
> different than the default one, most likely in order to prepend a
> hardware descriptor in front of the Ethernet frame to send. Whenever a
> new slave is added to a bridge, ensure that we update the
> needed_headroom value accordingly to account for the slave
> needed_headroom value.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  net/bridge/br_if.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
> index aa6c9a8..c41d5fb 100644
> --- a/net/bridge/br_if.c
> +++ b/net/bridge/br_if.c
> @@ -383,6 +383,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
>  
>  	netdev_update_features(br->dev);
>  
> +	if (br->dev->needed_headroom < dev->needed_headroom)
> +		br->dev->needed_headroom = dev->needed_headroom;
> +
>  	spin_lock_bh(&br->lock);
>  	changed_addr = br_stp_recalculate_bridge_id(br);
>  

I am okay with this but it only helps locally generated traffic
which is the minority on most bridge devices. It does nothing for the case
where one port needs more headroom than the packet received on the
other port. That is why a device has to always work when it receives
a packet with less headroom, usually by copying.

  parent reply	other threads:[~2013-08-22  4:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20  9:21 [RFC PATCH] bridge: inherit slave devices needed_headroom Florian Fainelli
2013-08-22  3:41 ` David Miller
2013-08-22  4:58 ` Stephen Hemminger [this message]
2013-08-22 20:06   ` David Miller
2013-08-23  2:49 ` Amos Kong
2013-08-27 11:04   ` Florian Fainelli

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=20130821215829.1d65d38e@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevic@redhat.com \
    /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).