Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/62109/?format=api
http://patchwork.dpdk.org/api/patches/62109/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20191028140122.9592-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": "<20191028140122.9592-2-olivier.matz@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191028140122.9592-2-olivier.matz@6wind.com", "date": "2019-10-28T14:01:18", "name": "[1/5] mempool: allow unaligned addr/len in populate virt", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7acc0b7d149fa08f8cd88d03e594ce8a05a27122", "submitter": { "id": 8, "url": "http://patchwork.dpdk.org/api/people/8/?format=api", "name": "Olivier Matz", "email": "olivier.matz@6wind.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20191028140122.9592-2-olivier.matz@6wind.com/mbox/", "series": [ { "id": 7108, "url": "http://patchwork.dpdk.org/api/series/7108/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=7108", "date": "2019-10-28T14:01:17", "name": "mempool: avoid objects allocations across pages", "version": 1, "mbox": "http://patchwork.dpdk.org/series/7108/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/62109/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/62109/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 F195B1BF1F;\n\tMon, 28 Oct 2019 15:01:57 +0100 (CET)", "from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com\n\t[62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 590A51BEC6\n\tfor <dev@dpdk.org>; Mon, 28 Oct 2019 15:01:51 +0100 (CET)", "from glumotte.dev.6wind.com. (unknown [10.16.0.195])\n\tby proxy.6wind.com (Postfix) with ESMTP id 2A5F83373B2;\n\tMon, 28 Oct 2019 15:01:51 +0100 (CET)" ], "From": "Olivier Matz <olivier.matz@6wind.com>", "To": "dev@dpdk.org", "Cc": "Anatoly Burakov <anatoly.burakov@intel.com>,\n\tAndrew Rybchenko <arybchenko@solarflare.com>,\n\tFerruh Yigit <ferruh.yigit@linux.intel.com>,\n\t\"Giridharan, Ganesan\" <ggiridharan@rbbn.com>,\n\tJerin Jacob Kollanukkaran <jerinj@marvell.com>,\n\t\"Kiran Kumar Kokkilagadda\" <kirankumark@marvell.com>,\n\tStephen Hemminger <sthemmin@microsoft.com>,\n\tThomas Monjalon <thomas@monjalon.net>,\n\tVamsi Krishna Attunuru <vattunuru@marvell.com>", "Date": "Mon, 28 Oct 2019 15:01:18 +0100", "Message-Id": "<20191028140122.9592-2-olivier.matz@6wind.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20191028140122.9592-1-olivier.matz@6wind.com>", "References": "<20190719133845.32432-1-olivier.matz@6wind.com>\n\t<20191028140122.9592-1-olivier.matz@6wind.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 1/5] 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\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": "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>\n---\n lib/librte_mempool/rte_mempool.c | 18 +++++++-----------\n lib/librte_mempool/rte_mempool.h | 3 +--\n 2 files changed, 8 insertions(+), 13 deletions(-)", "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 0f29e8712..76cbacdf3 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,7 +383,10 @@ 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_PTR_ALIGN_CEIL(addr + off + 1, pg_sz) -\n+\t\t\t (addr + 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@@ -575,8 +572,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 +597,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": [ "1/5" ] }{ "id": 62109, "url": "