Received: by 10.223.176.46 with SMTP id f43csp4379213wra; Tue, 23 Jan 2018 08:34:53 -0800 (PST) X-Google-Smtp-Source: AH8x224eFRKgOhnbGzHoAd6l8SNaMC+KAYFZUdoh7B/ssxyq4QJ1MPs/4i62bZfmxZ8+QUZcF0DV X-Received: by 10.36.10.81 with SMTP id 78mr4632246itw.117.1516725293110; Tue, 23 Jan 2018 08:34:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516725293; cv=none; d=google.com; s=arc-20160816; b=gTtJdEYpGzzuinEAqlpH12PythPNmrdetaP4OpBGgVH+XZL+ppne8BsSblv+ojZGPn Zl/B6Q5eNDpbwuHs4t6sryOkKspYj7WUahUKsY5Ex23mc8CD7FjfeBQi1nIEGjKHXnmS lA52yvkneggNFVP7XQK+VI0XfxDmBLXZJd0Vef6ErANNzqKr8LRroskt3vZSVlRkAasa PCqQ7FNEdqyACWkIfgDw4p4H65T4KzH8sgvydWez+yeh4eB6e8hLZONo2PZIt9fogQ8i 255HUn93mF7z/P0cKkCj0/+TbDwGvH5dF0ygnwD35x4XzEWDq4UeXLq0BVeEiUupKZ04 2XuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=AgOwSRC0FhZe/W5+vt0YpvRiFhw5NUxWczlVZBZk7Vo=; b=TvFIccZgWWpXOyBNkPhqP1C0akIXHbWR2JSVuwXjn3wa9UWWKa7G0M3Gu7mHMeA/0Y 1THtmI5c0ppxUStU+ybQB5VHNa+H1l22687rbAMJVV+ruWEzRjK6duzTMitr/9SkcOrX dykBtCQtIGG06S/W3hTNc1N18bfIDxaTTkJG+k4Q47RDNrPwUpGd+3z1oxZdkRjUd2j1 M+e0KtFdfOvzrgcUPCPjHPs73Afy7BPZT1SzBJOdj2FL81+kZng71gumPZ5yDjpvTQvK 2hz7SRkxznBK01tj8nSoRkYmr2qNH+U1monr5IbGJRenwopzbXG0Qku2bKZjKSQndJ2f Loow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=gsb4N/dF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m67si8622279ite.168.2018.01.23.08.34.39; Tue, 23 Jan 2018 08:34:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=gsb4N/dF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751439AbeAWQdk (ORCPT + 99 others); Tue, 23 Jan 2018 11:33:40 -0500 Received: from mail-pg0-f47.google.com ([74.125.83.47]:38509 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbeAWQdi (ORCPT ); Tue, 23 Jan 2018 11:33:38 -0500 Received: by mail-pg0-f47.google.com with SMTP id y27so636294pgc.5 for ; Tue, 23 Jan 2018 08:33:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AgOwSRC0FhZe/W5+vt0YpvRiFhw5NUxWczlVZBZk7Vo=; b=gsb4N/dF35swYBDh4wAhqfYsv81BxwWZKmLgfXTDuk16l9RBTUXw82hYnMhQtJZnQm vXQd7Av8lRHg7os9zqJA2a3o0MeGrp9oJZ8n9ujmot0QWycd3x5GF3lbiJcwFmQtYniL 5tCASlX2YZI4LL/gO+LWOZpKKpxZelPSP8PcftRj3koTygzQrQwqoflHNsfV66Hs9pLd R4vYVty3xrrpotieqRyllKUmYIwPF6Cwn9LuS4oxsqKn+0aKHE0GbUV8xWbldc+Nsmse jBLg2VWqpPCrZdHQ8OQWwUR7nByfOIKzryzfy5lOt0LBN3Yrq5utUHi5tnQnNn54d0G1 btoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AgOwSRC0FhZe/W5+vt0YpvRiFhw5NUxWczlVZBZk7Vo=; b=K07s98S9EaS6tf+lUsrw//kZgyRIiRgJKean45gusktzQDj16XJmP5YQjm4YnntTUr wxzhEE6CZ1fCxGTe0ilcQ2A1YAvcvwWEzsDjP4oz/l7d7XWxbRWeyJ0sDS2q8Vg9Dtq/ SS2z18aCTzXukcJwaWsAZqMKGkXGr1XYuU9mNNsxeu5BpNPvjz6l+gnV+I1DR4FwAvaO bMyw85G2cFd5XlArhb+7Ev/tJBPyxVmJSPN5EOEPB+uI3uwhv8vOgqC11d/qFsiRp9zd Qf/wwl/6EJ47HXTSJUB3TIzdTNbk6lu6KxS/tD2IU5Zm/RtkCBsQ11Ij2pb806xQbAys imwA== X-Gm-Message-State: AKwxytf89UCfbrkBauxbG+Tuzktx4ECJHynRKR89sXKwQyFJ06rvAFpi qXiaS2pAR00H285atxg5xfCwZg== X-Received: by 10.99.96.23 with SMTP id u23mr9517534pgb.355.1516725218040; Tue, 23 Jan 2018 08:33:38 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id 9sm7469627pfq.62.2018.01.23.08.33.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2018 08:33:37 -0800 (PST) Date: Tue, 23 Jan 2018 08:33:36 -0800 From: Stephen Hemminger To: Mohammed Gamal Cc: netdev@vger.kernel.org, otubo@redhat.com, sthemmin@microsoft.com, haiyangz@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, vkuznets@redhat.com Subject: Re: [RFC PATCH 0/2] hv_netvsc: Fix shutdown regression on Win2012 hosts Message-ID: <20180123083336.7e66881e@xeon-e3> In-Reply-To: <1516700045-32142-1-git-send-email-mgamal@redhat.com> References: <1516700045-32142-1-git-send-email-mgamal@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Jan 2018 10:34:03 +0100 Mohammed Gamal wrote: > Commit 0cf737808ae7 ("hv_netvsc: netvsc_teardown_gpadl() split") introduced > a regression that caused VMs not to shutdown after netvsc_device_remove() is > called. This is caused by GPADL teardown sequence change, and while that was > necessary to fix issues with Win2016 hosts, it did introduce a regression for > earlier versions. > > Prior to commit 0cf737808 the call sequence in netvsc_device_remove() was as > follows (as implemented in netvsc_destroy_buf()): > 1- Send NVSP_MSG1_TYPE_REVOKE_RECV_BUF message > 2- Teardown receive buffer GPADL > 3- Send NVSP_MSG1_TYPE_REVOKE_SEND_BUF message > 4- Teardown send buffer GPADL > 5- Close vmbus > > This didn't work for WS2016 hosts. Commit 0cf737808 split netvsc_destroy_buf() > into two functions and rearranged the order as follows > 1- Send NVSP_MSG1_TYPE_REVOKE_RECV_BUF message > 2- Send NVSP_MSG1_TYPE_REVOKE_SEND_BUF message > 3- Close vmbus > 4- Teardown receive buffer GPADL > 5- Teardown send buffer GPADL > > That worked well for WS2016 hosts, but for WS2012 hosts it prevented VMs from > shutting down. > > This patch series works around this problem. The first patch splits > netvsc_revoke_buf() and netvsc_teardown_gpadl() into two finer grained > functions for tearing down send and receive buffers individally. The second patch > uses the finer grained functions to implement the teardown sequence according to > the host's version. We keep the behavior introduced in 0cf737808ae7 for Windows > 2016 hosts, while we re-introduce the old sequence for earlier verions. > > Mohammed Gamal (2): > hv_netvsc: Split netvsc_revoke_buf() and netvsc_teardown_gpadl() > hv_netvsc: Change GPADL teardown order according to Hyper-V version > > drivers/net/hyperv/netvsc.c | 50 +++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 42 insertions(+), 8 deletions(-) > The problem the original commit was trying to solve was actions in flight in the receive buffer on shutdown. Having different ordering for each version of Hyper-V seems unnecessary. There should be a way to get a stable sequence here. Let me see if I can shake more information out of the Windows team to see what the handshake on the other side is. Let's not apply this until then.