DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Ed Czeck <ed.czeck@atomicrules.com>
To: dev@dpdk.org, ferruh.yigit@intel.com
Cc: shepard.siegel@atomicrules.com, john.miller@atomicrules.com,
	Ed Czeck <ed.czeck@atomicrules.com>
Subject: [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close
Date: Fri, 19 Jul 2019 09:07:43 -0400
Message-ID: <1563541663-10797-2-git-send-email-ed.czeck@atomicrules.com> (raw)
In-Reply-To: <1563541663-10797-1-git-send-email-ed.czeck@atomicrules.com>

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources
for the port can be freed by rte_eth_dev_close()

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
 drivers/net/ark/ark_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 86e500e..3435728 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -261,6 +261,8 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
 	/* Use dummy function until setup */
 	dev->rx_pkt_burst = &eth_ark_recv_pkts_noop;
 	dev->tx_pkt_burst = &eth_ark_xmit_pkts_noop;
+	/* Let rte_eth_dev_close() release the port resources */
+	dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
 	ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
 	ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
@@ -706,6 +708,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
 		eth_ark_dev_rx_queue_release(dev->data->rx_queues[i]);
 		dev->data->rx_queues[i] = 0;
 	}
+
+	rte_free(dev->data->mac_addrs);
+	dev->data->mac_addrs = 0;
 }
 
 static void
-- 
2.7.4


  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 21:34 [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ed Czeck
2019-07-16 21:34 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-17 17:33 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
2019-07-19 13:07 ` Ed Czeck
2019-07-19 13:07   ` Ed Czeck [this message]
2019-07-19 17:27   ` Ferruh Yigit
2019-07-22 12:35 ` Ed Czeck
2019-07-22 12:35   ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-22 16:07   ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit

Reply instructions:

You may reply publically 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=1563541663-10797-2-git-send-email-ed.czeck@atomicrules.com \
    --to=ed.czeck@atomicrules.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.miller@atomicrules.com \
    --cc=shepard.siegel@atomicrules.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

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox