get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124158,
    "url": "http://patches.dpdk.org/api/patches/124158/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230219231416.22524-4-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<20230219231416.22524-4-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230219231416.22524-4-stephen@networkplumber.org",
    "date": "2023-02-19T23:14:10",
    "name": "[v4,3/9] lpm: enable on Windows",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fe261f32813ab6ccd6603631e72237634b370d94",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230219231416.22524-4-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 27076,
            "url": "http://patches.dpdk.org/api/series/27076/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27076",
            "date": "2023-02-19T23:14:07",
            "name": "Enable building more libraries on Windows",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/27076/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/124158/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/124158/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 60A4041CE4;\n\tMon, 20 Feb 2023 00:14:38 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8F7AE42D94;\n\tMon, 20 Feb 2023 00:14:30 +0100 (CET)",
            "from mail-pj1-f47.google.com (mail-pj1-f47.google.com\n [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 7236F42D7E\n for <dev@dpdk.org>; Mon, 20 Feb 2023 00:14:23 +0100 (CET)",
            "by mail-pj1-f47.google.com with SMTP id ot9so1506846pjb.3\n for <dev@dpdk.org>; Sun, 19 Feb 2023 15:14:23 -0800 (PST)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n l10-20020a170902d34a00b00192fe452e17sm683336plk.162.2023.02.19.15.14.21\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 19 Feb 2023 15:14:21 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20210112.gappssmtp.com; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=1XH+YIdS2J0+gUtw3hNcVseB7jI92w+W7yJ531/tnpU=;\n b=PpGTGGWriVeBLjapj211BWF3vqIZZsOaSCxbcUu/dVfGTurT0TaWLvoTUi+QptRU16\n 6lfvQtqkPqDPZF5Kfo4huwH4JXSVHgQCjwbWw8LHlkrvgFj40+jf/yoczFGshYCUGCyq\n xMFsaIhijnY/DD0HZT7PzH9xEaWq2Woqzi11RV8myq+v8Als+SCF6PTL3F7CxHpYD/Sf\n zz6Ru0aT8r88od0H4ozG8T6quJ0egCqu5TA5Ff+ccr/Zt+khaQ4T8F8/wz1bjM4yS2uS\n RYacgLFw19238DcGboyZgH0RzQQJJrKaueqC7bO25oqjw1+yMkJVxn9lPz8PG8STX8zr\n SrIg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=1XH+YIdS2J0+gUtw3hNcVseB7jI92w+W7yJ531/tnpU=;\n b=bRXQlsx1YdltHZQw+1hCt2oMgzlDnTH9IB43Mjkgqkt+KngFragfzywT+ACooSP0nk\n DdxRFrHZHCwAkOFcHQZvynQc5jVOES2NdbdocbkUKnDQ1WhgWaGVfhHuG6rTi5cqFiEJ\n QxQzcn6LGI16vaMOB+6xHuarG40vCFcGvbyMjUqMTkrSgk183zHJjPlbV644GStFtPK9\n +21ND4Qy7mmfWTzM1GYW8z+mLMjF9mjS2IqWWzgRw4e8PG84LcHbuyRQbWo2/ojY/S5R\n o74DqjhRb8C5XRfo+Y9udQ8ETz72lGEUfoEN46rg9GxBN7URVne+yEOkxR/CWkt3Pso+\n JydA==",
        "X-Gm-Message-State": "AO0yUKU66TEy6HAA3uxpNMC/265YwhS3eu01C5o26BwVSru34tpYQy5U\n QxbM7r8WCrp2bVj6ABQKJCotrSxIQgnLuTMokh0=",
        "X-Google-Smtp-Source": "\n AK7set+uW5IHXf5523nYwZX3YE3AhNg0Db1i5HYsKiUN0FNtLljazf7TH/SgIR5UiEEGcnoAWy5xZw==",
        "X-Received": "by 2002:a17:902:ecc7:b0:19a:f9b5:2f2f with SMTP id\n a7-20020a170902ecc700b0019af9b52f2fmr2138323plh.55.1676848462297;\n Sun, 19 Feb 2023 15:14:22 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "Subject": "[PATCH v4 3/9] lpm: enable on Windows",
        "Date": "Sun, 19 Feb 2023 15:14:10 -0800",
        "Message-Id": "<20230219231416.22524-4-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.1",
        "In-Reply-To": "<20230219231416.22524-1-stephen@networkplumber.org>",
        "References": "<20230207001937.875608-1-stephen@networkplumber.org>\n <20230219231416.22524-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "This builds on Windows without changes.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n app/test/test_lpm.c       | 15 +--------------\n app/test/test_lpm6.c      | 12 ------------\n app/test/test_lpm6_data.h |  3 ++-\n app/test/test_lpm6_perf.c | 14 +-------------\n app/test/test_lpm_perf.c  | 39 ++++++++++++---------------------------\n lib/lpm/meson.build       |  6 ------\n 6 files changed, 16 insertions(+), 73 deletions(-)",
    "diff": "diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c\nindex bceb9ae743d7..37b460af3a96 100644\n--- a/app/test/test_lpm.c\n+++ b/app/test/test_lpm.c\n@@ -2,18 +2,6 @@\n  * Copyright(c) 2010-2014 Intel Corporation\n  */\n \n-#include \"test.h\"\n-\n-#ifdef RTE_EXEC_ENV_WINDOWS\n-static int\n-test_lpm(void)\n-{\n-\tprintf(\"lpm not supported on Windows, skipping test\\n\");\n-\treturn TEST_SKIPPED;\n-}\n-\n-#else\n-\n #include <stdio.h>\n #include <stdint.h>\n #include <stdlib.h>\n@@ -22,6 +10,7 @@ test_lpm(void)\n #include <rte_lpm.h>\n #include <rte_malloc.h>\n \n+#include \"test.h\"\n #include \"test_xmmt_ops.h\"\n \n #define TEST_LPM_ASSERT(cond) do {                                            \\\n@@ -1595,6 +1584,4 @@ test_lpm(void)\n \treturn global_status;\n }\n \n-#endif /* !RTE_EXEC_ENV_WINDOWS */\n-\n REGISTER_TEST_COMMAND(lpm_autotest, test_lpm);\ndiff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c\nindex 1f44392db739..b6b6f8615ea5 100644\n--- a/app/test/test_lpm6.c\n+++ b/app/test/test_lpm6.c\n@@ -10,16 +10,6 @@\n #include <string.h>\n \n #include <rte_memory.h>\n-#ifdef RTE_EXEC_ENV_WINDOWS\n-static int\n-test_lpm6(void)\n-{\n-\tprintf(\"lpm6 not supported on Windows, skipping test\\n\");\n-\treturn TEST_SKIPPED;\n-}\n-\n-#else\n-\n #include <rte_lpm6.h>\n \n #include \"test_lpm6_data.h\"\n@@ -1803,6 +1793,4 @@ test_lpm6(void)\n \treturn global_status;\n }\n \n-#endif /* !RTE_EXEC_ENV_WINDOWS */\n-\n REGISTER_TEST_COMMAND(lpm6_autotest, test_lpm6);\ndiff --git a/app/test/test_lpm6_data.h b/app/test/test_lpm6_data.h\nindex da9b161f20e5..3a1fa25f8433 100644\n--- a/app/test/test_lpm6_data.h\n+++ b/app/test/test_lpm6_data.h\n@@ -6,6 +6,7 @@\n \n #include <stdint.h>\n #include <stdlib.h>\n+#include <rte_random.h>\n \n struct rules_tbl_entry {\n \tuint8_t ip[16];\n@@ -1129,7 +1130,7 @@ static void generate_large_ips_table(int gen_expected_next_hop)\n \n \tfor (i = 0; i < NUM_IPS_ENTRIES; i++) {\n \t\tfor (j = 0; j < 16; j++)\n-\t\t\tlarge_ips_table[i].ip[j] = lrand48();\n+\t\t\tlarge_ips_table[i].ip[j] = rte_rand();\n \t}\n \n \tfor (k = j = 0, i = 0; i < NUM_IPS_ENTRIES; i++) {\ndiff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c\nindex aaf2773b6fac..5b684686a687 100644\n--- a/app/test/test_lpm6_perf.c\n+++ b/app/test/test_lpm6_perf.c\n@@ -2,17 +2,6 @@\n  * Copyright(c) 2010-2014 Intel Corporation\n  */\n \n-#include \"test.h\"\n-\n-#ifdef RTE_EXEC_ENV_WINDOWS\n-static int\n-test_lpm6_perf(void)\n-{\n-\tprintf(\"lpm6_perf not supported on Windows, skipping test\\n\");\n-\treturn TEST_SKIPPED;\n-}\n-\n-#else\n \n #include <stdio.h>\n #include <stdint.h>\n@@ -24,6 +13,7 @@ test_lpm6_perf(void)\n #include <rte_memory.h>\n #include <rte_lpm6.h>\n \n+#include \"test.h\"\n #include \"test_lpm6_data.h\"\n \n #define TEST_LPM_ASSERT(cond) do {                                            \\\n@@ -171,6 +161,4 @@ test_lpm6_perf(void)\n \treturn 0;\n }\n \n-#endif /* !RTE_EXEC_ENV_WINDOWS */\n-\n REGISTER_TEST_COMMAND(lpm6_perf_autotest, test_lpm6_perf);\ndiff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c\nindex e858716f909b..e72437ba3850 100644\n--- a/app/test/test_lpm_perf.c\n+++ b/app/test/test_lpm_perf.c\n@@ -3,17 +3,6 @@\n  * Copyright(c) 2020 Arm Limited\n  */\n \n-#include \"test.h\"\n-\n-#ifdef RTE_EXEC_ENV_WINDOWS\n-static int\n-test_lpm_perf(void)\n-{\n-\tprintf(\"lpm_perf not supported on Windows, skipping test\\n\");\n-\treturn TEST_SKIPPED;\n-}\n-\n-#else\n #include <stdio.h>\n #include <stdint.h>\n #include <stdlib.h>\n@@ -25,7 +14,9 @@ test_lpm_perf(void)\n #include <rte_malloc.h>\n #include <rte_ip.h>\n #include <rte_lpm.h>\n+#include <rte_spinlock.h>\n \n+#include \"test.h\"\n #include \"test_xmmt_ops.h\"\n \n struct rte_lpm *lpm;\n@@ -34,8 +25,9 @@ static volatile uint8_t writer_done;\n static volatile uint32_t thr_id;\n static uint64_t gwrite_cycles;\n static uint32_t num_writers;\n-/* LPM APIs are not thread safe, use mutex to provide thread safety */\n-static pthread_mutex_t lpm_mutex = PTHREAD_MUTEX_INITIALIZER;\n+\n+/* LPM APIs are not thread safe, use spinlock */\n+static rte_spinlock_t lpm_lock = RTE_SPINLOCK_INITIALIZER;\n \n /* Report quiescent state interval every 1024 lookups. Larger critical\n  * sections in reader will result in writer polling multiple times.\n@@ -267,7 +259,7 @@ static void generate_random_rule_prefix(uint32_t ip_class, uint8_t depth)\n \t/* Only generate rest bits except the most significant\n \t * fixed bits for IP address class\n \t */\n-\tstart = lrand48() & mask;\n+\tstart = rte_rand() & mask;\n \tptr_rule = &large_route_table[num_route_entries];\n \tptr_ldepth_rule = &large_ldepth_route_table[num_ldepth_route_entries];\n \tfor (k = 0; k < rule_num; k++) {\n@@ -296,7 +288,7 @@ static void insert_rule_in_random_pos(uint32_t ip, uint8_t depth)\n \tstruct route_rule tmp;\n \n \tdo {\n-\t\tpos = lrand48();\n+\t\tpos = rte_rand();\n \t\ttry_count++;\n \t} while ((try_count < 10) && (pos > num_route_entries));\n \n@@ -452,8 +444,7 @@ test_lpm_rcu_qsbr_writer(void *arg)\n \tfor (i = 0; i < RCU_ITERATIONS; i++) {\n \t\t/* Add all the entries */\n \t\tfor (j = si; j < ei; j++) {\n-\t\t\tif (num_writers > 1)\n-\t\t\t\tpthread_mutex_lock(&lpm_mutex);\n+\t\t\trte_spinlock_lock(&lpm_lock);\n \t\t\tif (rte_lpm_add(lpm, large_ldepth_route_table[j].ip,\n \t\t\t\t\tlarge_ldepth_route_table[j].depth,\n \t\t\t\t\tnext_hop_add) != 0) {\n@@ -461,22 +452,19 @@ test_lpm_rcu_qsbr_writer(void *arg)\n \t\t\t\t\ti, j);\n \t\t\t\tgoto error;\n \t\t\t}\n-\t\t\tif (num_writers > 1)\n-\t\t\t\tpthread_mutex_unlock(&lpm_mutex);\n+\t\t\trte_spinlock_unlock(&lpm_lock);\n \t\t}\n \n \t\t/* Delete all the entries */\n \t\tfor (j = si; j < ei; j++) {\n-\t\t\tif (num_writers > 1)\n-\t\t\t\tpthread_mutex_lock(&lpm_mutex);\n+\t\t\trte_spinlock_lock(&lpm_lock);\n \t\t\tif (rte_lpm_delete(lpm, large_ldepth_route_table[j].ip,\n \t\t\t\tlarge_ldepth_route_table[j].depth) != 0) {\n \t\t\t\tprintf(\"Failed to delete iteration %d, route# %d\\n\",\n \t\t\t\t\ti, j);\n \t\t\t\tgoto error;\n \t\t\t}\n-\t\t\tif (num_writers > 1)\n-\t\t\t\tpthread_mutex_unlock(&lpm_mutex);\n+\t\t\trte_spinlock_unlock(&lpm_lock);\n \t\t}\n \t}\n \n@@ -487,8 +475,7 @@ test_lpm_rcu_qsbr_writer(void *arg)\n \treturn 0;\n \n error:\n-\tif (num_writers > 1)\n-\t\tpthread_mutex_unlock(&lpm_mutex);\n+\trte_spinlock_unlock(&lpm_lock);\n \treturn -1;\n }\n \n@@ -773,6 +760,4 @@ test_lpm_perf(void)\n \treturn 0;\n }\n \n-#endif /* !RTE_EXEC_ENV_WINDOWS */\n-\n REGISTER_TEST_COMMAND(lpm_perf_autotest, test_lpm_perf);\ndiff --git a/lib/lpm/meson.build b/lib/lpm/meson.build\nindex 6b47361fcec0..4cd48886fc41 100644\n--- a/lib/lpm/meson.build\n+++ b/lib/lpm/meson.build\n@@ -1,12 +1,6 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2017 Intel Corporation\n \n-if is_windows\n-    build = false\n-    reason = 'not supported on Windows'\n-    subdir_done()\n-endif\n-\n sources = files('rte_lpm.c', 'rte_lpm6.c')\n headers = files('rte_lpm.h', 'rte_lpm6.h')\n # since header files have different names, we can install all vector headers\n",
    "prefixes": [
        "v4",
        "3/9"
    ]
}