mbuf: remove the rte_pktmbuf structure
[dpdk.git] / app / test / test_distributor_perf.c
index 1031baa..b04864c 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "test.h"
 
-#ifdef RTE_LIBRTE_DISTRIBUTOR
 #include <unistd.h>
 #include <string.h>
 #include <rte_cycles.h>
@@ -160,7 +159,7 @@ perf_test(struct rte_distributor *d, struct rte_mempool *p)
        }
        /* ensure we have different hash value for each pkt */
        for (i = 0; i < BURST; i++)
-               bufs[i]->pkt.hash.rss = i;
+               bufs[i]->hash.rss = i;
 
        start = rte_rdtsc();
        for (i = 0; i < (1<<ITER_POWER); i++)
@@ -199,7 +198,7 @@ quit_workers(struct rte_distributor *d, struct rte_mempool *p)
 
        quit = 1;
        for (i = 0; i < num_workers; i++)
-               bufs[i]->pkt.hash.rss = i << 1;
+               bufs[i]->hash.rss = i << 1;
        rte_distributor_process(d, bufs, num_workers);
 
        rte_mempool_put_bulk(p, (void *)bufs, num_workers);
@@ -212,7 +211,7 @@ quit_workers(struct rte_distributor *d, struct rte_mempool *p)
 
 #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
 
-int
+static int
 test_distributor_perf(void)
 {
        static struct rte_distributor *d;
@@ -261,15 +260,8 @@ test_distributor_perf(void)
        return 0;
 }
 
-#else
-
-#include <stdio.h>
-
-int
-test_distributor_perf(void)
-{
-       printf("Distributor is not enabled in configuration\n");
-       return 0;
-}
-
-#endif
+static struct test_command distributor_perf_cmd = {
+       .command = "distributor_perf_autotest",
+       .callback = test_distributor_perf,
+};
+REGISTER_TEST_COMMAND(distributor_perf_cmd);