netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] bnx2x: Bug patch series
@ 2013-05-01 14:27 Yuval Mintz
  2013-05-01 14:27 ` [PATCH net 1/2] bnx2x: correct reading of speed capabilities Yuval Mintz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yuval Mintz @ 2013-05-01 14:27 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, ariele

Hi Dave,

This fixes 2 small bugs - one which may cause an unnecessary link flap,
and the other is a small memory leak when unloading while cnic is not 
loaded.

Please consider applying these patches to `net'.

Thanks,
Yuval Mintz

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

* [PATCH net 1/2] bnx2x: correct reading of speed capabilities
  2013-05-01 14:27 [PATCH net 0/2] bnx2x: Bug patch series Yuval Mintz
@ 2013-05-01 14:27 ` Yuval Mintz
  2013-05-01 14:27 ` [PATCH net 2/2] bnx2x: Prevent memory leak when cnic is absent Yuval Mintz
  2013-05-01 19:08 ` [PATCH net 0/2] bnx2x: Bug patch series David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Yuval Mintz @ 2013-05-01 14:27 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, ariele, Yaniv Rosner, Yuval Mintz

From: Yaniv Rosner <yanivr@broadcom.com>

When the bnx2x driver reads the port configuration - mask irrelevant bits. 

Without this change, the unintended bits may cause the driver to needlessly
toggle the link, as a comparison in the link flap avoidance flow will show
that the old link did not advertise the same capabilities and thus cannot
be retained.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index a8f1ee3..9cc39f1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10575,10 +10575,12 @@ static void bnx2x_get_port_hwinfo(struct bnx2x *bp)
 
 	bp->link_params.speed_cap_mask[0] =
 		SHMEM_RD(bp,
-			 dev_info.port_hw_config[port].speed_capability_mask);
+			 dev_info.port_hw_config[port].speed_capability_mask) &
+		PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK;
 	bp->link_params.speed_cap_mask[1] =
 		SHMEM_RD(bp,
-			 dev_info.port_hw_config[port].speed_capability_mask2);
+			 dev_info.port_hw_config[port].speed_capability_mask2) &
+		PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK;
 	bp->port.link_config[0] =
 		SHMEM_RD(bp, dev_info.port_feature_config[port].link_config);
 
-- 
1.8.1.227.g44fe835

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

* [PATCH net 2/2] bnx2x: Prevent memory leak when cnic is absent
  2013-05-01 14:27 [PATCH net 0/2] bnx2x: Bug patch series Yuval Mintz
  2013-05-01 14:27 ` [PATCH net 1/2] bnx2x: correct reading of speed capabilities Yuval Mintz
@ 2013-05-01 14:27 ` Yuval Mintz
  2013-05-01 19:08 ` [PATCH net 0/2] bnx2x: Bug patch series David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Yuval Mintz @ 2013-05-01 14:27 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, ariele, Yuval Mintz

bnx2x driver allocates searcher T2 tables, but it releases that memory
during unload only released if the cnic is loaded.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 9cc39f1..c31eca9 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -7757,6 +7757,8 @@ void bnx2x_free_mem(struct bnx2x *bp)
 	BNX2X_PCI_FREE(bp->eq_ring, bp->eq_mapping,
 		       BCM_PAGE_SIZE * NUM_EQ_PAGES);
 
+	BNX2X_PCI_FREE(bp->t2, bp->t2_mapping, SRC_T2_SZ);
+
 	bnx2x_iov_free_mem(bp);
 }
 
-- 
1.8.1.227.g44fe835

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

* Re: [PATCH net 0/2] bnx2x: Bug patch series
  2013-05-01 14:27 [PATCH net 0/2] bnx2x: Bug patch series Yuval Mintz
  2013-05-01 14:27 ` [PATCH net 1/2] bnx2x: correct reading of speed capabilities Yuval Mintz
  2013-05-01 14:27 ` [PATCH net 2/2] bnx2x: Prevent memory leak when cnic is absent Yuval Mintz
@ 2013-05-01 19:08 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-05-01 19:08 UTC (permalink / raw)
  To: yuvalmin; +Cc: netdev, eilong, ariele

From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Wed, 1 May 2013 17:27:56 +0300

> This fixes 2 small bugs - one which may cause an unnecessary link flap,
> and the other is a small memory leak when unloading while cnic is not 
> loaded.

Series applied, thanks.

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

end of thread, other threads:[~2013-05-01 19:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-01 14:27 [PATCH net 0/2] bnx2x: Bug patch series Yuval Mintz
2013-05-01 14:27 ` [PATCH net 1/2] bnx2x: correct reading of speed capabilities Yuval Mintz
2013-05-01 14:27 ` [PATCH net 2/2] bnx2x: Prevent memory leak when cnic is absent Yuval Mintz
2013-05-01 19:08 ` [PATCH net 0/2] bnx2x: Bug patch series David Miller

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