linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/5] net: lan966x: Fix issues with MAC table
@ 2022-07-14 19:40 Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 1/5] net: lan966x: Fix taking rtnl_lock while holding spin_lock Horatiu Vultur
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Horatiu Vultur @ 2022-07-14 19:40 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: UNGLinuxDriver, davem, edumazet, kuba, pabeni, vladimir.oltean,
	Horatiu Vultur

The patch series fixes 2 issues:
- when an entry was forgotten the irq thread was holding a spin lock and then
  was talking also rtnl_lock.
- the access to the HW MAC table is indirect, so the access to the HW MAC
  table was not synchronized, which means that there could be race conditions.

Horatiu Vultur (5):
  net: lan966x: Fix taking rtnl_lock while holding spin_lock
  net: lan966x: Fix usage of lan966x->mac_lock when entry is added
  net: lan966x: Fix usage of lan966x->mac_lock when entry is removed
  net: lan966x: Fix usage of lan966x->mac_lock inside
    lan966x_mac_irq_handler
  net: lan966x: Fix usage of lan966x->mac_lock when used by FDB

 .../ethernet/microchip/lan966x/lan966x_mac.c  | 112 +++++++++++++-----
 1 file changed, 80 insertions(+), 32 deletions(-)

-- 
2.33.0


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

* [PATCH net 1/5] net: lan966x: Fix taking rtnl_lock while holding spin_lock
  2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
@ 2022-07-14 19:40 ` Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 2/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is added Horatiu Vultur
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Horatiu Vultur @ 2022-07-14 19:40 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: UNGLinuxDriver, davem, edumazet, kuba, pabeni, vladimir.oltean,
	Horatiu Vultur

When the HW deletes an entry in MAC table then it generates an
interrupt. The SW will go through it's own list of MAC entries and if it
is not found then it would notify the listeners about this. The problem
is that when the SW will go through it's own list it would take a spin
lock(lan966x->mac_lock) and when it notifies that the entry is deleted.
But to notify the listeners it taking the rtnl_lock which is illegal.

This is fixed by instead of notifying right away that the entry is
deleted, move the entry on a temp list and once, it checks all the
entries then just notify that the entries from temp list are deleted.

Fixes: 5ccd66e01cbe ("net: lan966x: add support for interrupts from analyzer")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 .../ethernet/microchip/lan966x/lan966x_mac.c  | 27 ++++++++++++-------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
index 005e56ea5da1..2d2b83c03796 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
@@ -325,10 +325,13 @@ static void lan966x_mac_irq_process(struct lan966x *lan966x, u32 row,
 {
 	struct lan966x_mac_entry *mac_entry, *tmp;
 	unsigned char mac[ETH_ALEN] __aligned(2);
+	struct list_head mac_deleted_entries;
 	u32 dest_idx;
 	u32 column;
 	u16 vid;
 
+	INIT_LIST_HEAD(&mac_deleted_entries);
+
 	spin_lock(&lan966x->mac_lock);
 	list_for_each_entry_safe(mac_entry, tmp, &lan966x->mac_entries, list) {
 		bool found = false;
@@ -362,20 +365,26 @@ static void lan966x_mac_irq_process(struct lan966x *lan966x, u32 row,
 		}
 
 		if (!found) {
-			/* Notify the bridge that the entry doesn't exist
-			 * anymore in the HW and remove the entry from the SW
-			 * list
-			 */
-			lan966x_mac_notifiers(SWITCHDEV_FDB_DEL_TO_BRIDGE,
-					      mac_entry->mac, mac_entry->vid,
-					      lan966x->ports[mac_entry->port_index]->dev);
-
 			list_del(&mac_entry->list);
-			kfree(mac_entry);
+			/* Move the entry from SW list to a tmp list such that
+			 * it would be deleted later
+			 */
+			list_add_tail(&mac_entry->list, &mac_deleted_entries);
 		}
 	}
 	spin_unlock(&lan966x->mac_lock);
 
+	list_for_each_entry_safe(mac_entry, tmp, &mac_deleted_entries, list) {
+		/* Notify the bridge that the entry doesn't exist
+		 * anymore in the HW
+		 */
+		lan966x_mac_notifiers(SWITCHDEV_FDB_DEL_TO_BRIDGE,
+				      mac_entry->mac, mac_entry->vid,
+				      lan966x->ports[mac_entry->port_index]->dev);
+		list_del(&mac_entry->list);
+		kfree(mac_entry);
+	}
+
 	/* Now go to the list of columns and see if any entry was not in the SW
 	 * list, then that means that the entry is new so it needs to notify the
 	 * bridge.
-- 
2.33.0


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

* [PATCH net 2/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is added
  2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 1/5] net: lan966x: Fix taking rtnl_lock while holding spin_lock Horatiu Vultur
@ 2022-07-14 19:40 ` Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 3/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is removed Horatiu Vultur
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Horatiu Vultur @ 2022-07-14 19:40 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: UNGLinuxDriver, davem, edumazet, kuba, pabeni, vladimir.oltean,
	Horatiu Vultur

To add an entry to the MAC table, it is required first to setup the
entry and then issue a command for the MAC to learn the entry.
So if it happens for two threads to add simultaneously an entry in MAC
table then it would be a race condition.
Fix this by using lan966x->mac_lock to protect the HW access.

Fixes: fc0c3fe7486f2 ("net: lan966x: Add function lan966x_mac_ip_learn()")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_mac.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
index 2d2b83c03796..4f8fd5cde950 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
@@ -75,6 +75,9 @@ static int __lan966x_mac_learn(struct lan966x *lan966x, int pgid,
 			       unsigned int vid,
 			       enum macaccess_entry_type type)
 {
+	int ret;
+
+	spin_lock(&lan966x->mac_lock);
 	lan966x_mac_select(lan966x, mac, vid);
 
 	/* Issue a write command */
@@ -86,7 +89,10 @@ static int __lan966x_mac_learn(struct lan966x *lan966x, int pgid,
 	       ANA_MACACCESS_MAC_TABLE_CMD_SET(MACACCESS_CMD_LEARN),
 	       lan966x, ANA_MACACCESS);
 
-	return lan966x_mac_wait_for_completion(lan966x);
+	ret = lan966x_mac_wait_for_completion(lan966x);
+	spin_unlock(&lan966x->mac_lock);
+
+	return ret;
 }
 
 /* The mask of the front ports is encoded inside the mac parameter via a call
-- 
2.33.0


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

* [PATCH net 3/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is removed
  2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 1/5] net: lan966x: Fix taking rtnl_lock while holding spin_lock Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 2/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is added Horatiu Vultur
@ 2022-07-14 19:40 ` Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 4/5] net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler Horatiu Vultur
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Horatiu Vultur @ 2022-07-14 19:40 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: UNGLinuxDriver, davem, edumazet, kuba, pabeni, vladimir.oltean,
	Horatiu Vultur

To remove an entry to the MAC table, it is required first to setup the
entry and then issue a command for the MAC to forget the entry.
So if it happens for two threads to remove simultaneously an entry
in MAC table then it would be a race condition.
Fix this by using lan966x->mac_lock to protect the HW access.

Fixes: e18aba8941b40 ("net: lan966x: add mactable support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 .../ethernet/microchip/lan966x/lan966x_mac.c  | 24 +++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
index 4f8fd5cde950..d0b8eba0a66d 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
@@ -119,11 +119,13 @@ int lan966x_mac_learn(struct lan966x *lan966x, int port,
 	return __lan966x_mac_learn(lan966x, port, false, mac, vid, type);
 }
 
-int lan966x_mac_forget(struct lan966x *lan966x,
-		       const unsigned char mac[ETH_ALEN],
-		       unsigned int vid,
-		       enum macaccess_entry_type type)
+static int lan966x_mac_forget_locked(struct lan966x *lan966x,
+				     const unsigned char mac[ETH_ALEN],
+				     unsigned int vid,
+				     enum macaccess_entry_type type)
 {
+	lockdep_assert_held(&lan966x->mac_lock);
+
 	lan966x_mac_select(lan966x, mac, vid);
 
 	/* Issue a forget command */
@@ -134,6 +136,20 @@ int lan966x_mac_forget(struct lan966x *lan966x,
 	return lan966x_mac_wait_for_completion(lan966x);
 }
 
+int lan966x_mac_forget(struct lan966x *lan966x,
+		       const unsigned char mac[ETH_ALEN],
+		       unsigned int vid,
+		       enum macaccess_entry_type type)
+{
+	int ret;
+
+	spin_lock(&lan966x->mac_lock);
+	ret = lan966x_mac_forget_locked(lan966x, mac, vid, type);
+	spin_unlock(&lan966x->mac_lock);
+
+	return ret;
+}
+
 int lan966x_mac_cpu_learn(struct lan966x *lan966x, const char *addr, u16 vid)
 {
 	return lan966x_mac_learn(lan966x, PGID_CPU, addr, vid, ENTRYTYPE_LOCKED);
-- 
2.33.0


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

* [PATCH net 4/5] net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler
  2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
                   ` (2 preceding siblings ...)
  2022-07-14 19:40 ` [PATCH net 3/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is removed Horatiu Vultur
@ 2022-07-14 19:40 ` Horatiu Vultur
  2022-07-14 19:40 ` [PATCH net 5/5] net: lan966x: Fix usage of lan966x->mac_lock when used by FDB Horatiu Vultur
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Horatiu Vultur @ 2022-07-14 19:40 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: UNGLinuxDriver, davem, edumazet, kuba, pabeni, vladimir.oltean,
	Horatiu Vultur

The problem with this spin lock is that it was just protecting the list
of the MAC entries in SW and not also the access to the MAC entries in HW.
Because the access to HW is indirect, then it could happen to have race
conditions.
For example when SW introduced an entry in MAC table and the irq mac is
trying to read something from the MAC.
Update such that also the access to MAC entries in HW is protected by
this lock.

Fixes: 5ccd66e01cbef ("net: lan966x: add support for interrupts from analyzer")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 .../ethernet/microchip/lan966x/lan966x_mac.c  | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
index d0b8eba0a66d..69e343b7f4af 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
@@ -183,7 +183,7 @@ static struct lan966x_mac_entry *lan966x_mac_alloc_entry(const unsigned char *ma
 {
 	struct lan966x_mac_entry *mac_entry;
 
-	mac_entry = kzalloc(sizeof(*mac_entry), GFP_KERNEL);
+	mac_entry = kzalloc(sizeof(*mac_entry), GFP_ATOMIC);
 	if (!mac_entry)
 		return NULL;
 
@@ -310,8 +310,8 @@ void lan966x_mac_purge_entries(struct lan966x *lan966x)
 	spin_lock(&lan966x->mac_lock);
 	list_for_each_entry_safe(mac_entry, tmp, &lan966x->mac_entries,
 				 list) {
-		lan966x_mac_forget(lan966x, mac_entry->mac, mac_entry->vid,
-				   ENTRYTYPE_LOCKED);
+		lan966x_mac_forget_locked(lan966x, mac_entry->mac,
+					  mac_entry->vid, ENTRYTYPE_LOCKED);
 
 		list_del(&mac_entry->list);
 		kfree(mac_entry);
@@ -427,13 +427,14 @@ static void lan966x_mac_irq_process(struct lan966x *lan966x, u32 row,
 		if (WARN_ON(dest_idx >= lan966x->num_phys_ports))
 			continue;
 
+		spin_lock(&lan966x->mac_lock);
 		mac_entry = lan966x_mac_alloc_entry(mac, vid, dest_idx);
-		if (!mac_entry)
+		if (!mac_entry) {
+			spin_unlock(&lan966x->mac_lock);
 			return;
+		}
 
 		mac_entry->row = row;
-
-		spin_lock(&lan966x->mac_lock);
 		list_add_tail(&mac_entry->list, &lan966x->mac_entries);
 		spin_unlock(&lan966x->mac_lock);
 
@@ -455,6 +456,7 @@ irqreturn_t lan966x_mac_irq_handler(struct lan966x *lan966x)
 	       lan966x, ANA_MACTINDX);
 
 	while (1) {
+		spin_lock(&lan966x->mac_lock);
 		lan_rmw(ANA_MACACCESS_MAC_TABLE_CMD_SET(MACACCESS_CMD_SYNC_GET_NEXT),
 			ANA_MACACCESS_MAC_TABLE_CMD,
 			lan966x, ANA_MACACCESS);
@@ -478,12 +480,15 @@ irqreturn_t lan966x_mac_irq_handler(struct lan966x *lan966x)
 			stop = false;
 
 		if (column == LAN966X_MAC_COLUMNS - 1 &&
-		    index == 0 && stop)
+		    index == 0 && stop) {
+			spin_unlock(&lan966x->mac_lock);
 			break;
+		}
 
 		entry[column].mach = lan_rd(lan966x, ANA_MACHDATA);
 		entry[column].macl = lan_rd(lan966x, ANA_MACLDATA);
 		entry[column].maca = lan_rd(lan966x, ANA_MACACCESS);
+		spin_unlock(&lan966x->mac_lock);
 
 		/* Once all the columns are read process them */
 		if (column == LAN966X_MAC_COLUMNS - 1) {
-- 
2.33.0


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

* [PATCH net 5/5] net: lan966x: Fix usage of lan966x->mac_lock when used by FDB
  2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
                   ` (3 preceding siblings ...)
  2022-07-14 19:40 ` [PATCH net 4/5] net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler Horatiu Vultur
@ 2022-07-14 19:40 ` Horatiu Vultur
  2022-07-16 20:10 ` [PATCH net 0/5] net: lan966x: Fix issues with MAC table Vladimir Oltean
  2022-07-19  3:20 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 8+ messages in thread
From: Horatiu Vultur @ 2022-07-14 19:40 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: UNGLinuxDriver, davem, edumazet, kuba, pabeni, vladimir.oltean,
	Horatiu Vultur

When the SW bridge was trying to add/remove entries to/from HW, the
access to HW was not protected by any lock. In this way, it was
possible to have race conditions.
Fix this by using the lan966x->mac_lock to protect parallel access to HW
for this cases.

Fixes: 25ee9561ec622 ("net: lan966x: More MAC table functionality")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 .../ethernet/microchip/lan966x/lan966x_mac.c  | 34 +++++++++++++------
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
index 69e343b7f4af..5893770bfd94 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
@@ -201,7 +201,6 @@ static struct lan966x_mac_entry *lan966x_mac_find_entry(struct lan966x *lan966x,
 	struct lan966x_mac_entry *res = NULL;
 	struct lan966x_mac_entry *mac_entry;
 
-	spin_lock(&lan966x->mac_lock);
 	list_for_each_entry(mac_entry, &lan966x->mac_entries, list) {
 		if (mac_entry->vid == vid &&
 		    ether_addr_equal(mac, mac_entry->mac) &&
@@ -210,7 +209,6 @@ static struct lan966x_mac_entry *lan966x_mac_find_entry(struct lan966x *lan966x,
 			break;
 		}
 	}
-	spin_unlock(&lan966x->mac_lock);
 
 	return res;
 }
@@ -253,8 +251,11 @@ int lan966x_mac_add_entry(struct lan966x *lan966x, struct lan966x_port *port,
 {
 	struct lan966x_mac_entry *mac_entry;
 
-	if (lan966x_mac_lookup(lan966x, addr, vid, ENTRYTYPE_NORMAL))
+	spin_lock(&lan966x->mac_lock);
+	if (lan966x_mac_lookup(lan966x, addr, vid, ENTRYTYPE_NORMAL)) {
+		spin_unlock(&lan966x->mac_lock);
 		return 0;
+	}
 
 	/* In case the entry already exists, don't add it again to SW,
 	 * just update HW, but we need to look in the actual HW because
@@ -263,21 +264,25 @@ int lan966x_mac_add_entry(struct lan966x *lan966x, struct lan966x_port *port,
 	 * add the entry but without the extern_learn flag.
 	 */
 	mac_entry = lan966x_mac_find_entry(lan966x, addr, vid, port->chip_port);
-	if (mac_entry)
-		return lan966x_mac_learn(lan966x, port->chip_port,
-					 addr, vid, ENTRYTYPE_LOCKED);
+	if (mac_entry) {
+		spin_unlock(&lan966x->mac_lock);
+		goto mac_learn;
+	}
 
 	mac_entry = lan966x_mac_alloc_entry(addr, vid, port->chip_port);
-	if (!mac_entry)
+	if (!mac_entry) {
+		spin_unlock(&lan966x->mac_lock);
 		return -ENOMEM;
+	}
 
-	spin_lock(&lan966x->mac_lock);
 	list_add_tail(&mac_entry->list, &lan966x->mac_entries);
 	spin_unlock(&lan966x->mac_lock);
 
-	lan966x_mac_learn(lan966x, port->chip_port, addr, vid, ENTRYTYPE_LOCKED);
 	lan966x_fdb_call_notifiers(SWITCHDEV_FDB_OFFLOADED, addr, vid, port->dev);
 
+mac_learn:
+	lan966x_mac_learn(lan966x, port->chip_port, addr, vid, ENTRYTYPE_LOCKED);
+
 	return 0;
 }
 
@@ -291,8 +296,9 @@ int lan966x_mac_del_entry(struct lan966x *lan966x, const unsigned char *addr,
 				 list) {
 		if (mac_entry->vid == vid &&
 		    ether_addr_equal(addr, mac_entry->mac)) {
-			lan966x_mac_forget(lan966x, mac_entry->mac, mac_entry->vid,
-					   ENTRYTYPE_LOCKED);
+			lan966x_mac_forget_locked(lan966x, mac_entry->mac,
+						  mac_entry->vid,
+						  ENTRYTYPE_LOCKED);
 
 			list_del(&mac_entry->list);
 			kfree(mac_entry);
@@ -428,6 +434,12 @@ static void lan966x_mac_irq_process(struct lan966x *lan966x, u32 row,
 			continue;
 
 		spin_lock(&lan966x->mac_lock);
+		mac_entry = lan966x_mac_find_entry(lan966x, mac, vid, dest_idx);
+		if (mac_entry) {
+			spin_unlock(&lan966x->mac_lock);
+			continue;
+		}
+
 		mac_entry = lan966x_mac_alloc_entry(mac, vid, dest_idx);
 		if (!mac_entry) {
 			spin_unlock(&lan966x->mac_lock);
-- 
2.33.0


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

* Re: [PATCH net 0/5] net: lan966x: Fix issues with MAC table
  2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
                   ` (4 preceding siblings ...)
  2022-07-14 19:40 ` [PATCH net 5/5] net: lan966x: Fix usage of lan966x->mac_lock when used by FDB Horatiu Vultur
@ 2022-07-16 20:10 ` Vladimir Oltean
  2022-07-19  3:20 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 8+ messages in thread
From: Vladimir Oltean @ 2022-07-16 20:10 UTC (permalink / raw)
  To: Horatiu Vultur
  Cc: netdev, linux-kernel, UNGLinuxDriver, davem, edumazet, kuba, pabeni

On Thu, Jul 14, 2022 at 09:40:35PM +0200, Horatiu Vultur wrote:
> The patch series fixes 2 issues:
> - when an entry was forgotten the irq thread was holding a spin lock and then
>   was talking also rtnl_lock.
> - the access to the HW MAC table is indirect, so the access to the HW MAC
>   table was not synchronized, which means that there could be race conditions.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

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

* Re: [PATCH net 0/5] net: lan966x: Fix issues with MAC table
  2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
                   ` (5 preceding siblings ...)
  2022-07-16 20:10 ` [PATCH net 0/5] net: lan966x: Fix issues with MAC table Vladimir Oltean
@ 2022-07-19  3:20 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-19  3:20 UTC (permalink / raw)
  To: Horatiu Vultur
  Cc: netdev, linux-kernel, UNGLinuxDriver, davem, edumazet, kuba,
	pabeni, vladimir.oltean

Hello:

This series was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 14 Jul 2022 21:40:35 +0200 you wrote:
> The patch series fixes 2 issues:
> - when an entry was forgotten the irq thread was holding a spin lock and then
>   was talking also rtnl_lock.
> - the access to the HW MAC table is indirect, so the access to the HW MAC
>   table was not synchronized, which means that there could be race conditions.
> 
> Horatiu Vultur (5):
>   net: lan966x: Fix taking rtnl_lock while holding spin_lock
>   net: lan966x: Fix usage of lan966x->mac_lock when entry is added
>   net: lan966x: Fix usage of lan966x->mac_lock when entry is removed
>   net: lan966x: Fix usage of lan966x->mac_lock inside
>     lan966x_mac_irq_handler
>   net: lan966x: Fix usage of lan966x->mac_lock when used by FDB
> 
> [...]

Here is the summary with links:
  - [net,1/5] net: lan966x: Fix taking rtnl_lock while holding spin_lock
    https://git.kernel.org/netdev/net/c/45533a534a45
  - [net,2/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is added
    https://git.kernel.org/netdev/net/c/43243bb3195b
  - [net,3/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is removed
    https://git.kernel.org/netdev/net/c/99343cfa4f75
  - [net,4/5] net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler
    https://git.kernel.org/netdev/net/c/c19246843697
  - [net,5/5] net: lan966x: Fix usage of lan966x->mac_lock when used by FDB
    https://git.kernel.org/netdev/net/c/675c807ae26b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-07-19  3:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 19:40 [PATCH net 0/5] net: lan966x: Fix issues with MAC table Horatiu Vultur
2022-07-14 19:40 ` [PATCH net 1/5] net: lan966x: Fix taking rtnl_lock while holding spin_lock Horatiu Vultur
2022-07-14 19:40 ` [PATCH net 2/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is added Horatiu Vultur
2022-07-14 19:40 ` [PATCH net 3/5] net: lan966x: Fix usage of lan966x->mac_lock when entry is removed Horatiu Vultur
2022-07-14 19:40 ` [PATCH net 4/5] net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler Horatiu Vultur
2022-07-14 19:40 ` [PATCH net 5/5] net: lan966x: Fix usage of lan966x->mac_lock when used by FDB Horatiu Vultur
2022-07-16 20:10 ` [PATCH net 0/5] net: lan966x: Fix issues with MAC table Vladimir Oltean
2022-07-19  3:20 ` patchwork-bot+netdevbpf

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