get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 864501,
    "url": "http://patchwork.ozlabs.org/api/patches/864501/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180122170039.14144-7-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": "<20180122170039.14144-7-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2018-01-22T17:00:38",
    "name": "[next,S86-V2,7/8] i40evf: use __dev_[um]c_sync routines in .set_rx_mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b538d811f07de1ec35ed80e5113073ca4db32112",
    "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/20180122170039.14144-7-alice.michael@intel.com/mbox/",
    "series": [
        {
            "id": 24794,
            "url": "http://patchwork.ozlabs.org/api/series/24794/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=24794",
            "date": "2018-01-22T17:00:32",
            "name": "[next,S86-V2,1/8] i40e: don't leak memory addresses",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/24794/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/864501/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/864501/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.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3zQVXv2RRsz9sRm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 23 Jan 2018 12:08:15 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6806A89476;\n\tTue, 23 Jan 2018 01:08:13 +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 DvEneIZdC2sU; Tue, 23 Jan 2018 01:08:10 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C3CAA893EF;\n\tTue, 23 Jan 2018 01:08:10 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8AD011C006F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Jan 2018 01:08:07 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 8738030109\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Jan 2018 01:08:07 +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 tXh1YHQ2TCRQ for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Jan 2018 01:08:06 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id AC6C73016F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Jan 2018 01:08:06 +0000 (UTC)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Jan 2018 17:08:05 -0800",
            "from alicemic-2.jf.intel.com ([10.166.16.121])\n\tby fmsmga007.fm.intel.com with ESMTP; 22 Jan 2018 17:08:05 -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.46,398,1511856000\"; d=\"scan'208\";a=\"12244800\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 22 Jan 2018 12:00:38 -0500",
        "Message-Id": "<20180122170039.14144-7-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20180122170039.14144-1-alice.michael@intel.com>",
        "References": "<20180122170039.14144-1-alice.michael@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S86-V2 7/8] i40evf: use\n\t__dev_[um]c_sync routines in .set_rx_mode",
        "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\nSimilar to changes done to the PF driver in commit 6622f5cdbaf3 (\"i40e:\nmake use of __dev_uc_sync and __dev_mc_sync\"), replace our\nhome-rolled method for updating the internal status of MAC filters with\n__dev_uc_sync and __dev_mc_sync.\n\nThese new functions use internal state within the netdev struct in order\nto efficiently break the question of \"which filters in this list need to\nbe added or removed\" into singular \"add this filter\" and \"delete this\nfilter\" requests.\n\nThis vastly improves our handling of .set_rx_mode especially with large\nnumber of MAC filters being added to the device, and even results in\na simpler .set_rx_mode handler.\n\nUnder some circumstances, such as when attached to a bridge, we may\nreceive a request to delete our own permanent address. Prevent deletion\nof this address during i40evf_addr_unsync so that we don't accidentally\nstop receiving traffic.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40evf/i40evf_main.c | 95 +++++++++++++++----------\n 1 file changed, 56 insertions(+), 39 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 7822607..8741ca74 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -785,7 +785,7 @@ static int i40evf_vlan_rx_kill_vid(struct net_device *netdev,\n  **/\n static struct\n i40evf_mac_filter *i40evf_find_filter(struct i40evf_adapter *adapter,\n-\t\t\t\t      u8 *macaddr)\n+\t\t\t\t      const u8 *macaddr)\n {\n \tstruct i40evf_mac_filter *f;\n \n@@ -808,7 +808,7 @@ i40evf_mac_filter *i40evf_find_filter(struct i40evf_adapter *adapter,\n  **/\n static struct\n i40evf_mac_filter *i40evf_add_filter(struct i40evf_adapter *adapter,\n-\t\t\t\t     u8 *macaddr)\n+\t\t\t\t     const u8 *macaddr)\n {\n \tstruct i40evf_mac_filter *f;\n \n@@ -880,50 +880,64 @@ static int i40evf_set_mac(struct net_device *netdev, void *p)\n }\n \n /**\n- * i40evf_set_rx_mode - NDO callback to set the netdev filters\n- * @netdev: network interface device structure\n- **/\n-static void i40evf_set_rx_mode(struct net_device *netdev)\n+ * i40evf_addr_sync - Callback for dev_(mc|uc)_sync to add address\n+ * @netdev: the netdevice\n+ * @addr: address to add\n+ *\n+ * Called by __dev_(mc|uc)_sync when an address needs to be added. We call\n+ * __dev_(uc|mc)_sync from .set_rx_mode and guarantee to hold the hash lock.\n+ */\n+static int i40evf_addr_sync(struct net_device *netdev, const u8 *addr)\n {\n \tstruct i40evf_adapter *adapter = netdev_priv(netdev);\n-\tstruct i40evf_mac_filter *f, *ftmp;\n-\tstruct netdev_hw_addr *uca;\n-\tstruct netdev_hw_addr *mca;\n-\tstruct netdev_hw_addr *ha;\n-\n-\t/* add addr if not already in the filter list */\n-\tnetdev_for_each_uc_addr(uca, netdev) {\n-\t\ti40evf_add_filter(adapter, uca->addr);\n-\t}\n-\tnetdev_for_each_mc_addr(mca, netdev) {\n-\t\ti40evf_add_filter(adapter, mca->addr);\n-\t}\n-\n-\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n \n-\tlist_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {\n-\t\tnetdev_for_each_mc_addr(mca, netdev)\n-\t\t\tif (ether_addr_equal(mca->addr, f->macaddr))\n-\t\t\t\tgoto bottom_of_search_loop;\n-\n-\t\tnetdev_for_each_uc_addr(uca, netdev)\n-\t\t\tif (ether_addr_equal(uca->addr, f->macaddr))\n-\t\t\t\tgoto bottom_of_search_loop;\n+\tif (i40evf_add_filter(adapter, addr))\n+\t\treturn 0;\n+\telse\n+\t\treturn -ENOMEM;\n+}\n \n-\t\tfor_each_dev_addr(netdev, ha)\n-\t\t\tif (ether_addr_equal(ha->addr, f->macaddr))\n-\t\t\t\tgoto bottom_of_search_loop;\n+/**\n+ * i40evf_addr_unsync - Callback for dev_(mc|uc)_sync to remove address\n+ * @netdev: the netdevice\n+ * @addr: address to add\n+ *\n+ * Called by __dev_(mc|uc)_sync when an address needs to be removed. We call\n+ * __dev_(uc|mc)_sync from .set_rx_mode and guarantee to hold the hash lock.\n+ */\n+static int i40evf_addr_unsync(struct net_device *netdev, const u8 *addr)\n+{\n+\tstruct i40evf_adapter *adapter = netdev_priv(netdev);\n+\tstruct i40evf_mac_filter *f;\n \n-\t\tif (ether_addr_equal(f->macaddr, adapter->hw.mac.addr))\n-\t\t\tgoto bottom_of_search_loop;\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-\t\t/* f->macaddr wasn't found in uc, mc, or ha list so delete it */\n+\tf = i40evf_find_filter(adapter, addr);\n+\tif (f) {\n \t\tf->remove = true;\n \t\tadapter->aq_required |= I40EVF_FLAG_AQ_DEL_MAC_FILTER;\n-\n-bottom_of_search_loop:\n-\t\tcontinue;\n \t}\n+\treturn 0;\n+}\n+\n+/**\n+ * i40evf_set_rx_mode - NDO callback to set the netdev filters\n+ * @netdev: network interface device structure\n+ **/\n+static void i40evf_set_rx_mode(struct net_device *netdev)\n+{\n+\tstruct i40evf_adapter *adapter = netdev_priv(netdev);\n+\n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\t__dev_uc_sync(netdev, i40evf_addr_sync, i40evf_addr_unsync);\n+\t__dev_mc_sync(netdev, i40evf_addr_sync, i40evf_addr_unsync);\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \n \tif (netdev->flags & IFF_PROMISC &&\n \t    !(adapter->flags & I40EVF_FLAG_PROMISC_ON))\n@@ -938,8 +952,6 @@ static void i40evf_set_rx_mode(struct net_device *netdev)\n \telse if (!(netdev->flags & IFF_ALLMULTI) &&\n \t\t adapter->flags & I40EVF_FLAG_ALLMULTI_ON)\n \t\tadapter->aq_required |= I40EVF_FLAG_AQ_RELEASE_ALLMULTI;\n-\n-\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n }\n \n /**\n@@ -1042,10 +1054,15 @@ void i40evf_down(struct i40evf_adapter *adapter)\n \n \tspin_lock_bh(&adapter->mac_vlan_list_lock);\n \n+\t/* clear the sync flag on all filters */\n+\t__dev_uc_unsync(adapter->netdev, NULL);\n+\t__dev_mc_unsync(adapter->netdev, NULL);\n+\n \t/* remove all MAC filters */\n \tlist_for_each_entry(f, &adapter->mac_filter_list, list) {\n \t\tf->remove = true;\n \t}\n+\n \t/* remove all VLAN filters */\n \tlist_for_each_entry(vlf, &adapter->vlan_filter_list, list) {\n \t\tf->remove = true;\n",
    "prefixes": [
        "next",
        "S86-V2",
        "7/8"
    ]
}