Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/831545/?format=api
{ "id": 831545, "url": "http://patchwork.ozlabs.org/api/patches/831545/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20171027150656.68250-3-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": "<20171027150656.68250-3-alice.michael@intel.com>", "list_archive_url": null, "date": "2017-10-27T15:06:50", "name": "[next,S81-V3,3/9] i40evf: use spinlock to protect (mac|vlan)_filter_list", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b35a92da7d1ed06d714c7d49cf9e14d0f1f4ddbd", "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/20171027150656.68250-3-alice.michael@intel.com/mbox/", "series": [ { "id": 10681, "url": "http://patchwork.ozlabs.org/api/series/10681/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=10681", "date": "2017-10-27T15:06:48", "name": "[next,S81-V3,1/9] i40e: display priority_xon and priority_xoff stats", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/10681/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/831545/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/831545/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 3yP0651DHqz9t4b\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 28 Oct 2017 10:13:01 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id A41728A417;\n\tFri, 27 Oct 2017 23:12:59 +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 xjQVEM36YW8O; Fri, 27 Oct 2017 23:12:54 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3F5908A428;\n\tFri, 27 Oct 2017 23:12:54 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 09CD51CEF3D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:48 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 052B28A0A9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:48 +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 XZgP7Zf59F4e for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:44 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 4D5BC8A0BC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:43 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Oct 2017 16:12:42 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby fmsmga002.fm.intel.com with ESMTP; 27 Oct 2017 16:12:41 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.44,306,1505804400\"; d=\"scan'208\";\n\ta=\"1236400557\"", "From": "Alice Michael <alice.michael@intel.com>", "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Fri, 27 Oct 2017 11:06:50 -0400", "Message-Id": "<20171027150656.68250-3-alice.michael@intel.com>", "X-Mailer": "git-send-email 2.9.5", "In-Reply-To": "<20171027150656.68250-1-alice.michael@intel.com>", "References": "<20171027150656.68250-1-alice.michael@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S81-V3 3/9] i40evf: use spinlock to\n\tprotect (mac|vlan)_filter_list", "X-BeenThere": "intel-wired-lan@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.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\nStop overloading the __I40EVF_IN_CRITICAL_TASK bit lock to protect the\nmac_filter_list and vlan_filter_list. Instead, implement a spinlock to\nprotect these two lists, similar to how we protect the hash in the i40e\nPF code.\n\nEnsure that every place where we access the list uses the spinlock to\nensure consistency, and stop holding the critical section around blocks\nof code which only need access to the macvlan filter lists.\n\nThis refactor helps simplify the locking behavior, and is necessary as\na future refactor to the __I40EVF_IN_CRITICAL_TASK would cause\na deadlock otherwise.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40evf/i40evf.h | 4 +-\n drivers/net/ethernet/intel/i40evf/i40evf_main.c | 84 +++++++++++-----------\n .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 42 +++++++++--\n 3 files changed, 81 insertions(+), 49 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex de0af52..47040ab 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -199,6 +199,9 @@ struct i40evf_adapter {\n \twait_queue_head_t down_waitqueue;\n \tstruct i40e_q_vector *q_vectors;\n \tstruct list_head vlan_filter_list;\n+\tstruct list_head mac_filter_list;\n+\t/* Lock to protect accesses to MAC and VLAN lists */\n+\tspinlock_t mac_vlan_list_lock;\n \tchar misc_vector_name[IFNAMSIZ + 9];\n \tint num_active_queues;\n \tint num_req_queues;\n@@ -206,7 +209,6 @@ struct i40evf_adapter {\n \t/* TX */\n \tstruct i40e_ring *tx_rings;\n \tu32 tx_timeout_count;\n-\tstruct list_head mac_filter_list;\n \tu32 tx_desc_count;\n \n \t/* RX */\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 320408f..2b135dc 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -706,7 +706,8 @@ static void i40evf_configure_rx(struct i40evf_adapter *adapter)\n * @adapter: board private structure\n * @vlan: vlan tag\n *\n- * Returns ptr to the filter object or NULL\n+ * Returns ptr to the filter object or NULL. Must be called while holding the\n+ * mac_vlan_list_lock.\n **/\n static struct\n i40evf_vlan_filter *i40evf_find_vlan(struct i40evf_adapter *adapter, u16 vlan)\n@@ -731,14 +732,8 @@ static struct\n i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan)\n {\n \tstruct i40evf_vlan_filter *f = NULL;\n-\tint count = 50;\n \n-\twhile (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,\n-\t\t\t\t&adapter->crit_section)) {\n-\t\tudelay(1);\n-\t\tif (--count == 0)\n-\t\t\tgoto out;\n-\t}\n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n \n \tf = i40evf_find_vlan(adapter, vlan);\n \tif (!f) {\n@@ -755,8 +750,7 @@ i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan)\n \t}\n \n clearout:\n-\tclear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);\n-out:\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \treturn f;\n }\n \n@@ -768,21 +762,16 @@ i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan)\n static void i40evf_del_vlan(struct i40evf_adapter *adapter, u16 vlan)\n {\n \tstruct i40evf_vlan_filter *f;\n-\tint count = 50;\n \n-\twhile (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,\n-\t\t\t\t&adapter->crit_section)) {\n-\t\tudelay(1);\n-\t\tif (--count == 0)\n-\t\t\treturn;\n-\t}\n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n \n \tf = i40evf_find_vlan(adapter, vlan);\n \tif (f) {\n \t\tf->remove = true;\n \t\tadapter->aq_required |= I40EVF_FLAG_AQ_DEL_VLAN_FILTER;\n \t}\n-\tclear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);\n+\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n }\n \n /**\n@@ -824,7 +813,8 @@ static int i40evf_vlan_rx_kill_vid(struct net_device *netdev,\n * @adapter: board private structure\n * @macaddr: the MAC address\n *\n- * Returns ptr to the filter object or NULL\n+ * Returns ptr to the filter object or NULL. Must be called while holding the\n+ * mac_vlan_list_lock.\n **/\n static struct\n i40evf_mac_filter *i40evf_find_filter(struct i40evf_adapter *adapter,\n@@ -854,26 +844,17 @@ i40evf_mac_filter *i40evf_add_filter(struct i40evf_adapter *adapter,\n \t\t\t\t u8 *macaddr)\n {\n \tstruct i40evf_mac_filter *f;\n-\tint count = 50;\n \n \tif (!macaddr)\n \t\treturn NULL;\n \n-\twhile (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,\n-\t\t\t\t&adapter->crit_section)) {\n-\t\tudelay(1);\n-\t\tif (--count == 0)\n-\t\t\treturn NULL;\n-\t}\n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n \n \tf = i40evf_find_filter(adapter, macaddr);\n \tif (!f) {\n \t\tf = kzalloc(sizeof(*f), GFP_ATOMIC);\n-\t\tif (!f) {\n-\t\t\tclear_bit(__I40EVF_IN_CRITICAL_TASK,\n-\t\t\t\t &adapter->crit_section);\n-\t\t\treturn NULL;\n-\t\t}\n+\t\tif (!f)\n+\t\t\tgoto clearout;\n \n \t\tether_addr_copy(f->macaddr, macaddr);\n \n@@ -884,7 +865,8 @@ i40evf_mac_filter *i40evf_add_filter(struct i40evf_adapter *adapter,\n \t\tf->remove = false;\n \t}\n \n-\tclear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);\n+clearout:\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \treturn f;\n }\n \n@@ -911,12 +893,16 @@ static int i40evf_set_mac(struct net_device *netdev, void *p)\n \tif (adapter->flags & I40EVF_FLAG_ADDR_SET_BY_PF)\n \t\treturn -EPERM;\n \n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \tf = i40evf_find_filter(adapter, hw->mac.addr);\n \tif (f) {\n \t\tf->remove = true;\n \t\tadapter->aq_required |= I40EVF_FLAG_AQ_DEL_MAC_FILTER;\n \t}\n \n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \tf = i40evf_add_filter(adapter, addr->sa_data);\n \tif (f) {\n \t\tether_addr_copy(hw->mac.addr, addr->sa_data);\n@@ -937,7 +923,6 @@ static void i40evf_set_rx_mode(struct net_device *netdev)\n \tstruct netdev_hw_addr *uca;\n \tstruct netdev_hw_addr *mca;\n \tstruct netdev_hw_addr *ha;\n-\tint count = 50;\n \n \t/* add addr if not already in the filter list */\n \tnetdev_for_each_uc_addr(uca, netdev) {\n@@ -947,16 +932,8 @@ static void i40evf_set_rx_mode(struct net_device *netdev)\n \t\ti40evf_add_filter(adapter, mca->addr);\n \t}\n \n-\twhile (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,\n-\t\t\t\t&adapter->crit_section)) {\n-\t\tudelay(1);\n-\t\tif (--count == 0) {\n-\t\t\tdev_err(&adapter->pdev->dev,\n-\t\t\t\t\"Failed to get lock in %s\\n\", __func__);\n-\t\t\treturn;\n-\t\t}\n-\t}\n-\t/* remove filter if not in netdev list */\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@@ -995,7 +972,7 @@ static void i40evf_set_rx_mode(struct net_device *netdev)\n \t\t adapter->flags & I40EVF_FLAG_ALLMULTI_ON)\n \t\tadapter->aq_required |= I40EVF_FLAG_AQ_RELEASE_ALLMULTI;\n \n-\tclear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n }\n \n /**\n@@ -1094,6 +1071,8 @@ void i40evf_down(struct i40evf_adapter *adapter)\n \ti40evf_napi_disable_all(adapter);\n \ti40evf_irq_disable(adapter);\n \n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \t/* remove all MAC filters */\n \tlist_for_each_entry(f, &adapter->mac_filter_list, list) {\n \t\tf->remove = true;\n@@ -1102,6 +1081,9 @@ void i40evf_down(struct i40evf_adapter *adapter)\n \tlist_for_each_entry(f, &adapter->vlan_filter_list, list) {\n \t\tf->remove = true;\n \t}\n+\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \tif (!(adapter->flags & I40EVF_FLAG_PF_COMMS_FAILED) &&\n \t adapter->state != __I40EVF_RESETTING) {\n \t\t/* cancel any current operation */\n@@ -1812,6 +1794,8 @@ static void i40evf_disable_vf(struct i40evf_adapter *adapter)\n \t\ti40evf_free_all_rx_resources(adapter);\n \t}\n \n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \t/* Delete all of the filters, both MAC and VLAN. */\n \tlist_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {\n \t\tlist_del(&f->list);\n@@ -1823,6 +1807,8 @@ static void i40evf_disable_vf(struct i40evf_adapter *adapter)\n \t\tkfree(fv);\n \t}\n \n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \ti40evf_free_misc_irq(adapter);\n \ti40evf_reset_interrupt_capability(adapter);\n \ti40evf_free_queues(adapter);\n@@ -1959,6 +1945,8 @@ static void i40evf_reset_task(struct work_struct *work)\n \tadapter->aq_required |= I40EVF_FLAG_AQ_GET_CONFIG;\n \tadapter->aq_required |= I40EVF_FLAG_AQ_MAP_VECTORS;\n \n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \t/* re-add all MAC filters */\n \tlist_for_each_entry(f, &adapter->mac_filter_list, list) {\n \t\tf->add = true;\n@@ -1967,6 +1955,9 @@ static void i40evf_reset_task(struct work_struct *work)\n \tlist_for_each_entry(vlf, &adapter->vlan_filter_list, list) {\n \t\tvlf->add = true;\n \t}\n+\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \tadapter->aq_required |= I40EVF_FLAG_AQ_ADD_MAC_FILTER;\n \tadapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER;\n \tclear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);\n@@ -2957,6 +2948,8 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tmutex_init(&hw->aq.asq_mutex);\n \tmutex_init(&hw->aq.arq_mutex);\n \n+\tspin_lock_init(&adapter->mac_vlan_list_lock);\n+\n \tINIT_LIST_HEAD(&adapter->mac_filter_list);\n \tINIT_LIST_HEAD(&adapter->vlan_filter_list);\n \n@@ -3132,6 +3125,7 @@ static void i40evf_remove(struct pci_dev *pdev)\n \ti40evf_free_all_rx_resources(adapter);\n \ti40evf_free_queues(adapter);\n \tkfree(adapter->vf_res);\n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n \t/* If we got removed before an up/down sequence, we've got a filter\n \t * hanging out there that we need to get rid of.\n \t */\n@@ -3144,6 +3138,8 @@ static void i40evf_remove(struct pci_dev *pdev)\n \t\tkfree(f);\n \t}\n \n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \tfree_netdev(netdev);\n \n \tpci_disable_pcie_error_reporting(pdev);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\nindex 46c8b8a..2719a05 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n@@ -433,12 +433,16 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter)\n \t\t\tadapter->current_op);\n \t\treturn;\n \t}\n+\n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \tlist_for_each_entry(f, &adapter->mac_filter_list, list) {\n \t\tif (f->add)\n \t\t\tcount++;\n \t}\n \tif (!count) {\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER;\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n \t}\n \tadapter->current_op = VIRTCHNL_OP_ADD_ETH_ADDR;\n@@ -456,8 +460,10 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter)\n \t}\n \n \tveal = kzalloc(len, GFP_KERNEL);\n-\tif (!veal)\n+\tif (!veal) {\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n+\t}\n \n \tveal->vsi_id = adapter->vsi_res->vsi_id;\n \tveal->num_elements = count;\n@@ -472,6 +478,9 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter)\n \t}\n \tif (!more)\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER;\n+\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \ti40evf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_ETH_ADDR,\n \t\t\t (u8 *)veal, len);\n \tkfree(veal);\n@@ -498,12 +507,16 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter)\n \t\t\tadapter->current_op);\n \t\treturn;\n \t}\n+\n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \tlist_for_each_entry(f, &adapter->mac_filter_list, list) {\n \t\tif (f->remove)\n \t\t\tcount++;\n \t}\n \tif (!count) {\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER;\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n \t}\n \tadapter->current_op = VIRTCHNL_OP_DEL_ETH_ADDR;\n@@ -520,8 +533,10 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter)\n \t\tmore = true;\n \t}\n \tveal = kzalloc(len, GFP_KERNEL);\n-\tif (!veal)\n+\tif (!veal) {\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n+\t}\n \n \tveal->vsi_id = adapter->vsi_res->vsi_id;\n \tveal->num_elements = count;\n@@ -537,6 +552,9 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter)\n \t}\n \tif (!more)\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER;\n+\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \ti40evf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_ETH_ADDR,\n \t\t\t (u8 *)veal, len);\n \tkfree(veal);\n@@ -564,12 +582,15 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter)\n \t\treturn;\n \t}\n \n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \tlist_for_each_entry(f, &adapter->vlan_filter_list, list) {\n \t\tif (f->add)\n \t\t\tcount++;\n \t}\n \tif (!count) {\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER;\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n \t}\n \tadapter->current_op = VIRTCHNL_OP_ADD_VLAN;\n@@ -586,8 +607,10 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter)\n \t\tmore = true;\n \t}\n \tvvfl = kzalloc(len, GFP_KERNEL);\n-\tif (!vvfl)\n+\tif (!vvfl) {\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n+\t}\n \n \tvvfl->vsi_id = adapter->vsi_res->vsi_id;\n \tvvfl->num_elements = count;\n@@ -602,6 +625,9 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter)\n \t}\n \tif (!more)\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER;\n+\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \ti40evf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_VLAN, (u8 *)vvfl, len);\n \tkfree(vvfl);\n }\n@@ -628,12 +654,15 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter)\n \t\treturn;\n \t}\n \n+\tspin_lock_bh(&adapter->mac_vlan_list_lock);\n+\n \tlist_for_each_entry(f, &adapter->vlan_filter_list, list) {\n \t\tif (f->remove)\n \t\t\tcount++;\n \t}\n \tif (!count) {\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER;\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n \t}\n \tadapter->current_op = VIRTCHNL_OP_DEL_VLAN;\n@@ -650,8 +679,10 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter)\n \t\tmore = true;\n \t}\n \tvvfl = kzalloc(len, GFP_KERNEL);\n-\tif (!vvfl)\n+\tif (!vvfl) {\n+\t\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n \t\treturn;\n+\t}\n \n \tvvfl->vsi_id = adapter->vsi_res->vsi_id;\n \tvvfl->num_elements = count;\n@@ -667,6 +698,9 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter)\n \t}\n \tif (!more)\n \t\tadapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER;\n+\n+\tspin_unlock_bh(&adapter->mac_vlan_list_lock);\n+\n \ti40evf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_VLAN, (u8 *)vvfl, len);\n \tkfree(vvfl);\n }\n", "prefixes": [ "next", "S81-V3", "3/9" ] }