Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20992
b: refs/heads/master
c: b19666d
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Francois Romieu committed Mar 9, 2006
1 parent d2687a6 commit ca7fff8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28a31860191c0d5710d42f85510daac0a3c26a01
refs/heads/master: b19666d92009ad2aa8e12d25f2cab59fb32421eb
13 changes: 9 additions & 4 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit ca7fff8

Please sign in to comment.