get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7233,
    "url": "https://patches.dpdk.org/api/patches/7233/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1443487487-31915-2-git-send-email-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "https://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": "<1443487487-31915-2-git-send-email-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1443487487-31915-2-git-send-email-stephen@networkplumber.org",
    "date": "2015-09-29T00:44:42",
    "name": "[dpdk-dev,1/6] xen: allow determining DOM0 at runtime",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "0282941f03314667524b00967ea547a6de7ea394",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1443487487-31915-2-git-send-email-stephen@networkplumber.org/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7233/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7233/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 17F8156B7;\n\tTue, 29 Sep 2015 02:44:50 +0200 (CEST)",
            "from mail-pa0-f54.google.com (mail-pa0-f54.google.com\n\t[209.85.220.54]) by dpdk.org (Postfix) with ESMTP id 537931DB1\n\tfor <dev@dpdk.org>; Tue, 29 Sep 2015 02:44:46 +0200 (CEST)",
            "by padhy16 with SMTP id hy16so188536738pad.1\n\tfor <dev@dpdk.org>; Mon, 28 Sep 2015 17:44:45 -0700 (PDT)",
            "from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net.\n\t[50.53.82.155]) by smtp.gmail.com with ESMTPSA id\n\tsl7sm21702971pbc.54.2015.09.28.17.44.44\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 28 Sep 2015 17:44:45 -0700 (PDT)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=M8isXLUzcbW1YsUDcEdrbBrE/K6ZGFyQRpibZZzYYTk=;\n\tb=VlFBZEGkjrROFshgI9tcAAtM3+vP4T62mEtQYmRd43xLwuH/Uk4CuRrEDaxP6kpAK5\n\tZ2lzNqTXFZ5zV6XlWwVul/GhnOxfH+hM3i/PlVLKUsrtmnwAFRHnkEOf6Sq9dAhzga/x\n\t6Uu1J0Lu1IbQs+w+uLr6k6chjeeR9VsB/s+7K01N5Lp5n6gEYwOSlD3yYPDQFSjS7YDj\n\t5MirBz6CwHGll93nh4K8a76qvC9//1SdokNHYpP03E0NWPkw5VyZ0Dw9BxmPayWOgLHU\n\tZvlEoYNTcs0R5oWVUSbNKkr5teXHPngm6gQmVAiPMIBlMdz2vDyutSizfo1IKozXBoeh\n\tz3VQ==",
        "X-Gm-Message-State": "ALoCoQnA3aWtlaWm70pMB7sbG7Vcst3PbzBmw2fpvidILFChNLO8hQ9kXy//Uw65GA7b1N2fVjtW",
        "X-Received": "by 10.66.124.229 with SMTP id ml5mr27366582pab.77.1443487485710; \n\tMon, 28 Sep 2015 17:44:45 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 28 Sep 2015 17:44:42 -0700",
        "Message-Id": "<1443487487-31915-2-git-send-email-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1443487487-31915-1-git-send-email-stephen@networkplumber.org>",
        "References": "<1443487487-31915-1-git-send-email-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH 1/6] xen: allow determining DOM0 at runtime",
        "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": "Add memory infrastructure for runtime Xen DOM0 support.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/librte_eal/common/include/rte_memory.h   | 30 ++++++++++++++++-\n lib/librte_eal/linuxapp/eal/eal_memory.c     |  7 ++++\n lib/librte_eal/linuxapp/eal/eal_xen_memory.c |  2 +-\n lib/librte_mempool/rte_mempool.c             | 48 ++++++++++++++++++++--------\n lib/librte_mempool/rte_mempool.h             |  3 +-\n 5 files changed, 72 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h\nindex 1bed415..067be10 100644\n--- a/lib/librte_eal/common/include/rte_memory.h\n+++ b/lib/librte_eal/common/include/rte_memory.h\n@@ -52,6 +52,8 @@\n extern \"C\" {\n #endif\n \n+#include <rte_common.h>\n+\n enum rte_page_sizes {\n \tRTE_PGSIZE_4K    = 1ULL << 12,\n \tRTE_PGSIZE_64K   = 1ULL << 16,\n@@ -180,6 +182,13 @@ unsigned rte_memory_get_nchannel(void);\n unsigned rte_memory_get_nrank(void);\n \n #ifdef RTE_LIBRTE_XEN_DOM0\n+\n+/**< Internal use only - should DOM0 memory mapping be used */\n+extern int is_xen_dom0_supported(void);\n+\n+/**< Internal use only - phys to virt mapping for xen */\n+phys_addr_t rte_xen_mem_phy2mch(uint32_t, const phys_addr_t);\n+\n /**\n  * Return the physical address of elt, which is an element of the pool mp.\n  *\n@@ -191,7 +200,14 @@ unsigned rte_memory_get_nrank(void);\n  * @return\n  *   The physical address or error.\n  */\n-phys_addr_t rte_mem_phy2mch(uint32_t memseg_id, const phys_addr_t phy_addr);\n+static inline phys_addr_t\n+rte_mem_phy2mch(uint32_t memseg_id, const phys_addr_t phy_addr)\n+{\n+\tif (is_xen_dom0_supported())\n+\t\treturn rte_xen_mem_phy2mch(memseg_id, phy_addr);\n+\telse\n+\t\treturn phy_addr;\n+}\n \n /**\n  * Memory init for supporting application running on Xen domain0.\n@@ -214,7 +230,19 @@ int rte_xen_dom0_memory_init(void);\n  *       negative: error\n  */\n int rte_xen_dom0_memory_attach(void);\n+#else\n+static inline int is_xen_dom0_supported(void)\n+{\n+\treturn 0;\n+}\n+\n+static inline phys_addr_t\n+rte_mem_phy2mch(uint32_t memseg_id __rte_unused, const phys_addr_t phy_addr)\n+{\n+\treturn phy_addr;\n+}\n #endif\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex ac2745e..f36cabd 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c\n@@ -97,6 +97,13 @@\n #include \"eal_filesystem.h\"\n #include \"eal_hugepages.h\"\n \n+#ifdef RTE_LIBRTE_XEN_DOM0\n+int is_xen_dom0_supported(void)\n+{\n+\treturn internal_config.xen_dom0_support;\n+}\n+#endif\n+\n /**\n  * @file\n  * Huge page mapping under linux\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c\nindex d228a9d..7fd9e83 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c\n@@ -156,7 +156,7 @@ get_xen_memory_size(void)\n  * Based on physical address to caculate MFN in Xen Dom0.\n  */\n phys_addr_t\n-rte_mem_phy2mch(uint32_t memseg_id, const phys_addr_t phy_addr)\n+rte_xen_mem_phy2mch(uint32_t memseg_id, const phys_addr_t phy_addr)\n {\n \tint mfn_id;\n \tuint64_t mfn, mfn_offset;\ndiff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 8e185c5..d063268 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -375,6 +375,26 @@ rte_mempool_xmem_usage(void *vaddr, uint32_t elt_num, size_t elt_sz,\n \treturn usz;\n }\n \n+#ifndef RTE_LIBRTE_XEN_DOM0\n+/* stub if DOM0 support not configured */\n+struct rte_mempool *\n+rte_dom0_mempool_create(const char *name __rte_unused,\n+\t\t\tunsigned n __rte_unused,\n+\t\t\tunsigned elt_size __rte_unused,\n+\t\t\tunsigned cache_size __rte_unused,\n+\t\t\tunsigned private_data_size __rte_unused,\n+\t\t\trte_mempool_ctor_t *mp_init __rte_unused,\n+\t\t\tvoid *mp_init_arg __rte_unused,\n+\t\t\trte_mempool_obj_ctor_t *obj_init __rte_unused,\n+\t\t\tvoid *obj_init_arg __rte_unused,\n+\t\t\tint socket_id __rte_unused,\n+\t\t\tunsigned flags __rte_unused)\n+{\n+\trte_errno = EINVAL;\n+\treturn NULL;\n+}\n+#endif\n+\n /* create the mempool */\n struct rte_mempool *\n rte_mempool_create(const char *name, unsigned n, unsigned elt_size,\n@@ -383,20 +403,20 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,\n \t\t   rte_mempool_obj_ctor_t *obj_init, void *obj_init_arg,\n \t\t   int socket_id, unsigned flags)\n {\n-#ifdef RTE_LIBRTE_XEN_DOM0\n-\treturn rte_dom0_mempool_create(name, n, elt_size,\n-\t\tcache_size, private_data_size,\n-\t\tmp_init, mp_init_arg,\n-\t\tobj_init, obj_init_arg,\n-\t\tsocket_id, flags);\n-#else\n-\treturn rte_mempool_xmem_create(name, n, elt_size,\n-\t\tcache_size, private_data_size,\n-\t\tmp_init, mp_init_arg,\n-\t\tobj_init, obj_init_arg,\n-\t\tsocket_id, flags,\n-\t\tNULL, NULL, MEMPOOL_PG_NUM_DEFAULT, MEMPOOL_PG_SHIFT_MAX);\n-#endif\n+\tif (is_xen_dom0_supported())\n+\t\treturn rte_dom0_mempool_create(name, n, elt_size,\n+\t\t\t\t\t       cache_size, private_data_size,\n+\t\t\t\t\t       mp_init, mp_init_arg,\n+\t\t\t\t\t       obj_init, obj_init_arg,\n+\t\t\t\t\t       socket_id, flags);\n+\telse\n+\t\treturn rte_mempool_xmem_create(name, n, elt_size,\n+\t\t\t\t\t       cache_size, private_data_size,\n+\t\t\t\t\t       mp_init, mp_init_arg,\n+\t\t\t\t\t       obj_init, obj_init_arg,\n+\t\t\t\t\t       socket_id, flags,\n+\t\t\t\t\t       NULL, NULL, MEMPOOL_PG_NUM_DEFAULT,\n+\t\t\t\t\t       MEMPOOL_PG_SHIFT_MAX);\n }\n \n /*\ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex 8abeca9..6e2390a 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -640,7 +640,6 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,\n \t\tint socket_id, unsigned flags, void *vaddr,\n \t\tconst phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift);\n \n-#ifdef RTE_LIBRTE_XEN_DOM0\n /**\n  * Create a new mempool named *name* in memory on Xen Dom0.\n  *\n@@ -728,7 +727,7 @@ rte_dom0_mempool_create(const char *name, unsigned n, unsigned elt_size,\n \t\trte_mempool_ctor_t *mp_init, void *mp_init_arg,\n \t\trte_mempool_obj_ctor_t *obj_init, void *obj_init_arg,\n \t\tint socket_id, unsigned flags);\n-#endif\n+\n \n /**\n  * Dump the status of the mempool to the console.\n",
    "prefixes": [
        "dpdk-dev",
        "1/6"
    ]
}