public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mlx4: decreasing ref count when removing mac
@ 2011-08-04 11:05 Yevgeny Petrilin
       [not found] ` <4E3A7CE8.4080407-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Yevgeny Petrilin @ 2011-08-04 11:05 UTC (permalink / raw)
  To: roland-DgEjT+Ai2ygdnm+yROfE0A
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, yevgenyp-VPRAkNaXOzVS1MOuV/RT9w


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-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/net/mlx4/port.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c
index 1f95afd..609e0ec 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)
 	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);
 }
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mlx4: decreasing ref count when removing mac
       [not found] ` <4E3A7CE8.4080407-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
@ 2011-08-04 12:55   ` Roland Dreier
       [not found]     ` <CAL1RGDWVBWvc_p_XM2BQ-jV8DG19ZcbCcpntMJifED2frR+jcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Dreier @ 2011-08-04 12:55 UTC (permalink / raw)
  To: Yevgeny Petrilin
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

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

Tested-by: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mlx4: decreasing ref count when removing mac
       [not found]     ` <CAL1RGDWVBWvc_p_XM2BQ-jV8DG19ZcbCcpntMJifED2frR+jcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-08-05 10:36       ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-08-05 10:36 UTC (permalink / raw)
  To: roland-DgEjT+Ai2ygdnm+yROfE0A
  Cc: yevgenyp-VPRAkNaXOzVS1MOuV/RT9w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA

From: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Date: Thu, 4 Aug 2011 05:55:39 -0700

>> 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.
> 
> Tested-by: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>

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

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

end of thread, other threads:[~2011-08-05 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-04 11:05 [PATCH] mlx4: decreasing ref count when removing mac Yevgeny Petrilin
     [not found] ` <4E3A7CE8.4080407-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2011-08-04 12:55   ` Roland Dreier
     [not found]     ` <CAL1RGDWVBWvc_p_XM2BQ-jV8DG19ZcbCcpntMJifED2frR+jcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-05 10:36       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox