Re: [PATCH net-next 3/5] net: ipqess: introduce the Qualcomm IPQESS driver

From: Andrew Lunn
Date: Tue Oct 24 2023 - 10:08:49 EST


> > > + for (c = 0; c < priv->info->mib_count; c++) {
> > > + mib = &ar8327_mib[c];
> > > + reg = QCA8K_PORT_MIB_COUNTER(port->index) + mib->offset;
> > > +
> > > + ret = qca8k_read(priv, reg, &val);
> > > + if (ret < 0)
> > > + continue;
> >
> > Given the switch is built in, is this fast? The 8k driver avoids doing
> > register reads for this.
>
> Sorry, I don't quite understand what you mean. Are you referring to the existing
> QCA8k DSA driver? From what I've seen, it calls qca8k_get_ethtool_stats defined
> in qca8k-common.c and this uses the same register read.

It should actually build an Ethernet frame containing a command to get
most of the statistics in one operation. That frame is sent to the
switch over the SoCs ethernet interface. The switch replies with a
frame containing the statistics. This should be faster than doing lots
of register reads over a slow MDIO bus.

Now, given that this switch is built into the SoC, i assume the MDIO
bus is gone, so register access is fast. So you don't need to use
Ethernet frames.

Andrew