get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 808533,
    "url": "http://patchwork.ozlabs.org/api/patches/808533/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170901062713.1842249-3-kafai@fb.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170901062713.1842249-3-kafai@fb.com>",
    "list_archive_url": null,
    "date": "2017-09-01T06:27:12",
    "name": "[net-next,2/3] bpf: Inline LRU map lookup",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2e47d15715fb6d2fa104179a2bfb5bb424f3196c",
    "submitter": {
        "id": 64907,
        "url": "http://patchwork.ozlabs.org/api/people/64907/?format=api",
        "name": "Martin KaFai Lau",
        "email": "kafai@fb.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170901062713.1842249-3-kafai@fb.com/mbox/",
    "series": [
        {
            "id": 953,
            "url": "http://patchwork.ozlabs.org/api/series/953/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=953",
            "date": "2017-09-01T06:27:10",
            "name": "bpf: Improve LRU map lookup performance",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/953/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808533/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808533/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=fb.com header.i=@fb.com header.b=\"dEdj4/ov\";\n\tdkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xk8RX0RkJz9sMN\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 16:27:20 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751385AbdIAG1R (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Sep 2017 02:27:17 -0400",
            "from mx0a-00082601.pphosted.com ([67.231.145.42]:36474 \"EHLO\n\tmx0a-00082601.pphosted.com\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1751022AbdIAG1P (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 1 Sep 2017 02:27:15 -0400",
            "from pps.filterd (m0044010.ppops.net [127.0.0.1])\n\tby mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv816OnLO009163\n\tfor <netdev@vger.kernel.org>; Thu, 31 Aug 2017 23:27:14 -0700",
            "from mail.thefacebook.com ([199.201.64.23])\n\tby mx0a-00082601.pphosted.com with ESMTP id 2cq180r9r6-3\n\t(version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT)\n\tfor <netdev@vger.kernel.org>; Thu, 31 Aug 2017 23:27:14 -0700",
            "from mx-out.facebook.com (192.168.52.123) by\n\tPRN-CHUB09.TheFacebook.com (192.168.16.19) with Microsoft SMTP Server\n\tid 14.3.319.2; Thu, 31 Aug 2017 23:27:14 -0700",
            "by devbig738.prn1.facebook.com (Postfix, from userid 6611)    id\n\tBC30145005AB; Thu, 31 Aug 2017 23:27:13 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com;\n\th=from : to : cc : subject\n\t: date : message-id : in-reply-to : references : mime-version :\n\tcontent-type; s=facebook;\n\tbh=F7OEfivmx6oAyYsIrgRpnt9Aa5WlFgMGrnlo4ho5QK4=; \n\tb=dEdj4/ovf57oqnXACGG7cLn+lT68RRbodNEstMBUbURfA7Qxplr89E4dBSN8FhLyqHy/\n\tRIH/a13lC3xqiHNyVB+yDK24EiBUT+uJoVaj3pPs9SCZIIlSBZ0mWxS75C2+YxuRZbEI\n\tf0kuLMs7yMmmyAaUF3862VnPGzKgJw//Y1g= ",
        "X-ThriftRelayHost": "devbig738.prn1.facebook.com",
        "Smtp-Origin-Hostprefix": "devbig",
        "From": "Martin KaFai Lau <kafai@fb.com>",
        "Smtp-Origin-Hostname": "devbig738.prn1.facebook.com",
        "To": "<netdev@vger.kernel.org>",
        "CC": "Alexei Starovoitov <ast@fb.com>,\n\tDaniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>",
        "Smtp-Origin-Cluster": "prn1c29",
        "Subject": "[PATCH net-next 2/3] bpf: Inline LRU map lookup",
        "Date": "Thu, 31 Aug 2017 23:27:12 -0700",
        "Message-ID": "<20170901062713.1842249-3-kafai@fb.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20170901062713.1842249-1-kafai@fb.com>",
        "References": "<20170901062713.1842249-1-kafai@fb.com>",
        "X-FB-Internal": [
            "Safe",
            "Safe"
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Spam-Reason": "safe",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-01_02:, , signatures=0",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "Inline the lru map lookup to save the cost in making calls to\nbpf_map_lookup_elem() and htab_lru_map_lookup_elem().\n\nDifferent LRU hash size is tested.  The benefit diminishes when\nthe cache miss starts to dominate in the bigger LRU hash.\nConsidering the change is simple, it is still worth to optimize.\n\nFirst column: Size of the LRU hash\nSecond column: Number of lookups/s\n\nBefore:\n> for i in $(seq 9 20); do echo \"$((2**i+1)): $(./map_perf_test 1024 1 $((2**i+1)) 10000000 | awk '{print $3}')\"; done\n513: 1132020\n1025: 1056826\n2049: 1007024\n4097: 853298\n8193: 742723\n16385: 712600\n32769: 688142\n65537: 677028\n131073: 619437\n262145: 498770\n524289: 316695\n1048577: 260038\n\nAfter:\n> for i in $(seq 9 20); do echo \"$((2**i+1)): $(./map_perf_test 1024 1 $((2**i+1)) 10000000 | awk '{print $3}')\"; done\n513: 1221851\n1025: 1144695\n2049: 1049902\n4097: 884460\n8193: 773731\n16385: 729673\n32769: 721989\n65537: 715530\n131073: 671665\n262145: 516987\n524289: 321125\n1048577: 260048\n\nSigned-off-by: Martin KaFai Lau <kafai@fb.com>\n---\n kernel/bpf/hashtab.c | 19 +++++++++++++++++++\n 1 file changed, 19 insertions(+)",
    "diff": "diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c\nindex d246905f2bb1..682f4543fefa 100644\n--- a/kernel/bpf/hashtab.c\n+++ b/kernel/bpf/hashtab.c\n@@ -514,6 +514,24 @@ static void *htab_lru_map_lookup_elem(struct bpf_map *map, void *key)\n \treturn NULL;\n }\n \n+static u32 htab_lru_map_gen_lookup(struct bpf_map *map,\n+\t\t\t\t   struct bpf_insn *insn_buf)\n+{\n+\tstruct bpf_insn *insn = insn_buf;\n+\tconst int ret = BPF_REG_0;\n+\n+\t*insn++ = BPF_EMIT_CALL((u64 (*)(u64, u64, u64, u64, u64))__htab_map_lookup_elem);\n+\t*insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 2);\n+\t*insn++ = BPF_ST_MEM(BPF_B, ret,\n+\t\t\t     offsetof(struct htab_elem, lru_node) +\n+\t\t\t     offsetof(struct bpf_lru_node, ref),\n+\t\t\t     1);\n+\t*insn++ = BPF_ALU64_IMM(BPF_ADD, ret,\n+\t\t\t\toffsetof(struct htab_elem, key) +\n+\t\t\t\tround_up(map->key_size, 8));\n+\treturn insn - insn_buf;\n+}\n+\n /* It is called from the bpf_lru_list when the LRU needs to delete\n  * older elements from the htab.\n  */\n@@ -1137,6 +1155,7 @@ const struct bpf_map_ops htab_lru_map_ops = {\n \t.map_lookup_elem = htab_lru_map_lookup_elem,\n \t.map_update_elem = htab_lru_map_update_elem,\n \t.map_delete_elem = htab_lru_map_delete_elem,\n+\t.map_gen_lookup = htab_lru_map_gen_lookup,\n };\n \n /* Called from eBPF program */\n",
    "prefixes": [
        "net-next",
        "2/3"
    ]
}