lkml.org 
[lkml]   [2020]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 12/14] habanalabs/gaudi: Add ethtool support using coresight
> +static struct gaudi_nic_ethtool_stats gaudi_nic_mac_stats_rx[] = {
> + {"Rx MAC counters", 0},
> + {" etherStatsOctets", 0x0},
> + {" OctetsReceivedOK", 0x4},
> + {" aAlignmentErrors", 0x8},
> + {" aPAUSEMACCtrlFramesReceived", 0xC},
> + {" aFrameTooLongErrors", 0x10},
> + {" aInRangeLengthErrors", 0x14},
> + {" aFramesReceivedOK", 0x18},
> + {" VLANReceivedOK", 0x1C},
> + {" aFrameCheckSequenceErrors", 0x20},
> + {" ifInErrors", 0x24},
> + {" ifInUcastPkts", 0x28},
> + {" ifInMulticastPkts", 0x2C},
> + {" ifInBroadcastPkts", 0x30},
> + {" etherStatsDropEvents", 0x34},
> + {" etherStatsUndersizePkts", 0x38},
> + {" etherStatsPkts", 0x3C},
> + {" etherStatsPkts64Octets", 0x40},
> + {" etherStatsPkts65to127Octets", 0x44},
> + {" etherStatsPkts128to255Octets", 0x48},
> + {" etherStatsPkts256to511Octets", 0x4C},
> + {" etherStatsPkts512to1023Octets", 0x50},
> + {" etherStatsPkts1024to1518Octets", 0x54},
> + {" etherStatsPkts1519toMaxOctets", 0x58},
> + {" etherStatsOversizePkts", 0x5C},
> + {" etherStatsJabbers", 0x60},
> + {" etherStatsFragments", 0x64},
> + {" aCBFCPAUSEFramesReceived_0", 0x68},
> + {" aCBFCPAUSEFramesReceived_1", 0x6C},
> + {" aCBFCPAUSEFramesReceived_2", 0x70},
> + {" aCBFCPAUSEFramesReceived_3", 0x74},
> + {" aCBFCPAUSEFramesReceived_4", 0x78},
> + {" aCBFCPAUSEFramesReceived_5", 0x7C},
> + {" aCBFCPAUSEFramesReceived_6", 0x80},
> + {" aCBFCPAUSEFramesReceived_7", 0x84},
> + {" aMACControlFramesReceived", 0x88}
> +};
> +
> +static struct gaudi_nic_ethtool_stats gaudi_nic_mac_stats_tx[] = {
> + {"Tx MAC counters", 0},
> + {" etherStatsOctets", 0x0},
> + {" OctetsTransmittedOK", 0x4},
> + {" aPAUSEMACCtrlFramesTransmitted", 0x8},
> + {" aFramesTransmittedOK", 0xC},
> + {" VLANTransmittedOK", 0x10},
> + {" ifOutErrors", 0x14},
> + {" ifOutUcastPkts", 0x18},
> + {" ifOutMulticastPkts", 0x1C},
> + {" ifOutBroadcastPkts", 0x20},
> + {" etherStatsPkts64Octets", 0x24},
> + {" etherStatsPkts65to127Octets", 0x28},
> + {" etherStatsPkts128to255Octets", 0x2C},
> + {" etherStatsPkts256to511Octets", 0x30},
> + {" etherStatsPkts512to1023Octets", 0x34},
> + {" etherStatsPkts1024to1518Octets", 0x38},
> + {" etherStatsPkts1519toMaxOctets", 0x3C},
> + {" aCBFCPAUSEFramesTransmitted_0", 0x40},
> + {" aCBFCPAUSEFramesTransmitted_1", 0x44},
> + {" aCBFCPAUSEFramesTransmitted_2", 0x48},
> + {" aCBFCPAUSEFramesTransmitted_3", 0x4C},
> + {" aCBFCPAUSEFramesTransmitted_4", 0x50},
> + {" aCBFCPAUSEFramesTransmitted_5", 0x54},
> + {" aCBFCPAUSEFramesTransmitted_6", 0x58},
> + {" aCBFCPAUSEFramesTransmitted_7", 0x5C},
> + {" aMACControlFramesTransmitted", 0x60},
> + {" etherStatsPkts", 0x64}
> +};

...

> +static void gaudi_nic_get_internal_stats(struct net_device *netdev, u64 *data)
> +{
> + struct gaudi_nic_device **ptr = netdev_priv(netdev);
> + struct gaudi_nic_device *gaudi_nic = *ptr;
> + struct hl_device *hdev = gaudi_nic->hdev;
> + u32 port = gaudi_nic->port;
> + u32 num_spmus;
> + int i;
> +
> + num_spmus = (port & 1) ? NIC_SPMU1_STATS_LEN : NIC_SPMU0_STATS_LEN;
> +
> + gaudi_sample_spmu_nic(hdev, port, num_spmus, data);
> + data += num_spmus;
> +
> + /* first entry is title */
> + data[0] = 0;

Hi Jakub

You have been looking at statistics names recently. What do you think
of this data[0]?

Andrew

\
 
 \ /
  Last update: 2020-09-14 03:25    [W:0.121 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site