DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hyong Youb Kim <hyonkim@cisco.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, John Daley <johndale@cisco.com>,
	Hyong Youb Kim <hyonkim@cisco.com>
Subject: [dpdk-dev] [PATCH 1/4] net/enic: release port upon close
Date: Mon, 10 Dec 2018 10:28:53 -0800	[thread overview]
Message-ID: <20181210182857.13043-2-hyonkim@cisco.com> (raw)
In-Reply-To: <20181210182857.13043-1-hyonkim@cisco.com>

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>
---
 drivers/net/enic/enic_ethdev.c | 2 ++
 drivers/net/enic/enic_main.c   | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 996bb5542..ed8dda568 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 c3869de36..f45717374 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);
-- 
2.16.2

  reply	other threads:[~2018-12-10 18:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 18:28 [dpdk-dev] [PATCH 0/4] net/enic: minor updates Hyong Youb Kim
2018-12-10 18:28 ` Hyong Youb Kim [this message]
2018-12-10 18:28 ` [dpdk-dev] [PATCH 2/4] net/enic: add handler to return firmware version string Hyong Youb Kim
2018-12-10 18:28 ` [dpdk-dev] [PATCH 3/4] net/enic: support multicast filtering Hyong Youb Kim
2019-01-11 15:46   ` Ferruh Yigit
2019-01-12  4:49     ` Hyong Youb Kim
2019-01-14 10:29       ` Ferruh Yigit
2018-12-10 18:28 ` [dpdk-dev] [PATCH 4/4] doc: update release notes for enic Hyong Youb Kim
2018-12-11  2:44   ` Varghese, Vipin
2018-12-11 16:08     ` Hyong Youb Kim
2018-12-11 16:31       ` Varghese, Vipin
2018-12-11 16:40         ` Hyong Youb Kim
2018-12-11 16:49           ` Varghese, Vipin
2018-12-11 17:25             ` Hyong Youb Kim
2018-12-12  2:23               ` Varghese, Vipin
2018-12-12 11:56 ` [dpdk-dev] [PATCH 0/4] net/enic: minor updates Ferruh Yigit

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=20181210182857.13043-2-hyonkim@cisco.com \
    --to=hyonkim@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=johndale@cisco.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).