get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 818847,
    "url": "http://patchwork.ozlabs.org/api/patches/818847/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1506464764-12699-2-git-send-email-andrew@lunn.ch/",
    "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": "<1506464764-12699-2-git-send-email-andrew@lunn.ch>",
    "list_archive_url": null,
    "date": "2017-09-26T22:25:58",
    "name": "[net-next,1/6] net: dsa: Fix SWITCHDEV_ATTR_ID_PORT_PARENT_ID",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "df3ae52de3b46bb7e6f37d20d17c1ac89cb3360b",
    "submitter": {
        "id": 13608,
        "url": "http://patchwork.ozlabs.org/api/people/13608/?format=api",
        "name": "Andrew Lunn",
        "email": "andrew@lunn.ch"
    },
    "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/1506464764-12699-2-git-send-email-andrew@lunn.ch/mbox/",
    "series": [
        {
            "id": 5236,
            "url": "http://patchwork.ozlabs.org/api/series/5236/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=5236",
            "date": "2017-09-26T22:26:00",
            "name": "mv88e6xxx broadcast flooding in hardware",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/5236/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/818847/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/818847/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>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y1wbb57QRz9s3T\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 27 Sep 2017 08:28:59 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1031135AbdIZW26 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 26 Sep 2017 18:28:58 -0400",
            "from vps0.lunn.ch ([185.16.172.187]:57031 \"EHLO vps0.lunn.ch\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1031080AbdIZW25 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 26 Sep 2017 18:28:57 -0400",
            "from andrew by vps0.lunn.ch with local (Exim 4.84_2)\n\t(envelope-from <andrew@lunn.ch>)\n\tid 1dwyIq-0003JT-Qj; Wed, 27 Sep 2017 00:26:08 +0200"
        ],
        "From": "Andrew Lunn <andrew@lunn.ch>",
        "To": "David Miller <davem@davemloft.net>",
        "Cc": "Vivien Didelot <vivien.didelot@savoirfairelinux.com>,\n\tnetdev <netdev@vger.kernel.org>, Andrew Lunn <andrew@lunn.ch>",
        "Subject": "[PATCH net-next 1/6] net: dsa: Fix SWITCHDEV_ATTR_ID_PORT_PARENT_ID",
        "Date": "Wed, 27 Sep 2017 00:25:58 +0200",
        "Message-Id": "<1506464764-12699-2-git-send-email-andrew@lunn.ch>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1506464764-12699-1-git-send-email-andrew@lunn.ch>",
        "References": "<1506464764-12699-1-git-send-email-andrew@lunn.ch>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "SWITCHDEV_ATTR_ID_PORT_PARENT_ID is used by the software bridge when\ndetermining which ports to flood a packet out. If the packet\noriginated from a switch, it assumes the switch has already flooded\nthe packet out the switches ports, so the bridge should not flood the\npacket itself out switch ports. Ports on the same switch are expected\nto return the same parent ID when SWITCHDEV_ATTR_ID_PORT_PARENT_ID is\ncalled.\n\nDSA gets this wrong with clusters of switches. As far as the software\nbridge is concerned, the cluster is all one switch. A packet from any\nswitch in the cluster can be assumed to of been flooded as needed out\nall ports of the cluster, not just the switch it originated\nfrom. Hence all ports of a cluster should return the same parent. The\nold implementation did not, each switch in the cluster had its own ID.\n\nAlso wrong was that the ID was not unique if multiple DSA instances\nare in operation.\n\nUse the tree ID as the parent ID, which is the same for all switches\nin a cluster and unique across switch clusters.\n\nSigned-off-by: Andrew Lunn <andrew@lunn.ch>\n---\nv2: Swap from MAC address to dst->tree\n---\n net/dsa/slave.c | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/net/dsa/slave.c b/net/dsa/slave.c\nindex bd51ef56ec5b..ee72aa164956 100644\n--- a/net/dsa/slave.c\n+++ b/net/dsa/slave.c\n@@ -354,13 +354,16 @@ static int dsa_slave_port_attr_get(struct net_device *dev,\n \t\t\t\t   struct switchdev_attr *attr)\n {\n \tstruct dsa_slave_priv *p = netdev_priv(dev);\n-\tstruct dsa_switch *ds = p->dp->ds;\n \n \tswitch (attr->id) {\n-\tcase SWITCHDEV_ATTR_ID_PORT_PARENT_ID:\n-\t\tattr->u.ppid.id_len = sizeof(ds->index);\n-\t\tmemcpy(&attr->u.ppid.id, &ds->index, attr->u.ppid.id_len);\n+\tcase SWITCHDEV_ATTR_ID_PORT_PARENT_ID: {\n+\t\tstruct dsa_switch *ds = p->dp->ds;\n+\t\tstruct dsa_switch_tree *dst = ds->dst;\n+\n+\t\tattr->u.ppid.id_len = sizeof(dst->tree);\n+\t\tmemcpy(&attr->u.ppid.id, &dst->tree, sizeof(dst->tree));\n \t\tbreak;\n+\t}\n \tcase SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:\n \t\tattr->u.brport_flags_support = 0;\n \t\tbreak;\n",
    "prefixes": [
        "net-next",
        "1/6"
    ]
}