Received: by 10.223.176.46 with SMTP id f43csp1003093wra; Fri, 26 Jan 2018 10:11:35 -0800 (PST) X-Google-Smtp-Source: AH8x225JP7K2FYsAHbw0MdNbU/5Ie5cCWLiXE8WJHdehdp7bdin8mphWHBvell9GBSS6ER7hPvYw X-Received: by 2002:a17:902:7083:: with SMTP id z3-v6mr15135987plk.404.1516990294957; Fri, 26 Jan 2018 10:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516990294; cv=none; d=google.com; s=arc-20160816; b=EGuj0PfoP417sJoOJRDkEPx8NrDUkCh2oqm0OaReXvDXC99Dz8Bw2atVL6fxSiNQo6 7a/yId9NrLtj7zNl13ACPUBrSyU0brcmMrnwvJ6XTx4rZONVIfIx8vUvH7Wyv0RorGSA BwOcxxc7e1iTkSsuNkDQoxlGjFF21fb8DZ3j3frMgZlIYtuevEwf+DZ1TZTz6huwG46P P7Il0lSha+W/xQMWTSIPn7WD33vxzvkzQj1Rcc3tHXyq7VjZKdm/JKJsTr93iHEE3rZ0 RiWcErxPJeqmzzekTYWKWtoWN92++m7Y2huf+ALbyO0AvG5Y2PbdyzeV34A0PChWSW9V 6zLA== 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=Tj60yIVx69pIE19P26ruNLtmcQHbBUSwRvtn2NJkSi0=; b=gRiLygxm6VudzkWdnlopgpy1TU6auUKIIzCvdFdBm+tU7BrycG7Igh+mm1YRwmsjr1 FidUqZutaa555u6F130VzSA7GUSDltr82F6ffr6DVhgBOezwGifYUz7IclqwWpf7igGf fas/U9TTm6QaR+W6D5FeM2XVhiwLindcoVq4t9Ba4nSbZ4GSmeg0JmVwBswQ8f0lr0Ha bG8FtMJZQ/CrRrKqy01M7xTlcq9mqEKHmuSCU67DJPby1xTadFr0VKZaYtqh8mO80cfZ 1uPVHQZRNpmHerBxqC0ZcM8MCiseuJIOIXLjBhAeD4lnmKIWaxvyshprTJtciTlmjf70 tf1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=ioHm2RQy; 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 f3si6672599pfd.65.2018.01.26.10.11.20; Fri, 26 Jan 2018 10:11:34 -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=ioHm2RQy; 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 S1752081AbeAZSKr (ORCPT + 99 others); Fri, 26 Jan 2018 13:10:47 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:43765 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751807AbeAZSKp (ORCPT ); Fri, 26 Jan 2018 13:10:45 -0500 Received: by mail-pf0-f194.google.com with SMTP id y26so757701pfi.10 for ; Fri, 26 Jan 2018 10:10:45 -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=Tj60yIVx69pIE19P26ruNLtmcQHbBUSwRvtn2NJkSi0=; b=ioHm2RQyAyQesBDdo+LjAHiyEyp8TWt0W2LIK+hgHY3F8FoZtdfe2uL3CLoEWUnN22 LE3rbRIuwaYKuEfB0vPTB85psOPzD39MS9C5eMzo0PuTsjM7GKosSEVBG8edP+YA/1c5 oPgX10r6+U9eBAyPms/7Zz7oX1SZAj0fPaADdW/nHUEcSsp95awxEziuwso5P5vtwaoV 8u2MSPBAgYK4bB9KD0zG1DOeGNAV9GeyPPm6eJ+9WCIaZHG7c6bHh5IV6y3q+SOB8eet Fnu9G3qc0UnAE3CtLCP7AUSNqaBT8SOXpRJxAOgx/tG7+DxQUZpHnEpvXkpj4l/LYOdj 5/6g== 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=Tj60yIVx69pIE19P26ruNLtmcQHbBUSwRvtn2NJkSi0=; b=qZ9zfljm1qirvUC/BBSzJgZhyFcKLFY40czHcZF6JR60oC4fNNkgs4aBEVEQ9YT8Z4 FSHot18TvZe9ihUpoV7Mwv54Nxj2Aqs0dyxdhgCsMdOPferGyr7b5LlnBoShU3qrXd7E vQXCxhkrGG5R+bDbBkTp56MKT3AnPtVe9GHoywXuwKhfXCER9oPcjfiUutJdc+vQAfQP NlOb1KtuGntTVhS1pKHWoT37Lf/tH1d0DoN2Zw6Y/gxDwQPJyB7Vz4gC88lmiS1wFNeX isH2Fn9pOx2lVzoqq1ZL2yqjkQbHiFIF6udxT7bFbbyKOl93ARun1MzxG3k0h/CPlBA9 EN/g== X-Gm-Message-State: AKwxytcXDRIAo+9P+UtfSrcv20a9b0MOUw62M7GIykk2nHATFk+x/l/F DAI+qJVIquy8THhwvi7t0tbiEw== X-Received: by 2002:a17:902:3103:: with SMTP id w3-v6mr6078989plb.3.1516990245236; Fri, 26 Jan 2018 10:10:45 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id f72sm22231733pff.145.2018.01.26.10.10.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 10:10:45 -0800 (PST) Date: Fri, 26 Jan 2018 10:10:42 -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: <20180126101042.0300d836@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(-) > What I am experimenting with is sending an NDIS_RESET (instead of setting packet filter) as part of the close processing. This seems more like what the description of what Windows driver does and matches my reading of the public RNDIS specification.