netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jpirko@redhat.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: netdev@vger.kernel.org, kaber@trash.net, fubar@us.ibm.com,
	bonding-devel@lists.sourceforge.net, davem@davemloft.net
Subject: Re: [Bonding-devel] [net-next-2.6 PATCH 2/3] bonding: check return value of nofitier when changing type
Date: Thu, 11 Mar 2010 08:59:09 +0100	[thread overview]
Message-ID: <20100311075908.GA2785@psychotron.redhat.com> (raw)
In-Reply-To: <20100310144710.605ef033@nehalam>

Wed, Mar 10, 2010 at 11:47:10PM CET, shemminger@linux-foundation.org wrote:
>On Wed, 10 Mar 2010 21:29:35 +0100
>Jiri Pirko <jpirko@redhat.com> wrote:
>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index bcc490c..5de4a15 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -1084,9 +1084,9 @@ void netdev_state_change(struct net_device *dev)
>>  }
>>  EXPORT_SYMBOL(netdev_state_change);
>>  
>> -void netdev_bonding_change(struct net_device *dev, unsigned long event)
>> +int netdev_bonding_change(struct net_device *dev, unsigned long event)
>>  {
>> -	call_netdevice_notifiers(event, dev);
>> +	return call_netdevice_notifiers(event, dev);
>>  }
>>  EXPORT_SYMBOL(netdev_bonding_change);
>>  
>
>I don't think all this pre-post stuff needed.
>Since this is general (not just bonding) how about

Well actually I reused NETDEV_BONDING_OLDTYPE. This and NETDEV_BONDING_NEWTYPE
is used in inetdev_event() and addrconf_notify(). These functions apparently
need to be notified before and after the change.

>
>int netdev_change_type(struct net_device *dev, int newtype)
>{
>	int ret, oldtype;
>
>	if (dev->flags & IFF_UP)
>		return -EBUSY;
>
>	oldtype = dev->type;
>	dev->type = newtype;
>	ret = call_netdevice_notifier(NETDEV_CHANGETYPE, dev);
>	ret = notifier_to_errno(ret);
>	if (ret)
>	     dev->type = oldtype;
>
>	return ret;
>}

I see you point here, but that would be another notifier event. Do you suggest
to have 3 of them finally? NETDEV_BONDING_OLDTYPE, NETDEV_BONDING_NEWTYPE and
NETDEV_CHANGETYPE. Looks a bit redundant to me...

Thanks.

Jirka


  reply	other threads:[~2010-03-11  7:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10 20:28 [net-next-2.6 PATCH 0/3] bonding: refuse to change bond type if it's used V3 Jiri Pirko
2010-03-10 20:28 ` [net-next-2.6 PATCH 1/3] net: rename notifier defines for netdev type change Jiri Pirko
2010-03-10 20:29 ` [net-next-2.6 PATCH 2/3] bonding: check return value of nofitier when changing type Jiri Pirko
2010-03-10 22:47   ` [Bonding-devel] " Stephen Hemminger
2010-03-11  7:59     ` Jiri Pirko [this message]
2010-03-11  9:53       ` Jiri Pirko
2010-03-10 20:30 ` [net-next-2.6 PATCH 3/3] net: forbid underlaying devices to change its type Jiri Pirko
2010-03-10 21:04   ` Jay Vosburgh
2010-03-10 21:17     ` Jiri Pirko
2010-03-19  3:05 ` [net-next-2.6 PATCH 0/3] bonding: refuse to change bond type if it's used V3 David Miller

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=20100311075908.GA2785@psychotron.redhat.com \
    --to=jpirko@redhat.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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).