[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230808162704.7f5d4889.alex.williamson@redhat.com>
Date: Tue, 8 Aug 2023 16:27:04 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Brett Creeley <brett.creeley@....com>
Cc: <kvm@...r.kernel.org>, <netdev@...r.kernel.org>, <jgg@...dia.com>,
<yishaih@...dia.com>, <shameerali.kolothum.thodi@...wei.com>,
<kevin.tian@...el.com>, <horms@...nel.org>, <shannon.nelson@....com>
Subject: Re: [PATCH v14 vfio 5/8] vfio/pds: Add VFIO live migration support
On Mon, 7 Aug 2023 13:57:52 -0700
Brett Creeley <brett.creeley@....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
Powered by blists - more mailing lists