get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1306579,
    "url": "http://patchwork.ozlabs.org/api/patches/1306579/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20200610061850.2005397-1-numans@ovn.org/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/projects/47/?format=api",
        "name": "Open vSwitch",
        "link_name": "openvswitch",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "git@github.com:openvswitch/ovs.git",
        "webscm_url": "https://github.com/openvswitch/ovs",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20200610061850.2005397-1-numans@ovn.org>",
    "list_archive_url": null,
    "date": "2020-06-10T06:18:50",
    "name": "[ovs-dev,ovn,v11,6/6] Add an util function get_unique_lport_key() for generating unique lport key.",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b4cab840842958f285d2114962eecebcfb81801a",
    "submitter": {
        "id": 77669,
        "url": "http://patchwork.ozlabs.org/api/people/77669/?format=api",
        "name": "Numan Siddique",
        "email": "numans@ovn.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20200610061850.2005397-1-numans@ovn.org/mbox/",
    "series": [
        {
            "id": 182423,
            "url": "http://patchwork.ozlabs.org/api/series/182423/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=182423",
            "date": "2020-06-10T06:17:26",
            "name": "Incremental processing improvements.",
            "version": 11,
            "mbox": "http://patchwork.ozlabs.org/series/182423/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1306579/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1306579/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.137; helo=fraxinus.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=none (p=none dis=none) header.from=ovn.org"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49hcJc2zXMz9sRh\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 10 Jun 2020 16:19:11 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id CA4E7870F4;\n\tWed, 10 Jun 2020 06:19:09 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id KiqfF5pe20Qv; Wed, 10 Jun 2020 06:19:07 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id CEF3187097;\n\tWed, 10 Jun 2020 06:19:07 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id B107AC0893;\n\tWed, 10 Jun 2020 06:19:07 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 08C1EC016F\n for <dev@openvswitch.org>; Wed, 10 Jun 2020 06:19:06 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id DF60688039\n for <dev@openvswitch.org>; Wed, 10 Jun 2020 06:19:05 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 5mAcfj2xZTCz for <dev@openvswitch.org>;\n Wed, 10 Jun 2020 06:19:02 +0000 (UTC)",
            "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n [217.70.183.195])\n by whitealder.osuosl.org (Postfix) with ESMTPS id 68ADA88028\n for <dev@openvswitch.org>; Wed, 10 Jun 2020 06:18:57 +0000 (UTC)",
            "from nusiddiq.home.org.com (unknown [115.99.171.40])\n (Authenticated sender: numans@ovn.org)\n by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id DA33E60005;\n Wed, 10 Jun 2020 06:18:54 +0000 (UTC)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Originating-IP": "115.99.171.40",
        "From": "numans@ovn.org",
        "To": "dev@openvswitch.org",
        "Date": "Wed, 10 Jun 2020 11:48:50 +0530",
        "Message-Id": "<20200610061850.2005397-1-numans@ovn.org>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "<20200610061726.1937231-1-numans@ovn.org>",
        "References": "<20200610061726.1937231-1-numans@ovn.org>",
        "MIME-Version": "1.0",
        "Subject": "[ovs-dev] [PATCH ovn v11 6/6] Add an util function\n\tget_unique_lport_key() for generating unique lport key.",
        "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": "From: Numan Siddique <numans@ovn.org>\n\nSuggested-by: Dumitru Ceara <dceara@redhat.com>\nSigned-off-by: Numan Siddique <numans@ovn.org>\n---\n controller/binding.c | 8 ++++----\n controller/lflow.c   | 8 ++++----\n lib/ovn-util.h       | 8 ++++++++\n 3 files changed, 16 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/controller/binding.c b/controller/binding.c\nindex 3da19a219..27f9dbdc3 100644\n--- a/controller/binding.c\n+++ b/controller/binding.c\n@@ -497,8 +497,8 @@ update_local_lport_ids(struct sset *local_lport_ids,\n                        struct hmap *tracked_datapaths)\n {\n     char buf[16];\n-    snprintf(buf, sizeof(buf), \"%\"PRId64\"_%\"PRId64,\n-             pb->datapath->tunnel_key, pb->tunnel_key);\n+    get_unique_lport_key(pb->datapath->tunnel_key, pb->tunnel_key,\n+                         buf, sizeof(buf));\n     bool added = !!sset_add(local_lport_ids, buf);\n     if (added && tracked_datapaths) {\n         /* Add the 'pb' to the tracked_datapaths. */\n@@ -512,8 +512,8 @@ remove_local_lport_ids(const struct sbrec_port_binding *pb,\n                        struct hmap *tracked_datapaths)\n {\n     char buf[16];\n-    snprintf(buf, sizeof(buf), \"%\"PRId64\"_%\"PRId64,\n-             pb->datapath->tunnel_key, pb->tunnel_key);\n+    get_unique_lport_key(pb->datapath->tunnel_key, pb->tunnel_key,\n+                         buf, sizeof(buf));\n     bool deleted = sset_find_and_delete(local_lport_ids, buf);\n     if (deleted && tracked_datapaths) {\n         /* Add the 'pb' to the tracked_datapaths. */\ndiff --git a/controller/lflow.c b/controller/lflow.c\nindex eb6be0100..546658c60 100644\n--- a/controller/lflow.c\n+++ b/controller/lflow.c\n@@ -130,7 +130,7 @@ is_chassis_resident_cb(const void *c_aux_, const char *port_name)\n     /* Store the port_name to lflow reference. */\n     int64_t dp_id = pb->datapath->tunnel_key;\n     char buf[16];\n-    snprintf(buf, sizeof(buf), \"%\"PRId64\"_%\"PRId64, dp_id, pb->tunnel_key);\n+    get_unique_lport_key(dp_id, pb->tunnel_key, buf, sizeof(buf));\n     lflow_resource_add(c_aux->lfrr, REF_TYPE_PORTBINDING, buf,\n                        &c_aux->lflow->header_.uuid);\n \n@@ -664,7 +664,7 @@ consider_logical_flow(const struct sbrec_logical_flow *lflow,\n             if (port_id) {\n                 int64_t dp_id = lflow->logical_datapath->tunnel_key;\n                 char buf[16];\n-                snprintf(buf, sizeof(buf), \"%\"PRId64\"_%\"PRId64, dp_id, port_id);\n+                get_unique_lport_key(dp_id, port_id, buf, sizeof(buf));\n                 lflow_resource_add(l_ctx_out->lfrr, REF_TYPE_PORTBINDING, buf,\n                                    &lflow->header_.uuid);\n                 if (!sset_contains(l_ctx_in->local_lport_ids, buf)) {\n@@ -927,8 +927,8 @@ lflow_handle_flows_for_lport(const struct sbrec_port_binding *pb,\n {\n     int64_t dp_id = pb->datapath->tunnel_key;\n     char pb_ref_name[16];\n-    snprintf(pb_ref_name, sizeof(pb_ref_name), \"%\"PRId64\"_%\"PRId64,\n-             dp_id, pb->tunnel_key);\n+    get_unique_lport_key(dp_id, pb->tunnel_key, pb_ref_name,\n+                         sizeof(pb_ref_name));\n     bool changed = true;\n     return lflow_handle_changed_ref(REF_TYPE_PORTBINDING, pb_ref_name,\n                                     l_ctx_in, l_ctx_out, &changed);\ndiff --git a/lib/ovn-util.h b/lib/ovn-util.h\nindex e13cf4d78..eba2948ff 100644\n--- a/lib/ovn-util.h\n+++ b/lib/ovn-util.h\n@@ -114,6 +114,14 @@ bool ovn_tnlid_in_use(const struct hmap *set, uint32_t tnlid);\n uint32_t ovn_allocate_tnlid(struct hmap *set, const char *name, uint32_t min,\n                             uint32_t max, uint32_t *hint);\n \n+static inline void\n+get_unique_lport_key(uint64_t dp_tunnel_key, uint64_t lport_tunnel_key,\n+                     char *buf, size_t buf_size)\n+{\n+    snprintf(buf, buf_size, \"%\"PRId64\"_%\"PRId64, dp_tunnel_key,\n+             lport_tunnel_key);\n+}\n+\n char *ovn_chassis_redirect_name(const char *port_name);\n void ovn_set_pidfile(const char *name);\n \n",
    "prefixes": [
        "ovs-dev",
        "ovn",
        "v11",
        "6/6"
    ]
}