[dpdk-dev] [PATCH] net/ixgbevf: prevent duplicate default mac filter entries

David Harton dharton at cisco.com
Wed Dec 11 03:11:33 CET 2019


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.

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

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)
-- 
2.19.1



More information about the dev mailing list