* [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX.
@ 2010-02-16 5:42 Michael Chan
2010-02-16 5:42 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change Michael Chan
2010-02-16 23:20 ` [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX David Miller
0 siblings, 2 replies; 11+ messages in thread
From: Michael Chan @ 2010-02-16 5:42 UTC (permalink / raw)
To: davem; +Cc: netdev
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 <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/bnx2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index c7f5515..48bc578 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -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);
--
1.6.4.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change.
2010-02-16 5:42 [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX Michael Chan
@ 2010-02-16 5:42 ` Michael Chan
2010-02-16 5:42 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks Michael Chan
2010-02-16 23:20 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change David Miller
2010-02-16 23:20 ` [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX David Miller
1 sibling, 2 replies; 11+ messages in thread
From: Michael Chan @ 2010-02-16 5:42 UTC (permalink / raw)
To: davem; +Cc: netdev
New status blocks are allocated during MTU change so we need to
update this information for the cnic driver.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/bnx2.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 48bc578..063f283 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -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;
--
1.6.4.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH -next 3/6] bnx2: Adjust flow control water marks.
2010-02-16 5:42 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change Michael Chan
@ 2010-02-16 5:42 ` Michael Chan
2010-02-16 5:42 ` [PATCH -next 4/6] bnx2: Allow user-specified multiple advertisement speed values Michael Chan
2010-02-16 23:20 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks David Miller
2010-02-16 23:20 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change David Miller
1 sibling, 2 replies; 11+ messages in thread
From: Michael Chan @ 2010-02-16 5:42 UTC (permalink / raw)
To: davem; +Cc: netdev
The current water marks are too high and can cause unnecessary flow
control frames.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/bnx2.c | 2 +-
drivers/net/bnx2.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 063f283..54d43d8 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -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;
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index b860fbb..cd4b0e4 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -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
--
1.6.4.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH -next 4/6] bnx2: Allow user-specified multiple advertisement speed values.
2010-02-16 5:42 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks Michael Chan
@ 2010-02-16 5:42 ` Michael Chan
2010-02-16 5:42 ` [PATCH -next 5/6] bnx2: Fix bug when saving statistics Michael Chan
2010-02-16 23:20 ` [PATCH -next 4/6] bnx2: Allow user-specified multiple advertisement speed values David Miller
2010-02-16 23:20 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks David Miller
1 sibling, 2 replies; 11+ messages in thread
From: Michael Chan @ 2010-02-16 5:42 UTC (permalink / raw)
To: davem; +Cc: netdev
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 <vladislav.yasevich@hp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/bnx2.c | 33 ++++++++-------------------------
1 files changed, 8 insertions(+), 25 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 54d43d8..2c75fd7 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -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;
}
--
1.6.4.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH -next 3/6] bnx2: Adjust flow control water marks.
2010-02-16 5:42 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks Michael Chan
2010-02-16 5:42 ` [PATCH -next 4/6] bnx2: Allow user-specified multiple advertisement speed values Michael Chan
@ 2010-02-16 23:20 ` David Miller
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2010-02-16 23:20 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Mon, 15 Feb 2010 21:42:09 -0800
> The current water marks are too high and can cause unnecessary flow
> control frames.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change.
2010-02-16 5:42 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change Michael Chan
2010-02-16 5:42 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks Michael Chan
@ 2010-02-16 23:20 ` David Miller
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2010-02-16 23:20 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Mon, 15 Feb 2010 21:42:08 -0800
> New status blocks are allocated during MTU change so we need to
> update this information for the cnic driver.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX.
2010-02-16 5:42 [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX Michael Chan
2010-02-16 5:42 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change Michael Chan
@ 2010-02-16 23:20 ` David Miller
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2010-02-16 23:20 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Mon, 15 Feb 2010 21:42:07 -0800
> 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 <mchan@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-02-16 23:20 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-16 5:42 [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX Michael Chan
2010-02-16 5:42 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change Michael Chan
2010-02-16 5:42 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks Michael Chan
2010-02-16 5:42 ` [PATCH -next 4/6] bnx2: Allow user-specified multiple advertisement speed values Michael Chan
2010-02-16 5:42 ` [PATCH -next 5/6] bnx2: Fix bug when saving statistics Michael Chan
2010-02-16 23:20 ` David Miller
[not found] ` <1266298932-28129-6-git-send-email-mchan@broadcom.com>
2010-02-16 23:20 ` [PATCH -next 6/6] bnx2: Update firmwares and update version to 2.0.8 David Miller
2010-02-16 23:20 ` [PATCH -next 4/6] bnx2: Allow user-specified multiple advertisement speed values David Miller
2010-02-16 23:20 ` [PATCH -next 3/6] bnx2: Adjust flow control water marks David Miller
2010-02-16 23:20 ` [PATCH -next 2/6] bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change David Miller
2010-02-16 23:20 ` [PATCH -next 1/6] bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX 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).