get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49231,
    "url": "https://patches.dpdk.org/api/patches/49231/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545391716.git.anatoly.burakov@intel.com/",
    "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": "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545391716.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545391716.git.anatoly.burakov@intel.com",
    "date": "2018-12-21T11:29:00",
    "name": "[v2,1/4] test/extmem: refactor and rename test functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2e408c18a1937a20a4431294fcd4e8535ad08f7d",
    "submitter": {
        "id": 4,
        "url": "https://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545391716.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 2919,
            "url": "https://patches.dpdk.org/api/series/2919/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2919",
            "date": "2018-12-21T11:29:00",
            "name": "[v2,1/4] test/extmem: refactor and rename test functions",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/2919/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/49231/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/49231/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 92B211BDCE;\n\tFri, 21 Dec 2018 12:29:11 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 0C1AD1BD76\n\tfor <dev@dpdk.org>; Fri, 21 Dec 2018 12:29:07 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Dec 2018 03:29:06 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga005.jf.intel.com with ESMTP; 21 Dec 2018 03:29:05 -0800",
            "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\twBLBT469023508; Fri, 21 Dec 2018 11:29:04 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id wBLBT4vq002049;\n\tFri, 21 Dec 2018 11:29:04 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBLBT3Iu002045;\n\tFri, 21 Dec 2018 11:29:04 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,381,1539673200\"; d=\"scan'208\";a=\"285537509\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, stephen@networkplumber.org",
        "Date": "Fri, 21 Dec 2018 11:29:00 +0000",
        "Message-Id": "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545391716.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>",
        "References": "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/4] test/extmem: refactor and rename test\n\tfunctions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "We will be adding a new extmem test that will behave roughly similar\nto already existing, so clarify function names to distinguish between\nthese tests, as well as factor out the common parts.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n test/test/test_external_mem.c | 62 +++++++++++++++++++++--------------\n 1 file changed, 37 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/test/test/test_external_mem.c b/test/test/test_external_mem.c\nindex 998cafa68..6df42e3ae 100644\n--- a/test/test/test_external_mem.c\n+++ b/test/test/test_external_mem.c\n@@ -23,7 +23,35 @@\n #define EXTERNAL_MEM_SZ (RTE_PGSIZE_4K << 10) /* 4M of data */\n \n static int\n-test_invalid_param(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n+check_mem(void *addr, rte_iova_t *iova, size_t pgsz, int n_pages)\n+{\n+\tint i;\n+\n+\t/* check that we can get this memory from EAL now */\n+\tfor (i = 0; i < n_pages; i++) {\n+\t\tconst struct rte_memseg *ms;\n+\t\tvoid *cur = RTE_PTR_ADD(addr, pgsz * i);\n+\n+\t\tms = rte_mem_virt2memseg(cur, NULL);\n+\t\tif (ms == NULL) {\n+\t\t\tprintf(\"%s():%i: Failed to retrieve memseg for external mem\\n\",\n+\t\t\t\t__func__, __LINE__);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tif (ms->addr != cur) {\n+\t\t\tprintf(\"%s():%i: VA mismatch\\n\", __func__, __LINE__);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tif (ms->iova != iova[i]) {\n+\t\t\tprintf(\"%s():%i: IOVA mismatch\\n\", __func__, __LINE__);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+static int\n+test_malloc_invalid_param(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n \t\tint n_pages)\n {\n \tstatic const char * const names[] = {\n@@ -223,11 +251,12 @@ test_invalid_param(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n }\n \n static int\n-test_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, int n_pages)\n+test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n+\t\tint n_pages)\n {\n \tconst char *heap_name = \"heap\";\n \tvoid *ptr = NULL;\n-\tint socket_id, i;\n+\tint socket_id;\n \tconst struct rte_memzone *mz = NULL;\n \n \t/* create heap */\n@@ -261,26 +290,9 @@ test_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, int n_pages)\n \t\tgoto fail;\n \t}\n \n-\t/* check that we can get this memory from EAL now */\n-\tfor (i = 0; i < n_pages; i++) {\n-\t\tconst struct rte_memseg *ms;\n-\t\tvoid *cur = RTE_PTR_ADD(addr, pgsz * i);\n-\n-\t\tms = rte_mem_virt2memseg(cur, NULL);\n-\t\tif (ms == NULL) {\n-\t\t\tprintf(\"%s():%i: Failed to retrieve memseg for external mem\\n\",\n-\t\t\t\t__func__, __LINE__);\n-\t\t\tgoto fail;\n-\t\t}\n-\t\tif (ms->addr != cur) {\n-\t\t\tprintf(\"%s():%i: VA mismatch\\n\", __func__, __LINE__);\n-\t\t\tgoto fail;\n-\t\t}\n-\t\tif (ms->iova != iova[i]) {\n-\t\t\tprintf(\"%s():%i: IOVA mismatch\\n\", __func__, __LINE__);\n-\t\t\tgoto fail;\n-\t\t}\n-\t}\n+\t/* check if memory is accessible from EAL */\n+\tif (check_mem(addr, iova, pgsz, n_pages) < 0)\n+\t\tgoto fail;\n \n \t/* allocate - this now should succeed */\n \tptr = rte_malloc_socket(\"EXTMEM\", 64, 0, socket_id);\n@@ -379,8 +391,8 @@ test_external_mem(void)\n \t\tiova[i] = tmp;\n \t}\n \n-\tret = test_invalid_param(addr, len, pgsz, iova, n_pages);\n-\tret |= test_basic(addr, len, pgsz, iova, n_pages);\n+\tret = test_malloc_invalid_param(addr, len, pgsz, iova, n_pages);\n+\tret |= test_malloc_basic(addr, len, pgsz, iova, n_pages);\n \n \tmunmap(addr, len);\n \n",
    "prefixes": [
        "v2",
        "1/4"
    ]
}