net/i40e: fix mac counting error

Message ID 20210823080009.8603-1-chenqiming_huawei@163.com (mailing list archive)
State Not Applicable, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: fix mac counting error |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing fail Testing issues
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS

Commit Message

Qiming Chen Aug. 23, 2021, 8 a.m. UTC
  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(-)
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 5b1c8e76ab..12e69a3233 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -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;