get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49232,
    "url": "https://patches.dpdk.org/api/patches/49232/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/d585585708545763d1fc27839ce1936153e88995.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": "<d585585708545763d1fc27839ce1936153e88995.1545391716.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/d585585708545763d1fc27839ce1936153e88995.1545391716.git.anatoly.burakov@intel.com",
    "date": "2018-12-21T11:29:01",
    "name": "[v2,2/4] test/extmem: extend autotest to test without IOVA table",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "bbdf1b0e8cd3976fd92390a7234a535c7b5ef34c",
    "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/d585585708545763d1fc27839ce1936153e88995.1545391716.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 2920,
            "url": "https://patches.dpdk.org/api/series/2920/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2920",
            "date": "2018-12-21T11:29:01",
            "name": null,
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/2920/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/49232/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/49232/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 B60341BD7F;\n\tFri, 21 Dec 2018 12:29:08 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 3FF521BD76\n\tfor <dev@dpdk.org>; Fri, 21 Dec 2018 12:29:07 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\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 fmsmga002.fm.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\twBLBT4UW023511; 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 wBLBT4g0002056;\n\tFri, 21 Dec 2018 11:29:04 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBLBT42c002052;\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=\"127963265\"",
        "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:01 +0000",
        "Message-Id": "<d585585708545763d1fc27839ce1936153e88995.1545391716.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545391716.git.anatoly.burakov@intel.com>",
            "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545391716.git.anatoly.burakov@intel.com>",
            "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 2/4] test/extmem: extend autotest to test\n\twithout IOVA table",
        "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": "Currently, only scenario with valid IOVA table is tested. Fix this\nby also testing without IOVA table - in these cases, EAL should\nalways return RTE_BAD_IOVA for all memsegs, and contiguous memzone\nallocation should fail.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    v2:\n    - Improve condition checking on contiguous memzone test\n    - Clarify commit message\n\n test/test/test_external_mem.c | 66 +++++++++++++++++++++++------------\n 1 file changed, 43 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/test/test/test_external_mem.c b/test/test/test_external_mem.c\nindex 6df42e3ae..06e6ccc1d 100644\n--- a/test/test/test_external_mem.c\n+++ b/test/test/test_external_mem.c\n@@ -31,6 +31,7 @@ check_mem(void *addr, rte_iova_t *iova, size_t pgsz, int n_pages)\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+\t\trte_iova_t expected_iova;\n \n \t\tms = rte_mem_virt2memseg(cur, NULL);\n \t\tif (ms == NULL) {\n@@ -42,7 +43,8 @@ check_mem(void *addr, rte_iova_t *iova, size_t pgsz, int n_pages)\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\texpected_iova = (iova == NULL) ? RTE_BAD_IOVA : iova[i];\n+\t\tif (ms->iova != expected_iova) {\n \t\t\tprintf(\"%s():%i: IOVA mismatch\\n\", __func__, __LINE__);\n \t\t\treturn -1;\n \t\t}\n@@ -218,24 +220,29 @@ test_malloc_invalid_param(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n \t\tgoto fail;\n \t}\n \n-\t/* wrong page count */\n-\tif (rte_malloc_heap_memory_add(valid_name, addr, len,\n-\t\t\tiova, 0, pgsz) >= 0 || rte_errno != EINVAL) {\n-\t\tprintf(\"%s():%i: Added memory with invalid parameters\\n\",\n-\t\t\t__func__, __LINE__);\n-\t\tgoto fail;\n-\t}\n-\tif (rte_malloc_heap_memory_add(valid_name, addr, len,\n-\t\t\tiova, n_pages - 1, pgsz) >= 0 || rte_errno != EINVAL) {\n-\t\tprintf(\"%s():%i: Added memory with invalid parameters\\n\",\n-\t\t\t__func__, __LINE__);\n-\t\tgoto fail;\n-\t}\n-\tif (rte_malloc_heap_memory_add(valid_name, addr, len,\n-\t\t\tiova, n_pages + 1, pgsz) >= 0 || rte_errno != EINVAL) {\n-\t\tprintf(\"%s():%i: Added memory with invalid parameters\\n\",\n-\t\t\t__func__, __LINE__);\n-\t\tgoto fail;\n+\t/* the following tests are only valid if IOVA table is not NULL */\n+\tif (iova != NULL) {\n+\t\t/* wrong page count */\n+\t\tif (rte_malloc_heap_memory_add(valid_name, addr, len,\n+\t\t\t\tiova, 0, pgsz) >= 0 || rte_errno != EINVAL) {\n+\t\t\tprintf(\"%s():%i: Added memory with invalid parameters\\n\",\n+\t\t\t\t__func__, __LINE__);\n+\t\t\tgoto fail;\n+\t\t}\n+\t\tif (rte_malloc_heap_memory_add(valid_name, addr, len,\n+\t\t\t\tiova, n_pages - 1, pgsz) >= 0 ||\n+\t\t\t\trte_errno != EINVAL) {\n+\t\t\tprintf(\"%s():%i: Added memory with invalid parameters\\n\",\n+\t\t\t\t__func__, __LINE__);\n+\t\t\tgoto fail;\n+\t\t}\n+\t\tif (rte_malloc_heap_memory_add(valid_name, addr, len,\n+\t\t\t\tiova, n_pages + 1, pgsz) >= 0 ||\n+\t\t\t\trte_errno != EINVAL) {\n+\t\t\tprintf(\"%s():%i: Added memory with invalid parameters\\n\",\n+\t\t\t\t__func__, __LINE__);\n+\t\t\tgoto fail;\n+\t\t}\n \t}\n \n \t/* tests passed, destroy heap */\n@@ -257,7 +264,7 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n \tconst char *heap_name = \"heap\";\n \tvoid *ptr = NULL;\n \tint socket_id;\n-\tconst struct rte_memzone *mz = NULL;\n+\tconst struct rte_memzone *mz = NULL, *contig_mz = NULL;\n \n \t/* create heap */\n \tif (rte_malloc_heap_create(heap_name) != 0) {\n@@ -322,12 +329,19 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n \t\tgoto fail;\n \t}\n \n+\t/* try allocating a memzone */\n+\tmz = rte_memzone_reserve(\"heap_test\", pgsz * 2, socket_id, 0);\n+\tif (mz == NULL) {\n+\t\tprintf(\"%s():%i: Failed to reserve memzone\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\tgoto fail;\n+\t}\n \t/* try allocating an IOVA-contiguous memzone - this should succeed\n-\t * because we've set up a contiguous IOVA table.\n+\t * if we've set up a contiguous IOVA table, and fail if we haven't.\n \t */\n-\tmz = rte_memzone_reserve(\"heap_test\", pgsz * 2, socket_id,\n+\tcontig_mz = rte_memzone_reserve(\"heap_test_contig\", pgsz * 2, socket_id,\n \t\t\tRTE_MEMZONE_IOVA_CONTIG);\n-\tif (mz == NULL) {\n+\tif ((iova == NULL) != (contig_mz == NULL)) {\n \t\tprintf(\"%s():%i: Failed to reserve memzone\\n\",\n \t\t\t__func__, __LINE__);\n \t\tgoto fail;\n@@ -342,6 +356,8 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n \n \trte_memzone_free(mz);\n \tmz = NULL;\n+\trte_memzone_free(contig_mz);\n+\tcontig_mz = NULL;\n \n \tif (rte_malloc_heap_memory_remove(heap_name, addr, len) != 0) {\n \t\tprintf(\"%s():%i: Removing memory from heap failed\\n\",\n@@ -356,6 +372,7 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n \n \treturn 0;\n fail:\n+\trte_memzone_free(contig_mz);\n \trte_memzone_free(mz);\n \trte_free(ptr);\n \t/* even if something failed, attempt to clean up */\n@@ -393,6 +410,9 @@ test_external_mem(void)\n \n \tret = test_malloc_invalid_param(addr, len, pgsz, iova, n_pages);\n \tret |= test_malloc_basic(addr, len, pgsz, iova, n_pages);\n+\t/* when iova table is NULL, everything should still work */\n+\tret |= test_malloc_invalid_param(addr, len, pgsz, NULL, n_pages);\n+\tret |= test_malloc_basic(addr, len, pgsz, NULL, n_pages);\n \n \tmunmap(addr, len);\n \n",
    "prefixes": [
        "v2",
        "2/4"
    ]
}