From: Dan Carpenter <dan.carpenter@oracle.com>
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, olaf@aepfle.de,
jasowang@redhat.com, driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event
Date: Fri, 20 Jun 2014 11:41:58 +0300 [thread overview]
Message-ID: <20140620084158.GR5500@mwanda> (raw)
In-Reply-To: <1403228076-7596-1-git-send-email-haiyangz@microsoft.com>
On Thu, Jun 19, 2014 at 06:34:36PM -0700, Haiyang Zhang wrote:
> @@ -589,7 +590,19 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
> net_device = hv_get_drvdata(device_obj);
> rdev = net_device->extension;
>
> - rdev->link_state = status != 1;
> + switch (indicate->status) {
> + case RNDIS_STATUS_MEDIA_CONNECT:
> + rdev->link_state = false;
link_state false means that we want to connect?
> + break;
> + case RNDIS_STATUS_MEDIA_DISCONNECT:
> + rdev->link_state = true;
link_state true means that we are disconnecting.
> + break;
> + case RNDIS_STATUS_NETWORK_CHANGE:
> + rdev->link_change = true;
> + break;
> + default:
> + return;
> + }
>
> net = net_device->ndev;
>
> @@ -597,7 +610,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
> @@ -782,10 +797,17 @@ static void netvsc_link_change(struct work_struct *w)
> } else {
> netif_carrier_on(net);
> notify = true;
> + if (rdev->link_change) {
> + rdev->link_change = false;
> + refresh = true;
> + }
How do we know that we received a RNDIS_STATUS_MEDIA_CONNECT before we
received the RNDIS_STATUS_NETWORK_CHANGE? In other words, why does
RNDIS_STATUS_NETWORK_CHANGE imply that the link_state is false?
> }
>
> rtnl_unlock();
>
> + if (refresh)
> + call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
You may as well use UMH_NO_WAIT since there is no error handling if
/etc/init.d/network is not found.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: olaf@aepfle.de, netdev@vger.kernel.org, jasowang@redhat.com,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH net-next] hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event
Date: Fri, 20 Jun 2014 11:41:58 +0300 [thread overview]
Message-ID: <20140620084158.GR5500@mwanda> (raw)
In-Reply-To: <1403228076-7596-1-git-send-email-haiyangz@microsoft.com>
On Thu, Jun 19, 2014 at 06:34:36PM -0700, Haiyang Zhang wrote:
> @@ -589,7 +590,19 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
> net_device = hv_get_drvdata(device_obj);
> rdev = net_device->extension;
>
> - rdev->link_state = status != 1;
> + switch (indicate->status) {
> + case RNDIS_STATUS_MEDIA_CONNECT:
> + rdev->link_state = false;
link_state false means that we want to connect?
> + break;
> + case RNDIS_STATUS_MEDIA_DISCONNECT:
> + rdev->link_state = true;
link_state true means that we are disconnecting.
> + break;
> + case RNDIS_STATUS_NETWORK_CHANGE:
> + rdev->link_change = true;
> + break;
> + default:
> + return;
> + }
>
> net = net_device->ndev;
>
> @@ -597,7 +610,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
> @@ -782,10 +797,17 @@ static void netvsc_link_change(struct work_struct *w)
> } else {
> netif_carrier_on(net);
> notify = true;
> + if (rdev->link_change) {
> + rdev->link_change = false;
> + refresh = true;
> + }
How do we know that we received a RNDIS_STATUS_MEDIA_CONNECT before we
received the RNDIS_STATUS_NETWORK_CHANGE? In other words, why does
RNDIS_STATUS_NETWORK_CHANGE imply that the link_state is false?
> }
>
> rtnl_unlock();
>
> + if (refresh)
> + call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
You may as well use UMH_NO_WAIT since there is no error handling if
/etc/init.d/network is not found.
regards,
dan carpenter
next prev parent reply other threads:[~2014-06-20 8:42 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 1:34 [PATCH net-next] hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event Haiyang Zhang
2014-06-20 1:34 ` Haiyang Zhang
2014-06-20 4:21 ` David Miller
2014-06-20 4:21 ` David Miller
2014-06-20 4:57 ` Olaf Hering
2014-06-20 5:12 ` Greg KH
2014-06-20 5:12 ` Greg KH
2014-06-20 16:09 ` Haiyang Zhang
2014-06-23 8:02 ` Olaf Hering
2014-06-23 12:47 ` Haiyang Zhang
2014-06-23 12:47 ` Haiyang Zhang
2014-06-23 13:17 ` Olaf Hering
2014-06-23 13:17 ` Olaf Hering
2014-06-23 16:09 ` Haiyang Zhang
2014-06-23 16:09 ` Haiyang Zhang
2014-06-23 16:27 ` Olaf Hering
2014-06-23 18:21 ` Haiyang Zhang
2014-06-23 18:21 ` Haiyang Zhang
2014-06-26 8:45 ` Olaf Hering
2014-06-26 8:45 ` Olaf Hering
2014-06-26 14:55 ` Haiyang Zhang
2014-06-26 14:55 ` Haiyang Zhang
2014-06-23 16:29 ` Greg KH
2014-06-23 18:23 ` Haiyang Zhang
2014-06-23 20:11 ` David Miller
2014-06-23 20:11 ` David Miller
2014-06-23 20:10 ` David Miller
2014-06-23 20:10 ` David Miller
2014-06-23 20:17 ` Haiyang Zhang
2015-10-27 22:36 ` Richard Weinberger
2015-10-27 22:36 ` Richard Weinberger
2015-10-28 17:59 ` Haiyang Zhang
2015-10-28 17:59 ` Haiyang Zhang
2015-10-29 19:09 ` Haiyang Zhang
2015-10-29 19:09 ` Haiyang Zhang
2015-10-30 10:56 ` Vitaly Kuznetsov
2015-10-30 22:03 ` Haiyang Zhang
2015-10-30 22:10 ` Richard Weinberger
2014-06-23 20:06 ` David Miller
2014-06-23 20:06 ` David Miller
2014-06-20 8:41 ` Dan Carpenter [this message]
2014-06-20 8:41 ` Dan Carpenter
2014-06-20 15:48 ` Haiyang Zhang
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=20140620084158.GR5500@mwanda \
--to=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
/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.