netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netdev: generate kobject uevent on network events.
       [not found]       ` <ac3eb2510811230813s3cb5c248k1e15d9ece581c8ad@mail.gmail.com>
@ 2008-11-24 19:45         ` Stephen Hemminger
  2008-11-24 19:55           ` Kay Sievers
  2008-11-24 20:06           ` Ben Hutchings
  0 siblings, 2 replies; 12+ messages in thread
From: Stephen Hemminger @ 2008-11-24 19:45 UTC (permalink / raw)
  To: Kay Sievers, David Miller; +Cc: Marcel Holtmann, linux-hotplug, netdev

It is easier for some applications to deal with text based interfaces
like uevent, rather than using netlink to listen for events.

Note, this does not deal with network namespaces but that is a generic
problem that already exists with kobjects (see rename events).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 net/core/Makefile |    1 
 net/core/uevent.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

--- a/net/core/Makefile	2008-11-24 08:40:10.000000000 -0800
+++ b/net/core/Makefile	2008-11-24 08:51:01.000000000 -0800
@@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.o
 obj-$(CONFIG_NETPOLL) += netpoll.o
 obj-$(CONFIG_NET_DMA) += user_dma.o
 obj-$(CONFIG_FIB_RULES) += fib_rules.o
+obj-$(CONFIG_HOTPLUG) += uevent.o
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/net/core/uevent.c	2008-11-24 09:06:50.000000000 -0800
@@ -0,0 +1,60 @@
+/*
+ * Linux network device event notification
+ *
+ * Author:
+ *	Stephen Hemminger <shemminger@vyatta.com>
+ */
+
+#include <linux/kernel.h>
+#include <linux/netdevice.h>
+#include <linux/kobject.h>
+#include <linux/notifier.h>
+
+/*
+ * Generate uevent in response to nework device changes.
+ * NB: KOBJ_MOVE is already genereated by kobject_rename
+ */
+static int netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
+{
+	struct net_device *netdev = ptr;
+
+	switch (event) {
+	case NETDEV_UNREGISTER:
+		kobject_uevent(&netdev->dev.kobj, KOBJ_REMOVE);
+		break;
+	case NETDEV_REGISTER:
+		kobject_uevent(&netdev->dev.kobj, KOBJ_ADD);
+		break;
+	case NETDEV_UP:
+		kobject_uevent(&netdev->dev.kobj, KOBJ_ONLINE);
+		break;
+	case NETDEV_DOWN:
+		kobject_uevent(&netdev->dev.kobj, KOBJ_OFFLINE);
+		break;
+	case NETDEV_CHANGE:
+		if (netif_running(netdev)) {
+			char str[64] = "DEVSTATE=UP";
+			char *envp[2] = { str, NULL };
+
+			if (netif_oper_up(netdev))
+				strcat(str, ",RUNNING");
+			if (netif_carrier_ok(netdev))
+				strcat(str, ",LOWER_UP");
+			if (netif_dormant(netdev))
+				strcat(str, ",DORMANT");
+			kobject_uevent_env(&netdev->dev.kobj, KOBJ_CHANGE, envp);
+		}
+		break;
+	}
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block netdev_uevent_notifier = {
+	.notifier_call	= netdev_event,
+};
+
+static int __init netdev_uevent_init(void)
+{
+	return register_netdevice_notifier(&netdev_uevent_notifier);
+}
+device_initcall(netdev_uevent_init);


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network events.
  2008-11-24 19:45         ` [PATCH] netdev: generate kobject uevent on network events Stephen Hemminger
@ 2008-11-24 19:55           ` Kay Sievers
  2008-11-24 20:06             ` Stephen Hemminger
  2008-11-24 20:06           ` Ben Hutchings
  1 sibling, 1 reply; 12+ messages in thread
From: Kay Sievers @ 2008-11-24 19:55 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, Marcel Holtmann, linux-hotplug, netdev

On Mon, Nov 24, 2008 at 20:45, Stephen Hemminger <shemminger@vyatta.com> wrote:
> It is easier for some applications to deal with text based interfaces
> like uevent, rather than using netlink to listen for events.
>
> Note, this does not deal with network namespaces but that is a generic
> problem that already exists with kobjects (see rename events).
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
>  net/core/Makefile |    1
>  net/core/uevent.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 62 insertions(+)
>
> --- a/net/core/Makefile 2008-11-24 08:40:10.000000000 -0800
> +++ b/net/core/Makefile 2008-11-24 08:51:01.000000000 -0800
> @@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.o
>  obj-$(CONFIG_NETPOLL) += netpoll.o
>  obj-$(CONFIG_NET_DMA) += user_dma.o
>  obj-$(CONFIG_FIB_RULES) += fib_rules.o
> +obj-$(CONFIG_HOTPLUG) += uevent.o
> --- /dev/null   1970-01-01 00:00:00.000000000 +0000
> +++ b/net/core/uevent.c 2008-11-24 09:06:50.000000000 -0800
> @@ -0,0 +1,60 @@
> +/*
> + * Linux network device event notification
> + *
> + * Author:
> + *     Stephen Hemminger <shemminger@vyatta.com>
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/netdevice.h>
> +#include <linux/kobject.h>
> +#include <linux/notifier.h>
> +
> +/*
> + * Generate uevent in response to nework device changes.
> + * NB: KOBJ_MOVE is already genereated by kobject_rename
> + */
> +static int netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
> +{
> +       struct net_device *netdev = ptr;
> +
> +       switch (event) {
> +       case NETDEV_UNREGISTER:
> +               kobject_uevent(&netdev->dev.kobj, KOBJ_REMOVE);
> +               break;
> +       case NETDEV_REGISTER:
> +               kobject_uevent(&netdev->dev.kobj, KOBJ_ADD);
> +               break;

Did you do anything else to prevent the duplicated add/remove events?
The core does send these already. I replied with a "udevadm monitor"
output to your earlier mail. Don't you see the duplicates on your box?

Thanks,
Kay

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network events.
  2008-11-24 19:45         ` [PATCH] netdev: generate kobject uevent on network events Stephen Hemminger
  2008-11-24 19:55           ` Kay Sievers
@ 2008-11-24 20:06           ` Ben Hutchings
  2008-11-24 23:03             ` [PATCH] netdev: generate kobject uevent on network state transitions Stephen Hemminger
  1 sibling, 1 reply; 12+ messages in thread
From: Ben Hutchings @ 2008-11-24 20:06 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Kay Sievers, David Miller, Marcel Holtmann, linux-hotplug, netdev

On Mon, 2008-11-24 at 11:45 -0800, Stephen Hemminger wrote:
[...]
> +	case NETDEV_CHANGE:
> +		if (netif_running(netdev)) {
> +			char str[64] = "DEVSTATE=UP";
> +			char *envp[2] = { str, NULL };
> +
> +			if (netif_oper_up(netdev))
> +				strcat(str, ",RUNNING");
> +			if (netif_carrier_ok(netdev))
> +				strcat(str, ",LOWER_UP");
> +			if (netif_dormant(netdev))
> +				strcat(str, ",DORMANT");
> +			kobject_uevent_env(&netdev->dev.kobj, KOBJ_CHANGE, envp);
> +		}
> +		break;

Unless I'm much mistaken, NETDEV_CHANGE should only be generated when
netif_running() is true, so the test is redundant.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network events.
  2008-11-24 19:55           ` Kay Sievers
@ 2008-11-24 20:06             ` Stephen Hemminger
  2008-11-25  8:39               ` David Miller
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Hemminger @ 2008-11-24 20:06 UTC (permalink / raw)
  To: Kay Sievers; +Cc: David Miller, Marcel Holtmann, linux-hotplug, netdev

On Mon, 24 Nov 2008 20:55:02 +0100
"Kay Sievers" <kay.sievers@vrfy.org> wrote:

> On Mon, Nov 24, 2008 at 20:45, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > It is easier for some applications to deal with text based interfaces
> > like uevent, rather than using netlink to listen for events.
> >
> > Note, this does not deal with network namespaces but that is a generic
> > problem that already exists with kobjects (see rename events).
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > ---
> >  net/core/Makefile |    1
> >  net/core/uevent.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 62 insertions(+)
> >
> > --- a/net/core/Makefile 2008-11-24 08:40:10.000000000 -0800
> > +++ b/net/core/Makefile 2008-11-24 08:51:01.000000000 -0800
> > @@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.o
> >  obj-$(CONFIG_NETPOLL) += netpoll.o
> >  obj-$(CONFIG_NET_DMA) += user_dma.o
> >  obj-$(CONFIG_FIB_RULES) += fib_rules.o
> > +obj-$(CONFIG_HOTPLUG) += uevent.o
> > --- /dev/null   1970-01-01 00:00:00.000000000 +0000
> > +++ b/net/core/uevent.c 2008-11-24 09:06:50.000000000 -0800
> > @@ -0,0 +1,60 @@
> > +/*
> > + * Linux network device event notification
> > + *
> > + * Author:
> > + *     Stephen Hemminger <shemminger@vyatta.com>
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/netdevice.h>
> > +#include <linux/kobject.h>
> > +#include <linux/notifier.h>
> > +
> > +/*
> > + * Generate uevent in response to nework device changes.
> > + * NB: KOBJ_MOVE is already genereated by kobject_rename
> > + */
> > +static int netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
> > +{
> > +       struct net_device *netdev = ptr;
> > +
> > +       switch (event) {
> > +       case NETDEV_UNREGISTER:
> > +               kobject_uevent(&netdev->dev.kobj, KOBJ_REMOVE);
> > +               break;
> > +       case NETDEV_REGISTER:
> > +               kobject_uevent(&netdev->dev.kobj, KOBJ_ADD);
> > +               break;
> 
> Did you do anything else to prevent the duplicated add/remove events?
> The core does send these already. I replied with a "udevadm monitor"
> output to your earlier mail. Don't you see the duplicates on your box?
> 
> Thanks,
> Kay

okay, then i'll just take it out of here.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] netdev: generate kobject uevent on network state transitions
  2008-11-24 20:06           ` Ben Hutchings
@ 2008-11-24 23:03             ` Stephen Hemminger
  2008-11-25  3:08               ` Kay Sievers
  2008-11-25  3:51               ` Marcel Holtmann
  0 siblings, 2 replies; 12+ messages in thread
From: Stephen Hemminger @ 2008-11-24 23:03 UTC (permalink / raw)
  Cc: Ben Hutchings, Kay Sievers, David Miller, Marcel Holtmann,
	linux-hotplug, netdev

It is easier for some applications to deal with text based interfaces
like uevent, rather than using netlink to listen for events.

Note, this does not deal with network namespaces but that is a generic
problem that already exists with kobjects (see rename events).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 net/core/Makefile |    1 
 net/core/uevent.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

--- a/net/core/Makefile	2008-11-24 12:07:18.000000000 -0800
+++ b/net/core/Makefile	2008-11-24 12:07:22.000000000 -0800
@@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.o
 obj-$(CONFIG_NETPOLL) += netpoll.o
 obj-$(CONFIG_NET_DMA) += user_dma.o
 obj-$(CONFIG_FIB_RULES) += fib_rules.o
+obj-$(CONFIG_HOTPLUG) += uevent.o
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/net/core/uevent.c	2008-11-24 12:11:46.000000000 -0800
@@ -0,0 +1,55 @@
+/*
+ * Linux network device event notification
+ *
+ * Author:
+ *	Stephen Hemminger <shemminger@vyatta.com>
+ */
+
+#include <linux/kernel.h>
+#include <linux/netdevice.h>
+#include <linux/kobject.h>
+#include <linux/notifier.h>
+
+/*
+ * Generate uevent in response to network device state changes.
+ * Other events are already handled by device subsystem.
+ */
+static int netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
+{
+	struct net_device *netdev = ptr;
+
+	switch (event) {
+	case NETDEV_UP:
+		kobject_uevent(&netdev->dev.kobj, KOBJ_ONLINE);
+		break;
+
+	case NETDEV_DOWN:
+		kobject_uevent(&netdev->dev.kobj, KOBJ_OFFLINE);
+		break;
+
+	case NETDEV_CHANGE: {
+		char str[64] = "DEVSTATE=UP";
+		char *envp[2] = { str, NULL };
+
+		if (netif_oper_up(netdev))
+			strcat(str, ",RUNNING");
+		if (netif_carrier_ok(netdev))
+			strcat(str, ",LOWER_UP");
+		if (netif_dormant(netdev))
+			strcat(str, ",DORMANT");
+		kobject_uevent_env(&netdev->dev.kobj, KOBJ_CHANGE, envp);
+		break;
+		}
+	}
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block netdev_uevent_notifier = {
+	.notifier_call	= netdev_event,
+};
+
+static int __init netdev_uevent_init(void)
+{
+	return register_netdevice_notifier(&netdev_uevent_notifier);
+}
+device_initcall(netdev_uevent_init);

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network state transitions
  2008-11-24 23:03             ` [PATCH] netdev: generate kobject uevent on network state transitions Stephen Hemminger
@ 2008-11-25  3:08               ` Kay Sievers
  2008-11-25  3:51               ` Marcel Holtmann
  1 sibling, 0 replies; 12+ messages in thread
From: Kay Sievers @ 2008-11-25  3:08 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Ben Hutchings, David Miller, Marcel Holtmann, linux-hotplug,
	netdev

On Tue, Nov 25, 2008 at 00:03, Stephen Hemminger <shemminger@vyatta.com> wrote:
> It is easier for some applications to deal with text based interfaces
> like uevent, rather than using netlink to listen for events.
>
> Note, this does not deal with network namespaces but that is a generic
> problem that already exists with kobjects (see rename events).
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Works fine here.

Thanks,
Kay

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network state transitions
  2008-11-24 23:03             ` [PATCH] netdev: generate kobject uevent on network state transitions Stephen Hemminger
  2008-11-25  3:08               ` Kay Sievers
@ 2008-11-25  3:51               ` Marcel Holtmann
  2008-11-25  4:14                 ` Stephen Hemminger
  1 sibling, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2008-11-25  3:51 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Ben Hutchings, Kay Sievers, David Miller, linux-hotplug, netdev

Hi Stephen,

> It is easier for some applications to deal with text based interfaces
> like uevent, rather than using netlink to listen for events.
>
> Note, this does not deal with network namespaces but that is a generic
> problem that already exists with kobjects (see rename events).
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> net/core/Makefile |    1
> net/core/uevent.c |   61 ++++++++++++++++++++++++++++++++++++++++++++ 
> ++++++++++
> 2 files changed, 62 insertions(+)
>
> --- a/net/core/Makefile	2008-11-24 12:07:18.000000000 -0800
> +++ b/net/core/Makefile	2008-11-24 12:07:22.000000000 -0800
> @@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.o
> obj-$(CONFIG_NETPOLL) += netpoll.o
> obj-$(CONFIG_NET_DMA) += user_dma.o
> obj-$(CONFIG_FIB_RULES) += fib_rules.o
> +obj-$(CONFIG_HOTPLUG) += uevent.o
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ b/net/core/uevent.c	2008-11-24 12:11:46.000000000 -0800
> @@ -0,0 +1,55 @@
> +/*
> + * Linux network device event notification
> + *
> + * Author:
> + *	Stephen Hemminger <shemminger@vyatta.com>
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/netdevice.h>
> +#include <linux/kobject.h>
> +#include <linux/notifier.h>
> +
> +/*
> + * Generate uevent in response to network device state changes.
> + * Other events are already handled by device subsystem.
> + */
> +static int netdev_event(struct notifier_block *this, unsigned long  
> event, void *ptr)
> +{
> +	struct net_device *netdev = ptr;
> +
> +	switch (event) {
> +	case NETDEV_UP:
> +		kobject_uevent(&netdev->dev.kobj, KOBJ_ONLINE);
> +		break;
> +
> +	case NETDEV_DOWN:
> +		kobject_uevent(&netdev->dev.kobj, KOBJ_OFFLINE);
> +		break;
> +
> +	case NETDEV_CHANGE: {
> +		char str[64] = "DEVSTATE=UP";
> +		char *envp[2] = { str, NULL };
> +
> +		if (netif_oper_up(netdev))
> +			strcat(str, ",RUNNING");
> +		if (netif_carrier_ok(netdev))
> +			strcat(str, ",LOWER_UP");
> +		if (netif_dormant(netdev))
> +			strcat(str, ",DORMANT");
> +		kobject_uevent_env(&netdev->dev.kobj, KOBJ_CHANGE, envp);
> +		break;

do we wanna copy just what ifconfig shows or do we might be a more  
intelligent and have separate variables like RUNNING=1 etc.?

Regards

Marcel


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network state transitions
  2008-11-25  3:51               ` Marcel Holtmann
@ 2008-11-25  4:14                 ` Stephen Hemminger
  2008-11-25  9:09                   ` David Miller
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Hemminger @ 2008-11-25  4:14 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Ben Hutchings, Kay Sievers, David Miller, linux-hotplug, netdev

On Tue, 25 Nov 2008 04:51:53 +0100
Marcel Holtmann <marcel@holtmann.org> wrote:

> Hi Stephen,
> 
> > It is easier for some applications to deal with text based interfaces
> > like uevent, rather than using netlink to listen for events.
> >
> > Note, this does not deal with network namespaces but that is a generic
> > problem that already exists with kobjects (see rename events).
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > ---
> > net/core/Makefile |    1
> > net/core/uevent.c |   61 ++++++++++++++++++++++++++++++++++++++++++++ 
> > ++++++++++
> > 2 files changed, 62 insertions(+)
> >
> > --- a/net/core/Makefile	2008-11-24 12:07:18.000000000 -0800
> > +++ b/net/core/Makefile	2008-11-24 12:07:22.000000000 -0800
> > @@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.o
> > obj-$(CONFIG_NETPOLL) += netpoll.o
> > obj-$(CONFIG_NET_DMA) += user_dma.o
> > obj-$(CONFIG_FIB_RULES) += fib_rules.o
> > +obj-$(CONFIG_HOTPLUG) += uevent.o
> > --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> > +++ b/net/core/uevent.c	2008-11-24 12:11:46.000000000 -0800
> > @@ -0,0 +1,55 @@
> > +/*
> > + * Linux network device event notification
> > + *
> > + * Author:
> > + *	Stephen Hemminger <shemminger@vyatta.com>
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/netdevice.h>
> > +#include <linux/kobject.h>
> > +#include <linux/notifier.h>
> > +
> > +/*
> > + * Generate uevent in response to network device state changes.
> > + * Other events are already handled by device subsystem.
> > + */
> > +static int netdev_event(struct notifier_block *this, unsigned long  
> > event, void *ptr)
> > +{
> > +	struct net_device *netdev = ptr;
> > +
> > +	switch (event) {
> > +	case NETDEV_UP:
> > +		kobject_uevent(&netdev->dev.kobj, KOBJ_ONLINE);
> > +		break;
> > +
> > +	case NETDEV_DOWN:
> > +		kobject_uevent(&netdev->dev.kobj, KOBJ_OFFLINE);
> > +		break;
> > +
> > +	case NETDEV_CHANGE: {
> > +		char str[64] = "DEVSTATE=UP";
> > +		char *envp[2] = { str, NULL };
> > +
> > +		if (netif_oper_up(netdev))
> > +			strcat(str, ",RUNNING");
> > +		if (netif_carrier_ok(netdev))
> > +			strcat(str, ",LOWER_UP");
> > +		if (netif_dormant(netdev))
> > +			strcat(str, ",DORMANT");
> > +		kobject_uevent_env(&netdev->dev.kobj, KOBJ_CHANGE, envp);
> > +		break;
> 
> do we wanna copy just what ifconfig shows or do we might be a more  
> intelligent and have separate variables like RUNNING=1 etc.?
> 
> Regards
> 
> Marcel

Was arbitrary choice to just use same flags as existing ifconfig.
What ever feels best I guess...


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network events.
  2008-11-24 20:06             ` Stephen Hemminger
@ 2008-11-25  8:39               ` David Miller
  0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2008-11-25  8:39 UTC (permalink / raw)
  To: shemminger; +Cc: kay.sievers, marcel, linux-hotplug, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 24 Nov 2008 12:06:45 -0800

> On Mon, 24 Nov 2008 20:55:02 +0100
> "Kay Sievers" <kay.sievers@vrfy.org> wrote:
> 
> > Did you do anything else to prevent the duplicated add/remove events?
> > The core does send these already. I replied with a "udevadm monitor"
> > output to your earlier mail. Don't you see the duplicates on your box?
> > 
> > Thanks,
> > Kay
> 
> okay, then i'll just take it out of here.

I'll wait for the updated patch then.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network state transitions
  2008-11-25  4:14                 ` Stephen Hemminger
@ 2008-11-25  9:09                   ` David Miller
  2008-11-26  5:24                     ` Marcel Holtmann
  0 siblings, 1 reply; 12+ messages in thread
From: David Miller @ 2008-11-25  9:09 UTC (permalink / raw)
  To: shemminger; +Cc: marcel, bhutchings, kay.sievers, linux-hotplug, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 24 Nov 2008 20:14:40 -0800

> On Tue, 25 Nov 2008 04:51:53 +0100
> Marcel Holtmann <marcel@holtmann.org> wrote:
> 
> > > It is easier for some applications to deal with text based interfaces
> > > like uevent, rather than using netlink to listen for events.
> > >
> > > Note, this does not deal with network namespaces but that is a generic
> > > problem that already exists with kobjects (see rename events).
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
 ...
> > do we wanna copy just what ifconfig shows or do we might be a more  
> > intelligent and have separate variables like RUNNING=1 etc.?
> 
> Was arbitrary choice to just use same flags as existing ifconfig.
> What ever feels best I guess...

So what do folks want me to do here?  Should I put Stephen's
latest patch in, or do we want to make some kind of flags change?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network state transitions
  2008-11-25  9:09                   ` David Miller
@ 2008-11-26  5:24                     ` Marcel Holtmann
  2008-11-26 12:09                       ` Kay Sievers
  0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2008-11-26  5:24 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, bhutchings, kay.sievers, linux-hotplug, netdev

Hi Dave,

>>>> It is easier for some applications to deal with text based  
>>>> interfaces
>>>> like uevent, rather than using netlink to listen for events.
>>>>
>>>> Note, this does not deal with network namespaces but that is a  
>>>> generic
>>>> problem that already exists with kobjects (see rename events).
>>>>
>>>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ...
>>> do we wanna copy just what ifconfig shows or do we might be a more
>>> intelligent and have separate variables like RUNNING=1 etc.?
>>
>> Was arbitrary choice to just use same flags as existing ifconfig.
>> What ever feels best I guess...
>
> So what do folks want me to do here?  Should I put Stephen's
> latest patch in, or do we want to make some kind of flags change?

I am thinking of using per value variables. My personal choice.

Kay, any pointers or opinions from you?

Regards

Marcel


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] netdev: generate kobject uevent on network state transitions
  2008-11-26  5:24                     ` Marcel Holtmann
@ 2008-11-26 12:09                       ` Kay Sievers
  0 siblings, 0 replies; 12+ messages in thread
From: Kay Sievers @ 2008-11-26 12:09 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: David Miller, shemminger, bhutchings, linux-hotplug, netdev

On Wed, Nov 26, 2008 at 06:24, Marcel Holtmann <marcel@holtmann.org> wrote:
>>>>> It is easier for some applications to deal with text based interfaces
>>>>> like uevent, rather than using netlink to listen for events.
>>>>>
>>>>> Note, this does not deal with network namespaces but that is a generic
>>>>> problem that already exists with kobjects (see rename events).
>>>>>
>>>>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>> ...
>>>> do we wanna copy just what ifconfig shows or do we might be a more
>>>> intelligent and have separate variables like RUNNING=1 etc.?
>>>
>>> Was arbitrary choice to just use same flags as existing ifconfig.
>>> What ever feels best I guess...
>>
>> So what do folks want me to do here?  Should I put Stephen's
>> latest patch in, or do we want to make some kind of flags change?
>
> I am thinking of using per value variables. My personal choice.
>
> Kay, any pointers or opinions from you?

As long as we can match values with fnmatch(), it should all work fine.

Bitmasks are fine if represented as binary strings, otherwise, like
for hex strings, the fnmatch() looks really weird.

As long as no string value in the list is contained in another value,
like matching for RUNNING, IS_RUNNING, RUNNING2 would be, it's fine to
stuff them all in one string just separated by comma. If they can ever
overlap, we would need to add the comma also to the beginning and end
of the string, to be able to put it into the match string like
"*,RUNNING,*", to avoid wrong matches by partial string matches.

I leave it up to you, I'm fighting with really weird things in some
other subsystems, so all of the possible options here for the net
events look pretty to me, and should work fine, compared to some stuff
I'm used to. :)

Thanks,
Kay

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-11-26 12:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20081121234110.22b47154@extreme>
     [not found] ` <ac3eb2510811220608y33662b0bkb66026c2a21b061e@mail.gmail.com>
     [not found]   ` <F6B63A37-A69F-4197-B7E5-C9FD9BFA76F6@holtmann.org>
     [not found]     ` <20081122223249.4be03e4e@extreme>
     [not found]       ` <ac3eb2510811230813s3cb5c248k1e15d9ece581c8ad@mail.gmail.com>
2008-11-24 19:45         ` [PATCH] netdev: generate kobject uevent on network events Stephen Hemminger
2008-11-24 19:55           ` Kay Sievers
2008-11-24 20:06             ` Stephen Hemminger
2008-11-25  8:39               ` David Miller
2008-11-24 20:06           ` Ben Hutchings
2008-11-24 23:03             ` [PATCH] netdev: generate kobject uevent on network state transitions Stephen Hemminger
2008-11-25  3:08               ` Kay Sievers
2008-11-25  3:51               ` Marcel Holtmann
2008-11-25  4:14                 ` Stephen Hemminger
2008-11-25  9:09                   ` David Miller
2008-11-26  5:24                     ` Marcel Holtmann
2008-11-26 12:09                       ` Kay Sievers

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).