From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by dpdk.org (Postfix) with ESMTP id 17D525A63 for ; Mon, 18 Jan 2016 10:13:30 +0100 (CET) Received: by mail-pa0-f44.google.com with SMTP id ho8so170353335pac.2 for ; Mon, 18 Jan 2016 01:13:30 -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; bh=Go/WrqC3ibNeYzFQnplGAonpTNLqeBzYoAuAZXANJeU=; b=FDTWvA5C7ATTl4wvddmhXDAAlfgeF/8lvLe8aExmuSl8yYdhkXexa2dV+XOUkVoEpm acj/xW1+HT9lXcTOtpe4XIv7yc/cYcZ39QNI+wZBtsbdINFkVM6qzUNugSaj68gbwIvn D8gX42iW9C9dwbG019Xtw63QZn9s+wMuZdaQg3O26Y7scVJBMpQpwrBboYvZjf9l7Th8 f2SeMONeepCNx3/ywjd/0LJ+gGEbtRBz7kR1eWI4XYNmTt9E9soFpJoyw/082tAv4KUT hFHKNKplIeZbLKf+xTY9XysVmByptriwLnH8nclDefxPVpRcmmoamd4IBiQEr94liZ3G 9ofA== 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=Go/WrqC3ibNeYzFQnplGAonpTNLqeBzYoAuAZXANJeU=; b=IbZMdNeAUQSRx35QGLAuNbQaE8ioG7SHp1NRRL/eZE/5Xe6dpNvaDGvKHSlrJjqlqi VY1HZhcKaL6ufuv+4YR6+GgxTfZAB6DpA80CUPHwu5WLpdvMWlQ71oEufC4iB2wtR7EN oBtrnzxkIBBd+96dl3j/GEQ8iAZsOS9VQJR4nA7N1mA0iVF39PMZdiNUZ8VNJLrtltbI fiD8Yui4UTqfVMonvAQxaoYyuh90of1n/UqbEczlwjDNGJoeMRZxpYzTAU9n0GQLYc/R SAPWX4wIAR/PGUYZQZ1DL1fJ43lhf2Dqc4kjA+g3TF62pMssp0ManYpo9/bA+LO1sTOR 8b2Q== X-Gm-Message-State: ALoCoQkd2MXwktQprDi0sNhyERcgd9PkG7NIeOhHZU2vnQ0vujKE+MrEVS2JJ7qIqhfhKRHr4dlf06ughiIdhbY/Arf3yEcLaw== X-Received: by 10.66.100.198 with SMTP id fa6mr35275656pab.123.1453108409528; Mon, 18 Jan 2016 01:13:29 -0800 (PST) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id g10sm32278308pfd.49.2016.01.18.01.13.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jan 2016 01:13:29 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Mon, 18 Jan 2016 18:13:08 +0900 Message-Id: <1453108389-21006-3-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453108389-21006-1-git-send-email-mukawa@igel.co.jp> References: <1453108389-21006-1-git-send-email-mukawa@igel.co.jp> Subject: [dpdk-dev] [PATCH 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: Mon, 18 Jan 2016 09:13:30 -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..b98d195 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(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 f1a6ee9..ffcd2fa 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -872,3 +872,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 99572a0..ec1d46b 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