DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbevf: prevent duplicate default mac filter entries
@ 2019-12-11  2:11 David Harton
  2020-01-26 17:32 ` [dpdk-dev] [PATCH v2] " David Harton
  0 siblings, 1 reply; 2+ messages in thread
From: David Harton @ 2019-12-11  2:11 UTC (permalink / raw)
  To: dev, wenzhuo.lu, konstantin.ananyev; +Cc: David Harton

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@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-dev] [PATCH v2] net/ixgbevf: prevent duplicate default mac filter entries
  2019-12-11  2:11 [dpdk-dev] [PATCH] net/ixgbevf: prevent duplicate default mac filter entries David Harton
@ 2020-01-26 17:32 ` David Harton
  0 siblings, 0 replies; 2+ messages in thread
From: David Harton @ 2020-01-26 17:32 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, konstantin.ananyev, xiaolong.ye, David Harton, ivan.boule

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

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-26 17:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11  2:11 [dpdk-dev] [PATCH] net/ixgbevf: prevent duplicate default mac filter entries David Harton
2020-01-26 17:32 ` [dpdk-dev] [PATCH v2] " David Harton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).