OSDN Git Service

net: mhi: Add rx_length_errors stat
authorLoic Poulain <loic.poulain@linaro.org>
Tue, 9 Feb 2021 09:05:57 +0000 (10:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Feb 2021 23:11:51 +0000 (15:11 -0800)
This can be used by proto when packet len is incorrect.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mhi/mhi.h
drivers/net/mhi/net.c

index 5050e4a..82210e0 100644 (file)
@@ -9,6 +9,7 @@ struct mhi_net_stats {
        u64_stats_t rx_bytes;
        u64_stats_t rx_errors;
        u64_stats_t rx_dropped;
+       u64_stats_t rx_length_errors;
        u64_stats_t tx_packets;
        u64_stats_t tx_bytes;
        u64_stats_t tx_errors;
index 58b4b7c..44cbfb3 100644 (file)
@@ -95,6 +95,7 @@ static void mhi_ndo_get_stats64(struct net_device *ndev,
                stats->rx_bytes = u64_stats_read(&mhi_netdev->stats.rx_bytes);
                stats->rx_errors = u64_stats_read(&mhi_netdev->stats.rx_errors);
                stats->rx_dropped = u64_stats_read(&mhi_netdev->stats.rx_dropped);
+               stats->rx_length_errors = u64_stats_read(&mhi_netdev->stats.rx_length_errors);
        } while (u64_stats_fetch_retry_irq(&mhi_netdev->stats.rx_syncp, start));
 
        do {