get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1528391,
    "url": "http://patchwork.ozlabs.org/api/patches/1528391/",
    "web_url": "http://patchwork.ozlabs.org/project/ovn/patch/20210915142213.25413-1-dceara@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": "<20210915142213.25413-1-dceara@redhat.com>",
    "list_archive_url": null,
    "date": "2021-09-15T14:22:13",
    "name": "[ovs-dev] binding: Store timestamp at which ovn-installed was set.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "faf966874ff61aeabfa1167e795ff96f6bb1ab2e",
    "submitter": {
        "id": 76591,
        "url": "http://patchwork.ozlabs.org/api/people/76591/",
        "name": "Dumitru Ceara",
        "email": "dceara@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ovn/patch/20210915142213.25413-1-dceara@redhat.com/mbox/",
    "series": [
        {
            "id": 262468,
            "url": "http://patchwork.ozlabs.org/api/series/262468/",
            "web_url": "http://patchwork.ozlabs.org/project/ovn/list/?series=262468",
            "date": "2021-09-15T14:22:13",
            "name": "[ovs-dev] binding: Store timestamp at which ovn-installed was set.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/262468/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1528391/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1528391/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ovs-dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@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=VNJlzJxw;\n\tdkim-atps=neutral",
            "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>)",
            "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com"
        ],
        "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 4H8j931dksz9sR4\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Sep 2021 00:22:31 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id 11B0D404AE;\n\tWed, 15 Sep 2021 14:22:28 +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 exivI5XY_C4E; Wed, 15 Sep 2021 14:22:25 +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 983DB40181;\n\tWed, 15 Sep 2021 14:22:24 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 78B40C0011;\n\tWed, 15 Sep 2021 14:22:24 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id BF224C000D\n for <ovs-dev@openvswitch.org>; Wed, 15 Sep 2021 14:22:22 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id A6568404AE\n for <ovs-dev@openvswitch.org>; Wed, 15 Sep 2021 14:22:22 +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 LZssJdC8n64Y for <ovs-dev@openvswitch.org>;\n Wed, 15 Sep 2021 14:22:21 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp2.osuosl.org (Postfix) with ESMTPS id AD16340181\n for <ovs-dev@openvswitch.org>; Wed, 15 Sep 2021 14:22:21 +0000 (UTC)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-148-NdL22kqHMkuWIXnLfsMFRA-1; Wed, 15 Sep 2021 10:22:18 -0400",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com\n [10.5.11.12])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA68D1006AA0\n for <ovs-dev@openvswitch.org>; Wed, 15 Sep 2021 14:22:17 +0000 (UTC)",
            "from dceara.remote.csb (unknown [10.39.194.131])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 409FC60C7F\n for <ovs-dev@openvswitch.org>; Wed, 15 Sep 2021 14:22:17 +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",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1631715740;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=6o+MJyF1y8xXBS4nvfPJG4Dar014pN7uc2GGzzBtLPU=;\n b=VNJlzJxwrT3EY55ulL+Jold9nvQzDk1ZEg87KTzEqGmkUk3ngKxgA0uJ7ROlqDC4nBx9Ei\n vse8oroKo+TfGT7M/RqycJR30kzD78vMSqxirZfdaRG7mBBYyCWqGO6YWwK53zKvCouAam\n UE79gGd1tyCqiacqVWSklZRMtbXVqFE=",
        "X-MC-Unique": "NdL22kqHMkuWIXnLfsMFRA-1",
        "From": "Dumitru Ceara <dceara@redhat.com>",
        "To": "ovs-dev@openvswitch.org",
        "Date": "Wed, 15 Sep 2021 16:22:13 +0200",
        "Message-Id": "<20210915142213.25413-1-dceara@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Subject": "[ovs-dev] [PATCH ovn] binding: Store timestamp at which\n\tovn-installed was set.",
        "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": "CMSs (e.g., ovn-kubernetes) already use the ovn-installed\nexternal_id set by ovn-controller in OVS.Interface.external_ids to\ndetermine that the networking for a VIF is completely plugged.\n\novn-controller now also stores the timestamp (in milliseconds since the\nepoch) at which an interface was marked as \"installed\", as the\novn-installed-ts external id in the OVS DB.\n\nThis commit also adds the relevant documentation for\novn-installed/ovn-installed-ts.\n\nSigned-off-by: Dumitru Ceara <dceara@redhat.com>\n---\n controller/binding.c            |  7 ++++++-\n controller/binding.h            |  3 ++-\n controller/if-status.c          |  6 +++++-\n controller/ovn-controller.8.xml | 15 +++++++++++++++\n 4 files changed, 28 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/controller/binding.c b/controller/binding.c\nindex 34935bb9c..c037b2352 100644\n--- a/controller/binding.c\n+++ b/controller/binding.c\n@@ -44,6 +44,7 @@ VLOG_DEFINE_THIS_MODULE(binding);\n  * flows have been installed.\n  */\n #define OVN_INSTALLED_EXT_ID \"ovn-installed\"\n+#define OVN_INSTALLED_TS_EXT_ID \"ovn-installed-ts\"\n \n #define OVN_QOS_TYPE \"linux-htb\"\n \n@@ -712,7 +713,8 @@ local_binding_is_down(struct shash *local_bindings, const char *pb_name)\n \n void\n local_binding_set_up(struct shash *local_bindings, const char *pb_name,\n-                     bool sb_readonly, bool ovs_readonly)\n+                     const char *ts_now_str, bool sb_readonly,\n+                     bool ovs_readonly)\n {\n     struct local_binding *lbinding =\n         local_binding_find(local_bindings, pb_name);\n@@ -725,6 +727,9 @@ local_binding_set_up(struct shash *local_bindings, const char *pb_name,\n         ovsrec_interface_update_external_ids_setkey(lbinding->iface,\n                                                     OVN_INSTALLED_EXT_ID,\n                                                     \"true\");\n+        ovsrec_interface_update_external_ids_setkey(lbinding->iface,\n+                                                    OVN_INSTALLED_TS_EXT_ID,\n+                                                    ts_now_str);\n     }\n \n     if (!sb_readonly && lbinding && b_lport && b_lport->pb->n_up\ndiff --git a/controller/binding.h b/controller/binding.h\nindex f1abc4b9c..70cc37c78 100644\n--- a/controller/binding.h\n+++ b/controller/binding.h\n@@ -120,7 +120,8 @@ ofp_port_t local_binding_get_lport_ofport(const struct shash *local_bindings,\n bool local_binding_is_up(struct shash *local_bindings, const char *pb_name);\n bool local_binding_is_down(struct shash *local_bindings, const char *pb_name);\n void local_binding_set_up(struct shash *local_bindings, const char *pb_name,\n-                          bool sb_readonly, bool ovs_readonly);\n+                          const char *ts_now_str, bool sb_readonly,\n+                          bool ovs_readonly);\n void local_binding_set_down(struct shash *local_bindings, const char *pb_name,\n                             bool sb_readonly, bool ovs_readonly);\n \ndiff --git a/controller/if-status.c b/controller/if-status.c\nindex 08fb50b87..b5a4025fc 100644\n--- a/controller/if-status.c\n+++ b/controller/if-status.c\n@@ -21,6 +21,7 @@\n \n #include \"lib/hmapx.h\"\n #include \"lib/util.h\"\n+#include \"timeval.h\"\n #include \"openvswitch/vlog.h\"\n \n VLOG_DEFINE_THIS_MODULE(if_status);\n@@ -398,11 +399,14 @@ if_status_mgr_update_bindings(struct if_status_mgr *mgr,\n      * their flows installed but are not yet marked \"up\" in the binding\n      * module.\n      */\n+    char *ts_now_str = xasprintf(\"%lld\", time_wall_msec());\n     HMAPX_FOR_EACH (node, &mgr->ifaces_per_state[OIF_MARK_UP]) {\n         struct ovs_iface *iface = node->data;\n \n-        local_binding_set_up(bindings, iface->id, sb_readonly, ovs_readonly);\n+        local_binding_set_up(bindings, iface->id, ts_now_str,\n+                             sb_readonly, ovs_readonly);\n     }\n+    free(ts_now_str);\n \n     /* Notify the binding module to set \"down\" all bindings that have been\n      * released but are not yet marked as \"down\" in the binding module.\ndiff --git a/controller/ovn-controller.8.xml b/controller/ovn-controller.8.xml\nindex 5a649ee65..8c180f576 100644\n--- a/controller/ovn-controller.8.xml\n+++ b/controller/ovn-controller.8.xml\n@@ -471,6 +471,21 @@\n           flows have been successfully installed in OVS.\n         </p>\n       </dd>\n+\n+      <dt>\n+        <code>external_ids:ovn-installed</code> and\n+        <code>external_ids:ovn-installed-ts</code> in the\n+        <code>Interface</code> table\n+      </dt>\n+\n+      <dd>\n+        <p>\n+          This key is set after all openflow operations corresponding to the\n+          OVS interface have been processed by ovs-vswitchd.  At the same time\n+          a timestamp, in milliseconds since the epoch, is stored in\n+          <code>external_ids:ovn-installed-ts</code>.\n+        </p>\n+      </dd>\n     </dl>\n \n     <h1>OVN Southbound Database Usage</h1>\n",
    "prefixes": [
        "ovs-dev"
    ]
}