get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56782,
    "url": "http://patchwork.dpdk.org/api/patches/56782/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20190719133845.32432-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": "<20190719133845.32432-2-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190719133845.32432-2-olivier.matz@6wind.com",
    "date": "2019-07-19T13:38:42",
    "name": "[RFC,1/4] mempool: clarify default populate function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "775767709fd2dd63fd169308a95b4cb3070f8ab2",
    "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/20190719133845.32432-2-olivier.matz@6wind.com/mbox/",
    "series": [
        {
            "id": 5624,
            "url": "http://patchwork.dpdk.org/api/series/5624/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=5624",
            "date": "2019-07-19T13:38:41",
            "name": "mempool: avoid objects allocations across pages",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/5624/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/56782/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/56782/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 901801B197;\n\tFri, 19 Jul 2019 15:39:05 +0200 (CEST)",
            "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 C44A3322C\n\tfor <dev@dpdk.org>; Fri, 19 Jul 2019 15:38:59 +0200 (CEST)",
            "from glumotte.dev.6wind.com. (unknown [10.16.0.195])\n\tby proxy.6wind.com (Postfix) with ESMTP id 9F48E2ED325;\n\tFri, 19 Jul 2019 15:38:59 +0200 (CEST)"
        ],
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "Vamsi Krishna Attunuru <vattunuru@marvell.com>,\n\tdev@dpdk.org",
        "Cc": "Andrew Rybchenko <arybchenko@solarflare.com>,\n\tThomas Monjalon <thomas@monjalon.net>,\n\tAnatoly Burakov <anatoly.burakov@intel.com>,\n\tJerin Jacob Kollanukkaran <jerinj@marvell.com>,\n\tKokkilagadda <kirankumark@marvell.com>,\n\tFerruh Yigit <ferruh.yigit@intel.com>",
        "Date": "Fri, 19 Jul 2019 15:38:42 +0200",
        "Message-Id": "<20190719133845.32432-2-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20190719133845.32432-1-olivier.matz@6wind.com>",
        "References": "<CH2PR18MB338160CD8EF16EEB45EED387A6C80@CH2PR18MB3381.namprd18.prod.outlook.com>\n\t<20190719133845.32432-1-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [RFC 1/4] mempool: clarify default populate function",
        "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": "No functional change. Clarify the populate function to make\nthe next commit easier to understand.\n\nRename the variables:\n- to avoid negation in the name\n- to have more understandable names\n\nRemove useless variable (no_pageshift is equivalent to pg_sz == 0).\n\nRemove duplicate affectation of \"external\" variable.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n lib/librte_mempool/rte_mempool.c | 50 +++++++++++++++++++++-------------------\n 1 file changed, 26 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 7260ce0be..0f29e8712 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -429,24 +429,18 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \trte_iova_t iova;\n \tunsigned mz_id, n;\n \tint ret;\n-\tbool no_contig, try_contig, no_pageshift, external;\n+\tbool need_iova_contig_obj;\n+\tbool try_iova_contig_mempool;\n+\tbool alloc_in_ext_mem;\n \n \tret = mempool_ops_alloc_once(mp);\n \tif (ret != 0)\n \t\treturn ret;\n \n-\t/* check if we can retrieve a valid socket ID */\n-\tret = rte_malloc_heap_socket_is_external(mp->socket_id);\n-\tif (ret < 0)\n-\t\treturn -EINVAL;\n-\texternal = ret;\n-\n \t/* mempool must not be populated */\n \tif (mp->nb_mem_chunks != 0)\n \t\treturn -EEXIST;\n \n-\tno_contig = mp->flags & MEMPOOL_F_NO_IOVA_CONTIG;\n-\n \t/*\n \t * the following section calculates page shift and page size values.\n \t *\n@@ -496,16 +490,23 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t * to go for contiguous memory even if we're in no-huge mode, because\n \t * external memory may in fact be IOVA-contiguous.\n \t */\n-\texternal = rte_malloc_heap_socket_is_external(mp->socket_id) == 1;\n-\tno_pageshift = no_contig ||\n-\t\t\t(!external && rte_eal_iova_mode() == RTE_IOVA_VA);\n-\ttry_contig = !no_contig && !no_pageshift &&\n-\t\t\t(rte_eal_has_hugepages() || external);\n \n-\tif (no_pageshift) {\n+\t/* check if we can retrieve a valid socket ID */\n+\tret = rte_malloc_heap_socket_is_external(mp->socket_id);\n+\tif (ret < 0)\n+\t\treturn -EINVAL;\n+\talloc_in_ext_mem = (ret == 1);\n+\tneed_iova_contig_obj = !(mp->flags & MEMPOOL_F_NO_IOVA_CONTIG);\n+\ttry_iova_contig_mempool = false;\n+\n+\tif (!need_iova_contig_obj) {\n+\t\tpg_sz = 0;\n+\t\tpg_shift = 0;\n+\t} else if (!alloc_in_ext_mem && rte_eal_iova_mode() == RTE_IOVA_VA) {\n \t\tpg_sz = 0;\n \t\tpg_shift = 0;\n-\t} else if (try_contig) {\n+\t} else if (rte_eal_has_hugepages() || alloc_in_ext_mem) {\n+\t\ttry_iova_contig_mempool = true;\n \t\tpg_sz = get_min_page_size(mp->socket_id);\n \t\tpg_shift = rte_bsf32(pg_sz);\n \t} else {\n@@ -517,7 +518,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t\tsize_t min_chunk_size;\n \t\tunsigned int flags;\n \n-\t\tif (try_contig || no_pageshift)\n+\t\tif (try_iova_contig_mempool || pg_sz == 0)\n \t\t\tmem_size = rte_mempool_ops_calc_mem_size(mp, n,\n \t\t\t\t\t0, &min_chunk_size, &align);\n \t\telse\n@@ -541,7 +542,7 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t\t/* if we're trying to reserve contiguous memory, add appropriate\n \t\t * memzone flag.\n \t\t */\n-\t\tif (try_contig)\n+\t\tif (try_iova_contig_mempool)\n \t\t\tflags |= RTE_MEMZONE_IOVA_CONTIG;\n \n \t\tmz = rte_memzone_reserve_aligned(mz_name, mem_size,\n@@ -551,8 +552,9 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t\t * minimum required contiguous chunk fits minimum page, adjust\n \t\t * memzone size to the page size, and try again.\n \t\t */\n-\t\tif (mz == NULL && try_contig && min_chunk_size <= pg_sz) {\n-\t\t\ttry_contig = false;\n+\t\tif (mz == NULL && try_iova_contig_mempool &&\n+\t\t\t\tmin_chunk_size <= pg_sz) {\n+\t\t\ttry_iova_contig_mempool = false;\n \t\t\tflags &= ~RTE_MEMZONE_IOVA_CONTIG;\n \n \t\t\tmem_size = rte_mempool_ops_calc_mem_size(mp, n,\n@@ -587,12 +589,12 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \t\t\tgoto fail;\n \t\t}\n \n-\t\tif (no_contig)\n-\t\t\tiova = RTE_BAD_IOVA;\n-\t\telse\n+\t\tif (need_iova_contig_obj)\n \t\t\tiova = mz->iova;\n+\t\telse\n+\t\t\tiova = RTE_BAD_IOVA;\n \n-\t\tif (no_pageshift || try_contig)\n+\t\tif (try_iova_contig_mempool || pg_sz == 0)\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",
    "prefixes": [
        "RFC",
        "1/4"
    ]
}