RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-13 Thread Dexuan Cui
> -Original Message- > From: Dan Williams > > > e.g., on a bare metal host with Ubuntu 14.04, when I plug the RJ45 cable > > > out of the network card and then plug the cable back into the network card > > > quickly -- in ~3 seconds, networkd doesn't trigger DHCP renew request: in > > > /va

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-13 Thread Dan Williams
On Wed, 2014-08-13 at 15:15 +0200, Tom Gundersen wrote: > On Tue, Aug 12, 2014 at 10:29 AM, Dexuan Cui wrote: > >> From: Tom Gundersen > >> > Unluckily this logic doesn't work because the user-space daemons > >> > like ifplugd, usually don't renew the DHCP immediately as long as they > >> > receiv

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-13 Thread Tom Gundersen
On Tue, Aug 12, 2014 at 10:29 AM, Dexuan Cui wrote: >> From: Tom Gundersen >> > Unluckily this logic doesn't work because the user-space daemons >> > like ifplugd, usually don't renew the DHCP immediately as long as they >> > receive a link-down message: they usually wait for some seconds and if >

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-12 Thread Dexuan Cui
> From: Tom Gundersen > > Unluckily this logic doesn't work because the user-space daemons > > like ifplugd, usually don't renew the DHCP immediately as long as they > > receive a link-down message: they usually wait for some seconds and if > > they find the link becomes up soon, they won't trigger

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-12 Thread Dexuan Cui
> -Original Message- > From: Bill Fink > In the case of ifplugd, it has parameters -u | --delay-up= which > defaults to 0 seconds, and -d | --delay-down= which defaults to > 5 seconds. Maybe for hyperv you could specify --delay-down=0. > I don't know if other daemons such as systemd have

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-12 Thread Dexuan Cui
> -Original Message- > From: Florian Fainelli [mailto:f.faine...@gmail.com] > Sent: Monday, August 11, 2014 11:52 AM > > I suppose you meant the below logic: > > if (refresh) { > > rtnl_lock(); > > netif_carrier_off(net); > > netif_carrier_on(net); > > rt

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-11 Thread Tom Gundersen
On Mon, Aug 11, 2014 at 5:23 AM, Dexuan Cui wrote: >> -Original Message- >> From: Greg KH [mailto:gre...@linuxfoundation.org] >> > > > >> > > > IMO the most feasible and need-the-least-change solution may be: >> > > > the hyperv network VSC driver passes the event >> > > > RNDIS_STATUS_NET

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-10 Thread Bill Fink
On Sun, 10 Aug 2014, Florian Fainelli wrote: > Le 10/08/2014 20:23, Dexuan Cui a écrit : > >> -Original Message- > >> From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > IMO the most feasible and need-the-least-change solution may be: > > the hyperv network VSC driver pas

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-10 Thread Florian Fainelli
Le 10/08/2014 20:23, Dexuan Cui a écrit : -Original Message- From: Greg KH [mailto:gre...@linuxfoundation.org] IMO the most feasible and need-the-least-change solution may be: the hyperv network VSC driver passes the event RNDIS_STATUS_NETWORK_CHANGE to the udev daemon? No, don't do t

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-10 Thread Dexuan Cui
> -Original Message- > From: Dexuan Cui > Sent: Monday, August 11, 2014 11:24 AM > Now I understand it's not good to pass the event to the udev daemon, > and it's not good to use a SLEEP(10s) in the kernel space(even if it's in a > "work" task here). > > Please let me know if it's the corr

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-10 Thread Dexuan Cui
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > > > > > IMO the most feasible and need-the-least-change solution may be: > > > > the hyperv network VSC driver passes the event > > > > RNDIS_STATUS_NETWORK_CHANGE to the udev daemon? > > > > > > > No, don't do

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-08 Thread Greg KH
On Fri, Aug 08, 2014 at 08:11:20AM +, Dexuan Cui wrote: > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > Sent: Friday, August 8, 2014 11:32 AM > > > Hi Richard and all, > > > > > > IMO the most feasible and need-the-least-change solution may be: > > > the hyperv network VSC driver pass

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-08 Thread Dexuan Cui
> From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Friday, August 8, 2014 11:32 AM > > Hi Richard and all, > > > > IMO the most feasible and need-the-least-change solution may be: > > the hyperv network VSC driver passes the event > > RNDIS_STATUS_NETWORK_CHANGE to the udev daemon? > > > >

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-07 Thread Greg KH
fle.de; net...@vger.kernel.org; driverdev- > > de...@linuxdriverproject.org; LKML; Greg KH; jasow...@redhat.com; > > Haiyang Zhang; KY Srinivasan; Thomas Shao; Dexuan Cui > > Subject: Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation > > > > On Mon, Jul 21, 2014 a

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-07 Thread Dexuan Cui
asow...@redhat.com; > Haiyang Zhang; KY Srinivasan; Thomas Shao; Dexuan Cui > Subject: Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation > > On Mon, Jul 21, 2014 at 11:32 PM, David Miller > wrote: > > From: Olaf Hering > > Date: Mon, 21 Jul 2014 11:18:51 +020

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-08-07 Thread Richard Weinberger
On Mon, Jul 21, 2014 at 11:32 PM, David Miller wrote: > From: Olaf Hering > Date: Mon, 21 Jul 2014 11:18:51 +0200 > >> On Mon, Jul 21, Richard Weinberger wrote: >> >>> My concern is that 10 seconds is maybe not a the right choice. >>> (As we cannot know all implementations) >> >> Until someone re

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread David Miller
From: Olaf Hering Date: Mon, 21 Jul 2014 11:18:51 +0200 > On Mon, Jul 21, Richard Weinberger wrote: > >> My concern is that 10 seconds is maybe not a the right choice. >> (As we cannot know all implementations) > > Until someone reports an issue with it, 10 is fine. Just like 20 or 666. Wrong,

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Dan Williams
On Mon, 2014-07-21 at 15:11 +0200, Lennart Poettering wrote: > On Mon, 21.07.14 10:21, Yue Zhang (OSTC DEV) (yue...@microsoft.com) wrote: > > > Some network monitoring daemon, like ifplugd has a deferring mechanism. > > When it detects carriers is offline, it doesn't trigger DHCP renew > > immedi

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Tom Gundersen
On Mon, Jul 21, 2014 at 12:21 PM, Yue Zhang (OSTC DEV) wrote: >> From: Tom Gundersen [mailto:t...@jklm.no] >> Sent: Monday, July 21, 2014 5:42 PM >> >> On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang wrote: >> > From: Yue Zhang >> > >> > This patch addresses the comment from Olaf Hering and Greg KH

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Lennart Poettering
On Mon, 21.07.14 10:21, Yue Zhang (OSTC DEV) (yue...@microsoft.com) wrote: > Some network monitoring daemon, like ifplugd has a deferring mechanism. > When it detects carriers is offline, it doesn't trigger DHCP renew > immediately. > Instead it will wait for another 5 seconds to check whether c

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Yue Zhang (OSTC DEV)
> From: Tom Gundersen [mailto:t...@jklm.no] > Sent: Monday, July 21, 2014 5:42 PM > > On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang wrote: > > From: Yue Zhang > > > > This patch addresses the comment from Olaf Hering and Greg KH > > for a previous commit 3a494e710367 ("hyperv: Add handler for > >

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Tom Gundersen
On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang wrote: > From: Yue Zhang > > This patch addresses the comment from Olaf Hering and Greg KH > for a previous commit 3a494e710367 ("hyperv: Add handler for > RNDIS_STATUS_NETWORK_CHANGE event") > > In previous solution, the driver calls "network restart"

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Olaf Hering
On Mon, Jul 21, Richard Weinberger wrote: > My concern is that 10 seconds is maybe not a the right choice. > (As we cannot know all implementations) Until someone reports an issue with it, 10 is fine. Just like 20 or 666. Olaf -- To unsubscribe from this list: send the line "unsubscribe linux-ke

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Richard Weinberger
Yue, Am 21.07.2014 10:44, schrieb Yue Zhang (OSTC DEV): > Hi, Richard > > IMHO, all networking implementations should handle the cable offline event. > Consider > this situation. I unplugged the network cable and connect it to a new network > switch > after 10 seconds. If the DHCP renew is not

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Yue Zhang (OSTC DEV)
> From: Richard Weinberger [mailto:rich...@nod.at] > Sent: Monday, July 21, 2014 4:18 PM > > Yue, > > Am 21.07.2014 10:05, schrieb Yue Zhang (OSTC DEV): > > The problem of systemd implementation is that in different distros, the > > ways > > to restart service are different. Propagating the eve

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Richard Weinberger
Yue, Am 21.07.2014 10:05, schrieb Yue Zhang (OSTC DEV): > The problem of systemd implementation is that in different distros, the ways > to > restart service are different. Propagating the event to userspace also > doesn't help > for this issue. This way each distro can provide their own rest

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-21 Thread Yue Zhang (OSTC DEV)
> From: Richard Weinberger [mailto:rich...@nod.at] > Sent: Monday, July 21, 2014 2:55 PM > > Yue, > > Am 21.07.2014 04:44, schrieb Yue Zhang (OSTC DEV): > >> From: Richard Weinberger [mailto:richard.weinber...@gmail.com] > >> Why 10? Is this a random number which works by accident for ifplugd? >

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-20 Thread Richard Weinberger
Yie, Am 21.07.2014 04:44, schrieb Yue Zhang (OSTC DEV): >> From: Richard Weinberger [mailto:richard.weinber...@gmail.com] >> Why 10? Is this a random number which works by accident for ifplugd? >> What about other networking implementations, is 10 also ok for them? >> -- >> Thanks, >> //richard >

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-20 Thread Yue Zhang (OSTC DEV)
> From: Varka Bhadram [mailto:varkabhad...@gmail.com] > Sent: Friday, July 18, 2014 6:13 PM > > On 07/18/2014 04:25 PM, Yue Zhang wrote: > > @@ -816,8 +816,21 @@ static void netvsc_link_change(struct work_struct > *w) > > > > rtnl_unlock(); > > > > - if (refresh) > > - call_usermod

RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-20 Thread Yue Zhang (OSTC DEV)
> From: Richard Weinberger [mailto:richard.weinber...@gmail.com] > Sent: Friday, July 18, 2014 9:41 PM > > On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang wrote: > > From: Yue Zhang > > > > This patch addresses the comment from Olaf Hering and Greg KH > > for a previous commit 3a494e710367 ("hyperv:

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-18 Thread Richard Weinberger
On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang wrote: > From: Yue Zhang > > This patch addresses the comment from Olaf Hering and Greg KH > for a previous commit 3a494e710367 ("hyperv: Add handler for > RNDIS_STATUS_NETWORK_CHANGE event") > > In previous solution, the driver calls "network restart"

Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-18 Thread Varka Bhadram
On 07/18/2014 04:25 PM, Yue Zhang wrote: @@ -816,8 +816,21 @@ static void netvsc_link_change(struct work_struct *w) rtnl_unlock(); - if (refresh) - call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC); + if (refresh) { + /* +* Keep th

[PATCH] Hyperv: Trigger DHCP renew after host hibernation

2014-07-18 Thread Yue Zhang
From: Yue Zhang This patch addresses the comment from Olaf Hering and Greg KH for a previous commit 3a494e710367 ("hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event") In previous solution, the driver calls "network restart" to force a DHCP renew when the host is back from hibernation. I