Skip to content

Commit

Permalink
bnx2x: fix stats copying logic
Browse files Browse the repository at this point in the history
FW needs the driver statistics for management. Current logic is broken
in that the function that gathers the port statistics does not copy
its own statistics to a place where the FW can use it.
This patch causes every function that can pass statistics to the FW to
do so.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yuval Mintz authored and David S. Miller committed Sep 13, 2012
1 parent bef0540 commit 217aeb8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp)
if (CHIP_REV_IS_SLOW(bp))
return;

/* Update MCP's statistics if possible */
if (bp->func_stx)
memcpy(bnx2x_sp(bp, func_stats), &bp->func_stats,
sizeof(bp->func_stats));

/* loader */
if (bp->executer_idx) {
int loader_idx = PMF_DMAE_C(bp);
Expand Down Expand Up @@ -128,8 +133,6 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp)

} else if (bp->func_stx) {
*stats_comp = 0;
memcpy(bnx2x_sp(bp, func_stats), &bp->func_stats,
sizeof(bp->func_stats));
bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp));
}
}
Expand Down

0 comments on commit 217aeb8

Please sign in to comment.