netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6] vlan ioctl propagation (rev.2)
       [not found] ` <20040806132145.675fd17d.davem@redhat.com>
@ 2004-08-06 21:39   ` Stephen Hemminger
  2004-08-07 21:10     ` bert hubert
  2004-08-09 23:45     ` David S. Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Hemminger @ 2004-08-06 21:39 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

Here is a redo of the patch to propagate ethtool and mii ioctl's
on vlan's to the underlying real device.  This time the request
is copied to a new buffer, to avoid the colon name rewrite issues.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -Nru a/net/8021q/vlan.c b/net/8021q/vlan.c
--- a/net/8021q/vlan.c	2004-08-06 11:09:08 -07:00
+++ b/net/8021q/vlan.c	2004-08-06 11:09:08 -07:00
@@ -358,6 +358,7 @@
 	new_dev->set_mac_address = vlan_dev_set_mac_address;
 	new_dev->set_multicast_list = vlan_dev_set_multicast_list;
 	new_dev->destructor = free_netdev;
+	new_dev->do_ioctl = vlan_dev_ioctl;
 }
 
 /*  Attach a VLAN device to a mac address (ie Ethernet Card).
diff -Nru a/net/8021q/vlan.h b/net/8021q/vlan.h
--- a/net/8021q/vlan.h	2004-08-06 11:09:08 -07:00
+++ b/net/8021q/vlan.h	2004-08-06 11:09:08 -07:00
@@ -65,6 +65,7 @@
 int vlan_dev_set_mac_address(struct net_device *dev, void* addr);
 int vlan_dev_open(struct net_device* dev);
 int vlan_dev_stop(struct net_device* dev);
+int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd);
 int vlan_dev_set_ingress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
 int vlan_dev_set_egress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
 int vlan_dev_set_vlan_flag(char* dev_name, __u32 flag, short flag_val);
diff -Nru a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
--- a/net/8021q/vlan_dev.c	2004-08-06 11:09:08 -07:00
+++ b/net/8021q/vlan_dev.c	2004-08-06 11:09:08 -07:00
@@ -757,6 +757,34 @@
 	vlan_flush_mc_list(dev);
 	return 0;
 }
+
+int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
+	struct ifreq ifrr;
+	int err = -EOPNOTSUPP;
+
+	strncpy(ifrr.ifr_name, real_dev->name, IFNAMSIZ);
+	ifrr.ifr_ifru = ifr->ifr_ifru;
+
+	switch(cmd) {
+	case SIOCGMIIPHY:
+	case SIOCGMIIREG:
+	case SIOCSMIIREG:
+		if (real_dev->do_ioctl && netif_device_present(real_dev)) 
+			err = real_dev->do_ioctl(dev, &ifrr, cmd);
+		break;
+
+	case SIOCETHTOOL:
+		err = dev_ethtool(&ifrr);
+	}
+
+	if (!err) 
+		ifr->ifr_ifru = ifrr.ifr_ifru;
+
+	return err;
+}
+
 /** Taken from Gleb + Lennert's VLAN code, and modified... */
 void vlan_dev_set_multicast_list(struct net_device *vlan_dev)
 {

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

* Re: [PATCH 2.6] vlan ioctl propagation (rev.2)
  2004-08-06 21:39   ` [PATCH 2.6] vlan ioctl propagation (rev.2) Stephen Hemminger
@ 2004-08-07 21:10     ` bert hubert
  2004-08-08  4:38       ` Glen Turner
  2004-08-09 15:53       ` Stephen Hemminger
  2004-08-09 23:45     ` David S. Miller
  1 sibling, 2 replies; 6+ messages in thread
From: bert hubert @ 2004-08-07 21:10 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

On Fri, Aug 06, 2004 at 02:39:28PM -0700, Stephen Hemminger wrote:
> Here is a redo of the patch to propagate ethtool and mii ioctl's
> on vlan's to the underlying real device.  This time the request
> is copied to a new buffer, to avoid the colon name rewrite issues.

Is this really what we want? We also don't make virtual IPs appear as real
interfaces anymore. Virtual devices are just that - virtual.

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO

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

* Re: [PATCH 2.6] vlan ioctl propagation (rev.2)
  2004-08-07 21:10     ` bert hubert
@ 2004-08-08  4:38       ` Glen Turner
  2004-08-08 10:14         ` bert hubert
  2004-08-09 15:53       ` Stephen Hemminger
  1 sibling, 1 reply; 6+ messages in thread
From: Glen Turner @ 2004-08-08  4:38 UTC (permalink / raw)
  To: bert hubert; +Cc: Stephen Hemminger, David S. Miller, netdev

bert hubert wrote:

> On Fri, Aug 06, 2004 at 02:39:28PM -0700, Stephen Hemminger wrote:
> 
>>Here is a redo of the patch to propagate ethtool and mii ioctl's
>>on vlan's to the underlying real device.  This time the request
>>is copied to a new buffer, to avoid the colon name rewrite issues.
> 
> 
> Is this really what we want? We also don't make virtual IPs appear as real
> interfaces anymore. Virtual devices are just that - virtual.

Hi Bert,

Please don't be so absolute. For example, if the virtual device "link" status
doesn't reflect that of the real device then routing software needs to parse
the virtual->real device mappings (a parsing for which Linux provides only
limited support).

Worse still, we now need to special-case virtual interfaces in application
code:
    while (virtual_interface(interface_name)) {
      virtual_to_real(interface_name, &interface_name);
    }

This is the sort of nasty detail than operating systems are meant to abstract
away from application code.

Thanks,
Glen

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

* Re: [PATCH 2.6] vlan ioctl propagation (rev.2)
  2004-08-08  4:38       ` Glen Turner
@ 2004-08-08 10:14         ` bert hubert
  0 siblings, 0 replies; 6+ messages in thread
From: bert hubert @ 2004-08-08 10:14 UTC (permalink / raw)
  To: Glen Turner; +Cc: Stephen Hemminger, David S. Miller, netdev

On Sun, Aug 08, 2004 at 02:08:36PM +0930, Glen Turner wrote:

>    while (virtual_interface(interface_name)) {
>      virtual_to_real(interface_name, &interface_name);
>    }
> 
> This is the sort of nasty detail than operating systems are meant to
> abstract away from application code.

What I'm saying is that even userspace should not offer this abstraction.
Remember the past confusion over "ifconfig eth0:1 down" ?

But I'm more than prepared to follow DaveM's lead here, I just want to be
sure people think about this change.

Regards,

bert 

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO

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

* Re: [PATCH 2.6] vlan ioctl propagation (rev.2)
  2004-08-07 21:10     ` bert hubert
  2004-08-08  4:38       ` Glen Turner
@ 2004-08-09 15:53       ` Stephen Hemminger
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2004-08-09 15:53 UTC (permalink / raw)
  To: bert hubert; +Cc: David S. Miller, netdev

On Sat, 7 Aug 2004 23:10:37 +0200
bert hubert <ahu@ds9a.nl> wrote:

> On Fri, Aug 06, 2004 at 02:39:28PM -0700, Stephen Hemminger wrote:
> > Here is a redo of the patch to propagate ethtool and mii ioctl's
> > on vlan's to the underlying real device.  This time the request
> > is copied to a new buffer, to avoid the colon name rewrite issues.
> 
> Is this really what we want? We also don't make virtual IPs appear as real
> interfaces anymore. Virtual devices are just that - virtual.
> 
> -- 
> http://www.PowerDNS.com      Open source, database driven DNS Software 
> http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO

The problem is that the bridge code (and bonding) want to be able to send ethtool
ioctl's to the device.  The bridge wants it to find out the speed of the device
to set the spanning tree values appropriately. 
I would rather not special case VLAN's.

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

* Re: [PATCH 2.6] vlan ioctl propagation (rev.2)
  2004-08-06 21:39   ` [PATCH 2.6] vlan ioctl propagation (rev.2) Stephen Hemminger
  2004-08-07 21:10     ` bert hubert
@ 2004-08-09 23:45     ` David S. Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David S. Miller @ 2004-08-09 23:45 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Fri, 6 Aug 2004 14:39:28 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> Here is a redo of the patch to propagate ethtool and mii ioctl's
> on vlan's to the underlying real device.  This time the request
> is copied to a new buffer, to avoid the colon name rewrite issues.

Applied.

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

end of thread, other threads:[~2004-08-09 23:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040806091305.4d405664@dell_ss3.pdx.osdl.net>
     [not found] ` <20040806132145.675fd17d.davem@redhat.com>
2004-08-06 21:39   ` [PATCH 2.6] vlan ioctl propagation (rev.2) Stephen Hemminger
2004-08-07 21:10     ` bert hubert
2004-08-08  4:38       ` Glen Turner
2004-08-08 10:14         ` bert hubert
2004-08-09 15:53       ` Stephen Hemminger
2004-08-09 23:45     ` David S. Miller

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