get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129459,
    "url": "http://patchwork.dpdk.org/api/patches/129459/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1689094157-16873-5-git-send-email-roretzla@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": "<1689094157-16873-5-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1689094157-16873-5-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-07-11T16:49:07",
    "name": "[v9,04/14] eal: use cpuid and cpuidex intrinsics",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0b83f1bc0c06743e051a23626e546d2c440aa134",
    "submitter": {
        "id": 2077,
        "url": "http://patchwork.dpdk.org/api/people/2077/?format=api",
        "name": "Tyler Retzlaff",
        "email": "roretzla@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/1689094157-16873-5-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 28906,
            "url": "http://patchwork.dpdk.org/api/series/28906/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28906",
            "date": "2023-07-11T16:49:04",
            "name": "msvc integration changes",
            "version": 9,
            "mbox": "http://patchwork.dpdk.org/series/28906/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129459/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129459/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 9F33242E48;\n\tTue, 11 Jul 2023 18:49:44 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3E84642D10;\n\tTue, 11 Jul 2023 18:49:25 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 832DA410DC\n for <dev@dpdk.org>; Tue, 11 Jul 2023 18:49:19 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id B61B521C3F06; Tue, 11 Jul 2023 09:49:18 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com B61B521C3F06",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1689094158;\n bh=bPgAm+R23dJoygVwnfMeNv3Rc6j/VXQwtzi9fLarLXU=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=dmYpxxJGKbQdvSyz+502TjTEF8aAHENFDOPxu6BtpiJAj6B1rJOtpfMvhQuzGwCOH\n BqE5ZxArhX1iJ3wCnWZzdviZHawyM8A5qRd40UUS3MryhnwVexDZ78TliPBRX1zbaq\n zchGVy8kKMETk36+Zl1eYxnSaEsvHQI2SrGL2DrM=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>,\n Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,\n Ciara Power <ciara.power@intel.com>, thomas@monjalon.net,\n david.marchand@redhat.com, mb@smartsharesystems.com,\n Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH v9 04/14] eal: use cpuid and cpuidex intrinsics",
        "Date": "Tue, 11 Jul 2023 09:49:07 -0700",
        "Message-Id": "<1689094157-16873-5-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1689094157-16873-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com>\n <1689094157-16873-1-git-send-email-roretzla@linux.microsoft.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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": "Inline assembly is not supported for MSVC x64 instead use __cpuid\nand __cpuidex intrinsics.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n lib/eal/x86/rte_cpuflags.c   |  6 +++++-\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, 52 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/eal/x86/rte_cpuflags.c b/lib/eal/x86/rte_cpuflags.c\nindex d6b5182..8a30f79 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-\t __cpuid_count(feat->leaf, feat->subleaf,\n+#ifdef RTE_TOOLCHAIN_MSVC\n+\t__cpuidex(regs, feat->leaf, feat->subleaf);\n+#else\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+#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..69ed59b 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+#ifdef RTE_TOOLCHAIN_MSVC\n+#define bit_AVX (1 << 28)\n+#else\n #include <cpuid.h>\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+#ifdef RTE_TOOLCHAIN_MSVC\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+#else\n \t\t__cpuid(0x15, a, b, c, d);\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+#ifdef RTE_TOOLCHAIN_MSVC\n+\t__cpuid(cpuinfo, 0x1);\n+\ta = cpuinfo[0];\n+\tb = cpuinfo[1];\n+\tc = cpuinfo[2];\n+\td = cpuinfo[3];\n+#else\n \t__cpuid(0x1, a, b, c, d);\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..04fe767 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+#ifdef RTE_TOOLCHAIN_MSVC\n+\t__cpuid(regs, HYPERVISOR_INFO_LEAF);\n+#else\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+#endif\n \tfor (reg = 1; reg < 4; reg++)\n \t\tmemcpy(name + (reg - 1) * 4, &regs[reg], 4);\n \tname[12] = '\\0';\n",
    "prefixes": [
        "v9",
        "04/14"
    ]
}