get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2481,
    "url": "https://patches.dpdk.org/api/patches/2481/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1421914598-2747-14-git-send-email-cunming.liang@intel.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": "<1421914598-2747-14-git-send-email-cunming.liang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1421914598-2747-14-git-send-email-cunming.liang@intel.com",
    "date": "2015-01-22T08:16:36",
    "name": "[dpdk-dev,v1,13/15] mempool: add support to non-EAL thread",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e6ae9daa057268b3f377aaaeeabaffa9725e5576",
    "submitter": {
        "id": 46,
        "url": "https://patches.dpdk.org/api/people/46/?format=api",
        "name": "Cunming Liang",
        "email": "cunming.liang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1421914598-2747-14-git-send-email-cunming.liang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/2481/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/2481/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 686205AAA;\n\tThu, 22 Jan 2015 09:18:02 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id B271B5A98\n\tfor <dev@dpdk.org>; Thu, 22 Jan 2015 09:17:39 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga101.fm.intel.com with ESMTP; 22 Jan 2015 00:17:37 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 22 Jan 2015 00:17:38 -0800",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t0M8HZ42005782;\n\tThu, 22 Jan 2015 16:17:35 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t0M8HXxx002894; Thu, 22 Jan 2015 16:17:35 +0800",
            "(from cliang18@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0M8HXhR002890; \n\tThu, 22 Jan 2015 16:17:33 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.09,447,1418112000\"; d=\"scan'208\";a=\"640850330\"",
        "From": "Cunming Liang <cunming.liang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 22 Jan 2015 16:16:36 +0800",
        "Message-Id": "<1421914598-2747-14-git-send-email-cunming.liang@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1421914598-2747-1-git-send-email-cunming.liang@intel.com>",
        "References": "<1417589628-43666-1-git-send-email-cunming.liang@intel.com>\n\t<1421914598-2747-1-git-send-email-cunming.liang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v1 13/15] mempool: add support to non-EAL thread",
        "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": "For non-EAL thread, bypass per lcore cache, directly use ring pool.\nIt allows using rte_mempool in either EAL thread or any user pthread.\nAs in non-EAL thread, it directly rely on rte_ring and it's none preemptive.\nIt doesn't suggest to run multi-pthread/cpu which compete the rte_mempool.\nIt will get bad performance and has critical risk if scheduling policy is RT.\n\nSigned-off-by: Cunming Liang <cunming.liang@intel.com>\n---\n lib/librte_mempool/rte_mempool.h | 18 +++++++++++-------\n 1 file changed, 11 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex 3314651..4845f27 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -198,10 +198,12 @@ struct rte_mempool {\n  *   Number to add to the object-oriented statistics.\n  */\n #ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n-#define __MEMPOOL_STAT_ADD(mp, name, n) do {\t\t\t\\\n-\t\tunsigned __lcore_id = rte_lcore_id();\t\t\\\n-\t\tmp->stats[__lcore_id].name##_objs += n;\t\t\\\n-\t\tmp->stats[__lcore_id].name##_bulk += 1;\t\t\\\n+#define __MEMPOOL_STAT_ADD(mp, name, n) do {                    \\\n+\t\tunsigned __lcore_id = rte_lcore_id();           \\\n+\t\tif (__lcore_id < RTE_MAX_LCORE) {               \\\n+\t\t\tmp->stats[__lcore_id].name##_objs += n;\t\\\n+\t\t\tmp->stats[__lcore_id].name##_bulk += 1;\t\\\n+\t\t}                                               \\\n \t} while(0)\n #else\n #define __MEMPOOL_STAT_ADD(mp, name, n) do {} while(0)\n@@ -767,8 +769,9 @@ __mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table,\n \t__MEMPOOL_STAT_ADD(mp, put, n);\n \n #if RTE_MEMPOOL_CACHE_MAX_SIZE > 0\n-\t/* cache is not enabled or single producer */\n-\tif (unlikely(cache_size == 0 || is_mp == 0))\n+\t/* cache is not enabled or single producer or none EAL thread */\n+\tif (unlikely(cache_size == 0 || is_mp == 0 ||\n+\t\t     lcore_id >= RTE_MAX_LCORE))\n \t\tgoto ring_enqueue;\n \n \t/* Go straight to ring if put would overflow mem allocated for cache */\n@@ -952,7 +955,8 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_table,\n \tuint32_t cache_size = mp->cache_size;\n \n \t/* cache is not enabled or single consumer */\n-\tif (unlikely(cache_size == 0 || is_mc == 0 || n >= cache_size))\n+\tif (unlikely(cache_size == 0 || is_mc == 0 ||\n+\t\t     n >= cache_size || lcore_id >= RTE_MAX_LCORE))\n \t\tgoto ring_dequeue;\n \n \tcache = &mp->local_cache[lcore_id];\n",
    "prefixes": [
        "dpdk-dev",
        "v1",
        "13/15"
    ]
}