Skip to content

Commit

Permalink
bnx2x: perform statistics "action" before state transition.
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladislav Zolotarov authored and David S. Miller committed Feb 28, 2011
1 parent ff80ee0 commit 6313528
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/bnx2x/bnx2x_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,14 +1239,14 @@ void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event)
if (unlikely(bp->panic))
return;

bnx2x_stats_stm[bp->stats_state][event].action(bp);

/* Protect a state change flow */
spin_lock_bh(&bp->stats_lock);
state = bp->stats_state;
bp->stats_state = bnx2x_stats_stm[state][event].next_state;
spin_unlock_bh(&bp->stats_lock);

bnx2x_stats_stm[state][event].action(bp);

if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))
DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
state, event, bp->stats_state);
Expand Down

0 comments on commit 6313528

Please sign in to comment.