netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: pravin shelar <pshelar@ovn.org>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Pravin Shelar <pshelar@nicira.com>,
	Jesse Gross <jesse@kernel.org>, Flavio Leitner <fbl@sysclose.org>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>
Subject: Re: [PATCH net-next 2/5] bridge: notify ensabled devices of headroom changes
Date: Wed, 24 Feb 2016 09:43:54 +0100	[thread overview]
Message-ID: <1456303434.5436.10.camel@redhat.com> (raw)
In-Reply-To: <CAOrHB_Cf6Cnp-r4eMChq=9UeUq_Rg7QG41MiP=HmZFAFaCrUAA@mail.gmail.com>

On Tue, 2016-02-23 at 11:20 -0800, pravin shelar wrote:
> On Tue, Feb 23, 2016 at 4:53 AM, Paolo Abeni <pabeni@redhat.com> wrote:
> > On bridge needed_headroom changes, the enslaved devices are
> > notified via the ndo_set_rx_headroom method
> >
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > ---
> >  net/bridge/br_if.c | 36 ++++++++++++++++++++++++++++++++++--
> >  1 file changed, 34 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
> > index c367b3e..f42f1da 100644
> > --- a/net/bridge/br_if.c
> > +++ b/net/bridge/br_if.c
> > @@ -223,6 +223,31 @@ static void destroy_nbp_rcu(struct rcu_head *head)
> >         destroy_nbp(p);
> >  }
> >
> > +static unsigned get_max_headroom(struct net_bridge *br)
> > +{
> > +       unsigned max_headroom = 0;
> > +       struct net_bridge_port *p;
> > +
> > +       list_for_each_entry(p, &br->port_list, list) {
> > +               unsigned dev_headroom = netdev_get_fwd_headroom(p->dev);
> > +
> 
> IFF_PHONY_HEADROOM is only set for veth and ovs-internal-device, so we
> can not get headroom for tunnel devices. I guess it worked in your
> tests due to the bug in netdev_get_fwd_headroom().

This code should be actually correct; the idea is to ignore the devices
with phony headroom when computing the maximum headroom; all other
devices should be taken in account.

The current, bugged, netdev_get_fwd_headroom() implementation is
actually the culprit for the confusion.

Paolo

  reply	other threads:[~2016-02-24  8:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 12:53 [PATCH net-next 0/5] bridge/ovs: avoid skb head copy on frame forwarding Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 1/5] netdev: introduce ndo_set_rx_headroom Paolo Abeni
2016-02-23 19:20   ` pravin shelar
2016-02-24  8:37     ` Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 2/5] bridge: notify ensabled devices of headroom changes Paolo Abeni
2016-02-23 19:20   ` pravin shelar
2016-02-24  8:43     ` Paolo Abeni [this message]
2016-02-23 12:53 ` [PATCH net-next 3/5] ovs: propagate per dp max headroom to all vports Paolo Abeni
2016-02-23 19:20   ` pravin shelar
2016-02-24  8:59     ` Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 4/5] net/tun: implement ndo_set_rx_headroom Paolo Abeni
2016-02-25 10:49   ` Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 5/5] veth: " Paolo Abeni
2016-02-23 19:21   ` pravin shelar
2016-02-24  9:17     ` Paolo Abeni

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=1456303434.5436.10.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=fbl@sysclose.org \
    --cc=hannes@stressinduktion.org \
    --cc=jesse@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=pshelar@ovn.org \
    --cc=stephen@networkplumber.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).