aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-08-12 04:23:26 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-13 02:02:42 -0400
commita18f5128828cd1af8091602f5233b00422e74c9a (patch)
tree8fcac1b43c5a6d4015abee6ebe16f8ff2e124a60
parenta119a069349b6ad32807ff1b09e417cf23514020 (diff)
bnx2x: Configurable pause scheme
When a given ring is running out of space, the FW can send pause towards the network. When working with multi-queues, when one queue is getting out of space it can block all other queues. The preferred scheme is to send pause frames only when running out of the shared internal chip buffers and if a given queue cannot place a packet on the host, it will drop it. Since some users might want to work in drop-less mode, allowing changing the behavior as a module parameter. Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bnx2x.h2
-rw-r--r--drivers/net/bnx2x_main.c14
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
index 1d0b72716f7a..004f4a8e1649 100644
--- a/drivers/net/bnx2x.h
+++ b/drivers/net/bnx2x.h
@@ -967,6 +967,8 @@ struct bnx2x {
967 dma_addr_t qm_mapping; 967 dma_addr_t qm_mapping;
968#endif 968#endif
969 969
970 int dropless_fc;
971
970 int dmae_ready; 972 int dmae_ready;
971 /* used to synchronize dmae accesses */ 973 /* used to synchronize dmae accesses */
972 struct mutex dmae_mutex; 974 struct mutex dmae_mutex;
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 039fdd4becff..0ebbc7794803 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -101,6 +101,10 @@ static int int_mode;
101module_param(int_mode, int, 0); 101module_param(int_mode, int, 0);
102MODULE_PARM_DESC(int_mode, " Force interrupt mode (1 INT#x; 2 MSI)"); 102MODULE_PARM_DESC(int_mode, " Force interrupt mode (1 INT#x; 2 MSI)");
103 103
104static int dropless_fc;
105module_param(dropless_fc, int, 0);
106MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring");
107
104static int poll; 108static int poll;
105module_param(poll, int, 0); 109module_param(poll, int, 0);
106MODULE_PARM_DESC(poll, " Use polling (for debug)"); 110MODULE_PARM_DESC(poll, " Use polling (for debug)");
@@ -2369,7 +2373,7 @@ static void bnx2x_link_attn(struct bnx2x *bp)
2369 if (bp->link_vars.link_up) { 2373 if (bp->link_vars.link_up) {
2370 2374
2371 /* dropless flow control */ 2375 /* dropless flow control */
2372 if (CHIP_IS_E1H(bp)) { 2376 if (CHIP_IS_E1H(bp) && bp->dropless_fc) {
2373 int port = BP_PORT(bp); 2377 int port = BP_PORT(bp);
2374 u32 pause_enabled = 0; 2378 u32 pause_enabled = 0;
2375 2379
@@ -6359,9 +6363,6 @@ static int bnx2x_init_port(struct bnx2x *bp)
6359 REG_WR(bp, NIG_REG_LLH0_BRB1_DRV_MASK_MF + port*4, 6363 REG_WR(bp, NIG_REG_LLH0_BRB1_DRV_MASK_MF + port*4,
6360 (IS_E1HMF(bp) ? 0x1 : 0x2)); 6364 (IS_E1HMF(bp) ? 0x1 : 0x2));
6361 6365
6362 /* support pause requests from USDM, TSDM and BRB */
6363 REG_WR(bp, NIG_REG_LLFC_EGRESS_SRC_ENABLE_0 + port*4, 0x7);
6364
6365 { 6366 {
6366 REG_WR(bp, NIG_REG_LLFC_ENABLE_0 + port*4, 0); 6367 REG_WR(bp, NIG_REG_LLFC_ENABLE_0 + port*4, 0);
6367 REG_WR(bp, NIG_REG_LLFC_OUT_EN_0 + port*4, 0); 6368 REG_WR(bp, NIG_REG_LLFC_OUT_EN_0 + port*4, 0);
@@ -8677,6 +8678,11 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
8677 bp->dev->features |= NETIF_F_LRO; 8678 bp->dev->features |= NETIF_F_LRO;
8678 } 8679 }
8679 8680
8681 if (CHIP_IS_E1(bp))
8682 bp->dropless_fc = 0;
8683 else
8684 bp->dropless_fc = dropless_fc;
8685
8680 bp->mrrs = mrrs; 8686 bp->mrrs = mrrs;
8681 8687
8682 bp->tx_ring_size = MAX_TX_AVAIL; 8688 bp->tx_ring_size = MAX_TX_AVAIL;