]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
amd-xgbe: Add additional ethtool statistics
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Fri, 18 Aug 2017 14:04:14 +0000 (09:04 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Aug 2017 23:30:17 +0000 (16:30 -0700)
Add some additional statistics for tracking VXLAN packets and checksum
errors.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-dev.c
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
drivers/net/ethernet/amd/xgbe/xgbe.h

index 1bf671e02c0a7158e4f2ca65caae63466dbca483..671203dbea3dcb93b78947c4438ae0d7dcaa90c9 100644 (file)
@@ -1805,10 +1805,13 @@ static void xgbe_dev_xmit(struct xgbe_channel *channel)
                                  packet->length);
        }
 
-       if (vxlan)
+       if (vxlan) {
                XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, VNP,
                                  TX_NORMAL_DESC3_VXLAN_PACKET);
 
+               pdata->ext_stats.tx_vxlan_packets += packet->tx_packets;
+       }
+
        for (i = cur_index - start_index + 1; i < packet->rdesc_count; i++) {
                cur_index++;
                rdata = XGBE_GET_DESC_DATA(ring, cur_index);
@@ -1981,6 +1984,7 @@ static int xgbe_dev_read(struct xgbe_channel *channel)
        if (XGMAC_GET_BITS_LE(rdesc->desc2, RX_NORMAL_DESC2, TNP)) {
                XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
                               TNP, 1);
+               pdata->ext_stats.rx_vxlan_packets++;
 
                l34t = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, L34T);
                switch (l34t) {
@@ -2018,11 +2022,13 @@ static int xgbe_dev_read(struct xgbe_channel *channel)
                                       CSUM_DONE, 0);
                        XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
                                       TNPCSUM_DONE, 0);
+                       pdata->ext_stats.rx_csum_errors++;
                } else if (tnp && ((etlt == 0x09) || (etlt == 0x0a))) {
                        XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
                                       CSUM_DONE, 0);
                        XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
                                       TNPCSUM_DONE, 0);
+                       pdata->ext_stats.rx_vxlan_csum_errors++;
                } else {
                        XGMAC_SET_BITS(packet->errors, RX_PACKET_ERRORS,
                                       FRAME, 1);
index cea25acd5de2921a49e75cf6417dfe38313ec11a..ff397bb25042cb255f88baaf620e3eb811d61391 100644 (file)
@@ -146,6 +146,7 @@ static const struct xgbe_stats xgbe_gstring_stats[] = {
        XGMAC_MMC_STAT("tx_broadcast_packets", txbroadcastframes_gb),
        XGMAC_MMC_STAT("tx_multicast_packets", txmulticastframes_gb),
        XGMAC_MMC_STAT("tx_vlan_packets", txvlanframes_g),
+       XGMAC_EXT_STAT("tx_vxlan_packets", tx_vxlan_packets),
        XGMAC_EXT_STAT("tx_tso_packets", tx_tso_packets),
        XGMAC_MMC_STAT("tx_64_byte_packets", tx64octets_gb),
        XGMAC_MMC_STAT("tx_65_to_127_byte_packets", tx65to127octets_gb),
@@ -162,6 +163,7 @@ static const struct xgbe_stats xgbe_gstring_stats[] = {
        XGMAC_MMC_STAT("rx_broadcast_packets", rxbroadcastframes_g),
        XGMAC_MMC_STAT("rx_multicast_packets", rxmulticastframes_g),
        XGMAC_MMC_STAT("rx_vlan_packets", rxvlanframes_gb),
+       XGMAC_EXT_STAT("rx_vxlan_packets", rx_vxlan_packets),
        XGMAC_MMC_STAT("rx_64_byte_packets", rx64octets_gb),
        XGMAC_MMC_STAT("rx_65_to_127_byte_packets", rx65to127octets_gb),
        XGMAC_MMC_STAT("rx_128_to_255_byte_packets", rx128to255octets_gb),
@@ -177,6 +179,8 @@ static const struct xgbe_stats xgbe_gstring_stats[] = {
        XGMAC_MMC_STAT("rx_out_of_range_errors", rxoutofrangetype),
        XGMAC_MMC_STAT("rx_fifo_overflow_errors", rxfifooverflow),
        XGMAC_MMC_STAT("rx_watchdog_errors", rxwatchdogerror),
+       XGMAC_EXT_STAT("rx_csum_errors", rx_csum_errors),
+       XGMAC_EXT_STAT("rx_vxlan_csum_errors", rx_vxlan_csum_errors),
        XGMAC_MMC_STAT("rx_pause_frames", rxpauseframes),
        XGMAC_EXT_STAT("rx_split_header_packets", rx_split_header_packets),
        XGMAC_EXT_STAT("rx_buffer_unavailable", rx_buffer_unavailable),
index db155fe7f74d3154cc665c8f65afabc530d84b3a..ad102c8bac7bf44d8fa92d0bc175333b12f415fc 100644 (file)
@@ -715,6 +715,11 @@ struct xgbe_ext_stats {
        u64 txq_bytes[XGBE_MAX_DMA_CHANNELS];
        u64 rxq_packets[XGBE_MAX_DMA_CHANNELS];
        u64 rxq_bytes[XGBE_MAX_DMA_CHANNELS];
+
+       u64 tx_vxlan_packets;
+       u64 rx_vxlan_packets;
+       u64 rx_csum_errors;
+       u64 rx_vxlan_csum_errors;
 };
 
 struct xgbe_hw_if {