[PATCH] skge: don't allow transmit ring to be too small
authorStephen Hemminger <shemminger@osdl.org>
Mon, 15 May 2006 23:32:39 +0000 (16:32 -0700)
committerJeff Garzik <jeff@garzik.org>
Sat, 20 May 2006 04:17:07 +0000 (00:17 -0400)
The driver will get stuck (permanent transmit timeout), if the transmit
ring size is set too small.  It needs to have enough ring elements to
hold one maximum size transmit.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/skge.c

index 0dd4247..5ca5a1b 100644 (file)
@@ -401,7 +401,7 @@ static int skge_set_ring_param(struct net_device *dev,
        int err;
 
        if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
-           p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE)
+           p->tx_pending < MAX_SKB_FRAGS+1 || p->tx_pending > MAX_TX_RING_SIZE)
                return -EINVAL;
 
        skge->rx_ring.count = p->rx_pending;