[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180705172016.GK23469@lunn.ch>
Date: Thu, 5 Jul 2018 19:20:16 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Bryan Whitehead <Bryan.Whitehead@...rochip.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v1 net-next 3/9] lan743x: Add support for ethtool
statistics
Hi Bryan
> +static void lan743x_ethtool_get_ethtool_stats(struct net_device *netdev,
> + struct ethtool_stats *stats,
> + u64 *data)
> +{
> + struct lan743x_adapter *adapter = netdev_priv(netdev);
> + int data_index = 0;
> + u32 buf;
> + int i;
> +
> + for (i = 0; i < (sizeof(lan743x_set0_hw_cnt_addr) / (sizeof(u32)));
ARRAY_SIZE(lan743x_set0_hw_cnt_addr) ?
> + i++) {
> + buf = lan743x_csr_read(adapter, lan743x_set0_hw_cnt_addr[i]);
> + data[data_index++] = (u64)buf;
> + }
> + for (i = 0; i < 4; i++)
ARRAY_SIZE(lan743x_set1_sw_cnt_strings) ??
> + data[data_index++] = (u64)(adapter->rx[i].frame_count);
> + for (i = 0; i < (sizeof(lan743x_set2_hw_cnt_addr) / (sizeof(u32)));
ARRAY_SIZE()
> + i++) {
> + buf = lan743x_csr_read(adapter, lan743x_set2_hw_cnt_addr[i]);
> + data[data_index++] = (u64)buf;
> + }
> +}
Andrew
Powered by blists - more mailing lists