From: Stephen Hemminger Date: Wed, 22 Feb 2006 19:44:59 +0000 (-0800) Subject: [PATCH] sky2: limit coalescing values to ring size X-Git-Tag: v2.6.16-rc5~53^2~1^2~9 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ff81fbbe321c3a468b6225c673ca57efa501fbed;p=~emulex%2Finfiniband.git [PATCH] sky2: limit coalescing values to ring size Don't allow coalescing values to be bigger than the transmit ring. Since if you set them that big, the interrupt never happens and driver livelocks. Signed-off-by: Stephen Hemminger --- diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index ce135b84a54..cf7fd28d677 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -2884,11 +2884,11 @@ static int sky2_set_coalesce(struct net_device *dev, (ecmd->rx_coalesce_usecs_irq < tmin || ecmd->rx_coalesce_usecs_irq > tmax)) return -EINVAL; - if (ecmd->tx_max_coalesced_frames > 0xffff) + if (ecmd->tx_max_coalesced_frames >= TX_RING_SIZE-1) return -EINVAL; - if (ecmd->rx_max_coalesced_frames > 0xff) + if (ecmd->rx_max_coalesced_frames > RX_MAX_PENDING) return -EINVAL; - if (ecmd->rx_max_coalesced_frames_irq > 0xff) + if (ecmd->rx_max_coalesced_frames_irq >RX_MAX_PENDING) return -EINVAL; if (ecmd->tx_coalesce_usecs == 0)