Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/37705/?format=api
http://patches.dpdk.org/api/patches/37705/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/e8c80225e6cbb69b2c2d85ed90a5518f47102f2f.1523296700.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": "<e8c80225e6cbb69b2c2d85ed90a5518f47102f2f.1523296700.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/e8c80225e6cbb69b2c2d85ed90a5518f47102f2f.1523296700.git.anatoly.burakov@intel.com", "date": "2018-04-09T18:00:39", "name": "[dpdk-dev,v5,36/70] eal: add iova2virt function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "14a4332ac5390181db461bb2205b34d2c1413370", "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/e8c80225e6cbb69b2c2d85ed90a5518f47102f2f.1523296700.git.anatoly.burakov@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/37705/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/37705/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 190691BA27;\n\tMon, 9 Apr 2018 20:03:06 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 5C5AC1B880\n\tfor <dev@dpdk.org>; Mon, 9 Apr 2018 20:01:39 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Apr 2018 11:01:38 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga004.jf.intel.com with ESMTP; 09 Apr 2018 11:01:34 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw39I1XLC031154; Mon, 9 Apr 2018 19:01:33 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w39I1XJO027968;\n\tMon, 9 Apr 2018 19:01:33 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w39I1WS2027954;\n\tMon, 9 Apr 2018 19:01:32 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.48,427,1517904000\"; d=\"scan'208\";a=\"190066575\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "keith.wiles@intel.com, jianfeng.tan@intel.com, andras.kovacs@ericsson.com,\n\tlaszlo.vadkeri@ericsson.com, benjamin.walker@intel.com,\n\tbruce.richardson@intel.com, thomas@monjalon.net,\n\tkonstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com,\n\tlouise.m.daly@intel.com, nelio.laranjeiro@6wind.com,\n\tyskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, \n\themant.agrawal@nxp.com, olivier.matz@6wind.com, shreyansh.jain@nxp.com,\n\tgowrishankar.m@linux.vnet.ibm.com", "Date": "Mon, 9 Apr 2018 19:00:39 +0100", "Message-Id": "<e8c80225e6cbb69b2c2d85ed90a5518f47102f2f.1523296700.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1523296700.git.anatoly.burakov@intel.com>", "<cover.1523296700.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1523296700.git.anatoly.burakov@intel.com>", "<cover.1523218215.git.anatoly.burakov@intel.com>\n\t<cover.1523296700.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH v5 36/70] eal: add iova2virt function", "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This is reverse lookup of PA to VA. Using this will make\nother code less dependent on internals of mem API.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nTested-by: Santosh Shukla <Santosh.Shukla@caviumnetworks.com>\nTested-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n lib/librte_eal/common/eal_common_memory.c | 30 ++++++++++++++++++++++++++++++\n lib/librte_eal/common/include/rte_memory.h | 12 ++++++++++++\n lib/librte_eal/rte_eal_version.map | 1 +\n 3 files changed, 43 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex 4b528b0..ea3c5a7 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -131,6 +131,36 @@ rte_eal_get_physmem_layout(void)\n \treturn rte_eal_get_configuration()->mem_config->memseg;\n }\n \n+struct virtiova {\n+\trte_iova_t iova;\n+\tvoid *virt;\n+};\n+static int\n+find_virt(const struct rte_memseg *ms, void *arg)\n+{\n+\tstruct virtiova *vi = arg;\n+\tif (vi->iova >= ms->iova && vi->iova < (ms->iova + ms->len)) {\n+\t\tsize_t offset = vi->iova - ms->iova;\n+\t\tvi->virt = RTE_PTR_ADD(ms->addr, offset);\n+\t\t/* stop the walk */\n+\t\treturn 1;\n+\t}\n+\treturn 0;\n+}\n+\n+__rte_experimental void *\n+rte_mem_iova2virt(rte_iova_t iova)\n+{\n+\tstruct virtiova vi;\n+\n+\tmemset(&vi, 0, sizeof(vi));\n+\n+\tvi.iova = iova;\n+\trte_memseg_walk(find_virt, &vi);\n+\n+\treturn vi.virt;\n+}\n+\n static int\n physmem_size(const struct rte_memseg *ms, void *arg)\n {\ndiff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h\nindex 45d067f..5c60b91 100644\n--- a/lib/librte_eal/common/include/rte_memory.h\n+++ b/lib/librte_eal/common/include/rte_memory.h\n@@ -131,6 +131,18 @@ phys_addr_t rte_mem_virt2phy(const void *virt);\n rte_iova_t rte_mem_virt2iova(const void *virt);\n \n /**\n+ * Get virtual memory address corresponding to iova address.\n+ *\n+ * @param iova\n+ * The iova address.\n+ * @return\n+ * Virtual address corresponding to iova address (or NULL if address does not\n+ * exist within DPDK memory map).\n+ */\n+__rte_experimental void *\n+rte_mem_iova2virt(rte_iova_t iova);\n+\n+/**\n * Memseg walk function prototype.\n *\n * Returning 0 will continue walk\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 93033b5..dccfc35 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -223,6 +223,7 @@ EXPERIMENTAL {\n \trte_eal_mbuf_user_pool_ops;\n \trte_log_register_type_and_pick_level;\n \trte_malloc_dump_heaps;\n+\trte_mem_iova2virt;\n \trte_memseg_contig_walk;\n \trte_memseg_walk;\n \trte_mp_action_register;\n", "prefixes": [ "dpdk-dev", "v5", "36/70" ] }{ "id": 37705, "url": "