From: Florian Fainelli <f.fainelli@gmail.com>
To: Dexuan Cui <decui@microsoft.com>, Greg KH <gregkh@linuxfoundation.org>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>,
Richard Weinberger <richard.weinberger@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"jasowang@redhat.com" <jasowang@redhat.com>,
"driverdev-devel@linuxdriverproject.org"
<driverdev-devel@linuxdriverproject.org>,
Haiyang Zhang <haiyangz@microsoft.com>,
LKML <linux-kernel@vger.kernel.org>,
Thomas Shao <huishao@microsoft.com>,
"Yue Zhang (OSTC DEV)" <yuezha@microsoft.com>,
David Miller <davem@davemloft.net>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
Date: Sun, 10 Aug 2014 20:51:48 -0700 [thread overview]
Message-ID: <53E83DD4.1060500@gmail.com> (raw)
In-Reply-To: <EE124450C0AAF944A40DD71E61F878C991B653@SINEX14MBXC417.southpacific.corp.microsoft.com>
Le 10/08/2014 20:23, Dexuan Cui a écrit :
>> -----Original Message-----
>> From: Greg KH [mailto:gregkh@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 that, again, act like any other network device, drop the
>>>> link and bring it up when it comes back.
>>>>
>>> Hi Greg,
>>> Do you mean tearing down the net device and re-creating it (by
>>> register_netdev() and unregister_netdev)?
>>
>> No, don't you have link-detect for your network device? Toggle that, I
>> thought patches to do this were posted a while ago...
>>
>> But if you really want to tear the whole network device down and then
>> back up again, sure, that would also work.
> Hi Greg, Stephen,
>
> Thanks for the comments!
>
> I suppose you meant the below logic:
> if (refresh) {
> rtnl_lock();
> netif_carrier_off(net);
> netif_carrier_on(net);
> rtnl_unlock();
> }
>
> We have discussed this in the previous mails of this thread itself:
> e.g., http://marc.info/?l=linux-driver-devel&m=140593811715975&w=2
>
> 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 renew operations.
> (I guess this behavior can be somewhat reasonable: maybe the daemons
> try to not trigger DHCP renew on temporary link instability)
Is that such a big deal? If you know you spend much of your time in
ifplugd, why not use something different that triggers a DHCP renewal
faster, or fix ifplugd?
>
> If we use this logic in the kernel space, we'll have to "fix" the user-space
> daemons, like ifplugd, systemd-networkd...,etc.
You mean the opposite here don't you? If you put that logic in kernel
space you don't have to fix the userland.
>
> I'm not sure our attempt to "fix" the daemons can be easily accepted.
> BTW, by CPUID, an application has a reliable way to determine if it's
> running on hyper-v on not. Maybe we can "fix" the behavior of the
> daemons when they run on hyper-v?
That is not acceptable as well, why would an user-space application
would have to care that much whether it runs on hyper-v or a physical
host? Not to mention that anytime someone develops a similar but new
application they would have to become aware of such platform and its
"specicities".
> BTW2, according to my limited experience, I doubt other VMMs can
> handle this auto-DHCP-renew-in-guest issue properly.
>
> That was why Yue's patch wanted to add a SLEEP(10s) between the
> link-down and link-up events and hoped this could be an acceptable
> fix(while it turned out not, obviously), though we admit it's not so good
> to add such a magic number "10s" in a kernel driver.
>
> Please point it out if I missed or misunderstand something.
I think this is just an integration issue that you are having, and I
would not be focusing on any particular user-space implementation, but
rather put something in the driver that is sensible, just like what was
suggested before: toggling the carrier state.
>
> 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 correct direction to fix the user-space
> daemons (ifplugd, systemd-networkd, etc).
> If you think this is viable and we should do this, I'll submit a
> netif_carrier_off/on patch first and will start to work with the
> projects of ifplugd, systemd-networkd and many OSVs to make the
> while thing work eventually.
>
> Thanks,
> -- Dexuan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Florian
next prev parent reply other threads:[~2014-08-11 3:58 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 10:55 [PATCH] Hyperv: Trigger DHCP renew after host hibernation Yue Zhang
2014-07-18 10:55 ` Yue Zhang
2014-07-18 10:13 ` Varka Bhadram
2014-07-18 10:13 ` Varka Bhadram
2014-07-21 2:45 ` Yue Zhang (OSTC DEV)
2014-07-21 2:45 ` Yue Zhang (OSTC DEV)
2014-07-18 13:40 ` Richard Weinberger
2014-07-18 13:40 ` Richard Weinberger
2014-07-21 2:44 ` Yue Zhang (OSTC DEV)
2014-07-21 2:44 ` Yue Zhang (OSTC DEV)
2014-07-21 6:55 ` Richard Weinberger
2014-07-21 6:55 ` Richard Weinberger
2014-07-21 8:05 ` Yue Zhang (OSTC DEV)
2014-07-21 8:05 ` Yue Zhang (OSTC DEV)
2014-07-21 8:17 ` Richard Weinberger
2014-07-21 8:17 ` Richard Weinberger
2014-07-21 8:44 ` Yue Zhang (OSTC DEV)
2014-07-21 8:44 ` Yue Zhang (OSTC DEV)
2014-07-21 9:01 ` Richard Weinberger
2014-07-21 9:18 ` Olaf Hering
2014-07-21 21:32 ` David Miller
2014-07-21 21:32 ` David Miller
2014-08-07 22:37 ` Richard Weinberger
2014-08-07 22:37 ` Richard Weinberger
2014-08-08 3:13 ` Dexuan Cui
2014-08-08 3:13 ` Dexuan Cui
2014-08-08 3:32 ` Greg KH
2014-08-08 3:32 ` Greg KH
2014-08-08 8:11 ` Dexuan Cui
2014-08-08 8:11 ` Dexuan Cui
2014-08-08 13:45 ` Greg KH
2014-08-08 13:45 ` Greg KH
2014-08-08 16:28 ` Stephen Hemminger
2014-08-11 3:23 ` Dexuan Cui
2014-08-11 3:51 ` Florian Fainelli [this message]
2014-08-11 4:22 ` Bill Fink
2014-08-11 4:22 ` Bill Fink
2014-08-12 7:51 ` Dexuan Cui
2014-08-12 7:51 ` Dexuan Cui
2014-08-12 7:48 ` Dexuan Cui
2014-08-12 7:48 ` Dexuan Cui
2014-08-11 10:45 ` Tom Gundersen
2014-08-11 10:45 ` Tom Gundersen
2014-08-12 8:29 ` Dexuan Cui
2014-08-12 8:29 ` Dexuan Cui
2014-08-13 13:15 ` Tom Gundersen
2014-08-13 13:15 ` Tom Gundersen
2014-08-13 13:34 ` Dan Williams
2014-08-13 13:34 ` Dan Williams
2014-08-14 5:19 ` Dexuan Cui
2014-08-14 5:19 ` Dexuan Cui
2014-08-11 3:29 ` Dexuan Cui
2014-08-11 3:29 ` Dexuan Cui
2014-07-21 9:42 ` Tom Gundersen
2014-07-21 10:21 ` Yue Zhang (OSTC DEV)
2014-07-21 10:21 ` Yue Zhang (OSTC DEV)
2014-07-21 13:11 ` Lennart Poettering
2014-07-21 13:11 ` Lennart Poettering
2014-07-21 17:17 ` Dan Williams
2014-07-21 17:17 ` Dan Williams
2014-07-21 14:06 ` Tom Gundersen
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=53E83DD4.1060500@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=huishao@microsoft.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=richard.weinberger@gmail.com \
--cc=stephen@networkplumber.org \
--cc=yuezha@microsoft.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.