bnx2: Adjust flow control water marks.
authorMichael Chan <mchan@broadcom.com>
Mon, 15 Feb 2010 19:42:09 +0000 (19:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Feb 2010 23:19:03 +0000 (15:19 -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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2.c
drivers/net/bnx2.h

index 063f28394e3d1edf69d5677394562a8534bee4c3..dbe487f2915dddd51c1cb23252ad607c8dbb558e 100644 (file)
@@ -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;
index b860fbbff355bbc86371cf393ef93d55d43d2969..cd4b0e4637ab4aad478ca72304a42a36ecd29667 100644 (file)
@@ -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