From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B421EB64D8 for ; Wed, 21 Jun 2023 14:23:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3610F80E3B; Wed, 21 Jun 2023 14:23:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3610F80E3B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1687357411; bh=7qYhNTwgfNHdCfp/dj4EaesBhDJ0GfBn7UveP4sR2UI=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=WZFFMp/nPSNmFPI3HcLuljR3/LEsB+SpxcyXbI/NqakslaHDgKG+6m2s2Ut8tIG8X 3XfANlXPMf2YRZu7UIs56ylEPiQ9wZtKd3jff6s0Uex+2Er8cNJiA34OmmSowdpe+l Yz0IB4gB566ROke1Z6Fr739UmLgA3mu+nSY3b+v3E8RPndc+6PZCanVgSHmJcA0H4S 1QXNau8wED8zkSRh8N//tznOCuZFQGo5oy9gWp/L/ecCDO88bYXCUYk/gC1CjmXvCC LUP3eYECbKWG7KeQkIWzHub+4rp7bvyoTEEqiV42SoYgU+r/IVYIJMCDPggW8076pF +IA2VMWoiZS1w== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GpeyzmqcS84S; Wed, 21 Jun 2023 14:23:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 3E52B80E60; Wed, 21 Jun 2023 14:23:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3E52B80E60 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 3B6561BF473 for ; Wed, 21 Jun 2023 14:23:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 203C480E3B for ; Wed, 21 Jun 2023 14:23:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 203C480E3B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TUf2ZTB_c46B for ; Wed, 21 Jun 2023 14:23:28 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 69D7980DF9 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by smtp1.osuosl.org (Postfix) with ESMTPS id 69D7980DF9 for ; Wed, 21 Jun 2023 14:23:28 +0000 (UTC) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6686ef86110so2321212b3a.2 for ; Wed, 21 Jun 2023 07:23:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687357408; x=1689949408; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tirA0cT91xteVoTFn4SjAFuV0+tvKI9IkCl5oFMwNV4=; b=RcZsudpSBi0Bu8VLKARRINfh011XRY7CX/+AdyOlZBU1MA+nyuYQC3uV/zSb/AWVSl SNJXgLiipSHiS0P0RIygoxV/r6uBoIZPwS7nHpgaBGSWjVvPyRFMo61tM5O775sKIFp/ VLxKdi4xb8IhSWr+zyDTsuOwaHf1pYTg2evX9vCivVuvqBOyR9TzCk1beYefAMqfPpqF gEufA4LadukEhNhEoeAah7ebkdz1xnSEdeqdxHQ/2z2xHBy66G9WABFgmiZl7pEBIRga E7dDAOkC7POX9MJ7lhsqh2hKwClP6HteNO8stQjB0V2XoZMfaWBo+Z74P0v0zTLs4lP/ eeIg== X-Gm-Message-State: AC+VfDzpZKsgnWsQ3MnqoUyHdmoIKJKeSYJsiDAOmNA5/ijOmuyI3Ihn 9mojWjppreDrHwIF4mejXFFdxbCHS7eVe31GLT0= X-Google-Smtp-Source: ACHHUZ7BIYW/nRHpJ0LfW42hKq7id+3yBhRctuOqQw4EKf7pEvl1dlEdVRZyFNbzF/dowR0EOUMd+g== X-Received: by 2002:a05:6a20:1e81:b0:123:7989:ba4e with SMTP id dl1-20020a056a201e8100b001237989ba4emr615520pzb.35.1687357407755; Wed, 21 Jun 2023 07:23:27 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-25-194.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.25.194]) by smtp.gmail.com with ESMTPSA id u5-20020a62ed05000000b006687da3db65sm2987132pfh.75.2023.06.21.07.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 07:23:27 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qByk0-007cw1-KN; Wed, 21 Jun 2023 11:23:24 -0300 Date: Wed, 21 Jun 2023 11:23:24 -0300 From: Jason Gunthorpe To: Lingyu Liu Message-ID: References: <20230621091112.44945-1-lingyu.liu@intel.com> <20230621091112.44945-14-lingyu.liu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230621091112.44945-14-lingyu.liu@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1687357408; x=1689949408; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tirA0cT91xteVoTFn4SjAFuV0+tvKI9IkCl5oFMwNV4=; b=llkW21/FhzNP63O6hSnpksFOaTQ88X1xiuTHZBr/c7/1ZPi1OJ3+6fejhPjGurYg/W /SLzyZx7rJR0lPgCu6LW4p+YoyO7fEdJfVvGGbl9sQArZIIH4m8lO8qg7pSKwuWyA43Z H3JJcJgU80FG39H/imBN3chta64e/6vByiyan+Itwn3zAVoxYdTdf7yCCawKuwVo+1ST dy6w8pE6sroHSrO3hnJH95s4H5IO1oHEVBqhqqssVspcGhHA9AjOhgUI63iP2VDDQdco aUffUPt5+nvZ6XxH3DnnYgTZt0T6keqD2eA9kduR9nh2QU/udXHzd8FJfWOIHJiBPKMU XxFw== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=llkW21/F Subject: Re: [Intel-wired-lan] [PATCH iwl-next V2 13/15] vfio/ice: implement vfio_pci driver for E800 devices X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kevin.tian@intel.com, yi.l.liu@intel.com, intel-wired-lan@lists.osuosl.org, phani.r.burra@intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Wed, Jun 21, 2023 at 09:11:10AM +0000, Lingyu Liu wrote: > +static struct file * > +ice_vfio_pci_step_device_state_locked(struct ice_vfio_pci_core_device *ice_vdev, > + u32 new, u32 final) > +{ > + struct device *dev = &ice_vdev->core_device.pdev->dev; > + u32 cur = ice_vdev->mig_state; > + int ret; > + > + if (final == VFIO_DEVICE_STATE_RESUMING) > + ice_vdev->is_dst = true; > + else if (final == VFIO_DEVICE_STATE_STOP) > + ice_vdev->is_dst = false; Definately not. The kernel should not be guessing which end is which, the protocol already makes it clear. > + > + if (cur == VFIO_DEVICE_STATE_RUNNING && new == VFIO_DEVICE_STATE_STOP) { > + if (!ice_vdev->is_dst) > + dev_info(dev, "Live migration begins\n"); > + ice_migration_suspend_vf(ice_vdev->vf_handle, ice_vdev->is_dst); > + return NULL; > + } > + > + if (cur == VFIO_DEVICE_STATE_STOP && new == VFIO_DEVICE_STATE_STOP_COPY) { > + struct ice_vfio_pci_migration_file *migf; > + > + migf = ice_vfio_pci_stop_copy(ice_vdev); > + if (IS_ERR(migf)) > + return ERR_CAST(migf); > + get_file(migf->filp); > + ice_vdev->saving_migf = migf; > + return migf->filp; > + } > + > + if (cur == VFIO_DEVICE_STATE_STOP_COPY && new == VFIO_DEVICE_STATE_STOP) { > + ice_vfio_pci_disable_fds(ice_vdev); > + dev_info(dev, "Live migration ends\n"); > + return NULL; > + } > + > + if (cur == VFIO_DEVICE_STATE_STOP && new == VFIO_DEVICE_STATE_RESUMING) { > + struct ice_vfio_pci_migration_file *migf; > + > + migf = ice_vfio_pci_resume(ice_vdev); > + if (IS_ERR(migf)) > + return ERR_CAST(migf); > + get_file(migf->filp); > + ice_vdev->resuming_migf = migf; > + return migf->filp; > + } > + > + if (cur == VFIO_DEVICE_STATE_RESUMING && new == VFIO_DEVICE_STATE_STOP) { > + ret = ice_vfio_pci_load_state(ice_vdev); > + if (ret) > + return ERR_PTR(ret); > + ice_vfio_pci_disable_fds(ice_vdev); > + return NULL; > + } > + > + if (cur == VFIO_DEVICE_STATE_STOP && new == VFIO_DEVICE_STATE_RUNNING) > + return NULL; Lack of P2P is going to be a problem too Jason _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan