Skip to contentSkip to conversation

bnx2x: Fix the maximal values of coalescing timeouts.

PATCH Applied Eilon Greenstein 2 participants 2 messages Jul 5, 2009 – Jul 6, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 bnx2x: Fix the maximal values of coalescing timeouts.

This patch properly defines the maximum values for rx/tx coalescing timeouts.

---
 drivers/net/bnx2x.h      |    2 ++
 drivers/net/bnx2x_main.c |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/bnx2x.h +2 -0
index 8678457..85a737c 100644
@@ -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;
 
drivers/net/bnx2x_main.c +4 -4
index 5737b75..6c67be6 100644
@@ -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);

--
1.6.0.4