From: Stephen Hemminger <stephen@networkplumber.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org,
Stephen Hemminger <stephen@networkplumber.org>,
Stephen Hemminger <sthemmin@microsoft.com>
Subject: [PATCH net-stable 18/24] hv_netvsc: change GPAD teardown order on older versions
Date: Mon, 14 May 2018 15:32:17 -0700 [thread overview]
Message-ID: <20180514223223.25433-19-sthemmin@microsoft.com> (raw)
In-Reply-To: <20180514223223.25433-1-sthemmin@microsoft.com>
From: Stephen Hemminger <stephen@networkplumber.org>
commit 0ef58b0a05c127762f975c3dfe8b922e4aa87a29 upstream
On older versions of Windows, the host ignores messages after
vmbus channel is closed.
Workaround this by doing what Windows does and send the teardown
before close on older versions of NVSP protocol.
Reported-by: Mohammed Gamal <mgamal@redhat.com>
Fixes: 0cf737808ae7 ("hv_netvsc: netvsc_teardown_gpadl() split")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/hyperv/netvsc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 03328a60377e..3f3c6489ade2 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -570,10 +570,15 @@ void netvsc_device_remove(struct hv_device *device)
*/
netdev_dbg(ndev, "net device safe to remove\n");
+ /* older versions require that buffer be revoked before close */
+ if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_4)
+ netvsc_teardown_gpadl(device, net_device);
+
/* Now, we can close the channel safely */
vmbus_close(device->channel);
- netvsc_teardown_gpadl(device, net_device);
+ if (net_device->nvsp_version >= NVSP_PROTOCOL_VERSION_4)
+ netvsc_teardown_gpadl(device, net_device);
/* Release all resources */
free_netvsc_device_rcu(net_device);
--
2.17.0
next prev parent reply other threads:[~2018-05-14 22:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 22:31 [PATCH net-stable 00/24] hv_netvsc patches for 4.14 stable Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 01/24] hv_netvsc: Fix the real number of queues of non-vRSS cases Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 02/24] hv_netvsc: Rename ind_table to rx_table Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 03/24] hv_netvsc: Rename tx_send_table to tx_table Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 04/24] hv_netvsc: Add initialization of tx_table in netvsc_device_add() Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 05/24] hv_netvsc: Set tx_table to equal weight after subchannels open Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 06/24] hv_netvsc: netvsc_teardown_gpadl() split Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 07/24] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 08/24] hv_netvsc: empty current transmit aggregation if flow blocked Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 09/24] hv_netvsc: Use the num_online_cpus() for channel limit Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 10/24] hv_netvsc: avoid retry on send during shutdown Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 11/24] hv_netvsc: only wake transmit queue if link is up Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 12/24] hv_netvsc: fix error unwind handling if vmbus_open fails Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 13/24] hv_netvsc: cancel subchannel setup before halting device Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 14/24] hv_netvsc: fix race in napi poll when rescheduling Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 15/24] hv_netvsc: defer queue selection to VF Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 16/24] hv_netvsc: disable NAPI before channel close Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 17/24] hv_netvsc: use RCU to fix concurrent rx and queue changes Stephen Hemminger
2018-05-14 22:32 ` Stephen Hemminger [this message]
2018-05-14 22:32 ` [PATCH net-stable 19/24] hv_netvsc: common detach logic Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 20/24] hv_netvsc: Use Windows version instead of NVSP version on GPAD teardown Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 21/24] hv_netvsc: Split netvsc_revoke_buf() and netvsc_teardown_gpadl() Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 22/24] hv_netvsc: Ensure correct teardown message sequence order Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 23/24] hv_netvsc: Fix net device attach on older Windows hosts Stephen Hemminger
2018-05-14 22:32 ` [PATCH net-stable 24/24] hv_netvsc: set master device 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=20180514223223.25433-19-sthemmin@microsoft.com \
--to=stephen@networkplumber.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sthemmin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox