On Sat, 1 Aug 2020 14:21:28 +0000 [email protected] wrote:
> + if (eni_stats_needed) {
> + ena_update_hw_stats(adapter);
> + for (i = 0; i < ENA_STATS_ARRAY_ENI(adapter); i++) {
> + ena_stats = &ena_stats_eni_strings[i];
> +
> + ptr = (u64 *)((uintptr_t)&adapter->eni_stats +
> + (uintptr_t)ena_stats->stat_offset);
In the kernel unsigned long is the type for doing maths on pointers.
> + ena_safe_update_stat(ptr, data++, &adapter->syncp);
> + }
> + }
> +
> ena_queue_stats(adapter, &data);
> ena_dev_admin_queue_stats(adapter, &data);
> }
>
> +static void ena_get_ethtool_stats(struct net_device *netdev,
> + struct ethtool_stats *stats,
> + u64 *data)
> +{
> + struct ena_adapter *adapter = netdev_priv(netdev);
> +
> + ena_get_stats(adapter, data, adapter->eni_stats_supported);
> +}
Why the indirections? You always pass adapter->eni_stats_supported as a
parameter, why not just use it directly?
Other than the two nits, the set LGTM.