From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=140.77.167.80 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796316194; b=YPxM1jH4EqEUb2AQWW/tEGsKhjHPc8rRsIyefqoQzNpy8fIyfrLAFJ79VKgzuhzXcc0B dhH6yO6wrfsa2LNfUMEyK3wYwsmyhhrHNjlLf9lJttJPYHcalGr1KfpezN6hCsjpKGCLh mjhh0PAbqJ850H6gbt9hfTKEk7n8FR1ZdTzqUMEpnsCuPSZMSe/07q6NLyZBVf6fR3eP8 Ab0JYK5MZ8c7DTGtuq1CstB6RAvizmDTrZqrVl9hvJnXRnHXcx+i5y20csyZTGUxwTwo8 1jVMijntHmRpQXNAhEqctXo1G7HQuFLs/gPVxEuZvxq8gmF/muhj6Tg1/az6MapWtxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796316194; h=DMARC-Filter:Received:X-Virus-Scanned:Received:DKIM-Signature: Received:Received:MIME-Version:Date:From:To:Cc:Subject:In-Reply-To: References:Message-ID:X-Sender:User-Agent:Content-Type: Content-Transfer-Encoding; bh=0XL45nAE48sRsI+0wogS1RGtCF15ny2NYXrRKlTB6FQ=; b=3atVgis1bgFyYboMozE78UvCU4Byy5/7aDwUWCo95tcUfhxjO2uISQGuAmWQbTI7ofxX 6Zwt4AkB3flK72df/Dx06fjQlwgN5efXwtZfT5bLBI+m2Bqm/qDsMc92yPI3INZpYGTlW hdwWkKUrcmqFDv2atesbEIh21ql1qQBLZQBKLPkfy4qfncj62g+riefCA1k5WcT1SkA3X 7qZno8cirufs0+7gHm1zb7tVaEyirMSAdVu197t3bvZ5GNH6373J0brLnMPKgJFqQ6YSa uiAiVXdUkFVEtvDvNkDXCaoap52aSX1jbONPxwmu6gccfMHIkhFMYSLYNPe+ItsrPfw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=ens-lyon.fr; spf=pass smtp.mailfrom=ens-lyon.fr; dkim=pass header.d=ens-lyon.fr header.i=@ens-lyon.fr header.a=rsa-sha256 header.s=2024 header.b=eDJwbplP; arc=none smtp.remote-ip=140.77.167.80 Received: from lxc-smtp1.ens-lyon.fr (lxc-smtp1.ens-lyon.fr [140.77.167.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6B88606A683 for ; Thu, 3 Dec 2026 16:43:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A6B88606A683 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ens-lyon.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ens-lyon.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ens-lyon.fr header.i=@ens-lyon.fr header.a=rsa-sha256 header.s=2024 header.b=eDJwbplP Received: from localhost (localhost [127.0.0.1]) by lxc-smtp1.ens-lyon.fr (Postfix) with ESMTP id 28F9B221604; Thu, 3 Dec 2026 17:43:10 +0100 (CET) X-Virus-Scanned: by amavis-2.13.0 (20230106) (Debian) at ens-lyon.fr Received: from lxc-smtp1.ens-lyon.fr ([127.0.0.1]) by localhost (lxc-smtp1.ens-lyon.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id bXSj4gatapDO; Thu, 3 Dec 2026 17:43:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ens-lyon.fr; s=2024; t=1796316190; bh=0XL45nAE48sRsI+0wogS1RGtCF15ny2NYXrRKlTB6FQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eDJwbplPqZsZE6QgjKuI9mvNF8whF5yrHkne6LY4rMoHyczXxAnOxRLJ16/Xe504F JYq+yiXmhIdh30js7XEBCg+H5CpMNjPMjlai79FrTomzE3GXGaVAAdGrPsaVo0VQq1 1rlRhWLMX4ILxPS7lKHUyglSeFn7GkwAcw9l1eJSo1imZtLYIGxK1gYb6D7jgKIhSv 3mGJXmP5mTPqWHTFMod6ZN9d9HkZJRICHgajbUU5Ak/prdq9RpyX6vEv0z7YDKN9Z0 MaCCYSoVrTMSLP2ahB3QIhUtipKB7PVUxF3teO/hWopwp+NFzPnePURAkK7lX7J695 m2EBUuyHAYu1A== Received: from webmail.ens-lyon.fr (lxc-m2-webmail1.ens-lyon.fr [140.77.167.52]) by lxc-smtp1.ens-lyon.fr (Postfix) with ESMTP id F04F02215C0; Thu, 3 Dec 2026 17:43:09 +0100 (CET) Received: from butineur (par []) by [140.77.167.50] X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Date: Thu, 03 Dec 2026 17:43:09 +0100 From: Andreea-Carina Deaconu To: netdev@vger.kernel.org Cc: Thomas Begin Subject: Re: [PATCH] net/sched: fq_codel: choose random fat flow to drop from, if multiple are equal In-Reply-To: References: Message-ID: <7336ca91af4536c2a1a96ca60700a815@ens-lyon.fr> X-Sender: carina.deaconu@ens-lyon.fr User-Agent: Roundcube Webmail/1.3.17 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Hi, When performing a stress test on an FQ Codel queue, we found a bias when searching for the "fat flow" to drop packets from. Bias: When the FQ Codel queue capacity is reached, we proceed to drop packets from the biggest flow (the "fat flow") in fq_codel_drop(). If there are two or more biggest flows, with equal size, we will always choose the flow with the lowest index (the first flow we find during the iteration). Steps to reproduce: Use the script below to: 1. Configure two interfaces that will receive UDP traffic at equal rates, on ports 5201 and 5202. 2. Configure an FQ Codel queue with a limit of 1p and no ECN so that: the queue capacity is immediately reached, and when we proceed to drop packets from the biggest flow in fq_codel_drop(), there will likely be two equal ones to choose from. 3. Perform two runs by switching the start order: In the first run, the traffic towards the 5201 port is started first. In the second run, the traffic towards the 5202 port is started first. 4. At the end, inspect the loss rate for each of the two flows in both runs. Expected behavior: The two flows should have similar loss rates in both runs, no matter which one is started first, since their traffic intensities are the same. Actual behavior (before the patch) (see captured output below): In each run, the flow that is started first has loss rate of 80%, while the flow that is started second has a <1% loss rate. Fix: When searching for the "fat flow" in fq_codel_drop(), keep account of the number of candidates. If there are multiple fat flows with equal size, randomly choose a flow index to drop packets from. Behavior after the patch (see captured output below): Both flows have similar loss rates: 39% and 40% in the first run, 39% and 41% in the second run. Regards Script to stress test: ---begin script--- #!/usr/bin/env sh set -eu LIMIT="${1:-1}" # Check required tools before setting up namespaces MISSING="" command -v tc >/dev/null 2>&1 || MISSING="$MISSING iproute2" command -v iperf3 >/dev/null 2>&1 || MISSING="$MISSING iperf3" if [ -n "$MISSING" ]; then printf "Missing packages:%s. Do you want to run 'sudo apt install -y%s' to install them? [y/N] " "$MISSING" "$MISSING" read -r ANSWER || ANSWER="n" case "$ANSWER" in y|Y|yes|YES) sudo apt update # Preseed 'No' for iperf3 daemon prompt if debconf asks, then run non-interactively printf "iperf3 iperf3/start_daemon boolean false\n" | sudo debconf-set-selections 2>/dev/null || true sudo DEBIAN_FRONTEND=noninteractive apt install -y $MISSING ;; *) echo "Aborting: required packages not installed." exit 1 ;; esac fi tc -V # Clean up any leftover state from a previous run sudo pkill -f "iperf3 -s" 2>/dev/null || true sudo ip netns del ns1 2>/dev/null || true sudo ip netns del ns2 2>/dev/null || true # Create two isolated network namespaces linked by a veth pair sudo ip netns add ns1 sudo ip netns add ns2 sudo ip link add veth1 type veth peer name veth2 sudo ip link set veth1 netns ns1 sudo ip link set veth2 netns ns2 sudo ip netns exec ns1 ip addr add 10.0.0.1/24 dev veth1 sudo ip netns exec ns2 ip addr add 10.0.0.2/24 dev veth2 sudo ip netns exec ns1 ip link set lo up && sudo ip netns exec ns1 ip link set veth1 up sudo ip netns exec ns2 ip link set lo up && sudo ip netns exec ns2 ip link set veth2 up # Shape veth1 egress to 10mbit with fq_codel limit 1p (noecn) sudo ip netns exec ns1 tc qdisc add dev veth1 root handle 1: htb default 10 sudo ip netns exec ns1 tc class add dev veth1 parent 1: classid 1:10 htb rate 10mbit sudo ip netns exec ns1 tc qdisc add dev veth1 parent 1:10 handle 10: fq_codel limit "${LIMIT}" noecn # Start two UDP iperf3 servers on separate ports sudo ip netns exec ns2 iperf3 -s -p 5201 -D sudo ip netns exec ns2 iperf3 -s -p 5202 -D sleep 0.5 # ============================================================================== echo "==================================================================" echo "RUN 1: Launching Flow 1 (port 5201) first, then Flow 2 (port 5202)" echo "==================================================================" sudo ip netns exec ns1 iperf3 -c 10.0.0.2 -p 5201 -u -l 1000 -b 8m -t 15 > /tmp/run1_flow1.log & PID1=$! sleep 0.002 sudo ip netns exec ns1 iperf3 -c 10.0.0.2 -p 5202 -u -l 1000 -b 8m -t 15 > /tmp/run1_flow2.log & PID2=$! wait "$PID1" "$PID2" echo "--- Run 1 | Flow 1 (port 5201 - started 1st) ---" tail -n 6 /tmp/run1_flow1.log echo "--- Run 1 | Flow 2 (port 5202 - started 2nd) ---" tail -n 6 /tmp/run1_flow2.log echo "--- Run 1 | qdisc stats ---" sudo ip netns exec ns1 tc -s qdisc show dev veth1 # Reset htb and fq_codel cleanly before Run 2 sudo ip netns exec ns1 tc qdisc del dev veth1 root sudo ip netns exec ns1 tc qdisc add dev veth1 root handle 1: htb default 10 sudo ip netns exec ns1 tc class add dev veth1 parent 1: classid 1:10 htb rate 10mbit sudo ip netns exec ns1 tc qdisc add dev veth1 parent 1:10 handle 10: fq_codel limit "${LIMIT}" noecn sleep 1 # ============================================================================== echo "" echo "==================================================================" echo "RUN 2: Launching Flow 2 (port 5202) first, then Flow 1 (port 5201)" echo "==================================================================" sudo ip netns exec ns1 iperf3 -c 10.0.0.2 -p 5202 -u -l 1000 -b 8m -t 15 > /tmp/run2_flow2.log & PID2=$! sleep 0.002 sudo ip netns exec ns1 iperf3 -c 10.0.0.2 -p 5201 -u -l 1000 -b 8m -t 15 > /tmp/run2_flow1.log & PID1=$! wait "$PID1" "$PID2" echo "--- Run 2 | Flow 2 (port 5202 - started 1st) ---" tail -n 6 /tmp/run2_flow2.log echo "--- Run 2 | Flow 1 (port 5201 - started 2nd) ---" tail -n 6 /tmp/run2_flow1.log echo "--- Run 2 | qdisc stats ---" sudo ip netns exec ns1 tc -s qdisc show dev veth1 # Clean up background servers and namespaces sudo pkill -f "iperf3 -s" 2>/dev/null || true sudo ip netns del ns1 2>/dev/null || true sudo ip netns del ns2 2>/dev/null || true ---end script--- Output before the patch: ---captured output--- queue-engineer@fq-codel-lab:~/kernel-lab/linux$ ../run_fqcodel_stress_test.sh tc utility, iproute2-6.19.0, libbpf 1.6.3 ================================================================== RUN 1: Launching Flow 1 (port 5201) first, then Flow 2 (port 5202) ================================================================== --- Run 1 | Flow 1 (port 5201 - started 1st) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15001 (0%) sender [ 5] 0.00-15.00 sec 2.91 MBytes 1.63 Mbits/sec 0.382 ms 11946/14998 (80%) receiver iperf Done. --- Run 1 | Flow 2 (port 5202 - started 2nd) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15001 (0%) sender [ 5] 0.00-15.00 sec 14.2 MBytes 7.97 Mbits/sec 0.300 ms 64/15001 (0.43%) receiver iperf Done. --- Run 1 | qdisc stats --- qdisc htb 1: root refcnt 9 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000 Sent 18748170 bytes 18029 pkt (dropped 12015, overlimits 17971 requeues 0) backlog 0b 0p requeues 0 qdisc fq_codel 10: parent 1:10 limit 1p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb drop_batch 64 Sent 18748170 bytes 18029 pkt (dropped 12015, overlimits 0 requeues 0) backlog 0b 0p requeues 0 maxpacket 1042 drop_overlimit 12015 new_flow_count 9388 ecn_mark 0 new_flows_len 0 old_flows_len 2 ================================================================== RUN 2: Launching Flow 2 (port 5202) first, then Flow 1 (port 5201) ================================================================== --- Run 2 | Flow 2 (port 5202 - started 1st) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15001 (0%) sender [ 5] 0.00-15.00 sec 2.87 MBytes 1.60 Mbits/sec 0.070 ms 11992/14999 (80%) receiver iperf Done. --- Run 2 | Flow 1 (port 5201 - started 2nd) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15001 (0%) sender [ 5] 0.00-15.00 sec 14.3 MBytes 7.99 Mbits/sec 0.324 ms 24/15001 (0.16%) receiver iperf Done. --- Run 2 | qdisc stats --- qdisc htb 1: root refcnt 9 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000 Sent 18742451 bytes 18017 pkt (dropped 12019, overlimits 17968 requeues 0) backlog 0b 0p requeues 0 qdisc fq_codel 10: parent 1:10 limit 1p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb drop_batch 64 Sent 18742451 bytes 18017 pkt (dropped 12019, overlimits 0 requeues 0) backlog 0b 0p requeues 0 maxpacket 1042 drop_overlimit 12019 new_flow_count 9172 ecn_mark 0 new_flows_len 1 old_flows_len 2 queue-engineer@fq-codel-lab:~/kernel-lab/linux$ date Thu Dec 3 04:27:31 PM CET 2026 queue-engineer@fq-codel-lab:~/kernel-lab/linux$ cat /proc/version Linux version 7.0.0-44-generic (buildd@bos03-arm64-054) (aarch64-linux-gnu-gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, GNU ld (GNU Binutils for Ubuntu) 2.46) #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 6 02:50:28 UTC 2026 queue-engineer@fq-codel-lab:~/kernel-lab/linux$ uname -a Linux fq-codel-lab 7.0.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 6 02:50:28 UTC 2026 aarch64 GNU/Linux ---captured output end--- Output after the patch: ---captured output--- queue-engineer@fq-codel-lab:~$ uname -a Linux fq-codel-lab 7.4.0-rc5-g37ba33ea2993 #5 SMP PREEMPT_DYNAMIC Thu Dec 3 16:32:22 CET 2026 aarch64 GNU/Linux queue-engineer@fq-codel-lab:~$ cat /proc/version Linux version 7.4.0-rc5-g37ba33ea2993 (queue-engineer@fq-codel-lab) (gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, GNU ld (GNU Binutils for Ubuntu) 2.46) #5 SMP PREEMPT_DYNAMIC Thu Dec 3 16:32:22 CET 2026 queue-engineer@fq-codel-lab:~$ cd kernel-lab/ queue-engineer@fq-codel-lab:~/kernel-lab$ ./run_fqcodel_stress_test.sh tc utility, iproute2-6.19.0, libbpf 1.6.3 [sudo: authenticate] Password: ================================================================== RUN 1: Launching Flow 1 (port 5201) first, then Flow 2 (port 5202) ================================================================== --- Run 1 | Flow 1 (port 5201 - started 1st) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15001 (0%) sender [ 5] 0.00-15.00 sec 8.73 MBytes 4.88 Mbits/sec 0.404 ms 5847/15001 (39%) receiver iperf Done. --- Run 1 | Flow 2 (port 5202 - started 2nd) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15002 (0%) sender [ 5] 0.00-15.00 sec 8.59 MBytes 4.80 Mbits/sec 0.019 ms 5994/15002 (40%) receiver iperf Done. --- Run 1 | qdisc stats --- qdisc htb 1: root refcnt 9 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000 Sent 18928361 bytes 18200 pkt (dropped 11843, overlimits 17739 requeues 0) backlog 0b 0p requeues 0 qdisc fq_codel 10: parent 1:10 limit 1p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb drop_batch 64 Sent 18928361 bytes 18200 pkt (dropped 11843, overlimits 0 requeues 0) backlog 0b 0p requeues 0 maxpacket 1042 drop_overlimit 11843 new_flow_count 5590 ecn_mark 0 new_flows_len 1 old_flows_len 1 ================================================================== RUN 2: Launching Flow 2 (port 5202) first, then Flow 1 (port 5201) ================================================================== --- Run 2 | Flow 2 (port 5202 - started 1st) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15001 (0%) sender [ 5] 0.00-15.00 sec 8.68 MBytes 4.85 Mbits/sec 0.373 ms 5900/15000 (39%) receiver iperf Done. --- Run 2 | Flow 1 (port 5201 - started 2nd) --- - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-15.00 sec 14.3 MBytes 8.00 Mbits/sec 0.000 ms 0/15001 (0%) sender [ 5] 0.00-15.00 sec 8.48 MBytes 4.74 Mbits/sec 0.314 ms 6109/15001 (41%) receiver iperf Done. --- Run 2 | qdisc stats --- qdisc htb 1: root refcnt 9 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000 Sent 18750641 bytes 18023 pkt (dropped 12011, overlimits 17976 requeues 0) backlog 0b 0p requeues 0 qdisc fq_codel 10: parent 1:10 limit 1p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb drop_batch 64 Sent 18750641 bytes 18023 pkt (dropped 12011, overlimits 0 requeues 0) backlog 0b 0p requeues 0 maxpacket 1042 drop_overlimit 12011 new_flow_count 5672 ecn_mark 0 new_flows_len 1 old_flows_len 1 queue-engineer@fq-codel-lab:~/kernel-lab$ date Thu Dec 3 04:42:30 PM CET 2026 ---captured output end--- On 2026-12-03 17:42, Andreea-Carina Deaconu wrote: > Original bias: When the FQ Codel queue capacity is reached and we > proceed > in fq_codel_drop() to drop packets from the "fat flow" (the flow with > the biggest size), if there are two or more equal "fat flows", we > always > drop from the first flow found (the flow with the lowest index). > > Fix: When searching for the "fat flow", keep a candidate count and, if > there is more than one candidate, choose a random one to drop from. > > Reported-by: Thomas Begin > Reported-by: Andreea-Carina Deaconu > Signed-off-by: Andreea-Carina Deaconu > --- > net/sched/sch_fq_codel.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c > index e0fcda26f..b63d3a3de 100644 > --- a/net/sched/sch_fq_codel.c > +++ b/net/sched/sch_fq_codel.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -139,8 +140,9 @@ static unsigned int fq_codel_drop(struct Qdisc > *sch, unsigned int max_packets, > { > struct fq_codel_sched_data *q = qdisc_priv(sch); > struct sk_buff *skb; > - unsigned int maxbacklog = 0, idx = 0, i, len; > struct fq_codel_flow *flow; > + unsigned int maxbacklog = 0, idx = 0, ties = 0; > + unsigned int target = 0, match_idx = 0, i, len; > unsigned int threshold; > unsigned int mem = 0; > > @@ -154,7 +156,26 @@ static unsigned int fq_codel_drop(struct Qdisc > *sch, unsigned int max_packets, > for (i = 0; i < q->flows_cnt; i++) { > if (q->backlogs[i] > maxbacklog) { > maxbacklog = q->backlogs[i]; > - idx = i; > + ties = 1; > + } else if (maxbacklog > 0 && q->backlogs[i] == > maxbacklog) { > + ties++; > + } > + } > + > + if (maxbacklog > 0 && ties > 0) { > + if (ties == 1) > + target = 0; > + else > + target = get_random_u32() % ties; > + > + for (i = 0; i < q->flows_cnt; i++) { > + if (q->backlogs[i] == maxbacklog) { > + if (match_idx == target) { > + idx = i; > + break; > + } > + match_idx++; > + } > } > }