get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 540216,
    "url": "http://patchwork.ozlabs.org/api/patches/540216/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20151104232100.GJ14575@oracle.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20151104232100.GJ14575@oracle.com>",
    "list_archive_url": null,
    "date": "2015-11-04T23:21:00",
    "name": "[v6] i40e: Look up MAC address in Open Firmware or IDPROM",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "82632f26477645d772516261fd87d15299ae2f5c",
    "submitter": {
        "id": 64444,
        "url": "http://patchwork.ozlabs.org/api/people/64444/?format=api",
        "name": "Sowmini Varadhan",
        "email": "sowmini.varadhan@oracle.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20151104232100.GJ14575@oracle.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/540216/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/540216/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id 731E71413DD\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  5 Nov 2015 10:21:14 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 7178C8B6FB;\n\tWed,  4 Nov 2015 23:21:13 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Yu7dWNh-KguU; Wed,  4 Nov 2015 23:21:12 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 9281D8B950;\n\tWed,  4 Nov 2015 23:21:12 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id E79961C0DB0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  4 Nov 2015 23:21:11 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id E2F4793C3B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  4 Nov 2015 23:21:11 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 8aGWaAdBJuBR for <intel-wired-lan@lists.osuosl.org>;\n\tWed,  4 Nov 2015 23:21:11 +0000 (UTC)",
            "from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id ED499939CA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  4 Nov 2015 23:21:10 +0000 (UTC)",
            "from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2)\n\twith ESMTP id tA4NL3jV015738\n\t(version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\n\tWed, 4 Nov 2015 23:21:03 GMT",
            "from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])\n\tby aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id\n\ttA4NL3tS011973\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); \n\tWed, 4 Nov 2015 23:21:03 GMT",
            "from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13])\n\tby aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id\n\ttA4NL36F009509; Wed, 4 Nov 2015 23:21:03 GMT",
            "from oracle.com (/10.154.113.156)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Wed, 04 Nov 2015 15:21:02 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "Date": "Wed, 4 Nov 2015 18:21:00 -0500",
        "From": "Sowmini Varadhan <sowmini.varadhan@oracle.com>",
        "To": "sowmini.varadhan@oracle.com, intel-wired-lan@lists.osuosl.org,\n\tnetdev@vger.kernel.org, linux-kernel@vger.kernel.org",
        "Message-ID": "<20151104232100.GJ14575@oracle.com>",
        "MIME-Version": "1.0",
        "Content-Disposition": "inline",
        "User-Agent": "Mutt/1.5.21 (2010-09-15)",
        "X-Source-IP": "aserv0022.oracle.com [141.146.126.234]",
        "Cc": "andy.shevchenko@gmail.com",
        "Subject": "[Intel-wired-lan] [PATCH v6] i40e: Look up MAC address in Open\n\tFirmware or IDPROM",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "This is the i40e equivalent of commit c762dff24c06 (\"ixgbe: Look up MAC\naddress in Open Firmware or IDPROM\").\n\nAs with that fix, attempt to look up the MAC address in Open Firmware\non systems that support it, and use IDPROM on SPARC if no OF address\nis found.\n\nIn the case of the i40e there is an assumption that the default mac\naddress has already been set up as the primary mac filter on probe,\nso if this filter is obtained from the Open Firmware or IDPROM, an\nexplicit write is needed via i40e_aq_mac_address_write() and\ni40e_aq_add_macvlan() invocation.\n\nReviewed-by: Martin K. Petersen <martin.petersen@oracle.com>\nSigned-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>\n---\nv2, v3: Andy Shevchenko comments\nv4: Shannon Nelson review: explicitly set up mac filters before register_netdev\nv5: Shannon Nelson code style comments\nv6: Shannon Nelson code style comments\n\n drivers/net/ethernet/intel/i40e/i40e_main.c |   83 ++++++++++++++++++++++++++-\n 1 files changed, 82 insertions(+), 1 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex b825f97..e355873 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -24,6 +24,15 @@\n  *\n  ******************************************************************************/\n \n+#include <linux/etherdevice.h>\n+#include <linux/of_net.h>\n+#include <linux/pci.h>\n+\n+#ifdef CONFIG_SPARC\n+#include <asm/idprom.h>\n+#include <asm/prom.h>\n+#endif\n+\n /* Local includes */\n #include \"i40e.h\"\n #include \"i40e_diag.h\"\n@@ -9213,6 +9222,44 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n }\n \n /**\n+ * i40e_macaddr_init - explicitly write the mac address filters.\n+ *\n+ * @vsi: pointer to the vsi.\n+ * @macaddr: the MAC address\n+ *\n+ * This is needed when the macaddr has been obtained by other\n+ * means than the default, e.g., from Open Firmware or IDPROM.\n+ * Returns 0 on success, negative on failure\n+ **/\n+static int i40e_macaddr_init(struct i40e_vsi *vsi, u8 *macaddr)\n+{\n+\tint ret, aq_err;\n+\tstruct i40e_aqc_add_macvlan_element_data element;\n+\n+\tret = i40e_aq_mac_address_write(&vsi->back->hw,\n+\t\t\t\t\tI40E_AQC_WRITE_TYPE_LAA_WOL,\n+\t\t\t\t\tmacaddr, NULL);\n+\tif (ret) {\n+\t\tdev_info(&vsi->back->pdev->dev,\n+\t\t\t \"Addr change for VSI failed: %d\\n\", ret);\n+\t\treturn -EADDRNOTAVAIL;\n+\t}\n+\n+\tmemset(&element, 0, sizeof(element));\n+\tether_addr_copy(element.mac_addr, macaddr);\n+\telement.flags = cpu_to_le16(I40E_AQC_MACVLAN_ADD_PERFECT_MATCH);\n+\tret = i40e_aq_add_macvlan(&vsi->back->hw, vsi->seid, &element, 1, NULL);\n+\taq_err = vsi->back->hw.aq.asq_last_status;\n+\tif (aq_err != I40E_AQ_RC_OK) {\n+\t\tdev_info(&vsi->back->pdev->dev,\n+\t\t\t \"add filter failed err %s aq_err %s\\n\",\n+\t\t\t i40e_stat_str(&vsi->back->hw, ret),\n+\t\t\t i40e_aq_str(&vsi->back->hw, aq_err));\n+\t}\n+\treturn ret;\n+}\n+\n+/**\n  * i40e_vsi_setup - Set up a VSI by a given type\n  * @pf: board private structure\n  * @type: VSI type\n@@ -9341,6 +9388,9 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,\n \t\tret = i40e_config_netdev(vsi);\n \t\tif (ret)\n \t\t\tgoto err_netdev;\n+\t\tret = i40e_macaddr_init(vsi, pf->hw.mac.addr);\n+\t\tif (ret)\n+\t\t\tgoto err_netdev;\n \t\tret = register_netdev(vsi->netdev);\n \t\tif (ret)\n \t\t\tgoto err_netdev;\n@@ -10163,6 +10213,35 @@ static void i40e_print_features(struct i40e_pf *pf)\n }\n \n /**\n+ * i40e_get_platform_mac_addr - get platform-specific MAC address\n+ *\n+ * @pdev: PCI device information struct\n+ * @mac_addr: the MAC address to be returned\n+ *\n+ * Look up the MAC address in Open Firmware  on systems that support it,\n+ * and use IDPROM on SPARC if no OF address is found.\n+ *\n+ * Returns 0 on success, negative on failure\n+ **/\n+static int i40e_get_platform_mac_addr(struct pci_dev *pdev, u8 *mac_addr)\n+{\n+\tstruct device_node *dp = pci_device_to_OF_node(pdev);\n+\tconst unsigned char *addr;\n+\n+\taddr = of_get_mac_address(dp);\n+\tif (addr) {\n+\t\tether_addr_copy(mac_addr, addr);\n+\t\treturn 0;\n+\t}\n+#ifdef CONFIG_SPARC\n+\tether_addr_copy(mac_addr, idprom->id_ethaddr);\n+\treturn 0;\n+#else\n+\treturn -EINVAL;\n+#endif /* CONFIG_SPARC */\n+}\n+\n+/**\n  * i40e_probe - Device initialization routine\n  * @pdev: PCI device information struct\n  * @ent: entry in i40e_pci_tbl\n@@ -10360,7 +10439,9 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t\ti40e_aq_stop_lldp(hw, true, NULL);\n \t}\n \n-\ti40e_get_mac_addr(hw, hw->mac.addr);\n+\terr = i40e_get_platform_mac_addr(pdev, hw->mac.addr);\n+\tif (err)\n+\t\ti40e_get_mac_addr(hw, hw->mac.addr);\n \tif (!is_valid_ether_addr(hw->mac.addr)) {\n \t\tdev_info(&pdev->dev, \"invalid MAC address %pM\\n\", hw->mac.addr);\n \t\terr = -EIO;\n",
    "prefixes": [
        "v6"
    ]
}