> In this version I left irqfd initialization to the first assertion of an > irq. But I think it is better to initialize irqfd at cq creation time so we > won’t bother checking it at each irq assertion. However if I put these code > in nvme_init_cq(), irqfd does not work properly. After adding some > tracepoints I found the MSI messages in MSI-X table changed after > nvme_init_cq(). Specifically, the `data` field does not seem correct at the > time when nvme_init_cq() is called.
I found that in Linux NVMe driver, in nvme_create_cq() (drivers/nvme/host/pci.c), queue_request_irq() is called after nvme_init_queue(). Does this possibly cause the incorrect MSI messages at CQ creation time?