get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131830,
    "url": "http://patches.dpdk.org/api/patches/131830/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230922093722.2057688-3-david.marchand@redhat.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": "<20230922093722.2057688-3-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230922093722.2057688-3-david.marchand@redhat.com",
    "date": "2023-09-22T09:37:21",
    "name": "[2/2] common/mlx5: use EAL x86 processor identification",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "b203e0dd2fc7c350c7561ae0d52ac0681290f0e3",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.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/20230922093722.2057688-3-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 29605,
            "url": "http://patches.dpdk.org/api/series/29605/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29605",
            "date": "2023-09-22T09:37:19",
            "name": "Introduce x86 specific identification API",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/29605/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/131830/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/131830/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 2FE8A42616;\n\tFri, 22 Sep 2023 11:37:50 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 21B60406B8;\n\tFri, 22 Sep 2023 11:37:50 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 99AED402DC\n for <dev@dpdk.org>; Fri, 22 Sep 2023 11:37:48 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-378-bLpJrWJUNfaN9lSUcJ2U0g-1; Fri, 22 Sep 2023 05:37:43 -0400",
            "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com\n [10.11.54.3])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 69D03800962;\n Fri, 22 Sep 2023 09:37:42 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.45.224.128])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 2B21210005D4;\n Fri, 22 Sep 2023 09:37:40 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1695375468;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=3L6AS3AHRPXVfZvexDGVDqkoJm9XSjTn2EnCH8qosk8=;\n b=XzCD4pGVXqUg++YsU5Yv7uX0mUXo6H6pk0dvncIHgySxzo2a1Q5ryPNYisVdA3PTeVfuQ7\n 55aPyYfcz4GRIGbiUZa96HNYAmJ3Nh/3QR1nBper48Vu0RfZmNcCumTXFPabcAYRv23M7d\n z0mOrpReM6FQjA+WAtf+B7Srfxy5res=",
        "X-MC-Unique": "bLpJrWJUNfaN9lSUcJ2U0g-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@amd.com, thomas@monjalon.net, bruce.richardson@intel.com,\n konstantin.v.ananyev@yandex.ru, ruifeng.wang@arm.com, zhoumin@loongson.cn,\n drc@linux.vnet.ibm.com, kda@semihalf.com, roretzla@linux.microsoft.com,\n Matan Azrad <matan@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>, Ori Kam <orika@nvidia.com>,\n Suanming Mou <suanmingm@nvidia.com>",
        "Subject": "[PATCH 2/2] common/mlx5: use EAL x86 processor identification",
        "Date": "Fri, 22 Sep 2023 11:37:21 +0200",
        "Message-ID": "<20230922093722.2057688-3-david.marchand@redhat.com>",
        "In-Reply-To": "<20230922093722.2057688-1-david.marchand@redhat.com>",
        "References": "<20230922093722.2057688-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.3",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "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": "Rather than use an ugly asm thing, use newly introduced EAL x86 API.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n drivers/common/mlx5/mlx5_common.c | 81 ++++++++-----------------------\n 1 file changed, 21 insertions(+), 60 deletions(-)",
    "diff": "diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c\nindex 0ad14a48c7..99adcd960e 100644\n--- a/drivers/common/mlx5/mlx5_common.c\n+++ b/drivers/common/mlx5/mlx5_common.c\n@@ -6,6 +6,7 @@\n #include <string.h>\n #include <stdio.h>\n \n+#include <eal_cpu.h>\n #include <rte_errno.h>\n #include <rte_mempool.h>\n #include <rte_class.h>\n@@ -52,29 +53,6 @@ uint8_t haswell_broadwell_cpu;\n  */\n #define MLX5_SQ_DB_NC \"sq_db_nc\"\n \n-/* In case this is an x86_64 intel processor to check if\n- * we should use relaxed ordering.\n- */\n-#ifdef RTE_ARCH_X86_64\n-/**\n- * This function returns processor identification and feature information\n- * into the registers.\n- *\n- * @param eax, ebx, ecx, edx\n- *\t\tPointers to the registers that will hold cpu information.\n- * @param level\n- *\t\tThe main category of information returned.\n- */\n-static inline void mlx5_cpu_id(unsigned int level,\n-\t\t\t\tunsigned int *eax, unsigned int *ebx,\n-\t\t\t\tunsigned int *ecx, unsigned int *edx)\n-{\n-\t__asm__(\"cpuid\\n\\t\"\n-\t\t: \"=a\" (*eax), \"=b\" (*ebx), \"=c\" (*ecx), \"=d\" (*edx)\n-\t\t: \"0\" (level));\n-}\n-#endif\n-\n RTE_LOG_REGISTER_DEFAULT(mlx5_common_logtype, NOTICE)\n \n /* Head of list of drivers. */\n@@ -1246,46 +1224,29 @@ mlx5_common_init(void)\n RTE_INIT_PRIO(mlx5_is_haswell_broadwell_cpu, LOG)\n {\n #ifdef RTE_ARCH_X86_64\n-\tunsigned int broadwell_models[4] = {0x3d, 0x47, 0x4F, 0x56};\n-\tunsigned int haswell_models[4] = {0x3c, 0x3f, 0x45, 0x46};\n-\tunsigned int i, model, family, brand_id, vendor;\n-\tunsigned int signature_intel_ebx = 0x756e6547;\n-\tunsigned int extended_model;\n-\tunsigned int eax = 0;\n-\tunsigned int ebx = 0;\n-\tunsigned int ecx = 0;\n-\tunsigned int edx = 0;\n-\tint max_level;\n-\n-\tmlx5_cpu_id(0, &eax, &ebx, &ecx, &edx);\n-\tvendor = ebx;\n-\tmax_level = eax;\n-\tif (max_level < 1) {\n-\t\thaswell_broadwell_cpu = 0;\n+\tuint8_t broadwell_models[] = {0x3d, 0x47, 0x4f, 0x56};\n+\tuint8_t haswell_models[] = {0x3c, 0x3f, 0x45, 0x46};\n+\tunsigned int i;\n+\tuint8_t model;\n+\n+\tif (!rte_cpu_is_x86() || !rte_cpu_x86_is_intel() || rte_cpu_x86_brand() != 0x0 ||\n+\t\t\trte_cpu_x86_family() != 0x6)\n+\t\tgoto out;\n+\n+\tmodel = rte_cpu_x86_model();\n+\tfor (i = 0; i < RTE_DIM(broadwell_models); i++) {\n+\t\tif (model != broadwell_models[i])\n+\t\t\tcontinue;\n+\t\thaswell_broadwell_cpu = 1;\n \t\treturn;\n \t}\n-\tmlx5_cpu_id(1, &eax, &ebx, &ecx, &edx);\n-\tmodel = (eax >> 4) & 0x0f;\n-\tfamily = (eax >> 8) & 0x0f;\n-\tbrand_id = ebx & 0xff;\n-\textended_model = (eax >> 12) & 0xf0;\n-\t/* Check if the processor is Haswell or Broadwell */\n-\tif (vendor == signature_intel_ebx) {\n-\t\tif (family == 0x06)\n-\t\t\tmodel += extended_model;\n-\t\tif (brand_id == 0 && family == 0x6) {\n-\t\t\tfor (i = 0; i < RTE_DIM(broadwell_models); i++)\n-\t\t\t\tif (model == broadwell_models[i]) {\n-\t\t\t\t\thaswell_broadwell_cpu = 1;\n-\t\t\t\t\treturn;\n-\t\t\t\t}\n-\t\t\tfor (i = 0; i < RTE_DIM(haswell_models); i++)\n-\t\t\t\tif (model == haswell_models[i]) {\n-\t\t\t\t\thaswell_broadwell_cpu = 1;\n-\t\t\t\t\treturn;\n-\t\t\t\t}\n-\t\t}\n+\tfor (i = 0; i < RTE_DIM(haswell_models); i++) {\n+\t\tif (model != haswell_models[i])\n+\t\t\tcontinue;\n+\t\thaswell_broadwell_cpu = 1;\n+\t\treturn;\n \t}\n+out:\n #endif\n \thaswell_broadwell_cpu = 0;\n }\n",
    "prefixes": [
        "2/2"
    ]
}