get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1525570,
    "url": "http://patchwork.ozlabs.org/api/patches/1525570/",
    "web_url": "http://patchwork.ozlabs.org/project/ovn/patch/20210907224516.489604-6-blp@ovn.org/",
    "project": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/projects/68/",
        "name": "Open Virtual Network development",
        "link_name": "ovn",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20210907224516.489604-6-blp@ovn.org>",
    "list_archive_url": null,
    "date": "2021-09-07T22:45:11",
    "name": "[ovs-dev,v2,05/10] ovn-northd-ddlog: Avoid re-parsing LB IP addresses and ports.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "52fe7dc599b60dc919e0ae2cacf58e3098745442",
    "submitter": {
        "id": 67603,
        "url": "http://patchwork.ozlabs.org/api/people/67603/",
        "name": "Ben Pfaff",
        "email": "blp@ovn.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ovn/patch/20210907224516.489604-6-blp@ovn.org/mbox/",
    "series": [
        {
            "id": 261352,
            "url": "http://patchwork.ozlabs.org/api/series/261352/",
            "web_url": "http://patchwork.ozlabs.org/project/ovn/list/?series=261352",
            "date": "2021-09-07T22:45:06",
            "name": "3x performance improvement for ddlog with load balancer benchmark",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/261352/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1525570/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/1525570/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
        "Received": [
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4H40jW5Vzwz9t1Q\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Sep 2021 08:45:51 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id 89B634051C;\n\tTue,  7 Sep 2021 22:45:47 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n\tby localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id h5XeUp7O8MC4; Tue,  7 Sep 2021 22:45:45 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp2.osuosl.org (Postfix) with ESMTPS id 6EF59402DD;\n\tTue,  7 Sep 2021 22:45:43 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id D7811C0034;\n\tTue,  7 Sep 2021 22:45:39 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 86224C000D\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 22:45:37 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 234C5402AA\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 22:45:36 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id wtG-NzRE0xkC for <dev@openvswitch.org>;\n Tue,  7 Sep 2021 22:45:35 +0000 (UTC)",
            "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n [217.70.183.201])\n by smtp2.osuosl.org (Postfix) with ESMTPS id CD7D640104\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 22:45:34 +0000 (UTC)",
            "(Authenticated sender: blp@ovn.org)\n by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 870D81BF205;\n Tue,  7 Sep 2021 22:45:32 +0000 (UTC)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0",
        "From": "Ben Pfaff <blp@ovn.org>",
        "To": "dev@openvswitch.org",
        "Date": "Tue,  7 Sep 2021 15:45:11 -0700",
        "Message-Id": "<20210907224516.489604-6-blp@ovn.org>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210907224516.489604-1-blp@ovn.org>",
        "References": "<20210907224516.489604-1-blp@ovn.org>",
        "MIME-Version": "1.0",
        "Cc": "Ben Pfaff <blp@ovn.org>",
        "Subject": "[ovs-dev] [PATCH ovn v2 05/10] ovn-northd-ddlog: Avoid re-parsing\n\tLB IP addresses and ports.",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ovs-dev-bounces@openvswitch.org",
        "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>"
    },
    "content": "The LBVIPs already contain parsed versions of the load balancer\nkeys, but the code was parsing it redundantly.\n\nSlight performance improvement but much cleaner.\n\nSigned-off-by: Ben Pfaff <blp@ovn.org>\n---\n northd/ovn_northd.dl | 37 ++++++++++++-------------------------\n 1 file changed, 12 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl\nindex f678a4f50..bf2192f7e 100644\n--- a/northd/ovn_northd.dl\n+++ b/northd/ovn_northd.dl\n@@ -5667,8 +5667,7 @@ LogicalRouterNdFlow(.lr = r,\n                     .drop = false,\n                     .priority = 90,\n                     .stage_hint = 0) :-\n-    LBVIP[lbvip@&LBVIP{.vip_key = lb_key, .lb = lb}],\n-    Some{(IPv6{var ip}, _)} = ip_address_and_port_from_lb_key(lb_key.ival()),\n+    LBVIP[lbvip@&LBVIP{.vip_addr = IPv6{ip}, .lb = lb}],\n     r in &Router(),\n     r.load_balancer.contains(lb._uuid),\n     &RouterPort(.router = r, .lrp = lrp, .is_redirect = is_redirect),\n@@ -6685,8 +6684,7 @@ Flow(.logical_datapath = r._uuid,\n      .stage_hint       = 0,\n      .io_port          = None,\n      .controller_meter = None) :-\n-    LBVIP[lbvip@&LBVIP{.vip_key = lb_key, .lb = lb}],\n-    Some{(var ip, var port)} = ip_address_and_port_from_lb_key(lb_key.ival()),\n+    LBVIP[lbvip@&LBVIP{.vip_addr = ip, .vip_port = port, .lb = lb}],\n     var prio = if (port != 0) { 110 } else { 100 },\n     var proto = match (lb.protocol) {\n         Some{proto} -> proto,\n@@ -6719,8 +6717,7 @@ Flow(.logical_datapath = r._uuid,\n      .stage_hint       = 0,\n      .io_port          = None,\n      .controller_meter = None) :-\n-    LBVIP[lbvip@&LBVIP{.vip_key = lb_key, .lb = lb}],\n-    Some{(var ip, var port)} = ip_address_and_port_from_lb_key(lb_key.ival()),\n+    LBVIP[lbvip@&LBVIP{.vip_addr = ip, .vip_port = port, .lb = lb}],\n     var proto = match (lb.protocol) {\n         Some{proto} -> proto,\n         _ -> i\"tcp\"\n@@ -6765,8 +6762,7 @@ Flow(.logical_datapath = r._uuid,\n      .stage_hint       = stage_hint(lb._uuid),\n      .io_port          = None,\n      .controller_meter = None) :-\n-    LBVIP[lbvip@&LBVIP{.vip_key = lb_key, .lb = lb}],\n-    Some{(var ip, var port)} = ip_address_and_port_from_lb_key(lb_key.ival()),\n+    LBVIP[lbvip@&LBVIP{.vip_addr = ip, .vip_port = port, .lb = lb}],\n     var proto = match (lb.protocol) {\n         Some{proto} -> proto,\n         _ -> i\"tcp\"\n@@ -6791,28 +6787,19 @@ Flow(.logical_datapath = r._uuid,\n      .stage_hint       = stage_hint(lb._uuid),\n      .io_port          = None,\n      .controller_meter = None) :-\n-    LBVIP[lbvip@&LBVIP{.vip_key = lb_key, .lb = lb, .backend_ips = backends}],\n-    Some{(var ip, var port)} = ip_address_and_port_from_lb_key(lb_key.ival()),\n+    LBVIP[lbvip@&LBVIP{.vip_addr = ip, .vip_port = port, .lb = lb, .backends = backends}],\n     var proto = match (lb.protocol) {\n         Some{proto} -> proto,\n         _ -> i\"tcp\"\n     },\n-    var conds = {\n-        var conds = vec_empty();\n-        for (ip_str in backends.split(\",\")) {\n-            match (ip_address_and_port_from_lb_key(ip_str)) {\n-                None -> () /* FIXME: put a break here */,\n-                Some{(ip_, port_)} -> conds.push(\n-                    \"(${ip_.ipX()}.src == ${ip_}\" ++\n-                    if (port_ != 0) {\n-                        \" && ${proto}.src == ${port_})\"\n-                    } else {\n-                        \")\"\n-                    })\n-            }\n+    var conds = backends.map(|b| {\n+        var port_match = if (b.port != 0) {\n+            \" && ${proto}.src == ${b.port}\"\n+        } else {\n+            \"\"\n         };\n-        conds.join(\" || \")\n-    },\n+        \"(${b.ip.ipX()}.src == ${b.ip}\" ++ port_match ++ \")\"\n+    }).join(\" || \"),\n     conds != \"\",\n     r in &Router(),\n     Some{var gwport} = r.l3dgw_ports.nth(0),\n",
    "prefixes": [
        "ovs-dev",
        "v2",
        "05/10"
    ]
}