sky2: force early transmit interrupts

Avoid premature transmit ring full conditions.
Force a transmit status interrupt if transmit ring gets nearly full
and after a TSO send.

Allow more entries in transmit ring to be used if dma_addr is 32 bits

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
This commit is contained in:
Stephen Hemminger 2006-03-07 11:06:36 -08:00 committed by Francois Romieu
parent 28a3186019
commit b19666d920

View file

@ -74,7 +74,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))
@ -1145,6 +1145,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
struct sky2_tx_le *le = NULL;
struct tx_ring_info *re;
unsigned i, len;
int avail;
dma_addr_t mapping;
u32 addr64;
u16 mss;
@ -1287,12 +1288,16 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
re->idx = sky2->tx_prod;
le->ctrl |= EOP;
avail = tx_avail(sky2);
if (mss != 0 || avail < TX_MIN_PENDING) {
le->ctrl |= FRC_STAT;
if (avail <= MAX_SKB_TX_LE)
netif_stop_queue(dev);
}
sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod,
&sky2->tx_last_put, TX_RING_SIZE);
if (tx_avail(sky2) <= MAX_SKB_TX_LE)
netif_stop_queue(dev);
out_unlock:
spin_unlock(&sky2->tx_lock);