Patch "[PATCH 006/135] i40e: properly delete VF MAC filters" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
[PATCH 006/135] i40e: properly delete VF MAC filters
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
0006-i40e-properly-delete-VF-MAC-filters.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
0163083d5ed77ee3e08b0cd722ef340ee78682d4Mon Sep 17 00:00:00 2001
From: Mitch Williams <[email protected]>
Date: Thu, 19 Nov 2015 11:34:16 -0800
Subject: [PATCH 006/135] i40e: properly delete VF MAC filters
[ Upstream commit b36e9ab59b7e3a5b14bf88dc0536e6579db7b54d ]
The virtual channel interface was using incorrect semantics to remove MAC addresses, which would leave incorrect filters active when using VLANs. To correct this, add a new function that unconditionally removes MAC addresses from all VLANs, and call this function when the VF requests a MAC filter removal.
--- drivers/net/ethernet/intel/i40e/i40e.h | 2 + drivers/net/ethernet/intel/i40e/i40e_main.c | 36 +++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 8 +++- 3 files changed, 44 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -0
@@ -767,6 +767,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vint i40e_vsi_kill_vlan (struct i40e_vsi *vsi,s16 vid);struct i40e_mac_filter *i40e_put_mac_in_vlan (struct i40e_vsi *vsi,u8 *macaddr,bool is_vf,bool is_netdev); +int i40e_del_mac_all_vlan (struct i40e_vsi *vsi,u8 *macaddr, +bool is_vf,bool is_netdev);bool i40e_is_vsi_in_vlan (struct i40e_vsi *vsi);struct i40e_mac_filter *i40e_find_mac (struct i40e_vsi *vsi,u8 *macaddr,bool is_vf,bool is_netdev);
drivers/net/ethernet/intel/i40e/i40e_main.c +36 -0
@@ -1317,6 +1317,42 @@ struct i40e_mac_filter *i40e_put_mac_in_ }/** +* i40e_del_mac_all_vlan - Remove a MAC filter from all VLANS +* @vsi: the VSI to be searched +* @macaddr: the mac address to be removed +* @is_vf: true if it is a VF +* @is_netdev: true if it is a netdev +* +* Removes a given MAC address from a VSI, regardless of VLAN +* +* Returns 0 for success, or error +**/ +int i40e_del_mac_all_vlan (struct i40e_vsi *vsi,u8 *macaddr, +bool is_vf,bool is_netdev) +{ +struct i40e_mac_filter *f =NULL ; +int changed =0 ; + +WARN (!spin_is_locked (&vsi->mac_filter_list_lock), +"Missing mac_filter_list_lock\n" ); +list_for_each_entry (f, &vsi->mac_filter_list, list) { +if ((ether_addr_equal (macaddr, f->macaddr)) && + (is_vf == f->is_vf) && + (is_netdev == f->is_netdev)) { + f->counter--; + f->changed = true; + changed =1 ; + } + } +if (changed) { + vsi->flags |=I40E_VSI_FLAG_FILTER_CHANGED ; + vsi->back->flags |=I40E_FLAG_FILTER_SYNC ; +return 0 ; + } +return -ENOENT ; +} + +/** * i40e_rm_default_mac_filter - Remove the default MAC filter set by NVM * @vsi: the PF Main VSI - inappropriate for any other VSI * @macaddr: the MAC address
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 -2
@@ -1680,8 +1680,12 @@ static int i40e_vc_del_mac_addr_msg(struspin_lock_bh (&vsi->mac_filter_list_lock);/* delete addresses from the list */ for (i =0 ; i < al->num_elements; i++) -i40e_del_filter (vsi, al->list[i].addr, -I40E_VLAN_ANY , true, false); +if (i40e_del_mac_all_vlan (vsi, al->list[i].addr, true, false)) { + ret =I40E_ERR_INVALID_MAC_ADDR ; +spin_unlock_bh (&vsi->mac_filter_list_lock); + goto error_param; + } +spin_unlock_bh (&vsi->mac_filter_list_lock);/* program the updated filter list */
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/0008-i40evf-check-rings-before-freeing-resources.patch queue-4.4/0007-i40e-don-t-add-zero-MAC-filter.patch queue-4.4/0002-i40evf-handle-many-MAC-filters-correctly.patch queue-4.4/0006-i40e-properly-delete-VF-MAC-filters.patch