From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [VLAN]: translate IF_OPER_DORMANT to netif_dormant_on() Date: Mon, 10 Jul 2006 09:56:03 -0700 Message-ID: <20060710095603.0b197eec@dxpl.pdx.osdl.net> References: <200603211829.k2LITMNR029085@hera.kernel.org> <44AE2FCC.6020207@trash.net> <20060707143314.67bf07ff@dxpl.pdx.osdl.net> <200607091049.31628.stefan@loplof.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Patrick McHardy , Ben Greear , Linux Netdev List Return-path: Received: from smtp.osdl.org ([65.172.181.4]:36741 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1422697AbWGJQ4I (ORCPT ); Mon, 10 Jul 2006 12:56:08 -0400 To: Stefan Rompf In-Reply-To: <200607091049.31628.stefan@loplof.de> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Sun, 9 Jul 2006 10:49:31 +0200 Stefan Rompf wrote: > Am Freitag, 7. Juli 2006 23:33 schrieb Stephen Hemminger: > > > Not really. The flag code last major change was to do the dormant > > stuff that HDLC wanted. > > ... and where the maintainer doesn't seem to care to use it now that the > infrastructure is there. Sigh. > > > IMHO VLAN device's should mirror the state of the underlying physical > > device. > > > > I can't really follow the thread well. What is broken? > > The thread is still quite short and describes the problem, look at > http://marc.theaimsgroup.com/?t=115200782600004&r=1&w=2 > > Stefan Okay, going back to the original problem, before the current round of name calling. This bug shows a lot of problems with the existing VLAN device state management. 1. I think vlan code should never be using the state bits directly at all. It makes the code error prone if the bits ever change, and it means that the proper callbacks are not being done. The existing vlan_transfer_operstate does what you want. VLAN_LINK_STATE_MASK etc, should go. 2. The vlan device should not be marked as up when it is registered. Couldn't it wait for the user to bring it up? If you want to automagically bring the device up, you need to call dev_open() so that all the proper notifier's get called. 3. All checks for IFF_UP should be using netif_running instead. IFF_UP is a leftover BSDism. Instead of: int vlan_dev_open(struct net_device *dev) { if (!(VLAN_DEV_INFO(dev)->real_dev->flags & IFF_UP)) return -ENETDOWN; return 0; } Use: int vlan_dev_open(struct net_device *dev) { return netif_running(VLAN_DEV_INFO(dev)->real_dev) ? 0 : -ENETDOWN; } -- Stephen Hemminger Quis custodiet ipsos custodes?