get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 851737,
    "url": "http://patchwork.ozlabs.org/api/patches/851737/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20171220160436.15288-1-alice.michael@intel.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": "<20171220160436.15288-1-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2017-12-20T16:04:36",
    "name": "i40e: don't remove netdev->dev_addr when syncing uc list",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "508f13df41e53bf40a9d06bccacba4b8acd5f4c8",
    "submitter": {
        "id": 71123,
        "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api",
        "name": "Michael, Alice",
        "email": "alice.michael@intel.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/20171220160436.15288-1-alice.michael@intel.com/mbox/",
    "series": [
        {
            "id": 19760,
            "url": "http://patchwork.ozlabs.org/api/series/19760/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=19760",
            "date": "2017-12-20T16:04:36",
            "name": "i40e: don't remove netdev->dev_addr when syncing uc list",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/19760/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/851737/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/851737/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3z2Brh26j2z9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Dec 2017 11:11:31 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 6976C302B1;\n\tThu, 21 Dec 2017 00:11:29 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id mfFlqup3wrV3; Thu, 21 Dec 2017 00:11:28 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 52FE52ED02;\n\tThu, 21 Dec 2017 00:11:28 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id AECBD1C0340\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Dec 2017 00:11:26 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9A0F488248\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Dec 2017 00:11:26 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id CqvoPeSW0S-f for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Dec 2017 00:11:25 +0000 (UTC)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 983DF8735C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Dec 2017 00:11:25 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Dec 2017 16:11:24 -0800",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby orsmga001.jf.intel.com with ESMTP; 20 Dec 2017 16:11:24 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.45,434,1508828400\"; d=\"scan'208\";a=\"17744129\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 20 Dec 2017 11:04:36 -0500",
        "Message-Id": "<20171220160436.15288-1-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "Subject": "[Intel-wired-lan] [PATCH] i40e: don't remove netdev->dev_addr when\n\tsyncing uc list",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nIn some circumstances, such as with bridging, it is possible that the\nstack will add a devices own MAC address to its unicast address list.\n\nIf, later, the stack deletes this address, then the i40e driver will\nreceive a request to remove this address.\n\nThe driver stores its current MAC address as part of the MAC/VLAN hash\narray, since it is convenient and matches exactly how the hardware\nexpects to be told which traffic to receive.\n\nThis causes a problem, since for more devices, the MAC address is stored\nseparately, and requests to delete a unicast address should not have the\nability to remove the filter for the MAC address.\n\nFix this by forcing a check on every address sync to ensure we do not\nremove the device address.\n\nThere is a very narrow possibility of a race between .set_mac and\n.set_rx_mode, if we don't change netdev->dev_addr before updating our\ninternal MAC list in .set_mac. This might be possible if .set_rx_mode is\ngoing to remove MAC \"XYZ\" from the list, at the same time as .set_mac\nchanges our dev_addr to MAC \"XYZ\", we might possibly queue a delete,\nthen an add in .set_mac, then queue a delete in .set_rx_mode's\ndev_uc_sync and then update netdev->dev_addr. We can avoid this by\nmoving the copy into dev_addr prior to the changes to the MAC filter\nlist.\n\nA similar race on the other side does not cause problems, as if we're\nchanging our MAC form A to B, and we race with .set_rx_mode, it could\nqueue a delete from A, we'd update our address, and allow the delete.\nThis seems like a race, but in reality we're about to queue a delete of\nA anyways, so it would not cause any issues.\n\nA race in the initialization code is unlikely because the netdevice has\nnot yet been fully initialized and the stack should not be adding or\nremoving addresses yet.\n\nNote that we don't (yet) need similar code for the VF driver because it\ndoes not make use of __dev_uc_sync and __dev_mc_sync, but instead roles\nits own method for handling updates to the MAC/VLAN list, which already\nhas code to protect against removal of the hardware address.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 17 ++++++++++++++++-\n 1 file changed, 16 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 5c5296e..c971339d 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -1573,11 +1573,18 @@ static int i40e_set_mac(struct net_device *netdev, void *p)\n \telse\n \t\tnetdev_info(netdev, \"set new mac address %pM\\n\", addr->sa_data);\n \n+\t/* Copy the address first, so that we avoid a possible race with\n+\t * .set_rx_mode(). If we copy after changing the address in the filter\n+\t * list, we might open ourselves to a narrow race window where\n+\t * .set_rx_mode could delete our dev_addr filter and prevent traffic\n+\t * from passing.\n+\t */\n+\tether_addr_copy(netdev->dev_addr, addr->sa_data);\n+\n \tspin_lock_bh(&vsi->mac_filter_hash_lock);\n \ti40e_del_mac_filter(vsi, netdev->dev_addr);\n \ti40e_add_mac_filter(vsi, addr->sa_data);\n \tspin_unlock_bh(&vsi->mac_filter_hash_lock);\n-\tether_addr_copy(netdev->dev_addr, addr->sa_data);\n \tif (vsi->type == I40E_VSI_MAIN) {\n \t\ti40e_status ret;\n \n@@ -1923,6 +1930,14 @@ static int i40e_addr_unsync(struct net_device *netdev, const u8 *addr)\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n \tstruct i40e_vsi *vsi = np->vsi;\n \n+\t/* Under some circumstances, we might receive a request to delete\n+\t * our own device address from our uc list. Because we store the\n+\t * device address in the VSI's MAC/VLAN filter list, we need to ignore\n+\t * such requests and not delete our device address from this list.\n+\t */\n+\tif (ether_addr_equal(addr, netdev->dev_addr))\n+\t\treturn 0;\n+\n \ti40e_del_mac_filter(vsi, addr);\n \n \treturn 0;\n",
    "prefixes": []
}