Re: [PATCH net-next v4 2/2] net: dsa: mv88e6xxx: add support for credit based shaper

From: Andrew Lunn

Date: Fri May 29 2026 - 10:49:37 EST


On Fri, May 29, 2026 at 04:32:15PM +0200, Cedric Jehasse wrote:
> On Fri, May 29, 2026 at 03:28:56PM +0200, Andrew Lunn wrote:
> > > > That's not the same logic.
> > > > If one of the two function pointer is NULL, the other can still be executed
> > > > (Maybe not that likely as that's probably a mistake in the driver)
> > >
> > > True, but agree also that it shouldn’t happen (would be a driver bug).
> >
> > However, a kernel splat because you have jumped through a NULL pointer
> > makes a good bug report. It is much more obvious what is wrong than a
> > report that somebody tried to configure TC, but nothing appeared to
> > happen.
> >
>
> Removing !avb_ops->port_qav_write || !ops->port_set_scheduling_mode won't make
> it jump to a NULL pointer. mv88e6xxx_port_qav_write and
> mv88e6xxx_port_set_scheduling_mode will still return -EOPNOTSUPP.
> Do you prefer removing the NULL pointer checks in those functions?

No, leave them. Its just people have an aversion to kernel splats, but
they can actually be useful if they highlight a bug.

Andrew