Re: [PATCH] net: ti: icssg-prueth: Fix tx_total_bytes count

From: Andrew Lunn
Date: Wed Oct 11 2023 - 08:41:37 EST


> @@ -29,7 +30,12 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
> base + icssg_all_stats[i].offset,
> val);
>
> + if (!strncmp(icssg_ethtool_stats[i].name, "tx_good_frames", ETH_GSTRING_LEN))
> + tx_pkt_cnt = val;

Doing a strncmp seems very expensive. Could you make use of
icssg_stats.offset?

Andrew