All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Herbert Xu" <herbert@gondor.hengli.com.au>,
	"Patrick McHardy" <kaber@trash.net>,
	"David S. Miller" <davem@davemloft.net>,
	MichałMirosław <mirq-linux@rere.qmqm.pl>,
	"Tom Herbert" <therbert@google.com>,
	"Jesse Gross" <jesse@nicira.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"yrl pp-manager tt" <yrl.pp-manager.tt@hitachi.com>,
	"HAYASAKA Mitsuo" <mitsuo.hayasaka.hu@hitachi.com>
Subject: Re: [PATCH net-next ] Fix time-lag of IFF_RUNNING flag consistency between vlan and real devices
Date: Sun, 28 Aug 2011 23:06:28 -0700 (PDT)	[thread overview]
Message-ID: <f6ded72b-346d-43af-af47-4edae5060406@tahiti.vyatta.com> (raw)
In-Reply-To: <1314540589.3036.12.camel@edumazet-laptop>



----- Original Message -----
> Le dimanche 28 août 2011 à 22:20 +0900, HAYASAKA Mitsuo a écrit :
> > Hi Stephen and Herbert
> > 
> > Thank you for your comments.
> > 
> > (2011/08/26 15:08), Stephen Hemminger wrote:
> > > I don't think this is the right way to solve the problem.
> > >
> > > The flags are supposed to propagate back from real device to vlan
> > > via network notifications.
> > >
> > > Just doing this for ioctl is not enough, API's other than user
> > > space depend on this.
> > > Also the user may have manually set different flags on vlan than
> > > on
> > > the real device.
> > 
> > I agreed.
> > I will try another way to solve this problem, as you said.
> > 
> > 
> > (2011/08/26 15:45), Herbert Xu wrote:
> > > On Thu, Aug 25, 2011 at 11:08:59PM -0700, Stephen Hemminger
> > > wrote:
> > >> Just doing this for ioctl is not enough, API's other than user
> > >> space depend on this.
> > >> Also the user may have manually set different flags on vlan than
> > >> on
> > >> the real device.
> > > Right, anything that tests netif_carrier_ok directly on the VLAN
> > > device will still be delayed.
> > >
> > > Now I remember discussing this issue in Japan.  However, I can't
> > > recall the exact scenario in which the delay occured.
> > >
> > > Is the issue with the link status going down on the real device,
> > > or the real device coming up?
> > >
> > > IIRC we already have mechanisms in place to ensure that down
> > > events
> > > are not delayed by linkwatch.  Of course it is possible that this
> > > isn't working for some reason, or some other part of the system
> > > is
> > > causing the delay.
> > >
> > > So please clarify the scenario for us Hayasaka-san.  Also please
> > > let us know how you measured the delay.
> > >
> > > Thanks,
> > 
> > This issue happens when the link status is going down on the real
> > device.
> > 
> > ex) A cable is broken, or is unplugged from a NIC.
> > 
> > I measured the delay using ioctl with SIOCGIFFLAGS from userspace
> > in order to check if there is a time-lag of the flag between vlan
> > and real devices.
> > 
> > Also, you can check it using a script below.
> > 
> > -------------------------
> > #!/bin/sh
> > t=0
> > while :
> > do
> > 	echo $t; t=$((t+1))
> > 	echo -n real; ifconfig RealDev | grep UP
> > 	echo -n vlan; ifconfig VlanDev | grep UP
> > 	sleep 0.2
> > done
> > -------------------------
> > 
> > The result is shown as follows.
> > It is observed that there is a time-lag of RUNNING status between
> > real and vlan devices.
> > 
> > 
> 
> Hi !
> 
> This reminds me some work done in linkwatch
> 
> Please take a look at commit e014debecd3ee3832e647 (linkwatch:
> linkwatch_forget_dev() to speedup device dismantle)
> 
> And more generally, code in net/core/link_watch.c

Maybe the problem is specific to a ethernet driver. Some devices poll
for link changes, and also do a manual check when ioctl was done.
This was mostly typical of older hardware that did not have a PHY
interrupt.

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Herbert Xu" <herbert@gondor.apana.org.au>,
	"Patrick McHardy" <kaber@trash.net>,
	"David S. Miller" <davem@davemloft.net>,
	MichałMirosław <mirq-linux@rere.qmqm.pl>,
	"Tom Herbert" <therbert@google.com>,
	"Jesse Gross" <jesse@nicira.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"yrl pp-manager tt" <yrl.pp-manager.tt@hitachi.com>,
	"HAYASAKA Mitsuo" <mitsuo.hayasaka.hu@hitachi.com>
Subject: Re: [PATCH net-next ] Fix time-lag of IFF_RUNNING flag consistency between vlan and real devices
Date: Sun, 28 Aug 2011 23:06:28 -0700 (PDT)	[thread overview]
Message-ID: <f6ded72b-346d-43af-af47-4edae5060406@tahiti.vyatta.com> (raw)
In-Reply-To: <1314540589.3036.12.camel@edumazet-laptop>



----- Original Message -----
> Le dimanche 28 août 2011 à 22:20 +0900, HAYASAKA Mitsuo a écrit :
> > Hi Stephen and Herbert
> > 
> > Thank you for your comments.
> > 
> > (2011/08/26 15:08), Stephen Hemminger wrote:
> > > I don't think this is the right way to solve the problem.
> > >
> > > The flags are supposed to propagate back from real device to vlan
> > > via network notifications.
> > >
> > > Just doing this for ioctl is not enough, API's other than user
> > > space depend on this.
> > > Also the user may have manually set different flags on vlan than
> > > on
> > > the real device.
> > 
> > I agreed.
> > I will try another way to solve this problem, as you said.
> > 
> > 
> > (2011/08/26 15:45), Herbert Xu wrote:
> > > On Thu, Aug 25, 2011 at 11:08:59PM -0700, Stephen Hemminger
> > > wrote:
> > >> Just doing this for ioctl is not enough, API's other than user
> > >> space depend on this.
> > >> Also the user may have manually set different flags on vlan than
> > >> on
> > >> the real device.
> > > Right, anything that tests netif_carrier_ok directly on the VLAN
> > > device will still be delayed.
> > >
> > > Now I remember discussing this issue in Japan.  However, I can't
> > > recall the exact scenario in which the delay occured.
> > >
> > > Is the issue with the link status going down on the real device,
> > > or the real device coming up?
> > >
> > > IIRC we already have mechanisms in place to ensure that down
> > > events
> > > are not delayed by linkwatch.  Of course it is possible that this
> > > isn't working for some reason, or some other part of the system
> > > is
> > > causing the delay.
> > >
> > > So please clarify the scenario for us Hayasaka-san.  Also please
> > > let us know how you measured the delay.
> > >
> > > Thanks,
> > 
> > This issue happens when the link status is going down on the real
> > device.
> > 
> > ex) A cable is broken, or is unplugged from a NIC.
> > 
> > I measured the delay using ioctl with SIOCGIFFLAGS from userspace
> > in order to check if there is a time-lag of the flag between vlan
> > and real devices.
> > 
> > Also, you can check it using a script below.
> > 
> > -------------------------
> > #!/bin/sh
> > t=0
> > while :
> > do
> > 	echo $t; t=$((t+1))
> > 	echo -n real; ifconfig RealDev | grep UP
> > 	echo -n vlan; ifconfig VlanDev | grep UP
> > 	sleep 0.2
> > done
> > -------------------------
> > 
> > The result is shown as follows.
> > It is observed that there is a time-lag of RUNNING status between
> > real and vlan devices.
> > 
> > 
> 
> Hi !
> 
> This reminds me some work done in linkwatch
> 
> Please take a look at commit e014debecd3ee3832e647 (linkwatch:
> linkwatch_forget_dev() to speedup device dismantle)
> 
> And more generally, code in net/core/link_watch.c

Maybe the problem is specific to a ethernet driver. Some devices poll
for link changes, and also do a manual check when ioctl was done.
This was mostly typical of older hardware that did not have a PHY
interrupt.

  reply	other threads:[~2011-08-29  6:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  6:02 [PATCH net-next ] Fix time-lag of IFF_RUNNING flag consistency between vlan and real devices Mitsuo Hayasaka
2011-08-26  6:02 ` Mitsuo Hayasaka
2011-08-26  6:08 ` Stephen Hemminger
2011-08-26  6:08   ` Stephen Hemminger
2011-08-26  6:45   ` Herbert Xu
2011-08-26  6:45     ` Herbert Xu
2011-08-28 13:20     ` HAYASAKA Mitsuo
2011-08-28 13:20       ` HAYASAKA Mitsuo
2011-08-28 14:09       ` Eric Dumazet
2011-08-28 14:09         ` Eric Dumazet
2011-08-29  6:06         ` Stephen Hemminger [this message]
2011-08-29  6:06           ` Stephen Hemminger
2011-08-29  6:23           ` Eric Dumazet
2011-08-29  6:23             ` Eric Dumazet
2011-08-29  6:34           ` David Miller
2011-08-31  9:31         ` [PATCH net-next] net: linkwatch: allow vlans to get carrier changes faster Eric Dumazet
2011-08-31  9:31           ` Eric Dumazet
2011-09-01 11:53           ` HAYASAKA Mitsuo
2011-09-01 11:53             ` HAYASAKA Mitsuo
2011-09-15 19:44           ` 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=f6ded72b-346d-43af-af47-4edae5060406@tahiti.vyatta.com \
    --to=stephen.hemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=herbert@gondor.hengli.com.au \
    --cc=jesse@nicira.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=mitsuo.hayasaka.hu@hitachi.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    --cc=yrl.pp-manager.tt@hitachi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.