Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1315f7c3 authored by Greg Rose's avatar Greg Rose Committed by Jeff Kirsher
Browse files

i40e: Retain MAC filters when changing port VLAN



We were already taking care to retain the MAC filter list when deleting a
port VLAN.  Take some additional care to retain the MAC filter list when
changing a port VLAN.

Change-ID: Iacf9599ea24ecb4dca8e419aacaf4b58ca361a9c
Signed-off-by: default avatarGreg Rose <gregory.v.rose@intel.com>
Signed-off-by: default avatarCatherine Sullivan <catherine.sullivan@intel.com>
Tested-by: default avatarSibai Li <sibai.li@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 0dd8357f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2128,11 +2128,15 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,

	/* Check for condition where there was already a port VLAN ID
	 * filter set and now it is being deleted by setting it to zero.
	 * Additionally check for the condition where there was a port
	 * VLAN but now there is a new and different port VLAN being set.
	 * Before deleting all the old VLAN filters we must add new ones
	 * with -1 (I40E_VLAN_ANY) or otherwise we're left with all our
	 * MAC addresses deleted.
	 */
	if (!(vlan_id || qos) && vsi->info.pvid)
	if ((!(vlan_id || qos) ||
	    (vlan_id | qos) != le16_to_cpu(vsi->info.pvid)) &&
	    vsi->info.pvid)
		ret = i40e_vsi_add_vlan(vsi, I40E_VLAN_ANY);

	if (vsi->info.pvid) {