From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v4 10/23] virtio: Add vtpci_intr_handle() helper to get rte_intr_handle Date: Wed, 21 Dec 2016 12:08:17 -0800 Message-ID: <20161221120817.0e6c171b@xeon-e3> References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> <1482332986-7599-11-git-send-email-jblunck@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, shreyansh.jain@nxp.com, david.marchand@6wind.com To: Jan Blunck Return-path: Received: from mail-pg0-f45.google.com (mail-pg0-f45.google.com [74.125.83.45]) by dpdk.org (Postfix) with ESMTP id D42F310CA6 for ; Wed, 21 Dec 2016 21:08:25 +0100 (CET) Received: by mail-pg0-f45.google.com with SMTP id g1so49503534pgn.0 for ; Wed, 21 Dec 2016 12:08:25 -0800 (PST) In-Reply-To: <1482332986-7599-11-git-send-email-jblunck@infradead.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 21 Dec 2016 16:09:33 +0100 Jan Blunck 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 > Acked-by: Shreyansh Jain > --- > 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.