get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1525732,
    "url": "http://patchwork.ozlabs.org/api/patches/1525732/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/85aae34082427f28dd56547f0d044e1a6975e0d6.1631094144.git.grive@u256.net/",
    "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": "<85aae34082427f28dd56547f0d044e1a6975e0d6.1631094144.git.grive@u256.net>",
    "list_archive_url": null,
    "date": "2021-09-08T09:47:48",
    "name": "[ovs-dev,v5,24/27] dpif-netdev: Make megaflow and mark mappings thread objects",
    "commit_ref": "d85b9230acd237fec9986ddf2ff880738a523dbe",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4678411d7da275ae344c7564d71d8b03ff3953e0",
    "submitter": {
        "id": 78795,
        "url": "http://patchwork.ozlabs.org/api/people/78795/?format=api",
        "name": "Gaetan Rivet",
        "email": "grive@u256.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/85aae34082427f28dd56547f0d044e1a6975e0d6.1631094144.git.grive@u256.net/mbox/",
    "series": [
        {
            "id": 261424,
            "url": "http://patchwork.ozlabs.org/api/series/261424/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=261424",
            "date": "2021-09-08T09:47:24",
            "name": "dpif-netdev: Parallel offload processing",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/261424/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1525732/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1525732/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@bilbo.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=u256.net header.i=@u256.net header.a=rsa-sha256\n header.s=fm2 header.b=GNiMg6+1;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=messagingengine.com header.i=@messagingengine.com\n header.a=rsa-sha256 header.s=fm3 header.b=QFZBEzUT;\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>)",
            "smtp3.osuosl.org (amavisd-new);\n dkim=pass (2048-bit key) header.d=u256.net header.b=\"GNiMg6+1\";\n dkim=pass (2048-bit key) header.d=messagingengine.com\n header.b=\"QFZBEzUT\""
        ],
        "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 ozlabs.org (Postfix) with ESMTPS id 4H4HSD4S2zz9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Sep 2021 19:50:20 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id E324342649;\n\tWed,  8 Sep 2021 09:50:17 +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 swaoreyLy0dQ; Wed,  8 Sep 2021 09:50:16 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id 3501242631;\n\tWed,  8 Sep 2021 09:50:15 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 101A9C001C;\n\tWed,  8 Sep 2021 09:50:15 +0000 (UTC)",
            "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 12D99C0011\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:50:11 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id ECFBC608F3\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:40 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id fMjdo7TDJPcY for <ovs-dev@openvswitch.org>;\n Wed,  8 Sep 2021 09:48:40 +0000 (UTC)",
            "from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com\n [64.147.123.19])\n by smtp3.osuosl.org (Postfix) with ESMTPS id 37DD7613D5\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:40 +0000 (UTC)",
            "from compute4.internal (compute4.nyi.internal [10.202.2.44])\n by mailout.west.internal (Postfix) with ESMTP id 9E00832009E7;\n Wed,  8 Sep 2021 05:48:39 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n by compute4.internal (MEProxy); Wed, 08 Sep 2021 05:48:39 -0400",
            "by mail.messagingengine.com (Postfix) with ESMTPA; Wed,\n 8 Sep 2021 05:48:38 -0400 (EDT)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.8.0",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=u256.net; h=from\n :to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding; s=fm2; bh=tqu14UcrqXY9J\n tP26sOYgwg8leUNdiv3QwhLaQqHgf8=; b=GNiMg6+1/5Vj9WT03R6MIKpM1GYJO\n rVn+f3Kjp9vnGBWuupJ+z8qW4GDL3b+gdRdUmeoKkdJsWkzP5NEckIb5W6uK34ns\n 3PGo37MqFM6U1hzuoIbPwIMHRWONCjW3lQ0k//oVK9eIOVj6xA5KGxUCh/rR2JYd\n ulNYiISBaYeNXcGhBq6OsvYpUhK3SEzJxVa0E2I7q/lWJfiRiZgR2RMAJKddqe40\n 5Czj9lh3KsAUPvaFWZy6vHO0QMJDYQDtjAfIqQeza4mHyNNc/OOM2R+/JlR/1mcC\n /m9tEaJ9TjJDHssJVn7Gq4F0qjqvAQ/qW7nIKj29f6JKeBNNkJeiJgj3g==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :in-reply-to:message-id:mime-version:references:subject:to\n :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n fm3; bh=tqu14UcrqXY9JtP26sOYgwg8leUNdiv3QwhLaQqHgf8=; b=QFZBEzUT\n 5bMeKYFvQ7n4Ims5KuXATgV+ST+KSQFyxEwYbpBeAQw9OtdnwuyEVD60DJdAIb0g\n LVPoV0O45m+CvA8xJ79gN/iycPLQ8UEtc12awLjghAQqmPMDNMmylSnGW4KleJdW\n H4nS2LJP3UQsXxBpujTRbzxtinllwUAvFZlc1Wb0NxSTpYDadRjOkOCc3jwj34DK\n zuA6f3pfYKWwc+HG69Gpv9mYIF4qHZc03LTlakLFandsLRYQxUZ7ZwWW/nK+DgZh\n nbCbiwLvQQrSxTXdxLL/slQ4SY02IQCapg64VDd4eKU4j5gLWgYXhZ8DSPF93l21\n PLH1Hba2GtYZ/A=="
        ],
        "X-ME-Sender": "<xms:94Y4YSsopbUutykNjSyTnaM4-4EEVTZEgRzzBhV7MJOCa8Vx-PIwjQ>\n <xme:94Y4YXfYAlNexriLiDEop2O9nCgEFZY5xuRjVWnnNmAuJMYfl5IgTfh6tmRZVHang\n T_VkKF72IhcfhvgF80>",
        "X-ME-Received": "\n <xmr:94Y4YdxsxZ0hrfFUG-3Bygelu4Oj6AULNAZc-HlkMAMnu0CSaZTkFEKlo8IRbQapof2KfTs5m2SscL9EjnFH-6uEcQ>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedvtddrudefjedgudekucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefirggvthgr\n nhcutfhivhgvthcuoehgrhhivhgvsehuvdehiedrnhgvtheqnecuggftrfgrthhtvghrnh\n ephefgveffkeetheetfeeifedvheelfeejfeehveduteejhfekuedtkeeiuedvteehnecu\n vehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehmrghilhhfrhhomhepghhrihhvvg\n esuhdvheeirdhnvght",
        "X-ME-Proxy": "<xmx:94Y4YdNtkPRJtqZ3mTQVBdPQNfrO9REq_ouA5M5KhejaAN8CkTWqvQ>\n <xmx:94Y4YS8Z8liw848G60RBgxbYU4P3IjZOpO82fy7ZH8y5EAlMMhAD5A>\n <xmx:94Y4YVWP79uIhSFROY_bGXHt5Webl68SwbU2_y421BcznW5y9rGMYA>\n <xmx:94Y4YYlAqkKMHSmz7t3B9_gjtWZHB3SuSQMbgaja1egVb8j5pG9MEw>",
        "From": "Gaetan Rivet <grive@u256.net>",
        "To": "ovs-dev@openvswitch.org",
        "Date": "Wed,  8 Sep 2021 11:47:48 +0200",
        "Message-Id": "\n <85aae34082427f28dd56547f0d044e1a6975e0d6.1631094144.git.grive@u256.net>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<cover.1631094144.git.grive@u256.net>",
        "References": "<cover.1631094144.git.grive@u256.net>",
        "MIME-Version": "1.0",
        "Cc": "Eli Britstein <elibr@nvidia.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Subject": "[ovs-dev] [PATCH v5 24/27] dpif-netdev: Make megaflow and mark\n\tmappings thread objects",
        "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": "In later commits hardware offloads are managed in several threads.\nEach offload is managed by a thread determined by its flow's 'mega_ufid'.\n\nAs megaflow to mark and mark to flow mappings are 1:1 and 1:N\nrespectively, then a single mark exists for a single 'mega_ufid', and\nmultiple flows uses the same 'mega_ufid'. Because the managing thread will\nbe chosen using the 'mega_ufid', then each mapping does not need to be\nshared with other offload threads.\n\nThe mappings are kept as cmap as upcalls will sometimes query them before\nenqueuing orders to the offload threads.\n\nTo prepare this change, move the mappings within the offload thread\nstructure.\n\nSigned-off-by: Gaetan Rivet <grive@u256.net>\nReviewed-by: Eli Britstein <elibr@nvidia.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/dpif-netdev.c | 45 +++++++++++++++++++++------------------------\n 1 file changed, 21 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c\nindex 4e91926fd..365726ed5 100644\n--- a/lib/dpif-netdev.c\n+++ b/lib/dpif-netdev.c\n@@ -376,12 +376,16 @@ struct dp_offload_thread_item {\n struct dp_offload_thread {\n     struct mpsc_queue queue;\n     atomic_uint64_t enqueued_item;\n+    struct cmap megaflow_to_mark;\n+    struct cmap mark_to_flow;\n     struct mov_avg_cma cma;\n     struct mov_avg_ema ema;\n };\n \n static struct dp_offload_thread dp_offload_thread = {\n     .queue = MPSC_QUEUE_INITIALIZER(&dp_offload_thread.queue),\n+    .megaflow_to_mark = CMAP_INITIALIZER,\n+    .mark_to_flow = CMAP_INITIALIZER,\n     .enqueued_item = ATOMIC_VAR_INIT(0),\n     .cma = MOV_AVG_CMA_INITIALIZER,\n     .ema = MOV_AVG_EMA_INITIALIZER(100),\n@@ -2368,32 +2372,23 @@ struct megaflow_to_mark_data {\n     uint32_t mark;\n };\n \n-struct flow_mark {\n-    struct cmap megaflow_to_mark;\n-    struct cmap mark_to_flow;\n-    struct id_fpool *pool;\n-};\n-\n-static struct flow_mark flow_mark = {\n-    .megaflow_to_mark = CMAP_INITIALIZER,\n-    .mark_to_flow = CMAP_INITIALIZER,\n-};\n+static struct id_fpool *flow_mark_pool;\n \n static uint32_t\n flow_mark_alloc(void)\n {\n-    static struct ovsthread_once pool_init = OVSTHREAD_ONCE_INITIALIZER;\n+    static struct ovsthread_once init_once = OVSTHREAD_ONCE_INITIALIZER;\n     unsigned int tid = netdev_offload_thread_id();\n     uint32_t mark;\n \n-    if (ovsthread_once_start(&pool_init)) {\n+    if (ovsthread_once_start(&init_once)) {\n         /* Haven't initiated yet, do it here */\n-        flow_mark.pool = id_fpool_create(netdev_offload_thread_nb(),\n+        flow_mark_pool = id_fpool_create(netdev_offload_thread_nb(),\n                                          1, MAX_FLOW_MARK);\n-        ovsthread_once_done(&pool_init);\n+        ovsthread_once_done(&init_once);\n     }\n \n-    if (id_fpool_new_id(flow_mark.pool, tid, &mark)) {\n+    if (id_fpool_new_id(flow_mark_pool, tid, &mark)) {\n         return mark;\n     }\n \n@@ -2405,7 +2400,7 @@ flow_mark_free(uint32_t mark)\n {\n     unsigned int tid = netdev_offload_thread_id();\n \n-    id_fpool_free_id(flow_mark.pool, tid, mark);\n+    id_fpool_free_id(flow_mark_pool, tid, mark);\n }\n \n /* associate megaflow with a mark, which is a 1:1 mapping */\n@@ -2418,7 +2413,7 @@ megaflow_to_mark_associate(const ovs_u128 *mega_ufid, uint32_t mark)\n     data->mega_ufid = *mega_ufid;\n     data->mark = mark;\n \n-    cmap_insert(&flow_mark.megaflow_to_mark,\n+    cmap_insert(&dp_offload_thread.megaflow_to_mark,\n                 CONST_CAST(struct cmap_node *, &data->node), hash);\n }\n \n@@ -2429,9 +2424,10 @@ megaflow_to_mark_disassociate(const ovs_u128 *mega_ufid)\n     size_t hash = dp_netdev_flow_hash(mega_ufid);\n     struct megaflow_to_mark_data *data;\n \n-    CMAP_FOR_EACH_WITH_HASH (data, node, hash, &flow_mark.megaflow_to_mark) {\n+    CMAP_FOR_EACH_WITH_HASH (data, node, hash,\n+                             &dp_offload_thread.megaflow_to_mark) {\n         if (ovs_u128_equals(*mega_ufid, data->mega_ufid)) {\n-            cmap_remove(&flow_mark.megaflow_to_mark,\n+            cmap_remove(&dp_offload_thread.megaflow_to_mark,\n                         CONST_CAST(struct cmap_node *, &data->node), hash);\n             ovsrcu_postpone(free, data);\n             return;\n@@ -2448,7 +2444,8 @@ megaflow_to_mark_find(const ovs_u128 *mega_ufid)\n     size_t hash = dp_netdev_flow_hash(mega_ufid);\n     struct megaflow_to_mark_data *data;\n \n-    CMAP_FOR_EACH_WITH_HASH (data, node, hash, &flow_mark.megaflow_to_mark) {\n+    CMAP_FOR_EACH_WITH_HASH (data, node, hash,\n+                             &dp_offload_thread.megaflow_to_mark) {\n         if (ovs_u128_equals(*mega_ufid, data->mega_ufid)) {\n             return data->mark;\n         }\n@@ -2465,7 +2462,7 @@ mark_to_flow_associate(const uint32_t mark, struct dp_netdev_flow *flow)\n {\n     dp_netdev_flow_ref(flow);\n \n-    cmap_insert(&flow_mark.mark_to_flow,\n+    cmap_insert(&dp_offload_thread.mark_to_flow,\n                 CONST_CAST(struct cmap_node *, &flow->mark_node),\n                 hash_int(mark, 0));\n     flow->mark = mark;\n@@ -2480,7 +2477,7 @@ flow_mark_has_no_ref(uint32_t mark)\n     struct dp_netdev_flow *flow;\n \n     CMAP_FOR_EACH_WITH_HASH (flow, mark_node, hash_int(mark, 0),\n-                             &flow_mark.mark_to_flow) {\n+                             &dp_offload_thread.mark_to_flow) {\n         if (flow->mark == mark) {\n             return false;\n         }\n@@ -2505,7 +2502,7 @@ mark_to_flow_disassociate(struct dp_netdev_pmd_thread *pmd,\n         return EINVAL;\n     }\n \n-    cmap_remove(&flow_mark.mark_to_flow, mark_node, hash_int(mark, 0));\n+    cmap_remove(&dp_offload_thread.mark_to_flow, mark_node, hash_int(mark, 0));\n     flow->mark = INVALID_FLOW_MARK;\n \n     /*\n@@ -2544,7 +2541,7 @@ mark_to_flow_find(const struct dp_netdev_pmd_thread *pmd,\n     struct dp_netdev_flow *flow;\n \n     CMAP_FOR_EACH_WITH_HASH (flow, mark_node, hash_int(mark, 0),\n-                             &flow_mark.mark_to_flow) {\n+                             &dp_offload_thread.mark_to_flow) {\n         if (flow->mark == mark && flow->pmd_id == pmd->core_id &&\n             flow->dead == false) {\n             return flow;\n",
    "prefixes": [
        "ovs-dev",
        "v5",
        "24/27"
    ]
}