From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-4099071-1516725229-2-15594521480792462064 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no 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.133', Host='smtp2.osuosl.org', Country='US', FromHeader='org', MailFrom='org' X-Spam-charsets: plain='us-ascii' 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=1516725228; b=a3kChyZzwpeJxu2dENBY/ryoAEuRN2WfJbXF2K6HFNdDy/k 5u6C0VH6KVBWX/orkTnKR+b+vbsL4nJEkeYhFbeuLPwnv5ffwApBR0ReeRST/3IQ 1P6CvGpIyUwxQhPKfd1q2FVNyH7lB4Om1ui9h2iEoqd85gehhAHDIcgiKhcm4Cag FrXvxpR1LASzyfodz9j93dmI6v4o8zNHfkPggljz7Gi500YG0bH4O+FZFQX99Ygs J7YH09JqF145qe+0IoMBoB1evR+6CFLfsfU1bZEiRsP+Dsr8XYZ+zz5JyyE8+cTT IvYHgElj0OIeIez+HgPs2JgwJ2x6nPWdtz59KHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :in-reply-to:references:mime-version:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:content-type :content-transfer-encoding:sender; s=arctest; t=1516725228; bh=p aMifq5E7fTQQIlBkv2q/kAHSdhAilReJcZBpF/O0dM=; b=iTEk4r5hKQ0PfB/+q QWEKHCqaTok+b8xM5WQm9c7KkYTlm9X2jtMoHEgvcEesZS/lc2Ju7IaJkBV0tlGE ZzeNRZQ2L5upC4WJg3BuPDcJLDDPrmLwdqnQnsuU4Unmai5Nof0voveJ6aDmfzXn 8p/3F1zliinZMuFRxjUBmyJ+vpKoJy8jm3Pt3XKo1B0E8I2UmavCVKW4Cz7MRUmN WMNbYmrnNWKBqQrQjyvDXFKkr3bhKi5Uz/OT6e4bCkXVYxpfIBIz+ANI73icYfye hEAFh6zbYc2xsfvdcJiTavAxeGM+a4doBF38JNiz/t7u1tJhd0tTHO1wM6ajJn/D A0RHA== ARC-Authentication-Results: i=1; mx5.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered; 2048-bit rsa key sha256) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b=gsb4N/dF x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=20150623; dmarc=none (p=none,has-list-id=yes,d=none) header.from=networkplumber.org; iprev=pass policy.iprev=140.211.166.133 (smtp2.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=hemlock.osuosl.org; x-aligned-from=fail; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=tgJr9zUo; x-ptr=fail x-ptr-helo=hemlock.osuosl.org x-ptr-lookup=smtp2.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=networkplumber.org 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: mx5.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered; 2048-bit rsa key sha256) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b=gsb4N/dF x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=20150623; dmarc=none (p=none,has-list-id=yes,d=none) header.from=networkplumber.org; iprev=pass policy.iprev=140.211.166.133 (smtp2.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=hemlock.osuosl.org; x-aligned-from=fail; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=tgJr9zUo; x-ptr=fail x-ptr-helo=hemlock.osuosl.org x-ptr-lookup=smtp2.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=networkplumber.org 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 X-Google-Smtp-Source: AH8x224ZoOOs+ebTxcwFdPiZmyWxy1v349NyST6oREU6BJz0cQaCSHb+Q2+Elv7GZ3hhGm1lpTUNwQ== Date: Tue, 23 Jan 2018 08:33:36 -0800 From: Stephen Hemminger To: Mohammed Gamal 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 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, sthemmin@microsoft.com, netdev@vger.kernel.org, haiyangz@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, vkuznets@redhat.com 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: 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. _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel