diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-03-07 14:06:36 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2006-03-09 17:19:02 -0500 |
commit | b19666d92009ad2aa8e12d25f2cab59fb32421eb (patch) | |
tree | f2217c5d18df21eb87d8f3571b105598f86e6314 /drivers/net/sky2.c | |
parent | 28a31860191c0d5710d42f85510daac0a3c26a01 (diff) |
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>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index dc4feaf79be2..1078b7cab076 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -74,7 +74,7 @@ | |||
74 | #define TX_RING_SIZE 512 | 74 | #define TX_RING_SIZE 512 |
75 | #define TX_DEF_PENDING (TX_RING_SIZE - 1) | 75 | #define TX_DEF_PENDING (TX_RING_SIZE - 1) |
76 | #define TX_MIN_PENDING 64 | 76 | #define TX_MIN_PENDING 64 |
77 | #define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS) | 77 | #define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) |
78 | 78 | ||
79 | #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ | 79 | #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ |
80 | #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) | 80 | #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) | |||
1145 | struct sky2_tx_le *le = NULL; | 1145 | struct sky2_tx_le *le = NULL; |
1146 | struct tx_ring_info *re; | 1146 | struct tx_ring_info *re; |
1147 | unsigned i, len; | 1147 | unsigned i, len; |
1148 | int avail; | ||
1148 | dma_addr_t mapping; | 1149 | dma_addr_t mapping; |
1149 | u32 addr64; | 1150 | u32 addr64; |
1150 | u16 mss; | 1151 | u16 mss; |
@@ -1287,12 +1288,16 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1287 | re->idx = sky2->tx_prod; | 1288 | re->idx = sky2->tx_prod; |
1288 | le->ctrl |= EOP; | 1289 | le->ctrl |= EOP; |
1289 | 1290 | ||
1291 | avail = tx_avail(sky2); | ||
1292 | if (mss != 0 || avail < TX_MIN_PENDING) { | ||
1293 | le->ctrl |= FRC_STAT; | ||
1294 | if (avail <= MAX_SKB_TX_LE) | ||
1295 | netif_stop_queue(dev); | ||
1296 | } | ||
1297 | |||
1290 | sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, | 1298 | sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, |
1291 | &sky2->tx_last_put, TX_RING_SIZE); | 1299 | &sky2->tx_last_put, TX_RING_SIZE); |
1292 | 1300 | ||
1293 | if (tx_avail(sky2) <= MAX_SKB_TX_LE) | ||
1294 | netif_stop_queue(dev); | ||
1295 | |||
1296 | out_unlock: | 1301 | out_unlock: |
1297 | spin_unlock(&sky2->tx_lock); | 1302 | spin_unlock(&sky2->tx_lock); |
1298 | 1303 | ||