Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135016
b: refs/heads/master
c: 8534f32
h: refs/heads/master
v: v3
  • Loading branch information
Eilon Greenstein authored and David S. Miller committed Mar 3, 2009
1 parent 7646728 commit 7c4b20f
Show file tree
Hide file tree
Showing 2 changed files with 19 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: 7961f79123604a395dc467c605a94bbaed74df83
refs/heads/master: 8534f32c2fb86bff629f7152bc3096245252062c
22 changes: 18 additions & 4 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10068,14 +10068,27 @@ static int bnx2x_poll(struct napi_struct *napi, int budget)
if (bnx2x_has_tx_work(fp))
bnx2x_tx_int(fp);

if (bnx2x_has_rx_work(fp))
if (bnx2x_has_rx_work(fp)) {
work_done = bnx2x_rx_int(fp, budget);

rmb(); /* BNX2X_HAS_WORK() reads the status block */
/* must not complete if we consumed full budget */
if (work_done >= budget)
goto poll_again;
}

/* must not complete if we consumed full budget */
if ((work_done < budget) && !BNX2X_HAS_WORK(fp)) {
/* BNX2X_HAS_WORK() reads the status block, thus we need to
* ensure that status block indices have been actually read
* (bnx2x_update_fpsb_idx) prior to this check (BNX2X_HAS_WORK)
* so that we won't write the "newer" value of the status block to IGU
* (if there was a DMA right after BNX2X_HAS_WORK and
* if there is no rmb, the memory reading (bnx2x_update_fpsb_idx)
* may be postponed to right before bnx2x_ack_sb). In this case
* there will never be another interrupt until there is another update
* of the status block, while there is still unhandled work.
*/
rmb();

if (!BNX2X_HAS_WORK(fp)) {
#ifdef BNX2X_STOP_ON_ERROR
poll_panic:
#endif
Expand All @@ -10087,6 +10100,7 @@ static int bnx2x_poll(struct napi_struct *napi, int budget)
le16_to_cpu(fp->fp_c_idx), IGU_INT_ENABLE, 1);
}

poll_again:
return work_done;
}

Expand Down

0 comments on commit 7c4b20f

Please sign in to comment.