Force a transmit status interrupt if transmit ring gets nearly full. Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
--- sky2-1.0.orig/drivers/net/sky2.c 2006-03-06 09:59:10.000000000 -0800 +++ sky2-1.0/drivers/net/sky2.c 2006-03-06 09:59:11.000000000 -0800 @@ -70,7 +70,7 @@ #define TX_RING_SIZE 512 #define TX_DEF_PENDING (TX_RING_SIZE - 1) #define TX_MIN_PENDING 64 -#define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS) +#define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) @@ -1114,6 +1114,7 @@ struct sky2_tx_le *le = NULL; struct tx_ring_info *re; unsigned i, len; + int avail; dma_addr_t mapping; u32 addr64; u16 mss; @@ -1256,10 +1257,14 @@ re->idx = sky2->tx_prod; le->ctrl |= EOP; - sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod); + avail = tx_avail(sky2); + if (avail < TX_MIN_PENDING) { + le->ctrl |= FRC_STAT; + if (avail <= MAX_SKB_TX_LE) + netif_stop_queue(dev); + } - if (tx_avail(sky2) <= MAX_SKB_TX_LE) - netif_stop_queue(dev); + sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod); out_unlock: spin_unlock(&sky2->tx_lock); -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html