netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Rompf <stefan@loplof.de>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Patrick McHardy <kaber@trash.net>,
	Ben Greear <greearb@candelatech.com>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [VLAN]: translate IF_OPER_DORMANT to netif_dormant_on()
Date: Tue, 11 Jul 2006 00:01:14 +0200	[thread overview]
Message-ID: <200607110001.14812.stefan@loplof.de> (raw)
In-Reply-To: <20060710095603.0b197eec@dxpl.pdx.osdl.net>

Am Montag, 10. Juli 2006 18:56 schrieb Stephen Hemminger:

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

I just realized why 2.6.16 explicitely transfers LINK_STATE_PRESENT. This flag 
is positive true, and the code just assumes that it is always set in 
real_dev:

 new_dev->state = real_dev->state & VLAN_LINK_STATE_INITIAL_MASK;

So I think the fix for 2.6.17-stable should be:

-       new_dev->state = real_dev->state & ~(1<<__LINK_STATE_START);
+       new_dev->state = real_dev->state & (1<<__LINK_STATE_NOCARRIER) | 
(1<<__LINK_STATE_DORMANT)) | (1<<__LINK_STATE_PRESENT); , dropping 
VLAN_LINK_STATE_INITIAL_MASK.

I can produce and test such a patch tomorrow evening, if someone needs it 
faster, feel free to go ahead ;-)

For the rest of your comment and 

> 3. All checks for IFF_UP should be using netif_running instead.
> IFF_UP is a leftover BSDism.

ACK. However,

> 2. The vlan device should not be marked as up when it
> is registered.

this is a userspace visible API change I don't like, but you are right it 
should use dev_open(). 

I would take responsibility to implement this on one of the next two weekends. 
Should be 2.6.19 stuff IMHO.

Stefan

  parent reply	other threads:[~2006-07-10 21:59 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
2006-07-10 22:01                     ` Stefan Rompf [this message]
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=200607110001.14812.stefan@loplof.de \
    --to=stefan@loplof.de \
    --cc=greearb@candelatech.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).