From patchwork Tue Oct 26 02:45:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102818 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED483A0C47; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DFFC40A4B; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3DFAB40A4B for ; Tue, 26 Oct 2021 04:46:06 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 7B8A920A2361; Mon, 25 Oct 2021 19:46:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7B8A920A2361 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216365; bh=RYRFSl0eXA1lw9V/p/npn21OhvTol5apv1Inw601kSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bvQ9jB7u0CQ+pgsSCJuKgHEajvsvhWA5uueFN/8xdTQO22V4kIz4Q4OdWQ9IO0dHe Yycc0LGxtnde5DYZAnnTTtZ7oyy1qQVhbUK0BtCCsswGcHnuxqUhu6lpbGA3hMZHOL cYo8I43+CmPgBZTIgDXIR8u8TGD3xab2LkLtK7Sw= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:51 -0700 Message-Id: <1635216361-23641-2-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 01/11] eal/windows: return ENOTSUP for not supported API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" UT memory_autotest on Windows has 2 failed cases on eal APIs eal_memalloc_get_seg_fd and eal_memalloc_get_seg_fd_offset. These 2 APIs are not supported on Windows yet. Should return ENOTSUP such that in test_memory.c these 2 ENOTSUP cases will not be marked as failures, same as other ENOTSUP cases. Signed-off-by: Jie Zhou Acked-by: Dmitry Kozlyuk --- lib/eal/windows/eal_memalloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/windows/eal_memalloc.c b/lib/eal/windows/eal_memalloc.c index 55d6dcc71c..aa7589b81d 100644 --- a/lib/eal/windows/eal_memalloc.c +++ b/lib/eal/windows/eal_memalloc.c @@ -17,7 +17,7 @@ eal_memalloc_get_seg_fd(int list_idx, int seg_idx) RTE_SET_USED(list_idx); RTE_SET_USED(seg_idx); EAL_LOG_NOT_IMPLEMENTED(); - return -1; + return -ENOTSUP; } int @@ -28,7 +28,7 @@ eal_memalloc_get_seg_fd_offset(int list_idx, int seg_idx, size_t *offset) RTE_SET_USED(seg_idx); RTE_SET_USED(offset); EAL_LOG_NOT_IMPLEMENTED(); - return -1; + return -ENOTSUP; } static int @@ -428,7 +428,7 @@ eal_memalloc_sync_with_primary(void) { /* No multi-process support. */ EAL_LOG_NOT_IMPLEMENTED(); - return -1; + return -ENOTSUP; } int From patchwork Tue Oct 26 02:45:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102820 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B4EEA0C47; Tue, 26 Oct 2021 04:46:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A642B41162; Tue, 26 Oct 2021 04:46:09 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 47B5B40E0F for ; Tue, 26 Oct 2021 04:46:06 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 9157820A3E11; Mon, 25 Oct 2021 19:46:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9157820A3E11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216365; bh=19VO4TlZEiQT+HcejoTOL2u6CXecZ8UnC4T8s9bIglE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P47jwKXtkeqPI64ga0kj+32umXcTm0SCHGrmQymhIztKUjg8lPg+/1P0+yiCoK7qr jyvZB5pKYOtphMZsqLvJ+oA12rH5u4wgfCtqONVAYc6oPxcpcQ7N1WAAWs3byEh+Gg 26xhtyubcg4jaEWQmGfghPGzGqH8VZb3i5VHCM+k= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:52 -0700 Message-Id: <1635216361-23641-3-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 02/11] app/test: remove unnecessary headers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove unnecessary header inclusion Signed-off-by: Jie Zhou --- app/test/commands.c | 2 -- app/test/test.c | 1 - app/test/test_cmdline_lib.c | 1 - 3 files changed, 4 deletions(-) diff --git a/app/test/commands.c b/app/test/commands.c index 76f6ee5d23..82bd8bf474 100644 --- a/app/test/commands.c +++ b/app/test/commands.c @@ -8,8 +8,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/app/test/test.c b/app/test/test.c index 5194131026..8b698656bf 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c index f238094b07..4715edc341 100644 --- a/app/test/test_cmdline_lib.c +++ b/app/test/test_cmdline_lib.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include From patchwork Tue Oct 26 02:45:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102822 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 337EEA0C47; Tue, 26 Oct 2021 04:46:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC4024117B; Tue, 26 Oct 2021 04:46:11 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 626AD40E3C for ; Tue, 26 Oct 2021 04:46:06 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id A769620A5044; Mon, 25 Oct 2021 19:46:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A769620A5044 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216365; bh=Q5WztECvlsXuzKDWd4LmjniTj9iQsQAjPHdi+/KlJD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OgLh0BPo9bKxCzh+rM69Ys9q/cspTv2TmO15kWisqlLWZf/rskkXRV0vWRTkLWoIN a6E2DRfVoBdk5fSGn7E/cZWQBWzj6F4NsUufi4WinsVctzefQkkMGmwBLoTeycGfxs 0vfO15t6KffWq/ljJkiR4uPgDHNH1GzKpXNhe9ss= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:53 -0700 Message-Id: <1635216361-23641-4-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 03/11] app/test: replace POSIX specific code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" - Include rte_os_shim.h - Replace sleep and usleep with rte_delay_us_sleep - #ifndef RTE_EXEC_ENV_WINDOWS for POSIX code only Signed-off-by: Jie Zhou --- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +++- app/test/test.c | 4 ++++ app/test/test_byteorder.c | 2 +- app/test/test_cmdline.c | 2 ++ app/test/test_crc.c | 1 - app/test/test_mp_secondary.c | 2 ++ app/test/test_pmd_perf.c | 6 +++++- app/test/test_ring_stress.c | 3 ++- app/test/test_ring_stress_impl.h | 2 +- app/test/test_telemetry_data.c | 2 ++ 11 files changed, 23 insertions(+), 6 deletions(-) diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c index 8ac24577ba..6b42b9b83b 100644 --- a/app/test/packet_burst_generator.c +++ b/app/test/packet_burst_generator.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "packet_burst_generator.h" diff --git a/app/test/process.h b/app/test/process.h index 5b10cf64df..1f073b9c5c 100644 --- a/app/test/process.h +++ b/app/test/process.h @@ -7,12 +7,14 @@ #include /* errno */ #include /* PATH_MAX */ +#ifndef RTE_EXEC_ENV_WINDOWS #include /* basename et al */ +#include +#endif #include /* NULL */ #include /* strerror */ #include /* readlink */ #include -#include #include /* strlcpy */ diff --git a/app/test/test.c b/app/test/test.c index 8b698656bf..e69cae3eea 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -62,7 +62,9 @@ do_recursive_call(void) const char *env_var; int (*action_fn)(void); } actions[] = { +#ifndef RTE_EXEC_ENV_WINDOWS { "run_secondary_instances", test_mp_secondary }, +#endif #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING { "run_pdump_server_tests", test_pdump }, @@ -81,7 +83,9 @@ do_recursive_call(void) { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, #ifdef RTE_LIB_TIMER +#ifndef RTE_EXEC_ENV_WINDOWS { "timer_secondary_spawn_wait", test_timer_secondary }, +#endif #endif }; diff --git a/app/test/test_byteorder.c b/app/test/test_byteorder.c index 03c08d9abf..de14ed539e 100644 --- a/app/test/test_byteorder.c +++ b/app/test/test_byteorder.c @@ -46,7 +46,7 @@ test_byteorder(void) return -1; res_u16 = rte_bswap16(0x1337); - printf("const %"PRIx16" -> %"PRIx16"\n", 0x1337, res_u16); + printf("const %"PRIx16" -> %"PRIx16"\n", (uint16_t)0x1337, res_u16); if (res_u16 != 0x3713) return -1; diff --git a/app/test/test_cmdline.c b/app/test/test_cmdline.c index 115bee966d..9a76bd299f 100644 --- a/app/test/test_cmdline.c +++ b/app/test/test_cmdline.c @@ -31,6 +31,7 @@ test_cmdline(void) return -1; if (test_parse_num_invalid_param() < 0) return -1; +#ifndef RTE_EXEC_ENV_WINDOWS printf("Testing parsing IP addresses...\n"); if (test_parse_ipaddr_valid() < 0) return -1; @@ -38,6 +39,7 @@ test_cmdline(void) return -1; if (test_parse_ipaddr_invalid_param() < 0) return -1; +#endif printf("Testing parsing strings...\n"); if (test_parse_string_valid() < 0) return -1; diff --git a/app/test/test_crc.c b/app/test/test_crc.c index bf1d344359..0ed080e482 100644 --- a/app/test/test_crc.c +++ b/app/test/test_crc.c @@ -14,7 +14,6 @@ #define CRC32_VEC_LEN2 348 #define CRC16_VEC_LEN1 12 #define CRC16_VEC_LEN2 2 -#define LINE_LEN 75 /* CRC test vector */ static const uint8_t crc_vec[CRC_VEC_LEN] = { diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c index 5b6f05dbb1..da035348bd 100644 --- a/app/test/test_mp_secondary.c +++ b/app/test/test_mp_secondary.c @@ -14,7 +14,9 @@ #include #include #include +#ifndef RTE_EXEC_ENV_WINDOWS #include +#endif #include #include #include diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index 1df86ce080..b5e5a93a52 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -297,6 +297,7 @@ reset_count(void) idle = 0; } +#ifndef RTE_EXEC_ENV_WINDOWS static void stats_display(uint16_t port_id) { @@ -326,6 +327,7 @@ signal_handler(int signum) if (signum == SIGUSR2) stats_display(0); } +#endif struct rte_mbuf **tx_burst; @@ -637,7 +639,7 @@ exec_burst(uint32_t flags, int lcore) i = (i >= conf->nb_ports - 1) ? 0 : (i + 1); } - sleep(5); + rte_delay_us(5 * US_PER_S); /* only when polling second */ if (flags == SC_BURST_XMIT_FIRST) @@ -668,8 +670,10 @@ test_pmd_perf(void) printf("Start PMD RXTX cycles cost test.\n"); +#ifndef RTE_EXEC_ENV_WINDOWS signal(SIGUSR1, signal_handler); signal(SIGUSR2, signal_handler); +#endif nb_ports = rte_eth_dev_count_avail(); if (nb_ports < NB_ETHPORTS_USED) { diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c index 1af45e0fc8..ce3535c6b2 100644 --- a/app/test/test_ring_stress.c +++ b/app/test/test_ring_stress.c @@ -43,9 +43,10 @@ test_ring_stress(void) n += test_ring_rts_stress.nb_case; k += run_test(&test_ring_rts_stress); +#ifndef RTE_EXEC_ENV_WINDOWS n += test_ring_hts_stress.nb_case; k += run_test(&test_ring_hts_stress); - +#endif n += test_ring_mt_peek_stress.nb_case; k += run_test(&test_ring_mt_peek_stress); diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h index 2825a9dce6..62f046a91a 100644 --- a/app/test/test_ring_stress_impl.h +++ b/app/test/test_ring_stress_impl.h @@ -360,7 +360,7 @@ test_mt1(int (*test)(void *)) /* signal worker to start test */ __atomic_store_n(&wrk_cmd, WRK_CMD_RUN, __ATOMIC_RELEASE); - usleep(run_time * US_PER_S); + rte_delay_us(run_time * US_PER_S); /* signal worker to start test */ __atomic_store_n(&wrk_cmd, WRK_CMD_STOP, __ATOMIC_RELEASE); diff --git a/app/test/test_telemetry_data.c b/app/test/test_telemetry_data.c index 18b93db8ef..73eee293a1 100644 --- a/app/test/test_telemetry_data.c +++ b/app/test/test_telemetry_data.c @@ -4,7 +4,9 @@ #include #include +#ifndef RTE_EXEC_ENV_WINDOWS #include +#endif #include #include From patchwork Tue Oct 26 02:45:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102821 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3615BA0C47; Tue, 26 Oct 2021 04:46:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C19834116C; Tue, 26 Oct 2021 04:46:10 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 68EEF410DB for ; Tue, 26 Oct 2021 04:46:06 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id BCF1A20A5046; Mon, 25 Oct 2021 19:46:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BCF1A20A5046 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216365; bh=pepWjjVIbE2tSGy72zZCgpSt9v1VtfzH7pXoS5SfXBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OnWK0CNzKpHc7hsZR1ODbt0MvjjdnZRbSj0eksUQbgY48l74c6567K9ugcDQRVLVS xjrhs8p/ifXlVw5DsU8Li8Dd8BbJeg5ZBiy9iije1uCJovWF3fol7t4rJAbLBvyKel W+xmr5/gfFM01T6+TSUlq80S2dVUSyxOh5N4JWEU= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:54 -0700 Message-Id: <1635216361-23641-5-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 04/11] app/test: exclude ENOTSUP as failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Check rte_errno to exclude ENOTSUP as failures in test_memory.c Signed-off-by: Jie Zhou --- app/test/test_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test/test_memory.c b/app/test/test_memory.c index dbf6871e71..379b0f99ca 100644 --- a/app/test/test_memory.c +++ b/app/test/test_memory.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "test.h" @@ -63,7 +64,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms, /* we're able to get memseg fd - try getting its offset */ ret = rte_memseg_get_fd_offset_thread_unsafe(ms, &offset); if (ret < 0) { - if (errno == ENOTSUP) + if (rte_errno == ENOTSUP) return 1; return -1; } From patchwork Tue Oct 26 02:45:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102825 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79E24A0C47; Tue, 26 Oct 2021 04:46:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 331FC41190; Tue, 26 Oct 2021 04:46:26 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 0614A4003E for ; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id D2BA120A5047; Mon, 25 Oct 2021 19:46:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D2BA120A5047 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216365; bh=+9dHlgmZeJJyTF4/+/HPmQ9vjqHVjdJSaPq0LNLiOls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fi1gWawrLoxKSLkxHnzkXbxxtLIRxW5UCTmHsDRNo4w9NS1669VNA+WFuvMuNbMjC KJ3kclhkos1f0AyVWnuMd+kCynr2IivdZxu3UQkrv/PIfaH9PyWEGZsuIuGI1uXmAC cE0OZQWm8orFz5e8PUFBSC3BD0tsBcxX7rkCmZMQ= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:55 -0700 Message-Id: <1635216361-23641-6-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 05/11] app/test: skip interrupt tests on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Even though test_interrupts.c can compile on Windows, skip interrupt tests for now since majority of eal_interrupt on Windows are stubs. Will remove the skip after interrupt being fully enabled on Windows. Signed-off-by: Jie Zhou --- app/test/test_interrupts.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/test/test_interrupts.c b/app/test/test_interrupts.c index 2a05399f96..eec9b2805b 100644 --- a/app/test/test_interrupts.c +++ b/app/test/test_interrupts.c @@ -12,6 +12,15 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_interrupt(void) +{ + printf("Interrupt on Windows is not fully supported yet, skipping test\n"); + return TEST_SKIPPED; +} +#else + #define TEST_INTERRUPT_CHECK_INTERVAL 100 /* ms */ /* predefined interrupt handle types */ @@ -590,5 +599,6 @@ test_interrupt(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND(interrupt_autotest, test_interrupt); From patchwork Tue Oct 26 02:45:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102824 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 118E9A0C47; Tue, 26 Oct 2021 04:46:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AD2541187; Tue, 26 Oct 2021 04:46:25 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 069AF40A4B for ; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id E8B2A20A5048; Mon, 25 Oct 2021 19:46:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E8B2A20A5048 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216365; bh=TehtBGNo14PgPNdGQjIEQLtXnqxy2J8uwxRNe1JdnFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FLHrC1ZkfKYdPkJd+SPbC8dm1bPPEH+6BlDb8WCXizWvR9ta+iadXe1D/XDg/kyFE bCvemt4I+oAbb5HFnBdLB/Kv411iXeuXy6Vc4lxLMg8rLZRKAQiBTBpDN7P6gV6O8A iWCk4Gp8KkDHKUZY1FXUP4pchunsUfxizbn3RZaA= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:56 -0700 Message-Id: <1635216361-23641-7-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 06/11] app/test: temporarily "skip" one cmdline test case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" cmdline tests pass except one failure at the test_cmdline_socket_fns test case with error: failed to open /dev/null for reading! Temporarily "skip" this case while enable all other passing cases. Issue is tracked internally and will add the corresponding case on Windows in future. Signed-off-by: Jie Zhou --- app/test/test_cmdline_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c index 4715edc341..eb54ef06d7 100644 --- a/app/test/test_cmdline_lib.c +++ b/app/test/test_cmdline_lib.c @@ -146,6 +146,9 @@ test_cmdline_vt100_fns(void) static int test_cmdline_socket_fns(void) { +#ifdef RTE_EXEC_ENV_WINDOWS + return 0; +#else cmdline_parse_ctx_t ctx; struct cmdline *cl; @@ -184,6 +187,7 @@ test_cmdline_socket_fns(void) printf("Error: function accepted null parameter!\n"); cmdline_free(cl); return -1; +#endif } static int From patchwork Tue Oct 26 02:45:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102827 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 954F0A0C47; Tue, 26 Oct 2021 04:46:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 669414119B; Tue, 26 Oct 2021 04:46:28 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 0BE7840E3C for ; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 0A82A20A504F; Mon, 25 Oct 2021 19:46:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0A82A20A504F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216366; bh=Rt+uxw8CAfeYyUkGN8bkpLml2OIeF4aMAEGFxbnNavQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RndNe4fatbtBicLNdV0f/4mT+3RLLiaAYakaOVl2UJO1I8vTqBoVcjcWh82hCdGNj wxp64wBDrCsso7fjPtsUVGJnXP7ez7JAUdVJjj8VYOmFJ6CYMJ8Sclv7WMzfiJvBBk WlU2nDy4veBDfygdD22nY7WIkd7kqcM0DfG+El5U= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:57 -0700 Message-Id: <1635216361-23641-8-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 07/11] app/test: skip two logs_autotest cases on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DPDK logs_autotest on Windows failed at "dynamic log types" tests. The failures are on 2 test cases for rte_log_set_level_regexp API, due to regular expression is not supported on Windows in DPDK yet and regcomp/regexec are just stubs on Windows (in regex.h). In app\test\test_logs.c, ifndef these two test cases, and for the rte_log_set_level_pattern validation case following these two cases, differentiate the expected log level passed into macro CHECK_LEVELS Now logs_autotest completes for all dynamic log types and static log types. Signed-off-by: Jie Zhou --- app/test/test_logs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test/test_logs.c b/app/test/test_logs.c index 7abb6eeca2..7c001c1ab3 100644 --- a/app/test/test_logs.c +++ b/app/test/test_logs.c @@ -113,6 +113,7 @@ test_logs(void) rte_log_set_level(logtype1, RTE_LOG_ERR); CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_INFO, RTE_LOG_ERR); +#ifndef RTE_EXEC_ENV_WINDOWS rte_log_set_level_regexp("type$", RTE_LOG_EMERG); CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_INFO, RTE_LOG_ERR); @@ -121,7 +122,10 @@ test_logs(void) rte_log_set_level_pattern("logtype", RTE_LOG_DEBUG); CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_EMERG, RTE_LOG_EMERG); - +#else + ret = rte_log_set_level_pattern("logtype", RTE_LOG_DEBUG); + CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_INFO, RTE_LOG_ERR); +#endif /* set logtype level low to so we can test global level */ rte_log_set_level_pattern("logtype*", RTE_LOG_DEBUG); CHECK_LEVELS(RTE_LOG_DEBUG, RTE_LOG_DEBUG, RTE_LOG_DEBUG); From patchwork Tue Oct 26 02:45:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102828 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C54CCA0C47; Tue, 26 Oct 2021 04:47:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7168B411A1; Tue, 26 Oct 2021 04:46:29 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 142A8410DB for ; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 2187520A5050; Mon, 25 Oct 2021 19:46:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2187520A5050 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216366; bh=VYLH4NBv4NAU2SjeXbbOZkZFgZEebGzSYAwOMUwDVWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EoTrtHQY+xs9ToT4tTCimjheO1h3yvEnaiyfubAYWSfUoX3c7EzmJKdj0N3l0w1QX NBOJKOxG7jlOa1pBqomqaHKsquMsfitOrN5f9wt/N9rezEEMopsYxPk8Wx6ifqRDiv wRABVydvYb4RL+Ty7VNKP4fQwaG5wIT7Db5UWwpU= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:58 -0700 Message-Id: <1635216361-23641-9-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 08/11] app/test: differentiate a strerror on different OS X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Windows, strerror returns just "Unknown error" for errnum greater than MAX_ERRNO, while linux and freebsd returns "Unknown error ", which is the current expectation for errno_autotest. Differentiate the error string on Windows to remove a "duplicate error code" failure. Signed-off-by: Jie Zhou --- app/test/test_errno.c | 12 +++++++++++- lib/eal/common/eal_common_errno.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/test/test_errno.c b/app/test/test_errno.c index 3ff0456a58..0db4fbc8b3 100644 --- a/app/test/test_errno.c +++ b/app/test/test_errno.c @@ -18,13 +18,19 @@ test_errno(void) { const char *rte_retval; const char *libc_retval; + +#ifndef RTE_EXEC_ENV_WINDOWS #ifdef RTE_EXEC_ENV_FREEBSD /* BSD has a colon in the string, unlike linux */ const char unknown_code_result[] = "Unknown error: %d"; #else const char unknown_code_result[] = "Unknown error %d"; #endif - char expected_libc_retval[sizeof(unknown_code_result)+3]; + char expected_libc_retval[sizeof(unknown_code_result) + 3]; +#else + /* Windows doesn't return error number for error greater than MAX_errno*/ + static const char expected_libc_retval[] = "Unknown error"; +#endif /* use a small selection of standard errors for testing */ int std_errs[] = {EAGAIN, EBADF, EACCES, EINTR, EINVAL}; @@ -54,11 +60,13 @@ test_errno(void) rte_retval, libc_retval); if (strcmp(rte_retval, libc_retval) == 0) return -1; +#ifndef RTE_EXEC_ENV_WINDOWS /* generate appropriate error string for unknown error number * and then check that this is what we got back. If not, we have * a duplicate error number that conflicts with errno.h */ snprintf(expected_libc_retval, sizeof(expected_libc_retval), unknown_code_result, rte_errs[i]); +#endif if ((strcmp(expected_libc_retval, libc_retval) != 0) && (strcmp("", libc_retval) != 0)){ printf("Error, duplicate error code %d\n", rte_errs[i]); @@ -69,8 +77,10 @@ test_errno(void) /* ensure that beyond RTE_MAX_ERRNO, we always get an unknown code */ rte_retval = rte_strerror(RTE_MAX_ERRNO + 1); libc_retval = strerror(RTE_MAX_ERRNO + 1); +#ifndef RTE_EXEC_ENV_WINDOWS snprintf(expected_libc_retval, sizeof(expected_libc_retval), unknown_code_result, RTE_MAX_ERRNO + 1); +#endif printf("rte_strerror: '%s', strerror: '%s'\n", rte_retval, libc_retval); if ((strcmp(rte_retval, libc_retval) != 0) || diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c index f86802705a..4c4abb802e 100644 --- a/lib/eal/common/eal_common_errno.c +++ b/lib/eal/common/eal_common_errno.c @@ -37,7 +37,11 @@ rte_strerror(int errnum) /* since some implementations of strerror_r throw an error * themselves if errnum is too big, we handle that case here */ if (errnum >= RTE_MAX_ERRNO) +#ifdef RTE_EXEC_ENV_WINDOWS + snprintf(ret, RETVAL_SZ, "Unknown error%s", sep); +#else snprintf(ret, RETVAL_SZ, "Unknown error%s %d", sep, errnum); +#endif else switch (errnum){ case E_RTE_SECONDARY: From patchwork Tue Oct 26 02:45:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102823 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E791FA0C47; Tue, 26 Oct 2021 04:46:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CED241159; Tue, 26 Oct 2021 04:46:24 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 09A6640E0F for ; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 3803920A5051; Mon, 25 Oct 2021 19:46:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3803920A5051 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216366; bh=l0KOGdlOqkniobGBQzdhML6GnEFyjKhs0BmqNb1StDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pMYMuGu8DPfYrEkZQRjbUdQSjft6oy78G/c3nJM+soOQeEMAwg4NYeruX00DXkEFD vg+GC+KAUkGwBWxCD2+JEC/fVUpejbH4g8NGVIadxUyCYS1iyOe87ZargaDQ1z19hY yHplIRpK33JIFR3otdbfJee0VU+uyVjs8i5WYEPM= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:45:59 -0700 Message-Id: <1635216361-23641-10-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 09/11] app/test: remove two alarm_autotest cases X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove two alarm_autotest test cases which do bogus range check on Windows. Signed-off-by: Jie Zhou --- app/test/test_alarm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/test/test_alarm.c b/app/test/test_alarm.c index b4034339b8..70e97a3109 100644 --- a/app/test/test_alarm.c +++ b/app/test/test_alarm.c @@ -10,6 +10,7 @@ #include "test.h" +#ifndef RTE_EXEC_ENV_WINDOWS static volatile int flag; static void @@ -18,6 +19,7 @@ test_alarm_callback(void *cb_arg) flag = 1; printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); } +#endif static int test_alarm(void) @@ -27,6 +29,7 @@ test_alarm(void) return 0; #endif +#ifndef RTE_EXEC_ENV_WINDOWS /* check if it will fail to set alarm with wrong us value */ printf("check if it will fail to set alarm with wrong ms values\n"); if (rte_eal_alarm_set(0, test_alarm_callback, @@ -39,6 +42,7 @@ test_alarm(void) printf("should not be successful with (UINT64_MAX-1) us value\n"); return -1; } +#endif /* check if it will fail to set alarm with null callback parameter */ printf("check if it will fail to set alarm with null callback parameter\n"); From patchwork Tue Oct 26 02:46:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102826 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B3FBFA0C47; Tue, 26 Oct 2021 04:46:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C19641196; Tue, 26 Oct 2021 04:46:27 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 194A1410DD for ; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 4E42120ABAC0; Mon, 25 Oct 2021 19:46:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4E42120ABAC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216366; bh=aK4qu0rzD9HqPA+15S6Dvsz9sRE1f+sc2CeRbedvicE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iBk/VKEcaq01ORC5Mj0e1JpFmQxf3io00JR+4KwyqC9gkLO3BF9BneeshoynvSJ0S UFze0A5S/hpzShAnd1j42xj7URXxJXIZeQxSbRvHj0fI0CibtU3sT+pCx6Ur90L3HA J8zGOo6lGqP0FOOLtweYVOunPDxi3665pgtGQKIg= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:46:00 -0700 Message-Id: <1635216361-23641-11-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 10/11] app/test: replace .sh scripts with .py scripts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" - Add python script to check if system supports hugepages - Remove corresponding .sh scripts - Replace calling of .sh with corresponding .py in meson.build Signed-off-by: Jie Zhou --- app/test/has-hugepage.sh | 11 ----------- app/test/has_hugepage.py | 25 +++++++++++++++++++++++++ app/test/meson.build | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py diff --git a/app/test/has-hugepage.sh b/app/test/has-hugepage.sh deleted file mode 100755 index d600fad319..0000000000 --- a/app/test/has-hugepage.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020 Mellanox Technologies, Ltd - -if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 -elif [ "$(uname)" = "FreeBSD" ] ; then - echo 1 # assume FreeBSD always has hugepages -else - echo 0 -fi diff --git a/app/test/has_hugepage.py b/app/test/has_hugepage.py new file mode 100644 index 0000000000..70107c61fd --- /dev/null +++ b/app/test/has_hugepage.py @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script checks if the system supports huge pages""" + +import platform +import ctypes + +osName = platform.system() +if osName == "Linux": + with open("/proc/sys/vm/nr_hugepages") as file_o: + content = file_o.read() + print(content) +elif osName == "FreeBSD": + # Assume FreeBSD always has hugepages enabled + print("1") +elif osName == "Windows": + # On Windows, determine if large page is supported based on the + # value returned by GetLargePageMinimum. If the return value is zero, + # the processor does not support large pages. + if ctypes.windll.kernel32.GetLargePageMinimum() > 0: + print("1") + else: + print("0") +else: + print("0") diff --git a/app/test/meson.build b/app/test/meson.build index 20f36a1803..210ccd29b0 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -463,7 +463,7 @@ dpdk_test = executable('dpdk-test', driver_install_path), install: true) -has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0' +has_hugepage = run_command(py3, 'has_hugepage.py').stdout().strip() != '0' message('hugepage availability: @0@'.format(has_hugepage)) # some perf tests (eg: memcpy perf autotest)take very long From patchwork Tue Oct 26 02:46:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 102829 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21FF4A0C47; Tue, 26 Oct 2021 04:47:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9402A411A5; Tue, 26 Oct 2021 04:46:30 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 2F95A410E2 for ; Tue, 26 Oct 2021 04:46:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 645F320ABAC1; Mon, 25 Oct 2021 19:46:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 645F320ABAC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635216366; bh=At38I41KvdE75BW9zK0n/oLYInUKoFNE6IXhKEZfjp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FpG2CY9Y8ZnjOSWpkk0ctmOmwk0XXOfs/hOVTW3onQ9/10KB4E8/E5eFz42910kEl dx9yv74ZwGR1VBBfduWcenMpzzId6IUpDGz+GZR4jEW88iSCgEm7Pc61YkYstodOWx WZDlOq0Td6TV3uZanf/SczevFeS/7oMCvGFcDWmQ= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Date: Mon, 25 Oct 2021 19:46:01 -0700 Message-Id: <1635216361-23641-12-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> References: <1635215204-20604-1-git-send-email-jizh@linux.microsoft.com> <1635216361-23641-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v8 11/11] app/test: enable subset of unit tests on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" - For fast tests and perf tests, add test stubs to skip not supported ones. - For driver tests, for now skip on Windows totally to avoid unnecessary amount of test stubs. For example, there are about 30 cryptodev related tests (even though in the meson for CI it only listed about half) which will be enabled by "patch-18949: app/test: enable crypto unit tests on Windows". - For dump tests, currently the tests hang on Windows which require further investigation. Keep the dump test list just for non-Windows for easier tracking. Signed-off-by: Jie Zhou --- app/test/meson.build | 114 ++++++++++++----------- app/test/test_acl.c | 12 +++ app/test/test_bpf.c | 15 ++- app/test/test_cksum.c | 12 +++ app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 97 +++++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 +++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 +++- app/test/test_event_timer_adapter.c | 16 +++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 +++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 +++- app/test/test_hash_perf.c | 12 +++ app/test/test_ipfrag.c | 16 +++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 +++- app/test/test_member_perf.c | 16 +++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 15 ++- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 +++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 ++++++- 70 files changed, 1015 insertions(+), 126 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index 210ccd29b0..7161a83196 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - if not get_option('tests') subdir_done() endif @@ -157,37 +151,17 @@ test_sources = files( ) test_deps = [ - 'acl', 'bus_pci', 'bus_vdev', 'bitratestats', - 'bpf', 'cfgfile', 'cmdline', - 'cryptodev', - 'distributor', - 'dmadev', - 'efd', 'ethdev', - 'eventdev', - 'fib', - 'flow_classify', - 'graph', 'hash', - 'ipsec', 'latencystats', - 'lpm', - 'member', 'metrics', - 'node', - 'pipeline', - 'port', - 'rawdev', 'rcu', - 'reorder', - 'rib', 'ring', - 'security', 'stack', 'telemetry', 'timer', @@ -325,39 +299,69 @@ perf_test_names = [ ] driver_test_names = [ - 'cryptodev_aesni_mb_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_cn9k_autotest', - 'cryptodev_cn10k_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_null_autotest', - 'cryptodev_octeontx2_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_zuc_autotest', - 'dmadev_autotest', - 'eventdev_selftest_octeontx', - 'eventdev_selftest_sw', - 'rawdev_autotest', ] dump_test_names = [ - 'dump_struct_sizes', - 'dump_mempool', - 'dump_malloc_stats', - 'dump_devargs', - 'dump_log_types', - 'dump_ring', - 'dump_physmem', - 'dump_memzone', ] +if not is_windows + test_deps += [ + 'acl', + 'bpf', + 'cryptodev', + 'distributor', + 'dmadev', + 'efd', + 'eventdev', + 'fib', + 'flow_classify', + 'graph', + 'ipsec', + 'lpm', + 'member', + 'node', + 'pipeline', + 'port', + 'rawdev', + 'reorder', + 'rib', + 'security', + ] + + driver_test_names += [ + 'cryptodev_aesni_mb_autotest', + 'cryptodev_aesni_gcm_autotest', + 'cryptodev_cn9k_autotest', + 'cryptodev_cn10k_autotest', + 'cryptodev_dpaa_sec_autotest', + 'cryptodev_dpaa2_sec_autotest', + 'cryptodev_null_autotest', + 'cryptodev_octeontx2_autotest', + 'cryptodev_openssl_autotest', + 'cryptodev_openssl_asym_autotest', + 'cryptodev_qat_autotest', + 'cryptodev_sw_armv8_autotest', + 'cryptodev_sw_kasumi_autotest', + 'cryptodev_sw_mvsam_autotest', + 'cryptodev_sw_snow3g_autotest', + 'cryptodev_sw_zuc_autotest', + 'eventdev_selftest_octeontx', + 'eventdev_selftest_sw', + 'rawdev_autotest', + ] + + dump_test_names += [ + 'dump_struct_sizes', + 'dump_mempool', + 'dump_malloc_stats', + 'dump_devargs', + 'dump_log_types', + 'dump_ring', + 'dump_physmem', + 'dump_memzone', + ] +endif + # The following linkages are an exception to allow running the # unit tests without requiring that the developer install the # DPDK libraries. Explicit linkage of drivers (plugin libraries) @@ -371,7 +375,7 @@ endif if dpdk_conf.has('RTE_EVENT_SKELETON') test_deps += 'event_skeleton' endif -if dpdk_conf.has('RTE_LIB_TELEMETRY') +if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY') test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c'] fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]] endif diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 5b32347954..7814e25a53 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -11,6 +11,16 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_acl(void) +{ + printf("acl not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include #include @@ -1741,4 +1751,6 @@ test_acl(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(acl_autotest, test_acl); diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c index ef861d05e7..437d85ce7e 100644 --- a/app/test/test_bpf.c +++ b/app/test/test_bpf.c @@ -14,11 +14,22 @@ #include #include #include +#include "test.h" + +#if !defined(RTE_LIB_BPF) + +static int +test_bpf(void) +{ + printf("BPF not supported, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include #include #include -#include "test.h" /* * Basic functional tests for librte_bpf. @@ -3248,6 +3259,8 @@ test_bpf(void) return rc; } +#endif + REGISTER_TEST_COMMAND(bpf_autotest, test_bpf); #ifdef RTE_PORT_PCAP diff --git a/app/test/test_cksum.c b/app/test/test_cksum.c index cd983d7c01..3c5bfc8671 100644 --- a/app/test/test_cksum.c +++ b/app/test/test_cksum.c @@ -13,6 +13,16 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_cksum(void) +{ + printf("cksum not supported, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #define MEMPOOL_CACHE_SIZE 0 #define MBUF_DATA_SIZE 256 #define NB_MBUF 128 @@ -268,4 +278,6 @@ test_cksum(void) } #undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(cksum_autotest, test_cksum); diff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c index 2a1ee120fc..ff039a304f 100644 --- a/app/test/test_cmdline_ipaddr.c +++ b/app/test/test_cmdline_ipaddr.c @@ -2,9 +2,12 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include #include + #include #include @@ -669,3 +672,5 @@ test_parse_ipaddr_invalid_param(void) } return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 814a0b401d..e877507778 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -3,6 +3,8 @@ * Copyright 2020 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include @@ -15715,3 +15717,5 @@ REGISTER_TEST_COMMAND(cryptodev_nitrox_autotest, test_cryptodev_nitrox); REGISTER_TEST_COMMAND(cryptodev_bcmfs_autotest, test_cryptodev_bcmfs); REGISTER_TEST_COMMAND(cryptodev_cn9k_autotest, test_cryptodev_cn9k); REGISTER_TEST_COMMAND(cryptodev_cn10k_autotest, test_cryptodev_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index 9d19a6d6d9..680ced4dbe 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -3,6 +3,8 @@ * Copyright (c) 2019 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include #include @@ -2429,3 +2431,5 @@ REGISTER_TEST_COMMAND(cryptodev_octeontx2_asym_autotest, test_cryptodev_octeontx2_asym); REGISTER_TEST_COMMAND(cryptodev_cn9k_asym_autotest, test_cryptodev_cn9k_asym); REGISTER_TEST_COMMAND(cryptodev_cn10k_asym_autotest, test_cryptodev_cn10k_asym); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c index 3cdb2c96e8..a4434c020f 100644 --- a/app/test/test_cryptodev_blockcipher.c +++ b/app/test/test_cryptodev_blockcipher.c @@ -2,6 +2,8 @@ * Copyright(c) 2015-2017 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include #include @@ -1218,3 +1220,5 @@ free_blockcipher_test_suite(struct unit_test_suite *ts) { free(ts); } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_cryptodev_security_ipsec.c b/app/test/test_cryptodev_security_ipsec.c index 4708803bd2..a84afae7f5 100644 --- a/app/test/test_cryptodev_security_ipsec.c +++ b/app/test/test_cryptodev_security_ipsec.c @@ -2,6 +2,8 @@ * Copyright(C) 2021 Marvell. */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include #include @@ -672,3 +674,5 @@ test_ipsec_status_check(struct rte_crypto_op *op, return ret; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_cryptodev_security_pdcp.c b/app/test/test_cryptodev_security_pdcp.c index a7641bab7a..3409add715 100644 --- a/app/test/test_cryptodev_security_pdcp.c +++ b/app/test/test_cryptodev_security_pdcp.c @@ -4,6 +4,8 @@ * Copyright 2018-2019 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include @@ -587,3 +589,5 @@ test_PDCP_PROTO_uplane_decap_all(void) return n - i; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_debug.c b/app/test/test_debug.c index 23b24db177..c4038a4ed1 100644 --- a/app/test/test_debug.c +++ b/app/test/test_debug.c @@ -2,8 +2,21 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_debug(void) +{ + printf("debug not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include @@ -14,8 +27,6 @@ #include #include -#include "test.h" - /* * Debug test * ========== @@ -127,4 +138,6 @@ test_debug(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(debug_autotest, test_debug); diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c index 961f326cd5..0ecd5ba232 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -11,6 +11,17 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor(void) +{ + printf("distributor not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include @@ -939,4 +950,6 @@ test_distributor(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(distributor_autotest, test_distributor); diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c index fdbeae6d2f..c4b4c7fd97 100644 --- a/app/test/test_distributor_perf.c +++ b/app/test/test_distributor_perf.c @@ -10,6 +10,17 @@ #include #include #include + +#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 #include @@ -267,4 +278,6 @@ test_distributor_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(distributor_perf_autotest, test_distributor_perf); diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c index b206db27ae..c2ea9090cf 100644 --- a/app/test/test_dmadev.c +++ b/app/test/test_dmadev.c @@ -2,6 +2,17 @@ * Copyright(c) 2021 HiSilicon Limited * Copyright(c) 2021 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_dma(void) +{ + printf("dma not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include @@ -13,7 +24,6 @@ #include #include -#include "test.h" #include "test_dmadev_api.h" #define ERR_RETURN(...) do { print_err(__func__, __LINE__, __VA_ARGS__); return -1; } while (0) @@ -864,4 +874,6 @@ test_dma(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(dmadev_autotest, test_dma); diff --git a/app/test/test_dmadev_api.c b/app/test/test_dmadev_api.c index 4a181af90a..7b38f66dc0 100644 --- a/app/test/test_dmadev_api.c +++ b/app/test/test_dmadev_api.c @@ -2,6 +2,8 @@ * Copyright(c) 2021 HiSilicon Limited */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include @@ -572,3 +574,5 @@ test_dma_api(uint16_t dev_id) return 0; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 1d18a0ba8f..91908e5065 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -9,6 +9,101 @@ #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eal_flags(void) +{ + printf("eal_flags not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_missing_c_flag(void) +{ + printf("emissing_c_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_main_lcore_flag(void) +{ + printf("main_lcore_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_invalid_n_flag(void) +{ + printf("invalid_n_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_no_hpet_flag(void) +{ + printf("no_hpet_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_no_huge_flag(void) +{ + printf("no_huge_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_allow_flag(void) +{ + printf("allow_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_invalid_b_flag(void) +{ + printf("invalid_b_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_invalid_vdev_flag(void) +{ + printf("invalid_vdev_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_invalid_r_flag(void) +{ + printf("invalid_r_flag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_memory_flags(void) +{ + printf("memory_flags not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_file_prefix(void) +{ + printf("file_prefix not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_misc_flags(void) +{ + printf("misc_flags not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include @@ -1579,6 +1674,8 @@ test_eal_flags(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(eal_flags_autotest, test_eal_flags); /* subtests used in meson for CI */ diff --git a/app/test/test_eal_fs.c b/app/test/test_eal_fs.c index 39ac6961b3..5d24ae3d32 100644 --- a/app/test/test_eal_fs.c +++ b/app/test/test_eal_fs.c @@ -10,6 +10,16 @@ #include "eal_filesystem.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eal_fs(void) +{ + printf("eal_fs not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + static int test_parse_sysfs_value(void) { @@ -173,4 +183,6 @@ test_eal_fs(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(eal_fs_autotest, test_eal_fs); diff --git a/app/test/test_efd.c b/app/test/test_efd.c index 1b249e0447..f8f356dcd9 100644 --- a/app/test/test_efd.c +++ b/app/test/test_efd.c @@ -1,6 +1,17 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd(void) +{ + printf("efd not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include #include @@ -10,8 +21,6 @@ #include #include -#include "test.h" - #define EFD_TEST_KEY_LEN 8 #define TABLE_SIZE (1 << 21) #define ITERATIONS 3 @@ -462,4 +471,6 @@ test_efd(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(efd_autotest, test_efd); diff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c index f3fe3b1736..1bf6bcb0ca 100644 --- a/app/test/test_efd_perf.c +++ b/app/test/test_efd_perf.c @@ -2,6 +2,18 @@ * Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd_perf(void) +{ + printf("efd_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include @@ -13,8 +25,6 @@ #include #include -#include "test.h" - #define NUM_KEYSIZES 10 #define NUM_SHUFFLES 10 #define MAX_KEYSIZE 64 @@ -382,4 +392,6 @@ test_efd_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(efd_perf_autotest, test_efd_perf); diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c index 3d7e9fb93c..8f5fd78723 100644 --- a/app/test/test_event_crypto_adapter.c +++ b/app/test/test_event_crypto_adapter.c @@ -3,16 +3,27 @@ * All rights reserved. */ +#include "test.h" #include #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_crypto_adapter(void) +{ + printf("event_crypto_adapter not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include #include #include -#include "test.h" #define PKT_TRACE 0 #define NUM 1 @@ -1011,5 +1022,7 @@ test_event_crypto_adapter(void) return unit_test_suite_runner(&functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(event_crypto_adapter_autotest, test_event_crypto_adapter); diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c index 1419f6f64d..7d651a12f4 100644 --- a/app/test/test_event_eth_rx_adapter.c +++ b/app/test/test_event_eth_rx_adapter.c @@ -1,18 +1,37 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ + +#include "test.h" + #include #include #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_rx_adapter_common(void) +{ + printf("event_eth_rx_adapter not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_event_eth_rx_intr_adapter_common(void) +{ + printf("event_eth_rx_intr_adapter not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include -#include "test.h" - #define MAX_NUM_RX_QUEUE 64 #define NB_MBUFS (8192 * num_ports * MAX_NUM_RX_QUEUE) #define MBUF_CACHE_SIZE 512 @@ -967,6 +986,8 @@ test_event_eth_rx_intr_adapter_common(void) return unit_test_suite_runner(&event_eth_rx_intr_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(event_eth_rx_adapter_autotest, test_event_eth_rx_adapter_common); REGISTER_TEST_COMMAND(event_eth_rx_intr_adapter_autotest, diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c index cfcc784351..c1c9732dd4 100644 --- a/app/test/test_event_eth_tx_adapter.c +++ b/app/test/test_event_eth_tx_adapter.c @@ -16,6 +16,16 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_tx_adapter_common(void) +{ + printf("event_eth_tx_adapter not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #define MAX_NUM_QUEUE RTE_PMD_RING_MAX_RX_RINGS #define TEST_INST_ID 0 #define TEST_DEV_ID 0 @@ -696,5 +706,7 @@ test_event_eth_tx_adapter_common(void) return unit_test_suite_runner(&event_eth_tx_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(event_eth_tx_adapter_autotest, test_event_eth_tx_adapter_common); diff --git a/app/test/test_event_ring.c b/app/test/test_event_ring.c index 70eb9845e1..9c5e28fb81 100644 --- a/app/test/test_event_ring.c +++ b/app/test/test_event_ring.c @@ -2,11 +2,21 @@ * Copyright(c) 2010-2017 Intel Corporation */ +#include "test.h" + #include -#include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_ring(void) +{ + printf("event_ring not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} -#include "test.h" +#else + +#include /* * Event Ring @@ -244,4 +254,6 @@ test_event_ring(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(event_ring_autotest, test_event_ring); diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_timer_adapter.c index 12c00e678e..fb76744183 100644 --- a/app/test/test_event_timer_adapter.c +++ b/app/test/test_event_timer_adapter.c @@ -2,6 +2,7 @@ * Copyright(c) 2017 Cavium, Inc * Copyright(c) 2017-2018 Intel Corporation. */ +#include "test.h" #include @@ -11,6 +12,17 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_timer_adapter_func(void) +{ + printf("event_timer_adapter not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include @@ -22,8 +34,6 @@ #include #include -#include "test.h" - /* 4K timers corresponds to sw evdev max inflight events */ #define MAX_TIMERS (4 * 1024) #define BKT_TCK_NSEC @@ -1951,4 +1961,6 @@ test_event_timer_adapter_func(void) return unit_test_suite_runner(&event_timer_adptr_functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(event_timer_adapter_test, test_event_timer_adapter_func); diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c index 843d9766b0..fee2ecaa22 100644 --- a/app/test/test_eventdev.c +++ b/app/test/test_eventdev.c @@ -1,18 +1,28 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016 Cavium, Inc */ +#include "test.h" #include #include #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eventdev_common(void) +{ + printf("eventdev_common not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include -#include "test.h" - #define TEST_DEV_ID 0 static int @@ -1048,7 +1058,11 @@ test_eventdev_selftest_cn10k(void) return test_eventdev_selftest_impl("event_cn10k", ""); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(eventdev_common_autotest, test_eventdev_common); + +#ifndef RTE_EXEC_ENV_WINDOWS REGISTER_TEST_COMMAND(eventdev_selftest_sw, test_eventdev_selftest_sw); REGISTER_TEST_COMMAND(eventdev_selftest_octeontx, test_eventdev_selftest_octeontx); @@ -1058,3 +1072,5 @@ REGISTER_TEST_COMMAND(eventdev_selftest_dpaa2, test_eventdev_selftest_dpaa2); REGISTER_TEST_COMMAND(eventdev_selftest_dlb2, test_eventdev_selftest_dlb2); REGISTER_TEST_COMMAND(eventdev_selftest_cn9k, test_eventdev_selftest_cn9k); REGISTER_TEST_COMMAND(eventdev_selftest_cn10k, test_eventdev_selftest_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_external_mem.c b/app/test/test_external_mem.c index 5edf88b9f6..759f4fce6b 100644 --- a/app/test/test_external_mem.c +++ b/app/test/test_external_mem.c @@ -2,11 +2,25 @@ * Copyright(c) 2018 Intel Corporation */ +#include "test.h" + #include #include #include #include #include + + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_external_mem(void) +{ + printf("external_mem not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include @@ -19,8 +33,6 @@ #include #include -#include "test.h" - #define EXTERNAL_MEM_SZ (RTE_PGSIZE_4K << 10) /* 4M of data */ static int @@ -574,4 +586,6 @@ test_external_mem(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(external_mem_autotest, test_external_mem); diff --git a/app/test/test_fib.c b/app/test/test_fib.c index e46b9934fe..d991017d58 100644 --- a/app/test/test_fib.c +++ b/app/test/test_fib.c @@ -9,10 +9,28 @@ #include #include -#include #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib(void) +{ + printf("fib not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_slow_fib(void) +{ + printf("slow_fib not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + +#include + typedef int32_t (*rte_fib_test)(void); static int32_t test_create_invalid(void); @@ -410,5 +428,7 @@ test_slow_fib(void) return unit_test_suite_runner(&fib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(fib_autotest, test_fib); REGISTER_TEST_COMMAND(fib_slow_autotest, test_slow_fib); diff --git a/app/test/test_fib6.c b/app/test/test_fib6.c index 74abfc7a5d..7545a3496f 100644 --- a/app/test/test_fib6.c +++ b/app/test/test_fib6.c @@ -9,11 +9,29 @@ #include #include -#include -#include #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6(void) +{ + printf("fib not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_slow_fib6(void) +{ + printf("slow_fib not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + +#include +#include + typedef int32_t (*rte_fib6_test)(void); static int32_t test_create_invalid(void); @@ -419,5 +437,7 @@ test_slow_fib6(void) return unit_test_suite_runner(&fib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(fib6_autotest, test_fib6); REGISTER_TEST_COMMAND(fib6_slow_autotest, test_slow_fib6); diff --git a/app/test/test_fib6_perf.c b/app/test/test_fib6_perf.c index 56c799b2e9..22e8adb738 100644 --- a/app/test/test_fib6_perf.c +++ b/app/test/test_fib6_perf.c @@ -10,9 +10,21 @@ #include #include #include -#include #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6_perf(void) +{ + printf("fib6_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + +#include + #include "test_lpm6_data.h" #define TEST_FIB_ASSERT(cond) do { \ @@ -154,4 +166,6 @@ test_fib6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(fib6_perf_autotest, test_fib6_perf); diff --git a/app/test/test_fib_perf.c b/app/test/test_fib_perf.c index dd2e54db8b..c0c44c3fd5 100644 --- a/app/test/test_fib_perf.c +++ b/app/test/test_fib_perf.c @@ -12,11 +12,22 @@ #include #include #include -#include #include "test.h" #include "test_xmmt_ops.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib_perf(void) +{ + printf("fib_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + +#include + #define TEST_FIB_ASSERT(cond) do { \ if (!(cond)) { \ printf("Error at line %d:\n", __LINE__); \ @@ -408,4 +419,6 @@ test_fib_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(fib_perf_autotest, test_fib_perf); diff --git a/app/test/test_flow_classify.c b/app/test/test_flow_classify.c index 4f64be5357..d9893766d1 100644 --- a/app/test/test_flow_classify.c +++ b/app/test/test_flow_classify.c @@ -11,6 +11,17 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_flow_classify(void) +{ + printf("flow_classify not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include @@ -879,4 +890,6 @@ test_flow_classify(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(flow_classify_autotest, test_flow_classify); diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c index 838ab6f0f9..45f8484349 100644 --- a/app/test/test_func_reentrancy.c +++ b/app/test/test_func_reentrancy.c @@ -41,6 +41,16 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_func_reentrancy(void) +{ + printf("reentrancy not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + typedef int (*case_func_t)(void* arg); typedef void (*case_clean_t)(unsigned lcore_id); @@ -512,4 +522,6 @@ test_func_reentrancy(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(func_reentrancy_autotest, test_func_reentrancy); diff --git a/app/test/test_graph.c b/app/test/test_graph.c index 81bdcb9bea..ce4cdecd34 100644 --- a/app/test/test_graph.c +++ b/app/test/test_graph.c @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" + #include #include #include @@ -9,14 +11,23 @@ #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_node_list_dump(void) +{ + printf("node_list_dump not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include #include #include -#include "test.h" - static uint16_t test_node_worker_source(struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs); @@ -841,4 +852,7 @@ test_node_list_dump(void) return TEST_SUCCESS; } + +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(node_list_dump, test_node_list_dump); diff --git a/app/test/test_graph_perf.c b/app/test/test_graph_perf.c index 296d99a9d3..a58cde1f22 100644 --- a/app/test/test_graph_perf.c +++ b/app/test/test_graph_perf.c @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" + #include #include #include @@ -9,14 +11,22 @@ #include #include #include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_graph_perf_func(void) +{ + printf("graph_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include #include #include -#include "test.h" - #define TEST_GRAPH_PERF_MZ "graph_perf_data" #define TEST_GRAPH_SRC_NAME "test_graph_perf_source" #define TEST_GRAPH_SRC_BRST_ONE_NAME "test_graph_perf_source_one" @@ -1060,4 +1070,6 @@ test_graph_perf_func(void) return unit_test_suite_runner(&graph_perf_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(graph_perf_autotest, test_graph_perf_func); diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index 76cdac5d53..4229f85aa7 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -17,6 +17,16 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_hash_perf(void) +{ + printf("hash_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #define MAX_ENTRIES (1 << 19) #define KEYS_TO_ADD (MAX_ENTRIES) #define ADD_PERCENT 0.75 /* 75% table utilization */ @@ -749,4 +759,6 @@ test_hash_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(hash_perf_autotest, test_hash_perf); diff --git a/app/test/test_ipfrag.c b/app/test/test_ipfrag.c index da8c212f92..926a621f72 100644 --- a/app/test/test_ipfrag.c +++ b/app/test/test_ipfrag.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Red Hat, Inc. */ +#include "test.h" #include @@ -8,13 +9,22 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipfrag(void) +{ + printf("ipfrag not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include #include -#include "test.h" - #define NUM_MBUFS 128 #define BURST 32 @@ -259,4 +269,6 @@ test_ipfrag(void) return unit_test_suite_runner(&ipfrag_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(ipfrag_autotest, test_ipfrag); diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index 1bec63b0e8..293ee9bc95 100644 --- a/app/test/test_ipsec.c +++ b/app/test/test_ipsec.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2018 Intel Corporation */ +#include "test.h" #include @@ -13,15 +14,25 @@ #include #include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec(void) +{ + printf("ipsec not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include + #include #include #include #include -#include "test.h" #include "test_cryptodev.h" #define VDEV_ARGS_SIZE 100 @@ -2536,4 +2547,6 @@ test_ipsec(void) return unit_test_suite_runner(&ipsec_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(ipsec_autotest, test_ipsec); diff --git a/app/test/test_ipsec_perf.c b/app/test/test_ipsec_perf.c index 92106bf374..5ebb61ce18 100644 --- a/app/test/test_ipsec_perf.c +++ b/app/test/test_ipsec_perf.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include "test.h" #include #include @@ -8,10 +9,20 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_libipsec_perf(void) +{ + printf("ipsec_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include -#include "test.h" #include "test_cryptodev.h" #define RING_SIZE 4096 @@ -611,4 +622,6 @@ test_libipsec_perf(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(ipsec_perf_autotest, test_libipsec_perf); diff --git a/app/test/test_ipsec_sad.c b/app/test/test_ipsec_sad.c index 491164689e..07f3ed245b 100644 --- a/app/test/test_ipsec_sad.c +++ b/app/test/test_ipsec_sad.c @@ -1,16 +1,26 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include #include #include #include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec_sad(void) +{ + printf("ipsec_sad not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include -#include "test.h" #include "test_xmmt_ops.h" typedef int32_t (*rte_ipsec_sad_test)(void); @@ -884,4 +894,6 @@ test_ipsec_sad(void) return unit_test_suite_runner(&ipsec_sad_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(ipsec_sad_autotest, test_ipsec_sad); diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 40ab0d5c4c..8f4e92f6ca 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -2,15 +2,12 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + #include #include #include #include -#include -#include - -#include "test.h" - #if !defined(RTE_EXEC_ENV_LINUX) || !defined(RTE_LIB_KNI) static int @@ -22,6 +19,9 @@ test_kni(void) #else +#include +#include + #include #include #include diff --git a/app/test/test_lcores.c b/app/test/test_lcores.c index 35c47d5372..2277ae597f 100644 --- a/app/test/test_lcores.c +++ b/app/test/test_lcores.c @@ -11,6 +11,16 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lcores(void) +{ + printf("lcore not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + struct thread_context { enum { INIT, ERROR, DONE } state; bool lcore_id_any; @@ -411,4 +421,6 @@ test_lcores(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(lcores_autotest, test_lcores); diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index 556f5a67ba..31f7d53748 100644 --- a/app/test/test_lpm.c +++ b/app/test/test_lpm.c @@ -1,6 +1,17 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm(void) +{ + printf("lpm not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include #include @@ -10,7 +21,6 @@ #include #include -#include "test.h" #include "test_xmmt_ops.h" #define TEST_LPM_ASSERT(cond) do { \ @@ -1584,4 +1594,6 @@ test_lpm(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(lpm_autotest, test_lpm); diff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c index 0d664546fa..cd9bc969b7 100644 --- a/app/test/test_lpm6.c +++ b/app/test/test_lpm6.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include #include @@ -8,9 +9,18 @@ #include #include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6(void) +{ + printf("lpm6 not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT(cond) do { \ @@ -1792,4 +1802,6 @@ test_lpm6(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(lpm6_autotest, test_lpm6); diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c index 0b43ad824a..622418ddfe 100644 --- a/app/test/test_lpm6_perf.c +++ b/app/test/test_lpm6_perf.c @@ -1,6 +1,17 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6_perf(void) +{ + printf("lpm6_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include #include @@ -12,7 +23,6 @@ #include #include -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT(cond) do { \ @@ -160,4 +170,6 @@ test_lpm6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(lpm6_perf_autotest, test_lpm6_perf); diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c index 2bed00d064..d49bce5d36 100644 --- a/app/test/test_lpm_perf.c +++ b/app/test/test_lpm_perf.c @@ -2,7 +2,17 @@ * Copyright(c) 2010-2014 Intel Corporation * Copyright(c) 2020 Arm Limited */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm_perf(void) +{ + printf("lpm_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +#else #include #include #include @@ -15,7 +25,6 @@ #include #include -#include "test.h" #include "test_xmmt_ops.h" struct rte_lpm *lpm; @@ -763,4 +772,6 @@ test_lpm_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(lpm_perf_autotest, test_lpm_perf); diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index afff0de9f0..0c0a6cd954 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2019 Intel Corporation */ +#include "test.h" #include #include @@ -8,6 +9,17 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_malloc(void) +{ + printf("malloc not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include @@ -23,11 +35,8 @@ #include #include -#include "test.h" - #define N 10000 - static int is_mem_on_socket(int32_t socket); @@ -1080,4 +1089,6 @@ test_malloc(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(malloc_autotest, test_malloc); diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 94d1cdde37..8a1db80a1f 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include #include @@ -34,7 +35,15 @@ #include #include -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mbuf(void) +{ + printf("mbuf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else #define MEMPOOL_CACHE_SIZE 32 #define MBUF_DATA_SIZE 2048 @@ -2972,4 +2981,6 @@ test_mbuf(void) } #undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(mbuf_autotest, test_mbuf); diff --git a/app/test/test_member.c b/app/test/test_member.c index 40aa4c8627..85f3a126b9 100644 --- a/app/test/test_member.c +++ b/app/test/test_member.c @@ -3,17 +3,27 @@ */ /* This test is for membership library's simple feature test */ +#include "test.h" #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member(void) +{ + printf("member not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include #include #include -#include "test.h" - struct rte_member_setsum *setsum_ht; struct rte_member_setsum *setsum_cache; struct rte_member_setsum *setsum_vbf; @@ -712,4 +722,6 @@ test_member(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(member_autotest, test_member); diff --git a/app/test/test_member_perf.c b/app/test/test_member_perf.c index e2840f12d3..1cc9c3e4d8 100644 --- a/app/test/test_member_perf.c +++ b/app/test/test_member_perf.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include "test.h" #include #include @@ -11,9 +12,18 @@ #include #include #include -#include -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member_perf(void) +{ + printf("member_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + +#include #define NUM_KEYSIZES 10 #define NUM_SHUFFLES 10 @@ -622,4 +632,6 @@ test_member_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(member_perf_autotest, test_member_perf); diff --git a/app/test/test_memcpy_perf.c b/app/test/test_memcpy_perf.c index c711e36ba7..e9388fa7c4 100644 --- a/app/test/test_memcpy_perf.c +++ b/app/test/test_memcpy_perf.c @@ -2,21 +2,31 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + #include #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_memcpy_perf(void) +{ + printf("memcpy_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include #include #include - #include -#include "test.h" - /* * Set this to the maximum buffer size you want to test. If it is 0, then the * values in the buf_sizes[] array below will be used. @@ -347,4 +357,6 @@ test_memcpy_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(memcpy_perf_autotest, test_memcpy_perf); diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c index 8f629736e8..193327a546 100644 --- a/app/test/test_mempool_perf.c +++ b/app/test/test_mempool_perf.c @@ -28,6 +28,16 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mempool_perf(void) +{ + printf("mempool_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + /* * Mempool performance * ======= @@ -393,4 +403,6 @@ test_mempool_perf(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(mempool_perf_autotest, test_mempool_perf); diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c index da035348bd..dcfcc8a32a 100644 --- a/app/test/test_mp_secondary.c +++ b/app/test/test_mp_secondary.c @@ -14,9 +14,18 @@ #include #include #include -#ifndef RTE_EXEC_ENV_WINDOWS + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_mp_secondary(void) +{ + printf("mp_secondary not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include -#endif #include #include #include @@ -214,4 +223,6 @@ test_mp_secondary(void) return run_object_creation_tests(); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(multiprocess_autotest, test_mp_secondary); diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c index 081fab969b..561b0e0300 100644 --- a/app/test/test_rawdev.c +++ b/app/test/test_rawdev.c @@ -1,16 +1,27 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright 2017 NXP */ +#include "test.h" + #include #include #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rawdev_selftests(void) +{ + printf("rawdev not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include -#include "test.h" - static int test_rawdev_selftest_impl(const char *pmd, const char *opts) { @@ -54,4 +65,6 @@ test_rawdev_selftests(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftests); diff --git a/app/test/test_rcu_qsbr_perf.c b/app/test/test_rcu_qsbr_perf.c index cf7b158d22..9209fb2658 100644 --- a/app/test/test_rcu_qsbr_perf.c +++ b/app/test/test_rcu_qsbr_perf.c @@ -15,6 +15,16 @@ #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rcu_qsbr_main(void) +{ + printf("rcu_qsbr_main not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + /* Check condition and return an error if true. */ static uint16_t enabled_core_ids[RTE_MAX_LCORE]; static unsigned int num_cores; @@ -687,4 +697,6 @@ test_rcu_qsbr_main(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(rcu_qsbr_perf_autotest, test_rcu_qsbr_main); diff --git a/app/test/test_reciprocal_division.c b/app/test/test_reciprocal_division.c index 8ea9b1d24d..8777211cd7 100644 --- a/app/test/test_reciprocal_division.c +++ b/app/test/test_reciprocal_division.c @@ -13,6 +13,16 @@ #include #include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal(void) +{ + printf("reciprocal not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #define MAX_ITERATIONS (1ULL << 32) #define DIVIDE_ITER (100) @@ -164,4 +174,6 @@ test_reciprocal(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(reciprocal_division, test_reciprocal); diff --git a/app/test/test_reciprocal_division_perf.c b/app/test/test_reciprocal_division_perf.c index 4f625873e5..66b004fa1b 100644 --- a/app/test/test_reciprocal_division_perf.c +++ b/app/test/test_reciprocal_division_perf.c @@ -13,6 +13,16 @@ #include #include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal_division_perf(void) +{ + printf("reciprocal_division_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #define MAX_ITERATIONS (1ULL << 32) #define DIVIDE_ITER (1ULL << 28) @@ -205,4 +215,6 @@ test_reciprocal_division_perf(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(reciprocal_division_perf, test_reciprocal_division_perf); diff --git a/app/test/test_red.c b/app/test/test_red.c index e973f3131e..d0200c13aa 100644 --- a/app/test/test_red.c +++ b/app/test/test_red.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include #include @@ -8,12 +9,34 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_red(void) +{ + printf("red not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_red_perf(void) +{ + printf("red_perf not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_red_all(void) +{ + printf("red_all not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +#else + #include #include #include -#include "test.h" - #include #ifdef __INTEL_COMPILER @@ -1851,6 +1874,8 @@ test_red_all(void) return tell_the_result(num_tests, num_pass); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(red_autotest, test_red); REGISTER_TEST_COMMAND(red_perf, test_red_perf); REGISTER_TEST_COMMAND(red_all, test_red_all); diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c index 1c4226da65..c73cbdefe6 100644 --- a/app/test/test_reorder.c +++ b/app/test/test_reorder.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include #include @@ -9,12 +10,20 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reorder(void) +{ + printf("reorder not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +#else + #include #include #include -#include "test.h" - #define BURST 32 #define REORDER_BUFFER_SIZE 16384 #define NUM_MBUFS (2*REORDER_BUFFER_SIZE) @@ -390,4 +399,6 @@ test_reorder(void) return unit_test_suite_runner(&reorder_test_suite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(reorder_autotest, test_reorder); diff --git a/app/test/test_rib.c b/app/test/test_rib.c index 3dc48fe1f2..ad7c79ca78 100644 --- a/app/test/test_rib.c +++ b/app/test/test_rib.c @@ -2,15 +2,31 @@ * Copyright(c) 2018 Vladimir Medvedkin * Copyright(c) 2019 Intel Corporation */ +#include "test.h" #include #include #include #include -#include -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib(void) +{ + printf("rib not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_slow_rib(void) +{ + printf("slow_rib not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +#else + +#include typedef int32_t (*rte_rib_test)(void); @@ -363,5 +379,7 @@ test_slow_rib(void) return unit_test_suite_runner(&rib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(rib_autotest, test_rib); REGISTER_TEST_COMMAND(rib_slow_autotest, test_slow_rib); diff --git a/app/test/test_rib6.c b/app/test/test_rib6.c index c77df11298..9d0e3cb55e 100644 --- a/app/test/test_rib6.c +++ b/app/test/test_rib6.c @@ -3,14 +3,31 @@ * Copyright(c) 2019 Intel Corporation */ +#include "test.h" + #include #include #include #include -#include -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib6(void) +{ + printf("rib6 not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_slow_rib6(void) +{ + printf("slow_rib6 not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +#else + +#include typedef int32_t (*rte_rib6_test)(void); @@ -368,5 +385,6 @@ test_slow_rib6(void) return unit_test_suite_runner(&rib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND(rib6_autotest, test_rib6); REGISTER_TEST_COMMAND(rib6_slow_autotest, test_slow_rib6); diff --git a/app/test/test_sched.c b/app/test/test_sched.c index 958b631144..ad3e978ea6 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -14,8 +14,18 @@ #include #include #include -#include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_sched(void) +{ + printf("sched not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + +#include #define SUBPORT 0 #define PIPE 1 @@ -204,4 +214,6 @@ test_sched(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(sched_autotest, test_sched); diff --git a/app/test/test_security.c b/app/test/test_security.c index 060cf1ffa8..c31273941c 100644 --- a/app/test/test_security.c +++ b/app/test/test_security.c @@ -1,12 +1,24 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include "test.h" #include #include #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_security(void) +{ + printf("security not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include @@ -20,7 +32,7 @@ #endif #include -#include "test.h" + /** * Security @@ -2639,4 +2651,6 @@ test_security(void) return unit_test_suite_runner(&security_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(security_autotest, test_security); diff --git a/app/test/test_table.c b/app/test/test_table.c index 95034148cb..2e18e49ba4 100644 --- a/app/test/test_table.c +++ b/app/test/test_table.c @@ -7,6 +7,17 @@ #include #include #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_table(void) +{ + printf("table not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include "test_table.h" #include "test_table_pipeline.h" #include "test_table_ports.h" @@ -194,4 +205,6 @@ test_table(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(table_autotest, test_table); diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c index 0bdf76ab70..83bef0ea57 100644 --- a/app/test/test_table_acl.c +++ b/app/test/test_table_acl.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS #include #include #include @@ -728,3 +729,5 @@ test_table_acl(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_table_combined.c b/app/test/test_table_combined.c index f72b634bff..0abc5e45c5 100644 --- a/app/test/test_table_combined.c +++ b/app/test/test_table_combined.c @@ -2,6 +2,8 @@ * Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include "test_table_combined.h" #include "test_table.h" @@ -840,3 +842,5 @@ test_table_hash_cuckoo_combined(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c index aabf4375db..45dc7682d8 100644 --- a/app/test/test_table_pipeline.c +++ b/app/test/test_table_pipeline.c @@ -2,6 +2,8 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include #include @@ -569,3 +571,5 @@ test_table_pipeline(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_table_ports.c b/app/test/test_table_ports.c index d921b2e207..f3b5693609 100644 --- a/app/test/test_table_ports.c +++ b/app/test/test_table_ports.c @@ -2,6 +2,8 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include "test_table_ports.h" #include "test_table.h" @@ -189,3 +191,5 @@ test_port_ring_writer(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_table_tables.c b/app/test/test_table_tables.c index 4ff6ab16aa..2901490e61 100644 --- a/app/test/test_table_tables.c +++ b/app/test/test_table_tables.c @@ -2,6 +2,8 @@ * Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include #include @@ -1052,3 +1054,5 @@ test_table_hash_cuckoo(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/ diff --git a/app/test/test_timer_secondary.c b/app/test/test_timer_secondary.c index 16a9f1878b..002a7b8ad6 100644 --- a/app/test/test_timer_secondary.c +++ b/app/test/test_timer_secondary.c @@ -16,6 +16,17 @@ #include #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_timer_secondary(void) +{ + printf("timer_secondary not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include "process.h" #define NUM_TIMERS (1 << 20) /* ~1M timers */ @@ -213,4 +224,6 @@ test_timer_secondary(void) return TEST_FAILED; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + REGISTER_TEST_COMMAND(timer_secondary_autotest, test_timer_secondary); diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 0f9df83c40..e62f9ca10e 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -9,6 +9,30 @@ #include "test.h" #include "test_trace.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_trace(void) +{ + printf("trace not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_trace_dump(void) +{ + printf("trace_dump not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +static int +test_trace_metadata_dump(void) +{ + printf("trace_metadata_dump not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + static int32_t test_trace_point_globbing(void) { @@ -194,8 +218,6 @@ test_trace(void) return unit_test_suite_runner(&trace_tests); } -REGISTER_TEST_COMMAND(trace_autotest, test_trace); - static int test_trace_dump(void) { @@ -203,12 +225,14 @@ test_trace_dump(void) return 0; } -REGISTER_TEST_COMMAND(trace_dump, test_trace_dump); - static int test_trace_metadata_dump(void) { return rte_trace_metadata_dump(stdout); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + +REGISTER_TEST_COMMAND(trace_autotest, test_trace); +REGISTER_TEST_COMMAND(trace_dump, test_trace_dump); REGISTER_TEST_COMMAND(trace_metadata_dump, test_trace_metadata_dump);