get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 619,
    "url": "http://patchwork.dpdk.org/api/patches/619/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/3B9A624B-ABBF-4A20-96CD-8D5607006FEA@windriver.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": "<3B9A624B-ABBF-4A20-96CD-8D5607006FEA@windriver.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/3B9A624B-ABBF-4A20-96CD-8D5607006FEA@windriver.com",
    "date": "2014-09-28T17:52:16",
    "name": "[dpdk-dev,RFC] More changes for rte_mempool.h:__mempool_get_bulk()",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "2e3252ab08eaff45121d94378f6918fea7f146eb",
    "submitter": {
        "id": 75,
        "url": "http://patchwork.dpdk.org/api/people/75/?format=api",
        "name": "Wiles, Roger Keith",
        "email": "keith.wiles@windriver.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/3B9A624B-ABBF-4A20-96CD-8D5607006FEA@windriver.com/mbox/",
    "series": [],
    "comments": "http://patchwork.dpdk.org/api/patches/619/comments/",
    "check": "pending",
    "checks": "http://patchwork.dpdk.org/api/patches/619/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 14FFF7E14;\n\tSun, 28 Sep 2014 19:45:54 +0200 (CEST)",
            "from mail1.windriver.com (mail1.windriver.com [147.11.146.13])\n\tby dpdk.org (Postfix) with ESMTP id 35AD57E13\n\tfor <dev@dpdk.org>; Sun, 28 Sep 2014 19:45:50 +0200 (CEST)",
            "from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com\n\t[147.11.189.40])\n\tby mail1.windriver.com (8.14.9/8.14.5) with ESMTP id s8SHqHVF027580\n\t(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL)\n\tfor <dev@dpdk.org>; Sun, 28 Sep 2014 10:52:18 -0700 (PDT)",
            "from ALA-MBB.corp.ad.wrs.com ([169.254.1.18]) by\n\tALA-HCA.corp.ad.wrs.com ([147.11.189.40]) with mapi id 14.03.0174.001;\n\tSun, 28 Sep 2014 10:52:17 -0700"
        ],
        "From": "\"Wiles, Roger Keith\" <keith.wiles@windriver.com>",
        "To": "\"<dev@dpdk.org>\" <dev@dpdk.org>",
        "Thread-Topic": "[RFC] More changes for rte_mempool.h:__mempool_get_bulk()",
        "Thread-Index": "AQHP20TxUYvnLZ5sIU2OzJoGryugjQ==",
        "Date": "Sun, 28 Sep 2014 17:52:16 +0000",
        "Message-ID": "<3B9A624B-ABBF-4A20-96CD-8D5607006FEA@windriver.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-originating-ip": "[172.25.40.166]",
        "Content-Type": "text/plain; charset=\"Windows-1252\"",
        "Content-ID": "<F04C2CAC6D56B644B3E89E4226625A96@local>",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "Subject": "[dpdk-dev] [RFC] More changes for rte_mempool.h:__mempool_get_bulk()",
        "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": "Here is a Request for Comment on __mempool_get_bulk() routine. I believe I am seeing a few more issues in this routine, please look at the code below and see if these seem to fix some concerns in how the ring is handled.\n\nThe first issue I believe is cache->len is increased by ret and not req as we do not know if ret == req. This also means the cache->len may still not satisfy the request from the cache.\n\nThe second issue is if you believe the above code then we have to account for that issue in the stats.\n\nLet me know what you think?\n++Keith\nā€”ā€”ā€”\n\n\nKeith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex 199a493..b1b1f7a 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -945,9 +945,7 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_table,\n                   unsigned n, int is_mc)\n {\n        int ret;\n-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n-       unsigned n_orig = n;\n-#endif\n+\n #if RTE_MEMPOOL_CACHE_MAX_SIZE > 0\n        struct rte_mempool_cache *cache;\n        uint32_t index, len;\n@@ -979,7 +977,21 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_table,\n                        goto ring_dequeue;\n                }\n \n-               cache->len += req;\n+               cache->len += ret;      // Need to adjust len by ret not req, as (ret != req)\n+\n+               if ( cache->len < n ) {\n+                       /*\n+                        * Number (ret + cache->len) may not be >= n. As\n+                        * the 'ret' value maybe zero or less then 'req'.\n+                        *\n+                        * Note:\n+                        * An issue of order from the cache and common pool could\n+                        * be an issue if (cache->len != 0 and less then n), but the\n+                        * normal case it should be OK. If the user needs to preserve\n+                        * the order of packets then he must set cache_size == 0.\n+                        */\n+                       goto ring_dequeue;\n+               }\n        }\n \n        /* Now fill in the response ... */\n@@ -1002,9 +1014,12 @@ ring_dequeue:\n                ret = rte_ring_sc_dequeue_bulk(mp->ring, obj_table, n);\n \n        if (ret < 0)\n-               __MEMPOOL_STAT_ADD(mp, get_fail, n_orig);\n-       else\n+               __MEMPOOL_STAT_ADD(mp, get_fail, n);\n+       else {\n                __MEMPOOL_STAT_ADD(mp, get_success, ret);\n+               // Catch the case when ret != n, adding zero should not be a problem.\n+               __MEMPOOL_STAT_ADD(mp, get_fail, n - ret);\n+       }\n \n        return ret;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "RFC"
    ]
}