Show a patch.

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

{
    "id": 339,
    "url": "https://patches.dpdk.org/api/patches/339/?format=api",
    "web_url": "https://patches.dpdk.org/patch/339/",
    "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"
    },
    "msgid": "<7F861DC0615E0C47A872E6F3C5FCDDBD011A99A8@BPXM14GP.gisp.nec.co.jp>",
    "date": "2014-09-11T07:51:46",
    "name": "[dpdk-dev,memnic,6/7] pmd: add branch hint in recv/xmit",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e91f2c35785ef6d0505f80996558e7899878da20",
    "submitter": {
        "id": 38,
        "url": "https://patches.dpdk.org/api/people/38/?format=api",
        "name": "Hiroshi Shimamoto",
        "email": "h-shimamoto@ct.jp.nec.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/339/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/339/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/339/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Content-Language": "ja-JP",
        "Accept-Language": "ja-JP, en-US",
        "Thread-Topic": "[memnic PATCH 6/7] pmd: add branch hint in recv/xmit",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "Thread-Index": "Ac/NlTGBVAvPfNK8SxSfZgzquF035A==",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Message-ID": "<7F861DC0615E0C47A872E6F3C5FCDDBD011A99A8@BPXM14GP.gisp.nec.co.jp>",
        "X-BeenThere": "dev@dpdk.org",
        "x-originating-ip": "[10.205.5.123]",
        "Subject": "[dpdk-dev] [memnic PATCH 6/7] pmd: add branch hint in recv/xmit",
        "Cc": "Hayato Momma <h-momma@ce.jp.nec.com>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "X-MS-TNEF-Correlator": "",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Date": "Thu, 11 Sep 2014 07:51:46 +0000",
        "Precedence": "list",
        "From": "Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>",
        "X-MS-Has-Attach": "",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "Errors-To": "dev-bounces@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 4C7BE5909;\n\tThu, 11 Sep 2014 09:54:44 +0200 (CEST)",
            "from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [210.143.35.52])\n\tby dpdk.org (Postfix) with ESMTP id 51B845901\n\tfor <dev@dpdk.org>; Thu, 11 Sep 2014 09:54:42 +0200 (CEST)",
            "from mailgate3.nec.co.jp ([10.7.69.195])\n\tby tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id s8B7xr3g014659\n\tfor <dev@dpdk.org>; Thu, 11 Sep 2014 16:59:53 +0900 (JST)",
            "from mailsv.nec.co.jp (imss62.nec.co.jp [10.7.69.157]) by\n\tmailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) with ESMTP\n\tid s8B7xqx10649 for <dev@dpdk.org>;\n\tThu, 11 Sep 2014 16:59:52 +0900 (JST)",
            "from mail03.kamome.nec.co.jp (mail03.kamome.nec.co.jp [10.25.43.7])\n\tby mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id s8B7xqi9022757\n\tfor <dev@dpdk.org>; Thu, 11 Sep 2014 16:59:52 +0900 (JST)",
            "from bpxc99gp.gisp.nec.co.jp ([10.38.151.145] [10.38.151.145]) by\n\tmail03.kamome.nec.co.jp with ESMTP id BT-MMP-1868130;\n\tThu, 11 Sep 2014 16:51:48 +0900",
            "from BPXM14GP.gisp.nec.co.jp ([169.254.1.238]) by\n\tBPXC17GP.gisp.nec.co.jp ([10.38.151.145]) with mapi id 14.02.0328.011;\n\tThu, 11 Sep 2014 16:51:47 +0900"
        ],
        "X-Original-To": "patchwork@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Content-Type": "text/plain; charset=\"iso-2022-jp\"",
        "Delivered-To": "patchwork@dpdk.org",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>\n\nTo reduce instruction cache miss, add branch condition hints into\nrecv/xmit functions. This improves a bit performance.\n\nWe can see performance improvements with memnic-tester.\nUsing Xeon E5-2697 v2 @ 2.70GHz, 4 vCPU.\n size |  before  |  after\n   64 | 5.54Mpps | 5.55Mpps\n  128 | 5.46Mpps | 5.44Mpps\n  256 | 5.21Mpps | 5.22Mpps\n  512 | 4.50Mpps | 4.52Mpps\n 1024 | 3.71Mpps | 3.73Mpps\n 1280 | 3.21Mpps | 3.22Mpps\n 1518 | 2.92Mpps | 2.93Mpps\n\nSigned-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>\nReviewed-by: Hayato Momma <h-momma@ce.jp.nec.com>\n---\n pmd/pmd_memnic.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/pmd/pmd_memnic.c b/pmd/pmd_memnic.c\nindex dbe5033..cc0ae25 100644\n--- a/pmd/pmd_memnic.c\n+++ b/pmd/pmd_memnic.c\n@@ -289,26 +289,26 @@ static uint16_t memnic_recv_pkts(void *rx_queue,\n \tint idx, next;\n \tstruct rte_eth_stats *st = &adapter->stats[rte_lcore_id()];\n \n-\tif (!adapter->nic->hdr.valid)\n+\tif (unlikely(!adapter->nic->hdr.valid))\n \t\treturn 0;\n \n \tpkts = bytes = errs = 0;\n \tidx = adapter->up_idx;\n \tfor (nr = 0; nr < nb_pkts; nr++) {\n \t\tp = &data->packets[idx];\n-\t\tif (p->status != MEMNIC_PKT_ST_FILLED)\n+\t\tif (unlikely(p->status != MEMNIC_PKT_ST_FILLED))\n \t\t\tbreak;\n \t\t/* prefetch the next area */\n \t\tnext = idx;\n-\t\tif (++next >= MEMNIC_NR_PACKET)\n+\t\tif (unlikely(++next >= MEMNIC_NR_PACKET))\n \t\t\tnext = 0;\n \t\trte_prefetch0(&data->packets[next]);\n-\t\tif (p->len > framesz) {\n+\t\tif (unlikely(p->len > framesz)) {\n \t\t\terrs++;\n \t\t\tgoto drop;\n \t\t}\n \t\tmb = rte_pktmbuf_alloc(adapter->mp);\n-\t\tif (!mb)\n+\t\tif (unlikely(!mb))\n \t\t\tbreak;\n \n \t\trte_memcpy(rte_pktmbuf_mtod(mb, void *), p->data, p->len);\n@@ -350,7 +350,7 @@ static uint16_t memnic_xmit_pkts(void *tx_queue,\n \tuint64_t pkts, bytes, errs;\n \tuint32_t framesz = adapter->framesz;\n \n-\tif (!adapter->nic->hdr.valid)\n+\tif (unlikely(!adapter->nic->hdr.valid))\n \t\treturn 0;\n \n \tpkts = bytes = errs = 0;\n@@ -360,7 +360,7 @@ static uint16_t memnic_xmit_pkts(void *tx_queue,\n \t\tstruct rte_mbuf *sg;\n \t\tvoid *ptr;\n \n-\t\tif (pkt_len > framesz) {\n+\t\tif (unlikely(pkt_len > framesz)) {\n \t\t\terrs++;\n \t\t\tbreak;\n \t\t}\n@@ -379,7 +379,7 @@ retry:\n \t\t\tgoto retry;\n \t\t}\n \n-\t\tif (idx != ACCESS_ONCE(adapter->down_idx)) {\n+\t\tif (unlikely(idx != ACCESS_ONCE(adapter->down_idx))) {\n \t\t\t/*\n \t\t\t * host freed this and got false positive,\n \t\t\t * need to recover the status and retry.\n@@ -388,7 +388,7 @@ retry:\n \t\t\tgoto retry;\n \t\t}\n \n-\t\tif (++idx >= MEMNIC_NR_PACKET)\n+\t\tif (unlikely(++idx >= MEMNIC_NR_PACKET))\n \t\t\tidx = 0;\n \t\tadapter->down_idx = idx;\n \n",
    "prefixes": [
        "dpdk-dev",
        "memnic",
        "6/7"
    ]
}