Commit ff81fbbe authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Francois Romieu

[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: default avatarStephen Hemminger <shemminger@osdl.org>
parent 977bdf06
...@@ -2884,11 +2884,11 @@ static int sky2_set_coalesce(struct net_device *dev, ...@@ -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)) (ecmd->rx_coalesce_usecs_irq < tmin || ecmd->rx_coalesce_usecs_irq > tmax))
return -EINVAL; return -EINVAL;
if (ecmd->tx_max_coalesced_frames > 0xffff) if (ecmd->tx_max_coalesced_frames >= TX_RING_SIZE-1)
return -EINVAL; return -EINVAL;
if (ecmd->rx_max_coalesced_frames > 0xff) if (ecmd->rx_max_coalesced_frames > RX_MAX_PENDING)
return -EINVAL; return -EINVAL;
if (ecmd->rx_max_coalesced_frames_irq > 0xff) if (ecmd->rx_max_coalesced_frames_irq >RX_MAX_PENDING)
return -EINVAL; return -EINVAL;
if (ecmd->tx_coalesce_usecs == 0) if (ecmd->tx_coalesce_usecs == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment