Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/49228/?format=api
http://patches.dpdk.org/api/patches/49228/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/0521642ca0052bbfb1a8d21033582276c9782717.1545390524.git.anatoly.burakov@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": "<0521642ca0052bbfb1a8d21033582276c9782717.1545390524.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/0521642ca0052bbfb1a8d21033582276c9782717.1545390524.git.anatoly.burakov@intel.com", "date": "2018-12-21T11:09:13", "name": "[2/4] test/extmem: extend autotest to test without IOVA table", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1cbbd6aecd51a5327df520eee7a2708e60d4eb69", "submitter": { "id": 4, "url": "http://patches.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/0521642ca0052bbfb1a8d21033582276c9782717.1545390524.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 2918, "url": "http://patches.dpdk.org/api/series/2918/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2918", "date": "2018-12-21T11:09:12", "name": "[1/4] test/extmem: refactor and rename test functions", "version": 1, "mbox": "http://patches.dpdk.org/series/2918/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/49228/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/49228/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 CB35A1BD73;\n\tFri, 21 Dec 2018 12:09:26 +0100 (CET)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 386001BD41\n\tfor <dev@dpdk.org>; Fri, 21 Dec 2018 12:09:22 +0100 (CET)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Dec 2018 03:09:21 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga006.fm.intel.com with ESMTP; 21 Dec 2018 03:09:20 -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\twBLB9Jvl019011; Fri, 21 Dec 2018 11:09:19 GMT", "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id wBLB9Jn5028340;\n\tFri, 21 Dec 2018 11:09:19 GMT", "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBLB9J19028336;\n\tFri, 21 Dec 2018 11:09:19 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=\"304053540\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, stephen@networkplumber.org", "Date": "Fri, 21 Dec 2018 11:09:13 +0000", "Message-Id": "<0521642ca0052bbfb1a8d21033582276c9782717.1545390524.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>", "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>" ], "References": [ "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>", "<c822e5e21620d0fa4b2930d9e89bce44e80eac73.1545390524.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH 2/4] test/extmem: extend autotest to test without\n\tIOVA 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.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n test/test/test_external_mem.c | 68 +++++++++++++++++++++++------------\n 1 file changed, 45 insertions(+), 23 deletions(-)", "diff": "diff --git a/test/test/test_external_mem.c b/test/test/test_external_mem.c\nindex 6df42e3ae..845c625d6 100644\n--- a/test/test/test_external_mem.c\n+++ b/test/test/test_external_mem.c\n@@ -42,7 +42,11 @@ 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\tif (iova == NULL && ms->iova != RTE_BAD_IOVA) {\n+\t\t\tprintf(\"%s():%i: IOVA is not invalid\\n\", __func__,\n+\t\t\t\t\t__LINE__);\n+\t\t\treturn -1;\n+\t\t} else if (iova != NULL && ms->iova != iova[i]) {\n \t\t\tprintf(\"%s():%i: IOVA mismatch\\n\", __func__, __LINE__);\n \t\t\treturn -1;\n \t\t}\n@@ -218,24 +222,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 +266,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 +331,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 +358,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 +374,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 +412,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": [ "2/4" ] }{ "id": 49228, "url": "