summaryrefslogtreecommitdiff
path: root/drivers/net/enic
diff options
context:
space:
mode:
authorHyong Youb Kim <hyonkim@cisco.com>2018-12-10 10:28:53 -0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-12-13 17:50:26 +0000
commit7f34bb52028fdfc4ac97a7d828476b93a9a5a3e1 (patch)
tree482227c57c16f5ff2a3ad0a8972038575ee9f791 /drivers/net/enic
parent46df488b270a81a9353cac9374b8c338fcf7dfeb (diff)
downloaddpdk-next-eventdev-7f34bb52028fdfc4ac97a7d828476b93a9a5a3e1.zip
dpdk-next-eventdev-7f34bb52028fdfc4ac97a7d828476b93a9a5a3e1.tar.gz
dpdk-next-eventdev-7f34bb52028fdfc4ac97a7d828476b93a9a5a3e1.tar.xz
net/enic: release port upon close
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so rte_eth_dev_close() can later free port resources including mac_addrs. Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com> Reviewed-by: John Daley <johndale@cisco.com>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r--drivers/net/enic/enic_ethdev.c2
-rw-r--r--drivers/net/enic/enic_main.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 996bb55..ed8dda5 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -1048,6 +1048,8 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)
eth_dev->rx_pkt_burst = &enic_recv_pkts;
eth_dev->tx_pkt_burst = &enic_xmit_pkts;
eth_dev->tx_pkt_prepare = &enic_prep_pkts;
+ /* Let rte_eth_dev_close() release the port resources */
+ eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
pdev = RTE_ETH_DEV_TO_PCI(eth_dev);
rte_eth_copy_pci_info(eth_dev, pdev);
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index c3869de..f457173 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1379,12 +1379,10 @@ int enic_get_link_status(struct enic *enic)
static void enic_dev_deinit(struct enic *enic)
{
- struct rte_eth_dev *eth_dev = enic->rte_dev;
-
/* stop link status checking */
vnic_dev_notify_unset(enic->vdev);
- rte_free(eth_dev->data->mac_addrs);
+ /* mac_addrs is freed by rte_eth_dev_release_port() */
rte_free(enic->cq);
rte_free(enic->intr);
rte_free(enic->rq);