Re: [PATCH] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-29 Thread Jinhao Fan
at 4:13 AM, Klaus Jensen wrote: > On Jun 27 18:48, Jinhao Fan wrote: >> Add property "ioeventfd" which is enabled by default. When this is >> enabled, updates on the doorbell registers will cause KVM to signal >> an event to the QEMU main loop to handle the doorbell updates. >> Therefore,

Re: [PATCH] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-29 Thread Jinhao Fan
> That looks correct since we don't need the ioevent is an optional > optimization. > > I would just suggest making this easier to read. For example, in > nvme_init_sq_ioeventfd(), instead of assigning within a conditional: > >if ((ret = event_notifier_init(>notifier, 0))) { > > Do each

Re: [PATCH] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-29 Thread Klaus Jensen
On Jun 27 18:48, Jinhao Fan wrote: > Add property "ioeventfd" which is enabled by default. When this is > enabled, updates on the doorbell registers will cause KVM to signal > an event to the QEMU main loop to handle the doorbell updates. > Therefore, instead of letting the vcpu thread run both

Re: [PATCH] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-29 Thread Keith Busch
On Wed, Jun 29, 2022 at 05:04:25PM +0800, Jinhao Fan wrote: > Ping~ > > > @@ -4271,6 +4343,11 @@ static void nvme_init_sq(NvmeSQueue *sq, NvmeCtrl > > *n, uint64_t dma_addr, > > if (n->dbbuf_enabled) { > > sq->db_addr = n->dbbuf_dbs + (sqid << 3); > > sq->ei_addr =

Re: [PATCH] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-29 Thread Jinhao Fan
Ping~ > @@ -4271,6 +4343,11 @@ static void nvme_init_sq(NvmeSQueue *sq, NvmeCtrl *n, > uint64_t dma_addr, > if (n->dbbuf_enabled) { > sq->db_addr = n->dbbuf_dbs + (sqid << 3); > sq->ei_addr = n->dbbuf_eis + (sqid << 3); > + > +if (n->params.ioeventfd &&

[PATCH] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-27 Thread Jinhao Fan
Add property "ioeventfd" which is enabled by default. When this is enabled, updates on the doorbell registers will cause KVM to signal an event to the QEMU main loop to handle the doorbell updates. Therefore, instead of letting the vcpu thread run both guest VM and IO emulation, we now use the