sfc: add n_rx_overlength to ethtool stats
authorEdward Cree <ecree.xilinx@gmail.com>
Mon, 30 Sep 2024 13:52:41 +0000 (14:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 6 Oct 2024 15:02:23 +0000 (16:02 +0100)
The previous patch changed when we increment the RX queue's rx_packets
 counter, to match the semantics of netdev per-queue stats.  The
 differences between the old and new counts are scatter errors (which
 produce a WARN_ON) and this counter, which is incremented by
 efx_rx_packet__check_len() when an RX packet (which was placed in a
 single buffer by SG, i.e. n_frags == 1) has a length (from the RX
 event) which is too long to fit in the RX buffer.  If this occurs, we
 drop the packet and fire a ratelimited netif_err().
The counter previously was not reported anywhere; add it to ethtool -S
 output to ensure users still have this information.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ethtool_common.c

index a8baeacd83c089ec4f6126516a7df21a69296a36..ae32e08540fa19fad822b5f1e2d1e70a77d4a49a 100644 (file)
@@ -83,6 +83,7 @@ static const struct efx_sw_stat_desc efx_sw_stat_desc[] = {
        EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_outer_tcp_udp_chksum_err),
        EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_eth_crc_err),
        EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc),
+       EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_overlength),
        EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_events),
        EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_packets),
        EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_xdp_drops),