[dpdk-dev] [PATCH v2 4/8] emu/iavf: add vfio-user device register and unregister

Xia, Chenbo chenbo.xia at intel.com
Wed Jan 6 08:41:57 CET 2021


Hi Jingjing,

> -----Original Message-----
> From: Wu, Jingjing <jingjing.wu at intel.com>
> Sent: Tuesday, January 5, 2021 9:42 PM
> To: Xia, Chenbo <chenbo.xia at intel.com>; dev at dpdk.org; thomas at monjalon.net;
> david.marchand at redhat.com
> Cc: stephen at networkplumber.org; Liang, Cunming <cunming.liang at intel.com>; Lu,
> Xiuchun <xiuchun.lu at intel.com>; Li, Miao <miao.li at intel.com>
> Subject: RE: [PATCH v2 4/8] emu/iavf: add vfio-user device register and
> unregister
> 
> > +static int iavf_emu_update_status(int vfio_dev_id) {
> > +	struct iavf_emudev *dev;
> > +	int ret;
> > +
> > +	dev = find_iavf_with_dev_id(vfio_dev_id);
> > +	if (!dev)
> > +		return -1;
> > +
> > +	ret = iavf_emu_setup_mem_table(dev);
> > +	if (ret) {
> > +		EMU_IAVF_LOG(ERR, "Failed to set up memtable for "
> > +			"device %d", dev->vfio->dev_id);
> > +		return ret;
> > +	}
> > +
> > +	ret = iavf_emu_setup_irq(dev);
> In update callback, irq fds will be reinitialized here. Think about if the
> update happening during mailbox communication, the eventfd of mailbox will be
> cleared without notify.

Correct! Will fix this in next version.

Thanks!
Chenbo

> 
> > +	if (ret) {
> > +		EMU_IAVF_LOG(ERR, "Failed to set up irq for "
> > +			"device %d", dev->vfio->dev_id);
> > +		return ret;
> > +	}
> > +
> > +	dev->ops->update_status(dev->edev);
> > +
> > +	return 0;
> > +}


More information about the dev mailing list