Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/64849/?format=api
http://patches.dpdk.org/api/patches/64849/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200117145754.11682-2-olivier.matz@6wind.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": "<20200117145754.11682-2-olivier.matz@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200117145754.11682-2-olivier.matz@6wind.com", "date": "2020-01-17T14:57:52", "name": "[v2,1/3] mempool: fix mempool virt populate with small chunks", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "7d8a81f3e5091c4a9ea58d5c735f809b666c634c", "submitter": { "id": 8, "url": "http://patches.dpdk.org/api/people/8/?format=api", "name": "Olivier Matz", "email": "olivier.matz@6wind.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200117145754.11682-2-olivier.matz@6wind.com/mbox/", "series": [ { "id": 8198, "url": "http://patches.dpdk.org/api/series/8198/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8198", "date": "2020-01-17T14:57:51", "name": "mempool: fix mempool virt populate with small chunks", "version": 2, "mbox": "http://patches.dpdk.org/series/8198/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/64849/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/64849/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 D209BA051A;\n\tFri, 17 Jan 2020 15:58:23 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DF6762BAA;\n\tFri, 17 Jan 2020 15:58:17 +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 1302728F3;\n Fri, 17 Jan 2020 15:58:15 +0100 (CET)", "from glumotte.dev.6wind.com. (unknown [10.16.0.195])\n by proxy.6wind.com (Postfix) with ESMTP id DD83136DD32;\n Fri, 17 Jan 2020 15:58:14 +0100 (CET)" ], "From": "Olivier Matz <olivier.matz@6wind.com>", "To": "dev@dpdk.org", "Cc": "\"Zhang, AlvinX\" <alvinx.zhang@intel.com>,\n \"Burakov, Anatoly\" <anatoly.burakov@intel.com>,\n Andrew Rybchenko <arybchenko@solarflare.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n David Marchand <david.marchand@redhat.com>, dpdk stable <stable@dpdk.org>", "Date": "Fri, 17 Jan 2020 15:57:52 +0100", "Message-Id": "<20200117145754.11682-2-olivier.matz@6wind.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200117145754.11682-1-olivier.matz@6wind.com>", "References": "<20200109132720.15664-1-olivier.matz@6wind.com>\n <20200117145754.11682-1-olivier.matz@6wind.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 1/3] mempool: fix mempool virt populate with\n\tsmall chunks", "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": "To populate a mempool with a virtual area, the mempool code calls\nrte_mempool_populate_iova() for each iova-contiguous area. It happens\n(rarely) that this area is too small to store one object. In this case,\nrte_mempool_populate_iova() returns an error, which is forwarded by\nrte_mempool_populate_virt().\n\nThis case should not throw an error in\nrte_mempool_populate_virt(). Instead, the area that is too small should\njust be ignored.\n\nTo fix this issue, change the return value of\nrte_mempool_populate_iova() to 0 when no object can be populated,\nso it can be ignored by the caller. As this would be an API/ABI change,\nonly do this modification internally for now.\n\nFixes: 354788b60cfd (\"mempool: allow populating with unaligned virtual area\")\nCc: stable@dpdk.org\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\nTested-by: Anatoly Burakov <anatoly.burakov@intel.com>\nTested-by: Zhang Alvin <alvinx.zhang@intel.com>\n---\n lib/librte_mempool/rte_mempool.c | 30 +++++++++++++++++++++++++-----\n 1 file changed, 25 insertions(+), 5 deletions(-)", "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex f8d453d21..b434d9f17 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -297,8 +297,8 @@ mempool_ops_alloc_once(struct rte_mempool *mp)\n * zone. Return the number of objects added, or a negative value\n * on error.\n */\n-int\n-rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n+static int\n+__rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n \trte_iova_t iova, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,\n \tvoid *opaque)\n {\n@@ -332,7 +332,7 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n \t\toff = RTE_PTR_ALIGN_CEIL(vaddr, RTE_MEMPOOL_ALIGN) - vaddr;\n \n \tif (off > len) {\n-\t\tret = -EINVAL;\n+\t\tret = 0;\n \t\tgoto fail;\n \t}\n \n@@ -343,7 +343,7 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n \n \t/* not enough room to store one object */\n \tif (i == 0) {\n-\t\tret = -EINVAL;\n+\t\tret = 0;\n \t\tgoto fail;\n \t}\n \n@@ -356,6 +356,21 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n \treturn ret;\n }\n \n+int\n+rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n+\trte_iova_t iova, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,\n+\tvoid *opaque)\n+{\n+\tint ret;\n+\n+\tret = __rte_mempool_populate_iova(mp, vaddr, iova, len, free_cb,\n+\t\t\t\t\topaque);\n+\tif (ret == 0)\n+\t\tret = -EINVAL;\n+\n+\treturn ret;\n+}\n+\n static rte_iova_t\n get_iova(void *addr)\n {\n@@ -406,8 +421,10 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \t\t\t\tbreak;\n \t\t}\n \n-\t\tret = rte_mempool_populate_iova(mp, addr + off, iova,\n+\t\tret = __rte_mempool_populate_iova(mp, addr + off, iova,\n \t\t\tphys_len, free_cb, opaque);\n+\t\tif (ret == 0)\n+\t\t\tcontinue;\n \t\tif (ret < 0)\n \t\t\tgoto fail;\n \t\t/* no need to call the free callback for next chunks */\n@@ -415,6 +432,9 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \t\tcnt += ret;\n \t}\n \n+\tif (cnt == 0)\n+\t\treturn -EINVAL;\n+\n \treturn cnt;\n \n fail:\n", "prefixes": [ "v2", "1/3" ] }{ "id": 64849, "url": "