get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57222,
    "url": "https://patches.dpdk.org/api/patches/57222/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190729121313.30639-2-vattunuru@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20190729121313.30639-2-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190729121313.30639-2-vattunuru@marvell.com",
    "date": "2019-07-29T12:13:09",
    "name": "[v9,1/5] mempool: populate mempool with the page sized chunks of memory",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "62b05ffaf8aca69b1d70671a1ca4b8a30dc3e25a",
    "submitter": {
        "id": 1277,
        "url": "https://patches.dpdk.org/api/people/1277/?format=api",
        "name": "Vamsi Krishna Attunuru",
        "email": "vattunuru@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190729121313.30639-2-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 5808,
            "url": "https://patches.dpdk.org/api/series/5808/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5808",
            "date": "2019-07-29T12:13:08",
            "name": "kni: add IOVA=VA support",
            "version": 9,
            "mbox": "https://patches.dpdk.org/series/5808/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/57222/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/57222/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 65A551BF53;\n\tMon, 29 Jul 2019 14:13:39 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 1CE9B1BF51\n\tfor <dev@dpdk.org>; Mon, 29 Jul 2019 14:13:35 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx6TCAJBv025747; Mon, 29 Jul 2019 05:13:34 -0700",
            "from sc-exch01.marvell.com ([199.233.58.181])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2u0p4ky2kv-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 29 Jul 2019 05:13:34 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 29 Jul 2019 05:13:32 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 29 Jul 2019 05:13:32 -0700",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n\tby maili.marvell.com (Postfix) with ESMTP id 5BE5C3F7040;\n\tMon, 29 Jul 2019 05:13:29 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-type; s=pfpt0818;\n\tbh=EHw0uM827wGIBOe/pUyVBH6DDA72kyO9p9v49qBtTEc=; \n\tb=JfH3Md9dpy/ryAK0vuc8aop/GRJxYx2c8zgiyZdfNhti+Tm7h5RHy6wWAk8B+x1iv7Af\n\toh7gwzG6Ih4df6ElOVzgih+4DuM3OTbpgLXQyB6krXHTfPF3hQ3bw/SJNoye8VNyp9wD\n\thgBjmg9mWRCad7UU9dh0wjM8e+jRL59PBjQaP1j6Zs20Ofc4VZkOqI6QBuNLgu7obS6t\n\tzfvSmF6u7PVe9Dg98a4pGFTdO5C75evde7WKJNUKPC4SbNRN7u3IeJdOW0wp6NxFlBGa\n\tL7bIMlZVHorpmfza3Lg5GTWJnVXjEjUmnPbl+9RRfXLyDFNgxh2QzVVUi0C7s6h/qIyA\n\ttA== ",
        "From": "<vattunuru@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <jerinj@marvell.com>, <olivier.matz@6wind.com>,\n\t<ferruh.yigit@intel.com>, <anatoly.burakov@intel.com>,\n\t<arybchenko@solarflare.com>, <kirankumark@marvell.com>, Vamsi Attunuru\n\t<vattunuru@marvell.com>",
        "Date": "Mon, 29 Jul 2019 17:43:09 +0530",
        "Message-ID": "<20190729121313.30639-2-vattunuru@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20190729121313.30639-1-vattunuru@marvell.com>",
        "References": "<20190723053821.30227-1-vattunuru@marvell.com>\n\t<20190729121313.30639-1-vattunuru@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:5.22.84,1.0.8\n\tdefinitions=2019-07-29_06:2019-07-29,2019-07-29 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v9 1/5] mempool: populate mempool with the page\n\tsized chunks of memory",
        "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": "From: Vamsi Attunuru <vattunuru@marvell.com>\n\nPatch adds a routine to populate mempool from page aligned and\npage sized chunks of memory to ensure memory objs do not fall\nacross the page boundaries. It's useful for applications that\nrequire physically contiguous mbuf memory while running in\nIOVA=VA mode.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\n---\n lib/librte_mempool/rte_mempool.c           | 64 ++++++++++++++++++++++++++++++\n lib/librte_mempool/rte_mempool.h           | 17 ++++++++\n lib/librte_mempool/rte_mempool_version.map |  1 +\n 3 files changed, 82 insertions(+)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 7260ce0..00619bd 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -414,6 +414,70 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \treturn ret;\n }\n \n+/* Function to populate mempool from page sized mem chunks, allocate page size\n+ * of memory in memzone and populate them. Return the number of objects added,\n+ * or a negative value on error.\n+ */\n+int\n+rte_mempool_populate_from_pg_sz_chunks(struct rte_mempool *mp)\n+{\n+\tchar mz_name[RTE_MEMZONE_NAMESIZE];\n+\tsize_t align, pg_sz, pg_shift;\n+\tconst struct rte_memzone *mz;\n+\tunsigned int mz_id, n;\n+\tsize_t min_chunk_size;\n+\tint ret;\n+\n+\tret = mempool_ops_alloc_once(mp);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tif (mp->nb_mem_chunks != 0)\n+\t\treturn -EEXIST;\n+\n+\tpg_sz = get_min_page_size(mp->socket_id);\n+\tpg_shift = rte_bsf32(pg_sz);\n+\n+\tfor (mz_id = 0, n = mp->size; n > 0; mz_id++, n -= ret) {\n+\n+\t\tret = rte_mempool_ops_calc_mem_size(mp, n,\n+\t\t\t\tpg_shift, &min_chunk_size, &align);\n+\n+\t\tif (ret < 0 || min_chunk_size > pg_sz)\n+\t\t\tgoto fail;\n+\n+\t\tret = snprintf(mz_name, sizeof(mz_name),\n+\t\t\tRTE_MEMPOOL_MZ_FORMAT \"_%d\", mp->name, mz_id);\n+\t\tif (ret < 0 || ret >= (int)sizeof(mz_name)) {\n+\t\t\tret = -ENAMETOOLONG;\n+\t\t\tgoto fail;\n+\t\t}\n+\n+\t\tmz = rte_memzone_reserve_aligned(mz_name, min_chunk_size,\n+\t\t\t\tmp->socket_id, 0, align);\n+\n+\t\tif (mz == NULL) {\n+\t\t\tret = -rte_errno;\n+\t\t\tgoto fail;\n+\t\t}\n+\n+\t\tret = rte_mempool_populate_iova(mp, mz->addr,\n+\t\t\t\tmz->iova, mz->len,\n+\t\t\t\trte_mempool_memchunk_mz_free,\n+\t\t\t\t(void *)(uintptr_t)mz);\n+\t\tif (ret < 0) {\n+\t\t\trte_memzone_free(mz);\n+\t\t\tgoto fail;\n+\t\t}\n+\t}\n+\n+\treturn mp->size;\n+\n+fail:\n+\trte_mempool_free_memchunks(mp);\n+\treturn ret;\n+}\n+\n /* Default function to populate the mempool: allocate memory in memzones,\n  * and populate them. Return the number of objects added, or a negative\n  * value on error.\ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex 8053f7a..3046e4f 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -1062,6 +1062,23 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \tvoid *opaque);\n \n /**\n+ * Add memory from page sized memzones for objects in the pool at init\n+ *\n+ * This is the function used to populate the mempool with page aligned and\n+ * page sized memzone memory to avoid spreading object memory across two pages\n+ * and to ensure all mempool objects reside on the page memory.\n+ *\n+ * @param mp\n+ *   A pointer to the mempool structure.\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+ */\n+__rte_experimental\n+int rte_mempool_populate_from_pg_sz_chunks(struct rte_mempool *mp);\n+\n+/**\n  * Add memory for objects in the pool at init\n  *\n  * This is the default function used by rte_mempool_create() to populate\ndiff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map\nindex 17cbca4..9a6fe65 100644\n--- a/lib/librte_mempool/rte_mempool_version.map\n+++ b/lib/librte_mempool/rte_mempool_version.map\n@@ -57,4 +57,5 @@ EXPERIMENTAL {\n \tglobal:\n \n \trte_mempool_ops_get_info;\n+\trte_mempool_populate_from_pg_sz_chunks;\n };\n",
    "prefixes": [
        "v9",
        "1/5"
    ]
}