From: Greg Rose Date: Fri, 14 Mar 2014 07:32:20 +0000 (+0000) Subject: i40e: Retain MAC filters when changing port VLAN X-Git-Tag: v3.16-rc1~27^2~296^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1315f7c34e08f50b0d710168c2d98fb4766a7f5d;p=platform%2Fkernel%2Flinux-exynos.git 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: Greg Rose Signed-off-by: Catherine Sullivan Tested-by: Sibai Li Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index b27b2f5..982eef0 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -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) {