Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291387
b: refs/heads/master
c: f124488
h: refs/heads/master
i:
  291385: 774e7df
  291383: d3b7185
v: v3
  • Loading branch information
Dmitry Kravkov authored and David S. Miller committed Mar 13, 2012
1 parent bf3e6c9 commit aa9c18f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 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: 241fb5d2b4205a523a50a85f9c312e1eda8ec53d
refs/heads/master: f124488e4713dc9afa2028553261b1d399286e68
17 changes: 9 additions & 8 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp,
{
struct bnx2x *bp = fp->bp;
u16 ring_prod, cqe_ring_prod;
int i;
int i, failure_cnt = 0;

fp->rx_comp_cons = 0;
cqe_ring_prod = ring_prod = 0;
Expand All @@ -1153,26 +1153,27 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp,
*/
for (i = 0; i < rx_ring_size; i++) {
if (bnx2x_alloc_rx_data(bp, fp, ring_prod) < 0) {
fp->eth_q_stats.rx_skb_alloc_failed++;
failure_cnt++;
continue;
}
ring_prod = NEXT_RX_IDX(ring_prod);
cqe_ring_prod = NEXT_RCQ_IDX(cqe_ring_prod);
WARN_ON(ring_prod <= (i - fp->eth_q_stats.rx_skb_alloc_failed));
WARN_ON(ring_prod <= (i - failure_cnt));
}

if (fp->eth_q_stats.rx_skb_alloc_failed)
BNX2X_ERR("was only able to allocate "
"%d rx skbs on queue[%d]\n",
(i - fp->eth_q_stats.rx_skb_alloc_failed), fp->index);
if (failure_cnt)
BNX2X_ERR("was only able to allocate %d rx skbs on queue[%d]\n",
i - failure_cnt, fp->index);

fp->rx_bd_prod = ring_prod;
/* Limit the CQE producer by the CQE ring size */
fp->rx_comp_prod = min_t(u16, NUM_RCQ_RINGS*RCQ_DESC_CNT,
cqe_ring_prod);
fp->rx_pkt = fp->rx_calls = 0;

return i - fp->eth_q_stats.rx_skb_alloc_failed;
fp->eth_q_stats.rx_skb_alloc_failed += failure_cnt;

return i - failure_cnt;
}

/* Statistics ID are global per chip/path, while Client IDs for E1x are per
Expand Down

0 comments on commit aa9c18f

Please sign in to comment.