On Thu, 11 Aug 2022 at 11:38, Jinhao Fan <fanjinhao...@ict.ac.cn> wrote: > > nvme_irq_assert() only does useful work when cq->irq_enabled is true. > nvme_irq_deassert() only works for pin-based interrupts. Avoid calls > into these functions if we are sure they will not do useful work. > > This will be most useful when we use eventfd to send interrupts. We > can avoid the unnecessary overhead of signalling eventfd. > > Signed-off-by: Jinhao Fan <fanjinhao...@ict.ac.cn> > --- > hw/nvme/ctrl.c | 40 ++++++++++++++++++++++------------------ > 1 file changed, 22 insertions(+), 18 deletions(-)
There is code duplication and nvme_irq_assert/deassert() check ->irq_enabled and msix_enabled() again. Can the logic be moved into assert()/deassert() so callers don't need to duplicate the checks? (I assume the optimization is that eventfd syscalls are avoided, not that the function call is avoided.) Stefan