get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126128,
    "url": "http://patches.dpdk.org/api/patches/126128/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1681521346-20356-5-git-send-email-roretzla@linux.microsoft.com/",
    "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": "<1681521346-20356-5-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1681521346-20356-5-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-04-15T01:15:35",
    "name": "[v6,04/15] eal: use cpuid and cpuidex intrinsics",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d7548fdf5eedbf653773d43a059845bbf33c1c4f",
    "submitter": {
        "id": 2077,
        "url": "http://patches.dpdk.org/api/people/2077/?format=api",
        "name": "Tyler Retzlaff",
        "email": "roretzla@linux.microsoft.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1681521346-20356-5-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 27725,
            "url": "http://patches.dpdk.org/api/series/27725/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27725",
            "date": "2023-04-15T01:15:34",
            "name": "msvc integration changes",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/27725/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126128/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/126128/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 0C8D142946;\n\tSat, 15 Apr 2023 03:16:14 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9BD2742D12;\n\tSat, 15 Apr 2023 03:15:54 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id E52D6410F1\n for <dev@dpdk.org>; Sat, 15 Apr 2023 03:15:48 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 1FC74217A952; Fri, 14 Apr 2023 18:15:48 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 1FC74217A952",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1681521348;\n bh=QEbhk43xBKijIEQLnc+WbV50VNTIJ2/wSVboPo+RcK0=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=IX1cGJhFr3tgVnUtAqP5cxkL6sw3fRk00jSywu3KkqEf4rf5iFmVEfvtpm6qadIFE\n j+acXaOtNTVcAv83+Jp8q4QOpXnqVCCDr6I/jEUelBHoCVvG0YgY7ye6dK87V5V9Gy\n UpOwggWNE8fid434I98Y3MKprCE8V2R8z4iclAAw=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, david.marchand@redhat.com,\n thomas@monjalon.net,\n mb@smartsharesystems.com, konstantin.ananyev@huawei.com,\n Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH v6 04/15] eal: use cpuid and cpuidex intrinsics",
        "Date": "Fri, 14 Apr 2023 18:15:35 -0700",
        "Message-Id": "<1681521346-20356-5-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1681521346-20356-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com>\n <1681521346-20356-1-git-send-email-roretzla@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": "Inline assembly is not supported for MSVC x64 instead use __cpuid\nand __cpuidex intrinsics.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/eal/x86/rte_cpuflags.c   |  4 ++++\n lib/eal/x86/rte_cpuid.h      |  7 +++++++\n lib/eal/x86/rte_cycles.c     | 36 ++++++++++++++++++++++++++++++++++++\n lib/eal/x86/rte_hypervisor.c |  4 ++++\n 4 files changed, 51 insertions(+)",
    "diff": "diff --git a/lib/eal/x86/rte_cpuflags.c b/lib/eal/x86/rte_cpuflags.c\nindex d6b5182..e3624e7 100644\n--- a/lib/eal/x86/rte_cpuflags.c\n+++ b/lib/eal/x86/rte_cpuflags.c\n@@ -165,9 +165,13 @@ struct feature_entry {\n \tif (maxleaf < feat->leaf)\n \t\treturn 0;\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n \t __cpuid_count(feat->leaf, feat->subleaf,\n \t\t\t regs[RTE_REG_EAX], regs[RTE_REG_EBX],\n \t\t\t regs[RTE_REG_ECX], regs[RTE_REG_EDX]);\n+#else\n+\t__cpuidex(regs, feat->leaf, feat->subleaf);\n+#endif\n \n \t/* check if the feature is enabled */\n \treturn (regs[feat->reg] >> feat->bit) & 1;\ndiff --git a/lib/eal/x86/rte_cpuid.h b/lib/eal/x86/rte_cpuid.h\nindex b773ad9..c6abaad 100644\n--- a/lib/eal/x86/rte_cpuid.h\n+++ b/lib/eal/x86/rte_cpuid.h\n@@ -5,7 +5,9 @@\n #ifndef RTE_CPUID_H\n #define RTE_CPUID_H\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n #include <cpuid.h>\n+#endif\n \n enum cpu_register_t {\n \tRTE_REG_EAX = 0,\n@@ -16,4 +18,9 @@ enum cpu_register_t {\n \n typedef uint32_t cpuid_registers_t[4];\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+int\n+__get_cpuid_max(unsigned int e, unsigned int *s);\n+#endif\n+\n #endif /* RTE_CPUID_H */\ndiff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c\nindex 0e695ca..db56d39 100644\n--- a/lib/eal/x86/rte_cycles.c\n+++ b/lib/eal/x86/rte_cycles.c\n@@ -4,7 +4,11 @@\n \n #include <fcntl.h>\n #include <unistd.h>\n+#ifndef RTE_TOOLCHAIN_MSVC\n #include <cpuid.h>\n+#else\n+#define bit_AVX (1 << 28)\n+#endif\n \n \n #include \"eal_private.h\"\n@@ -82,9 +86,25 @@\n \treturn 0;\n }\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+int\n+__get_cpuid_max(unsigned int e, unsigned int *s)\n+{\n+\tuint32_t cpuinfo[4];\n+\n+\t__cpuid(cpuinfo, e);\n+\tif (s)\n+\t\t*s = cpuinfo[1];\n+\treturn cpuinfo[0];\n+}\n+#endif\n+\n uint64_t\n get_tsc_freq_arch(void)\n {\n+#ifdef RTE_TOOLCHAIN_MSVC\n+\tint cpuinfo[4];\n+#endif\n \tuint64_t tsc_hz = 0;\n \tuint32_t a, b, c, d, maxleaf;\n \tuint8_t mult, model;\n@@ -97,14 +117,30 @@\n \tmaxleaf = __get_cpuid_max(0, NULL);\n \n \tif (maxleaf >= 0x15) {\n+#ifndef RTE_TOOLCHAIN_MSVC\n \t\t__cpuid(0x15, a, b, c, d);\n+#else\n+\t\t__cpuid(cpuinfo, 0x15);\n+\t\ta = cpuinfo[0];\n+\t\tb = cpuinfo[1];\n+\t\tc = cpuinfo[2];\n+\t\td = cpuinfo[3];\n+#endif\n \n \t\t/* EBX : TSC/Crystal ratio, ECX : Crystal Hz */\n \t\tif (b && c)\n \t\t\treturn c * (b / a);\n \t}\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n \t__cpuid(0x1, a, b, c, d);\n+#else\n+\t__cpuid(cpuinfo, 0x1);\n+\ta = cpuinfo[0];\n+\tb = cpuinfo[1];\n+\tc = cpuinfo[2];\n+\td = cpuinfo[3];\n+#endif\n \tmodel = rte_cpu_get_model(a);\n \n \tif (check_model_wsm_nhm(model))\ndiff --git a/lib/eal/x86/rte_hypervisor.c b/lib/eal/x86/rte_hypervisor.c\nindex c38cfc0..a9c2017 100644\n--- a/lib/eal/x86/rte_hypervisor.c\n+++ b/lib/eal/x86/rte_hypervisor.c\n@@ -23,9 +23,13 @@ enum rte_hypervisor\n \tif (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_HYPERVISOR))\n \t\treturn RTE_HYPERVISOR_NONE;\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n \t__cpuid(HYPERVISOR_INFO_LEAF,\n \t\t\tregs[RTE_REG_EAX], regs[RTE_REG_EBX],\n \t\t\tregs[RTE_REG_ECX], regs[RTE_REG_EDX]);\n+#else\n+\t__cpuid(regs, HYPERVISOR_INFO_LEAF);\n+#endif\n \tfor (reg = 1; reg < 4; reg++)\n \t\tmemcpy(name + (reg - 1) * 4, &regs[reg], 4);\n \tname[12] = '\\0';\n",
    "prefixes": [
        "v6",
        "04/15"
    ]
}