bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX.
Subsystems (2)
PATCH 1/6 bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX.
Checking the flag is more correct than checking bp->irq_nvecs. By accident it is not a problem because we always have more than 1 vectors when using MSIX mode.
--- drivers/net/bnx2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/bnx2.c +1 -1
@@ -4940,7 +4940,7 @@ bnx2_init_chip(struct bnx2 *bp)BNX2_HC_CONFIG_COLLECT_STATS ; } -if (bp->irq_nvecs >1 ) { +if (bp->flags &BNX2_FLAG_USING_MSIX ) {REG_WR (bp,BNX2_HC_MSIX_BIT_VECTOR ,BNX2_HC_MSIX_BIT_VECTOR_VAL );
Signature · 1 line
1.6.4.GIT
PATCH 2/6 bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change.
New status blocks are allocated during MTU change so we need to update this information for the cnic driver.
--- drivers/net/bnx2.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/bnx2.c +7 -0
@@ -7141,6 +7141,13 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)dev_close (bp->dev);return rc; } +#ifdef BCM_CNIC +mutex_lock (&bp->cnic_lock); +/* Let cnic know about the new status block. */ +if (bp->cnic_eth_dev.drv_state &CNIC_DRV_STATE_REGD ) +bnx2_setup_cnic_irq_info (bp); +mutex_unlock (&bp->cnic_lock); +#endif bnx2_netif_start (bp); }return 0 ;
Signature · 1 line
1.6.4.GIT
PATCH 3/6 bnx2: Adjust flow control water marks.
The current water marks are too high and can cause unnecessary flow control frames.
--- drivers/net/bnx2.c | 2 +- drivers/net/bnx2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnx2.c +1 -1
@@ -1277,7 +1277,7 @@ bnx2_init_rx_context(struct bnx2 *bp, u32 cid)if (lo_water >= bp->rx_ring_size) lo_water =0 ; - hi_water = bp->rx_ring_size /4 ; + hi_water =min_t (int, bp->rx_ring_size /4 , lo_water +16 );if (hi_water <= lo_water) lo_water =0 ;
drivers/net/bnx2.h +1 -1
@@ -349,7 +349,7 @@ struct l2_fhdr {#define BNX2_L2CTX_BD_PRE_READ 0x00000000#define BNX2_L2CTX_CTX_SIZE 0x00000000#define BNX2_L2CTX_CTX_TYPE 0x00000000 -#define BNX2_L2CTX_LO_WATER_MARK_DEFAULT 32 +#define BNX2_L2CTX_LO_WATER_MARK_DEFAULT 4#define BNX2_L2CTX_LO_WATER_MARK_SCALE 4#define BNX2_L2CTX_LO_WATER_MARK_DIS 0#define BNX2_L2CTX_HI_WATER_MARK_SHIFT 4
Signature · 1 line
1.6.4.GIT
PATCH 4/6 bnx2: Allow user-specified multiple advertisement speed values.
Remove unnecessary code that works around older versions of ethtool that can pass down invalid advertisement speed values. This old code prevents the user from specifying multiple advertisement values. The new code uses simple masking to mask out invalid advertisment bits.
--- drivers/net/bnx2.c | 33 ++++++++------------------------- 1 files changed, 8 insertions(+), 25 deletions(-)
drivers/net/bnx2.c +8 -25
@@ -6751,32 +6751,15 @@ bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)if (cmd->autoneg ==AUTONEG_ENABLE ) { autoneg |=AUTONEG_SPEED ; - cmd->advertising &=ETHTOOL_ALL_COPPER_SPEED ; - -/* allow advertising 1 speed */ -if ((cmd->advertising == ADVERTISED_10baseT_Half) || - (cmd->advertising == ADVERTISED_10baseT_Full) || - (cmd->advertising == ADVERTISED_100baseT_Half) || - (cmd->advertising == ADVERTISED_100baseT_Full)) { - -if (cmd->port ==PORT_FIBRE ) - goto err_out_unlock; - - advertising = cmd->advertising; - - }else if (cmd->advertising == ADVERTISED_2500baseX_Full) { -if (!(bp->phy_flags &BNX2_PHY_FLAG_2_5G_CAPABLE ) || - (cmd->port ==PORT_TP )) - goto err_out_unlock; - }else if (cmd->advertising == ADVERTISED_1000baseT_Full) - advertising = cmd->advertising; -else if (cmd->advertising == ADVERTISED_1000baseT_Half) - goto err_out_unlock; -else { -if (cmd->port ==PORT_FIBRE ) - advertising =ETHTOOL_ALL_FIBRE_SPEED ; -else + advertising = cmd->advertising; +if (cmd->port ==PORT_TP ) { + advertising &=ETHTOOL_ALL_COPPER_SPEED ; +if (!advertising) advertising =ETHTOOL_ALL_COPPER_SPEED ; + }else { + advertising &=ETHTOOL_ALL_FIBRE_SPEED ; +if (!advertising) + advertising =ETHTOOL_ALL_FIBRE_SPEED ; } advertising |= ADVERTISED_Autoneg; }
Signature · 1 line
1.6.4.GIT
PATCH 5/6 bnx2: Fix bug when saving statistics.
From: Patrick Rabau <[email protected]>
This fixes the problem of dropping the carry when adding 2 32-bit values. Switch to use array indexing for better readability.
Reported by and fix provided by Patrick Rabau.
--- drivers/net/bnx2.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/bnx2.c +5 -5
@@ -6555,16 +6555,16 @@ bnx2_save_stats(struct bnx2 *bp)u32 hi;u64 lo; - hi = *(temp_stats + i) + *(hw_stats + i); - lo = *(temp_stats + i +1 ) + *(hw_stats + i +1 ); + hi = temp_stats[i] + hw_stats[i]; + lo = (u64 ) temp_stats[i +1 ] + (u64 ) hw_stats[i +1 ];if (lo >0xffffffff ) hi++; - *(temp_stats + i) = hi; - *(temp_stats + i +1 ) = lo &0xffffffff ; + temp_stats[i] = hi; + temp_stats[i +1 ] = lo &0xffffffff ; }for ( ; i <sizeof (struct statistics_block ) /4 ; i++) - *(temp_stats + i) = *(temp_stats + i) + *(hw_stats + i); + temp_stats[i] += hw_stats[i]; }#define GET_64BIT_NET_STATS64 (ctr) \
Signature · 1 line
1.6.4.GIT
Re: [PATCH -next 5/6] bnx2: Fix bug when saving statistics.
From: "Michael Chan" <[email protected]>
Date: Mon, 15 Feb 2010 21:42:11 -0800
Quoted 9 lines
From: Patrick Rabau <[email protected]>
This fixes the problem of dropping the carry when adding 2 32-bit values. Switch to use array indexing for better readability.
Reported by and fix provided by Patrick Rabau.
Signed-off-by Michael Chan <[email protected]>Signed-off-by Benjamin Li <[email protected]>
Applied.
A message that is not in the archive (sent off-list or not yet received): [email protected]
David Miller
maintainerRe: [PATCH -next 6/6] bnx2: Update firmwares and update version to 2.0.8.
From: "Michael Chan" <[email protected]>
Date: Mon, 15 Feb 2010 21:42:12 -0800
Quoted 4 lines
- Increase FTQ depth to 256 to ehnabce performance.
- Fix RV2P context corruption on 5709 when flow control is enabled.Signed-off-by Michael Chan <[email protected]>
Also applied, thanks!
Re: [PATCH -next 4/6] bnx2: Allow user-specified multiple advertisement speed values.
In reply to Michael ChanFrom: "Michael Chan" <[email protected]>
Date: Mon, 15 Feb 2010 21:42:10 -0800
Quoted 8 lines
Remove unnecessary code that works around older versions of ethtool that can pass down invalid advertisement speed values. This old code prevents the user from specifying multiple advertisement values. The new code uses simple masking to mask out invalid advertisment bits.
Reported-by Vlad Yasevich <[email protected]>Signed-off-by Michael Chan <[email protected]>Signed-off-by Benjamin Li <[email protected]>
Applied.
Re: [PATCH -next 3/6] bnx2: Adjust flow control water marks.
In reply to Michael ChanFrom: "Michael Chan" <[email protected]>
Date: Mon, 15 Feb 2010 21:42:09 -0800
Quoted 5 lines
The current water marks are too high and can cause unnecessary flow control frames.
Signed-off-by Michael Chan <[email protected]>Signed-off-by Benjamin Li <[email protected]>
Applied.
Re: [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change.
In reply to Michael ChanFrom: "Michael Chan" <[email protected]>
Date: Mon, 15 Feb 2010 21:42:08 -0800
Quoted 5 lines
New status blocks are allocated during MTU change so we need to update this information for the cnic driver.
Signed-off-by Michael Chan <[email protected]>Signed-off-by Benjamin Li <[email protected]>
Applied.
From: "Michael Chan" <[email protected]>
Date: Mon, 15 Feb 2010 21:42:07 -0800
Quoted 6 lines
Checking the flag is more correct than checking
bp->irq_nvecs. By accident it is not a problem because we always have more than 1 vectors when using MSIX mode.Signed-off-by Michael Chan <[email protected]>Signed-off-by Benjamin Li <[email protected]>
Applied.