From: Mohammed Gamal <mgamal@redhat.com>
To: netdev@vger.kernel.org, sthemmin@microsoft.com
Cc: kys@microsoft.com, haiyangz@microsoft.com,
devel@linuxdriverproject.org, vkuznets@redhat.com,
linux-kernel@vger.kernel.org, Mohammed Gamal <mgamal@redhat.com>
Subject: [PATCH] hv_netvsc: Fix net device attach on older Windows hosts
Date: Tue, 8 May 2018 19:40:47 +0200 [thread overview]
Message-ID: <1525801247-27765-1-git-send-email-mgamal@redhat.com> (raw)
On older windows hosts the net_device instance is returned to
the caller of rndis_filter_device_add() without having the presence
bit set first. This would cause any subsequent calls to network device
operations (e.g. MTU change, channel change) to fail after the device
is detached once, returning -ENODEV.
Make sure we explicitly call netif_device_attach() before returning
the net_device instance to make sure the presence bit is set
Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic")
Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
---
drivers/net/hyperv/rndis_filter.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 6b127be..09a3c1d 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -1287,8 +1287,10 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
rndis_device->hw_mac_adr,
rndis_device->link_state ? "down" : "up");
- if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5)
+ if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5) {
+ netif_device_attach(net);
return net_device;
+ }
rndis_filter_query_link_speed(rndis_device, net_device);
--
1.8.3.1
next reply other threads:[~2018-05-08 17:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 17:40 Mohammed Gamal [this message]
2018-05-08 18:13 ` [PATCH] hv_netvsc: Fix net device attach on older Windows hosts Stephen Hemminger
2018-05-08 18:17 ` Mohammed Gamal
2018-05-08 22:49 ` Stephen Hemminger
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=1525801247-27765-1-git-send-email-mgamal@redhat.com \
--to=mgamal@redhat.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).