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

From: Cedric Jehasse

Date: Mon Jun 15 2026 - 10:33:50 EST


O Fri, Jun 12, 2026 at 03:36:56PM -0700, Jakub Kicinski wrote:
> On Tue, 09 Jun 2026 14:10:51 +0200 Cedric Jehasse via B4 Relay wrote:
> > From: Cedric Jehasse <cedric.jehasse@xxxxxxxxxx>
> >
> > Some of the chips supported by this driver have credit based shaper
> > support. Support is added for the 6341, 6352, 6390 and 6393 families.
> > This is configured using the Qav registers in the AVB register block.
> > There are small differences in the Qav registers between the chip
> > families (eg. the unit used for the rate and number of bits in the
> > registers). mv88e6xxx_qav_info is introduced to configure this per chip.
> >
> > Eg. setting up 20mbps credit based shaper on a 1GBit link:
> > tc qdisc add dev p8 parent root handle 100: mqprio \
> > num_tc 8 \
> > map 0 0 6 7 0 5 0 0 0 0 0 0 0 0 0 0 \
> > queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \
> > hw 0
> >
> > tc qdisc replace dev p8 parent 100:8 cbs locredit -1470 hicredit 30 \
> > sendslope -980000 idleslope 20000 offload 1
>
> Are DSA ports multi-queue? I would have expected a DSA driver to
> offload PRIO not MQPRIO.
>
> I seem to recall other discussion on the ML on the topic.
> It'd be great to get some review tags from folks familiar with
> the device.

As mentioned by Luke, this patch adds offloading for CBS, not MQPIO. Other dsa
driver already do this (eg. microchip ksz driver).

>
> > Note: only idleslope and hicredit can be programmed in the switch
> > registers, other parameters won't affect settings.
>
> > +static int mv88e6xxx_setup_tc_cbs(struct dsa_switch *ds, int port,
> > + struct tc_cbs_qopt_offload *cbs)
>
> please stick an extack into struct tc_cbs_qopt_offload and use it to
> report the reason for rejection back to the user
>

Do you mean modifying cbs_enable_offload to report a driver specified reason isof
reportig the generic "Specified device failed to setup cbs hardware offload"?
What should be done for other drivers who handle TC_SETUP_QDISC_CBS, but don't
fill in extack? Should cbs_enable_offload fill in extack with "Specified device
failed to setup cbs hardware offload"?

Cedric