Re: [PATCH net-next] net: stmmac: add tc-ets qdisc offload

Lorenzo Bianconi <[email protected]>
Newsgroups gmane.linux.network,gmane.linux.ports.arm.kernel
Message-ID <anObJdRfQcElQGFn@lore-qca>
> On Tue, Aug 04, 2026 at 08:17:35PM +0200, Lorenzo Bianconi wrote:
> 
> [...]
>  
> > When all bands are strict priority, the MTL scheduler is programmed with
> > SP scheduling; otherwise the requested weights are applied to the TX
> > queues and the scheduler is switched to DWRR. The TC_ETS_STATS command
> > is accepted and handled.
> > 
> > Export stmmac_set_tx_queue_weight() so the ETS path can reprogram queue
> > weights, and wire TC_SETUP_QDISC_ETS into stmmac_setup_tc().
> > 
> > Signed-off-by: Lorenzo Bianconi <[email protected]>
> 
> hello Lorenzo, thanks for your patch!

Hi Davide,

> 
> > ---
> > +static int tc_setup_ets_sched(struct stmmac_priv *priv,
> > +			      struct tc_ets_qopt_offload *qopt)
> > +{
> > +	struct tc_ets_qopt_offload_replace_params *p = &qopt->replace_params;
> > +	struct plat_stmmacenet_data *pdata = priv->plat;
> > +	int i, nstrict = 0;
> > +
> > +	if (p->bands > priv->plat->tx_queues_to_use)
> > +		return -EOPNOTSUPP;
> > +
> > +	for (i = 0; i < p->bands; i++) {
> > +		if (!p->quanta[i])
> > +			nstrict++;
> > +	}
> > +
> > +	if (p->bands && nstrict)
> > +		return -EOPNOTSUPP;
> > +
> > +	if (nstrict) {
> > +		tc_setup_sp_sched(priv);
> 
> From what I understood, this will fail configuring the strict priority case (the only one
> possible according to the commit message, where all bands have quanta equal to 0). Maybe
> the if() statement should be done like:
> 
>  if (nstrict && nstrict != p->bands)
> 	return -EOPNOTSUPP;
> 
> WDYT? thank you in advance!

ack, I agree. I will fix it in v2.

Regards,
Lorenzo

> 
> -- 
> davide
>
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCanObJQAKCRA6cBh0uS2t
rHD6AP9XgYpCrXA9PFQnJ+qQc4QoT8kpSYf9vl3QSkxIMCjvKwD+Is5MIO3/7u+d
f+JCbvPCgJWfCbT0bcm+si0m9cLGQwY=
=538k
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.