Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/62227/?format=api
http://patchwork.dpdk.org/api/patches/62227/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20191030143619.4007-2-olivier.matz@6wind.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20191030143619.4007-2-olivier.matz@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191030143619.4007-2-olivier.matz@6wind.com", "date": "2019-10-30T14:36:14", "name": "[v2,1/6] mempool: allow unaligned addr/len in populate virt", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "107caa42fe4cc4bb378772b35f06194bc1f72f15", "submitter": { "id": 8, "url": "http://patchwork.dpdk.org/api/people/8/?format=api", "name": "Olivier Matz", "email": "olivier.matz@6wind.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20191030143619.4007-2-olivier.matz@6wind.com/mbox/", "series": [ { "id": 7161, "url": "http://patchwork.dpdk.org/api/series/7161/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=7161", "date": "2019-10-30T14:36:15", "name": "mempool: avoid objects allocations across pages", "version": 2, "mbox": "http://patchwork.dpdk.org/series/7161/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/62227/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/62227/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 544A7A00BE;\n\tWed, 30 Oct 2019 15:37:21 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4B5DE1C00E;\n\tWed, 30 Oct 2019 15:37:04 +0100 (CET)", "from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com\n [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 87B661BF7A\n for <dev@dpdk.org>; Wed, 30 Oct 2019 15:36:57 +0100 (CET)", "from glumotte.dev.6wind.com. (unknown [10.16.0.195])\n by proxy.6wind.com (Postfix) with ESMTP id A4D1E338A49;\n Wed, 30 Oct 2019 15:36:55 +0100 (CET)" ], "From": "Olivier Matz <olivier.matz@6wind.com>", "To": "dev@dpdk.org", "Cc": "Anatoly Burakov <anatoly.burakov@intel.com>,\n Andrew Rybchenko <arybchenko@solarflare.com>,\n Ferruh Yigit <ferruh.yigit@linux.intel.com>,\n \"Giridharan, Ganesan\" <ggiridharan@rbbn.com>,\n Jerin Jacob Kollanukkaran <jerinj@marvell.com>,\n \"Kiran Kumar Kokkilagadda\" <kirankumark@marvell.com>,\n Stephen Hemminger <sthemmin@microsoft.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Vamsi Krishna Attunuru <vattunuru@marvell.com>", "Date": "Wed, 30 Oct 2019 15:36:14 +0100", "Message-Id": "<20191030143619.4007-2-olivier.matz@6wind.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20191030143619.4007-1-olivier.matz@6wind.com>", "References": "<20190719133845.32432-1-olivier.matz@6wind.com>\n <20191030143619.4007-1-olivier.matz@6wind.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 1/6] mempool: allow unaligned addr/len in\n\tpopulate virt", "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": "rte_mempool_populate_virt() currently requires that both addr\nand length are page-aligned.\n\nRemove this uneeded constraint which can be annoying with big\nhugepages (ex: 1GB).\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\nReviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n lib/librte_mempool/rte_mempool.c | 23 +++++++++++------------\n lib/librte_mempool/rte_mempool.h | 3 +--\n 2 files changed, 12 insertions(+), 14 deletions(-)", "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 0f29e8712..88e49c751 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -368,17 +368,11 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \tsize_t off, phys_len;\n \tint ret, cnt = 0;\n \n-\t/* address and len must be page-aligned */\n-\tif (RTE_PTR_ALIGN_CEIL(addr, pg_sz) != addr)\n-\t\treturn -EINVAL;\n-\tif (RTE_ALIGN_CEIL(len, pg_sz) != len)\n-\t\treturn -EINVAL;\n-\n \tif (mp->flags & MEMPOOL_F_NO_IOVA_CONTIG)\n \t\treturn rte_mempool_populate_iova(mp, addr, RTE_BAD_IOVA,\n \t\t\tlen, free_cb, opaque);\n \n-\tfor (off = 0; off + pg_sz <= len &&\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@@ -389,12 +383,18 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \t\t}\n \n \t\t/* populate with the largest group of contiguous pages */\n-\t\tfor (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) {\n+\t\tfor (phys_len = RTE_MIN(\n+\t\t\t(size_t)(RTE_PTR_ALIGN_CEIL(addr + off + 1, pg_sz) -\n+\t\t\t\t(addr + off)),\n+\t\t\tlen - off);\n+\t\t off + phys_len < len;\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 \n-\t\t\tif (iova_tmp != iova + phys_len)\n+\t\t\tif (iova_tmp == RTE_BAD_IOVA ||\n+\t\t\t\t\tiova_tmp != iova + phys_len)\n \t\t\t\tbreak;\n \t\t}\n \n@@ -575,8 +575,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t\t\t * have\n \t\t\t */\n \t\t\tmz = rte_memzone_reserve_aligned(mz_name, 0,\n-\t\t\t\t\tmp->socket_id, flags,\n-\t\t\t\t\tRTE_MAX(pg_sz, align));\n+\t\t\t\t\tmp->socket_id, flags, align);\n \t\t}\n \t\tif (mz == NULL) {\n \t\t\tret = -rte_errno;\n@@ -601,7 +600,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t\t\t\t(void *)(uintptr_t)mz);\n \t\telse\n \t\t\tret = rte_mempool_populate_virt(mp, mz->addr,\n-\t\t\t\tRTE_ALIGN_FLOOR(mz->len, pg_sz), pg_sz,\n+\t\t\t\tmz->len, pg_sz,\n \t\t\t\trte_mempool_memchunk_mz_free,\n \t\t\t\t(void *)(uintptr_t)mz);\n \t\tif (ret < 0) {\ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex 8053f7a04..0fe8aa7b8 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -1042,9 +1042,8 @@ int rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n * A pointer to the mempool structure.\n * @param addr\n * The virtual address of memory that should be used to store objects.\n- * Must be page-aligned.\n * @param len\n- * The length of memory in bytes. Must be page-aligned.\n+ * The length of memory in bytes.\n * @param pg_sz\n * The size of memory pages in this virtual area.\n * @param free_cb\n", "prefixes": [ "v2", "1/6" ] }{ "id": 62227, "url": "