aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Rose <gregory.v.rose@intel.com>2014-05-20 04:01:45 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-06-09 03:59:59 -0400
commit29f71bb0915db39c493235b63abf6b03150db84f (patch)
treed52b4258eebdc946cd6f0807fad5c939d69a446e
parentbbe7d0e01816fbfb9b5d3f47cb6d91e18340ec3d (diff)
i40e: Delete stale MAC filters after change
Delete all the old and stale MAC filters for the VF VSI when the host administrator changes the VF MAC address from under its feet. Also don't bother to add a filter for the VSI when its going to go away anyway. Just record the new address and punch the VF reset. Change-ID: Ic0d12055926f41989d1965ccf500053729c063ad Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 3f6cad46365c..385a46f910d6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2063,14 +2063,11 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
2063 i40e_del_filter(vsi, vf->default_lan_addr.addr, vf->port_vlan_id, 2063 i40e_del_filter(vsi, vf->default_lan_addr.addr, vf->port_vlan_id,
2064 true, false); 2064 true, false);
2065 2065
2066 /* add the new mac address */ 2066 /* Delete all the filters for this VSI - we're going to kill it
2067 f = i40e_add_filter(vsi, mac, vf->port_vlan_id, true, false); 2067 * anyway.
2068 if (!f) { 2068 */
2069 dev_err(&pf->pdev->dev, 2069 list_for_each_entry(f, &vsi->mac_filter_list, list)
2070 "Unable to add VF ucast filter\n"); 2070 i40e_del_filter(vsi, f->macaddr, f->vlan, true, false);
2071 ret = -ENOMEM;
2072 goto error_param;
2073 }
2074 2071
2075 dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n", mac, vf_id); 2072 dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n", mac, vf_id);
2076 /* program mac filter */ 2073 /* program mac filter */