netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Brett Creeley <brett.creeley@amd.com>
Cc: <kvm@vger.kernel.org>, <netdev@vger.kernel.org>, <jgg@nvidia.com>,
	<yishaih@nvidia.com>, <shameerali.kolothum.thodi@huawei.com>,
	<kevin.tian@intel.com>, <horms@kernel.org>,
	<shannon.nelson@amd.com>
Subject: Re: [PATCH v14 vfio 5/8] vfio/pds: Add VFIO live migration support
Date: Tue, 8 Aug 2023 16:27:04 -0600	[thread overview]
Message-ID: <20230808162704.7f5d4889.alex.williamson@redhat.com> (raw)
In-Reply-To: <20230807205755.29579-6-brett.creeley@amd.com>

On Mon, 7 Aug 2023 13:57:52 -0700
Brett Creeley <brett.creeley@amd.com> wrote:
...
> +static int
> +pds_vfio_suspend_wait_device_cmd(struct pds_vfio_pci_device *pds_vfio)
> +{
> +	union pds_core_adminq_cmd cmd = {
> +		.lm_suspend_status = {
> +			.opcode = PDS_LM_CMD_SUSPEND_STATUS,
> +			.vf_id = cpu_to_le16(pds_vfio->vf_id),
> +		},
> +	};
> +	struct device *dev = pds_vfio_to_dev(pds_vfio);
> +	union pds_core_adminq_comp comp = {};
> +	unsigned long time_limit;
> +	unsigned long time_start;
> +	unsigned long time_done;
> +	int err;
> +
> +	time_start = jiffies;
> +	time_limit = time_start + HZ * SUSPEND_TIMEOUT_S;
> +	do {
> +		err = pds_vfio_client_adminq_cmd(pds_vfio, &cmd, &comp, true);
> +		if (err != -EAGAIN)
> +			break;
> +
> +		msleep(SUSPEND_CHECK_INTERVAL_MS);
> +	} while (time_before(jiffies, time_limit));
> +
> +	time_done = jiffies;
> +	dev_dbg(dev, "%s: vf%u: Suspend comp received in %d msecs\n", __func__,
> +		pds_vfio->vf_id, jiffies_to_msecs(time_done - time_start));
> +
> +	/* Check the results */
> +	if (time_after_eq(time_done, time_limit)) {
> +		dev_err(dev, "%s: vf%u: Suspend comp timeout\n", __func__,
> +			pds_vfio->vf_id);
> +		err = -ETIMEDOUT;

If the command completes successfully but exceeds the time limit
this turns a success into a failure.  Is that desired?  Thanks,

Alex


  reply	other threads:[~2023-08-08 22:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 20:57 [PATCH v14 vfio 0/8] pds-vfio-pci driver Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 1/8] vfio: Commonize combine_ranges for use in other VFIO drivers Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 2/8] vfio/pds: Initial support for pds VFIO driver Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 3/8] pds_core: Require callers of register/unregister to pass PF drvdata Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 4/8] vfio/pds: register with the pds_core PF Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 5/8] vfio/pds: Add VFIO live migration support Brett Creeley
2023-08-08 22:27   ` Alex Williamson [this message]
2023-08-09 15:44     ` Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 6/8] vfio/pds: Add support for dirty page tracking Brett Creeley
2023-08-08 22:27   ` Alex Williamson
2023-08-09 15:44     ` Brett Creeley
2023-08-09 17:33       ` Alex Williamson
2023-08-09 18:06         ` Jason Gunthorpe
2023-08-10  2:47           ` Tian, Kevin
2023-08-10 16:47             ` Alex Williamson
2023-08-10 17:19               ` Jason Gunthorpe
2023-08-10 17:40                 ` Alex Williamson
2023-08-10 17:43                   ` Jason Gunthorpe
2023-08-10 17:54                     ` Alex Williamson
2023-08-10 18:11                       ` Jason Gunthorpe
2023-08-11  3:25                         ` Tian, Kevin
2023-08-14 18:41                           ` Brett Creeley
2023-08-15  2:45                             ` Tian, Kevin
2023-08-11 15:53                         ` Alex Williamson
2023-08-12 10:49                 ` Christoph Hellwig
2023-08-14 22:51                   ` Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 7/8] vfio/pds: Add support for firmware recovery Brett Creeley
2023-08-07 20:57 ` [PATCH v14 vfio 8/8] vfio/pds: Add Kconfig and documentation Brett Creeley
2023-08-10  8:32 ` [PATCH v14 vfio 0/8] pds-vfio-pci driver Shameerali Kolothum Thodi
2023-08-15  2:47 ` Tian, Kevin
2023-08-17 17:53 ` Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230808162704.7f5d4889.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=brett.creeley@amd.com \
    --cc=horms@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shannon.nelson@amd.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).