From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 49FA510E26 for ; Fri, 23 Dec 2016 12:04:13 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id l2so15396149wml.2 for ; Fri, 23 Dec 2016 03:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zPJPV6VU8zPeRz/gU5IsCCDo8VxV3FIFhMiAI+6JPNA=; b=uuzcoq9eLxbkQgoaRlYjbscP0vCMONdpEFYw8YCFPEVc3/FTldSIMTiryDRtS4OIG5 +DB9oi9Uq625I3ueqmXLn6tsavMlu+YoUGjBiy1WUBAZTP5lRtNODqZ7Hl44Oge/fJBZ oDKAK2IRyM1ArVOC8pSIMKqoOs+ssvrmg/i7lTIqtyOvb8fV9h31PEFpd5tK7vWnI/uR MST4ANnoK5Xfz/eDbtBi1APLEAIk08P2xZwPqY+4pVrE9A3KiGTiDoMv0MLxnlzSqFIz TDUcDi5zXXzCxxfqXB1lZFmHctHdd43KtzdTXz7TdKoPRI3kxPA6MW1+2wVNlquNTKiC NXbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zPJPV6VU8zPeRz/gU5IsCCDo8VxV3FIFhMiAI+6JPNA=; b=LQYWpmgU1G+NvI05AIbeL6yB1wqUwaAeWNx5n7TMRafI9Rwnm0qBkcx348dbqk4EkH cwaa7sq85AYRhOigQ5xb47PUl43Tp4OrGVCYt0rOIsca5BKal7TwFZeKq/h7XEssBN3z 7cQXhk5NRlZz1JTBSLAkqDDFis+uwbeJwCDckFTZ+Mlyk+pUnhuNl2p/wXxAKDFE46Q1 oGgJMXZ/NAaHL4fvYFP+eM4JfQs/j/mtKMbIzsSfZa5uMlkO9MS9gJEpf1JqC/Wf9aWC KP8gIqAPQ5DQRY8lYNwh5GUhG1CHUaOjuxpLuMJDyFVSmRS1ODcQRA8an1QIx6jbn7gO X6Yw== X-Gm-Message-State: AIkVDXIpNV/vqDb9g6FylvHgPfS4mp84DMFIJw21EIY/R05TEp+eDqMCzmsILLqDqT5tOptzaWPNIZClVfPTlw== X-Received: by 10.28.8.202 with SMTP id 193mr12809027wmi.101.1482491052959; Fri, 23 Dec 2016 03:04:12 -0800 (PST) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.63.83 with HTTP; Fri, 23 Dec 2016 03:04:12 -0800 (PST) In-Reply-To: <20161221120817.0e6c171b@xeon-e3> References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> <1482332986-7599-11-git-send-email-jblunck@infradead.org> <20161221120817.0e6c171b@xeon-e3> From: Jan Blunck Date: Fri, 23 Dec 2016 12:04:12 +0100 X-Google-Sender-Auth: oykgDm6Qfg0bKZjpobOPzG2Cx10 Message-ID: To: Stephen Hemminger Cc: dev@dpdk.org, Shreyansh Jain , David Marchand Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v4 10/23] virtio: Add vtpci_intr_handle() helper to get rte_intr_handle X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 11:04:13 -0000 On Wed, Dec 21, 2016 at 9:08 PM, Stephen Hemminger wrote: > 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. Thanks for the review. I'll fix this for v5.