Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/85378/?format=api
https://patches.dpdk.org/api/patches/85378/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201217190604.29803-4-ndabilpuram@marvell.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": "<20201217190604.29803-4-ndabilpuram@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20201217190604.29803-4-ndabilpuram@marvell.com", "date": "2020-12-17T19:06:03", "name": "[v6,3/4] test: add test case to validate VFIO DMA map/unmap", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "cf3a347ed52da87d2d00627fb02442ac524082e3", "submitter": { "id": 1202, "url": "https://patches.dpdk.org/api/people/1202/?format=api", "name": "Nithin Dabilpuram", "email": "ndabilpuram@marvell.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201217190604.29803-4-ndabilpuram@marvell.com/mbox/", "series": [ { "id": 14353, "url": "https://patches.dpdk.org/api/series/14353/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14353", "date": "2020-12-17T19:06:01", "name": "fix issue with partial DMA unmap", "version": 6, "mbox": "https://patches.dpdk.org/series/14353/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/85378/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/85378/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 801B7A09F6;\n\tThu, 17 Dec 2020 20:07:25 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DD3A3CA8B;\n\tThu, 17 Dec 2020 20:06:33 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 7E1ECCA5C\n for <dev@dpdk.org>; Thu, 17 Dec 2020 20:06:30 +0100 (CET)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 0BHJ62JA010809; Thu, 17 Dec 2020 11:06:28 -0800", "from sc-exch01.marvell.com ([199.233.58.181])\n by mx0a-0016f401.pphosted.com with ESMTP id 35g4rp1ph9-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 17 Dec 2020 11:06:28 -0800", "from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 17 Dec\n 2020 11:06:27 -0800", "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com\n (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Thu, 17 Dec 2020 11:06:27 -0800", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Thu, 17 Dec 2020 11:06:27 -0800", "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 557033F703F;\n Thu, 17 Dec 2020 11:06:25 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=7KPgaB/G5FP37Vo8YpNNA3PthimotlphMQy8Z33a6So=;\n b=Rh4I3KbpwpEO3tJmtFXf0UpnbTcdDtQh5mTSKPEJz7qSZ6XAQ3bYa2BJAJaj8ATCfgyH\n QtmwnnvNKOBUwlTsnHYiG/wbiQVx3ywyHk1nU8IE2+sPWf1zKr9dvE+XJuc4s3iScp7I\n LUUFbRBNkflAOft+HFgUpPZljpIQtu5fmscdSVqh3kCrU18k54BZtEVkSUqJsYCnVQ7p\n 2NjXjSsl24OQXy6+cRX6zkEoeUF1amwO2vcfI8FqnTjYl4APaRAxI8eUKm0SoENXb4Wf\n LlgaF9waXSYW2H3Utv1xmT70M9l/g7IYvfg/nSe05J0g+//FOWsMOVWHbT29v68NiR2d RA==", "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>", "To": "<anatoly.burakov@intel.com>, David Christensen <drc@linux.vnet.ibm.com>,\n <david.marchand@redhat.com>", "CC": "<jerinj@marvell.com>, <dev@dpdk.org>, Nithin Dabilpuram\n <ndabilpuram@marvell.com>", "Date": "Fri, 18 Dec 2020 00:36:03 +0530", "Message-ID": "<20201217190604.29803-4-ndabilpuram@marvell.com>", "X-Mailer": "git-send-email 2.8.4", "In-Reply-To": "<20201217190604.29803-1-ndabilpuram@marvell.com>", "References": "<20201012081106.10610-1-ndabilpuram@marvell.com>\n <20201217190604.29803-1-ndabilpuram@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737\n definitions=2020-12-17_13:2020-12-17,\n 2020-12-17 signatures=0", "Subject": "[dpdk-dev] [PATCH v6 3/4] test: add test case to validate VFIO DMA\n\tmap/unmap", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Test case alloc's system pages and tries to performs a user\nDMA map and unmap both partially and fully.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\nAcked-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n app/test/meson.build | 1 +\n app/test/test_vfio.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 108 insertions(+)\n create mode 100644 app/test/test_vfio.c", "diff": "diff --git a/app/test/meson.build b/app/test/meson.build\nindex 94fd39f..d9eedb6 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -139,6 +139,7 @@ test_sources = files('commands.c',\n \t'test_trace_register.c',\n \t'test_trace_perf.c',\n \t'test_version.c',\n+\t'test_vfio.c',\n \t'virtual_pmd.c'\n )\n \ndiff --git a/app/test/test_vfio.c b/app/test/test_vfio.c\nnew file mode 100644\nindex 0000000..c35efed\n--- /dev/null\n+++ b/app/test/test_vfio.c\n@@ -0,0 +1,107 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell.\n+ */\n+\n+#include <inttypes.h>\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <string.h>\n+#include <sys/mman.h>\n+#include <unistd.h>\n+\n+#include <rte_common.h>\n+#include <rte_eal.h>\n+#include <rte_eal_paging.h>\n+#include <rte_errno.h>\n+#include <rte_memory.h>\n+#include <rte_vfio.h>\n+\n+#include \"test.h\"\n+\n+static int\n+test_memory_vfio_dma_map(void)\n+{\n+\tuint64_t sz1, sz2, sz = 2 * rte_mem_page_size();\n+\tuint64_t unmap1, unmap2;\n+\tuint8_t *alloc_mem;\n+\tuint8_t *mem;\n+\tint ret;\n+\n+\t/* Allocate twice size of requirement from heap to align later */\n+\talloc_mem = malloc(sz * 2);\n+\tif (!alloc_mem) {\n+\t\tprintf(\"Skipping test as unable to alloc %\"PRIx64\"B from heap\\n\",\n+\t\t sz * 2);\n+\t\treturn 1;\n+\t}\n+\n+\t/* Force page allocation */\n+\tmemset(alloc_mem, 0, sz * 2);\n+\n+\tmem = RTE_PTR_ALIGN(alloc_mem, rte_mem_page_size());\n+\n+\t/* map the whole region */\n+\tret = rte_vfio_container_dma_map(RTE_VFIO_DEFAULT_CONTAINER_FD,\n+\t\t\t\t\t (uintptr_t)mem, (rte_iova_t)mem, sz);\n+\tif (ret) {\n+\t\t/* Check if VFIO is not available or no device is probed */\n+\t\tif (rte_errno == ENOTSUP || rte_errno == ENODEV) {\n+\t\t\tret = 1;\n+\t\t\tgoto fail;\n+\t\t}\n+\t\tprintf(\"Failed to dma map whole region, ret=%d(%s)\\n\",\n+\t\t ret, rte_strerror(rte_errno));\n+\t\tgoto fail;\n+\t}\n+\n+\tunmap1 = (uint64_t)mem + (sz / 2);\n+\tsz1 = sz / 2;\n+\tunmap2 = (uint64_t)mem;\n+\tsz2 = sz / 2;\n+\t/* unmap the partial region */\n+\tret = rte_vfio_container_dma_unmap(RTE_VFIO_DEFAULT_CONTAINER_FD,\n+\t\t\t\t\t unmap1, (rte_iova_t)unmap1, sz1);\n+\tif (ret) {\n+\t\tif (rte_errno == ENOTSUP) {\n+\t\t\tprintf(\"Partial dma unmap not supported\\n\");\n+\t\t\tunmap2 = (uint64_t)mem;\n+\t\t\tsz2 = sz;\n+\t\t} else {\n+\t\t\tprintf(\"Failed to unmap second half region, ret=%d(%s)\\n\",\n+\t\t\t ret, rte_strerror(rte_errno));\n+\t\t\tgoto fail;\n+\t\t}\n+\t}\n+\n+\t/* unmap the remaining region */\n+\tret = rte_vfio_container_dma_unmap(RTE_VFIO_DEFAULT_CONTAINER_FD,\n+\t\t\t\t\t unmap2, (rte_iova_t)unmap2, sz2);\n+\tif (ret) {\n+\t\tprintf(\"Failed to unmap remaining region, ret=%d(%s)\\n\", ret,\n+\t\t rte_strerror(rte_errno));\n+\t\tgoto fail;\n+\t}\n+\n+fail:\n+\tfree(alloc_mem);\n+\treturn ret;\n+}\n+\n+static int\n+test_vfio(void)\n+{\n+\tint ret;\n+\n+\t/* test for vfio dma map/unmap */\n+\tret = test_memory_vfio_dma_map();\n+\tif (ret == 1) {\n+\t\tprintf(\"VFIO dma map/unmap unsupported\\n\");\n+\t} else if (ret < 0) {\n+\t\tprintf(\"Error vfio dma map/unmap, ret=%d\\n\", ret);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+REGISTER_TEST_COMMAND(vfio_autotest, test_vfio);\n", "prefixes": [ "v6", "3/4" ] }{ "id": 85378, "url": "