Ethernet Bridge development
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: "Pekka Savola (ipv6)" <pekkas@netcore.fi>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
	James Morris <jmorris@namei.org>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	"David S. Miller" <davem@davemloft.net>,
	Tom Herbert <therbert@google.com>
Subject: Re: [Bridge] [RFC PATCH v2] net: fold dev_disable_lro() into netdev_fix_features()
Date: Thu, 12 May 2011 18:35:27 +0200	[thread overview]
Message-ID: <20110512163527.GA17878@rere.qmqm.pl> (raw)
In-Reply-To: <1305217747.5214.17.camel@bwh-desktop>

On Thu, May 12, 2011 at 05:29:07PM +0100, Ben Hutchings wrote:
> On Thu, 2011-05-12 at 18:06 +0200, Michał Mirosław wrote:
> > This implements checks for forwarding mode in netdev_fix_features() using
> > dev->priv_flags bits. As a side effect, after device is no longer
> > forwarding it gets LRO back. This also means that user is not allowed to
> > enable LRO after device is put to forwarding mode.
> > 
> > This patch depends on removal of discrete offload setting ethtool ops.
> 
> This is nice, but:
> 
> [...]
> > --- a/net/bridge/br_if.c
> > +++ b/net/bridge/br_if.c
> > @@ -158,6 +158,8 @@ static void del_nbp(struct net_bridge_port *p)
> >  	br_netpoll_disable(p);
> >  
> >  	call_rcu(&p->rcu, destroy_nbp_rcu);
> > +
> > +	netdev_update_features(dev);
> >  }
> >  
> >  /* called with RTNL */
> > @@ -368,11 +370,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
> >  
> >  	dev->priv_flags |= IFF_BRIDGE_PORT;
> >  
> > -	dev_disable_lro(dev);
> > -
> >  	list_add_rcu(&p->list, &br->port_list);
> >  
> > -	netdev_update_features(br->dev);
> > +	netdev_change_features(dev);
> >  
> >  	spin_lock_bh(&br->lock);
> >  	changed_addr = br_stp_recalculate_bridge_id(br);
> Why netdev_change_features() here?  I thought that was primarily for use
> when vlan_features may have been changed.

Because this recalculates port's features and then cascades to bridge's
device. I could have written:

	netdev_update_features(dev);
	netdev_update_features(br->dev);

But that might cause redundant recalculations for br->dev (first through
notifier calls). I'll add a comment here.

> 
> [...]
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> [...]
> > @@ -5241,6 +5221,11 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
> >  		}
> >  	}
> >  
> > +	if (features & NETIF_F_LRO && dev->priv_flags & IFF_LRO_FORBIDDEN) {
> > +		netdev_info(dev, "Disabling LRO for forwarding interface.\n");
> > +		features &= NETIF_F_LRO;
> [...]
> 
> Mising '~'.

Fixed.

Best Regards,
Michał Mirosław

  reply	other threads:[~2011-05-12 16:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-07 11:48 [Bridge] [RFC PATCH] net: fold dev_disable_lro() into netdev_fix_features() Michał Mirosław
2011-05-09 19:08 ` David Miller
2011-05-12 16:06   ` Michał Mirosław
2011-05-12 16:06 ` [Bridge] [RFC PATCH v2] " Michał Mirosław
2011-05-12 16:29   ` Ben Hutchings
2011-05-12 16:35     ` Michał Mirosław [this message]
2011-05-12 16:57     ` Stephen Hemminger
2011-05-12 16:37   ` [Bridge] [RFC PATCH v3] " Michał Mirosław

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=20110512163527.GA17878@rere.qmqm.pl \
    --to=mirq-linux@rere.qmqm.pl \
    --cc=bhutchings@solarflare.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jmorris@namei.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=pekkas@netcore.fi \
    --cc=therbert@google.com \
    --cc=yoshfuji@linux-ipv6.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