app/test: rework command registration
[dpdk.git] / app / test / test_sched.c
index 60c62de..63ab084 100644 (file)
 #include <rte_sched.h>
 
 
-#define SUBPORT        0
-#define PIPE           1
-#define TC                     2
-#define QUEUE          3
+#define SUBPORT         0
+#define PIPE            1
+#define TC              2
+#define QUEUE           3
 
 static struct rte_sched_subport_params subport_param[] = {
        {
@@ -86,10 +86,8 @@ static struct rte_sched_port_params port_param = {
 };
 
 #define NB_MBUF          32
-#define MAX_PACKET_SZ    2048
-#define MBUF_SZ (MAX_PACKET_SZ + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
-#define PKT_BURST_SZ     32
-#define MEMPOOL_CACHE_SZ PKT_BURST_SZ
+#define MBUF_DATA_SZ     (2048 + RTE_PKTMBUF_HEADROOM)
+#define MEMPOOL_CACHE_SZ 0
 #define SOCKET           0
 
 
@@ -100,17 +98,8 @@ create_mempool(void)
 
        mp = rte_mempool_lookup("test_sched");
        if (!mp)
-               mp = rte_mempool_create("test_sched",
-                               NB_MBUF,
-                               MBUF_SZ,
-                               MEMPOOL_CACHE_SZ,
-                               sizeof(struct rte_pktmbuf_pool_private),
-                               rte_pktmbuf_pool_init,
-                               NULL,
-                               rte_pktmbuf_init,
-                               NULL,
-                               SOCKET,
-                               0);
+               mp = rte_pktmbuf_pool_create("test_sched", NB_MBUF,
+                       MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, SOCKET);
 
        return mp;
 }
@@ -224,8 +213,4 @@ test_sched(void)
        return 0;
 }
 
-static struct test_command sched_cmd = {
-       .command = "sched_autotest",
-       .callback = test_sched,
-};
-REGISTER_TEST_COMMAND(sched_cmd);
+REGISTER_TEST_COMMAND(sched_autotest, test_sched);