network devices generating uevents?
Subsystems (2)
RFC 1/1 network devices generating uevents?
Perhaps the following would make it easier for applications to track network device events without having to use netlink. Compile tested only so far. The implementation is almost trivial...
net/core/Makefile +1 -0
@@ -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
net/core/uevent.c new file +45 -0
45 lines not on this page · raw message
Quoted 2 lines · Stephen Hemminger
Perhaps the following would make it easier for applications to track network device events without having to use netlink.
Sure, that might be useful.
These events can not happen at a high frequency, at any time, right? We are sure that things like UP/DOWN/CHANGE can not happen at a high frequency, maybe in some failure situation?
Uevents are pretty expensive, every single of them may fork a /sbin/hotplug process, or a udev event process, regardless if anybody is listening to these events or not.
We can do that only if we can be sure, that there are never things like "storms of events", which would cause a pretty high system load, and can even crash non-udev systems with out-of-memory, caused by the stateless non-managed (disabled by udev) /sbin/hotplug scripts.
net/core/uevent.c 2008-11-21 13:42:13.000000000 -0800
Quoted 13 lines
net/core/uevent.c 2008-11-21 13:42:13.000000000 -0800 renamed from dev/null 1970-01-01 00:00:00.000000000 +0000 +9
-0@@ -0,0 +1,45 @@ +/* + * Linux network device event notification + switch (event) { + case NETDEV_UNREGISTER: + kobject_uevent(&netdev->dev.kobj, KOBJ_REMOVE); + break; + case NETDEV_REGISTER: + kobject_uevent(&netdev->dev.kobj, KOBJ_ADD); + break;
Isn't UNREGISTER/REGISTER happening at the same as the device itself being created or going away? We usually do not allow any driver code to send "add/remove" events for any "struct device", because they are handled by the driver core itself.
Along with the core-created events, wouldn't this create a sequence of add->add->remove->remove? This would confuse userspace tools, which can expect that an "add" will never be followed by another "add".
Thanks,
Kay
Quoted 8 lines · Kay Sievers
Quoted 2 lines · Stephen Hemminger
Perhaps the following would make it easier for applications to track network device events without having to use netlink.
These events can not happen at a high frequency, at any time, right? We are sure that things like UP/DOWN/CHANGE can not happen at a high frequency, maybe in some failure situation?
At _any_ time might be too strict a criteria.
You could certainly have a high rate of carrier acquire/loss if, for example, the ethernet plug was not all the way plugged in and there was vibration. But of course you could get the same thing with a usb mass storage device under the same conditions so I'm not sure that this example crosses the line. I've seen strange things happen when cables are laid in places where people walk over them. (!)
Could there be a problem with rapid fluctuation of wireless signal levels if, e.g., somebody's running a vacuum cleaner nearby?
Karl <[email protected]>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
Hi Kay,
Quoted 9 lines
Quoted 2 lines
Perhaps the following would make it easier for applications to track network device events without having to use netlink.
Sure, that might be useful.
These events can not happen at a high frequency, at any time, right? We are sure that things like UP/DOWN/CHANGE can not happen at a high frequency, maybe in some failure situation?
Quoted 8 lines
Uevents are pretty expensive, every single of them may fork a
/sbin/hotplugprocess, or a udev event process, regardless if anybody is listening to these events or not.We can do that only if we can be sure, that there are never things like "storms of events", which would cause a pretty high system load, and can even crash non-udev systems with out-of-memory, caused by the stateless non-managed (disabled by udev)
/sbin/hotplugscripts.
I was looking into the same thing the other day. And just getting the interface up/down events via uevent is pretty useful. I am also interested in getting the carrier signal of Ethernet cards via a CHANGE event.
If you look at the RTNL messages, it doesn't happen that often, but the NEWLINK messages are maybe a little bit too much and we should restrict it to event that really matter. So up/down are user triggered event normally. So that should be safe. I would be a little bit worried about the CHANGE event. Here we might wanna restrict it to a subset of possible changes inside the network device.
Regards
Marcel
Quoted 32 lines · On Sun, 23 Nov 2008 03:13:29 +0100 Marcel Holtmann <[email protected]> wrote:
Hi Kay,
Quoted 9 lines
Quoted 2 lines
Perhaps the following would make it easier for applications to track network device events without having to use netlink.
Sure, that might be useful.
These events can not happen at a high frequency, at any time, right? We are sure that things like UP/DOWN/CHANGE can not happen at a high frequency, maybe in some failure situation?
Quoted 8 lines
Uevents are pretty expensive, every single of them may fork a
/sbin/hotplugprocess, or a udev event process, regardless if anybody is listening to these events or not.We can do that only if we can be sure, that there are never things like "storms of events", which would cause a pretty high system load, and can even crash non-udev systems with out-of-memory, caused by the stateless non-managed (disabled by udev)
/sbin/hotplugscripts.I was looking into the same thing the other day. And just getting the interface up/down events via uevent is pretty useful. I am also interested in getting the carrier signal of Ethernet cards via a CHANGE event.
If you look at the RTNL messages, it doesn't happen that often, but the NEWLINK messages are maybe a little bit too much and we should restrict it to event that really matter. So up/down are user triggered event normally. So that should be safe. I would be a little bit worried about the CHANGE event. Here we might wanna restrict it to a subset of possible changes inside the network device.
Quoted 4 lines
Regards
Marcel
The events are carrier events are sampled by the linkwatch mechanism already, to eliminate too active bouncing. The other events only happen when administrator does something like add new device or take it on/off line.
Quoted 32 lines · Stephen Hemminger
Quoted 23 lines · On Sun, 23 Nov 2008 03:13:29 +0100 Marcel Holtmann <[email protected]> wrote:
Quoted 9 lines
Quoted 2 lines
Perhaps the following would make it easier for applications to track network device events without having to use netlink.
Sure, that might be useful.
These events can not happen at a high frequency, at any time, right? We are sure that things like UP/DOWN/CHANGE can not happen at a high frequency, maybe in some failure situation?
Quoted 8 lines
Uevents are pretty expensive, every single of them may fork a
/sbin/hotplugprocess, or a udev event process, regardless if anybody is listening to these events or not.We can do that only if we can be sure, that there are never things like "storms of events", which would cause a pretty high system load, and can even crash non-udev systems with out-of-memory, caused by the stateless non-managed (disabled by udev)
/sbin/hotplugscripts.I was looking into the same thing the other day. And just getting the interface up/down events via uevent is pretty useful. I am also interested in getting the carrier signal of Ethernet cards via a CHANGE event.
Quoted 6 lines
If you look at the RTNL messages, it doesn't happen that often, but the NEWLINK messages are maybe a little bit too much and we should restrict it to event that really matter. So up/down are user triggered event normally. So that should be safe. I would be a little bit worried about the CHANGE event. Here we might wanna restrict it to a subset of possible changes inside the network device.
Quoted 3 lines
The events are carrier events are sampled by the linkwatch mechanism already, to eliminate too active bouncing. The other events only happen when administrator does something like add new device or take it on/off line.
Sounds good! I just wanted to make sure, that we are safe here. Every other month someone comes up with the idea to pass errors, like I/O failures over uevents, which just can't scale if we have many devices, like thousands of block devices , which may all fail at the same time.
The patch looks fine besides the additional "add/remove" events, which should not be send by the net core.
"udevadm monitor" looks like this here:
UEVENT remove /devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/eth0 (net) UEVENT remove /devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/eth0 (net) UEVENT remove /module/e1000e (module) UEVENT add /module/e1000e (module) UEVENT add /devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/eth0 (net) UEVENT add /devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/eth0 (net)
If it makes things easier for possible consumers of these events, we may want to add environment variables to the event like CARRIER=0, CARRIER=1, or something that classifies the "change", or whatever else may fit here? There is kobject_uevent_env() which would accept an envp[], NULL terminated, string array.
Thanks,
Kay
PATCH 1/1 netdev: generate kobject uevent on network events.
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).
--- net/core/Makefile | 1 net/core/uevent.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+)
net/core/Makefile +1 -0
@@ -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
net/core/uevent.c new file +60 -0
60 lines not on this page · raw message
Re: [PATCH] netdev: generate kobject uevent on network events.
Quoted 40 lines · Stephen Hemminger
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 <[email protected]>--- net/core/Makefile | 1 net/core/uevent.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+)net/core/Makefile 2008-11-24 08:51:01.000000000 -0800 renamed from net/core/Makefile 2008-11-24 08:40:10.000000000 -0800 +1
-0@@ -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.onet/core/uevent.c 2008-11-24 09:06:50.000000000 -0800 renamed from dev/null 1970-01-01 00:00:00.000000000 +0000 +17
-0@@ -0,0 +1,60 @@ +/* + * Linux network device event notification + * + * Author: + * Stephen Hemminger <[email protected]> + */ + +#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)
net/core/uevent.c 2008-11-24 09:06:50.000000000 -0800 line 27
Quoted 10 lines
net/core/uevent.c 2008-11-24 09:06:50.000000000 -0800 renamed from dev/null 1970-01-01 00:00:00.000000000 +0000 +10
-0+{ + 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
Re: [PATCH] netdev: generate kobject uevent on network events.
Quoted 56 lines · On Mon, 24 Nov 2008 20:55:02 +0100 "Kay Sievers" <[email protected]> wrote:
Quoted 40 lines · Stephen Hemminger
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 <[email protected]>--- net/core/Makefile | 1 net/core/uevent.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+)net/core/Makefile 2008-11-24 08:51:01.000000000 -0800 renamed from net/core/Makefile 2008-11-24 08:40:10.000000000 -0800 +1
-0@@ -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.onet/core/uevent.c 2008-11-24 09:06:50.000000000 -0800 renamed from dev/null 1970-01-01 00:00:00.000000000 +0000 +17
-0@@ -0,0 +1,60 @@ +/* + * Linux network device event notification + * + * Author: + * Stephen Hemminger <[email protected]> + */ + +#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)net/core/uevent.c 2008-11-24 09:06:50.000000000 -0800 line 27
Quoted 10 lines
net/core/uevent.c 2008-11-24 09:06:50.000000000 -0800 renamed from dev/null 1970-01-01 00:00:00.000000000 +0000 +10
-0+{ + 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?
Quoted 2 lines
Thanks,
Kay
okay, then i'll just take it out of here.
David Miller
maintainerRe: [PATCH] netdev: generate kobject uevent on network events.
From: Stephen Hemminger <[email protected]>
Date: Mon, 24 Nov 2008 12:06:45 -0800
Quoted 11 lines
Quoted 6 lines · On Mon, 24 Nov 2008 20:55:02 +0100 "Kay Sievers" <[email protected]> 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,
Kayokay, then i'll just take it out of here.
I'll wait for the updated patch then.
Re: [PATCH] netdev: generate kobject uevent on network events.
In reply to Stephen HemmingerOn Mon, 2008-11-24 at 11:45 -0800, Stephen Hemminger wrote:
[...]
Quoted 4 lines
net/core/uevent.c new file +4
-0+case NETDEV_CHANGE : +if (netif_running (netdev)) { +char str[64 ] ="DEVSTATE=UP" ; +char *envp[2 ] = { str,NULL };
net/core/uevent.c line 47
Quoted 10 lines
net/core/uevent.c new file +10
-0+ +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.
Signature · 3 lines
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.
PATCH 1/1 netdev: generate kobject uevent on network state transitions
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).
--- net/core/Makefile | 1 net/core/uevent.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+)
net/core/Makefile +1 -0
@@ -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
net/core/uevent.c new file +55 -0
55 lines not on this page · raw message
Re: [PATCH] netdev: generate kobject uevent on network state transitions
Quoted 7 lines · Stephen Hemminger
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 <[email protected]>
Works fine here.
Thanks,
Kay
Re: [PATCH] netdev: generate kobject uevent on network state transitions
In reply to Stephen HemmingerHi Stephen,
Quoted 56 lines
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 <[email protected]>---
net/core/Makefile| 1net/core/uevent.c| 61 ++++++++++++++++++++++++++++++++++++++++++++
++++++++++2 files changed, 62 insertions(+)net/core/Makefile +0
-0@@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.oobj-$(CONFIG_NETPOLL) += netpoll.o
obj-$(CONFIG_NET_DMA) += user_dma.o
obj-$(CONFIG_FIB_RULES) += fib_rules.onet/core/Makefile +1
-0+obj-$(CONFIG_HOTPLUG) += uevent.onet/core/uevent.c new file +17
-0@@ -0,0 +1,55 @@ +/* +* Linux network device event notification +* +* Author: +* Stephen Hemminger <[email protected]> +*/ + +#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 longevent, void *ptr)
net/core/uevent.c new file +14
-0+{ +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" ;
net/core/uevent.c line 41
Quoted 10 lines
net/core/uevent.c new file +10
-0+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
Re: [PATCH] netdev: generate kobject uevent on network state transitions
Quoted 72 lines · On Tue, 25 Nov 2008 04:51:53 +0100 Marcel Holtmann <[email protected]> wrote:
Hi Stephen,
Quoted 56 lines
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 <[email protected]>---
net/core/Makefile| 1net/core/uevent.c| 61 ++++++++++++++++++++++++++++++++++++++++++++
++++++++++2 files changed, 62 insertions(+)net/core/Makefile +0
-0@@ -17,3 +17,4 @@ obj-$(CONFIG_NET_PKTGEN) += pktgen.oobj-$(CONFIG_NETPOLL) += netpoll.o
obj-$(CONFIG_NET_DMA) += user_dma.o
obj-$(CONFIG_FIB_RULES) += fib_rules.onet/core/Makefile +1
-0+obj-$(CONFIG_HOTPLUG) += uevent.onet/core/uevent.c new file +17
-0@@ -0,0 +1,55 @@ +/* +* Linux network device event notification +* +* Author: +* Stephen Hemminger <[email protected]> +*/ + +#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 longevent, void *ptr)
net/core/uevent.c new file +14
-0+{ +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" ;net/core/uevent.c line 41
Quoted 10 lines
net/core/uevent.c new file +10
-0+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.?
Quoted 3 lines
Regards
Marcel
Was arbitrary choice to just use same flags as existing ifconfig. What ever feels best I guess...
David Miller
maintainerRe: [PATCH] netdev: generate kobject uevent on network state transitions
From: Stephen Hemminger <[email protected]>
Date: Mon, 24 Nov 2008 20:14:40 -0800
Quoted 10 lines
Quoted 7 lines · On Tue, 25 Nov 2008 04:51:53 +0100 Marcel Holtmann <[email protected]> wrote:
Quoted 7 lines
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 <[email protected]>
...
Quoted 5 lines
Quoted 2 lines
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?
Re: [PATCH] netdev: generate kobject uevent on network state transitions
Hi Dave,
Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
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 <[email protected]>...
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
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
Re: [PATCH] netdev: generate kobject uevent on network state transitions
Quoted 14 lines · Marcel Holtmann
Quoted 14 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
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 <[email protected]>...
Quoted 5 lines
Quoted 2 lines
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...
Quoted 6 lines
Quoted 2 lines
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