get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 816248,
    "url": "http://patchwork.ozlabs.org/api/patches/816248/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170920141516.1402-5-jiri@resnulli.us/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170920141516.1402-5-jiri@resnulli.us>",
    "list_archive_url": null,
    "date": "2017-09-20T14:15:04",
    "name": "[net-next,04/16] mlxsw: spectrum_switchdev: Save mids list per bridge device",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "da21cf9736d1e16da3b432b2a67073a6275273eb",
    "submitter": {
        "id": 15321,
        "url": "http://patchwork.ozlabs.org/api/people/15321/?format=api",
        "name": "Jiri Pirko",
        "email": "jiri@resnulli.us"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170920141516.1402-5-jiri@resnulli.us/mbox/",
    "series": [
        {
            "id": 4129,
            "url": "http://patchwork.ozlabs.org/api/series/4129/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4129",
            "date": "2017-09-20T14:15:00",
            "name": "mlxsw: Multicast flood update",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4129/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/816248/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/816248/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"tZx9KHdj\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xy1wx25Kmz9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 00:15:29 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751743AbdITOP1 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 10:15:27 -0400",
            "from mail-wm0-f68.google.com ([74.125.82.68]:33823 \"EHLO\n\tmail-wm0-f68.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751463AbdITOPW (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 20 Sep 2017 10:15:22 -0400",
            "by mail-wm0-f68.google.com with SMTP id i131so2586374wma.1\n\tfor <netdev@vger.kernel.org>; Wed, 20 Sep 2017 07:15:21 -0700 (PDT)",
            "from localhost (ip-89-177-125-82.net.upcbroadband.cz.\n\t[89.177.125.82]) by smtp.gmail.com with ESMTPSA id\n\tn57sm2047176wrn.29.2017.09.20.07.15.20\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 20 Sep 2017 07:15:20 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=mtx0oINJuYYMVnX5q4ftyVbXRt8nfbN2xcoFLUuZxmM=;\n\tb=tZx9KHdjZy412RcUqUVwCdlWOxxIZzdwa2mL1YkA/Ge+eetlKXUNv06w6IX1eqU64y\n\tg4TTN62Ph+4Wv9ZIzO0Qa2WLNevKAx8ZrFnqQPbeEDsW4QeAVP3eG2k8LQPGfpGfMhZO\n\t0dJc4GlXR9dLoi69w+xMAS+c54zcrYv/by+ut+UqZNORD0v7NKA14VxVtkgo9bsq9eqq\n\tnt522KeKL6dcE7nqbqaDW4S+ymRbcRbybOLjZoaNQicHRO0dYT6w0YWO0SQWOBLLT7k2\n\tq7w9lbC/pWwVdFwtOC3xB2f+2Ct0xuCa5UHW/NnhF3pberHyj4EylAmbjD2CZ7tLof3s\n\tJ7Dg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=mtx0oINJuYYMVnX5q4ftyVbXRt8nfbN2xcoFLUuZxmM=;\n\tb=oTk/Dw9Ci4B9z6Yy2peOsiX+BOm15V4VPmuKhm7zAHgu55xToiqxDdIAklFYUTARGf\n\tFefzTqrP8HE+E0vkAHlEHb9VVivadUt43XMNvylwicRG597gjJbngEh++GZTUQCDSNMd\n\tFpRLud4KHulsofsn4nxBDSNxEN8IkuwFVtmqgwAGkay9iu5wfW/CDklbQtwaQ1kShaut\n\tXI203xPg0oqFz3UrbFuEa1Bs0tcPn9lv4QV2Y2hYpFTU9ZqT+RXXqeI6MNf3ljjvV+o0\n\toVSqPEIItlKTh7v7kRgoVa0ecM/vA5MH2wGhr7KszTFKOw5hJr1DudYznpRSU6GgHKmO\n\tk65w==",
        "X-Gm-Message-State": "AHPjjUj/wQc/trSFOJoKhMBIsNuSl/R6+wKaew6ttKiea1VVdaOIdFMz\n\ttwOP9vemgc/JoFlbiYi+DUwsQJV3",
        "X-Google-Smtp-Source": "AOwi7QCZkmJc6RpVajJgrtbWgaNkLQKcrCBFQbITuNNAbwSi03u6ZgOPADe49ffcJQU7N3RxGsRSNA==",
        "X-Received": "by 10.28.52.8 with SMTP id b8mr1446452wma.134.1505916920903;\n\tWed, 20 Sep 2017 07:15:20 -0700 (PDT)",
        "From": "Jiri Pirko <jiri@resnulli.us>",
        "To": "netdev@vger.kernel.org",
        "Cc": "davem@davemloft.net, nogahf@mellanox.com, idosch@mellanox.com,\n\tmlxsw@mellanox.com",
        "Subject": "[patch net-next 04/16] mlxsw: spectrum_switchdev: Save mids list\n\tper bridge device",
        "Date": "Wed, 20 Sep 2017 16:15:04 +0200",
        "Message-Id": "<20170920141516.1402-5-jiri@resnulli.us>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20170920141516.1402-1-jiri@resnulli.us>",
        "References": "<20170920141516.1402-1-jiri@resnulli.us>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Nogah Frankel <nogahf@mellanox.com>\n\nInstead of saving all the mids in the same list, save them per vlan\ndevice. This change allows a more efficient mid find.\nAlso, in the next patches, there will be added a lot of loops over all the\nmids in bridge device for multicast disable, mrouter change and ndb flush.\n\nSigned-off-by: Nogah Frankel <nogahf@mellanox.com>\nSigned-off-by: Jiri Pirko <jiri@mellanox.com>\n---\n .../ethernet/mellanox/mlxsw/spectrum_switchdev.c   | 49 +++++++++++-----------\n 1 file changed, 24 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c\nindex cb2275ed..2ba8a44 100644\n--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c\n+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c\n@@ -67,7 +67,6 @@ struct mlxsw_sp_bridge {\n \tu32 ageing_time;\n \tbool vlan_enabled_exists;\n \tstruct list_head bridges_list;\n-\tstruct list_head mids_list;\n \tDECLARE_BITMAP(mids_bitmap, MLXSW_SP_MID_MAX);\n \tconst struct mlxsw_sp_bridge_ops *bridge_8021q_ops;\n \tconst struct mlxsw_sp_bridge_ops *bridge_8021d_ops;\n@@ -77,6 +76,7 @@ struct mlxsw_sp_bridge_device {\n \tstruct net_device *dev;\n \tstruct list_head list;\n \tstruct list_head ports_list;\n+\tstruct list_head mids_list;\n \tu8 vlan_enabled:1,\n \t   multicast_enabled:1;\n \tconst struct mlxsw_sp_bridge_ops *ops;\n@@ -161,6 +161,7 @@ mlxsw_sp_bridge_device_create(struct mlxsw_sp_bridge *bridge,\n \t} else {\n \t\tbridge_device->ops = bridge->bridge_8021d_ops;\n \t}\n+\tINIT_LIST_HEAD(&bridge_device->mids_list);\n \tlist_add(&bridge_device->list, &bridge->bridges_list);\n \n \treturn bridge_device;\n@@ -170,10 +171,17 @@ static void\n mlxsw_sp_bridge_device_destroy(struct mlxsw_sp_bridge *bridge,\n \t\t\t       struct mlxsw_sp_bridge_device *bridge_device)\n {\n+\tstruct mlxsw_sp_mid *mid, *tmp;\n+\n \tlist_del(&bridge_device->list);\n \tif (bridge_device->vlan_enabled)\n \t\tbridge->vlan_enabled_exists = false;\n \tWARN_ON(!list_empty(&bridge_device->ports_list));\n+\tlist_for_each_entry_safe(mid, tmp, &bridge_device->mids_list, list) {\n+\t\tlist_del(&mid->list);\n+\t\tclear_bit(mid->mid, bridge->mids_bitmap);\n+\t\tkfree(mid);\n+\t}\n \tkfree(bridge_device);\n }\n \n@@ -1221,22 +1229,25 @@ static int mlxsw_sp_port_smid_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 mid,\n \treturn err;\n }\n \n-static struct mlxsw_sp_mid *__mlxsw_sp_mc_get(struct mlxsw_sp *mlxsw_sp,\n-\t\t\t\t\t      const unsigned char *addr,\n-\t\t\t\t\t      u16 fid)\n+static struct\n+mlxsw_sp_mid *__mlxsw_sp_mc_get(struct mlxsw_sp_bridge_device *bridge_device,\n+\t\t\t\tconst unsigned char *addr,\n+\t\t\t\tu16 fid)\n {\n \tstruct mlxsw_sp_mid *mid;\n \n-\tlist_for_each_entry(mid, &mlxsw_sp->bridge->mids_list, list) {\n+\tlist_for_each_entry(mid, &bridge_device->mids_list, list) {\n \t\tif (ether_addr_equal(mid->addr, addr) && mid->fid == fid)\n \t\t\treturn mid;\n \t}\n \treturn NULL;\n }\n \n-static struct mlxsw_sp_mid *__mlxsw_sp_mc_alloc(struct mlxsw_sp *mlxsw_sp,\n-\t\t\t\t\t\tconst unsigned char *addr,\n-\t\t\t\t\t\tu16 fid)\n+static struct\n+mlxsw_sp_mid *__mlxsw_sp_mc_alloc(struct mlxsw_sp *mlxsw_sp,\n+\t\t\t\t  struct mlxsw_sp_bridge_device *bridge_device,\n+\t\t\t\t  const unsigned char *addr,\n+\t\t\t\t  u16 fid)\n {\n \tstruct mlxsw_sp_mid *mid;\n \tsize_t alloc_size;\n@@ -1263,7 +1274,7 @@ static struct mlxsw_sp_mid *__mlxsw_sp_mc_alloc(struct mlxsw_sp *mlxsw_sp,\n \tether_addr_copy(mid->addr, addr);\n \tmid->fid = fid;\n \tmid->mid = mid_idx;\n-\tlist_add_tail(&mid->list, &mlxsw_sp->bridge->mids_list);\n+\tlist_add_tail(&mid->list, &bridge_device->mids_list);\n \n \treturn mid;\n }\n@@ -1316,9 +1327,10 @@ static int mlxsw_sp_port_mdb_add(struct mlxsw_sp_port *mlxsw_sp_port,\n \n \tfid_index = mlxsw_sp_fid_index(mlxsw_sp_port_vlan->fid);\n \n-\tmid = __mlxsw_sp_mc_get(mlxsw_sp, mdb->addr, fid_index);\n+\tmid = __mlxsw_sp_mc_get(bridge_device, mdb->addr, fid_index);\n \tif (!mid) {\n-\t\tmid = __mlxsw_sp_mc_alloc(mlxsw_sp, mdb->addr, fid_index);\n+\t\tmid = __mlxsw_sp_mc_alloc(mlxsw_sp, bridge_device, mdb->addr,\n+\t\t\t\t\t  fid_index);\n \t\tif (!mid) {\n \t\t\tnetdev_err(dev, \"Unable to allocate MC group\\n\");\n \t\t\treturn -ENOMEM;\n@@ -1440,7 +1452,7 @@ static int mlxsw_sp_port_mdb_del(struct mlxsw_sp_port *mlxsw_sp_port,\n \n \tfid_index = mlxsw_sp_fid_index(mlxsw_sp_port_vlan->fid);\n \n-\tmid = __mlxsw_sp_mc_get(mlxsw_sp, mdb->addr, fid_index);\n+\tmid = __mlxsw_sp_mc_get(bridge_device, mdb->addr, fid_index);\n \tif (!mid) {\n \t\tnetdev_err(dev, \"Unable to remove port from MC DB\\n\");\n \t\treturn -EINVAL;\n@@ -1995,17 +2007,6 @@ static void mlxsw_sp_fdb_fini(struct mlxsw_sp *mlxsw_sp)\n \n }\n \n-static void mlxsw_sp_mids_fini(struct mlxsw_sp *mlxsw_sp)\n-{\n-\tstruct mlxsw_sp_mid *mid, *tmp;\n-\n-\tlist_for_each_entry_safe(mid, tmp, &mlxsw_sp->bridge->mids_list, list) {\n-\t\tlist_del(&mid->list);\n-\t\tclear_bit(mid->mid, mlxsw_sp->bridge->mids_bitmap);\n-\t\tkfree(mid);\n-\t}\n-}\n-\n int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp)\n {\n \tstruct mlxsw_sp_bridge *bridge;\n@@ -2017,7 +2018,6 @@ int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp)\n \tbridge->mlxsw_sp = mlxsw_sp;\n \n \tINIT_LIST_HEAD(&mlxsw_sp->bridge->bridges_list);\n-\tINIT_LIST_HEAD(&mlxsw_sp->bridge->mids_list);\n \n \tbridge->bridge_8021q_ops = &mlxsw_sp_bridge_8021q_ops;\n \tbridge->bridge_8021d_ops = &mlxsw_sp_bridge_8021d_ops;\n@@ -2028,7 +2028,6 @@ int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp)\n void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp)\n {\n \tmlxsw_sp_fdb_fini(mlxsw_sp);\n-\tmlxsw_sp_mids_fini(mlxsw_sp);\n \tWARN_ON(!list_empty(&mlxsw_sp->bridge->bridges_list));\n \tkfree(mlxsw_sp->bridge);\n }\n",
    "prefixes": [
        "net-next",
        "04/16"
    ]
}