get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12866,
    "url": "https://patches.dpdk.org/api/patches/12866/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1463569496-31086-29-git-send-email-olivier.matz@6wind.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": "<1463569496-31086-29-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1463569496-31086-29-git-send-email-olivier.matz@6wind.com",
    "date": "2016-05-18T11:04:49",
    "name": "[dpdk-dev,v3,28/35] mempool: create the internal ring when populating",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "dc8854a50bf04c218ce7386d4c7d757e1571a389",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1463569496-31086-29-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/12866/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/12866/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 6B188B33F;\n\tWed, 18 May 2016 13:05:46 +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 E7089530A\n\tfor <dev@dpdk.org>; Wed, 18 May 2016 13:05:16 +0200 (CEST)",
            "from glumotte.dev.6wind.com (unknown [10.16.0.195])\n\tby proxy.6wind.com (Postfix) with ESMTP id 55B6D29BB8;\n\tWed, 18 May 2016 13:03:39 +0200 (CEST)"
        ],
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, stephen@networkplumber.org,\n\tkeith.wiles@intel.com",
        "Date": "Wed, 18 May 2016 13:04:49 +0200",
        "Message-Id": "<1463569496-31086-29-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.8.0.rc3",
        "In-Reply-To": "<1463569496-31086-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1460629199-32489-1-git-send-email-olivier.matz@6wind.com>\n\t<1463569496-31086-1-git-send-email-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v3 28/35] mempool: create the internal ring when\n\tpopulating",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "Instead of creating the internal ring at mempool creation, do\nit when populating the mempool with the first memory chunk. The\nobjective here is to simplify the change of external handler\nwhen it will be introduced.\n\nFor instance, this will be possible:\n\n  mp = rte_mempool_create_empty(...)\n  rte_mempool_set_ext_handler(mp, my_handler)\n  rte_mempool_populate_default()\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n lib/librte_mempool/rte_mempool.c | 12 +++++++++---\n lib/librte_mempool/rte_mempool.h |  1 +\n 2 files changed, 10 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex f141139..8be3c74 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -326,6 +326,7 @@ rte_mempool_ring_create(struct rte_mempool *mp)\n \t\treturn -rte_errno;\n \n \tmp->ring = r;\n+\tmp->flags |= MEMPOOL_F_RING_CREATED;\n \treturn 0;\n }\n \n@@ -375,6 +376,14 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr,\n \tunsigned i = 0;\n \tsize_t off;\n \tstruct rte_mempool_memhdr *memhdr;\n+\tint ret;\n+\n+\t/* create the internal ring if not already done */\n+\tif ((mp->flags & MEMPOOL_F_RING_CREATED) == 0) {\n+\t\tret = rte_mempool_ring_create(mp);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t}\n \n \t/* mempool is already populated */\n \tif (mp->populated_size >= mp->size)\n@@ -702,9 +711,6 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,\n \tSTAILQ_INIT(&mp->elt_list);\n \tSTAILQ_INIT(&mp->mem_list);\n \n-\tif (rte_mempool_ring_create(mp) < 0)\n-\t\tgoto exit_unlock;\n-\n \t/*\n \t * local_cache pointer is set even if cache_size is zero.\n \t * The local_cache points to just past the elt_pa[] array.\ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex 8c35b45..2a40aa7 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -235,6 +235,7 @@ struct rte_mempool {\n #define MEMPOOL_F_NO_CACHE_ALIGN 0x0002 /**< Do not align objs on cache lines.*/\n #define MEMPOOL_F_SP_PUT         0x0004 /**< Default put is \"single-producer\".*/\n #define MEMPOOL_F_SC_GET         0x0008 /**< Default get is \"single-consumer\".*/\n+#define MEMPOOL_F_RING_CREATED   0x0010 /**< Internal: ring is created */\n \n /**\n  * @internal When debug is enabled, store some statistics.\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "28/35"
    ]
}