aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index d63d1327b051..86436c77af03 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -522,20 +522,16 @@ static void bnx2x_func_stats_init(struct bnx2x *bp)
522/* should be called under stats_sema */ 522/* should be called under stats_sema */
523static void __bnx2x_stats_start(struct bnx2x *bp) 523static void __bnx2x_stats_start(struct bnx2x *bp)
524{ 524{
525 /* vfs travel through here as part of the statistics FSM, but no action 525 if (IS_PF(bp)) {
526 * is required 526 if (bp->port.pmf)
527 */ 527 bnx2x_port_stats_init(bp);
528 if (IS_VF(bp))
529 return;
530
531 if (bp->port.pmf)
532 bnx2x_port_stats_init(bp);
533 528
534 else if (bp->func_stx) 529 else if (bp->func_stx)
535 bnx2x_func_stats_init(bp); 530 bnx2x_func_stats_init(bp);
536 531
537 bnx2x_hw_stats_post(bp); 532 bnx2x_hw_stats_post(bp);
538 bnx2x_storm_stats_post(bp); 533 bnx2x_storm_stats_post(bp);
534 }
539 535
540 bp->stats_started = true; 536 bp->stats_started = true;
541} 537}
@@ -1997,3 +1993,14 @@ void bnx2x_afex_collect_stats(struct bnx2x *bp, void *void_afex_stats,
1997 estats->mac_discard); 1993 estats->mac_discard);
1998 } 1994 }
1999} 1995}
1996
1997void bnx2x_stats_safe_exec(struct bnx2x *bp,
1998 void (func_to_exec)(void *cookie),
1999 void *cookie){
2000 if (down_timeout(&bp->stats_sema, HZ/10))
2001 BNX2X_ERR("Unable to acquire stats lock\n");
2002 bnx2x_stats_comp(bp);
2003 func_to_exec(cookie);
2004 __bnx2x_stats_start(bp);
2005 up(&bp->stats_sema);
2006}