X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_table.c;h=676dab23dc3171a2b78c1d911d8c06f74775949f;hb=98dd7ad4da568279811883b6434f67ef4ef67ed3;hp=7e2e781d5c756b59b16c9982116916af58c3a8be;hpb=5205954791cb96244904f2c904a75d29a9bbf31b;p=dpdk.git diff --git a/app/test/test_table.c b/app/test/test_table.c index 7e2e781d5c..676dab23dc 100644 --- a/app/test/test_table.c +++ b/app/test/test_table.c @@ -31,19 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifndef RTE_LIBRTE_TABLE - -#include "test.h" - -int -test_table(void) -{ - return 0; -} - -#else - #include #include #include @@ -102,15 +89,10 @@ app_init_mbuf_pools(void) printf("Getting/Creating the mempool ...\n"); pool = rte_mempool_lookup("mempool"); if (!pool) { - pool = rte_mempool_create( + pool = rte_pktmbuf_pool_create( "mempool", POOL_SIZE, - POOL_BUFFER_SIZE, - POOL_CACHE_SIZE, - sizeof(struct rte_pktmbuf_pool_private), - rte_pktmbuf_pool_init, NULL, - rte_pktmbuf_init, NULL, - 0, + POOL_CACHE_SIZE, 0, POOL_BUFFER_SIZE, 0); if (pool == NULL) rte_panic("Cannot create mbuf pool\n"); @@ -125,7 +107,7 @@ app_init_rings(void) for (i = 0; i < N_PORTS; i++) { char name[32]; - rte_snprintf(name, sizeof(name), "app_ring_rx_%u", i); + snprintf(name, sizeof(name), "app_ring_rx_%u", i); rings_rx[i] = rte_ring_lookup(name); if (rings_rx[i] == NULL) { rings_rx[i] = rte_ring_create( @@ -141,7 +123,7 @@ app_init_rings(void) for (i = 0; i < N_PORTS; i++) { char name[32]; - rte_snprintf(name, sizeof(name), "app_ring_tx_%u", i); + snprintf(name, sizeof(name), "app_ring_tx_%u", i); rings_tx[i] = rte_ring_lookup(name); if (rings_tx[i] == NULL) { rings_tx[i] = rte_ring_create( @@ -156,7 +138,7 @@ app_init_rings(void) } -int +static int test_table(void) { int status, failures; @@ -210,11 +192,15 @@ test_table(void) #ifdef RTE_LIBRTE_ACL printf("\n\n\n\n************ACL tests************\n"); - if (test_table_ACL() < 0) + if (test_table_acl() < 0) return -1; #endif return 0; } -#endif +static struct test_command table_cmd = { + .command = "table_autotest", + .callback = test_table, +}; +REGISTER_TEST_COMMAND(table_cmd);