[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y49ICyTJ/WExT+wN@kbusch-mbp>
Date: Tue, 6 Dec 2022 13:47:55 +0000
From: Keith Busch <kbusch@...nel.org>
To: Lei Rao <lei.rao@...el.com>
Cc: axboe@...com, kch@...dia.com, hch@....de, sagi@...mberg.me,
alex.williamson@...hat.com, cohuck@...hat.com, jgg@...pe.ca,
yishaih@...dia.com, shameerali.kolothum.thodi@...wei.com,
kevin.tian@...el.com, mjrosato@...ux.ibm.com,
linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
kvm@...r.kernel.org, eddie.dong@...el.com, yadong.li@...el.com,
yi.l.liu@...el.com, Konrad.wilk@...cle.com, stephen@...eticom.com,
hang.yuan@...el.com
Subject: Re: [RFC PATCH 4/5] nvme-vfio: check if the hardware supports live
migration
On Tue, Dec 06, 2022 at 01:58:15PM +0800, Lei Rao wrote:
> +static bool nvmevf_check_migration(struct pci_dev *pdev)
> +{
> + struct nvme_command c = { };
> + struct nvme_id_ctrl *id;
> + u8 live_mig_support;
> + int ret;
> +
> + c.identify.opcode = nvme_admin_identify;
> + c.identify.cns = NVME_ID_CNS_CTRL;
> +
> + id = kmalloc(sizeof(struct nvme_id_ctrl), GFP_KERNEL);
> + if (!id)
> + return false;
> +
> + ret = nvme_submit_vf_cmd(pdev, &c, NULL, id, sizeof(struct nvme_id_ctrl));
> + if (ret) {
> + dev_warn(&pdev->dev, "Get identify ctrl failed (ret=0x%x)\n", ret);
> + goto out;
> + }
> +
> + live_mig_support = id->vs[0];
Considering this is a vendor specific region, it seems rather presumptuous to
assume this byte means "live migration supported".
Powered by blists - more mailing lists