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

From: Cedric Jehasse

Date: Wed May 27 2026 - 05:40:09 EST


>
> > + if (!qav || !avb_ops || !avb_ops->port_qav_write ||
> > + !ops->port_set_scheduling_mode)
> > + return -EOPNOTSUPP;
> > +
> > + if (!dsa_is_user_port(ds, port))
> > + return -EOPNOTSUPP;
> > +
> > + if (cbs->queue < 0 || cbs->queue >= chip->info->num_tx_queues)
> > + return -EINVAL;
> > +
> > + if (!(qav->queue_mask & BIT(cbs->queue)))
> > + return -EOPNOTSUPP;
> > +
> > + queue_bit = BIT(cbs->queue);
> > + rate_reg = cbs->queue * 2;
> > + hilimit_reg = rate_reg + 1;
> > +
> > + if (cbs->enable) {
> > + if (cbs->idleslope <= 0 ||
> > + cbs->idleslope > qav->max_rate ||
> > + cbs->sendslope >= 0 || cbs->hicredit <= 0 ||
> > + cbs->hicredit > qav->hi_limit_mask)
> > + return -ERANGE;
> > +
> > + rate = DIV_ROUND_UP(cbs->idleslope, qav->rate_unit);
>
> In the commit message, you mentioned 20Mbps, for a 1G link. Does the
> link speed actually matter? I don't see it here.
>
> Andrew
>

According to the cbs manpage: sendslope = idleslope - port_transmit_rate.
In the commit message i've used the example from the manpage, which would be
correct for any network interface.
But the commit message mentions only idleslope and hicredit can be programmed
in the switch.
So for Marvell switches the link speed doesn't matter.

Sorry if you've received html mails. Something seems to have changed overnight,
breaking plain text e-mails on my work account.

Cedric