Commit 08e14fe4 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net_sched: sch_fq: ensure maxrate fq parameter applies to EDT flows

When EDT conversion happened, fq lost the ability to enfore a maxrate
for all flows. It kept it for non EDT flows.

This commit restores the functionality.

Tested:

tc qd replace dev eth0 root fq maxrate 500Mbit
netperf -P0 -H host -- -O THROUGHPUT
489.75

Fixes: ab408b6d ("tcp: switch tcp and sch_fq to new earliest departure time model")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7150ceaa
...@@ -469,23 +469,30 @@ static struct sk_buff *fq_dequeue(struct Qdisc *sch) ...@@ -469,23 +469,30 @@ static struct sk_buff *fq_dequeue(struct Qdisc *sch)
goto begin; goto begin;
} }
prefetch(&skb->end); prefetch(&skb->end);
f->credit -= qdisc_pkt_len(skb); plen = qdisc_pkt_len(skb);
f->credit -= plen;
if (ktime_to_ns(skb->tstamp) || !q->rate_enable) if (!q->rate_enable)
goto out; goto out;
rate = q->flow_max_rate; rate = q->flow_max_rate;
/* If EDT time was provided for this skb, we need to
* update f->time_next_packet only if this qdisc enforces
* a flow max rate.
*/
if (!skb->tstamp) {
if (skb->sk) if (skb->sk)
rate = min(skb->sk->sk_pacing_rate, rate); rate = min(skb->sk->sk_pacing_rate, rate);
if (rate <= q->low_rate_threshold) { if (rate <= q->low_rate_threshold) {
f->credit = 0; f->credit = 0;
plen = qdisc_pkt_len(skb);
} else { } else {
plen = max(qdisc_pkt_len(skb), q->quantum); plen = max(plen, q->quantum);
if (f->credit > 0) if (f->credit > 0)
goto out; goto out;
} }
}
if (rate != ~0UL) { if (rate != ~0UL) {
u64 len = (u64)plen * NSEC_PER_SEC; u64 len = (u64)plen * NSEC_PER_SEC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment