Commit 20e72a44 authored by Yevgeny Petrilin's avatar Yevgeny Petrilin Committed by David S. Miller

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: default avatarYevgeny Petrilin <yevgenyp@mellanox.co.il>
Tested-by: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c70a3a92
...@@ -258,9 +258,12 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int qpn) ...@@ -258,9 +258,12 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int qpn)
if (validate_index(dev, table, index)) if (validate_index(dev, table, index))
goto out; goto out;
table->entries[index] = 0; /* Check whether this address has reference count */
mlx4_set_port_mac_table(dev, port, table->entries); if (!(--table->refs[index])) {
--table->total; table->entries[index] = 0;
mlx4_set_port_mac_table(dev, port, table->entries);
--table->total;
}
out: out:
mutex_unlock(&table->mutex); mutex_unlock(&table->mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment