Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/63018/?format=api
http://patches.dpdk.org/api/patches/63018/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/825d02ef7f7b6ab65a36d9fa4719847228537384.1573739893.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": "<825d02ef7f7b6ab65a36d9fa4719847228537384.1573739893.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/825d02ef7f7b6ab65a36d9fa4719847228537384.1573739893.git.anatoly.burakov@intel.com", "date": "2019-11-14T13:58:20", "name": "[1/2] mempool: use actual IOVA addresses when populating", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "69d76fc8fb3dce810f3636a6d83f9f94ea0c008b", "submitter": { "id": 4, "url": "http://patches.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/825d02ef7f7b6ab65a36d9fa4719847228537384.1573739893.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 7457, "url": "http://patches.dpdk.org/api/series/7457/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7457", "date": "2019-11-14T13:58:20", "name": "[1/2] mempool: use actual IOVA addresses when populating", "version": 1, "mbox": "http://patches.dpdk.org/series/7457/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/63018/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/63018/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 2C7A5A04C6;\n\tThu, 14 Nov 2019 14:58:27 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CEB642BC8;\n\tThu, 14 Nov 2019 14:58:25 +0100 (CET)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 9DB91374;\n Thu, 14 Nov 2019 14:58:24 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 14 Nov 2019 05:58:23 -0800", "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.223.151])\n by fmsmga005.fm.intel.com with ESMTP; 14 Nov 2019 05:58:21 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.68,304,1569308400\"; d=\"scan'208\";a=\"404980508\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "Olivier Matz <olivier.matz@6wind.com>,\n Andrew Rybchenko <arybchenko@solarflare.com>, david.marchand@redhat.com,\n stable@dpdk.org", "Date": "Thu, 14 Nov 2019 13:58:20 +0000", "Message-Id": "\n <825d02ef7f7b6ab65a36d9fa4719847228537384.1573739893.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[dpdk-dev] [PATCH 1/2] mempool: use actual IOVA addresses when\n\tpopulating", "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": "Currently, when mempool is being populated, we get IOVA address\nof every segment using rte_mem_virt2iova(). This works for internal\nmemory, but does not really work for external memory, and does not\nwork on platforms which return RTE_BAD_IOVA as a result of this\ncall (such as FreeBSD). Moreover, even when it works, the function\nin question will do unnecessary pagewalks in IOVA as PA mode, as\nit falls back to rte_mem_virt2phy() instead of just doing a lookup in\ninternal memseg table.\n\nTo fix it, replace the call to first attempt to look through the\ninternal memseg table (this takes care of internal and external memory),\nand fall back to rte_mem_virt2iova() when unable to perform VA->IOVA\ntranslation via memseg table.\n\nFixes: 66cc45e293ed (\"mem: replace memseg with memseg lists\")\nCc: stable@dpdk.org\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_mempool/rte_mempool.c | 17 +++++++++++++++--\n 1 file changed, 15 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 40cae3eb67..8da2e471c7 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -356,6 +356,19 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n \treturn ret;\n }\n \n+static rte_iova_t\n+get_iova(void *addr)\n+{\n+\tstruct rte_memseg *ms;\n+\n+\t/* try registered memory first */\n+\tms = rte_mem_virt2memseg(addr, NULL);\n+\tif (ms == NULL || ms->iova == RTE_BAD_IOVA)\n+\t\t/* fall back to actual physical address */\n+\t\treturn rte_mem_virt2iova(addr);\n+\treturn ms->iova + RTE_PTR_DIFF(addr, ms->addr);\n+}\n+\n /* Populate the mempool with a virtual area. Return the number of\n * objects added, or a negative value on error.\n */\n@@ -375,7 +388,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \tfor (off = 0; off < len &&\n \t\t mp->populated_size < mp->size; off += phys_len) {\n \n-\t\tiova = rte_mem_virt2iova(addr + off);\n+\t\tiova = get_iova(addr + off);\n \n \t\tif (iova == RTE_BAD_IOVA && rte_eal_has_hugepages()) {\n \t\t\tret = -EINVAL;\n@@ -391,7 +404,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \t\t phys_len = RTE_MIN(phys_len + pg_sz, len - off)) {\n \t\t\trte_iova_t iova_tmp;\n \n-\t\t\tiova_tmp = rte_mem_virt2iova(addr + off + phys_len);\n+\t\t\tiova_tmp = get_iova(addr + off + phys_len);\n \n \t\t\tif (iova_tmp == RTE_BAD_IOVA ||\n \t\t\t\t\tiova_tmp != iova + phys_len)\n", "prefixes": [ "1/2" ] }{ "id": 63018, "url": "