Skip to content

Commit

Permalink
net/virtio: avoid unneeded link interrupt configuration
Browse files Browse the repository at this point in the history
[ upstream commit 5be2325 ]

There is no reason to re-register a interrupt handler for LSC if this
feature was not requested in the first place.
A simple use case is when asking for Rx interrupts without LSC interrupt.

Fixes: 26b683b ("net/virtio: setup Rx queue interrupts")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
david-marchand authored and cpaelzer committed Nov 30, 2021
1 parent 9fa5eea commit d7a9138
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/net/virtio/virtio_ethdev.c
Expand Up @@ -1643,13 +1643,15 @@ virtio_configure_intr(struct rte_eth_dev *dev)
}
}

/* Re-register callback to update max_intr */
rte_intr_callback_unregister(dev->intr_handle,
virtio_interrupt_handler,
dev);
rte_intr_callback_register(dev->intr_handle,
virtio_interrupt_handler,
dev);
if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
/* Re-register callback to update max_intr */
rte_intr_callback_unregister(dev->intr_handle,
virtio_interrupt_handler,
dev);
rte_intr_callback_register(dev->intr_handle,
virtio_interrupt_handler,
dev);
}

/* DO NOT try to remove this! This function will enable msix, or QEMU
* will encounter SIGSEGV when DRIVER_OK is sent.
Expand Down

0 comments on commit d7a9138

Please sign in to comment.