From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SS7QLzaE0WrK84bD3t+2LDgwBuQrOxej8owgmp822xM=; b=VHpKo4REYeRMgjqnSE+3Y34yT9UDmwsFkrbznYL5zIxvfrYt9qbe1DbyMu1EhXJSgA n0ngjO7jybH3V3Jv1NcgXCt4dntZwrmfxB1r2HztHM/4kGF9wl+F64rqdNoTZgmsO+ii fjmpoDiP8Y4BThiqWQdae/yo56fikISjImktL+4ATZ9EJBXIYGZEPtkz0gHFxb9WALvX E6KexWkQ/kGDnAGuzROeV5TCs/sa9uddgl7X0zy9iwTJHksYG7LZHZXG0pS/phQcjUgT T740xvqMIvHc7uH3TtEYK6zlZIrol/Wm1hU0Nuv52NlXEacgtCzezcPB8L1WG1+cOPxU t3DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SS7QLzaE0WrK84bD3t+2LDgwBuQrOxej8owgmp822xM=; b=ADssUDw2nH2Z+l4vhx6VqQgRy2Po5B3zKD2dU+k3H517Ke7bqQeZnlOLyu5ERhSnWR bMlVpshbmgauNHZQvd5oVNJsXRHtgEEu5zi4sQA81CFxOM9BGkmqgYkeQNbh7WwjNpwT Yn7a+6OzGJyg/WpAZ3PL24mV5ec7C42wCZ3z4yHYLEC3rXpibB0PFBWIn+k3o4mB7/Xo +3SFJY0/64g+KeCJ0yUKJaEJYcw/Fdkbljw4KMm03A/atmaZIxiHp73KQKCROeBQrhrJ AOeiJiCmVN4boNeYH4FsxFrzQY+H7I3oNLQvh4OrGGGgb3OA+UmXyfZeZPgLNq73PrUQ RefQ== X-Gm-Message-State: AIkVDXKlLyRhNeqGqKGFl7S7ysOzPwK43RvqkxwJILtgurjcm1LKbT4Exjs1ZiFPP3vwyA== X-Received: by 10.84.225.133 with SMTP id u5mr9474271plj.76.1482350905097; Wed, 21 Dec 2016 12:08:25 -0800 (PST) Received: from xeon-e3 (204-195-18-65.wavecable.com. [204.195.18.65]) by smtp.gmail.com with ESMTPSA id c15sm48895525pfd.36.2016.12.21.12.08.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Dec 2016 12:08:24 -0800 (PST) Date: Wed, 21 Dec 2016 12:08:17 -0800 From: Stephen Hemminger To: Jan Blunck Cc: dev@dpdk.org, shreyansh.jain@nxp.com, david.marchand@6wind.com Message-ID: <20161221120817.0e6c171b@xeon-e3> In-Reply-To: <1482332986-7599-11-git-send-email-jblunck@infradead.org> 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 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: Wed, 21 Dec 2016 20:08:26 -0000 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.