Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/105009/?format=api
http://patchwork.dpdk.org/api/patches/105009/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1638912263-7054-3-git-send-email-jizh@linux.microsoft.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1638912263-7054-3-git-send-email-jizh@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1638912263-7054-3-git-send-email-jizh@linux.microsoft.com", "date": "2021-12-07T21:24:14", "name": "[v12,02/11] app/test: remove POSIX-specific code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "f3208766561a701c6db487d229072b5080a1977f", "submitter": { "id": 1934, "url": "http://patchwork.dpdk.org/api/people/1934/?format=api", "name": "Jie Zhou", "email": "jizh@linux.microsoft.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1638912263-7054-3-git-send-email-jizh@linux.microsoft.com/mbox/", "series": [ { "id": 20888, "url": "http://patchwork.dpdk.org/api/series/20888/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20888", "date": "2021-12-07T21:24:13", "name": "app/test: enable subset of tests on Windows", "version": 12, "mbox": "http://patchwork.dpdk.org/series/20888/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/105009/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/105009/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C9D57A00C3;\n\tTue, 7 Dec 2021 22:25:26 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7F59042763;\n\tTue, 7 Dec 2021 22:24:41 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 8D4E741152\n for <dev@dpdk.org>; Tue, 7 Dec 2021 22:24:28 +0100 (CET)", "from\n linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net\n (linux.microsoft.com [13.77.154.182])\n by linux.microsoft.com (Postfix) with ESMTPSA id CA45E20B717B;\n Tue, 7 Dec 2021 13:24:27 -0800 (PST)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com CA45E20B717B", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1638912267;\n bh=o41ScpEYZKVq1GzakYq2DAZfj2SJlO1bIqNPQHaPTL8=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=Q648yVugUN0QIG9nxJo8LdxFaahL3ZvOSgp1ViB3QHIav0O+ZOBEYnyXL/h+hPsmy\n vLg8QtpCxURufRLuwhVEmuc5Bzr6bS6484+GPOOBsFMvzESNMFTun6r/1exxLa918Z\n Btt7M9x7DlEPYg+/qwPV4aYLL1Ev6LGJ87dGcxgo=", "From": "Jie Zhou <jizh@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "dmitry.kozliuk@gmail.com, bruce.richardson@intel.com,\n roretzla@microsoft.com, navasile@linux.microsoft.com,\n dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com,\n thomas@monjalon.net, aconole@redhat.com", "Subject": "[PATCH v12 02/11] app/test: remove POSIX-specific code", "Date": "Tue, 7 Dec 2021 13:24:14 -0800", "Message-Id": "<1638912263-7054-3-git-send-email-jizh@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1638912263-7054-1-git-send-email-jizh@linux.microsoft.com>", "References": "<1638490007-9939-1-git-send-email-jizh@linux.microsoft.com>\n <1638912263-7054-1-git-send-email-jizh@linux.microsoft.com>", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "- Replace POSIX-specific code with DPDK equivalents or conditional platform\n specific code, or conditionally disable it on Windows\n- Use NUL on Windows as /dev/null for Unix\n- Exclude tests not supported on Windows yet\n * multi-process\n * PMD performance statistics display on signal\n\nSigned-off-by: Jie Zhou <jizh@linux.microsoft.com>\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\n\n---\n app/test/commands.c | 2 --\n app/test/packet_burst_generator.c | 1 +\n app/test/process.h | 4 +++-\n app/test/test.c | 5 ++++-\n app/test/test_byteorder.c | 2 +-\n app/test/test_cmdline_ipaddr.c | 19 +++++++++----------\n app/test/test_cmdline_lib.c | 13 +++++++++----\n app/test/test_crc.c | 1 -\n app/test/test_memcpy_perf.c | 28 ++++++++++++++--------------\n app/test/test_pmd_perf.c | 6 +++++-\n app/test/test_ring_stress_impl.h | 2 +-\n app/test/test_telemetry_data.c | 2 ++\n 12 files changed, 49 insertions(+), 36 deletions(-)", "diff": "diff --git a/app/test/commands.c b/app/test/commands.c\nindex 2dced3bc44..887cabad64 100644\n--- a/app/test/commands.c\n+++ b/app/test/commands.c\n@@ -8,8 +8,6 @@\n #include <stdint.h>\n #include <string.h>\n #include <stdlib.h>\n-#include <netinet/in.h>\n-#include <termios.h>\n #include <inttypes.h>\n #include <errno.h>\n #include <sys/queue.h>\ndiff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c\nindex 8ac24577ba..6b42b9b83b 100644\n--- a/app/test/packet_burst_generator.c\n+++ b/app/test/packet_burst_generator.c\n@@ -5,6 +5,7 @@\n #include <rte_byteorder.h>\n #include <rte_mbuf.h>\n #include <rte_ip.h>\n+#include <rte_os_shim.h>\n \n #include \"packet_burst_generator.h\"\n \ndiff --git a/app/test/process.h b/app/test/process.h\nindex 5b10cf64df..1f073b9c5c 100644\n--- a/app/test/process.h\n+++ b/app/test/process.h\n@@ -7,12 +7,14 @@\n \n #include <errno.h> /* errno */\n #include <limits.h> /* PATH_MAX */\n+#ifndef RTE_EXEC_ENV_WINDOWS\n #include <libgen.h> /* basename et al */\n+#include <sys/wait.h>\n+#endif\n #include <stdlib.h> /* NULL */\n #include <string.h> /* strerror */\n #include <unistd.h> /* readlink */\n #include <dirent.h>\n-#include <sys/wait.h>\n \n #include <rte_string_fns.h> /* strlcpy */\n \ndiff --git a/app/test/test.c b/app/test/test.c\nindex 5194131026..e69cae3eea 100644\n--- a/app/test/test.c\n+++ b/app/test/test.c\n@@ -8,7 +8,6 @@\n #include <stdarg.h>\n #include <stdlib.h>\n #include <errno.h>\n-#include <termios.h>\n #include <ctype.h>\n #include <sys/queue.h>\n \n@@ -63,7 +62,9 @@ do_recursive_call(void)\n \t\tconst char *env_var;\n \t\tint (*action_fn)(void);\n \t} actions[] = {\n+#ifndef RTE_EXEC_ENV_WINDOWS\n \t\t\t{ \"run_secondary_instances\", test_mp_secondary },\n+#endif\n #ifdef RTE_LIB_PDUMP\n #ifdef RTE_NET_RING\n \t\t\t{ \"run_pdump_server_tests\", test_pdump },\n@@ -82,7 +83,9 @@ do_recursive_call(void)\n \t\t\t{ \"test_file_prefix\", no_action },\n \t\t\t{ \"test_no_huge_flag\", no_action },\n #ifdef RTE_LIB_TIMER\n+#ifndef RTE_EXEC_ENV_WINDOWS\n \t\t\t{ \"timer_secondary_spawn_wait\", test_timer_secondary },\n+#endif\n #endif\n \t};\n \ndiff --git a/app/test/test_byteorder.c b/app/test/test_byteorder.c\nindex 03c08d9abf..de14ed539e 100644\n--- a/app/test/test_byteorder.c\n+++ b/app/test/test_byteorder.c\n@@ -46,7 +46,7 @@ test_byteorder(void)\n \t\treturn -1;\n \n \tres_u16 = rte_bswap16(0x1337);\n-\tprintf(\"const %\"PRIx16\" -> %\"PRIx16\"\\n\", 0x1337, res_u16);\n+\tprintf(\"const %\"PRIx16\" -> %\"PRIx16\"\\n\", (uint16_t)0x1337, res_u16);\n \tif (res_u16 != 0x3713)\n \t\treturn -1;\n \ndiff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c\nindex 2a1ee120fc..278fa3cd79 100644\n--- a/app/test/test_cmdline_ipaddr.c\n+++ b/app/test/test_cmdline_ipaddr.c\n@@ -1,12 +1,9 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n * Copyright(c) 2010-2014 Intel Corporation\n */\n-\n #include <stdio.h>\n #include <string.h>\n #include <inttypes.h>\n-#include <netinet/in.h>\n-#include <sys/socket.h>\n \n #include <rte_string_fns.h>\n \n@@ -15,17 +12,21 @@\n \n #include \"test_cmdline.h\"\n \n-#define IP4(a,b,c,d) {((uint32_t)(((a) & 0xff)) | \\\n-\t\t\t\t\t (((b) & 0xff) << 8) | \\\n-\t\t\t\t\t (((c) & 0xff) << 16) | \\\n-\t\t\t\t\t ((d) & 0xff) << 24)}\n+#define IP4(a,b,c,d) {.s_addr = (uint32_t)(((a) & 0xff) | \\\n+\t\t\t\t\t (((b) & 0xff) << 8) | \\\n+\t\t\t\t\t (((c) & 0xff) << 16) | \\\n+\t\t\t\t\t ((d) & 0xff) << 24)}\n \n #define U16_SWAP(x) \\\n \t\t(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8))\n \n /* create IPv6 address, swapping bytes where needed */\n #ifndef s6_addr16\n-# define s6_addr16 __u6_addr.__u6_addr16\n+#ifdef RTE_EXEC_ENV_WINDOWS\n+#define s6_addr16 u.Word\n+#else\n+#define s6_addr16 __u6_addr.__u6_addr16\n+#endif\n #endif\n #define IP6(a,b,c,d,e,f,g,h) .ipv6 = \\\n \t\t{.s6_addr16 = \\\n@@ -166,8 +167,6 @@ const char * ipaddr_garbage_network6_strs[] = {\n };\n #define IPv6_GARBAGE_PREFIX 64\n \n-\n-\n const char * ipaddr_invalid_strs[] = {\n \t\t/** IPv4 **/\n \ndiff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c\nindex f50ccdb599..fcd58cb76a 100644\n--- a/app/test/test_cmdline_lib.c\n+++ b/app/test/test_cmdline_lib.c\n@@ -8,7 +8,6 @@\n #include <stdarg.h>\n #include <stdlib.h>\n #include <errno.h>\n-#include <termios.h>\n #include <ctype.h>\n #include <sys/queue.h>\n \n@@ -22,6 +21,12 @@\n \n #include \"test_cmdline.h\"\n \n+#ifndef RTE_EXEC_ENV_WINDOWS\n+#define NULL_INPUT \"/dev/null\"\n+#else\n+#define NULL_INPUT \"NUL\"\n+#endif\n+\n /****************************************************************/\n /* static functions required for some tests */\n static void\n@@ -156,10 +161,10 @@ test_cmdline_socket_fns(void)\n \tcl = cmdline_stdin_new(&ctx, NULL);\n \tif (cl != NULL)\n \t\tgoto error;\n-\tcl = cmdline_file_new(NULL, \"prompt\", \"/dev/null\");\n+\tcl = cmdline_file_new(NULL, \"prompt\", NULL_INPUT);\n \tif (cl != NULL)\n \t\tgoto error;\n-\tcl = cmdline_file_new(&ctx, NULL, \"/dev/null\");\n+\tcl = cmdline_file_new(&ctx, NULL, NULL_INPUT);\n \tif (cl != NULL)\n \t\tgoto error;\n \tcl = cmdline_file_new(&ctx, \"prompt\", NULL);\n@@ -171,7 +176,7 @@ test_cmdline_socket_fns(void)\n \t\tcmdline_free(cl);\n \t\treturn -1;\n \t}\n-\tcl = cmdline_file_new(&ctx, \"prompt\", \"/dev/null\");\n+\tcl = cmdline_file_new(&ctx, \"prompt\", NULL_INPUT);\n \tif (cl == NULL) {\n \t\tprintf(\"Error: failed to open /dev/null for reading!\");\n \t\treturn -1;\ndiff --git a/app/test/test_crc.c b/app/test/test_crc.c\nindex bf1d344359..0ed080e482 100644\n--- a/app/test/test_crc.c\n+++ b/app/test/test_crc.c\n@@ -14,7 +14,6 @@\n #define CRC32_VEC_LEN2 348\n #define CRC16_VEC_LEN1 12\n #define CRC16_VEC_LEN2 2\n-#define LINE_LEN 75\n \n /* CRC test vector */\n static const uint8_t crc_vec[CRC_VEC_LEN] = {\ndiff --git a/app/test/test_memcpy_perf.c b/app/test/test_memcpy_perf.c\nindex c711e36ba7..0dc88ed39c 100644\n--- a/app/test/test_memcpy_perf.c\n+++ b/app/test/test_memcpy_perf.c\n@@ -6,10 +6,10 @@\n #include <stdio.h>\n #include <string.h>\n #include <stdlib.h>\n-#include <sys/time.h>\n \n #include <rte_common.h>\n #include <rte_cycles.h>\n+#include <rte_os_shim.h>\n #include <rte_random.h>\n #include <rte_malloc.h>\n \n@@ -271,7 +271,7 @@ static int\n perf_test(void)\n {\n \tint ret;\n-\tstruct timeval tv_begin, tv_end;\n+\tstruct timespec tv_begin, tv_end;\n \tdouble time_aligned, time_unaligned;\n \tdouble time_aligned_const, time_unaligned_const;\n \n@@ -298,32 +298,32 @@ perf_test(void)\n \tprintf(\"\\n================================= %2dB aligned =================================\",\n \t\tALIGNMENT_UNIT);\n \t/* Do aligned tests where size is a variable */\n-\tgettimeofday(&tv_begin, NULL);\n+\ttimespec_get(&tv_begin, TIME_UTC);\n \tperf_test_variable_aligned();\n-\tgettimeofday(&tv_end, NULL);\n+\ttimespec_get(&tv_end, TIME_UTC);\n \ttime_aligned = (double)(tv_end.tv_sec - tv_begin.tv_sec)\n-\t\t+ ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;\n+\t\t+ ((double)tv_end.tv_nsec - tv_begin.tv_nsec) / NS_PER_S;\n \tprintf(\"\\n------- ----------------- ----------------- ----------------- -----------------\");\n \t/* Do aligned tests where size is a compile-time constant */\n-\tgettimeofday(&tv_begin, NULL);\n+\ttimespec_get(&tv_begin, TIME_UTC);\n \tperf_test_constant_aligned();\n-\tgettimeofday(&tv_end, NULL);\n+\ttimespec_get(&tv_end, TIME_UTC);\n \ttime_aligned_const = (double)(tv_end.tv_sec - tv_begin.tv_sec)\n-\t\t+ ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;\n+\t\t+ ((double)tv_end.tv_nsec - tv_begin.tv_nsec) / NS_PER_S;\n \tprintf(\"\\n================================== Unaligned ==================================\");\n \t/* Do unaligned tests where size is a variable */\n-\tgettimeofday(&tv_begin, NULL);\n+\ttimespec_get(&tv_begin, TIME_UTC);\n \tperf_test_variable_unaligned();\n-\tgettimeofday(&tv_end, NULL);\n+\ttimespec_get(&tv_end, TIME_UTC);\n \ttime_unaligned = (double)(tv_end.tv_sec - tv_begin.tv_sec)\n-\t\t+ ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;\n+\t\t+ ((double)tv_end.tv_nsec - tv_begin.tv_nsec) / NS_PER_S;\n \tprintf(\"\\n------- ----------------- ----------------- ----------------- -----------------\");\n \t/* Do unaligned tests where size is a compile-time constant */\n-\tgettimeofday(&tv_begin, NULL);\n+\ttimespec_get(&tv_begin, TIME_UTC);\n \tperf_test_constant_unaligned();\n-\tgettimeofday(&tv_end, NULL);\n+\ttimespec_get(&tv_end, TIME_UTC);\n \ttime_unaligned_const = (double)(tv_end.tv_sec - tv_begin.tv_sec)\n-\t\t+ ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;\n+\t\t+ ((double)tv_end.tv_nsec - tv_begin.tv_nsec) / NS_PER_S;\n \tprintf(\"\\n======= ================= ================= ================= =================\\n\\n\");\n \n \tprintf(\"Test Execution Time (seconds):\\n\");\ndiff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c\nindex 0aa9dc1b1c..25611bfe9b 100644\n--- a/app/test/test_pmd_perf.c\n+++ b/app/test/test_pmd_perf.c\n@@ -296,6 +296,7 @@ reset_count(void)\n \tidle = 0;\n }\n \n+#ifndef RTE_EXEC_ENV_WINDOWS\n static void\n stats_display(uint16_t port_id)\n {\n@@ -325,6 +326,7 @@ signal_handler(int signum)\n \tif (signum == SIGUSR2)\n \t\tstats_display(0);\n }\n+#endif\n \n struct rte_mbuf **tx_burst;\n \n@@ -638,7 +640,7 @@ exec_burst(uint32_t flags, int lcore)\n \t\ti = (i >= conf->nb_ports - 1) ? 0 : (i + 1);\n \t}\n \n-\tsleep(5);\n+\trte_delay_us(5 * US_PER_S);\n \n \t/* only when polling second */\n \tif (flags == SC_BURST_XMIT_FIRST)\n@@ -669,8 +671,10 @@ test_pmd_perf(void)\n \n \tprintf(\"Start PMD RXTX cycles cost test.\\n\");\n \n+#ifndef RTE_EXEC_ENV_WINDOWS\n \tsignal(SIGUSR1, signal_handler);\n \tsignal(SIGUSR2, signal_handler);\n+#endif\n \n \tnb_ports = rte_eth_dev_count_avail();\n \tif (nb_ports < NB_ETHPORTS_USED) {\ndiff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h\nindex 2825a9dce6..62f046a91a 100644\n--- a/app/test/test_ring_stress_impl.h\n+++ b/app/test/test_ring_stress_impl.h\n@@ -360,7 +360,7 @@ test_mt1(int (*test)(void *))\n \t/* signal worker to start test */\n \t__atomic_store_n(&wrk_cmd, WRK_CMD_RUN, __ATOMIC_RELEASE);\n \n-\tusleep(run_time * US_PER_S);\n+\trte_delay_us(run_time * US_PER_S);\n \n \t/* signal worker to start test */\n \t__atomic_store_n(&wrk_cmd, WRK_CMD_STOP, __ATOMIC_RELEASE);\ndiff --git a/app/test/test_telemetry_data.c b/app/test/test_telemetry_data.c\nindex 18b93db8ef..73eee293a1 100644\n--- a/app/test/test_telemetry_data.c\n+++ b/app/test/test_telemetry_data.c\n@@ -4,7 +4,9 @@\n \n #include <string.h>\n #include <sys/socket.h>\n+#ifndef RTE_EXEC_ENV_WINDOWS\n #include <sys/un.h>\n+#endif\n #include <unistd.h>\n #include <limits.h>\n \n", "prefixes": [ "v12", "02/11" ] }{ "id": 105009, "url": "