From mboxrd@z Thu Jan 1 00:00:00 1970 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 DA068C424 for ; Thu, 28 Jan 2016 10:34:06 +0100 (CET) Received: by mail-pf0-f173.google.com with SMTP id 65so20868987pfd.2 for ; Thu, 28 Jan 2016 01:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=lRKC5JX3LJ4r4xdMIQf2y+HhYDSdsiNwCY+W/eOjn+0=; b=Ec7UL0ach3pVpUzQG4GLysjiOeevDpA6T8Zg2qbGU9sCRh051qLq4zItYTtBYthc2x EIf6ipbIPqOGpTKCN6ITDGIsBMx1hrrwzEUrXEeSmIgGcLDztCucdsHpBlhrzakMXbjM kawr+qU4D//YS3Hg3TilUu2sJ5B5Sm8xqAjIO2jtRD8KH96BoA6cXMfAsGPEblx94twd KeGFGC5srcnA5KvBqL4/BMSFjl8hA0847/KtI2Kaxj0A5nULfznQ5Q78Ou7uiQor+XCD 2gwxOHZMflkmYX9AJI97sVNHjbSreAMYqnvZ09c6bjjzFXHJZxEguEvKSpfJYcnhiTuy m4Tw== 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:in-reply-to:references; bh=lRKC5JX3LJ4r4xdMIQf2y+HhYDSdsiNwCY+W/eOjn+0=; b=OvA4YxGwtijARoXHF/gSDTD/Lhp6Hq+xE3RLBAmpGob9AgT1Z/L0bPITlMAXNvDK3U FeJNr0vLR7bnqC4ZNWjXvrJLqCYsV5gHgJmichF/tw+n9z32+x/UmgTgMbmIofin3OyN p3k9rKN7FZMnYSffkKPpC48DfJJKT4ZGCmllj4nbISB/01NMQrPoHRCWGLR1vSE3p3wK DpWmtTpXAl7JKVzd3A2B1UpzGeNjwWzt8V+s0D+2c3tzzBzsFta1I4IrjzDW9FD+tqOZ 0mOxo/9r2CWQJ70hQ7TAk7KTInOzvHU5ikBdyMBU/eRLgh9jrbykVGZ+F63e/WxENTTR k+SQ== X-Gm-Message-State: AG10YOTnsArSxO2aEuEIs9Q+cn9WC7hI5C/jZY7FiXeFEy8ymt8kxcq6bIr+dFlhXKQejA== X-Received: by 10.98.80.135 with SMTP id g7mr3079466pfj.132.1453973646341; Thu, 28 Jan 2016 01:34:06 -0800 (PST) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id o75sm14823582pfi.17.2016.01.28.01.34.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 01:34:05 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Thu, 28 Jan 2016 18:33:31 +0900 Message-Id: <1453973612-8599-3-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453973612-8599-1-git-send-email-mukawa@igel.co.jp> References: <1453973612-8599-1-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1453108389-21006-2-git-send-email-mukawa@igel.co.jp> References: <1453108389-21006-2-git-send-email-mukawa@igel.co.jp> Subject: [dpdk-dev] [PATCH v2 2/3] virtio: move rte_eal_pci_unmap_device() to virtio_pci.c X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 09:34:07 -0000 To abstract pci access method, the patch moves below function to "virtio_pci.c". - rte_eal_pci_unmap_device() Signed-off-by: Tetsuya Mukawa --- drivers/net/virtio/virtio_ethdev.c | 2 +- drivers/net/virtio/virtio_pci.c | 11 +++++++++++ drivers/net/virtio/virtio_pci.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index deb0382..37833a8 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1177,7 +1177,7 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) rte_intr_callback_unregister(&pci_dev->intr_handle, virtio_interrupt_handler, eth_dev); - rte_eal_pci_unmap_device(pci_dev); + vtpci_uninit(pci_dev, hw); PMD_INIT_LOG(DEBUG, "dev_uninit completed"); diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 1fca39f..3e6be8c 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -892,3 +892,14 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw) return 0; } + +void +vtpci_uninit(struct rte_pci_device *dev, struct virtio_hw *hw) +{ + hw->dev = NULL; + hw->vtpci_ops = NULL; + hw->use_msix = 0; + hw->io_base = 0; + hw->modern = 0; + rte_eal_pci_unmap_device(dev); +} diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 0544a07..17c7972 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -328,6 +328,7 @@ vtpci_with_feature(struct virtio_hw *hw, uint64_t bit) * Function declaration from virtio_pci.c */ int vtpci_init(struct rte_pci_device *, struct virtio_hw *); +void vtpci_uninit(struct rte_pci_device *dev, struct virtio_hw *); void vtpci_reset(struct virtio_hw *); void vtpci_reinit_complete(struct virtio_hw *); -- 2.1.4