DPDK patches and discussions
 help / color / mirror / Atom feed
From: Phil Yang <phil.yang@arm.com>
To: dev@dpdk.org
Cc: nd@arm.com
Subject: [dpdk-dev] [PATCH 1/2] test/pmd_ring_perf: release ring resources after test
Date: Fri, 19 Oct 2018 19:00:38 +0800	[thread overview]
Message-ID: <1539946839-12996-1-git-send-email-phil.yang@arm.com> (raw)

Need to release the port and the ring resources after test. Otherwise,
it will cause failure to allocate memory when reentry the test.

Fixes: ea764af ("app/test: add performance test for ring driver")

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
 test/test/test_pmd_ring_perf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/test/test_pmd_ring_perf.c b/test/test/test_pmd_ring_perf.c
index ad5004a..6318da1 100644
--- a/test/test/test_pmd_ring_perf.c
+++ b/test/test/test_pmd_ring_perf.c
@@ -10,6 +10,7 @@
 #include <rte_launch.h>
 #include <rte_ethdev.h>
 #include <rte_eth_ring.h>
+#include <rte_bus_vdev.h>
 
 #include "test.h"
 
@@ -135,6 +136,8 @@ test_bulk_enqueue_dequeue(void)
 static int
 test_ring_pmd_perf(void)
 {
+	char name[RTE_ETH_NAME_MAX_LEN];
+
 	r = rte_ring_create(RING_NAME, RING_SIZE, rte_socket_id(),
 			RING_F_SP_ENQ|RING_F_SC_DEQ);
 	if (r == NULL && (r = rte_ring_lookup(RING_NAME)) == NULL)
@@ -151,6 +154,11 @@ test_ring_pmd_perf(void)
 	printf("\n### Testing using a single lcore ###\n");
 	test_bulk_enqueue_dequeue();
 
+	/* release port and ring resources */
+	rte_eth_dev_stop(ring_ethdev_port);
+	rte_eth_dev_get_name_by_port(ring_ethdev_port, name);
+	rte_vdev_uninit(name);
+	rte_ring_free(r);
 	return 0;
 }
 
-- 
2.7.4

             reply	other threads:[~2018-10-19 11:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 11:00 Phil Yang [this message]
2018-10-19 11:00 ` [dpdk-dev] [PATCH 2/2] test/pmd_ring: " Phil Yang
2018-10-19 11:12   ` [dpdk-dev] [PATCH v2] " Phil Yang
2018-10-30  0:42     ` Phil Yang (Arm Technology China)
2018-11-18 22:21 ` [dpdk-dev] [PATCH 1/2] test/pmd_ring_perf: " Thomas Monjalon
2018-11-19  1:42   ` Phil Yang (Arm Technology China)

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=1539946839-12996-1-git-send-email-phil.yang@arm.com \
    --to=phil.yang@arm.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.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).