netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Vlan interface nuisance
@ 2009-03-02  4:47 Stephen Hemminger
  2009-03-02  4:57 ` David Miller
  2009-03-02 17:20 ` Lennart Sorensen
  0 siblings, 2 replies; 26+ messages in thread
From: Stephen Hemminger @ 2009-03-02  4:47 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netdev

Why is interface created through netlink named 'vlan0' and
interface created through old vconfig called 'ethX.YY'.
Seems like the interface should be consistent.

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

* Re: Vlan interface nuisance
  2009-03-02  4:47 Vlan interface nuisance Stephen Hemminger
@ 2009-03-02  4:57 ` David Miller
  2009-03-02  5:05   ` Stephen Hemminger
  2009-03-02 17:20 ` Lennart Sorensen
  1 sibling, 1 reply; 26+ messages in thread
From: David Miller @ 2009-03-02  4:57 UTC (permalink / raw)
  To: shemminger; +Cc: kaber, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sun, 1 Mar 2009 20:47:31 -0800

> Why is interface created through netlink named 'vlan0' and
> interface created through old vconfig called 'ethX.YY'.
> Seems like the interface should be consistent.

I think the netlink scheme is saner, and the idea is to
transition people over to that.

We can't change what vconfig uses, so what Patrick decided
to do is pretty sane if you ask me.

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

* Re: Vlan interface nuisance
  2009-03-02  4:57 ` David Miller
@ 2009-03-02  5:05   ` Stephen Hemminger
  2009-03-02  5:28     ` David Miller
  2009-03-02  6:50     ` Herbert Xu
  0 siblings, 2 replies; 26+ messages in thread
From: Stephen Hemminger @ 2009-03-02  5:05 UTC (permalink / raw)
  To: David Miller; +Cc: kaber, netdev

On Sun, 01 Mar 2009 20:57:02 -0800 (PST)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Sun, 1 Mar 2009 20:47:31 -0800
> 
> > Why is interface created through netlink named 'vlan0' and
> > interface created through old vconfig called 'ethX.YY'.
> > Seems like the interface should be consistent.
> 
> I think the netlink scheme is saner, and the idea is to
> transition people over to that.
> 
> We can't change what vconfig uses, so what Patrick decided
> to do is pretty sane if you ask me.

This is missing:
------------------------------------------------------------------
Subject: vlan: names should be consistent

Vlan's created via netlink should be the same as vlan's created
via older interface. This patches changes is to be consistent.

One could argue this is an API change (it changes behaviour of netlink
interface), but I argue this was a design bug when the netlink interface
to VLAN was added.

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


--- a/net/8021q/vlan.c	2009-03-01 20:54:15.906263870 -0800
+++ b/net/8021q/vlan.c	2009-03-01 20:58:34.290763830 -0800
@@ -292,24 +292,11 @@ out_free_group:
 	return err;
 }
 
-/*  Attach a VLAN device to a mac address (ie Ethernet Card).
- *  Returns 0 if the device was created or a negative error code otherwise.
- */
-static int register_vlan_device(struct net_device *real_dev, u16 vlan_id)
+void vlan_name(char *name, const struct net_device *real_dev, u16 vlan_id)
 {
-	struct net_device *new_dev;
-	struct net *net = dev_net(real_dev);
-	struct vlan_net *vn = net_generic(net, vlan_net_id);
-	char name[IFNAMSIZ];
-	int err;
-
-	if (vlan_id >= VLAN_VID_MASK)
-		return -ERANGE;
-
-	err = vlan_check_real_dev(real_dev, vlan_id);
-	if (err < 0)
-		return err;
-
+	const struct net *net = dev_net(real_dev);
+	const struct vlan_net *vn = net_generic(net, vlan_net_id);
+
 	/* Gotta set up the fields for the device. */
 	switch (vn->name_type) {
 	case VLAN_NAME_TYPE_RAW_PLUS_VID:
@@ -336,6 +323,25 @@ static int register_vlan_device(struct n
 		snprintf(name, IFNAMSIZ, "vlan%.4i", vlan_id);
 	}
 
+}
+
+/*  Attach a VLAN device to a mac address (ie Ethernet Card).
+ *  Returns 0 if the device was created or a negative error code otherwise.
+ */
+static int register_vlan_device(struct net_device *real_dev, u16 vlan_id)
+{
+	struct net_device *new_dev;
+	char name[IFNAMSIZ];
+	int err;
+
+	if (vlan_id >= VLAN_VID_MASK)
+		return -ERANGE;
+
+	err = vlan_check_real_dev(real_dev, vlan_id);
+	if (err < 0)
+		return err;
+
+	vlan_name(name, real_dev, vlan_id);
 	new_dev = alloc_netdev(sizeof(struct vlan_dev_info), name,
 			       vlan_setup);
 
--- a/net/8021q/vlan.h	2009-03-01 20:57:49.766013840 -0800
+++ b/net/8021q/vlan.h	2009-03-01 20:58:33.490013558 -0800
@@ -80,6 +80,7 @@ int vlan_dev_change_flags(const struct n
 void vlan_dev_get_realdev_name(const struct net_device *dev, char *result);
 
 int vlan_check_real_dev(struct net_device *real_dev, u16 vlan_id);
+void vlan_name(char *name, const struct net_device *real_dev, u16 vlan_id);
 void vlan_setup(struct net_device *dev);
 int register_vlan_dev(struct net_device *dev);
 void unregister_vlan_dev(struct net_device *dev);
--- a/net/8021q/vlan_netlink.c	2009-03-01 20:51:14.943013010 -0800
+++ b/net/8021q/vlan_netlink.c	2009-03-01 20:57:37.448624035 -0800
@@ -106,6 +106,7 @@ static int vlan_newlink(struct net_devic
 	struct vlan_dev_info *vlan = vlan_dev_info(dev);
 	struct net_device *real_dev;
 	int err;
+	char name[IFNAMSIZ];
 
 	if (!data[IFLA_VLAN_ID])
 		return -EINVAL;
@@ -129,6 +130,11 @@ static int vlan_newlink(struct net_devic
 	else if (dev->mtu > real_dev->mtu)
 		return -EINVAL;
 
+	vlan_name(name, real_dev, vlan->vlan_id);
+	err = dev_change_name(dev, name);
+	if (err < 0)
+		return err;
+
 	err = vlan_changelink(dev, tb, data);
 	if (err < 0)
 		return err;

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

* Re: Vlan interface nuisance
  2009-03-02  5:05   ` Stephen Hemminger
@ 2009-03-02  5:28     ` David Miller
  2009-03-02  9:44       ` Patrick McHardy
  2009-03-02  6:50     ` Herbert Xu
  1 sibling, 1 reply; 26+ messages in thread
From: David Miller @ 2009-03-02  5:28 UTC (permalink / raw)
  To: shemminger; +Cc: kaber, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sun, 1 Mar 2009 21:05:41 -0800

> On Sun, 01 Mar 2009 20:57:02 -0800 (PST)
> David Miller <davem@davemloft.net> wrote:
> 
> > From: Stephen Hemminger <shemminger@vyatta.com>
> > Date: Sun, 1 Mar 2009 20:47:31 -0800
> > 
> > > Why is interface created through netlink named 'vlan0' and
> > > interface created through old vconfig called 'ethX.YY'.
> > > Seems like the interface should be consistent.
> > 
> > I think the netlink scheme is saner, and the idea is to
> > transition people over to that.
> > 
> > We can't change what vconfig uses, so what Patrick decided
> > to do is pretty sane if you ask me.
> 
> This is missing:

You can just say you don't think the behavior is
intentional.... :-/


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

* Re: Vlan interface nuisance
  2009-03-02  5:05   ` Stephen Hemminger
  2009-03-02  5:28     ` David Miller
@ 2009-03-02  6:50     ` Herbert Xu
  2009-03-02  7:15       ` Stephen Hemminger
  1 sibling, 1 reply; 26+ messages in thread
From: Herbert Xu @ 2009-03-02  6:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: davem, kaber, netdev

Stephen Hemminger <shemminger@vyatta.com> wrote:
>
> Subject: vlan: names should be consistent
> 
> Vlan's created via netlink should be the same as vlan's created
> via older interface. This patches changes is to be consistent.
> 
> One could argue this is an API change (it changes behaviour of netlink
> interface), but I argue this was a design bug when the netlink interface
> to VLAN was added.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

I don't see the point of this.  The new interface is available
through ip(8) only, vconfig remains unchanged.  So the user is
completely aware that the name may change as he's using a new
command.

In any case, ip(8) allows you to set the name to whatever you
want at creation time.  So for those nostalgics you can still
use ethX.Y through ip.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: Vlan interface nuisance
  2009-03-02  6:50     ` Herbert Xu
@ 2009-03-02  7:15       ` Stephen Hemminger
  2009-03-02  7:39         ` Herbert Xu
  0 siblings, 1 reply; 26+ messages in thread
From: Stephen Hemminger @ 2009-03-02  7:15 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Stephen Hemminger, davem, kaber, netdev

Herbert Xu wrote:
> Stephen Hemminger <shemminger@vyatta.com> wrote:
>   
>> Subject: vlan: names should be consistent
>>
>> Vlan's created via netlink should be the same as vlan's created
>> via older interface. This patches changes is to be consistent.
>>
>> One could argue this is an API change (it changes behaviour of netlink
>> interface), but I argue this was a design bug when the netlink interface
>> to VLAN was added.
>>
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>>     
>
> I don't see the point of this.  The new interface is available
> through ip(8) only, vconfig remains unchanged.  So the user is
> completely aware that the name may change as he's using a new
> command.
>
> In any case, ip(8) allows you to set the name to whatever you
> want at creation time.  So for those nostalgics you can still
> use ethX.Y through ip.
>
> Cheers,
>   
 Yes but their is no indication as to which interface was just created.

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

* Re: Vlan interface nuisance
  2009-03-02  7:15       ` Stephen Hemminger
@ 2009-03-02  7:39         ` Herbert Xu
  2009-03-02  9:45           ` Patrick McHardy
  0 siblings, 1 reply; 26+ messages in thread
From: Herbert Xu @ 2009-03-02  7:39 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: shemminger, davem, kaber, netdev

Stephen Hemminger <stephen.hemminger@vyatta.com> wrote:
>
>> In any case, ip(8) allows you to set the name to whatever you
>> want at creation time.  So for those nostalgics you can still
>> use ethX.Y through ip.
>>   
> Yes but their is no indication as to which interface was just created.

You should be able to set the name at creation time.

The default is only used if you didn't specify an explicit name.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: Vlan interface nuisance
  2009-03-02  5:28     ` David Miller
@ 2009-03-02  9:44       ` Patrick McHardy
  0 siblings, 0 replies; 26+ messages in thread
From: Patrick McHardy @ 2009-03-02  9:44 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev

David Miller wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Sun, 1 Mar 2009 21:05:41 -0800
> 
>> On Sun, 01 Mar 2009 20:57:02 -0800 (PST)
>> David Miller <davem@davemloft.net> wrote:
>>
>>> From: Stephen Hemminger <shemminger@vyatta.com>
>>> Date: Sun, 1 Mar 2009 20:47:31 -0800
>>>
>>>> Why is interface created through netlink named 'vlan0' and
>>>> interface created through old vconfig called 'ethX.YY'.
>>>> Seems like the interface should be consistent.
>>> I think the netlink scheme is saner, and the idea is to
>>> transition people over to that.
>>>
>>> We can't change what vconfig uses, so what Patrick decided
>>> to do is pretty sane if you ask me.
>> This is missing:
> 
> You can just say you don't think the behavior is
> intentional.... :-/

Indeed, it was intentional not to have these IMO useless naming
schemes when you can simply supply the name of your choice when
creating the interface.


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

* Re: Vlan interface nuisance
  2009-03-02  7:39         ` Herbert Xu
@ 2009-03-02  9:45           ` Patrick McHardy
  2009-03-02  9:57             ` David Miller
  0 siblings, 1 reply; 26+ messages in thread
From: Patrick McHardy @ 2009-03-02  9:45 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Stephen Hemminger, shemminger, davem, netdev

Herbert Xu wrote:
> Stephen Hemminger <stephen.hemminger@vyatta.com> wrote:
>>> In any case, ip(8) allows you to set the name to whatever you
>>> want at creation time.  So for those nostalgics you can still
>>> use ethX.Y through ip.
>>>   
>> Yes but their is no indication as to which interface was just created.
> 
> You should be able to set the name at creation time.
> 
> The default is only used if you didn't specify an explicit name.

Indeed. The kernel also sends notifications, so iproute could print
the generated name if none was specified.

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

* Re: Vlan interface nuisance
  2009-03-02  9:45           ` Patrick McHardy
@ 2009-03-02  9:57             ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2009-03-02  9:57 UTC (permalink / raw)
  To: kaber; +Cc: herbert, stephen.hemminger, shemminger, netdev

From: Patrick McHardy <kaber@trash.net>
Date: Mon, 02 Mar 2009 10:45:43 +0100

> Herbert Xu wrote:
> > Stephen Hemminger <stephen.hemminger@vyatta.com> wrote:
> >>> In any case, ip(8) allows you to set the name to whatever you
> >>> want at creation time.  So for those nostalgics you can still
> >>> use ethX.Y through ip.
> >>>   
> >> Yes but their is no indication as to which interface was just created.
> > You should be able to set the name at creation time.
> > The default is only used if you didn't specify an explicit name.
> 
> Indeed. The kernel also sends notifications, so iproute could print
> the generated name if none was specified.

I considered this issue closed 6 emails ago.

I don't know why Stephen keeps persisting. :-)

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

* Re: Vlan interface nuisance
  2009-03-02  4:47 Vlan interface nuisance Stephen Hemminger
  2009-03-02  4:57 ` David Miller
@ 2009-03-02 17:20 ` Lennart Sorensen
  2009-03-02 18:51   ` Jarek Poplawski
  1 sibling, 1 reply; 26+ messages in thread
From: Lennart Sorensen @ 2009-03-02 17:20 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Patrick McHardy, netdev

On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
> Why is interface created through netlink named 'vlan0' and
> interface created through old vconfig called 'ethX.YY'.
> Seems like the interface should be consistent.

That does seem silly.

ethX.YYYY told you which physical interface and which vlan number it was.

vlan0 tells you nothing useful.

-- 
Len Sorensen

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

* Re: Vlan interface nuisance
  2009-03-02 17:20 ` Lennart Sorensen
@ 2009-03-02 18:51   ` Jarek Poplawski
  2009-03-02 18:56     ` Ben Greear
                       ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Jarek Poplawski @ 2009-03-02 18:51 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: Stephen Hemminger, Patrick McHardy, netdev

Lennart Sorensen wrote, On 03/02/2009 06:20 PM:

> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
>> Why is interface created through netlink named 'vlan0' and
>> interface created through old vconfig called 'ethX.YY'.
>> Seems like the interface should be consistent.
> 
> That does seem silly.
> 
> ethX.YYYY told you which physical interface and which vlan number it was.
> 
> vlan0 tells you nothing useful.
 

Even if you have only one ethX?

Jarek P.

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

* Re: Vlan interface nuisance
  2009-03-02 18:51   ` Jarek Poplawski
@ 2009-03-02 18:56     ` Ben Greear
  2009-03-02 19:06       ` Jarek Poplawski
  2009-03-02 19:36     ` Lennart Sorensen
  2009-03-02 21:49     ` Patrick McHardy
  2 siblings, 1 reply; 26+ messages in thread
From: Ben Greear @ 2009-03-02 18:56 UTC (permalink / raw)
  To: Jarek Poplawski
  Cc: Lennart Sorensen, Stephen Hemminger, Patrick McHardy, netdev

Jarek Poplawski wrote:
> Lennart Sorensen wrote, On 03/02/2009 06:20 PM:
> 
>> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
>>> Why is interface created through netlink named 'vlan0' and
>>> interface created through old vconfig called 'ethX.YY'.
>>> Seems like the interface should be consistent.
>> That does seem silly.
>>
>> ethX.YYYY told you which physical interface and which vlan number it was.
>>
>> vlan0 tells you nothing useful.
>  
> 
> Even if you have only one ethX?

Yes...the old way would tell you the vlan-id regardless of how
many NICs you have, which is useful information for anyone
actually trying to configure two boxes to talk to each other,
or (god forbid), debug someone else's config.

It's true you can specify the vlan-name on creation using 'ip',
which is what I do, so I'm not going to argue Stephen's change
either way..but I do like device names that give more info...

Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

* Re: Vlan interface nuisance
  2009-03-02 18:56     ` Ben Greear
@ 2009-03-02 19:06       ` Jarek Poplawski
  2009-03-02 19:23         ` Denys Fedoryschenko
  2009-03-02 21:52         ` Patrick McHardy
  0 siblings, 2 replies; 26+ messages in thread
From: Jarek Poplawski @ 2009-03-02 19:06 UTC (permalink / raw)
  To: Ben Greear; +Cc: Lennart Sorensen, Stephen Hemminger, Patrick McHardy, netdev

Ben Greear wrote, On 03/02/2009 07:56 PM:

> Jarek Poplawski wrote:
>> Lennart Sorensen wrote, On 03/02/2009 06:20 PM:
>>
>>> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
>>>> Why is interface created through netlink named 'vlan0' and
>>>> interface created through old vconfig called 'ethX.YY'.
>>>> Seems like the interface should be consistent.
>>> That does seem silly.
>>>
>>> ethX.YYYY told you which physical interface and which vlan number it was.
>>>
>>> vlan0 tells you nothing useful.
>>  
>>
>> Even if you have only one ethX?
> 
> Yes...the old way would tell you the vlan-id regardless of how
> many NICs you have, which is useful information for anyone
> actually trying to configure two boxes to talk to each other,
> or (god forbid), debug someone else's config.
> 
> It's true you can specify the vlan-name on creation using 'ip',
> which is what I do, so I'm not going to argue Stephen's change
> either way..but I do like device names that give more info...

To make it clear: I don't say vlan0 is better; but IMHO it doesn't
have to be silly or nothing useful either.

Jarek P.

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

* Re: Vlan interface nuisance
  2009-03-02 19:06       ` Jarek Poplawski
@ 2009-03-02 19:23         ` Denys Fedoryschenko
  2009-03-02 20:24           ` Jarek Poplawski
  2009-03-02 21:52         ` Patrick McHardy
  1 sibling, 1 reply; 26+ messages in thread
From: Denys Fedoryschenko @ 2009-03-02 19:23 UTC (permalink / raw)
  To: Jarek Poplawski
  Cc: Ben Greear, Lennart Sorensen, Stephen Hemminger, Patrick McHardy,
	netdev

On Monday 02 March 2009 21:06:26 Jarek Poplawski wrote:
> > Yes...the old way would tell you the vlan-id regardless of how
> > many NICs you have, which is useful information for anyone
> > actually trying to configure two boxes to talk to each other,
> > or (god forbid), debug someone else's config.
> >
> > It's true you can specify the vlan-name on creation using 'ip',
> > which is what I do, so I'm not going to argue Stephen's change
> > either way..but I do like device names that give more info...
>
> To make it clear: I don't say vlan0 is better; but IMHO it doesn't
> have to be silly or nothing useful either.
>
> Jarek P.
I guess for Linux it should be ethN.Y.

vlanN is Cisco and other switches behaviour, since they establish vlanN 
interfaces and bridge all vlan with numbers there. In best case they do 
remapping on receive.
So on linux similar alternative of cisco interface vlan100 will be:

ip link add link eth0 type vlan id 100
ip link add link eth1 type vlan id 100
brctl addbr vlan100
brctl addif vlan100 eth0.100
brctl addif vlan100 eth1.100

But on first two steps it creates for me vlan0 and vlan1, which is not very 
informative. I guess interface names should be intuitive, and should help to 
admin to find out for who vlan0 belongs without digging tons of files.

But another point... ip -d link   output is enough useful. I can find out 
easily who is who.
141063: vlan0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether 00:0a:cd:16:82:74 brd ff:ff:ff:ff:ff:ff
    vlan id 100 <REORDER_HDR>
141070: vlan1@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether 00:0a:cd:16:82:69 brd ff:ff:ff:ff:ff:ff
    vlan id 100 <REORDER_HDR>

But IMHO ethN.Y more intuitive understandable.


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

* Re: Vlan interface nuisance
  2009-03-02 18:51   ` Jarek Poplawski
  2009-03-02 18:56     ` Ben Greear
@ 2009-03-02 19:36     ` Lennart Sorensen
  2009-03-02 20:07       ` Jarek Poplawski
  2009-03-02 21:49     ` Patrick McHardy
  2 siblings, 1 reply; 26+ messages in thread
From: Lennart Sorensen @ 2009-03-02 19:36 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: Stephen Hemminger, Patrick McHardy, netdev

On Mon, Mar 02, 2009 at 07:51:08PM +0100, Jarek Poplawski wrote:
> Even if you have only one ethX?

Yes.  What vlan number is vlan0 talking to on ethX?

Not that eth0 ever told you much useful, but at least eth0.0005 told
you something.  I guess vconfig chose the name anyhow before, so no
reason to not continue to let user space take care of what to name it.

-- 
Len Sorensen

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

* Re: Vlan interface nuisance
  2009-03-02 19:36     ` Lennart Sorensen
@ 2009-03-02 20:07       ` Jarek Poplawski
  0 siblings, 0 replies; 26+ messages in thread
From: Jarek Poplawski @ 2009-03-02 20:07 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: Stephen Hemminger, Patrick McHardy, netdev

Lennart Sorensen wrote, On 03/02/2009 08:36 PM:

> On Mon, Mar 02, 2009 at 07:51:08PM +0100, Jarek Poplawski wrote:
>> Even if you have only one ethX?
> 
> Yes.  What vlan number is vlan0 talking to on ethX?
> 
> Not that eth0 ever told you much useful, but at least eth0.0005 told
> you something. [...]


OK, you're right! More info is better. ...How about changing this
silly "eth" thing to something really useful like BSDs do?!

Jarek P.


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

* Re: Vlan interface nuisance
  2009-03-02 19:23         ` Denys Fedoryschenko
@ 2009-03-02 20:24           ` Jarek Poplawski
  0 siblings, 0 replies; 26+ messages in thread
From: Jarek Poplawski @ 2009-03-02 20:24 UTC (permalink / raw)
  To: Denys Fedoryschenko
  Cc: Ben Greear, Lennart Sorensen, Stephen Hemminger, Patrick McHardy,
	netdev

On Mon, Mar 02, 2009 at 09:23:15PM +0200, Denys Fedoryschenko wrote:
...
> But IMHO ethN.Y more intuitive understandable.

Happily there is a choice. On the other hand, I guess the main question
here is if it's OK to use different defaults depending on a config tool.

Jarek P.

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

* Re: Vlan interface nuisance
  2009-03-02 18:51   ` Jarek Poplawski
  2009-03-02 18:56     ` Ben Greear
  2009-03-02 19:36     ` Lennart Sorensen
@ 2009-03-02 21:49     ` Patrick McHardy
  2009-03-02 21:51       ` Stephen Hemminger
  2009-03-02 22:30       ` Jarek Poplawski
  2 siblings, 2 replies; 26+ messages in thread
From: Patrick McHardy @ 2009-03-02 21:49 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: Lennart Sorensen, Stephen Hemminger, netdev

Jarek Poplawski wrote:
> Lennart Sorensen wrote, On 03/02/2009 06:20 PM:
> 
>> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
>>> Why is interface created through netlink named 'vlan0' and
>>> interface created through old vconfig called 'ethX.YY'.
>>> Seems like the interface should be consistent.
>> That does seem silly.
>>
>> ethX.YYYY told you which physical interface and which vlan number it was.
>>
>> vlan0 tells you nothing useful.
>  
> 
> Even if you have only one ethX?

The binding is displayed when listing interfaces. This hole
argument is silly, if you want a particular name, just specify
it. The current naming schemes are entirely based on information
that you have to specify anyways.

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

* Re: Vlan interface nuisance
  2009-03-02 21:49     ` Patrick McHardy
@ 2009-03-02 21:51       ` Stephen Hemminger
  2009-03-02 21:54         ` Patrick McHardy
  2009-03-02 22:30       ` Jarek Poplawski
  1 sibling, 1 reply; 26+ messages in thread
From: Stephen Hemminger @ 2009-03-02 21:51 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Jarek Poplawski, Lennart Sorensen, netdev

On Mon, 02 Mar 2009 22:49:18 +0100
Patrick McHardy <kaber@trash.net> wrote:

> Jarek Poplawski wrote:
> > Lennart Sorensen wrote, On 03/02/2009 06:20 PM:
> > 
> >> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
> >>> Why is interface created through netlink named 'vlan0' and
> >>> interface created through old vconfig called 'ethX.YY'.
> >>> Seems like the interface should be consistent.
> >> That does seem silly.
> >>
> >> ethX.YYYY told you which physical interface and which vlan number it was.
> >>
> >> vlan0 tells you nothing useful.
> >  
> > 
> > Even if you have only one ethX?
> 
> The binding is displayed when listing interfaces. This hole
> argument is silly, if you want a particular name, just specify
> it. The current naming schemes are entirely based on information
> that you have to specify anyways.

I overlooked the obvious:
 ip li add link eth1 name eth1.44 type vlan id 44

Setting the name overrides.

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

* Re: Vlan interface nuisance
  2009-03-02 19:06       ` Jarek Poplawski
  2009-03-02 19:23         ` Denys Fedoryschenko
@ 2009-03-02 21:52         ` Patrick McHardy
  1 sibling, 0 replies; 26+ messages in thread
From: Patrick McHardy @ 2009-03-02 21:52 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: Ben Greear, Lennart Sorensen, Stephen Hemminger, netdev

Jarek Poplawski wrote:
> Ben Greear wrote, On 03/02/2009 07:56 PM:
> 
>> Jarek Poplawski wrote:
>>> Lennart Sorensen wrote, On 03/02/2009 06:20 PM:
>>>
>>>> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
>>>>> Why is interface created through netlink named 'vlan0' and
>>>>> interface created through old vconfig called 'ethX.YY'.
>>>>> Seems like the interface should be consistent.
>>>> That does seem silly.
>>>>
>>>> ethX.YYYY told you which physical interface and which vlan number it was.
>>>>
>>>> vlan0 tells you nothing useful.
>>>  
>>>
>>> Even if you have only one ethX?
>> Yes...the old way would tell you the vlan-id regardless of how
>> many NICs you have, which is useful information for anyone
>> actually trying to configure two boxes to talk to each other,
>> or (god forbid), debug someone else's config.
>>
>> It's true you can specify the vlan-name on creation using 'ip',
>> which is what I do, so I'm not going to argue Stephen's change
>> either way..but I do like device names that give more info...
> 
> To make it clear: I don't say vlan0 is better; but IMHO it doesn't
> have to be silly or nothing useful either.

Admittedly, this part of the rtnl_link interface could be improved.
The names are allocated centrally when unspecified, which imposes
this fixed naming scheme. A simple callback to choose a better
name than just incrementally counting up interfaces types would
allow to at least choose a default name of ethX.xyz or something
similar. I refuse to introduce the selectable naming schemes to
this interface though, this can easily be done in userspace.



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

* Re: Vlan interface nuisance
  2009-03-02 21:51       ` Stephen Hemminger
@ 2009-03-02 21:54         ` Patrick McHardy
  0 siblings, 0 replies; 26+ messages in thread
From: Patrick McHardy @ 2009-03-02 21:54 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Jarek Poplawski, Lennart Sorensen, netdev

Stephen Hemminger wrote:
> On Mon, 02 Mar 2009 22:49:18 +0100
> Patrick McHardy <kaber@trash.net> wrote:
> 
>> Jarek Poplawski wrote:
>>> Lennart Sorensen wrote, On 03/02/2009 06:20 PM:
>>>
>>>> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
>>>>> Why is interface created through netlink named 'vlan0' and
>>>>> interface created through old vconfig called 'ethX.YY'.
>>>>> Seems like the interface should be consistent.
>>>> That does seem silly.
>>>>
>>>> ethX.YYYY told you which physical interface and which vlan number it was.
>>>>
>>>> vlan0 tells you nothing useful.
>>>  
>>>
>>> Even if you have only one ethX?
>> The binding is displayed when listing interfaces. This hole
>> argument is silly, if you want a particular name, just specify
>> it. The current naming schemes are entirely based on information
>> that you have to specify anyways.
> 
> I overlooked the obvious:
>  ip li add link eth1 name eth1.44 type vlan id 44
> 
> Setting the name overrides.

Finally someone realizes it :) As stated before, there is room
for improvement, but please no selectable naming schemes when
userspace is ulitimatively responsible anyways :)


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

* Re: Vlan interface nuisance
  2009-03-02 21:49     ` Patrick McHardy
  2009-03-02 21:51       ` Stephen Hemminger
@ 2009-03-02 22:30       ` Jarek Poplawski
  2009-03-02 23:35         ` Patrick McHardy
  1 sibling, 1 reply; 26+ messages in thread
From: Jarek Poplawski @ 2009-03-02 22:30 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Lennart Sorensen, Stephen Hemminger, netdev

On Mon, Mar 02, 2009 at 10:49:18PM +0100, Patrick McHardy wrote:
> Jarek Poplawski wrote:
>> Lennart Sorensen wrote, On 03/02/2009 06:20 PM:
>>
>>> On Sun, Mar 01, 2009 at 08:47:31PM -0800, Stephen Hemminger wrote:
>>>> Why is interface created through netlink named 'vlan0' and
>>>> interface created through old vconfig called 'ethX.YY'.
>>>> Seems like the interface should be consistent.
>>> That does seem silly.
>>>
>>> ethX.YYYY told you which physical interface and which vlan number it was.
>>>
>>> vlan0 tells you nothing useful.
>>  
>>
>> Even if you have only one ethX?
>
> The binding is displayed when listing interfaces. This hole
> argument is silly, if you want a particular name, just specify
> it. The current naming schemes are entirely based on information
> that you have to specify anyways.

Just for the record, I don't agree with calling "this" argument silly
just like it was with "that" argument. Actually, I think they are
both so "right" that I've changed my mind and think it's great each
tool does it differently...

Jarek P.

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

* Re: Vlan interface nuisance
  2009-03-02 22:30       ` Jarek Poplawski
@ 2009-03-02 23:35         ` Patrick McHardy
  2009-03-03  6:41           ` Jarek Poplawski
  0 siblings, 1 reply; 26+ messages in thread
From: Patrick McHardy @ 2009-03-02 23:35 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: Lennart Sorensen, Stephen Hemminger, netdev

Jarek Poplawski wrote:
> On Mon, Mar 02, 2009 at 10:49:18PM +0100, Patrick McHardy wrote:
>> The binding is displayed when listing interfaces. This hole
>> argument is silly, if you want a particular name, just specify
>> it. The current naming schemes are entirely based on information
>> that you have to specify anyways.
> 
> Just for the record, I don't agree with calling "this" argument silly
> just like it was with "that" argument. Actually, I think they are
> both so "right" that I've changed my mind and think it's great each
> tool does it differently...

I'm not sure whether I'm supposed to understand this, so I'm going
to respond with something useful unrelated to naming user resources
that every virtual device author should know (and that seems to be
not well known):

Every virtual device bound to a different device should set the
dev->iflink field to the ifindex of the device bound to. This
makes every device related netlink message include this relation.
If the binding is already known at device-creation time and
relevant for the virtuals device's existance, this must be done
in the ->init callback to make sure its already included in the
first netlink creation message to avoid inconsistent information.

This is the also the prefered way device bindings should be
signaled to the kernel, and at least iproute and libnl are
aware of this in both directions. And to get back to the main
point of this discussion:

# ip l l
4: vlan0@dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN
     link/ether 92:2a:4f:ae:dc:29 brd ff:ff:ff:ff:ff:ff

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

* Re: Vlan interface nuisance
  2009-03-02 23:35         ` Patrick McHardy
@ 2009-03-03  6:41           ` Jarek Poplawski
  2009-03-03  6:53             ` Ben Greear
  0 siblings, 1 reply; 26+ messages in thread
From: Jarek Poplawski @ 2009-03-03  6:41 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Lennart Sorensen, Stephen Hemminger, netdev

On Tue, Mar 03, 2009 at 12:35:00AM +0100, Patrick McHardy wrote:
> Jarek Poplawski wrote:
>> On Mon, Mar 02, 2009 at 10:49:18PM +0100, Patrick McHardy wrote:
>>> The binding is displayed when listing interfaces. This hole
>>> argument is silly, if you want a particular name, just specify
>>> it. The current naming schemes are entirely based on information
>>> that you have to specify anyways.
>>
>> Just for the record, I don't agree with calling "this" argument silly
>> just like it was with "that" argument. Actually, I think they are
>> both so "right" that I've changed my mind and think it's great each
>> tool does it differently...
>
> I'm not sure whether I'm supposed to understand this, so I'm going
> to respond with something useful unrelated to naming user resources
> that every virtual device author should know (and that seems to be
> not well known):
>
> Every virtual device bound to a different device should set the
> dev->iflink field to the ifindex of the device bound to. This
> makes every device related netlink message include this relation.
> If the binding is already known at device-creation time and
> relevant for the virtuals device's existance, this must be done
> in the ->init callback to make sure its already included in the
> first netlink creation message to avoid inconsistent information.
>
> This is the also the prefered way device bindings should be
> signaled to the kernel, and at least iproute and libnl are
> aware of this in both directions. And to get back to the main
> point of this discussion:
>
> # ip l l
> 4: vlan0@dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN
>     link/ether 92:2a:4f:ae:dc:29 brd ff:ff:ff:ff:ff:ff

Yes, very interesting arguments for another disussion... But if we're
talking about naming than you seem to ignore what Lennart, Ben, Denys
and probably Stephen said about their preferred way, and I think it
matters, because if they had problems with understanding this change
I can only imagine what "common users" would say without knowing all
this technical rationale (which IMHO is disputable too - names  are
for people).

Jarek P.

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

* Re: Vlan interface nuisance
  2009-03-03  6:41           ` Jarek Poplawski
@ 2009-03-03  6:53             ` Ben Greear
  0 siblings, 0 replies; 26+ messages in thread
From: Ben Greear @ 2009-03-03  6:53 UTC (permalink / raw)
  To: Jarek Poplawski
  Cc: Patrick McHardy, Lennart Sorensen, Stephen Hemminger, netdev

Jarek Poplawski wrote:
> Yes, very interesting arguments for another disussion... But if we're
> talking about naming than you seem to ignore what Lennart, Ben, Denys
> and probably Stephen said about their preferred way, and I think it
> matters, because if they had problems with understanding this change
> I can only imagine what "common users" would say without knowing all
> this technical rationale (which IMHO is disputable too - names  are
> for people).
>   
I like my own naming scheme, and I use it by specifying the name when
creating the vlan using 'ip'.  It would have been nice (IMO) to have the
dev.vid naming be default from the beginning, but since it wasn't, it would
cause more harm than good to change it now.

So, I'm NOT arguing for changing the behaviour, though anything that can
document the features of 'ip' better and make it more obvious you can set
the name upon creation should help people...

Ben

> Jarek P.
> --
> 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
>   


-- 
Ben Greear <greearb@candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com



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

end of thread, other threads:[~2009-03-03  6:53 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-02  4:47 Vlan interface nuisance Stephen Hemminger
2009-03-02  4:57 ` David Miller
2009-03-02  5:05   ` Stephen Hemminger
2009-03-02  5:28     ` David Miller
2009-03-02  9:44       ` Patrick McHardy
2009-03-02  6:50     ` Herbert Xu
2009-03-02  7:15       ` Stephen Hemminger
2009-03-02  7:39         ` Herbert Xu
2009-03-02  9:45           ` Patrick McHardy
2009-03-02  9:57             ` David Miller
2009-03-02 17:20 ` Lennart Sorensen
2009-03-02 18:51   ` Jarek Poplawski
2009-03-02 18:56     ` Ben Greear
2009-03-02 19:06       ` Jarek Poplawski
2009-03-02 19:23         ` Denys Fedoryschenko
2009-03-02 20:24           ` Jarek Poplawski
2009-03-02 21:52         ` Patrick McHardy
2009-03-02 19:36     ` Lennart Sorensen
2009-03-02 20:07       ` Jarek Poplawski
2009-03-02 21:49     ` Patrick McHardy
2009-03-02 21:51       ` Stephen Hemminger
2009-03-02 21:54         ` Patrick McHardy
2009-03-02 22:30       ` Jarek Poplawski
2009-03-02 23:35         ` Patrick McHardy
2009-03-03  6:41           ` Jarek Poplawski
2009-03-03  6:53             ` Ben Greear

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