All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Thomas Monjalon <thomas@monjalon.net>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org
Subject: [dpdk-dev] [RFC v2 1/8] test/virtual_pmd: clean rings on close
Date: Fri, 16 Jul 2021 15:27:53 +0100	[thread overview]
Message-ID: <20210716142800.3853651-1-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20210617081449.2045195-1-ferruh.yigit@intel.com>

Not cleaning the rings prevents creating devices again, which breaks to
run some unit tests multiple times.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test/virtual_pmd.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 7036f401ed95..6098e633f35a 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -34,7 +34,7 @@ struct virtual_ethdev_queue {
 };
 
 static int
-virtual_ethdev_start_success(struct rte_eth_dev *eth_dev __rte_unused)
+virtual_ethdev_start_success(struct rte_eth_dev *eth_dev)
 {
 	eth_dev->data->dev_started = 1;
 
@@ -42,13 +42,13 @@ virtual_ethdev_start_success(struct rte_eth_dev *eth_dev __rte_unused)
 }
 
 static int
-virtual_ethdev_start_fail(struct rte_eth_dev *eth_dev __rte_unused)
+virtual_ethdev_start_fail(struct rte_eth_dev *eth_dev)
 {
 	eth_dev->data->dev_started = 0;
 
 	return -1;
 }
-static int  virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
+static int  virtual_ethdev_stop(struct rte_eth_dev *eth_dev)
 {
 	void *pkt = NULL;
 	struct virtual_ethdev_private *prv = eth_dev->data->dev_private;
@@ -65,8 +65,13 @@ static int  virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
 }
 
 static int
-virtual_ethdev_close(struct rte_eth_dev *dev __rte_unused)
+virtual_ethdev_close(struct rte_eth_dev *eth_dev)
 {
+	struct virtual_ethdev_private *prv = eth_dev->data->dev_private;
+
+	rte_ring_free(prv->rx_queue);
+	rte_ring_free(prv->tx_queue);
+
 	return 0;
 }
 
-- 
2.31.1


  parent reply	other threads:[~2021-07-16 14:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  8:14 [dpdk-dev] [RFC 1/4] test/virtual_pmd: enable getting device operations Ferruh Yigit
2021-06-17  8:14 ` [dpdk-dev] [RFC 2/4] test/virtual_pmd: clean rings on close Ferruh Yigit
2021-06-17  8:14 ` [dpdk-dev] [RFC 3/4] test/virtual_pmd: enable updating device flags Ferruh Yigit
2021-06-17  8:14 ` [dpdk-dev] [RFC 4/4] test: support ethdev Ferruh Yigit
2021-07-16 14:27 ` Ferruh Yigit [this message]
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 2/8] test/virtual_pmd: enable getting device operations Ferruh Yigit
2023-08-22 21:10     ` Stephen Hemminger
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 3/8] test/virtual_pmd: enable updating device flags Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 4/8] test/virtual_pmd: enable getting device data Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 5/8] test/virtual_pmd: support get queue info device ops Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 6/8] test/virtual_pmd: provide descriptor limit info Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 7/8] test/virtual_pmd: support queue start/stop Ferruh Yigit
2023-08-22 21:11     ` Stephen Hemminger
2021-07-16 14:28   ` [dpdk-dev] [RFC v2 8/8] test: support ethdev Ferruh Yigit
2023-08-22 21:14     ` Stephen Hemminger
2023-08-22 21:15   ` [dpdk-dev] [RFC v2 1/8] test/virtual_pmd: clean rings on close Stephen Hemminger

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=20210716142800.3853651-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.