get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1549868,
    "url": "http://patchwork.ozlabs.org/api/patches/1549868/",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/163587313623.3737810.4429039447241544262.stgit@fed.void/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/projects/47/",
        "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": "<163587313623.3737810.4429039447241544262.stgit@fed.void>",
    "list_archive_url": null,
    "date": "2021-11-02T17:12:16",
    "name": "[ovs-dev,1/4] Native tunnel: Read/write expires atomically.",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f4922f9498c4368f074b4e4a69e6d40f45bb8327",
    "submitter": {
        "id": 80629,
        "url": "http://patchwork.ozlabs.org/api/people/80629/",
        "name": "Paolo Valerio",
        "email": "pvalerio@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/163587313623.3737810.4429039447241544262.stgit@fed.void/mbox/",
    "series": [
        {
            "id": 270020,
            "url": "http://patchwork.ozlabs.org/api/series/270020/",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=270020",
            "date": "2021-11-02T17:12:06",
            "name": "Native tunnel: Update neigh entries in tnl termination.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/270020/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1549868/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1549868/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": [
            "bilbo.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=LOeIen/v;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
            "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pvalerio@redhat.com"
        ],
        "Received": [
            "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HkGg124V1z9sS8\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  3 Nov 2021 04:12:29 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 41927403AC;\n\tTue,  2 Nov 2021 17:12:26 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n\tby localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id wvnJ3EgfIiIs; Tue,  2 Nov 2021 17:12:25 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id 7319640395;\n\tTue,  2 Nov 2021 17:12:24 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 4CEA8C0036;\n\tTue,  2 Nov 2021 17:12:24 +0000 (UTC)",
            "from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by lists.linuxfoundation.org (Postfix) with ESMTP id AD604C000E\n for <dev@openvswitch.org>; Tue,  2 Nov 2021 17:12:22 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 90F964038A\n for <dev@openvswitch.org>; Tue,  2 Nov 2021 17:12:22 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id h3vSPpltYaFi for <dev@openvswitch.org>;\n Tue,  2 Nov 2021 17:12:21 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp4.osuosl.org (Postfix) with ESMTPS id BE0EE40397\n for <dev@openvswitch.org>; Tue,  2 Nov 2021 17:12:21 +0000 (UTC)",
            "from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-200-zI_C56EKP7-qifvhcUjmZQ-1; Tue, 02 Nov 2021 13:12:19 -0400",
            "by mail-wm1-f71.google.com with SMTP id\n b133-20020a1c808b000000b0032cdd691994so1459149wmd.1\n for <dev@openvswitch.org>; Tue, 02 Nov 2021 10:12:19 -0700 (PDT)",
            "from localhost (net-5-88-23-84.cust.vodafonedsl.it. [5.88.23.84])\n by smtp.gmail.com with ESMTPSA id o8sm5317328wrm.67.2021.11.02.10.12.16\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 02 Nov 2021 10:12:17 -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=1635873140;\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=pSWLOUCFA5EXbaHy3ptjsngu5NaKH7t4l0oL1lsbIq0=;\n b=LOeIen/v122jq3R6cz3ZAsxnOSiy509ZouAmtlAepJYptplBSaxaw/PAeDPsKTLjE4oNca\n 8jBcJnGyKDMEVXwOKvHQBujOJ+hg/Rgx6ueObigFQr5fKNptMxk2T3NguPjPw8o41JPyNO\n AK4u+/EPLS+4XLAag+ZxLaAZGlWgd/w=",
        "X-MC-Unique": "zI_C56EKP7-qifvhcUjmZQ-1",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n :references:user-agent:mime-version:content-transfer-encoding;\n bh=pSWLOUCFA5EXbaHy3ptjsngu5NaKH7t4l0oL1lsbIq0=;\n b=FMytp32mZKkkaWiR7wc3FbVhokhqnJ8IgW2kiRqr3cmEBbllUkx7qk3mqYPmTp5x2d\n km3hokB5y2gbNvapXLS0yQ5j0nIqae1fbUmr+1LlbHrKWzKMufke340sn1UzALPvuwaE\n aZrceeSa+YiiiIEv8KmgkGLvipY8/PX2YOoSNoXp1TFWKfuXFvrbYwxUqzVNJvuuiPwl\n 7Lfckiu5fX/uP1OY7TtOpfek9w48TZcMo5MDoEOyqaWMbsAhmXmQZ9HmawnxKAAfHl6i\n /+kGVkrEBGVsSHmGX1eZoRiZOxoIFH1C0o5bpqyOWBSuleRyB1qnpD7nTrRYCRIqZoIA\n Y0kA==",
        "X-Gm-Message-State": "AOAM531F2l5IphESW7LvbRk1rqcQ2ATly1jCb8TaYjRWjkbgUEqnjPAq\n vI/aE5BxIXG6HGdkScPn98LHHCTzbpzJEf31nb2i9ZMxQnmi44et2jVJhQePtfNrJaRIg5OUEY+\n N64Ztye6BWNs5io04BNZeUr5fSFpiARRGm/Exp6DsWxrONT5RUTkfDFe3RNhs0JXd",
        "X-Received": [
            "by 2002:a05:600c:4f4b:: with SMTP id\n m11mr8338759wmq.151.1635873137871;\n Tue, 02 Nov 2021 10:12:17 -0700 (PDT)",
            "by 2002:a05:600c:4f4b:: with SMTP id\n m11mr8338719wmq.151.1635873137595;\n Tue, 02 Nov 2021 10:12:17 -0700 (PDT)"
        ],
        "X-Google-Smtp-Source": "\n ABdhPJwbcyEpgP0y5UscPamy+8Zh65fZs3gDwKtIvJZnM711uywTALGuu7bwGH6YJ/zge7boyANNhw==",
        "From": "Paolo Valerio <pvalerio@redhat.com>",
        "To": "dev@openvswitch.org",
        "Date": "Tue, 02 Nov 2021 18:12:16 +0100",
        "Message-ID": "<163587313623.3737810.4429039447241544262.stgit@fed.void>",
        "In-Reply-To": "<163587312614.3737810.10273160791099199585.stgit@fed.void>",
        "References": "<163587312614.3737810.10273160791099199585.stgit@fed.void>",
        "User-Agent": "StGit/0.23",
        "MIME-Version": "1.0",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Cc": "fbl@redhat.com, i.maximets@ovn.org",
        "Subject": "[ovs-dev] [PATCH 1/4] Native tunnel: Read/write expires atomically.",
        "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": "Signed-off-by: Paolo Valerio <pvalerio@redhat.com>\n---\n lib/tnl-neigh-cache.c |   32 +++++++++++++++++++++++---------\n 1 file changed, 23 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/lib/tnl-neigh-cache.c b/lib/tnl-neigh-cache.c\nindex 5bda4af7e..2769e5c3d 100644\n--- a/lib/tnl-neigh-cache.c\n+++ b/lib/tnl-neigh-cache.c\n@@ -32,6 +32,7 @@\n #include \"errno.h\"\n #include \"flow.h\"\n #include \"netdev.h\"\n+#include \"ovs-atomic.h\"\n #include \"ovs-thread.h\"\n #include \"packets.h\"\n #include \"openvswitch/poll-loop.h\"\n@@ -44,14 +45,14 @@\n #include \"openvswitch/vlog.h\"\n \n \n-/* In seconds */\n-#define NEIGH_ENTRY_DEFAULT_IDLE_TIME  (15 * 60)\n+/* In milliseconds */\n+#define NEIGH_ENTRY_DEFAULT_IDLE_TIME  (15 * 60 * 1000)\n \n struct tnl_neigh_entry {\n     struct cmap_node cmap_node;\n     struct in6_addr ip;\n     struct eth_addr mac;\n-    time_t expires;             /* Expiration time. */\n+    atomic_llong expires;       /* Expiration time in ms. */\n     char br_name[IFNAMSIZ];\n };\n \n@@ -64,6 +65,16 @@ tnl_neigh_hash(const struct in6_addr *ip)\n     return hash_bytes(ip->s6_addr, 16, 0);\n }\n \n+static bool\n+tnl_neigh_expired(struct tnl_neigh_entry *neigh)\n+{\n+    long long expired;\n+\n+    atomic_read_relaxed(&neigh->expires, &expired);\n+\n+    return expired <= time_msec();\n+}\n+\n static struct tnl_neigh_entry *\n tnl_neigh_lookup__(const char br_name[IFNAMSIZ], const struct in6_addr *dst)\n {\n@@ -73,11 +84,12 @@ tnl_neigh_lookup__(const char br_name[IFNAMSIZ], const struct in6_addr *dst)\n     hash = tnl_neigh_hash(dst);\n     CMAP_FOR_EACH_WITH_HASH (neigh, cmap_node, hash, &table) {\n         if (ipv6_addr_equals(&neigh->ip, dst) && !strcmp(neigh->br_name, br_name)) {\n-            if (neigh->expires <= time_now()) {\n+            if (tnl_neigh_expired(neigh)) {\n                 return NULL;\n             }\n \n-            neigh->expires = time_now() + NEIGH_ENTRY_DEFAULT_IDLE_TIME;\n+            atomic_store_relaxed(&neigh->expires, time_msec() +\n+                                 NEIGH_ENTRY_DEFAULT_IDLE_TIME);\n             return neigh;\n         }\n     }\n@@ -121,7 +133,8 @@ tnl_neigh_set__(const char name[IFNAMSIZ], const struct in6_addr *dst,\n     struct tnl_neigh_entry *neigh = tnl_neigh_lookup__(name, dst);\n     if (neigh) {\n         if (eth_addr_equals(neigh->mac, mac)) {\n-            neigh->expires = time_now() + NEIGH_ENTRY_DEFAULT_IDLE_TIME;\n+            atomic_store_relaxed(&neigh->expires, time_msec() +\n+                                 NEIGH_ENTRY_DEFAULT_IDLE_TIME);\n             ovs_mutex_unlock(&mutex);\n             return;\n         }\n@@ -133,7 +146,8 @@ tnl_neigh_set__(const char name[IFNAMSIZ], const struct in6_addr *dst,\n \n     neigh->ip = *dst;\n     neigh->mac = mac;\n-    neigh->expires = time_now() + NEIGH_ENTRY_DEFAULT_IDLE_TIME;\n+    atomic_store_relaxed(&neigh->expires, time_msec() +\n+                         NEIGH_ENTRY_DEFAULT_IDLE_TIME);\n     ovs_strlcpy(neigh->br_name, name, sizeof neigh->br_name);\n     cmap_insert(&table, &neigh->cmap_node, tnl_neigh_hash(&neigh->ip));\n     ovs_mutex_unlock(&mutex);\n@@ -208,7 +222,7 @@ tnl_neigh_cache_run(void)\n \n     ovs_mutex_lock(&mutex);\n     CMAP_FOR_EACH(neigh, cmap_node, &table) {\n-        if (neigh->expires <= time_now()) {\n+        if (tnl_neigh_expired(neigh)) {\n             tnl_neigh_delete(neigh);\n             changed = true;\n         }\n@@ -319,7 +333,7 @@ tnl_neigh_cache_show(struct unixctl_conn *conn, int argc OVS_UNUSED,\n \n         ds_put_format(&ds, ETH_ADDR_FMT\"   %s\",\n                       ETH_ADDR_ARGS(neigh->mac), neigh->br_name);\n-        if (neigh->expires <= time_now()) {\n+        if (tnl_neigh_expired(neigh)) {\n             ds_put_format(&ds, \" STALE\");\n         }\n         ds_put_char(&ds, '\\n');\n",
    "prefixes": [
        "ovs-dev",
        "1/4"
    ]
}