bnx2x: Bug patch series
cover bnx2x: Bug patch series
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
PATCH 1/2 bnx2x: correct reading of speed capabilities
From: Yaniv Rosner <[email protected]>
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.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +4 -2
@@ -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);
Signature · 1 line
1.8.1.227.g44fe835
PATCH 2/2 bnx2x: Prevent memory leak when cnic is absent
In reply to Yuval Mintzbnx2x driver allocates searcher T2 tables, but it releases that memory during unload only released if the cnic is loaded.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +2 -0
@@ -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); }
Signature · 1 line
1.8.1.227.g44fe835
David Miller
maintainerFrom: "Yuval Mintz" <[email protected]>
Date: Wed, 1 May 2013 17:27:56 +0300
Quoted 3 lines
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.