net/i40e: fix mac counting error
Checks
Commit Message
The i40evf_add_del_all_mac_addr function implements the mac batch delete
or add function. The vsi mac_num variable should be determined according
to the value of the variable add to add j or subtract j.
Fixes: 185993420249 ("net/i40e: fix VF add/del MAC")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
drivers/net/i40e/i40e_ethdev_vf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -2153,9 +2153,9 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add)
"OP_DEL_ETHER_ADDRESS");
} else {
if (add)
- vf->vsi.mac_num++;
+ vf->vsi.mac_num += j;
else
- vf->vsi.mac_num--;
+ vf->vsi.mac_num -= j;
}
rte_free(list);
begin = next_begin;