From 7b53c036e6bf56623b8273018ff1c8cc62847857 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Mon, 25 Jul 2016 13:22:22 -0300 Subject: Imported Upstream version 16.07-rc4 Change-Id: Ic57f6a3726f2dbd1682223648d91310f45705327 Signed-off-by: Ricardo Salveti --- app/pdump/Makefile | 2 +- app/pdump/main.c | 67 +++++++++++++++++++++++++++++++++------------ app/proc_info/Makefile | 2 +- app/test/autotest_data.py | 4 +-- app/test/autotest_runner.py | 8 ++++-- app/test/test_mbuf.c | 2 +- app/test/test_mempool.c | 3 +- 7 files changed, 60 insertions(+), 28 deletions(-) (limited to 'app') diff --git a/app/pdump/Makefile b/app/pdump/Makefile index d85bb08e..536198fa 100644 --- a/app/pdump/Makefile +++ b/app/pdump/Makefile @@ -33,7 +33,7 @@ include $(RTE_SDK)/mk/rte.vars.mk ifeq ($(CONFIG_RTE_LIBRTE_PDUMP),y) -APP = dpdk_pdump +APP = dpdk-pdump CFLAGS += $(WERROR_FLAGS) diff --git a/app/pdump/main.c b/app/pdump/main.c index e0ff8bea..b76cfd0f 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -524,6 +524,26 @@ free_ring_data(struct rte_ring *ring, uint8_t vdev_id, pdump_rxtx(ring, vdev_id, stats); } +static void +cleanup_rings(void) +{ + int i; + struct pdump_tuples *pt; + + for (i = 0; i < num_tuples; i++) { + pt = &pdump_t[i]; + + if (pt->device_id) + free(pt->device_id); + + /* free the rings */ + if (pt->rx_ring) + rte_ring_free(pt->rx_ring); + if (pt->tx_ring) + rte_ring_free(pt->tx_ring); + } +} + static void cleanup_pdump_resources(void) { @@ -545,16 +565,8 @@ cleanup_pdump_resources(void) free_ring_data(pt->rx_ring, pt->rx_vdev_id, &pt->stats); if (pt->dir & RTE_PDUMP_FLAG_TX) free_ring_data(pt->tx_ring, pt->tx_vdev_id, &pt->stats); - - if (pt->device_id) - free(pt->device_id); - - /* free the rings */ - if (pt->rx_ring) - rte_ring_free(pt->rx_ring); - if (pt->tx_ring) - rte_ring_free(pt->tx_ring); } + cleanup_rings(); } static void @@ -630,10 +642,12 @@ create_mp_ring_vdev(void) MBUF_POOL_CACHE_SIZE, 0, pt->mbuf_data_size, rte_socket_id()); - if (mbuf_pool == NULL) + if (mbuf_pool == NULL) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "Mempool creation failed: %s\n", rte_strerror(rte_errno)); + } } pt->mp = mbuf_pool; @@ -643,19 +657,23 @@ create_mp_ring_vdev(void) snprintf(ring_name, SIZE, RX_RING, i); pt->rx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); - if (pt->rx_ring == NULL) + if (pt->rx_ring == NULL) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "%s:%s:%d\n", rte_strerror(rte_errno), __func__, __LINE__); + } /* create tx_ring */ snprintf(ring_name, SIZE, TX_RING, i); pt->tx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); - if (pt->tx_ring == NULL) + if (pt->tx_ring == NULL) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "%s:%s:%d\n", rte_strerror(rte_errno), __func__, __LINE__); + } /* create vdevs */ (pt->rx_vdev_stream_type == IFACE) ? @@ -663,10 +681,12 @@ create_mp_ring_vdev(void) pt->rx_dev) : snprintf(vdev_args, SIZE, VDEV_PCAP, RX_STR, i, pt->rx_dev); - if (rte_eth_dev_attach(vdev_args, &portid) < 0) + if (rte_eth_dev_attach(vdev_args, &portid) < 0) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "vdev creation failed:%s:%d\n", __func__, __LINE__); + } pt->rx_vdev_id = portid; /* configure vdev */ @@ -680,10 +700,13 @@ create_mp_ring_vdev(void) pt->tx_dev) : snprintf(vdev_args, SIZE, VDEV_PCAP, TX_STR, i, pt->tx_dev); - if (rte_eth_dev_attach(vdev_args, &portid) < 0) + if (rte_eth_dev_attach(vdev_args, + &portid) < 0) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "vdev creation failed:" "%s:%d\n", __func__, __LINE__); + } pt->tx_vdev_id = portid; /* configure vdev */ @@ -695,19 +718,23 @@ create_mp_ring_vdev(void) snprintf(ring_name, SIZE, RX_RING, i); pt->rx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); - if (pt->rx_ring == NULL) + if (pt->rx_ring == NULL) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno)); + } (pt->rx_vdev_stream_type == IFACE) ? snprintf(vdev_args, SIZE, VDEV_IFACE, RX_STR, i, pt->rx_dev) : snprintf(vdev_args, SIZE, VDEV_PCAP, RX_STR, i, pt->rx_dev); - if (rte_eth_dev_attach(vdev_args, &portid) < 0) + if (rte_eth_dev_attach(vdev_args, &portid) < 0) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "vdev creation failed:%s:%d\n", __func__, __LINE__); + } pt->rx_vdev_id = portid; /* configure vdev */ configure_vdev(pt->rx_vdev_id); @@ -717,18 +744,22 @@ create_mp_ring_vdev(void) snprintf(ring_name, SIZE, TX_RING, i); pt->tx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); - if (pt->tx_ring == NULL) + if (pt->tx_ring == NULL) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno)); + } (pt->tx_vdev_stream_type == IFACE) ? snprintf(vdev_args, SIZE, VDEV_IFACE, TX_STR, i, pt->tx_dev) : snprintf(vdev_args, SIZE, VDEV_PCAP, TX_STR, i, pt->tx_dev); - if (rte_eth_dev_attach(vdev_args, &portid) < 0) + if (rte_eth_dev_attach(vdev_args, &portid) < 0) { + cleanup_rings(); rte_exit(EXIT_FAILURE, "vdev creation failed\n"); + } pt->tx_vdev_id = portid; /* configure vdev */ diff --git a/app/proc_info/Makefile b/app/proc_info/Makefile index 33e058e4..e051e032 100644 --- a/app/proc_info/Makefile +++ b/app/proc_info/Makefile @@ -31,7 +31,7 @@ include $(RTE_SDK)/mk/rte.vars.mk -APP = dpdk_proc_info +APP = dpdk-procinfo CFLAGS += $(WERROR_FLAGS) diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py index c69705ed..defd46e8 100644 --- a/app/test/autotest_data.py +++ b/app/test/autotest_data.py @@ -158,7 +158,7 @@ parallel_test_group_list = [ }, { "Prefix": "group_3", - "Memory" : per_sockets(390), + "Memory" : per_sockets(512), "Tests" : [ { @@ -287,7 +287,7 @@ parallel_test_group_list = [ }, { "Prefix": "group_6", - "Memory" : per_sockets(128), + "Memory" : per_sockets(512), "Tests" : [ { diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py index bd99e19e..21d3be2c 100644 --- a/app/test/autotest_runner.py +++ b/app/test/autotest_runner.py @@ -107,8 +107,10 @@ def run_test_group(cmdline, test_group): # parse the binary for available test commands binary = cmdline.split()[0] - symbols = subprocess.check_output(['nm', binary]).decode('utf-8') - avail_cmds = re.findall('test_register_(\w+)', symbols) + stripped = 'not stripped' not in subprocess.check_output(['file', binary]) + if not stripped: + symbols = subprocess.check_output(['nm', binary]).decode('utf-8') + avail_cmds = re.findall('test_register_(\w+)', symbols) # run all tests in test group for test in test_group["Tests"]: @@ -129,7 +131,7 @@ def run_test_group(cmdline, test_group): print >>logfile, "\n%s %s\n" % ("-"*20, test["Name"]) # run test function associated with the test - if test["Command"] in avail_cmds: + if stripped or test["Command"] in avail_cmds: result = test["Func"](child, test["Command"]) else: result = (0, "Skipped [Not Available]") diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 684ad80f..c0823ea5 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -809,7 +809,7 @@ test_refcnt_mbuf(void) if (refcnt_mbuf_ring == NULL && (refcnt_mbuf_ring = rte_ring_create("refcnt_mbuf_ring", - REFCNT_RING_SIZE, SOCKET_ID_ANY, + rte_align32pow2(REFCNT_RING_SIZE), SOCKET_ID_ANY, RING_F_SP_ENQ)) == NULL) { printf("%s: cannot allocate " MAKE_STRING(refcnt_mbuf_ring) "\n", __func__); diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index 46ad6702..3b21cf76 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -506,7 +506,6 @@ test_mempool(void) { struct rte_mempool *mp_cache = NULL; struct rte_mempool *mp_nocache = NULL; - struct rte_mempool *mp_ext = NULL; struct rte_mempool *mp_stack = NULL; rte_atomic32_init(&synchro); @@ -605,7 +604,7 @@ test_mempool(void) err: rte_mempool_free(mp_nocache); rte_mempool_free(mp_cache); - rte_mempool_free(mp_ext); + rte_mempool_free(mp_stack); return -1; } -- cgit 1.2.3-korg