get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/105031/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 105031,
    "url": "http://patchwork.dpdk.org/api/patches/105031/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1638990000-3228-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": "<1638990000-3228-3-git-send-email-jizh@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1638990000-3228-3-git-send-email-jizh@linux.microsoft.com",
    "date": "2021-12-08T18:59:51",
    "name": "[v14,02/11] app/test: remove POSIX-specific code",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cdc10ac685e6381fdd0967e71d2366ff859fb5c7",
    "submitter": {
        "id": 1934,
        "url": "http://patchwork.dpdk.org/api/people/1934/?format=api",
        "name": "Jie Zhou",
        "email": "jizh@linux.microsoft.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1638990000-3228-3-git-send-email-jizh@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 20895,
            "url": "http://patchwork.dpdk.org/api/series/20895/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20895",
            "date": "2021-12-08T18:59:52",
            "name": "app/test: enable subset of tests on Windows",
            "version": 14,
            "mbox": "http://patchwork.dpdk.org/series/20895/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/105031/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/105031/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 2B885A00C2;\n\tWed,  8 Dec 2021 20:00:33 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2E21B426F9;\n\tWed,  8 Dec 2021 20:00:13 +0100 (CET)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id A4A3A4111B\n for <dev@dpdk.org>; Wed,  8 Dec 2021 20:00:06 +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 E33F620B717B;\n Wed,  8 Dec 2021 11:00:05 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com E33F620B717B",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1638990005;\n bh=I6SyQEzooUQo3TvEIh3LrYS1WO2fnQZn35NGY64YolE=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=Ff9B645Q+/xeRpbS1r8CC8Xbtb8xlO7e80dIt3P6JQC9/qLAzvQSzccu8aKIQjccc\n oiw9T0SfCdPnKzmExknTsWmYEyWPSxrfamsBhtWJpIEaGywlwt8PFEjId8z7OuDJIF\n fRywlhw0ZVITSUyVAj9TudyL9s9qvQWsiT1H0FhA=",
        "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 v14 02/11] app/test: remove POSIX-specific code",
        "Date": "Wed,  8 Dec 2021 10:59:51 -0800",
        "Message-Id": "<1638990000-3228-3-git-send-email-jizh@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1638990000-3228-1-git-send-email-jizh@linux.microsoft.com>",
        "References": "<1638928262-13177-1-git-send-email-jizh@linux.microsoft.com>\n <1638990000-3228-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\n  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    | 13 ++++++-------\n app/test/test_cmdline_lib.c       | 13 +++++++++----\n app/test/test_crc.c               |  1 -\n app/test/test_memcpy_perf.c       | 29 +++++++++++++++--------------\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, 47 insertions(+), 33 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..f540063508 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,7 +12,7 @@\n \n #include \"test_cmdline.h\"\n \n-#define IP4(a,b,c,d) {((uint32_t)(((a) & 0xff)) | \\\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@@ -25,7 +22,11 @@\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..3727c160e6 100644\n--- a/app/test/test_memcpy_perf.c\n+++ b/app/test/test_memcpy_perf.c\n@@ -6,10 +6,11 @@\n #include <stdio.h>\n #include <string.h>\n #include <stdlib.h>\n-#include <sys/time.h>\n+#include <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 +272,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 +299,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": [
        "v14",
        "02/11"
    ]
}