From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 651C81B52A for ; Fri, 19 Oct 2018 13:00:54 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7057C80D; Fri, 19 Oct 2018 04:00:53 -0700 (PDT) Received: from phil-VirtualBox.shanghai.arm.com (unknown [10.169.107.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DA3763F71D; Fri, 19 Oct 2018 04:00:52 -0700 (PDT) From: Phil Yang To: dev@dpdk.org Cc: nd@arm.com Date: Fri, 19 Oct 2018 19:00:38 +0800 Message-Id: <1539946839-12996-1-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH 1/2] test/pmd_ring_perf: release ring resources after test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2018 11:00:54 -0000 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 Reviewed-by: Gavin Hu --- 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 #include #include +#include #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