Re: [PATCH net v2 1/5] net: mvneta: lift the per-queue TX rate limits
From: Maxime Chevallier
Date: Tue Nov 03 2026 - 13:59:40 EST
Hi,
On 11/3/26 13:50, Josef Schlehofer wrote:
> The per-queue rate limits set by mqprio stay in effect after the
> shaper is turned off.
>
> mvneta_disable_per_queue_rate_limit() only changes the mode bits in
> MVNETA_TXQ_CMD1_REG. The token buckets keep limiting the TX queues
> with that mode as well, and their refill rate still holds the old
> limit.
>
> Refill the token buckets of all TX queues at full rate when the rate
> limit is disabled. Deleting the qdisc reaches this code only with the
> next patch.
>
> Tested on a Turris Omnia (Armada 385) with 10 Mbit/s limits on a
> 100 Mbit/s link. When mqprio was set up again without a shaper, each
> TX queue stayed at 10 Mbit/s. With this patch the link reaches
> 94 Mbit/s.
>
> Fixes: 2551dc9e398c ("net: mvneta: Add TC traffic shaping offload")
> Signed-off-by: Josef Schlehofer <pepe.schlehofer@xxxxxxxxx>
Reviewed-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>
Thanks for addressing this,
Maxime
> ---
> drivers/net/ethernet/marvell/mvneta.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index ea755cf05b9e..9b9efac2846e 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -5204,9 +5204,16 @@ static int mvneta_enable_per_queue_rate_limit(struct mvneta_port *pp)
> static void mvneta_disable_per_queue_rate_limit(struct mvneta_port *pp)
> {
> u32 val = mvreg_read(pp, MVNETA_TXQ_CMD1_REG);
> + int queue;
>
> val |= (MVNETA_TXQ_CMD1_BW_LIM_SEL_V1 | MVNETA_TXQ_CMD1_BW_LIM_EN);
> mvreg_write(pp, MVNETA_TXQ_CMD1_REG, val);
> +
> + /* The token buckets still limit the queues, refill them at full rate */
> + val = (1 << MVNETA_TXQ_BUCKET_REFILL_PERIOD_SHIFT) |
> + MVNETA_TXQ_BUCKET_REFILL_VALUE_MAX;
> + for (queue = 0; queue < txq_number; queue++)
> + mvreg_write(pp, MVNETA_TXQ_BUCKET_REFILL_REG(queue), val);
> }
>
> static int mvneta_setup_queue_rates(struct mvneta_port *pp, int queue,