From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-3501556-1516700089-2-17558832826518069435 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.136', Host='smtp3.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=1516700089; b=ibnWAaZ5Bx0YOBpgk9kTCWmCJto+G5erMPQAYOXR9zXCZMJ kQdd6CmKmJhD/Dw4T4zmWPnyv9Kzo0jM5rDxJu+ZZRJneiuO7f+bFF7v1/iWKVNo LnI4pafImMVsdkuo7NPNHSLSM2i05df29q2DbPzPT5O+9j+/0rjhjweh4QVdIV5R x5mmfIBEmvq3Wge6JRdr/v0jpl1BQeEwmd8dq6pFkLRHm+MaJT2N1ZZ4oMW5BXjT GVS9hUGggi7dMh8bdr2x4jopT0m57xfJ+g78t+5E/lwv3sJRp4op+cNC7Sd1qGtU jcLCGUUAV53nmdYcqqV13+Q96WnyHTnxZYTCNOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :in-reply-to:references:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:cc:mime-version:content-type :content-transfer-encoding:sender; s=arctest; t=1516700089; bh=n bOo9HVtoUTjRFXDd1i735mM8hQ5ZkzZv7pDphf6Y8Y=; b=cCaQNWC+SN3KM/u5a Sag0Mn4kg9Y9D/BgAlNX9Zsd3m5ky3KzaOEpXtwWixnPVZY40EcyegsnZkeUlbAC IEGhNgDQdoLKzHui86o9UGZEdjLjqK7fIiX8PkpGFdLd+KfYfKY6/G7xTLngwcxr d/X8oal6raTQgPerL4LsGvMzvJc69VEGKQhdn7a9kwfdwcU189CTwU3OucSzs3Hq xhS8tILuFO8mVVQDshTEuxS8GrLOIm6sBBp6XZfr+UMtYPsTKbknT+62ASvz1mOb znLLdgVQs0gGO0JqGTK/sCEnXw3m+NN1dEvYhn9us16+b3wNufY8IX8Rb3nr/ZN2 7CByA== ARC-Authentication-Results: i=1; mx4.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.136 (smtp3.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=silver.osuosl.org; x-aligned-from=fail; x-ptr=fail x-ptr-helo=silver.osuosl.org x-ptr-lookup=smtp3.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: mx4.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.136 (smtp3.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=silver.osuosl.org; x-aligned-from=fail; x-ptr=fail x-ptr-helo=silver.osuosl.org x-ptr-lookup=smtp3.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 2/2] hv_netvsc: Change GPADL teardown order according to Hyper-V version Date: Tue, 23 Jan 2018 10:34:05 +0100 Message-Id: <1516700045-32142-3-git-send-email-mgamal@redhat.com> In-Reply-To: <1516700045-32142-1-git-send-email-mgamal@redhat.com> References: <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 causing VMs not to shutdown on pre-Wind2016 hosts after netvsc_remove_device() is called. This was caused as the GPADL teardown sequence was changed. This patch restores the old behavior for pre-Win2016 hosts, while keeping the changes from 0cf7378 for Win2016 and higher hosts. Signed-off-by: Mohammed Gamal --- drivers/net/hyperv/netvsc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 3982f76..d09bb3b 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -575,8 +575,17 @@ void netvsc_device_remove(struct hv_device *device) cancel_work_sync(&net_device->subchan_work); + /* + * Revoke receive buffer. If host is pre-Win2016 then tear down + * receive buffer GPADL. Do the same for send buffer. + */ netvsc_revoke_recv_buf(device, net_device); + if (vmbus_proto_version < VERSION_WIN10) + netvsc_teardown_recv_buf_gpadl(device, net_device); + netvsc_revoke_send_buf(device, net_device); + if (vmbus_proto_version < VERSION_WIN10) + netvsc_teardown_send_buf_gpadl(device, net_device); RCU_INIT_POINTER(net_device_ctx->nvdev, NULL); @@ -589,8 +598,14 @@ void netvsc_device_remove(struct hv_device *device) /* Now, we can close the channel safely */ vmbus_close(device->channel); - netvsc_teardown_recv_buf_gpadl(device, net_device); - netvsc_teardown_send_buf_gpadl(device, net_device); + /* + * If host is Win2016 or higher then we do the GPADL tear down + * here after VMBus is closed, instead of doing it earlier. + */ + if (vmbus_proto_version >= VERSION_WIN10) { + netvsc_teardown_recv_buf_gpadl(device, net_device); + netvsc_teardown_send_buf_gpadl(device, net_device); + } /* And dissassociate NAPI context from device */ for (i = 0; i < net_device->num_chn; i++) -- 1.8.3.1 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel