[v2] net/ixgbevf: prevent duplicate default mac filter entries
diff mbox series

Message ID 20200126173249.27722-1-dharton@cisco.com
State New
Delegated to: xiaolong ye
Headers show
Series
  • [v2] net/ixgbevf: prevent duplicate default mac filter entries
Related show

Checks

Context Check Description
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

David Harton (dharton) Jan. 26, 2020, 5:32 p.m. UTC
The ixgbe PF manages the default VF mac address in a separate
list from the additional VF mac filters.  librte_ethdev
stores the default mac in dev->data->mac_addrs[0], however,
the ixgbevf driver re-adds mac_addr[0] when a mac filter is
removed.

ixgbevf_remove_mac_addr() is modified to avoid (re)adding
the default mac when it differs from the permanent mac.

Fixes: b6562244b4f3 ("ixgbevf: skip null and permanent mac addresses")
Cc: ivan.boule@6wind.com

Signed-off-by: David Harton <dharton@cisco.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 2c6fd0f13..49285ce53 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -6209,15 +6209,16 @@  ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index)
 	 * The IXGBE_VF_SET_MACVLAN command of the ixgbe-pf driver does
 	 * not support the deletion of a given MAC address.
 	 * Instead, it imposes to delete all MAC addresses, then to add again
-	 * all MAC addresses with the exception of the one to be deleted.
+	 * all MAC addresses with the exception of the one to be deleted
+	 * and the default mac address (index 0).
 	 */
 	(void) ixgbevf_set_uc_addr_vf(hw, 0, NULL);
 
 	/*
-	 * Add again all MAC addresses, with the exception of the deleted one
-	 * and of the permanent MAC address.
+	 * Add again all MAC addresses, with the exception of the deleted one,
+	 * the default mac (index 0) and the permanent MAC address.
 	 */
-	for (i = 0, mac_addr = dev->data->mac_addrs;
+	for (i = 1, mac_addr = &dev->data->mac_addrs[1];
 	     i < hw->mac.num_rar_entries; i++, mac_addr++) {
 		/* Skip the deleted MAC address */
 		if (i == index)