aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index d68accea380b..78ed633ceb82 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2652,10 +2652,10 @@ static int bnx2_poll_work(struct bnx2 *bp, int work_done, int budget)
2652 REG_RD(bp, BNX2_HC_COMMAND); 2652 REG_RD(bp, BNX2_HC_COMMAND);
2653 } 2653 }
2654 2654
2655 if (bp->status_blk->status_tx_quick_consumer_index0 != bp->hw_tx_cons) 2655 if (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons)
2656 bnx2_tx_int(bp); 2656 bnx2_tx_int(bp);
2657 2657
2658 if (bp->status_blk->status_rx_quick_consumer_index0 != bp->hw_rx_cons) 2658 if (sblk->status_rx_quick_consumer_index0 != bp->hw_rx_cons)
2659 work_done += bnx2_rx_int(bp, budget - work_done); 2659 work_done += bnx2_rx_int(bp, budget - work_done);
2660 2660
2661 return work_done; 2661 return work_done;
@@ -2665,6 +2665,7 @@ static int bnx2_poll(struct napi_struct *napi, int budget)
2665{ 2665{
2666 struct bnx2 *bp = container_of(napi, struct bnx2, napi); 2666 struct bnx2 *bp = container_of(napi, struct bnx2, napi);
2667 int work_done = 0; 2667 int work_done = 0;
2668 struct status_block *sblk = bp->status_blk;
2668 2669
2669 while (1) { 2670 while (1) {
2670 work_done = bnx2_poll_work(bp, work_done, budget); 2671 work_done = bnx2_poll_work(bp, work_done, budget);
@@ -2672,16 +2673,19 @@ static int bnx2_poll(struct napi_struct *napi, int budget)
2672 if (unlikely(work_done >= budget)) 2673 if (unlikely(work_done >= budget))
2673 break; 2674 break;
2674 2675
2676 /* bp->last_status_idx is used below to tell the hw how
2677 * much work has been processed, so we must read it before
2678 * checking for more work.
2679 */
2680 bp->last_status_idx = sblk->status_idx;
2681 rmb();
2675 if (likely(!bnx2_has_work(bp))) { 2682 if (likely(!bnx2_has_work(bp))) {
2676 bp->last_status_idx = bp->status_blk->status_idx;
2677 rmb();
2678
2679 netif_rx_complete(bp->dev, napi); 2683 netif_rx_complete(bp->dev, napi);
2680 if (likely(bp->flags & USING_MSI_FLAG)) { 2684 if (likely(bp->flags & USING_MSI_FLAG)) {
2681 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, 2685 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
2682 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | 2686 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
2683 bp->last_status_idx); 2687 bp->last_status_idx);
2684 return 0; 2688 break;
2685 } 2689 }
2686 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, 2690 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
2687 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | 2691 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |