On Wed, 21 Dec 2016 16:09:33 +0100
Jan Blunck <jblu...@infradead.org> wrote:

> This adds a helper to get the rte_intr_handle from the virtio_hw. This is
> safe to do since the usage of the helper is guarded by RTE_ETH_DEV_INTR_LSC
> which is only set if we found a PCI device during initialization.
> 
> Signed-off-by: Jan Blunck <jblu...@infradead.org>
> Acked-by: Shreyansh Jain <shreyansh.j...@nxp.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 12 +++++++-----
>  drivers/net/virtio/virtio_pci.h    |  6 ++++++
>  2 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c 
> b/drivers/net/virtio/virtio_ethdev.c
> index 741688e..da9668e 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1162,7 +1162,7 @@ virtio_interrupt_handler(__rte_unused struct 
> rte_intr_handle *handle,
>       isr = vtpci_isr(hw);
>       PMD_DRV_LOG(INFO, "interrupt status = %#x", isr);
>  
> -     if (rte_intr_enable(&dev->pci_dev->intr_handle) < 0)
> +     if (rte_intr_enable(vtpci_intr_handle(hw)) < 0)
>               PMD_DRV_LOG(ERR, "interrupt enable failed");
>  
>       if (isr & VIRTIO_PCI_ISR_CONFIG) {

Since intr_handle is already an argument to interrupt handler, why not use it?
That is what I did in the Intel driver changes.

Reply via email to