Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: sparx5/lan969x: fix DWRR cost max to match hardware register width

DWRR (Deficit Weighted Round Robin) scheduling distributes bandwidth
across traffic classes based on per-queue cost values, where lower cost
means higher bandwidth share.

The SPX5_DWRR_COST_MAX constant is 63 (6 bits) but the hardware
register field HSCH_DWRR_ENTRY_DWRR_COST is GENMASK(24, 20), only
5 bits wide (max 31). This causes sparx5_weight_to_hw_cost() to
compute cost values that silently overflow via FIELD_PREP, resulting
in incorrect scheduling weights.

Set SPX5_DWRR_COST_MAX to 31 to match the hardware register width.

Fixes: 211225428d65 ("net: microchip: sparx5: add support for offloading ets qdisc")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260210-sparx5-fix-dwrr-cost-max-v1-1-58fbdbc25652@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Daniel Machon and committed by
Jakub Kicinski
6c28aa8d 89308781

+1 -1
+1 -1
drivers/net/ethernet/microchip/sparx5/sparx5_qos.h
··· 35 35 #define SPX5_SE_BURST_UNIT 4096 36 36 37 37 /* Dwrr */ 38 - #define SPX5_DWRR_COST_MAX 63 38 + #define SPX5_DWRR_COST_MAX 31 39 39 40 40 struct sparx5_shaper { 41 41 u32 mode;