From: Tiwei Bie <tiwei.bie@intel.com>
To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/5] net/virtio: unmap port IO for legacy device
Date: Wed, 5 Jun 2019 17:43:39 +0800 [thread overview]
Message-ID: <20190605094342.17563-3-tiwei.bie@intel.com> (raw)
In-Reply-To: <20190605094342.17563-1-tiwei.bie@intel.com>
For legacy devices, we should also unmap the port IO
resource on device removal.
Fixes: b8f04520ad71 ("virtio: use PCI ioport API")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
drivers/net/virtio/virtio_ethdev.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index df3a218a8..a2cedcc87 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1876,6 +1876,8 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
static int
eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
{
+ struct virtio_hw *hw = eth_dev->data->dev_private;
+
PMD_INIT_FUNC_TRACE();
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
@@ -1888,8 +1890,11 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
eth_dev->tx_pkt_burst = NULL;
eth_dev->rx_pkt_burst = NULL;
- if (eth_dev->device)
+ if (eth_dev->device) {
rte_pci_unmap_device(RTE_ETH_DEV_TO_PCI(eth_dev));
+ if (!hw->modern)
+ rte_pci_ioport_unmap(VTPCI_IO(hw));
+ }
PMD_INIT_LOG(DEBUG, "dev_uninit completed");
--
2.17.1
next prev parent reply other threads:[~2019-06-05 9:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 9:43 [dpdk-dev] [PATCH 0/5] virtio: release port upon close Tiwei Bie
2019-06-05 9:43 ` [dpdk-dev] [PATCH 1/5] net/virtio: fix queue memory leak on error Tiwei Bie
2019-06-05 12:35 ` Maxime Coquelin
2019-06-05 9:43 ` Tiwei Bie [this message]
2019-06-05 14:31 ` [dpdk-dev] [PATCH 2/5] net/virtio: unmap port IO for legacy device Maxime Coquelin
2019-06-05 9:43 ` [dpdk-dev] [PATCH 3/5] net/virtio: unmap device on initialization error Tiwei Bie
2019-06-05 14:33 ` Maxime Coquelin
2019-06-05 9:43 ` [dpdk-dev] [PATCH 4/5] net/virtio: release port upon close Tiwei Bie
2019-06-17 14:42 ` Maxime Coquelin
2019-06-05 9:43 ` [dpdk-dev] [PATCH 5/5] app/testpmd: drop the workaround for virtio-user Tiwei Bie
2019-06-17 14:44 ` Maxime Coquelin
2019-06-20 9:59 ` [dpdk-dev] [PATCH 0/5] virtio: release port upon close Maxime Coquelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190605094342.17563-3-tiwei.bie@intel.com \
--to=tiwei.bie@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=zhihong.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).