Skip to contentSkip to conversation

mlx4: decreasing ref count when removing mac

PATCH In review Yevgeny Petrilin 3 participants 3 messages Aug 4, 2011 – Aug 5, 2011 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlx4: decreasing ref count when removing mac

For older FW versions, when a Mac address removed from Mac table, we should set 0 for reference count for the corresponding Mac index. Fixes a bug where removing Mac from the table still left that entry as invalid.

---
 drivers/net/mlx4/port.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/mlx4/port.c +6 -3
index 1f95afd..609e0ec 100644
@@ -258,9 +258,12 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int qpn)
 	if (validate_index(dev, table, index))
 		goto out;
 
-	table->entries[index] = 0;
-	mlx4_set_port_mac_table(dev, port, table->entries);
-	--table->total;
+	/* Check whether this address has reference count */
+	if (!(--table->refs[index])) {
+		table->entries[index] = 0;
+		mlx4_set_port_mac_table(dev, port, table->entries);
+		--table->total;
+	}
 out:
 	mutex_unlock(&table->mutex);
 }
Signature · 6 lines
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4E3A7CE8.4080407-VPRAkNaXOzVS1MOuV/[email protected]

Tested-by
#2 lore raw
Quoted 4 lines

For older FW versions, when a Mac address removed from Mac table, we should set 0 for reference count for the corresponding Mac index. Fixes a bug where removing Mac from the table still left that entry as invalid.

This fixes my problems with MTU settings with old FW.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAL1RGDWVBWvc_p_XM2BQ-jV8DG19ZcbCcpntMJifED2frR+jcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

From: Roland Dreier <[email protected]>
Date: Thu, 4 Aug 2011 05:55:39 -0700

Quoted 8 lines
Quoted 4 lines

For older FW versions, when a Mac address removed from Mac table, we should set 0 for reference count for the corresponding Mac index. Fixes a bug where removing Mac from the table still left that entry as invalid.

This fixes my problems with MTU settings with old FW.

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html