Re: [PATCH net v7 1/4] octeon_ep: update tx/rx stats locally for persistence
From: Jakub Kicinski
Date: Wed Jan 15 2025 - 17:23:18 EST
On Tue, 14 Jan 2025 04:51:21 -0800 Shinas Rasheed wrote:
> + tx_packets = 0;
> + tx_bytes = 0;
> + rx_packets = 0;
> + rx_bytes = 0;
> + for (q = 0; q < oct->num_ioq_stats; q++) {
> + tx_packets += oct->stats_iq[q].instr_completed;
> + tx_bytes += oct->stats_iq[q].bytes_sent;
> + rx_packets += oct->stats_oq[q].packets;
> + rx_bytes += oct->stats_oq[q].bytes;
> + }
> +
> if (netif_running(netdev))
> octep_ctrl_net_get_if_stats(oct,
> OCTEP_CTRL_NET_INVALID_VFID,
> &oct->iface_rx_stats,
> &oct->iface_tx_stats);
>
> - tx_packets = 0;
> - tx_bytes = 0;
> - rx_packets = 0;
> - rx_bytes = 0;
> - for (q = 0; q < oct->num_oqs; q++) {
> - struct octep_iq *iq = oct->iq[q];
> - struct octep_oq *oq = oct->oq[q];
> -
> - tx_packets += iq->stats.instr_completed;
> - tx_bytes += iq->stats.bytes_sent;
> - rx_packets += oq->stats.packets;
> - rx_bytes += oq->stats.bytes;
> - }
This code move is unnecessary. Next patch removes the
octep_ctrl_net_get_if_stats() call, so you can just
reorder the patches to remove the FW calls first,
and the diff will be smaller here.
--
pw-bot: cr