From mboxrd@z Thu Jan 1 00:00:00 1970 From: Santosh Shukla Subject: [ [PATCH v2] 12/13] virtio_ethdev: use virtio_ioport api at device init/close Date: Mon, 14 Dec 2015 18:30:31 +0530 Message-ID: <1450098032-21198-13-git-send-email-sshukla@mvista.com> References: <1450098032-21198-1-git-send-email-sshukla@mvista.com> To: dev@dpdk.org Return-path: Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by dpdk.org (Postfix) with ESMTP id 3357D91B6 for ; Mon, 14 Dec 2015 14:01:21 +0100 (CET) Received: by pff63 with SMTP id 63so11008418pff.2 for ; Mon, 14 Dec 2015 05:01:20 -0800 (PST) In-Reply-To: <1450098032-21198-1-git-send-email-sshukla@mvista.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Call virtio_ioport_init at device init and virtio_ioport_unmap at device close. Signed-off-by: Santosh Shukla --- drivers/net/virtio/virtio_ethdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 620e0d4..017d49f 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -62,7 +62,7 @@ #include "virtio_logs.h" #include "virtqueue.h" #include "virtio_rxtx.h" - +#include "virtio_ioport.h" static int eth_virtio_dev_init(struct rte_eth_dev *eth_dev); static int eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev); @@ -497,6 +497,7 @@ virtio_dev_close(struct rte_eth_dev *dev) hw->started = 0; virtio_dev_free_mbufs(dev); virtio_free_queues(dev); + virtio_ioport_unmap(); } static void @@ -1290,6 +1291,9 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) if (virtio_resource_init(pci_dev) < 0) return -1; + if (virtio_ioport_init(&pci_dev->mem_resource[0])) + return -1; + hw->use_msix = virtio_has_msix(&pci_dev->addr); hw->io_base = (uint64_t)(uintptr_t)pci_dev->mem_resource[0].addr; -- 1.7.9.5