get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1524290,
    "url": "http://patchwork.ozlabs.org/api/patches/1524290/",
    "web_url": "http://patchwork.ozlabs.org/project/ovn/patch/20210903122148.826196-8-mark.d.gray@redhat.com/",
    "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": "<20210903122148.826196-8-mark.d.gray@redhat.com>",
    "list_archive_url": null,
    "date": "2021-09-03T12:21:48",
    "name": "[ovs-dev,v4,7/7] northd: Add functionality to runtime node",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "5e911d17d68dc7aa7f7d1202de8f7221c298e6a4",
    "submitter": {
        "id": 79963,
        "url": "http://patchwork.ozlabs.org/api/people/79963/",
        "name": "Mark Gray",
        "email": "mark.d.gray@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ovn/patch/20210903122148.826196-8-mark.d.gray@redhat.com/mbox/",
    "series": [
        {
            "id": 260884,
            "url": "http://patchwork.ozlabs.org/api/series/260884/",
            "web_url": "http://patchwork.ozlabs.org/project/ovn/list/?series=260884",
            "date": "2021-09-03T12:21:41",
            "name": "northd: Split northd and northd incremental processing framework",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/260884/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1524290/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/1524290/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\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=D1EB0ume;\n\tdkim-atps=neutral",
            "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>)",
            "smtp1.osuosl.org (amavisd-new);\n dkim=fail (1024-bit key) reason=\"fail (body has been altered)\"\n header.d=redhat.com",
            "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mark.d.gray@redhat.com"
        ],
        "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 4H1H4273h2z9sSn\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Sep 2021 22:22:26 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id 5F1C7407DD;\n\tFri,  3 Sep 2021 12:22:18 +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 DbdUZgF39Djo; Fri,  3 Sep 2021 12:22:16 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp2.osuosl.org (Postfix) with ESMTPS id 73E5740809;\n\tFri,  3 Sep 2021 12:22:11 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 2B143C0028;\n\tFri,  3 Sep 2021 12:22:11 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 290B9C002D\n for <dev@openvswitch.org>; Fri,  3 Sep 2021 12:22:09 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 09E6E83E5F\n for <dev@openvswitch.org>; Fri,  3 Sep 2021 12:22:08 +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 2VcPX-uIgql7 for <dev@openvswitch.org>;\n Fri,  3 Sep 2021 12:22:06 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp1.osuosl.org (Postfix) with ESMTPS id F295F83E64\n for <dev@openvswitch.org>; Fri,  3 Sep 2021 12:22:04 +0000 (UTC)",
            "from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-368-7h0Ue5R3MEitJiDI81Itiw-1; Fri, 03 Sep 2021 08:22:03 -0400",
            "by mail-wm1-f72.google.com with SMTP id\n u1-20020a05600c210100b002e74fc5af71so1824518wml.1\n for <dev@openvswitch.org>; Fri, 03 Sep 2021 05:22:02 -0700 (PDT)",
            "from wsfd-netdev91.ntdv.lab.eng.bos.redhat.com\n (nat-pool-bos-t.redhat.com. [66.187.233.206])\n by smtp.gmail.com with ESMTPSA id a6sm4836612wrh.97.2021.09.03.05.22.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 03 Sep 2021 05:22:01 -0700 (PDT)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1630671723;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=jidf38BL8G3LwLsbcRbFuEs1EJQZ6PIVvy21f+56UgY=;\n b=D1EB0umez+IrdWqKLG6jFDsMfk/tGutYyiFmaiffbmd+m6hJrSe9D0ilAzj2YgvMFUYmbZ\n eqVRiSLxEP89CWDQQImseoGBcD9EP/e7L/gWTTSSl5nF8OTZ234Mz2HJb6SWmz+uJsMrLN\n s1LT7vmDD4PbYKciGtjgkyJCNTSDXO8=",
        "X-MC-Unique": "7h0Ue5R3MEitJiDI81Itiw-1",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=MVms11ABoaxLh4Ua8ADSwnxCY3hh1Jv/IEsO7la44IU=;\n b=BXpwJFn+Pf0Y6ci4vv9h9WNHrFScB3CvqYND79kSPiFUC0p/PNagz9ExYrhh3xXNLQ\n J9mNsIpfaiSQNpLWq8ii0zc+JUTYizudF3YJYWfsNyy3pS1do0AOR9mZk7lBoTRlUGmk\n 17fk2ZhnOdaLFqIwSO4FdUtjPfnSmc1cDXHI9+FxJG6m2icXkMgAD5N3tSXzyMt4Ix2P\n ijoMIobKfI39Y97ZtQQMqMUT9gDDqi5an3j8Zu/M0wn+CvxxSEfr1eSanFQDNQfUnkJF\n igtJ4YGYKToxM4274I05dM7M2vR0a6ab2yz0glvv6l+cmbRj7/HnsTJBSr2oI7tp5zof\n xC9A==",
        "X-Gm-Message-State": "AOAM533Yo4A+3JdEo/3wAeZd6+VlY08Kei1np/d92xVzBPpXalDl5hwL\n FS185+JoGU/mN1SzmJCarkky+IyVhBezViXblf5SXxBNALHam7c68Wc1B19Fn4yxUYUBTuQjpoQ\n 3b1kXg1BFhWXkvW2TpeFn+TX6s4X2QZ/KDw1nQAynY9ULOCaS4PTYgZ38+TTcWlatw4NG",
        "X-Received": [
            "by 2002:adf:c3d4:: with SMTP id d20mr3849069wrg.358.1630671721646;\n Fri, 03 Sep 2021 05:22:01 -0700 (PDT)",
            "by 2002:adf:c3d4:: with SMTP id d20mr3849043wrg.358.1630671721344;\n Fri, 03 Sep 2021 05:22:01 -0700 (PDT)"
        ],
        "X-Google-Smtp-Source": "\n ABdhPJxNCvqYp9PjU5llbHbHWeWXOL6nGdNx5KK4Dag/DqJDYnUtFnHBHd59cZfzBBfKF4GsqPKmuA==",
        "From": "Mark Gray <mark.d.gray@redhat.com>",
        "To": "dev@openvswitch.org",
        "Date": "Fri,  3 Sep 2021 08:21:48 -0400",
        "Message-Id": "<20210903122148.826196-8-mark.d.gray@redhat.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210903122148.826196-1-mark.d.gray@redhat.com>",
        "References": "<20210903122148.826196-1-mark.d.gray@redhat.com>",
        "MIME-Version": "1.0",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Cc": "numans@redhat.com",
        "Subject": "[ovs-dev] [PATCH ovn v4 7/7] northd: Add functionality to runtime\n\tnode",
        "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": "Update the runtime node to initialize and destroy some common data\nused by multiple functions in northd.\n\nSigned-off-by: Mark Gray <mark.d.gray@redhat.com>\n---\n northd/en-northd.c  |  9 ++++++++-\n northd/en-runtime.c | 30 ++++++++++++++++++++++++++++--\n northd/en-runtime.h |  8 ++++++++\n northd/northd.c     | 15 +++++----------\n northd/northd.h     |  5 ++++-\n 5 files changed, 53 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/northd/en-northd.c b/northd/en-northd.c\nindex d310fa4dd31f..2a3250f3d57a 100644\n--- a/northd/en-northd.c\n+++ b/northd/en-northd.c\n@@ -19,6 +19,7 @@\n #include <stdio.h>\n \n #include \"en-northd.h\"\n+#include \"en-runtime.h\"\n #include \"lib/inc-proc-eng.h\"\n #include \"northd.h\"\n #include \"openvswitch/vlog.h\"\n@@ -29,7 +30,13 @@ void en_northd_run(struct engine_node *node, void *data OVS_UNUSED)\n {\n     const struct engine_context *eng_ctx = engine_get_context();\n     struct northd_context *ctx = eng_ctx->client_ctx;\n-    ovn_db_run(ctx);\n+\n+    struct ed_type_runtime *runtime_data =\n+                         engine_get_input_data(\"runtime\", node);\n+\n+    ovn_db_run(ctx, &runtime_data->lr_list,\n+                    &runtime_data->datapaths,\n+                    &runtime_data->ports);\n \n     engine_set_node_state(node, EN_UPDATED);\n \ndiff --git a/northd/en-runtime.c b/northd/en-runtime.c\nindex aac01cd0351f..b8e5766823bf 100644\n--- a/northd/en-runtime.c\n+++ b/northd/en-runtime.c\n@@ -19,7 +19,9 @@\n #include <stdio.h>\n \n #include \"en-runtime.h\"\n+#include \"openvswitch/hmap.h\"\n #include \"lib/inc-proc-eng.h\"\n+#include \"openvswitch/list.h\"\n #include \"northd.h\"\n #include \"openvswitch/vlog.h\"\n \n@@ -27,14 +29,38 @@ VLOG_DEFINE_THIS_MODULE(en_runtime);\n \n void en_runtime_run(struct engine_node *node, void *data OVS_UNUSED)\n {\n+    struct ed_type_runtime *runtime_data = data;\n+\n+    struct ovs_list *lr_list = &runtime_data->lr_list;\n+    struct hmap *datapaths = &runtime_data->datapaths;\n+    struct hmap *ports = &runtime_data->ports;\n+\n+    destroy_datapaths_and_ports(datapaths, ports, lr_list);\n+\n+    ovs_list_init(lr_list);\n+    hmap_init(datapaths);\n+    hmap_init(ports);\n+\n     engine_set_node_state(node, EN_UPDATED);\n }\n void *en_runtime_init(struct engine_node *node OVS_UNUSED,\n                      struct engine_arg *arg OVS_UNUSED)\n {\n-    return NULL;\n+    struct ed_type_runtime *data = xzalloc(sizeof *data);\n+    ovs_list_init(&data->lr_list);\n+    hmap_init(&data->datapaths);\n+    hmap_init(&data->ports);\n+\n+    return data;\n }\n \n-void en_runtime_cleanup(void *data OVS_UNUSED)\n+void en_runtime_cleanup(void *data)\n {\n+    struct ed_type_runtime *runtime_data = data;\n+\n+    struct ovs_list *lr_list = &runtime_data->lr_list;\n+    struct hmap *datapaths = &runtime_data->datapaths;\n+    struct hmap *ports = &runtime_data->ports;\n+\n+    destroy_datapaths_and_ports(datapaths, ports, lr_list);\n }\ndiff --git a/northd/en-runtime.h b/northd/en-runtime.h\nindex 2547c9ec470a..7a1b2f6873e5 100644\n--- a/northd/en-runtime.h\n+++ b/northd/en-runtime.h\n@@ -7,7 +7,15 @@\n #include <stdlib.h>\n #include <stdio.h>\n \n+#include \"openvswitch/hmap.h\"\n #include \"lib/inc-proc-eng.h\"\n+#include \"openvswitch/list.h\"\n+\n+struct ed_type_runtime {\n+    struct ovs_list lr_list;\n+    struct hmap datapaths;\n+    struct hmap ports;\n+};\n \n void en_runtime_run(struct engine_node *node, void *data);\n void *en_runtime_init(struct engine_node *node,\ndiff --git a/northd/northd.c b/northd/northd.c\nindex 829c4479f14b..43792f0d7ff7 100644\n--- a/northd/northd.c\n+++ b/northd/northd.c\n@@ -13838,7 +13838,7 @@ sync_dns_entries(struct northd_context *ctx, struct hmap *datapaths)\n     hmap_destroy(&dns_map);\n }\n \f\n-static void\n+void\n destroy_datapaths_and_ports(struct hmap *datapaths, struct hmap *ports,\n                             struct ovs_list *lr_list)\n {\n@@ -14548,13 +14548,9 @@ ovnsb_db_run(struct northd_context *ctx,\n }\n \n void\n-ovn_db_run(struct northd_context *ctx)\n+ovn_db_run(struct northd_context *ctx, struct ovs_list *lr_list,\n+           struct hmap *datapaths, struct hmap *ports)\n {\n-    struct hmap datapaths, ports;\n-    struct ovs_list lr_list;\n-    ovs_list_init(&lr_list);\n-    hmap_init(&datapaths);\n-    hmap_init(&ports);\n     use_parallel_build = ctx->use_parallel_build;\n     lflow_locks = ctx->lflow_locks;\n \n@@ -14562,12 +14558,11 @@ ovn_db_run(struct northd_context *ctx)\n \n     stopwatch_start(OVNNB_DB_RUN_STOPWATCH_NAME, time_msec());\n     ovnnb_db_run(ctx, ctx->sbrec_chassis_by_name, ctx->ovnsb_idl_loop,\n-                 &datapaths, &ports, &lr_list, start_time,\n+                 datapaths, ports, lr_list, start_time,\n                  ctx->ovn_internal_version);\n     stopwatch_stop(OVNNB_DB_RUN_STOPWATCH_NAME, time_msec());\n     stopwatch_start(OVNSB_DB_RUN_STOPWATCH_NAME, time_msec());\n-    ovnsb_db_run(ctx, ctx->ovnsb_idl_loop, &ports, start_time);\n+    ovnsb_db_run(ctx, ctx->ovnsb_idl_loop, ports, start_time);\n     stopwatch_stop(OVNSB_DB_RUN_STOPWATCH_NAME, time_msec());\n-    destroy_datapaths_and_ports(&datapaths, &ports, &lr_list);\n }\n \ndiff --git a/northd/northd.h b/northd/northd.h\nindex fa941d8ec83b..45a153ba2aa4 100644\n--- a/northd/northd.h\n+++ b/northd/northd.h\n@@ -37,6 +37,9 @@ struct northd_context {\n     const char *ovn_internal_version;\n };\n \n-void ovn_db_run(struct northd_context *ctx);\n+void ovn_db_run(struct northd_context *ctx, struct ovs_list *,\n+                struct hmap *, struct hmap *);\n+void destroy_datapaths_and_ports(struct hmap *datapaths, struct hmap *ports,\n+                                 struct ovs_list *lr_list);\n \n #endif /* NORTHD_H */\n",
    "prefixes": [
        "ovs-dev",
        "v4",
        "7/7"
    ]
}