@@ -1547,11 +1547,51 @@ static void bnx2x_prep_fw_stats_req(struct bnx2x *bp)
1547
1547
}
1548
1548
}
1549
1549
1550
+ void bnx2x_memset_stats (struct bnx2x * bp )
1551
+ {
1552
+ int i ;
1553
+
1554
+ /* function stats */
1555
+ for_each_queue (bp , i ) {
1556
+ struct bnx2x_fp_stats * fp_stats = & bp -> fp_stats [i ];
1557
+
1558
+ memset (& fp_stats -> old_tclient , 0 ,
1559
+ sizeof (fp_stats -> old_tclient ));
1560
+ memset (& fp_stats -> old_uclient , 0 ,
1561
+ sizeof (fp_stats -> old_uclient ));
1562
+ memset (& fp_stats -> old_xclient , 0 ,
1563
+ sizeof (fp_stats -> old_xclient ));
1564
+ if (bp -> stats_init ) {
1565
+ memset (& fp_stats -> eth_q_stats , 0 ,
1566
+ sizeof (fp_stats -> eth_q_stats ));
1567
+ memset (& fp_stats -> eth_q_stats_old , 0 ,
1568
+ sizeof (fp_stats -> eth_q_stats_old ));
1569
+ }
1570
+ }
1571
+
1572
+ memset (& bp -> dev -> stats , 0 , sizeof (bp -> dev -> stats ));
1573
+
1574
+ if (bp -> stats_init ) {
1575
+ memset (& bp -> net_stats_old , 0 , sizeof (bp -> net_stats_old ));
1576
+ memset (& bp -> fw_stats_old , 0 , sizeof (bp -> fw_stats_old ));
1577
+ memset (& bp -> eth_stats_old , 0 , sizeof (bp -> eth_stats_old ));
1578
+ memset (& bp -> eth_stats , 0 , sizeof (bp -> eth_stats ));
1579
+ memset (& bp -> func_stats , 0 , sizeof (bp -> func_stats ));
1580
+ }
1581
+
1582
+ bp -> stats_state = STATS_STATE_DISABLED ;
1583
+
1584
+ if (bp -> port .pmf && bp -> port .port_stx )
1585
+ bnx2x_port_stats_base_init (bp );
1586
+
1587
+ /* mark the end of statistics initializiation */
1588
+ bp -> stats_init = false;
1589
+ }
1590
+
1550
1591
void bnx2x_stats_init (struct bnx2x * bp )
1551
1592
{
1552
1593
int /*abs*/ port = BP_PORT (bp );
1553
1594
int mb_idx = BP_FW_MB_IDX (bp );
1554
- int i ;
1555
1595
1556
1596
bp -> stats_pending = 0 ;
1557
1597
bp -> executer_idx = 0 ;
@@ -1587,36 +1627,11 @@ void bnx2x_stats_init(struct bnx2x *bp)
1587
1627
& (bp -> port .old_nig_stats .egress_mac_pkt1_lo ), 2 );
1588
1628
}
1589
1629
1590
- /* function stats */
1591
- for_each_queue (bp , i ) {
1592
- struct bnx2x_fp_stats * fp_stats = & bp -> fp_stats [i ];
1593
-
1594
- memset (& fp_stats -> old_tclient , 0 ,
1595
- sizeof (fp_stats -> old_tclient ));
1596
- memset (& fp_stats -> old_uclient , 0 ,
1597
- sizeof (fp_stats -> old_uclient ));
1598
- memset (& fp_stats -> old_xclient , 0 ,
1599
- sizeof (fp_stats -> old_xclient ));
1600
- if (bp -> stats_init ) {
1601
- memset (& fp_stats -> eth_q_stats , 0 ,
1602
- sizeof (fp_stats -> eth_q_stats ));
1603
- memset (& fp_stats -> eth_q_stats_old , 0 ,
1604
- sizeof (fp_stats -> eth_q_stats_old ));
1605
- }
1606
- }
1607
-
1608
1630
/* Prepare statistics ramrod data */
1609
1631
bnx2x_prep_fw_stats_req (bp );
1610
1632
1611
- memset ( & bp -> dev -> stats , 0 , sizeof ( bp -> dev -> stats ));
1633
+ /* Clean SP from previous statistics */
1612
1634
if (bp -> stats_init ) {
1613
- memset (& bp -> net_stats_old , 0 , sizeof (bp -> net_stats_old ));
1614
- memset (& bp -> fw_stats_old , 0 , sizeof (bp -> fw_stats_old ));
1615
- memset (& bp -> eth_stats_old , 0 , sizeof (bp -> eth_stats_old ));
1616
- memset (& bp -> eth_stats , 0 , sizeof (bp -> eth_stats ));
1617
- memset (& bp -> func_stats , 0 , sizeof (bp -> func_stats ));
1618
-
1619
- /* Clean SP from previous statistics */
1620
1635
if (bp -> func_stx ) {
1621
1636
memset (bnx2x_sp (bp , func_stats ), 0 ,
1622
1637
sizeof (struct host_func_stats ));
@@ -1626,13 +1641,7 @@ void bnx2x_stats_init(struct bnx2x *bp)
1626
1641
}
1627
1642
}
1628
1643
1629
- bp -> stats_state = STATS_STATE_DISABLED ;
1630
-
1631
- if (bp -> port .pmf && bp -> port .port_stx )
1632
- bnx2x_port_stats_base_init (bp );
1633
-
1634
- /* mark the end of statistics initializiation */
1635
- bp -> stats_init = false;
1644
+ bnx2x_memset_stats (bp );
1636
1645
}
1637
1646
1638
1647
void bnx2x_save_statistics (struct bnx2x * bp )
0 commit comments