netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Majer <adamm@zombino.com>
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org,
	Stephen Hemminger <shemminger@linux-foundation.org>,
	bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Issue NETDEV_CHANGE notification when bridge changes state
Date: Wed, 9 Mar 2011 10:44:49 -0600	[thread overview]
Message-ID: <20110309164448.GA2364@mira.lan.galacticasoftware.com> (raw)
In-Reply-To: <20110309150949.GE16951@cr0.redhat.com>

On Wed, Mar 09, 2011 at 11:09:49PM +0800, Américo Wang wrote:
> On Sat, Mar 05, 2011 at 11:18:33PM -0600, Adam Majer wrote:
> >
> >IPv6 address autoconfiguration relies on an UP interface to processes
> >traffic normally. A bridge that is UP enters LEARNING state and this
> >state "eats" any Router Advertising packets sent to the
> >bridge. Issuing a NETDEV_CHANGE notification on the bridge interface
> >when it changes state allows autoconfiguration code to retry
> >querying router information.
> >
> ...
> 
> >+static void br_port_change_notifier_handler(struct work_struct *work)
> >+{
> >+	struct net_bridge *br = container_of(work,
> >+					     struct net_bridge,
> >+					     change_notification_worker);
> >+
> >+	rtnl_lock();
> >+	netdev_state_change(br->dev);
> >+	rtnl_unlock();
> >+}
> >+
> 
> Do you really want user-space to get this notification too?
> Why do you put it into a workqueue? Maybe it has to be called in
> process-context?

Stephen Hemminger's patch (posted as a reply in this thread but only
on the netdev mailing list) is much better as it only brings the link
up on the bridge interface when the bridge enters forwarding mode.

Effectively it does similar thing via NETDEV_CHANGE but requires no
other hacks in other code. It should make userland much happier too.


As for my patch, I've put that in the workqueue because the
notification cannot be called in interrupt context. Is there a better
way of calling code that can sleep from interrupt context?

- Adam

-- 
Adam Majer
adamm@zombino.com

      reply	other threads:[~2011-03-09 16:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-06  5:18 [PATCH 1/2] Issue NETDEV_CHANGE notification when bridge changes state Adam Majer
2011-03-06  5:20 ` [PATCH 2/2] Retry autoconfiguration on interface after NETDEV_CHANGE notification Adam Majer
2011-03-06  5:31 ` [PATCH 1/2] Issue NETDEV_CHANGE notification when bridge changes state Adam Majer
2011-03-06  6:43 ` Stephen Hemminger
2011-03-06  8:03   ` Adam Majer
2011-03-06 17:45     ` Stephen Hemminger
2011-03-07  0:25       ` Adam Majer
2011-03-07  6:41         ` Stephen Hemminger
2011-03-07  7:44           ` Nicolas de Pesloüan
2011-03-07 18:34             ` [PATCH] bridge: control carrier based on ports online Stephen Hemminger
2011-03-07 20:48               ` Nicolas de Pesloüan
2011-03-07 21:44                 ` Stephen Hemminger
2011-03-07 21:51                   ` Nicolas de Pesloüan
2011-03-08  1:08               ` Adam Majer
2011-03-14 21:29               ` David Miller
2011-03-06 18:01     ` [PATCH 1/2] Issue NETDEV_CHANGE notification when bridge changes state Jan Ceuleers
2011-03-09 15:09 ` Américo Wang
2011-03-09 16:44   ` Adam Majer [this message]

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=20110309164448.GA2364@mira.lan.galacticasoftware.com \
    --to=adamm@zombino.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    --cc=xiyou.wangcong@gmail.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).