aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2011-08-03 21:05:12 -0400
committerDavid S. Miller <davem@davemloft.net>2011-08-05 06:36:07 -0400
commit20e72a44098641f0c4de34a31287a93e006afb5b (patch)
tree5bcc128348cba73f523a74255efd43cb0e865a24 /drivers
parentc70a3a9203ba327b86a4ce895c04e6d4ef18ee57 (diff)
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. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Tested-by: Roland Dreier <roland@purestorage.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/mlx4/port.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c
index 1f95afda6841..609e0ec14cee 100644
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -258,9 +258,12 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int qpn)
258 if (validate_index(dev, table, index)) 258 if (validate_index(dev, table, index))
259 goto out; 259 goto out;
260 260
261 table->entries[index] = 0; 261 /* Check whether this address has reference count */
262 mlx4_set_port_mac_table(dev, port, table->entries); 262 if (!(--table->refs[index])) {
263 --table->total; 263 table->entries[index] = 0;
264 mlx4_set_port_mac_table(dev, port, table->entries);
265 --table->total;
266 }
264out: 267out:
265 mutex_unlock(&table->mutex); 268 mutex_unlock(&table->mutex);
266} 269}