Re: [PATCH net-next] mlxsw: spectrum_dcb: Reject writes owned by an offloaded qdisc
From: Keno Fischer
Date: Tue May 19 2026 - 18:56:53 EST
On Tue, May 19, 2026 at 12:03 PM Petr Machata <petrm@xxxxxxxxxx> wrote:
>
> I'll let it pass through a full regression tonight. Overall the patch
> looks OK to me, but Sashiko found something:
Sounds good - I will wait for your testing before sending v2.
> > diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
> > index 73519301b744..c2ce4f3f562e 100644
> > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
> > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
> > @@ -2316,6 +2316,49 @@ int mlxsw_sp_setup_tc_block_qevent_mark(struct mlxsw_sp_port *mlxsw_sp_port,
> > action_mask);
> > }
> >
> > +bool mlxsw_sp_qdisc_has_prio_ets(struct mlxsw_sp_port *mlxsw_sp_port)
> > +{
> > + struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc;
> > + struct mlxsw_sp_qdisc *root_qdisc;
> > + bool found;
> > +
> > + mutex_lock(&qdisc_state->lock);
> > + root_qdisc = &qdisc_state->root_qdisc;
> > + found = root_qdisc->ops &&
> > + (root_qdisc->ops->type == MLXSW_SP_QDISC_PRIO ||
> > + root_qdisc->ops->type == MLXSW_SP_QDISC_ETS);
> > + mutex_unlock(&qdisc_state->lock);
> > +
> > + return found;
> > +}
>
> From Sashiko review:
>
> The check here only examines the root qdisc type. However, a prio or ets
> qdisc can be a valid child of a root tbf qdisc in the offloaded
> configuration.
>
> This is correct, ETS/PRIO are offloaded when under root TBF as well.
Good catch, thanks. I did take a look at this but then forgot to fix it.
My bad - will fix in v2 once you've run your regression tests.
Thanks,
Keno