Commit da583f7b authored by Adam Wujek's avatar Adam Wujek 💬

[BUG: 1064] kernel/wr_pstats: add rx_errors and tx_carrier_errors to ifconfig

Add reporting via ifconfig:
--rx errors (counter RX PCS Errors from pstats)
--carrier (counter RX Sync Lost from pstats)
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 15c1567b
......@@ -52,6 +52,8 @@ static struct pstats_version_description pstats_desc[] = {
.cnt_names = "Inv pstats ver reported by FPGA",
.rx_packets = 0,
.tx_packets = 0,
.rx_errors = 0,
.tx_carrier_errors = 0,
.rx_length_errors = 0,
.rx_crc_errors = 0,
.rx_fifo_errors = 0,
......@@ -100,6 +102,8 @@ static struct pstats_version_description pstats_desc[] = {
"TRU Resp Valid", /* 38 */
.rx_packets = 19, /* RX Frames */
.tx_packets = 18, /* TX Frames */
.rx_errors = 6, /* RX PCS Errors */
.tx_carrier_errors = 3, /* RX Sync Lost */
.rx_length_errors = 7, /* RX Giant Frames */
.rx_crc_errors = 9, /* RX CRC Errors */
.rx_fifo_errors = 1, /* RX Overrun */
......@@ -385,6 +389,11 @@ int pstats_callback(int epnum, struct net_device_stats *stats)
stats->rx_packets = (unsigned long) pstats_dev.cntrs[epnum][index];
index = pstats_desc[firmware_version].tx_packets;
stats->tx_packets = (unsigned long) pstats_dev.cntrs[epnum][index];
index = pstats_desc[firmware_version].rx_errors;
stats->rx_errors = (unsigned long) pstats_dev.cntrs[epnum][index];
index = pstats_desc[firmware_version].tx_carrier_errors;
stats->tx_carrier_errors =
(unsigned long) pstats_dev.cntrs[epnum][index];
index = pstats_desc[firmware_version].rx_length_errors;
stats->rx_length_errors = (unsigned long)pstats_dev.cntrs[epnum][index];
index = pstats_desc[firmware_version].rx_crc_errors;
......
......@@ -33,6 +33,8 @@ extern int (*wr_nic_pstats_callback)(int epnum,
struct pstats_version_description {
unsigned int rx_packets;
unsigned int tx_packets;
unsigned int rx_errors;
unsigned int tx_carrier_errors;
unsigned int rx_length_errors;
unsigned int rx_crc_errors;
unsigned int rx_fifo_errors;
......
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