All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Wu, Jingjing" <jingjing.wu@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>
Cc: "stephen@networkplumber.org" <stephen@networkplumber.org>,
	"Liang, Cunming" <cunming.liang@intel.com>,
	"Lu, Xiuchun" <xiuchun.lu@intel.com>,
	"Li, Miao" <miao.li@intel.com>
Subject: Re: [dpdk-dev] [PATCH 5/9] vfio_user: implement interrupt related APIs
Date: Wed, 30 Dec 2020 02:31:11 +0000	[thread overview]
Message-ID: <MN2PR11MB406318B96BF654643CBEE4519CD70@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <BN6PR11MB4052F85B71FBCDED48540598E3D70@BN6PR11MB4052.namprd11.prod.outlook.com>

Hi Jingjing,

> -----Original Message-----
> From: Wu, Jingjing <jingjing.wu@intel.com>
> Sent: Wednesday, December 30, 2020 9:05 AM
> To: Xia, Chenbo <chenbo.xia@intel.com>; dev@dpdk.org; thomas@monjalon.net;
> david.marchand@redhat.com
> Cc: stephen@networkplumber.org; Liang, Cunming <cunming.liang@intel.com>; Lu,
> Xiuchun <xiuchun.lu@intel.com>; Li, Miao <miao.li@intel.com>
> Subject: RE: [PATCH 5/9] vfio_user: implement interrupt related APIs
> 
> >  	if ((cmd == VFIO_USER_DMA_MAP || cmd == VFIO_USER_DMA_UNMAP
> > ||
> > +		cmd == VFIO_USER_DEVICE_SET_IRQS ||
> >  		cmd == VFIO_USER_DEVICE_RESET)
> >  		&& dev->ops->lock_dp) {
> >  		dev->ops->lock_dp(dev_id, 1);
> 
> About cmd "VFIO_USER_REGION_WRITE", irq setting would cause update_status to
> iavfbe device.
> Where will the lock be?

If emulated device needs some lock in slow-path region rw, IMHO, it should be implemented
in rte_vfio_user_reg_acc_t, which is the region rw callback. As region rw has different
behavior for different registers, it's better to make it device-specific 😊

Thanks!
Chenbo

> 
> > @@ -871,7 +1056,8 @@ static int vfio_user_message_handler(int dev_id, int fd)
> >  		if (vfio_user_is_ready(dev) && dev->ops->new_device)
> >  			dev->ops->new_device(dev_id);
> >  	} else {
> > -		if ((cmd == VFIO_USER_DMA_MAP || cmd ==
> > VFIO_USER_DMA_UNMAP)
> > +		if ((cmd == VFIO_USER_DMA_MAP || cmd ==
> > VFIO_USER_DMA_UNMAP
> > +			|| cmd == VFIO_USER_DEVICE_SET_IRQS)
> >  			&& dev->ops->update_status)
> >  			dev->ops->update_status(dev_id);
> >  	}
> > @@ -898,6 +1084,7 @@ static int vfio_user_sock_read(int fd, void *data)
> >  		if (dev) {
> >  			dev->ops->destroy_device(dev_id);
> >  			vfio_user_destroy_mem_entries(dev->mem);
> > +			vfio_user_clean_irqfd(dev);
> >  			dev->is_ready = 0;
> >  			dev->msg_id = 0;
> >  		}
> > @@ -995,9 +1182,9 @@ vfio_user_start_server(struct vfio_user_server_socket
> > *sk)
> >  	}
> >
> >  	/* All the info must be set before start */
> > -	if (!dev->dev_info || !dev->reg) {
> > +	if (!dev->dev_info || !dev->reg || !dev->irqs.info) {
> >  		VFIO_USER_LOG(ERR, "Failed to start, "
> > -			"dev/reg info must be set before start\n");
> > +			"dev/reg/irq info must be set before start\n");
> >  		return -1;
> >  	}
> >


  reply	other threads:[~2020-12-30  2:31 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18  7:38 [dpdk-dev] [PATCH 0/9] Introduce vfio-user library Chenbo Xia
2020-12-18  7:38 ` [dpdk-dev] [PATCH 1/9] lib: introduce " Chenbo Xia
2020-12-18 17:13   ` Stephen Hemminger
2020-12-19  6:12     ` Xia, Chenbo
2020-12-18 17:17   ` Stephen Hemminger
2020-12-19  6:25     ` Xia, Chenbo
2020-12-18  7:38 ` [dpdk-dev] [PATCH 2/9] vfio_user: implement lifecycle related APIs Chenbo Xia
2021-01-05  8:34   ` Xing, Beilei
2021-01-05  9:58     ` Xia, Chenbo
2020-12-18  7:38 ` [dpdk-dev] [PATCH 3/9] vfio_user: implement device and region " Chenbo Xia
2021-01-06  5:51   ` Xing, Beilei
2021-01-06  7:50     ` Xia, Chenbo
2020-12-18  7:38 ` [dpdk-dev] [PATCH 4/9] vfio_user: implement DMA table and socket address API Chenbo Xia
2020-12-18  7:38 ` [dpdk-dev] [PATCH 5/9] vfio_user: implement interrupt related APIs Chenbo Xia
2020-12-30  1:04   ` Wu, Jingjing
2020-12-30  2:31     ` Xia, Chenbo [this message]
2020-12-18  7:38 ` [dpdk-dev] [PATCH 6/9] vfio_user: add client APIs of device attach/detach Chenbo Xia
2020-12-18  7:38 ` [dpdk-dev] [PATCH 7/9] vfio_user: add client APIs of DMA/IRQ/region Chenbo Xia
2021-01-07  2:41   ` Xing, Beilei
2021-01-07  7:26     ` Xia, Chenbo
2020-12-18  7:38 ` [dpdk-dev] [PATCH 8/9] test/vfio_user: introduce functional test Chenbo Xia
2020-12-18  7:38 ` [dpdk-dev] [PATCH 9/9] doc: add vfio-user library guide Chenbo Xia
2021-01-06  5:07   ` Xing, Beilei
2021-01-06  7:43     ` Xia, Chenbo
2020-12-18  9:37 ` [dpdk-dev] [PATCH 0/9] Introduce vfio-user library David Marchand
2020-12-18 14:07   ` Thanos Makatos
2023-06-29 16:10     ` Stephen Hemminger
2023-06-30  1:36       ` Xia, Chenbo
2021-01-14  6:14 ` [dpdk-dev] [PATCH v2 " Chenbo Xia
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 1/9] lib: introduce " Chenbo Xia
2024-02-12 22:53     ` Stephen Hemminger
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 2/9] vfio_user: implement lifecycle related APIs Chenbo Xia
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 3/9] vfio_user: implement device and region " Chenbo Xia
2021-01-14 18:48     ` David Christensen
2021-01-19  3:22       ` Xia, Chenbo
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 4/9] vfio_user: implement DMA table and socket address API Chenbo Xia
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 5/9] vfio_user: implement interrupt related APIs Chenbo Xia
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 6/9] vfio_user: add client APIs of device attach/detach Chenbo Xia
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 7/9] vfio_user: add client APIs of DMA/IRQ/region Chenbo Xia
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 8/9] test/vfio_user: introduce functional test Chenbo Xia
2021-01-14 19:03     ` David Christensen
2021-01-19  3:27       ` Xia, Chenbo
2021-01-19 18:26         ` David Christensen
2021-01-14  6:14   ` [dpdk-dev] [PATCH v2 9/9] doc: add vfio-user library guide Chenbo Xia
2021-01-15  7:58   ` [dpdk-dev] [PATCH v2 0/9] Introduce vfio-user library David Marchand
2021-01-19  3:13     ` Xia, Chenbo

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=MN2PR11MB406318B96BF654643CBEE4519CD70@MN2PR11MB4063.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=cunming.liang@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=miao.li@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=xiuchun.lu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.