From: Ben Greear <greearb@candelatech•com>
To: Stephen Hemminger <shemminger@osdl•org>
Cc: Stefan Rompf <stefan@loplof•de>,
Patrick McHardy <kaber@trash•net>,
Linux Netdev List <netdev@vger•kernel.org>
Subject: Re: [VLAN]: translate IF_OPER_DORMANT to netif_dormant_on()
Date: Mon, 10 Jul 2006 10:02:04 -0700 [thread overview]
Message-ID: <44B2880C.9040801@candelatech.com> (raw)
In-Reply-To: <20060710095603.0b197eec@dxpl.pdx.osdl.net>
Stephen Hemminger wrote:
> On Sun, 9 Jul 2006 10:49:31 +0200
> Stefan Rompf <stefan@loplof•de> 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.
This sounds good to me.
> 3. All checks for IFF_UP should be using netif_running instead.
> IFF_UP is a leftover BSDism.
That also sounds good.
>
> 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;
> }
>
--
Ben Greear <greearb@candelatech•com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2006-07-10 17:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200603211829.k2LITMNR029085@hera.kernel.org>
2006-07-04 10:07 ` [VLAN]: translate IF_OPER_DORMANT to netif_dormant_on() Patrick McHardy
2006-07-05 18:57 ` Stefan Rompf
2006-07-05 21:00 ` Patrick McHardy
2006-07-05 21:17 ` Ben Greear
2006-07-06 7:42 ` Patrick McHardy
2006-07-07 9:45 ` Stefan Rompf
2006-07-07 9:56 ` Patrick McHardy
2006-07-07 21:33 ` Stephen Hemminger
2006-07-09 8:49 ` Stefan Rompf
2006-07-09 18:48 ` David Miller
2006-07-09 20:05 ` Krzysztof Halasa
2006-07-10 0:29 ` David Miller
2006-07-10 11:39 ` Krzysztof Halasa
2006-07-10 6:17 ` Stefan Rompf
2006-07-10 12:01 ` Krzysztof Halasa
2006-07-10 21:58 ` Stefan Rompf
2006-07-10 16:56 ` Stephen Hemminger
2006-07-10 17:02 ` Ben Greear [this message]
2006-07-10 22:01 ` Stefan Rompf
2006-07-11 21:28 ` [RFC] vlan handling of up/down Stephen Hemminger
2006-07-11 21:47 ` Ben Greear
2006-07-11 22:19 ` Stefan Rompf
2006-07-11 22:07 ` [VLAN]: translate IF_OPER_DORMANT to netif_dormant_on() Stefan Rompf
2006-07-11 22:15 ` Repost: " Stefan Rompf
2006-07-12 6:50 ` Patrick McHardy
2006-07-19 12:42 ` Patrick McHardy
2006-07-24 20:52 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44B2880C.9040801@candelatech.com \
--to=greearb@candelatech$(echo .)com \
--cc=kaber@trash$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
--cc=shemminger@osdl$(echo .)org \
--cc=stefan@loplof$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox