Re: [PATCH net-next v2 7/8] octeon_ep_vf: add ethtool support

From: Jakub Kicinski
Date: Thu Jan 04 2024 - 15:54:02 EST


On Sat, 23 Dec 2023 05:39:59 -0800 Shinas Rasheed wrote:
> + rx_packets = 0;
> + rx_bytes = 0;
> + tx_packets = 0;
> + tx_bytes = 0;
> + rx_alloc_errors = 0;
> + tx_busy_errors = 0;
> + tx_packets = 0;
> + tx_bytes = 0;
> + rx_packets = 0;
> + rx_bytes = 0;
> +
> + octep_vf_get_if_stats(oct);
> + iface_tx_stats = &oct->iface_tx_stats;
> + iface_rx_stats = &oct->iface_rx_stats;
> +
> + for (q = 0; q < oct->num_oqs; q++) {
> + struct octep_vf_iq *iq = oct->iq[q];
> + struct octep_vf_oq *oq = oct->oq[q];
> +
> + tx_packets += iq->stats.instr_completed;
> + tx_bytes += iq->stats.bytes_sent;
> + tx_busy_errors += iq->stats.tx_busy;
> +
> + rx_packets += oq->stats.packets;
> + rx_bytes += oq->stats.bytes;
> + rx_alloc_errors += oq->stats.alloc_failures;
> + }
> + i = 0;
> + data[i++] = rx_packets;
> + data[i++] = tx_packets;
> + data[i++] = rx_bytes;
> + data[i++] = tx_bytes;
> + data[i++] = rx_alloc_errors;
> + data[i++] = tx_busy_errors;

Don't duplicate stats you're already reporting via ndo_get_stats64,
please.