Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44660
b: refs/heads/master
c: faac9c4
h: refs/heads/master
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Dec 18, 2006
1 parent 25a107e commit c8cd007
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: a3d384029aa304f8f3f5355d35f0ae274454f7cd
refs/heads/master: faac9c4b753f420c02bdce0785d2657087830a12
13 changes: 10 additions & 3 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,16 @@ static inline u32 bnx2_tx_avail(struct bnx2 *bp)
u32 diff;

smp_mb();
diff = TX_RING_IDX(bp->tx_prod) - TX_RING_IDX(bp->tx_cons);
if (diff > MAX_TX_DESC_CNT)
diff = (diff & MAX_TX_DESC_CNT) - 1;

/* The ring uses 256 indices for 255 entries, one of them
* needs to be skipped.
*/
diff = bp->tx_prod - bp->tx_cons;
if (unlikely(diff >= TX_DESC_CNT)) {
diff &= 0xffff;
if (diff == TX_DESC_CNT)
diff = MAX_TX_DESC_CNT;
}
return (bp->tx_ring_size - diff);
}

Expand Down

0 comments on commit c8cd007

Please sign in to comment.