Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3646596pxk; Mon, 7 Sep 2020 21:12:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSheBSa9lRbGnpT+nfdRLKMNhUx1MvIDet3boKtWJrVLcFqC04DyqJ0rta0Au02wxJ92Yr X-Received: by 2002:a17:906:7c82:: with SMTP id w2mr23121566ejo.87.1599538320705; Mon, 07 Sep 2020 21:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599538320; cv=none; d=google.com; s=arc-20160816; b=PeQflJJ9rlLlWDrOuL58yh04IKtlgrzAO/i5MxpN5WNA44j0ydGzXRr3hVsdNPShUt jILk/qFsbJIPuKw2zPQ5KikErlU9gd2V5ZnGBeJHKS+diD9iApTq/cMIA/BQIDEt5/H8 cIChZB9mk9tevf47pAEBjbBWIjhlMhL03xoQt/BHPKsjSUvqYD9KNIRHBKhcMnLBy9Wm u0X5OczA8Nh4/+v1uj1hOte2lXXN0+K48CDzB9U657MCz0NVUVgBEuKSdaeFklKmPQbR E6rcWfqx951C78tNiJYEucsgdYjYFJv9EMxEqHEKGMZOzik7Hxb3zIoVBIUNpZl339lp 6Trw== 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; bh=Wv1jJOCHYACzU5gc5/V1Uul+B/tQj5HioemUBz4NfMc=; b=TSyjPOHOTvZIIwCk40ja5wuAlja1DT+OuIhcFlJA/smdz3VZ3bo/86tgfQDyN7UGGZ Z19PhfTi7G6pezBkY3JoDZIzd47ro2RLQ/KkqkBZJ15glmB5c3nmfNOG9pKiUevMgZbs gnw+jlvKsd528Ey+G1l7niv/B9LrPjnjLhhDV3x1BqVGSeG++QnyX5xIw/ih5EmuaL8x PE8O1HwoakQ0axiWFu7ArnHnTf6g8/jdRPvoPgZVfsXMGxkCBdC7atj/QZ2NKHzXdHXy OHu0yQ/qwBM7RiI71m+WBbAP53AVD/d5XbgZWAriPvymb66CKs6nf2KY47xtbi/cJtvD eHag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EGj9vMkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx16si10914804edb.575.2020.09.07.21.11.36; Mon, 07 Sep 2020 21:12:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EGj9vMkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726451AbgIHEKR (ORCPT + 99 others); Tue, 8 Sep 2020 00:10:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:46830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgIHEKP (ORCPT ); Tue, 8 Sep 2020 00:10:15 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C688321481; Tue, 8 Sep 2020 04:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599538215; bh=7odZQvUtuGLow8kJkUKxWanDGq/uvBKPEezxTaLB6tg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EGj9vMkJxWQ/GG1XSj4TGjIvY+XtIE0dCS3QGAwfwmNfJcmW89yve0qJd5DaYLzAt tv+4svBGxo9Qh28lbivrJmTi/pckrm/zPfaiIyGxdR5DhSLo06cgFOnVo62zVU6wSU LZOfETfJbpfw72Msdhd1VxcsEtGtvd9vXtR0jPWU= Date: Mon, 7 Sep 2020 21:10:13 -0700 From: Jakub Kicinski To: Dexuan Cui Cc: wei.liu@kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, davem@davemloft.net, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mikelley@microsoft.com Subject: Re: [PATCH net v2] hv_netvsc: Fix hibernation for mlx5 VF driver Message-ID: <20200907211013.0f1a6702@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20200907071339.35677-1-decui@microsoft.com> References: <20200907071339.35677-1-decui@microsoft.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 Mon, 7 Sep 2020 00:13:39 -0700 Dexuan Cui wrote: > mlx5_suspend()/resume() keep the network interface, so during hibernation > netvsc_unregister_vf() and netvsc_register_vf() are not called, and hence > netvsc_resume() should call netvsc_vf_changed() to switch the data path > back to the VF after hibernation. Note: after we close and re-open the > vmbus channel of the netvsc NIC in netvsc_suspend() and netvsc_resume(), > the data path is implicitly switched to the netvsc NIC. Similarly, > netvsc_suspend() should not call netvsc_unregister_vf(), otherwise the VF > can no longer be used after hibernation. > > For mlx4, since the VF network interafce is explicitly destroyed and > re-created during hibernation (see mlx4_suspend()/resume()), hv_netvsc > already explicitly switches the data path from and to the VF automatically > via netvsc_register_vf() and netvsc_unregister_vf(), so mlx4 doesn't need > this fix. Note: mlx4 can still work with the fix because in > netvsc_suspend()/resume() ndev_ctx->vf_netdev is NULL for mlx4. > > Fixes: 0efeea5fb153 ("hv_netvsc: Add the support of hibernation") > Signed-off-by: Dexuan Cui Applied, thanks!