get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/64369/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 64369,
    "url": "http://patches.dpdk.org/api/patches/64369/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200109132720.15664-1-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": "<20200109132720.15664-1-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200109132720.15664-1-olivier.matz@6wind.com",
    "date": "2020-01-09T13:27:20",
    "name": "mempool: fix mempool virt populate with small chunks",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2baed8fa35fcb27c7d636340d07862e915000c3d",
    "submitter": {
        "id": 8,
        "url": "http://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.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/20200109132720.15664-1-olivier.matz@6wind.com/mbox/",
    "series": [
        {
            "id": 8037,
            "url": "http://patches.dpdk.org/api/series/8037/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8037",
            "date": "2020-01-09T13:27:20",
            "name": "mempool: fix mempool virt populate with small chunks",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8037/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64369/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/64369/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 70C13A046B;\n\tThu,  9 Jan 2020 14:27:29 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A52711DD6F;\n\tThu,  9 Jan 2020 14:27:28 +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 EC5A21DBA7;\n Thu,  9 Jan 2020 14:27:26 +0100 (CET)",
            "from glumotte.dev.6wind.com. (unknown [10.16.0.195])\n by proxy.6wind.com (Postfix) with ESMTP id A4BF3366807;\n Thu,  9 Jan 2020 14:27:26 +0100 (CET)"
        ],
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Andrew Rybchenko <arybchenko@solarflare.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>, stable@dpdk.org",
        "Date": "Thu,  9 Jan 2020 14:27:20 +0100",
        "Message-Id": "<20200109132720.15664-1-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH] mempool: fix mempool virt populate with small\n\tchunks",
        "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 -ENOBUFS when no object can be populated,\nso it can be ignored by the caller. As this would be an API change, add\na compat wrapper to keep the current API unchanged. The wrapper will be\nremoved for 20.11.\n\nFixes: 354788b60cfd (\"mempool: allow populating with unaligned virtual area\")\nCc: stable@dpdk.org\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n\nIs there a simple way to ensure that we won't forget to remove the\nwrapper for 20.11? Anatoly suggested me to use versioned symbols, but\nit's not clear to me how.\n\n doc/guides/rel_notes/deprecation.rst |  4 ++++\n lib/librte_mempool/rte_mempool.c     | 28 +++++++++++++++++++++++-----\n lib/librte_mempool/rte_mempool.h     |  5 ++++-\n 3 files changed, 31 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex afa94b43e..b6e89d9a2 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -86,3 +86,7 @@ Deprecation Notices\n   to set new power environment if power environment was already initialized.\n   In this case the function will return -1 unless the environment is unset first\n   (using ``rte_power_unset_env``). Other function usage scenarios will not change.\n+\n+* mempool: starting from v20.11, rte_mempool_populate_iova() will\n+  return -ENOBUFS instead of -EINVAL when there is not enough room to\n+  store one object.\ndiff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 78d8eb941..bda361ce6 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 = -ENOBUFS;\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 = -ENOBUFS;\n \t\tgoto fail;\n \t}\n \n@@ -356,6 +356,22 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n \treturn ret;\n }\n \n+/* Compat wrapper, to be removed when changing the API is allowed (v20.11). */\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 == -ENOBUFS)\n+\t\tret = -EINVAL;\n+\n+\treturn ret;\n+}\n+\n static rte_iova_t\n get_iova(void *addr)\n {\n@@ -406,8 +422,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 == -ENOBUFS)\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 */\ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex f81152af9..c08bb444f 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -1108,7 +1108,10 @@ rte_mempool_free(struct rte_mempool *mp);\n  * @return\n  *   The number of objects added on success.\n  *   On error, the chunk is not added in the memory list of the\n- *   mempool and a negative errno is returned.\n+ *   mempool and a negative errno is returned:\n+ *   (-ENOBUFS): not enough room in chunk for one object.\n+ *   (-ENOSPC): mempool is already populated.\n+ *   (-ENOMEM): allocation failure.\n  */\n int 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",
    "prefixes": []
}