test/threads: add unit test
[dpdk.git] / app / test / test_distributor_perf.c
index fdbeae6..ee43214 100644 (file)
 #include <rte_cycles.h>
 #include <rte_common.h>
 #include <rte_mbuf.h>
+
+#ifdef RTE_EXEC_ENV_WINDOWS
+static int
+test_distributor_perf(void)
+{
+       printf("distributor perf not supported on Windows, skipping test\n");
+       return TEST_SKIPPED;
+}
+
+#else
+
 #include <rte_distributor.h>
 #include <rte_pause.h>
 
@@ -108,7 +119,6 @@ static int
 handle_work(void *arg)
 {
        struct rte_distributor *d = arg;
-       unsigned int count = 0;
        unsigned int num = 0;
        int i;
        unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
@@ -120,11 +130,9 @@ handle_work(void *arg)
        num = rte_distributor_get_pkt(d, id, buf, buf, num);
        while (!quit) {
                worker_stats[id].handled_packets += num;
-               count += num;
                num = rte_distributor_get_pkt(d, id, buf, buf, num);
        }
        worker_stats[id].handled_packets += num;
-       count += num;
        rte_distributor_return_pkt(d, id, buf, num);
        return 0;
 }
@@ -267,4 +275,6 @@ test_distributor_perf(void)
        return 0;
 }
 
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
 REGISTER_TEST_COMMAND(distributor_perf_autotest, test_distributor_perf);