Skip to content

Commit

Permalink
net/virtio: unmap port IO for legacy device
Browse files Browse the repository at this point in the history
[ upstream commit 535f8a1 ]

For legacy devices, we should also unmap the port IO
resource on device removal.

Fixes: b8f0452 ("virtio: use PCI ioport API")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
Tiwei Bie authored and kevintraynor committed Jun 24, 2019
1 parent 5f34f2e commit 635ccd4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/virtio/virtio_ethdev.c
Expand Up @@ -1716,6 +1716,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)
Expand All @@ -1728,8 +1730,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");

Expand Down

0 comments on commit 635ccd4

Please sign in to comment.