[dpdk-dev] [PATCH] net/i40e: fix mac counting error

From: Qiming Chen <hidden>
Date: 2021-08-23 08:01:06
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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 <redacted>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
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;
-- 
2.30.1.windows.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help