get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7947,
    "url": "http://patches.dpdk.org/api/patches/7947/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1445609833-17649-4-git-send-email-david.hunt@intel.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": "<1445609833-17649-4-git-send-email-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445609833-17649-4-git-send-email-david.hunt@intel.com",
    "date": "2015-10-23T14:17:05",
    "name": "[dpdk-dev,03/11] lib: add armv8 rte_cpuflags.h",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b503c96f7ed424234812a4f05e2d52029ad546d6",
    "submitter": {
        "id": 342,
        "url": "http://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1445609833-17649-4-git-send-email-david.hunt@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/7947/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/7947/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 7F6F28E8A;\n\tFri, 23 Oct 2015 16:17:50 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id E597E8D9D\n\tfor <dev@dpdk.org>; Fri, 23 Oct 2015 16:17:44 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga103.jf.intel.com with ESMTP; 23 Oct 2015 07:17:36 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga001.jf.intel.com with ESMTP; 23 Oct 2015 07:17:34 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tt9NEHYkf002473; Fri, 23 Oct 2015 15:17:34 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id t9NEHY9H017717;\n\tFri, 23 Oct 2015 15:17:34 +0100",
            "(from dhunt5@localhost)\n\tby sivswdev02.ir.intel.com with  id t9NEHYAg017713;\n\tFri, 23 Oct 2015 15:17:34 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,186,1444719600\"; d=\"scan'208\";a=\"801163644\"",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 23 Oct 2015 15:17:05 +0100",
        "Message-Id": "<1445609833-17649-4-git-send-email-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1445609833-17649-1-git-send-email-david.hunt@intel.com>",
        "References": "<1445609833-17649-1-git-send-email-david.hunt@intel.com>",
        "Cc": "Benjamin Boren <Ben.Boren@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 03/11] lib: add armv8 rte_cpuflags.h",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Benjamin Boren <Ben.Boren@intel.com>\n\nSigned-off-by: Benjamin Boren <Ben.Boren@intel.com>\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n .../common/include/arch/arm64/rte_cpuflags.h       | 137 +++++++++++++++++++++\n 1 file changed, 137 insertions(+)\n create mode 100644 lib/librte_eal/common/include/arch/arm64/rte_cpuflags.h",
    "diff": "diff --git a/lib/librte_eal/common/include/arch/arm64/rte_cpuflags.h b/lib/librte_eal/common/include/arch/arm64/rte_cpuflags.h\nnew file mode 100644\nindex 0000000..b4dcf9d\n--- /dev/null\n+++ b/lib/librte_eal/common/include/arch/arm64/rte_cpuflags.h\n@@ -0,0 +1,137 @@\n+/*\n+ *   BSD LICENSE\n+ *\n+ *   Copyright (C) IBM Corporation 2014.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of IBM Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+*/\n+\n+#ifndef _RTE_CPUFLAGS_ARM_64_H_\n+#define _RTE_CPUFLAGS_ARM_64_H_\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <elf.h>\n+#include <fcntl.h>\n+#include <assert.h>\n+#include <unistd.h>\n+#include <string.h>\n+\n+#include \"generic/rte_cpuflags.h\"\n+\n+/* Symbolic values for the entries in the auxiliary table */\n+#define AT_HWCAP  16\n+#define AT_HWCAP2 26\n+#define AT_PLATFORM 15\n+\n+/* software based registers */\n+enum cpu_register_t {\n+\tREG_HWCAP = 0,\n+\tAARCH_MODE,\n+};\n+\n+/**\n+ * Enumeration of all CPU features supported\n+ */\n+enum rte_cpu_flag_t {\n+\tRTE_CPUFLAG_FP = 0,\n+\tRTE_CPUFLAG_ASIMD,\n+\tRTE_CPUFLAG_EVTSTRM,\n+\tRTE_CPUFLAG_AARCH64,\n+\tRTE_CPUFLAG_AARCH32,\n+\t/* The last item */\n+\tRTE_CPUFLAG_NUMFLAGS,/**< This should always be the last! */\n+};\n+\n+static const struct feature_entry cpu_feature_table[] = {\n+\tFEAT_DEF(FP, 0x00000001, 0, REG_HWCAP,  0)\n+\tFEAT_DEF(ASIMD, 0x00000001, 0, REG_HWCAP,  1)\n+\tFEAT_DEF(EVTSTRM, 0x00000001, 0, REG_HWCAP,  2)\n+\tFEAT_DEF(AARCH64, 0x00000001, 0, AARCH_MODE, 3)\n+\tFEAT_DEF(AARCH32, 0x00000001, 0, AARCH_MODE, 4)\n+};\n+\n+/*\n+ * Read AUXV software register and get cpu features for Power\n+ */\n+static inline void\n+rte_cpu_get_features(__attribute__((unused)) uint32_t leaf,\n+\t__attribute__((unused)) uint32_t subleaf, cpuid_registers_t out)\n+{\n+\tint auxv_fd;\n+\tElf64_auxv_t auxv;\n+\n+\tauxv_fd = open(\"/proc/self/auxv\", O_RDONLY);\n+\tassert(auxv_fd);\n+\twhile (read(auxv_fd, &auxv,\n+\t\tsizeof(Elf64_auxv_t)) == sizeof(Elf64_auxv_t)) {\n+\t\tif (auxv.a_type == AT_HWCAP)\n+\t\t\tout[REG_HWCAP] = auxv.a_un.a_val;\n+\t\tif (auxv.a_type == AT_PLATFORM) {\n+\t\t\tif (strcmp((const char *)auxv.a_un.a_val,\n+\t\t\t\t\t\"aarch64\") == 0)\n+\t\t\t\tout[AARCH_MODE] = (1 << 3);\n+\t\t\telse if (strcmp((const char *)auxv.a_un.a_val,\n+\t\t\t\t\t\"aarch32\") == 0)\n+\t\t\t\tout[AARCH_MODE] =  (1 << 4);\n+\t\t}\n+\t}\n+}\n+\n+/*\n+ * Checks if a particular flag is available on current machine.\n+ */\n+static inline int\n+rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)\n+{\n+\tconst struct feature_entry *feat;\n+\tcpuid_registers_t regs = {0};\n+\n+\tif (feature >= RTE_CPUFLAG_NUMFLAGS)\n+\t\t/* Flag does not match anything in the feature tables */\n+\t\treturn -ENOENT;\n+\n+\tfeat = &cpu_feature_table[feature];\n+\n+\tif (!feat->leaf)\n+\t\t/* This entry in the table wasn't filled out! */\n+\t\treturn -EFAULT;\n+\n+\t/* get the cpuid leaf containing the desired feature */\n+\trte_cpu_get_features(feat->leaf, feat->subleaf, regs);\n+\n+\t/* check if the feature is enabled */\n+\treturn (regs[feat->reg] >> feat->bit) & 1;\n+}\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_CPUFLAGS_ARM_64_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "03/11"
    ]
}