From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-3501556-1516700075-2-36895098047790631 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no ("Email failed DMARC policy for domain") X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.25, RCVD_IN_DNSWL_MED -2.3, SPF_PASS -0.001, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='140.211.166.137', Host='smtp4.osuosl.org', Country='US', FromHeader='com', MailFrom='org' X-Spam-charsets: plain='us-ascii' X-IgnoreVacation: yes ("Email failed DMARC policy for domain") X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: driverdev-devel-bounces@linuxdriverproject.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1516700075; b=FxeO7iiCYqgJruYs/IM88M3QeB0MlPa/KqOG2j6CmDkZOi6 kql754KO12fu5DBDN0GRwstaftkgSL1OEgwTEAnwqlPsuB8y5Lh0OFA1p/uSdyi0 y61tila80IAUitqgy0I9kGSRY3qRc6QxVp9rJkWN1Lmc2g7+ObaLyOsjh92xKF6A tERV5Hl3kSlyssu/IZkSJPl1f9zQLJIfZ4RfaC7VlE0/PTdo0V5CeOIz7ln7KId6 rWiRtu4Lpw43ozXSv1h61OwMtLCOYCeelb13G7mBThaxV+4AQtshtDh5UR4zvGjH KZDFNC9LOp5PHlZM3X5D8iySKZ98HSVsbTwUoQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id:list-id :list-unsubscribe:list-archive:list-post:list-help :list-subscribe:cc:mime-version:content-type :content-transfer-encoding:sender; s=arctest; t=1516700075; bh=U saYs+Mg+2rqpJPFBjZ10Ty01d5q2gqJrQOSBTqBbUE=; b=F/0zuwtcfJPRS4aHq BWPvourzyETFFcn9dJI2yGseLB3DwjYdo74j0FdJ4AsMRo7SVowjaeYLzLgDObZ5 rnNpDoPDYcLfHP8rEns2yy3KnY4I8Ddq44Dbjgmw3ECGPEB6+1e1n+4gU7q05dw2 aUjJleDvKEQNBjo05ldL9AuVz4/dd/82lvtBDVKSgisKWeys+E4tUvUoFpH6rzOX 0tw6XZiw6gFurJn0QyLs5n2kE14Ug5/X/HS4oWQkZDgimOXMsW3wozeAcKh1yDK4 PvApghJdCm4XEChqrZ2IErDvCODW5foUCn7IuUJ3rBZ6Q9ZvSsXg+eGk48rMWWLL iNCdw== ARC-Authentication-Results: i=1; mx6.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=fail (p=none,has-list-id=yes,d=none) header.from=redhat.com; iprev=pass policy.iprev=140.211.166.137 (smtp4.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=fraxinus.osuosl.org; x-aligned-from=fail; x-ptr=fail x-ptr-helo=fraxinus.osuosl.org x-ptr-lookup=smtp4.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=redhat.com header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 Authentication-Results: mx6.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=fail (p=none,has-list-id=yes,d=none) header.from=redhat.com; iprev=pass policy.iprev=140.211.166.137 (smtp4.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=fraxinus.osuosl.org; x-aligned-from=fail; x-ptr=fail x-ptr-helo=fraxinus.osuosl.org x-ptr-lookup=smtp4.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=redhat.com header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 X-Remote-Delivered-To: driverdev-devel@osuosl.org From: Mohammed Gamal To: netdev@vger.kernel.org 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-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.24 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: otubo@redhat.com, Mohammed Gamal , sthemmin@microsoft.com, haiyangz@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, vkuznets@redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel