From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <sshukla@mvista.com>
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 <dev@dpdk.org>; Mon, 14 Dec 2015 14:01:21 +0100 (CET)
Received: by pff63 with SMTP id 63so11008418pff.2
 for <dev@dpdk.org>; Mon, 14 Dec 2015 05:01:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mvista-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:in-reply-to:references;
 bh=BPQ/avCObHsLOJi/e2NIEV+MDIcvJU3z5GYMA9cOPbU=;
 b=AZKG+XsLep/GGjfey0ZPIXZsQeigDK9pGzamLOpl1tfAKI3+u58c1bP/ad0f8TO4iM
 HnWPgdS5Fbhad5RHE+RA7beYi7ShFQnVINwIJYRCeT4s0af+L6rrJCKhWX0PuDfwlzM5
 8S5slqQc/q+r5zYill8M1iaLtexvpviKYdDn/3CNmKPttUzFNLtnipxE7NyX+eCWQc4L
 DVGx1r/rAXmDUliD9/LknAoEwW7q8+ZO1EA8VZKYrpCIRhKP95hLWgWVhNbIZmAi2Lq2
 +kgrLEBaoRbOQA8GDI/DAkVK6ZWbRDXF4GYybZ/DJBuG19o6Hvu+yMak9BcTfqwo2HxN
 SYSw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references;
 bh=BPQ/avCObHsLOJi/e2NIEV+MDIcvJU3z5GYMA9cOPbU=;
 b=MokoNHejRkrR7QwKsGBIPB4ZYTsx+I6FOaVg9AvLo2G3gsaiupW1tDCSZ/6zOiYQqH
 Y36y9jO3baWBIR8lnOjWx8irBSwSxwdqgx6nvRBMIYpTuAaBdLghch31q+fR+j2Xm3zz
 a1M4F+UPWiXMtzMAXG34uZ6JVdgc5bNjtlqmrSOg3GYO66L05E+/fgxyrMlmlqi5ytGC
 V+eXzqYilThnjEJ5b2lSO4Ra/g0TTDVzSWSB8ru6B9Ujt+PKaMaIMjhlDf3tK1nOrrqM
 r2xKSxXTKgmzf1TsdblKNVH1ekX7/vbooY3gaep8y5ibQz7/1Y88hs9P5LwvZfP0hbmY
 XfFA==
X-Gm-Message-State: ALoCoQmGkSfKqnX2iqLfHxiDbVAQWCJmCD5FqwUN2UV1rP3hR6+mBqvBMSctv9amnlPM23njflKzvlC58TTveeKm0pjqfJPckg==
X-Received: by 10.98.73.70 with SMTP id w67mr28957670pfa.106.1450098080614;
 Mon, 14 Dec 2015 05:01:20 -0800 (PST)
Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([110.172.16.5])
 by smtp.gmail.com with ESMTPSA id 9sm42506405pfn.51.2015.12.14.05.01.18
 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Mon, 14 Dec 2015 05:01:19 -0800 (PST)
From: Santosh Shukla <sshukla@mvista.com>
To: dev@dpdk.org
Date: Mon, 14 Dec 2015 18:30:31 +0530
Message-Id: <1450098032-21198-13-git-send-email-sshukla@mvista.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <1450098032-21198-1-git-send-email-sshukla@mvista.com>
References: <1450098032-21198-1-git-send-email-sshukla@mvista.com>
Subject: [dpdk-dev] [ [PATCH v2] 12/13] virtio_ethdev: use virtio_ioport api
	at device init/close
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 14 Dec 2015 13:01:21 -0000

Call virtio_ioport_init at device init and virtio_ioport_unmap at device close.

Signed-off-by: Santosh Shukla <sshukla@mvista.com>
---
 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