Skip to content

Commit

Permalink
i40e: fix a bug in debugfs with add/del macaddr
Browse files Browse the repository at this point in the history
The new code flow requires us to grab the filter list lock before
adding/deleting the filter.

Change-ID: I4eaef508ab4da2d1b2e23f20f2a78d931d5b6aeb
Signed-off-by: Anjali Singhai Jain <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
  • Loading branch information
anjalisinghai1 authored and Jeff Kirsher committed Oct 23, 2015
1 parent e7358f5 commit 10dc035
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/intel/i40e/i40e_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
goto command_write_done;
}

spin_lock_bh(&vsi->mac_filter_list_lock);
f = i40e_add_filter(vsi, ma, vlan, false, false);
spin_unlock_bh(&vsi->mac_filter_list_lock);
ret = i40e_sync_vsi_filters(vsi, true);
if (f && !ret)
dev_info(&pf->pdev->dev,
Expand Down Expand Up @@ -1174,7 +1176,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
goto command_write_done;
}

spin_lock_bh(&vsi->mac_filter_list_lock);
i40e_del_filter(vsi, ma, vlan, false, false);
spin_unlock_bh(&vsi->mac_filter_list_lock);
ret = i40e_sync_vsi_filters(vsi, true);
if (!ret)
dev_info(&pf->pdev->dev,
Expand Down

0 comments on commit 10dc035

Please sign in to comment.