提交 9947f83f 编写于 作者: M Michael Chan 提交者: David S. Miller

bnxt_en: Include some hardware port statistics in ndo_get_stats64().

Include some of the port error counters (e.g. crc) in ->ndo_get_stats64()
for the PF device.
Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3bdf56c4
......@@ -4935,6 +4935,22 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
stats->tx_dropped += le64_to_cpu(hw_stats->tx_drop_pkts);
}
if (bp->flags & BNXT_FLAG_PORT_STATS) {
struct rx_port_stats *rx = bp->hw_rx_port_stats;
struct tx_port_stats *tx = bp->hw_tx_port_stats;
stats->rx_crc_errors = le64_to_cpu(rx->rx_fcs_err_frames);
stats->rx_frame_errors = le64_to_cpu(rx->rx_align_err_frames);
stats->rx_length_errors = le64_to_cpu(rx->rx_undrsz_frames) +
le64_to_cpu(rx->rx_ovrsz_frames) +
le64_to_cpu(rx->rx_runt_frames);
stats->rx_errors = le64_to_cpu(rx->rx_false_carrier_frames) +
le64_to_cpu(rx->rx_jbr_frames);
stats->collisions = le64_to_cpu(tx->tx_total_collisions);
stats->tx_fifo_errors = le64_to_cpu(tx->tx_fifo_underruns);
stats->tx_errors = le64_to_cpu(tx->tx_err);
}
return stats;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册