if (rc)
return rc;
- if (xstats == NULL)
- return 0;
+ stat_count = RTE_DIM(bnxt_rx_stats_strings) +
+ RTE_DIM(bnxt_tx_stats_strings) +
+ RTE_DIM(bnxt_func_stats_strings) +
+ RTE_DIM(bnxt_rx_ext_stats_strings) +
+ RTE_DIM(bnxt_tx_ext_stats_strings) +
+ bnxt_flow_stats_cnt(bp);
- memset(xstats, 0, sizeof(*xstats));
+ if (n < stat_count || xstats == NULL)
+ return stat_count;
bnxt_hwrm_func_qstats(bp, 0xffff, NULL, &func_qstats);
bnxt_hwrm_port_qstats(bp);
(bp->fw_tx_port_stats_ext_size /
stat_size));
- count = RTE_DIM(bnxt_rx_stats_strings) +
- RTE_DIM(bnxt_tx_stats_strings) +
- RTE_DIM(bnxt_func_stats_strings) +
- RTE_DIM(bnxt_rx_ext_stats_strings) +
- RTE_DIM(bnxt_tx_ext_stats_strings) +
- bnxt_flow_stats_cnt(bp);
-
- stat_count = count;
-
- if (n < count)
- return count;
+ memset(xstats, 0, sizeof(*xstats));
count = 0;
for (i = 0; i < RTE_DIM(bnxt_rx_stats_strings); i++) {