qemu-devel
[Top][All Lists]
Advanced

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

hw/nvme: why schedule sq timer when cq is full?


From: Jinhao Fan
Subject: hw/nvme: why schedule sq timer when cq is full?
Date: Sat, 25 Jun 2022 11:29:07 +0800

Hi Keith,

I just came across this piece of code in nvme_process_db() that I found weird:

start_sqs = nvme_cq_full(cq) ? 1 : 0;
...
if (start_sqs) {
    NvmeSQueue *sq;
    QTAILQ_FOREACH(sq, &cq->sq_list, entry) {
        timer_mod(sq->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 500);
    }
    timer_mod(cq->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 500);
}


The logic seems to be “If CQ is full, schedule SQ timer to produce more 
completions”. I cannot understand this. I think it would make more sense
with “If CQ is NOT full, schedule SQ timer to produce more completions”.Am 
I missing something?

Thanks,
Jinhao Fan



reply via email to

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