app/test: count tests skipped at setup
[dpdk.git] / app / test / test_efd_perf.c
index 2b8a8ea..d7f4d83 100644 (file)
@@ -1,36 +1,19 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2017 Intel Corporation
  */
 
+#include "test.h"
+
+#ifdef RTE_EXEC_ENV_WINDOWS
+static int
+test_efd_perf(void)
+{
+       printf("EFD not supported on Windows, skipping test\n");
+       return TEST_SKIPPED;
+}
+
+#else
+
 #include <stdio.h>
 #include <inttypes.h>
 
@@ -42,8 +25,6 @@
 #include <rte_memcpy.h>
 #include <rte_thash.h>
 
-#include "test.h"
-
 #define NUM_KEYSIZES 10
 #define NUM_SHUFFLES 10
 #define MAX_KEYSIZE 64
 #endif
 static unsigned int test_socket_id;
 
-static inline uint8_t efd_get_all_sockets_bitmask(void)
+static inline uint64_t efd_get_all_sockets_bitmask(void)
 {
-       uint8_t all_cpu_sockets_bitmask = 0;
+       uint64_t all_cpu_sockets_bitmask = 0;
        unsigned int i;
-       unsigned int next_lcore = rte_get_master_lcore();
+       unsigned int next_lcore = rte_get_main_lcore();
        const int val_true = 1, val_false = 0;
        for (i = 0; i < rte_lcore_count(); i++) {
                all_cpu_sockets_bitmask |= 1 << rte_lcore_to_socket_id(next_lcore);
@@ -100,13 +81,13 @@ static uint32_t hashtest_key_lens[] = {
 };
 
 /* Array to store number of cycles per operation */
-uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS];
+static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS];
 
 /* Array to store the data */
-efd_value_t data[KEYS_TO_ADD];
+static efd_value_t data[KEYS_TO_ADD];
 
 /* Array to store all input keys */
-uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];
+static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];
 
 /* Shuffle the keys that have been added, so lookups will be totally random */
 static void
@@ -411,4 +392,6 @@ test_efd_perf(void)
        return 0;
 }
 
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
 REGISTER_TEST_COMMAND(efd_perf_autotest, test_efd_perf);