All of lore.kernel.org
 help / color / mirror / Atom feed
* IPv6: autoconfiguration and suspend/resume or link down/up
@ 2011-07-19 18:02 Jiri Bohac
  2011-07-20 16:15 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Jiri Bohac @ 2011-07-19 18:02 UTC (permalink / raw)
  To: netdev; +Cc: Herbert Xu, David S. Miller, stephen hemminger

Hi,

I came over a surprising behaviour with IPv6 autoconfiguration,
which I think is a bug, but I would first like to hear other
people's opinions before trying to fix this:

Problem 1: all the address/route lifetimes are kept in jiffies
and jiffies don't get incremented on resume. So when a
route/address lifetime is 30 minutes and the system resumes after
1 hour, the route/address should be considered expired, but it is
not.

Problem 2: when a system is moved to a new network a RS is not
sent. Thus, IPv6 does not autoconfigure until the router sends a
periodic RA. This can occur both while the system is alive and
while it is suspended. I think the autoconfigured state should be
discarded when the kernel suspects the system could have been
moved to a different network.

When the cable is unplugged and plugged in again, we already get
notified through linkwatch -> netdev_state_change ->
  -> call_netdevice_notifiers(NETDEV_CHANGE, ...)
However, if the device has already been autoconfigured,
addrconf_notify() only handles this event by printing a
message.

So my idea was to:
- handle link up/down in addrconf_notify() similarly to
  NETDEV_UP/NETDEV_DOWN

- on suspend, faking a link down event; on resume, faking a link up event
  (or better, having a special event type for suspend/resume)

This would cause autoconfiguration to be restarted on resume as
well as cable plug/unplug, solving both the above problems.

Or do we want to completely rely on userspace tools
(networkmanager/ifplug) and expect them to do NETDEV_DOWN on
unplug/suspend and NETDEV_UP on plug/resume?

Any thoughts?

-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: IPv6: autoconfiguration and suspend/resume or link down/up
@ 2011-07-19 19:42 Stephen Hemminger
  2011-07-26  5:16 ` Anirban Chakraborty
  0 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2011-07-19 19:42 UTC (permalink / raw)
  To: Jiri Bohac, netdev; +Cc: Herbert Xu,  David S. Miller, stephen hemminger

bridge forwarding table; route cache; and neighbor table could have same problem. I thought carrier is supposed to toggle on suspend or hibernate

Jiri Bohac <jbohac@suse.cz> wrote:

>Hi,
>
>I came over a surprising behaviour with IPv6 autoconfiguration,
>which I think is a bug, but I would first like to hear other
>people's opinions before trying to fix this:
>
>Problem 1: all the address/route lifetimes are kept in jiffies
>and jiffies don't get incremented on resume. So when a
>route/address lifetime is 30 minutes and the system resumes after
>1 hour, the route/address should be considered expired, but it is
>not.
>
>Problem 2: when a system is moved to a new network a RS is not
>sent. Thus, IPv6 does not autoconfigure until the router sends a
>periodic RA. This can occur both while the system is alive and
>while it is suspended. I think the autoconfigured state should be
>discarded when the kernel suspects the system could have been
>moved to a different network.
>
>When the cable is unplugged and plugged in again, we already get
>notified through linkwatch -> netdev_state_change ->
>  -> call_netdevice_notifiers(NETDEV_CHANGE, ...)
>However, if the device has already been autoconfigured,
>addrconf_notify() only handles this event by printing a
>message.
>
>So my idea was to:
>- handle link up/down in addrconf_notify() similarly to
>  NETDEV_UP/NETDEV_DOWN
>
>- on suspend, faking a link down event; on resume, faking a link up event
>  (or better, having a special event type for suspend/resume)
>
>This would cause autoconfiguration to be restarted on resume as
>well as cable plug/unplug, solving both the above problems.
>
>Or do we want to completely rely on userspace tools
>(networkmanager/ifplug) and expect them to do NETDEV_DOWN on
>unplug/suspend and NETDEV_UP on plug/resume?
>
>Any thoughts?
>
>-- 
>Jiri Bohac <jbohac@suse.cz>
>SUSE Labs, SUSE CZ
>

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: IPv6: autoconfiguration and suspend/resume or link down/up
@ 2011-07-25 16:55 Stephen Hemminger
  0 siblings, 0 replies; 21+ messages in thread
From: Stephen Hemminger @ 2011-07-25 16:55 UTC (permalink / raw)
  To: Herbert Xu, Stephen Hemminger
  Cc: Nicolas de Pesloüan, David Miller, jbohac, netdev

who manages link wit sriov? I assume it is up to the guest. And it is not really safe to assume that network is the same after migration. It makes sense to do DAD again.

Herbert Xu <herbert@gondor.apana.org.au> wrote:

>On Sun, Jul 24, 2011 at 08:26:20PM -0700, Stephen Hemminger wrote:
>>
>> Since virtual machines should be using virtio network devices, shouldn't
>> the suspend/resume in that device just work. It doesn't need to drop the link.
>
>The VM may also be using SRIOV.
>
>Cheers,
>-- 
>Email: Herbert Xu <herbert@gondor.apana.org.au>
>Home Page: http://gondor.apana.org.au/~herbert/
>PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2011-07-27 19:44 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-19 18:02 IPv6: autoconfiguration and suspend/resume or link down/up Jiri Bohac
2011-07-20 16:15 ` Stephen Hemminger
2011-07-20 16:29   ` Jiri Bohac
2011-07-20 16:21 ` Dan Williams
2011-07-20 16:36   ` Jiri Bohac
2011-07-21  5:30     ` Dan Williams
2011-07-21 16:35       ` Dan Williams
2011-07-21 19:44         ` Stephen Hemminger
2011-07-22  8:06 ` David Miller
2011-07-22  9:21   ` Herbert Xu
2011-07-23 14:31     ` Nicolas de Pesloüan
2011-07-23 15:27       ` Herbert Xu
2011-07-23 16:37         ` Stephen Hemminger
2011-07-24  0:18           ` Herbert Xu
2011-07-24  8:35             ` Nicolas de Pesloüan
2011-07-25  3:26               ` Stephen Hemminger
2011-07-25  3:46                 ` Herbert Xu
2011-07-27 19:48   ` Dan Williams
2011-07-19 19:42 Stephen Hemminger
2011-07-26  5:16 ` Anirban Chakraborty
2011-07-25 16:55 Stephen Hemminger

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.