mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
net: airoha: fix ETS channel derivation in airoha_tc_setup_qdisc_ets()
Derive the hardware QoS channel from opt->parent instead of opt->handle
in airoha_tc_setup_qdisc_ets(). The ETS qdisc handle is either
user-specified or auto-allocated by qdisc_alloc_handle() and bears no
relation to the HTB leaf classid that identifies the hardware channel.
HTB derives the channel from TC_H_MIN(opt->classid), and ETS is always
attached as a child of an HTB leaf, so its opt->parent matches that
classid. Using opt->handle instead can cause two ETS qdiscs on different
HTB leaves to collide on the same hardware channel, corrupting scheduler
configuration and stats.
Fixes: 20bf7d07c9 ("net: airoha: Add sched ETS offload support")
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260720-airoha-ets-handle-fix-v2-1-6f7129ddc06f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
d9a33cadc7
commit
649ea07fc2
|
|
@ -2543,8 +2543,7 @@ static int airoha_tc_setup_qdisc_ets(struct net_device *dev,
|
|||
if (opt->parent == TC_H_ROOT)
|
||||
return -EINVAL;
|
||||
|
||||
channel = TC_H_MAJ(opt->handle) >> 16;
|
||||
channel = channel % AIROHA_NUM_QOS_CHANNELS;
|
||||
channel = TC_H_MIN(opt->parent) % AIROHA_NUM_QOS_CHANNELS;
|
||||
|
||||
switch (opt->command) {
|
||||
case TC_ETS_REPLACE:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user