All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
	nikolay@redhat.com, dingtianhong@huawei.com,
	sfeldma@cumulusnetworks.com
Subject: Re: [patch net-next] bonding: create netlink event when bonding option is changed
Date: Wed, 20 Aug 2014 14:49:22 +0200	[thread overview]
Message-ID: <20140820124922.GE1916@nanopsycho.orion> (raw)
In-Reply-To: <20140820121828.GA31336@hmsreliant.think-freely.org>

Wed, Aug 20, 2014 at 02:18:28PM CEST, nhorman@tuxdriver.com wrote:
>On Tue, Aug 19, 2014 at 04:02:12PM +0200, Jiri Pirko wrote:
>> Userspace needs to be notified if one changes some option.
>> 
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> ---
>>  drivers/net/bonding/bond_options.c | 2 ++
>>  include/linux/netdevice.h          | 1 +
>>  2 files changed, 3 insertions(+)
>> 
>> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>> index dc73463..d8dc17f 100644
>> --- a/drivers/net/bonding/bond_options.c
>> +++ b/drivers/net/bonding/bond_options.c
>> @@ -625,6 +625,8 @@ int __bond_opt_set(struct bonding *bond,
>>  out:
>>  	if (ret)
>>  		bond_opt_error_interpret(bond, opt, ret, val);
>> +	else
>> +		call_netdevice_notifiers(NETDEV_CHANGEINFODATA, bond->dev);
>>  
>>  	return ret;
>>  }
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 967ddcc..44bc4bd 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -2017,6 +2017,7 @@ struct pcpu_sw_netstats {
>>  #define NETDEV_CHANGEUPPER	0x0015
>>  #define NETDEV_RESEND_IGMP	0x0016
>>  #define NETDEV_PRECHANGEMTU	0x0017 /* notify before mtu change happened */
>> +#define NETDEV_CHANGEINFODATA	0x0018
>>  
>Do you need to create a new netdev event here?  Seems like it might be more
>concise to reuse NETDEV_CHANGE and expand the netdev_notifier_change_info
>struct.

No, I would not like to do that. There are many notifiers processing
NETDEV_CHANGE now. Plus there is no limitation in adding event number.
Plus since this it not part of any api, it can be easily changed. I
prefer to add another event number.

>
>Neil
>
>>  int register_netdevice_notifier(struct notifier_block *nb);
>>  int unregister_netdevice_notifier(struct notifier_block *nb);
>> -- 
>> 1.9.3
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 

  reply	other threads:[~2014-08-20 12:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 14:02 [patch net-next] bonding: create netlink event when bonding option is changed Jiri Pirko
2014-08-19 20:34 ` Andy Gospodarek
2014-08-19 20:37   ` Jiri Pirko
2014-08-19 20:46     ` Andy Gospodarek
2014-08-20  6:44       ` Jiri Pirko
2014-08-20 11:11         ` Veaceslav Falico
2014-08-20 14:00         ` Andy Gospodarek
2014-08-20 17:49           ` Stephen Hemminger
2014-08-20 12:18 ` Neil Horman
2014-08-20 12:49   ` Jiri Pirko [this message]
2014-08-22 19:34 ` 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=20140820124922.GE1916@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=j.vosburgh@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=nikolay@redhat.com \
    --cc=sfeldma@cumulusnetworks.com \
    --cc=vfalico@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.