Messages in this thread | | | Date | Fri, 6 Nov 2020 17:40:25 +0200 | From | Vladimir Oltean <> | Subject | Re: [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959 |
| |
On Tue, Oct 20, 2020 at 12:04:57PM +0800, Xiaoliang Yang wrote: > +static int vsc9959_port_get_preempt(struct ocelot *ocelot, int port, > + struct ethtool_fp *fpcmd) > +{ > + struct ocelot_port *ocelot_port = ocelot->ports[port]; > + u32 val; > + > + val = ocelot_port_readl(ocelot_port, DEV_MM_VERIF_CONFIG); > + val &= DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_DIS; > + fpcmd->enabled = (val ? 0 : 1); > + > + val = ocelot_read(ocelot, QSYS_PREEMPTION_CFG);
You have a bug here. This should be:
val = ocelot_read_rix(ocelot, QSYS_PREEMPTION_CFG, port);
otherwise you're always retrieving the frame preemption configuration of port 0, regardless of the port passed as argument.
> + fpcmd->min_frag_size_mult = QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE_X(val); > + > + return 0; > +}
| |