Received: by 10.223.176.46 with SMTP id f43csp3947044wra; Tue, 23 Jan 2018 01:35:22 -0800 (PST) X-Google-Smtp-Source: AH8x2257ymYPGlBz3IvT+bEzSM87mKHT9lXhNYYKHEIwgjFXdS27dxw3qB8iIHofkh7G9ioqANDM X-Received: by 10.101.97.22 with SMTP id z22mr8619406pgu.24.1516700122604; Tue, 23 Jan 2018 01:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516700122; cv=none; d=google.com; s=arc-20160816; b=q7CGeVbFrwnaiYm4gK8mLKCxppLz9yWS9dJMEq/9QhzYBVZ5oTa4/sG2JcKSXrAXNU I3IfdQLt62+jshfn+OSqFtwfdO0Dy/0BgF8zbnnaDd35pYZR8a4SxB5+GJP9DCpvqzbO KMbUXSs6BIA++ELd3u91f/trvIAveIrJhEMEE953KdPapie+M0kWBpJDvbegTBoHehMu dNomt7SfyrYmyXdFN9Cl72VsaF9D8dLfmcOCSNPnKXvOqEEFIebEWK45IJZRnkpTFlsr zdroaCFxx5CuYb7nCXu72Uqj7T4iGDx8XcQQ8p9eSDr2/MMrNLc9B9y6cMDBXZNBkd2I UCKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vlbWuSH4WOwIP0/8hLLDL46RGx1BVSKRdCBqRqqsqBM=; b=qrtZNeK8wFsH16+cLTRkz9dURzJfTmuwxvtjXHYl0A/ckKLathuxl2Dvo7MsDufJmD uotGxN8QNypo3U9wsNAeukIFppKBtshcag0JhTpykPYxKvwnnZykZvyF/scLm5+1fygq zeiEiRGJQNhgNzl6IBydWz8/5oKmqMOYOkS/HJJjgfrr5Wic/9sTQ10Yj8BQNK/bLBDU 8Mr+TSViObex5CdYX0/RqXCha50dCUcHU/sDaVe+vd78cHj9gYhBRNYjGHiohpIhmHpi LU9ECN/umRNEaSROkBMbBfaMAu7f/1dArL5fSjpo+opJiS8efuM5MUd5qL9qDCrRppI5 iM2A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k127si4488353pgk.733.2018.01.23.01.35.08; Tue, 23 Jan 2018 01:35:22 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259AbeAWJe1 (ORCPT + 99 others); Tue, 23 Jan 2018 04:34:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49980 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbeAWJe0 (ORCPT ); Tue, 23 Jan 2018 04:34:26 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FC2481DE3; Tue, 23 Jan 2018 09:34:26 +0000 (UTC) Received: from mmorsy.remote.csb (ovpn-112-57.ams2.redhat.com [10.36.112.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0AC17F80A; Tue, 23 Jan 2018 09:34:11 +0000 (UTC) From: Mohammed Gamal To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, vkuznets@redhat.com, cavery@redhat.com, otubo@redhat.com, Mohammed Gamal Subject: [RFC PATCH 0/2] hv_netvsc: Fix shutdown regression on Win2012 hosts Date: Tue, 23 Jan 2018 10:34:03 +0100 Message-Id: <1516700045-32142-1-git-send-email-mgamal@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 23 Jan 2018 09:34:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.8.3.1