qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] hw/nvme: add iothread support


From: Jinhao Fan
Subject: Re: [PATCH 3/3] hw/nvme: add iothread support
Date: Fri, 26 Aug 2022 23:10:06 +0800

at 7:18 PM, Jinhao Fan <fanjinhao21s@ict.ac.cn> wrote:

> @@ -4979,7 +5007,13 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n, 
> uint64_t dma_addr,
>         }
>     }
>     n->cq[cqid] = cq;
> -    cq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_post_cqes, cq);
> +
> +    if (cq->cqid) {
> +        cq->timer = aio_timer_new(n->ctx, QEMU_CLOCK_VIRTUAL, SCALE_NS,
> +                                  nvme_post_cqes, cq);
> +    } else {
> +        cq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_post_cqes, cq);
> +    }
> 
>     /*
>      * Only enable irq eventfd for IO queues since we always emulate admin
> @@ -4988,6 +5022,13 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n, 
> uint64_t dma_addr,
>     if (cqid && n->params.irq_eventfd) {
>         nvme_init_irq_notifier(n, cq);
>     }
> +
> +    if (cq->cqid) {
> +        cq->timer = aio_timer_new(n->ctx, QEMU_CLOCK_VIRTUAL, SCALE_NS,
> +                                  nvme_post_cqes, cq);
> +    } else {
> +        cq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_post_cqes, cq);
> +    }
> }

Duplicated initialization of cq->timer.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]