get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 31190,
    "url": "https://patches.dpdk.org/api/patches/31190/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20171106014141.13266-11-thomas@monjalon.net/",
    "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": "<20171106014141.13266-11-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20171106014141.13266-11-thomas@monjalon.net",
    "date": "2017-11-06T01:41:36",
    "name": "[dpdk-dev,v4,10/15] mempool: rename populate functions to IOVA",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "69a32e6231d57493bdcb91d25326bded80111324",
    "submitter": {
        "id": 685,
        "url": "https://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20171106014141.13266-11-thomas@monjalon.net/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/31190/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/31190/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 08AC31B2BB;\n\tMon,  6 Nov 2017 02:42:24 +0100 (CET)",
            "from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com\n\t[66.111.4.28]) by dpdk.org (Postfix) with ESMTP id C1AF21B290\n\tfor <dev@dpdk.org>; Mon,  6 Nov 2017 02:42:19 +0100 (CET)",
            "from compute1.internal (compute1.nyi.internal [10.202.2.41])\n\tby mailout.nyi.internal (Postfix) with ESMTP id 1DB1220C05;\n\tSun,  5 Nov 2017 20:42:19 -0500 (EST)",
            "from frontend2 ([10.202.2.161])\n\tby compute1.internal (MEProxy); Sun, 05 Nov 2017 20:42:19 -0500",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id 46EEE24108;\n\tSun,  5 Nov 2017 20:42:18 -0500 (EST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n\tcc:date:from:in-reply-to:message-id:references:subject:to\n\t:x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=Tlv92sURC66oJW\n\tJlz9xCXZ9DTxaEnO3oCVtumry29Os=; b=EgJBSwAb3bXsd+9FXRaY0u1QjMp7q5\n\t00vfYE50CNUl6pbkNV2DZn0nlq6zgw6FgPABfcToyhIK8gm0Nsk9Pr+MDPdbOpBz\n\tsoFciAZ1wvL1MUbdrnfCVYysDsXTJNT5Jko2I/h4jGubp5extfIHtnASatwn0O9h\n\tBjLlHqbjdO8ls=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:date:from:in-reply-to:message-id\n\t:references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=\n\tfm1; bh=Tlv92sURC66oJWJlz9xCXZ9DTxaEnO3oCVtumry29Os=; b=eFr1W1u6\n\t/cVaGufOZdqxvErJHl191T0Ewrvohdp2ihHeD6T2pQ1Xg7KOFNLAvU/hmSqG4su/\n\tih2qpy06Oz7urnmfENw8tJPZFmG9mdFJxYzuQsCkS5zzaaircmBjpi3gN7Fjoyni\n\twvAP2xVyGzbXmeoAygNSmHkeGvNeE8UdNq6jDi/ArV6DgHK2E2fIStnDB8pxlXGd\n\tuEqZcyMiEADA4jrYE0o2pJxXj6nti/3jrsfKuX9cIIUs0rfc/807QdMLAUfK1uq3\n\t//TgWVoJKl4snRFxWV6LrSn9vMGkj5JZ5zps1CYAWK4uLO/sSNYzzv3h0OMNw1Sn\n\t89q9PzmKQB0whA=="
        ],
        "X-ME-Sender": "<xms:-73_WXCeUXQwZkm-fsrjyB15RcuQp01QXSDMyhioGAbbKUYWgpDbTw>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "Santosh Shukla <santosh.shukla@caviumnetworks.com>",
        "Cc": "olivier.matz@6wind.com, sergio.gonzalez.monroy@intel.com,\n\tanatoly.burakov@intel.com, dev@dpdk.org",
        "Date": "Mon,  6 Nov 2017 02:41:36 +0100",
        "Message-Id": "<20171106014141.13266-11-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.14.2",
        "In-Reply-To": "<20171106014141.13266-1-thomas@monjalon.net>",
        "References": "<20170814151537.29454-1-santosh.shukla@caviumnetworks.com>\n\t<20171106014141.13266-1-thomas@monjalon.net>",
        "Subject": "[dpdk-dev] [PATCH v4 10/15] mempool: rename populate functions to\n\tIOVA",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The functions rte_mempool_populate_phys() and\nrte_mempool_populate_phys_tab() are renamed to\nrte_mempool_populate_iova() and rte_mempool_populate_iova_tab().\nThe deprecated functions are kept as aliases to avoid breaking the API.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\n lib/librte_mempool/rte_mempool.c           | 51 ++++++++++++++++++++----------\n lib/librte_mempool/rte_mempool.h           | 27 ++++++++++------\n lib/librte_mempool/rte_mempool_version.map |  2 ++\n 3 files changed, 54 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 7472f830c..d50dba493 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -357,8 +357,8 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)\n  * on error.\n  */\n int\n-rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n-\tphys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,\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 \tunsigned total_elt_sz;\n@@ -368,7 +368,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n \tint ret;\n \n \t/* Notify memory area to mempool */\n-\tret = rte_mempool_ops_register_memory_area(mp, vaddr, paddr, len);\n+\tret = rte_mempool_ops_register_memory_area(mp, vaddr, iova, len);\n \tif (ret != -ENOTSUP && ret < 0)\n \t\treturn ret;\n \n@@ -402,7 +402,7 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n \n \tmemhdr->mp = mp;\n \tmemhdr->addr = vaddr;\n-\tmemhdr->iova = paddr;\n+\tmemhdr->iova = iova;\n \tmemhdr->len = len;\n \tmemhdr->free_cb = free_cb;\n \tmemhdr->opaque = opaque;\n@@ -417,11 +417,11 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n \n \twhile (off + total_elt_sz <= len && mp->populated_size < mp->size) {\n \t\toff += mp->header_size;\n-\t\tif (paddr == RTE_BAD_PHYS_ADDR)\n+\t\tif (iova == RTE_BAD_IOVA)\n \t\t\tmempool_add_elem(mp, (char *)vaddr + off,\n-\t\t\t\tRTE_BAD_PHYS_ADDR);\n+\t\t\t\tRTE_BAD_IOVA);\n \t\telse\n-\t\t\tmempool_add_elem(mp, (char *)vaddr + off, paddr + off);\n+\t\t\tmempool_add_elem(mp, (char *)vaddr + off, iova + off);\n \t\toff += mp->elt_size + mp->trailer_size;\n \t\ti++;\n \t}\n@@ -435,12 +435,20 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n \treturn i;\n }\n \n+int\n+rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n+\tphys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,\n+\tvoid *opaque)\n+{\n+\treturn rte_mempool_populate_iova(mp, vaddr, paddr, len, free_cb, opaque);\n+}\n+\n /* Add objects in the pool, using a table of physical pages. Return the\n  * number of objects added, or a negative value on error.\n  */\n int\n-rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,\n-\tconst phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,\n+rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,\n+\tconst rte_iova_t iova[], uint32_t pg_num, uint32_t pg_shift,\n \trte_mempool_memchunk_free_cb_t *free_cb, void *opaque)\n {\n \tuint32_t i, n;\n@@ -452,18 +460,18 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,\n \t\treturn -EEXIST;\n \n \tif (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)\n-\t\treturn rte_mempool_populate_phys(mp, vaddr, RTE_BAD_PHYS_ADDR,\n+\t\treturn rte_mempool_populate_iova(mp, vaddr, RTE_BAD_IOVA,\n \t\t\tpg_num * pg_sz, free_cb, opaque);\n \n \tfor (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {\n \n \t\t/* populate with the largest group of contiguous pages */\n \t\tfor (n = 1; (i + n) < pg_num &&\n-\t\t\t     paddr[i + n - 1] + pg_sz == paddr[i + n]; n++)\n+\t\t\t     iova[i + n - 1] + pg_sz == iova[i + n]; n++)\n \t\t\t;\n \n-\t\tret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,\n-\t\t\tpaddr[i], n * pg_sz, free_cb, opaque);\n+\t\tret = rte_mempool_populate_iova(mp, vaddr + i * pg_sz,\n+\t\t\tiova[i], n * pg_sz, free_cb, opaque);\n \t\tif (ret < 0) {\n \t\t\trte_mempool_free_memchunks(mp);\n \t\t\treturn ret;\n@@ -475,6 +483,15 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,\n \treturn cnt;\n }\n \n+int\n+rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,\n+\tconst phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,\n+\trte_mempool_memchunk_free_cb_t *free_cb, void *opaque)\n+{\n+\treturn rte_mempool_populate_iova_tab(mp, vaddr, paddr, pg_num, pg_shift,\n+\t\t\tfree_cb, opaque);\n+}\n+\n /* Populate the mempool with a virtual area. Return the number of\n  * objects added, or a negative value on error.\n  */\n@@ -497,7 +514,7 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,\n \t\treturn -EINVAL;\n \n \tif (mp->flags & MEMPOOL_F_NO_PHYS_CONTIG)\n-\t\treturn rte_mempool_populate_phys(mp, addr, RTE_BAD_PHYS_ADDR,\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@@ -520,7 +537,7 @@ 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_phys(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\tgoto fail;\n@@ -604,7 +621,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t\t\tiova = mz->iova;\n \n \t\tif (rte_eal_has_hugepages())\n-\t\t\tret = rte_mempool_populate_phys(mp, mz->addr,\n+\t\t\tret = rte_mempool_populate_iova(mp, mz->addr,\n \t\t\t\tiova, mz->len,\n \t\t\t\trte_mempool_memchunk_mz_free,\n \t\t\t\t(void *)(uintptr_t)mz);\n@@ -990,7 +1007,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,\n \tif (mp_init)\n \t\tmp_init(mp, mp_init_arg);\n \n-\tret = rte_mempool_populate_phys_tab(mp, vaddr, iova, pg_num, pg_shift,\n+\tret = rte_mempool_populate_iova_tab(mp, vaddr, iova, pg_num, pg_shift,\n \t\tNULL, NULL);\n \tif (ret < 0 || ret != (int)mp->size)\n \t\tgoto fail;\ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex 4a31f03f2..721227f6d 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -880,7 +880,7 @@ rte_mempool_free(struct rte_mempool *mp);\n  * Add a virtually and physically contiguous memory chunk in the pool\n  * where objects can be instantiated.\n  *\n- * If the given physical address is unknown (paddr = RTE_BAD_PHYS_ADDR),\n+ * If the given IO address is unknown (iova = RTE_BAD_IOVA),\n  * the chunk doesn't need to be physically contiguous (only virtually),\n  * and allocated objects may span two pages.\n  *\n@@ -888,8 +888,8 @@ rte_mempool_free(struct rte_mempool *mp);\n  *   A pointer to the mempool structure.\n  * @param vaddr\n  *   The virtual address of memory that should be used to store objects.\n- * @param paddr\n- *   The physical address\n+ * @param iova\n+ *   The IO address\n  * @param len\n  *   The length of memory in bytes.\n  * @param free_cb\n@@ -901,6 +901,11 @@ rte_mempool_free(struct rte_mempool *mp);\n  *   On error, the chunk is not added in the memory list of the\n  *   mempool and a negative errno is returned.\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+\tvoid *opaque);\n+\n+__rte_deprecated\n int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n \tphys_addr_t paddr, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,\n \tvoid *opaque);\n@@ -909,18 +914,17 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n  * Add physical memory for objects in the pool at init\n  *\n  * Add a virtually contiguous memory chunk in the pool where objects can\n- * be instantiated. The physical addresses corresponding to the virtual\n- * area are described in paddr[], pg_num, pg_shift.\n+ * be instantiated. The IO addresses corresponding to the virtual\n+ * area are described in iova[], pg_num, pg_shift.\n  *\n  * @param mp\n  *   A pointer to the mempool structure.\n  * @param vaddr\n  *   The virtual address of memory that should be used to store objects.\n- * @param paddr\n- *   An array of physical addresses of each page composing the virtual\n- *   area.\n+ * @param iova\n+ *   An array of IO addresses of each page composing the virtual area.\n  * @param pg_num\n- *   Number of elements in the paddr array.\n+ *   Number of elements in the iova array.\n  * @param pg_shift\n  *   LOG2 of the physical pages size.\n  * @param free_cb\n@@ -932,6 +936,11 @@ int rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n  *   On error, the chunks are not added in the memory list of the\n  *   mempool and a negative errno is returned.\n  */\n+int rte_mempool_populate_iova_tab(struct rte_mempool *mp, char *vaddr,\n+\tconst rte_iova_t iova[], uint32_t pg_num, uint32_t pg_shift,\n+\trte_mempool_memchunk_free_cb_t *free_cb, void *opaque);\n+\n+__rte_deprecated\n int rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,\n \tconst phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift,\n \trte_mempool_memchunk_free_cb_t *free_cb, void *opaque);\ndiff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map\nindex ff86dc9a7..62b76f912 100644\n--- a/lib/librte_mempool/rte_mempool_version.map\n+++ b/lib/librte_mempool/rte_mempool_version.map\n@@ -47,5 +47,7 @@ DPDK_17.11 {\n \n \trte_mempool_ops_get_capabilities;\n \trte_mempool_ops_register_memory_area;\n+\trte_mempool_populate_iova;\n+\trte_mempool_populate_iova_tab;\n \n } DPDK_16.07;\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "10/15"
    ]
}