get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1525572,
    "url": "http://patchwork.ozlabs.org/api/patches/1525572/",
    "web_url": "http://patchwork.ozlabs.org/project/ovn/patch/20210907224516.489604-7-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-7-blp@ovn.org>",
    "list_archive_url": null,
    "date": "2021-09-07T22:45:12",
    "name": "[ovs-dev,v2,06/10] ovn-northd-ddlog: Simplify LBVIPWithStatus to include up_backends string.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a9476c312f640faaa1fa44926a5004b3e8b9d2b9",
    "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-7-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/1525572/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/1525572/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=140.211.166.133; helo=smtp2.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
        "Received": [
            "from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.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 4H40jb72YMz9t10\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Sep 2021 08:45:55 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id C5E9A40502;\n\tTue,  7 Sep 2021 22:45:50 +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 DPoI9PHhbhRN; Tue,  7 Sep 2021 22:45:49 +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 5F92940503;\n\tTue,  7 Sep 2021 22:45:47 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id E6A0EC001D;\n\tTue,  7 Sep 2021 22:45:41 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id BB877C0034\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 22:45:38 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id A531B80C32\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 22:45:38 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id Sc7HiY_2HQoi for <dev@openvswitch.org>;\n Tue,  7 Sep 2021 22:45:37 +0000 (UTC)",
            "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n [217.70.183.201])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 573658001C\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 22:45:36 +0000 (UTC)",
            "(Authenticated sender: blp@ovn.org)\n by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id DBEA41BF207;\n Tue,  7 Sep 2021 22:45:33 +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:12 -0700",
        "Message-Id": "<20210907224516.489604-7-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 06/10] ovn-northd-ddlog: Simplify\n\tLBVIPWithStatus to include up_backends string.",
        "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": "There was only one use for the 'backends' map, which was to be converted\nto a string that listed all the backends that were up, so we might as\nwell do that at its point of origination.  At the same time, everything\nelse in LBVIPWithStatus was just a copy of the underlying LBVIP, so we\nmight as well just reference it.\n\nOnly slight improvement to performance.\n\nSigned-off-by: Ben Pfaff <blp@ovn.org>\n---\n northd/lswitch.dl    | 32 ++++++++++++++------------------\n northd/ovn_northd.dl | 29 +++++++++--------------------\n 2 files changed, 23 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/northd/lswitch.dl b/northd/lswitch.dl\nindex ad6475a91..69b1c6eb5 100644\n--- a/northd/lswitch.dl\n+++ b/northd/lswitch.dl\n@@ -445,25 +445,21 @@ function default_protocol(protocol: Option<istring>): istring = {\n     }\n }\n \n-typedef LBVIPWithStatus = LBVIPWithStatus {\n-    lb: Intern<nb::Load_Balancer>,\n-    vip_key: istring,\n-    backend_ips: istring,\n-    health_check: Option<Intern<nb::Load_Balancer_Health_Check>>,\n-    vip_addr: v46_ip,\n-    vip_port: bit<16>,\n-    backends: Map<lb_vip_backend, bool>\n-}\n-relation LBVIPWithStatus[Intern<LBVIPWithStatus>]\n-\n-LBVIPWithStatus[LBVIPWithStatus{lb, vip_key, backend_ips, health_check, vip_addr, vip_port, map_empty()}.intern()] :-\n-    &LBVIP(lb, vip_key, backend_ips, health_check, vip_addr, vip_port, vec_empty()).\n-LBVIPWithStatus[LBVIPWithStatus{lb, vip_key, backend_ips, health_check, vip_addr, vip_port, backends_with_status}.intern()] :-\n-    &LBVIP(lb, vip_key, backend_ips, health_check, vip_addr, vip_port, backends),\n-    var backend = FlatMap(backends),\n+relation LBVIPWithStatus(\n+    lbvip: Intern<LBVIP>,\n+    up_backends: istring)\n+LBVIPWithStatus(lbvip, i\"\") :-\n+    lbvip in &LBVIP(.backends = vec_empty()).\n+LBVIPWithStatus(lbvip, up_backends) :-\n     LBVIPBackendStatus(lbvip, backend, up),\n-    var backends_with_status = ((backend, up)).group_by((lb, vip_key, backend_ips, health_check,\n-                                                         vip_addr, vip_port)).to_map().\n+    var up_backends = ((backend, up)).group_by(lbvip).to_vec().filter_map(|x| {\n+        (LBVIPBackend{var ip, var port, _}, var up) = x;\n+        match ((up, port)) {\n+            (true, 0) -> Some{\"${ip.to_bracketed_string()}\"},\n+            (true, _) -> Some{\"${ip.to_bracketed_string()}:${port}\"},\n+            _ -> None\n+        }\n+    }).join(\",\").intern().\n \n /* Maps from a load-balancer virtual IP backend to whether it's up or not.\n  *\ndiff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl\nindex bf2192f7e..5af41fa22 100644\n--- a/northd/ovn_northd.dl\n+++ b/northd/ovn_northd.dl\n@@ -3177,7 +3177,7 @@ function get_match_for_lb_key(ip_address: v46_ip,\n }\n /* New connections in Ingress table. */\n \n-function ct_lb(backends: string,\n+function ct_lb(backends: istring,\n                selection_fields: Set<istring>, protocol: Option<istring>): string {\n     var args = vec_with_capacity(2);\n     args.push(\"backends=${backends}\");\n@@ -3198,18 +3198,11 @@ function ct_lb(backends: string,\n \n     \"ct_lb(\" ++ args.join(\"; \") ++ \");\"\n }\n-function build_lb_vip_actions(lbvip: Intern<LBVIPWithStatus>,\n+function build_lb_vip_actions(lbvip: Intern<LBVIP>,\n+                              up_backends: istring,\n                               stage: Intern<Stage>,\n                               actions0: string): (string, bool) {\n-    var up_backends = vec_with_capacity(lbvip.backends.size());\n-    for (pair in lbvip.backends) {\n-        (var backend, var up) = pair;\n-        if (up) {\n-            up_backends.push((backend.ip, backend.port))\n-        }\n-    };\n-\n-    if (up_backends.is_empty()) {\n+    if (up_backends == i\"\") {\n         if (lbvip.lb.options.get_bool_def(i\"reject\", false)) {\n             return (\"reg0 = 0; reject { outport <-> inport; ${next_to_stage(stage)};};\", true)\n         } else if (lbvip.health_check.is_some()) {\n@@ -3217,11 +3210,7 @@ function build_lb_vip_actions(lbvip: Intern<LBVIPWithStatus>,\n         } // else fall through\n     };\n \n-    var up_backends_s = up_backends.sort_imm().map(|x| match (x) {\n-        (ip, 0) -> \"${ip.to_bracketed_string()}\",\n-        (ip, port) -> \"${ip.to_bracketed_string()}:${port}\"\n-    }).join(\",\");\n-    var actions = ct_lb(up_backends_s, lbvip.lb.selection_fields, lbvip.lb.protocol);\n+    var actions = ct_lb(up_backends, lbvip.lb.selection_fields, lbvip.lb.protocol);\n     (actions0 ++ actions, false)\n }\n Flow(.logical_datapath = sw._uuid,\n@@ -3232,7 +3221,7 @@ Flow(.logical_datapath = sw._uuid,\n      .io_port          = None,\n      .controller_meter = meter,\n      .stage_hint       = 0) :-\n-    LBVIPWithStatus[lbvip@&LBVIPWithStatus{.lb = lb}],\n+    LBVIPWithStatus(lbvip@&LBVIP{.lb = lb}, up_backends),\n     var priority = if (lbvip.vip_port != 0) { 120 } else { 110 },\n     (var actions, var reject) = {\n         /* Store the original destination IP to be used when generating\n@@ -3252,7 +3241,7 @@ Flow(.logical_datapath = sw._uuid,\n             \"\"\n         };\n \n-        build_lb_vip_actions(lbvip, s_SWITCH_OUT_QOS_MARK(), actions0 ++ actions1)\n+        build_lb_vip_actions(lbvip, up_backends, s_SWITCH_OUT_QOS_MARK(), actions0 ++ actions1)\n     },\n     var __match = \"ct.new && \" ++ get_match_for_lb_key(lbvip.vip_addr, lbvip.vip_port, lb.protocol, false, false, false),\n     sw in &Switch(),\n@@ -6843,9 +6832,9 @@ Flow(.logical_datapath = r._uuid,\n      .io_port          = None,\n      .controller_meter = meter,\n      .stage_hint       = 0) :-\n-    LBVIPWithStatus[lbvip@&LBVIPWithStatus{.lb = lb}],\n+    LBVIPWithStatus(lbvip@&LBVIP{.lb = lb}, up_backends),\n     var priority = if (lbvip.vip_port != 0) 120 else 110,\n-    (var actions0, var reject) = build_lb_vip_actions(lbvip, s_ROUTER_OUT_SNAT(), \"\"),\n+    (var actions0, var reject) = build_lb_vip_actions(lbvip, up_backends, s_ROUTER_OUT_SNAT(), \"\"),\n     var match0 = \"ct.new && \" ++\n         get_match_for_lb_key(lbvip.vip_addr, lbvip.vip_port, lb.protocol, true, true, true),\n     r in &Router(),\n",
    "prefixes": [
        "ovs-dev",
        "v2",
        "06/10"
    ]
}