test: release ring resources after PMD perf test

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")
Cc: stable@dpdk.org

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
This commit is contained in:
Phil Yang 2018-10-19 19:00:38 +08:00 committed by Thomas Monjalon
parent f88bb9a674
commit bc44d44847

View File

@ -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;
}