[dpdk-dev] [PATCH v4 10/23] virtio: Add vtpci_intr_handle() helper to get rte_intr_handle

Jan Blunck jblunck at infradead.org
Fri Dec 23 12:04:12 CET 2016


On Wed, Dec 21, 2016 at 9:08 PM, Stephen Hemminger
<stephen at networkplumber.org> wrote:
> On Wed, 21 Dec 2016 16:09:33 +0100
> Jan Blunck <jblunck at 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 <jblunck at infradead.org>
>> Acked-by: Shreyansh Jain <shreyansh.jain at 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.

Thanks for the review. I'll fix this for v5.


More information about the dev mailing list