get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231616,
    "url": "http://patchwork.ozlabs.org/api/patches/2231616/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20260430233848.440994-3-i.maximets@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": "<20260430233848.440994-3-i.maximets@ovn.org>",
    "list_archive_url": null,
    "date": "2026-04-30T23:38:38",
    "name": "[ovs-dev,net,v2,2/2] selftests: openvswitch: add tests for tunnel vport refcounting",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "54418fa455bfdaef70824a71c4ed264cbf64cc6b",
    "submitter": {
        "id": 76798,
        "url": "http://patchwork.ozlabs.org/api/people/76798/?format=api",
        "name": "Ilya Maximets",
        "email": "i.maximets@ovn.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20260430233848.440994-3-i.maximets@ovn.org/mbox/",
    "series": [
        {
            "id": 502405,
            "url": "http://patchwork.ozlabs.org/api/series/502405/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=502405",
            "date": "2026-04-30T23:38:37",
            "name": "openvswitch: fix self-deadlock on release of tunnel vports",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/502405/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231616/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231616/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@legolas.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "legolas.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=patchwork.ozlabs.org)",
            "smtp1.osuosl.org;\n dmarc=none (p=none dis=none) header.from=ovn.org"
        ],
        "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 ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g69cj3bhqz1yGq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 09:39:33 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id 5003D40F60;\n\tThu, 30 Apr 2026 23:39:30 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id H73d0hOc8IBT; Thu, 30 Apr 2026 23:39:29 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp2.osuosl.org (Postfix) with ESMTPS id 57E8540F56;\n\tThu, 30 Apr 2026 23:39:29 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 4D76EC04E8;\n\tThu, 30 Apr 2026 23:39:29 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 46971C04E7\n for <dev@openvswitch.org>; Thu, 30 Apr 2026 23:39:27 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 52BB98547A\n for <dev@openvswitch.org>; Thu, 30 Apr 2026 23:39:14 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id wpiPYOWKPlmr for <dev@openvswitch.org>;\n Thu, 30 Apr 2026 23:39:13 +0000 (UTC)",
            "from mail-qt1-f193.google.com (mail-qt1-f193.google.com\n [209.85.160.193])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 31DCC85494\n for <dev@openvswitch.org>; Thu, 30 Apr 2026 23:39:13 +0000 (UTC)",
            "by mail-qt1-f193.google.com with SMTP id\n d75a77b69052e-50d87c138e1so12938341cf.1\n for <dev@openvswitch.org>; Thu, 30 Apr 2026 16:39:12 -0700 (PDT)",
            "from im-t490s.redhat.com (89-24-32-159.nat.epc.tmcz.cz.\n [89.24.32.159]) by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-51040934199sm221cf.13.2026.04.30.16.39.09\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 16:39:11 -0700 (PDT)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.9.56;\n helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp2.osuosl.org 57E8540F56",
            "OpenDKIM Filter v2.11.0 smtp1.osuosl.org 31DCC85494"
        ],
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=209.85.160.193;\n helo=mail-qt1-f193.google.com; envelope-from=i.maximets.ovn@gmail.com;\n receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp1.osuosl.org 31DCC85494",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777592352; x=1778197152;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=L9p6ZBs3o3Fa+hheEbjqBW5O3NwkqJypwl5eyCvle18=;\n b=SBXXULiHH4hPPOrQphWXD4YUXPLVjaFJZfVtK3hcw7lRjaAxuGLVdFgWnjShkQQrcT\n Jj7LLZS5u/R45P+KJ/uWrYJmXisIocDInDoa5Ju07diIc9n9+2zMbzYwgOnsPNIKAa0I\n mZo5K8wVTByxGohZYNb5PYl/qVRngaby9+UJU76OWzyzyjLZCFoNh0oyfk7v9qrWlMoP\n 0v+zw2DPq9ljbCCSyfAy39+qSoqHQoAsRUNnNqxRS6SNw2uWG6MNYjJJmGm68L3dYeQb\n 5lNM1tmQad6Bt4+Mmvl1/qtlNwYCOhndpaenjPBbE87TJAoWQpKBkg96icCOXb7wKtFk\n XM/A==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ/xQd+YoKrpd9j3AfkxF3gaWSfY/TIozoPTR/SmwZX56iurTRJdl2w6Ek7mPcTDb9iIVdQ=@openvswitch.org",
        "X-Gm-Message-State": "AOJu0YzyKzKQr6abpHxXWZc7LfcrRrsOmnrw7IJf+b8FjUhBIHUAiSa8\n f1Mo/9GIyGfVcdwLJEj+lLqNiGTouQDOxCW/EAGrtLP4ixeOxfNmcwtn",
        "X-Gm-Gg": "AeBDies04Y9qv3nMB0GmOSy0s9Zt+FzgMfQtpNsgbMbU7urs0DVmNlMV8P+dyTN0C6B\n P9gbIyaIkny6JPUS/rEEqSacb61hin6ThjLlTpYqp/19bqVB/sb29m+vUO1bXdi3tXpy1WQJHue\n HbFnAUbDiHYJlBvSo6Hb/L53tbCAxiFByVEJw/NEao6fyXbua/anLzQAqBaEQBzowqHasFn4yWu\n fOkAqT7zJhuLAN7EeeRyxLcNIW0rUzNLZTlLuhrFpq3QUNUh9WRDL1dE+2hjbmTQ1CJ0YWBg9XJ\n tEJKtXtBzPpuNUZzaDMB7U6N0D5YAsESrwz2YODopvjzdTfy94IuqaQW9qDNFuFVgM+LfsglY9x\n mnPdQ9eLw293/4836bVlzzxm1VHsX4wvFRT0BR4JReYeiWxne4VI7Scn5d6uIHPlgZSVrmtG7IS\n ZIqNfSNl1I3C5zQKPQkfaZMGeFOvcEdR7VFv8/3ro8JUw96MhGaKFFmCXWFxcu01huIe2Bgw==",
        "X-Received": "by 2002:a05:622a:1b19:b0:50d:b33d:bc6b with SMTP id\n d75a77b69052e-5102ab1f495mr75917351cf.20.1777592351818;\n Thu, 30 Apr 2026 16:39:11 -0700 (PDT)",
        "From": "Ilya Maximets <i.maximets@ovn.org>",
        "To": "netdev@vger.kernel.org",
        "Date": "Fri,  1 May 2026 01:38:38 +0200",
        "Message-ID": "<20260430233848.440994-3-i.maximets@ovn.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260430233848.440994-1-i.maximets@ovn.org>",
        "References": "<20260430233848.440994-1-i.maximets@ovn.org>",
        "MIME-Version": "1.0",
        "Subject": "[ovs-dev] [PATCH net v2 2/2] selftests: openvswitch: add tests for\n tunnel vport refcounting",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.30",
        "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>",
        "Cc": "dev@openvswitch.org, linux-kselftest@vger.kernel.org,\n Yuan Tan <tanyuan98@outlook.com>, linux-kernel@vger.kernel.org,\n Ilya Maximets <i.maximets@ovn.org>, Yang Yang <n05ec@lzu.edu.cn>,\n Eric Dumazet <edumazet@google.com>, Simon Horman <horms@kernel.org>,\n Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,\n Shuah Khan <shuah@kernel.org>, \"David S. Miller\" <davem@davemloft.net>",
        "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 were a few issues found with the tunnel vport types around the\nvport destruction code.  Add some basic tests, so at least we know that\nthey can be properly added and removed without obvious issues.\n\nThe test creates OVS datapath, adds a non-LWT tunnel port, makes sure\nthey are created, and then removes the datapath and waits for all the\nports to be gone.\n\nThe dpctl script had a few bugs in the none-lwt tunnel creation code,\nso fixing them as well to make the testing possible:\n- The type of the --lwt option changed in order to properly disable it.\n- Removed byte order conversion for the port numbers, as the value\n  supposed to be in the host order.\n- Added missing 'gre' choice for the tunnel type.\n\nSigned-off-by: Ilya Maximets <i.maximets@ovn.org>\n---\n .../selftests/net/openvswitch/openvswitch.sh  | 37 +++++++++++++++++++\n .../selftests/net/openvswitch/ovs-dpctl.py    | 19 +++++++---\n 2 files changed, 50 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh\nindex b327d3061ed53..3cdd953f68132 100755\n--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh\n+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh\n@@ -26,6 +26,7 @@ tests=\"\n \tnetlink_checks\t\t\t\tovsnl: validate netlink attrs and settings\n \tupcall_interfaces\t\t\tovs: test the upcall interfaces\n \ttunnel_metadata\t\t\t\tovs: test extraction of tunnel metadata\n+\ttunnel_refcount\t\t\t\tovs: test tunnel vport reference cleanup\n \tdrop_reason\t\t\t\tdrop: test drop reasons are emitted\n \tpsample\t\t\t\t\tpsample: Sampling packets with psample\"\n \n@@ -830,6 +831,42 @@ test_tunnel_metadata() {\n \treturn 0\n }\n \n+test_tunnel_refcount() {\n+\tsbxname=\"test_tunnel_refcount\"\n+\tsbx_add \"${sbxname}\" || return 1\n+\n+\tovs_sbx \"${sbxname}\" ip netns add trefns || return 1\n+\ton_exit \"ovs_sbx ${sbxname} ip netns del trefns\"\n+\n+\tfor tun_type in gre vxlan geneve; do\n+\t\tinfo \"testing ${tun_type} tunnel vport refcount\"\n+\n+\t\tovs_sbx \"${sbxname}\" ip netns exec trefns \\\n+\t\t\tpython3 $ovs_base/ovs-dpctl.py \\\n+\t\t\tadd-dp dp-${tun_type} || return 1\n+\n+\t\tovs_sbx \"${sbxname}\" ip netns exec trefns \\\n+\t\t\tpython3 $ovs_base/ovs-dpctl.py \\\n+\t\t\tadd-if --no-lwt -t ${tun_type} \\\n+\t\t\tdp-${tun_type} ovs-${tun_type}0 || return 1\n+\n+\t\tovs_wait ip -netns trefns link show \\\n+\t\t\tovs-${tun_type}0 >/dev/null 2>&1 || return 1\n+\n+\t\tinfo \"deleting dp - may hang if reference counting is broken\"\n+\t\tovs_sbx \"${sbxname}\" ip netns exec trefns \\\n+\t\t\tpython3 $ovs_base/ovs-dpctl.py \\\n+\t\t\tdel-dp dp-${tun_type} &\n+\n+\t\tdev_removed() {\n+\t\t\t! ip -netns trefns link show \"$1\" >/dev/null 2>&1\n+\t\t}\n+\t\tovs_wait dev_removed dp-${tun_type} || return 1\n+\t\tovs_wait dev_removed ovs-${tun_type}0 || return 1\n+\tdone\n+\treturn 0\n+}\n+\n run_test() {\n \t(\n \ttname=\"$1\"\ndiff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\nindex 848f61fdcee09..bbe35e2718d26 100644\n--- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\n+++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\n@@ -11,7 +11,6 @@ import logging\n import math\n import multiprocessing\n import re\n-import socket\n import struct\n import sys\n import time\n@@ -2069,7 +2068,7 @@ class OvsVport(GenericNetlinkSocket):\n         elif vport_type == \"internal\":\n             return OvsVport.OVS_VPORT_TYPE_INTERNAL\n         elif vport_type == \"gre\":\n-            return OvsVport.OVS_VPORT_TYPE_INTERNAL\n+            return OvsVport.OVS_VPORT_TYPE_GRE\n         elif vport_type == \"vxlan\":\n             return OvsVport.OVS_VPORT_TYPE_VXLAN\n         elif vport_type == \"geneve\":\n@@ -2121,6 +2120,7 @@ class OvsVport(GenericNetlinkSocket):\n         )\n \n         TUNNEL_DEFAULTS = [(\"geneve\", 6081),\n+                           (\"gre\", 0),\n                            (\"vxlan\", 4789)]\n \n         for tnl in TUNNEL_DEFAULTS:\n@@ -2129,9 +2129,13 @@ class OvsVport(GenericNetlinkSocket):\n                     dport = tnl[1]\n \n                 if not lwt:\n+                    if tnl[0] == \"gre\":\n+                        # GRE tunnels have no options.\n+                        break\n+\n                     vportopt = OvsVport.ovs_vport_msg.vportopts()\n                     vportopt[\"attrs\"].append(\n-                        [\"OVS_TUNNEL_ATTR_DST_PORT\", socket.htons(dport)]\n+                        [\"OVS_TUNNEL_ATTR_DST_PORT\", dport]\n                     )\n                     msg[\"attrs\"].append(\n                         [\"OVS_VPORT_ATTR_OPTIONS\", vportopt]\n@@ -2145,6 +2149,9 @@ class OvsVport(GenericNetlinkSocket):\n                                  geneve_port=dport,\n                                  geneve_collect_metadata=True,\n                                  geneve_udp_zero_csum6_rx=1)\n+                    elif tnl[0] == \"gre\":\n+                        ipr.link(\"add\", ifname=vport_ifname, kind=\"gretap\",\n+                                 gre_collect_metadata=True)\n                     elif tnl[0] == \"vxlan\":\n                         ipr.link(\"add\", ifname=vport_ifname, kind=tnl[0],\n                                  vxlan_learning=0, vxlan_collect_metadata=1,\n@@ -2563,7 +2570,7 @@ def print_ovsdp_full(dp_lookup_rep, ifindex, ndb=NDB(), vpl=OvsVport()):\n             if vpo:\n                 dpo = vpo.get_attr(\"OVS_TUNNEL_ATTR_DST_PORT\")\n                 if dpo:\n-                    opts += \" tnl-dport:%s\" % socket.ntohs(dpo)\n+                    opts += \" tnl-dport:%s\" % dpo\n             print(\n                 \"  port %d: %s (%s%s)\"\n                 % (\n@@ -2632,7 +2639,7 @@ def main(argv):\n         \"--ptype\",\n         type=str,\n         default=\"netdev\",\n-        choices=[\"netdev\", \"internal\", \"geneve\", \"vxlan\"],\n+        choices=[\"netdev\", \"internal\", \"gre\", \"geneve\", \"vxlan\"],\n         help=\"Interface type (default netdev)\",\n     )\n     addifcmd.add_argument(\n@@ -2645,7 +2652,7 @@ def main(argv):\n     addifcmd.add_argument(\n         \"-l\",\n         \"--lwt\",\n-        type=bool,\n+        action=argparse.BooleanOptionalAction,\n         default=True,\n         help=\"Use LWT infrastructure instead of vport (default true).\"\n     )\n",
    "prefixes": [
        "ovs-dev",
        "net",
        "v2",
        "2/2"
    ]
}