bnx2x: Fix the maximal values of coalescing timeouts.
authorEilon Greenstein <eilong@broadcom.com>
Sun, 5 Jul 2009 04:18:14 +0000 (04:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jul 2009 01:03:23 +0000 (18:03 -0700)
This patch properly defines the maximum values for rx/tx coalescing timeouts.

Signed-off-by: Vlad Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2x.h
drivers/net/bnx2x_main.c

index 8678457849f9ff32e5bb7b71c1af55fc43c7824f..85a737c5c23f2647577127b1e045edbaafc058a0 100644 (file)
@@ -902,6 +902,8 @@ struct bnx2x {
        u16                     rx_quick_cons_trip;
        u16                     rx_ticks_int;
        u16                     rx_ticks;
+/* Maximal coalescing timeout in us */
+#define BNX2X_MAX_COALESCE_TOUT                (0xf0*12)
 
        u32                     lin_cnt;
 
index 5737b7519005db13cad424e6ca92835678bac013..6c67be679764d6eb0daeb776ac9408830e427c8e 100644 (file)
@@ -9069,12 +9069,12 @@ static int bnx2x_set_coalesce(struct net_device *dev,
        struct bnx2x *bp = netdev_priv(dev);
 
        bp->rx_ticks = (u16) coal->rx_coalesce_usecs;
-       if (bp->rx_ticks > 3000)
-               bp->rx_ticks = 3000;
+       if (bp->rx_ticks > BNX2X_MAX_COALESCE_TOUT)
+               bp->rx_ticks = BNX2X_MAX_COALESCE_TOUT;
 
        bp->tx_ticks = (u16) coal->tx_coalesce_usecs;
-       if (bp->tx_ticks > 0x3000)
-               bp->tx_ticks = 0x3000;
+       if (bp->tx_ticks > BNX2X_MAX_COALESCE_TOUT)
+               bp->tx_ticks = BNX2X_MAX_COALESCE_TOUT;
 
        if (netif_running(dev))
                bnx2x_update_coalesce(bp);