netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dummy: do not create a link (dummy0) at module init by default
@ 2011-01-17  0:49 David Ward
  2011-01-17  9:25 ` Jarek Poplawski
  2011-01-17 16:56 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: David Ward @ 2011-01-17  0:49 UTC (permalink / raw)
  To: netdev, shemminger

When the dummy network driver is initialized with no parameters, a link
is automatically created (named 'dummy0'). This is inconsistent with
other virtual network drivers such as veth, macvlan, and macvtap, which
do not create a link upon initialization.

This also causes confusing behavior when sending an RTM_NEWLINK message
for a dummy link, because the kernel will load the dummy network driver
first if it has not already been loaded. When that occurs, the result
is that two new links are actually created (or if IFLA_IFNAME is set to
'dummy0', the error EEXIST is returned). The following iproute command
demonstrates this behavior:

  ip link add [ name dummy0 ] type dummy

With this change, users who still want to have a link created when the
dummy network driver is loaded (instead of using iproute to create the
link as shown above) just need to set the 'numdummies' parameter to 1:

  modprobe dummy numdummies=1

Signed-off-by: David Ward <david.ward@ll.mit.edu>
---
 drivers/net/dummy.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index ff2d29b..ac8815f 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -38,7 +38,7 @@
 #include <net/rtnetlink.h>
 #include <linux/u64_stats_sync.h>
 
-static int numdummies = 1;
+static int numdummies = 0;
 
 static int dummy_set_address(struct net_device *dev, void *p)
 {
-- 
1.7.3.4


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

* Re: [PATCH] dummy: do not create a link (dummy0) at module init by default
  2011-01-17  0:49 [PATCH] dummy: do not create a link (dummy0) at module init by default David Ward
@ 2011-01-17  9:25 ` Jarek Poplawski
  2011-01-17 16:56 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Jarek Poplawski @ 2011-01-17  9:25 UTC (permalink / raw)
  To: David Ward; +Cc: netdev, shemminger

On 2011-01-17 01:49, David Ward wrote:
> When the dummy network driver is initialized with no parameters, a link
> is automatically created (named 'dummy0'). This is inconsistent with
> other virtual network drivers such as veth, macvlan, and macvtap, which
> do not create a link upon initialization.

Actually, this is consistent with _other_ virtual network drivers such
as loopback, ifb, and teql, which create a link upon initialization ;-)

Jarek P.

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

* Re: [PATCH] dummy: do not create a link (dummy0) at module init by default
  2011-01-17  0:49 [PATCH] dummy: do not create a link (dummy0) at module init by default David Ward
  2011-01-17  9:25 ` Jarek Poplawski
@ 2011-01-17 16:56 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2011-01-17 16:56 UTC (permalink / raw)
  To: David Ward; +Cc: netdev

On Sun, 16 Jan 2011 19:49:53 -0500
David Ward <david.ward@ll.mit.edu> wrote:

> When the dummy network driver is initialized with no parameters, a link
> is automatically created (named 'dummy0'). This is inconsistent with
> other virtual network drivers such as veth, macvlan, and macvtap, which
> do not create a link upon initialization.
> 
> This also causes confusing behavior when sending an RTM_NEWLINK message
> for a dummy link, because the kernel will load the dummy network driver
> first if it has not already been loaded. When that occurs, the result
> is that two new links are actually created (or if IFLA_IFNAME is set to
> 'dummy0', the error EEXIST is returned). The following iproute command
> demonstrates this behavior:
> 
>   ip link add [ name dummy0 ] type dummy
> 
> With this change, users who still want to have a link created when the
> dummy network driver is loaded (instead of using iproute to create the
> link as shown above) just need to set the 'numdummies' parameter to 1:
> 
>   modprobe dummy numdummies=1
> 
> Signed-off-by: David Ward <david.ward@ll.mit.edu>

I understand what you are trying to do, and it makes sense.
But because of the history behind this it can't change.
We can't change existing API and break user scripts.

The 'ip link' command support is new (in last couple of years), and
the module parameter has been around since early days.

If you want to load module without any devices just use:
  modprobe dummy numdummies=0


-- 

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

end of thread, other threads:[~2011-01-17 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17  0:49 [PATCH] dummy: do not create a link (dummy0) at module init by default David Ward
2011-01-17  9:25 ` Jarek Poplawski
2011-01-17 16:56 ` Stephen Hemminger

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