Commit 217aeb89 authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

bnx2x: fix stats copying logic

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: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bef05406
...@@ -101,6 +101,11 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp) ...@@ -101,6 +101,11 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp)
if (CHIP_REV_IS_SLOW(bp)) if (CHIP_REV_IS_SLOW(bp))
return; 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 */ /* loader */
if (bp->executer_idx) { if (bp->executer_idx) {
int loader_idx = PMF_DMAE_C(bp); int loader_idx = PMF_DMAE_C(bp);
...@@ -128,8 +133,6 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp) ...@@ -128,8 +133,6 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp)
} else if (bp->func_stx) { } else if (bp->func_stx) {
*stats_comp = 0; *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)); bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment