get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 810323,
    "url": "http://patchwork.ozlabs.org/api/patches/810323/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1504654510-31004-9-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": "<1504654510-31004-9-git-send-email-andrew@lunn.ch>",
    "list_archive_url": null,
    "date": "2017-09-05T23:35:10",
    "name": "[v2,rfc,8/8] net: dsa: Fix SWITCHDEV_ATTR_ID_PORT_PARENT_ID",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "8ca570d40a5d281dc544ab992d1701b1d66bcc51",
    "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/1504654510-31004-9-git-send-email-andrew@lunn.ch/mbox/",
    "series": [
        {
            "id": 1666,
            "url": "http://patchwork.ozlabs.org/api/series/1666/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1666",
            "date": "2017-09-05T23:35:04",
            "name": "IGMP snooping for local traffic",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/1666/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/810323/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/810323/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 3xn35z4r3zz9s83\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  6 Sep 2017 09:37:11 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754072AbdIEXhJ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 5 Sep 2017 19:37:09 -0400",
            "from vps0.lunn.ch ([178.209.37.122]:58213 \"EHLO vps0.lunn.ch\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753545AbdIEXhH (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 5 Sep 2017 19:37:07 -0400",
            "from andrew by vps0.lunn.ch with local (Exim 4.84_2)\n\t(envelope-from <andrew@lunn.ch>)\n\tid 1dpNNG-00085H-KJ; Wed, 06 Sep 2017 01:35:18 +0200"
        ],
        "From": "Andrew Lunn <andrew@lunn.ch>",
        "To": "netdev <netdev@vger.kernel.org>",
        "Cc": "jiri@resnulli.us, nikolay@cumulusnetworks.com,\n\tFlorian Fainelli <f.fainelli@gmail.com>,\n\tVivien Didelot <vivien.didelot@savoirfairelinux.com>,\n\tAndrew Lunn <andrew@lunn.ch>",
        "Subject": "[PATCH v2 rfc 8/8] net: dsa: Fix SWITCHDEV_ATTR_ID_PORT_PARENT_ID",
        "Date": "Wed,  6 Sep 2017 01:35:10 +0200",
        "Message-Id": "<1504654510-31004-9-git-send-email-andrew@lunn.ch>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1504654510-31004-1-git-send-email-andrew@lunn.ch>",
        "References": "<1504654510-31004-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 MAC address of the master interface as the parent ID. This is\nthe same for all switches in a cluster, and should be unique if there\nare multiple clusters.\n\nSigned-off-by: Andrew Lunn <andrew@lunn.ch>\n---\n net/dsa/slave.c | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/net/dsa/slave.c b/net/dsa/slave.c\nindex 2e07be149415..d2744b0dad6e 100644\n--- a/net/dsa/slave.c\n+++ b/net/dsa/slave.c\n@@ -374,13 +374,15 @@ 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 net_device *master = dsa_master_netdev(p);\n+\n+\t\tattr->u.ppid.id_len = ETH_ALEN;\n+\t\tether_addr_copy(attr->u.ppid.id, master->dev_addr);\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": [
        "v2",
        "rfc",
        "8/8"
    ]
}