]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: fq_pie: re-factor fix for fq_pie endless loop
authorDavide Caratti <dcaratti@redhat.com>
Sat, 22 May 2021 13:14:45 +0000 (15:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 00:16:09 +0000 (17:16 -0700)
commit2570090f97d27fab1bf70c8894bb9209facb1d75
tree3e6a1db4a98b22e8bc060ddf280b895a2ed10a8e
parent2406b3e1dd4c1869f43115eccaea880f46b7184f
net/sched: fq_pie: re-factor fix for fq_pie endless loop

the patch that fixed an endless loop in_fq_pie_init() was not considering
that 65535 is a valid class id. The correct bugfix for this infinite loop
is to change 'idx' to become an u32, like Colin proposed in the past [1].

Fix this as follows:
 - restore 65536 as maximum possible values of 'flows_cnt'
 - use u32 'idx' when iterating on 'q->flows'
 - fix the TDC selftest

This reverts commit e6f5956365c0ed6548a4badc9c12478758fa6532.

[1] https://lore.kernel.org/netdev/20210407163808.499027-1-colin.king@canonical.com/

CC: Colin Ian King <colin.king@canonical.com>
CC: stable@vger.kernel.org
Fixes: e6f5956365c0 ("net/sched: fix infinite loop in sch_fq_pie")
Fixes: 0797d9ba9f1d ("net: sched: add Flow Queue PIE packet scheduler")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_fq_pie.c
tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq_pie.json