diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2016-11-11 21:39:28 +0100 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2016-12-07 06:25:19 +0100 |
commit | 756970255a58c0f5ff9f9c5bba6fb47c70804077 (patch) | |
tree | 74f8ea8f6b60c120fe9a3d5c23ec3aa7604f25e4 /drivers/net/ethernet/intel/i40e | |
parent | i40e: refactor i40e_update_filter_state to avoid passing aq_err (diff) | |
download | linux-756970255a58c0f5ff9f9c5bba6fb47c70804077.tar.xz linux-756970255a58c0f5ff9f9c5bba6fb47c70804077.zip |
i40e: delete filter after adding its replacement when converting
Fix a subtle issue with the code for converting VID=-1 filters into VID=0
filters when adding a new VLAN. Previously the code deleted the VID=-1
filter, and then added a new VID=0 filter. In the rare case that the
addition fails due to -ENOMEM, we end up completely deleting the filter
which prevents recovery if memory pressure subsides. While it is not
strictly an issue because it is likely that memory issues would result
in many other problems, we shouldn't delete the filter until after the
addition succeeds.
Change-ID: Icba07ddd04ecc6a3b27c2e29f2c1c8673d266826
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 8e65972b0592..f9e9c90bb151 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -2535,7 +2535,6 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid) I40E_VLAN_ANY); if (!del_f) continue; - __i40e_del_filter(vsi, del_f); add_f = i40e_add_filter(vsi, f->macaddr, 0); if (!add_f) { dev_info(&vsi->back->pdev->dev, @@ -2544,6 +2543,7 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid) spin_unlock_bh(&vsi->mac_filter_hash_lock); return -ENOMEM; } + __i40e_del_filter(vsi, del_f); } } |