X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_table.c;h=de6c27dc659b85df3c0875cce025524a7a91025a;hb=ea0c20ea95fd5d71a10757e6598ac66233ea1495;hp=7e2e781d5c756b59b16c9982116916af58c3a8be;hpb=5205954791cb96244904f2c904a75d29a9bbf31b;p=dpdk.git diff --git a/app/test/test_table.c b/app/test/test_table.c index 7e2e781d5c..de6c27dc65 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; @@ -217,4 +199,8 @@ test_table(void) return 0; } -#endif +static struct test_command table_cmd = { + .command = "table_autotest", + .callback = test_table, +}; +REGISTER_TEST_COMMAND(table_cmd);