[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1456303434.5436.10.camel@redhat.com>
Date: Wed, 24 Feb 2016 09:43:54 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: pravin shelar <pshelar@....org>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Stephen Hemminger <stephen@...workplumber.org>,
Pravin Shelar <pshelar@...ira.com>,
Jesse Gross <jesse@...nel.org>,
Flavio Leitner <fbl@...close.org>,
Hannes Frederic Sowa <hannes@...essinduktion.org>
Subject: Re: [PATCH net-next 2/5] bridge: notify ensabled devices of
headroom changes
On Tue, 2016-02-23 at 11:20 -0800, pravin shelar wrote:
> On Tue, Feb 23, 2016 at 4:53 AM, Paolo Abeni <pabeni@...hat.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@...hat.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
Powered by blists - more mailing lists