Commit 34c164de authored by Zijie Pan's avatar Zijie Pan Committed by Jeff Kirsher

i40e: fix the calculation of VFs mac addresses

num_mac should be increased only after the call to i40e_add_mac_filter().

Fixes: 5f527ba9 ("i40e: Limit the number of MAC and VLAN addresses that can be added for VFs")
Signed-off-by: default avatarZijie Pan <zijie.pan@6wind.com>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: default avatarTushar Dave <tushar.n.dave@oracle.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3d72aebf
...@@ -2218,7 +2218,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) ...@@ -2218,7 +2218,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
struct i40e_mac_filter *f; struct i40e_mac_filter *f;
f = i40e_find_mac(vsi, al->list[i].addr); f = i40e_find_mac(vsi, al->list[i].addr);
if (!f) if (!f) {
f = i40e_add_mac_filter(vsi, al->list[i].addr); f = i40e_add_mac_filter(vsi, al->list[i].addr);
if (!f) { if (!f) {
...@@ -2232,6 +2232,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) ...@@ -2232,6 +2232,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
vf->num_mac++; vf->num_mac++;
} }
} }
}
spin_unlock_bh(&vsi->mac_filter_hash_lock); spin_unlock_bh(&vsi->mac_filter_hash_lock);
/* program the updated filter list */ /* program the updated filter list */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment