get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49234,
    "url": "https://patches.dpdk.org/api/patches/49234/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/eaa4b2a8af77186c35790d43008889388d3e110d.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": "<eaa4b2a8af77186c35790d43008889388d3e110d.1545391716.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/eaa4b2a8af77186c35790d43008889388d3e110d.1545391716.git.anatoly.burakov@intel.com",
    "date": "2018-12-21T11:29:03",
    "name": "[v2,4/4] test/extmem: extend test to cover non-heap API",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2665e7267a113dfe9d6ea8b05a2bdaa9c731b26f",
    "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/eaa4b2a8af77186c35790d43008889388d3e110d.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/49234/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/49234/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 162601BD76;\n\tFri, 21 Dec 2018 12:29:15 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 293FD1BDAA\n\tfor <dev@dpdk.org>; Fri, 21 Dec 2018 12:29:07 +0100 (CET)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Dec 2018 03:29:07 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga004.jf.intel.com with ESMTP; 21 Dec 2018 03:29:06 -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\twBLBT5Nf023517; Fri, 21 Dec 2018 11:29:05 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id wBLBT5Dw002070;\n\tFri, 21 Dec 2018 11:29:05 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBLBT5xV002066;\n\tFri, 21 Dec 2018 11:29:05 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=\"261285193\"",
        "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:03 +0000",
        "Message-Id": "<eaa4b2a8af77186c35790d43008889388d3e110d.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 4/4] test/extmem: extend test to cover\n\tnon-heap API",
        "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, extmem autotest only covers the external malloc heap\nAPI. Extend it to also cover the non-heap, register/unregister\nexternal memory API.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n test/test/test_external_mem.c | 146 ++++++++++++++++++++++++++++++++++\n 1 file changed, 146 insertions(+)",
    "diff": "diff --git a/test/test/test_external_mem.c b/test/test/test_external_mem.c\nindex b877f8e2e..97bde1cfb 100644\n--- a/test/test/test_external_mem.c\n+++ b/test/test/test_external_mem.c\n@@ -391,6 +391,144 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n \treturn -1;\n }\n \n+static int\n+test_extmem_invalid_param(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n+\t\tint n_pages)\n+{\n+\t/* these calls may fail for other reasons, so check errno */\n+\tif (rte_extmem_unregister(addr, len) >= 0 ||\n+\t\t\trte_errno != ENOENT) {\n+\t\tprintf(\"%s():%i: Unregistered non-existent memory\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_extmem_attach(addr, len) >= 0 ||\n+\t\t\trte_errno != ENOENT) {\n+\t\tprintf(\"%s():%i: Attached to non-existent memory\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\tif (rte_extmem_attach(addr, len) >= 0 ||\n+\t\t\trte_errno != ENOENT) {\n+\t\tprintf(\"%s():%i: Detached from non-existent memory\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\t/* zero length */\n+\tif (rte_extmem_register(addr, 0, NULL, 0, pgsz) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Registered memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_extmem_unregister(addr, 0) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Unregistered memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_extmem_attach(addr, 0) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Attached memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\tif (rte_extmem_attach(addr, 0) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Detached memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\t/* zero address */\n+\tif (rte_extmem_register(NULL, len, NULL, 0, pgsz) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Registered memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_extmem_unregister(NULL, len) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Unregistered memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_extmem_attach(NULL, len) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Attached memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\tif (rte_extmem_attach(NULL, len) >= 0 ||\n+\t\t\trte_errno != EINVAL) {\n+\t\tprintf(\"%s():%i: Detached memory with invalid parameters\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\treturn -1;\n+\t}\n+\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_extmem_register(addr, len,\n+\t\t\t\tiova, 0, pgsz) >= 0 || rte_errno != EINVAL) {\n+\t\t\tprintf(\"%s():%i: Registered memory with invalid parameters\\n\",\n+\t\t\t\t__func__, __LINE__);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tif (rte_extmem_register(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: Registered memory with invalid parameters\\n\",\n+\t\t\t\t__func__, __LINE__);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tif (rte_extmem_register(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: Registered memory with invalid parameters\\n\",\n+\t\t\t\t__func__, __LINE__);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+test_extmem_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,\n+\t\tint n_pages)\n+{\n+\t/* register memory */\n+\tif (rte_extmem_register(addr, len, iova, n_pages, pgsz) != 0) {\n+\t\tprintf(\"%s():%i: Failed to register memory\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\tgoto fail;\n+\t}\n+\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+\tif (rte_extmem_unregister(addr, len) != 0) {\n+\t\tprintf(\"%s():%i: Removing memory from heap failed\\n\",\n+\t\t\t__func__, __LINE__);\n+\t\tgoto fail;\n+\t}\n+\n+\treturn 0;\n+fail:\n+\t/* even if something failed, attempt to clean up */\n+\trte_extmem_unregister(addr, len);\n+\n+\treturn -1;\n+}\n+\n /* we need to test attach/detach in secondary processes. */\n static int\n test_external_mem(void)\n@@ -417,12 +555,20 @@ test_external_mem(void)\n \t\tiova[i] = tmp;\n \t}\n \n+\t/* test external heap memory */\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+\t/* test non-heap memory */\n+\tret |= test_extmem_invalid_param(addr, len, pgsz, iova, n_pages);\n+\tret |= test_extmem_basic(addr, len, pgsz, iova, n_pages);\n+\t/* when iova table is NULL, everything should still work */\n+\tret |= test_extmem_invalid_param(addr, len, pgsz, NULL, n_pages);\n+\tret |= test_extmem_basic(addr, len, pgsz, NULL, n_pages);\n+\n \tmunmap(addr, len);\n \n \treturn ret;\n",
    "prefixes": [
        "v2",
        "4/4"
    ]
}