netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH vfio] vfio/pds: Send type for SUSPEND_STATUS command
@ 2023-08-21 18:42 Brett Creeley
  2023-08-22  7:51 ` Simon Horman
  2023-08-22 19:25 ` Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Brett Creeley @ 2023-08-21 18:42 UTC (permalink / raw)
  To: kvm, netdev, alex.williamson, jgg, yishaih,
	shameerali.kolothum.thodi, kevin.tian
  Cc: brett.creeley, shannon.nelson

Commit bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support")
added live migration support for the pds-vfio-pci driver. When
sending the SUSPEND command to the device, the driver sets the
type of suspend (i.e. P2P or FULL). However, the driver isn't
sending the type of suspend for the SUSPEND_STATUS command, which
will result in failures. Fix this by also sending the suspend type
in the SUSPEND_STATUS command.

Fixes: bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support")
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 drivers/vfio/pci/pds/cmds.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/pci/pds/cmds.c b/drivers/vfio/pci/pds/cmds.c
index b0d88442b091..36463ccc3df9 100644
--- a/drivers/vfio/pci/pds/cmds.c
+++ b/drivers/vfio/pci/pds/cmds.c
@@ -86,12 +86,13 @@ void pds_vfio_unregister_client_cmd(struct pds_vfio_pci_device *pds_vfio)
 }
 
 static int
-pds_vfio_suspend_wait_device_cmd(struct pds_vfio_pci_device *pds_vfio)
+pds_vfio_suspend_wait_device_cmd(struct pds_vfio_pci_device *pds_vfio, u8 type)
 {
 	union pds_core_adminq_cmd cmd = {
 		.lm_suspend_status = {
 			.opcode = PDS_LM_CMD_SUSPEND_STATUS,
 			.vf_id = cpu_to_le16(pds_vfio->vf_id),
+			.type = type,
 		},
 	};
 	struct device *dev = pds_vfio_to_dev(pds_vfio);
@@ -156,7 +157,7 @@ int pds_vfio_suspend_device_cmd(struct pds_vfio_pci_device *pds_vfio, u8 type)
 	 * The subsequent suspend status request(s) check if the firmware has
 	 * completed the device suspend process.
 	 */
-	return pds_vfio_suspend_wait_device_cmd(pds_vfio);
+	return pds_vfio_suspend_wait_device_cmd(pds_vfio, type);
 }
 
 int pds_vfio_resume_device_cmd(struct pds_vfio_pci_device *pds_vfio, u8 type)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH vfio] vfio/pds: Send type for SUSPEND_STATUS command
  2023-08-21 18:42 [PATCH vfio] vfio/pds: Send type for SUSPEND_STATUS command Brett Creeley
@ 2023-08-22  7:51 ` Simon Horman
  2023-08-22 19:25 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-08-22  7:51 UTC (permalink / raw)
  To: Brett Creeley
  Cc: kvm, netdev, alex.williamson, jgg, yishaih,
	shameerali.kolothum.thodi, kevin.tian, shannon.nelson

On Mon, Aug 21, 2023 at 11:42:15AM -0700, Brett Creeley wrote:
> Commit bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support")
> added live migration support for the pds-vfio-pci driver. When
> sending the SUSPEND command to the device, the driver sets the
> type of suspend (i.e. P2P or FULL). However, the driver isn't
> sending the type of suspend for the SUSPEND_STATUS command, which
> will result in failures. Fix this by also sending the suspend type
> in the SUSPEND_STATUS command.
> 
> Fixes: bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support")
> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH vfio] vfio/pds: Send type for SUSPEND_STATUS command
  2023-08-21 18:42 [PATCH vfio] vfio/pds: Send type for SUSPEND_STATUS command Brett Creeley
  2023-08-22  7:51 ` Simon Horman
@ 2023-08-22 19:25 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2023-08-22 19:25 UTC (permalink / raw)
  To: Brett Creeley
  Cc: kvm, netdev, jgg, yishaih, shameerali.kolothum.thodi, kevin.tian,
	shannon.nelson

On Mon, 21 Aug 2023 11:42:15 -0700
Brett Creeley <brett.creeley@amd.com> wrote:

> Commit bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support")
> added live migration support for the pds-vfio-pci driver. When
> sending the SUSPEND command to the device, the driver sets the
> type of suspend (i.e. P2P or FULL). However, the driver isn't
> sending the type of suspend for the SUSPEND_STATUS command, which
> will result in failures. Fix this by also sending the suspend type
> in the SUSPEND_STATUS command.
> 
> Fixes: bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support")
> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
> ---
>  drivers/vfio/pci/pds/cmds.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied to vfio next branch for v6.6.  Thanks,

Alex

> 
> diff --git a/drivers/vfio/pci/pds/cmds.c b/drivers/vfio/pci/pds/cmds.c
> index b0d88442b091..36463ccc3df9 100644
> --- a/drivers/vfio/pci/pds/cmds.c
> +++ b/drivers/vfio/pci/pds/cmds.c
> @@ -86,12 +86,13 @@ void pds_vfio_unregister_client_cmd(struct pds_vfio_pci_device *pds_vfio)
>  }
>  
>  static int
> -pds_vfio_suspend_wait_device_cmd(struct pds_vfio_pci_device *pds_vfio)
> +pds_vfio_suspend_wait_device_cmd(struct pds_vfio_pci_device *pds_vfio, u8 type)
>  {
>  	union pds_core_adminq_cmd cmd = {
>  		.lm_suspend_status = {
>  			.opcode = PDS_LM_CMD_SUSPEND_STATUS,
>  			.vf_id = cpu_to_le16(pds_vfio->vf_id),
> +			.type = type,
>  		},
>  	};
>  	struct device *dev = pds_vfio_to_dev(pds_vfio);
> @@ -156,7 +157,7 @@ int pds_vfio_suspend_device_cmd(struct pds_vfio_pci_device *pds_vfio, u8 type)
>  	 * The subsequent suspend status request(s) check if the firmware has
>  	 * completed the device suspend process.
>  	 */
> -	return pds_vfio_suspend_wait_device_cmd(pds_vfio);
> +	return pds_vfio_suspend_wait_device_cmd(pds_vfio, type);
>  }
>  
>  int pds_vfio_resume_device_cmd(struct pds_vfio_pci_device *pds_vfio, u8 type)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-22 19:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-21 18:42 [PATCH vfio] vfio/pds: Send type for SUSPEND_STATUS command Brett Creeley
2023-08-22  7:51 ` Simon Horman
2023-08-22 19:25 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).