Skip to contentSkip to conversation

net_sched: sch_fq: fastpath needs to take care of sk->sk_pacing_status

PATCH Applied Eric Dumazet 3 participants 3 messages Oct 20, 2023 – Oct 23, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net_sched: sch_fq: fastpath needs to take care of sk->sk_pacing_status

If packets of a TCP flows take the fast path, we need to make sure sk->sk_pacing_status is set to SK_PACING_FQ otherwise TCP might fallback to internal pacing, which is not optimal.

Fixes 076433bd78d7 ("net_sched: sch_fq: add fast path for mostly idle qdisc")
---
 net/sched/sch_fq.c | 4 ++++
 1 file changed, 4 insertions(+)
net/sched/sch_fq.c +4 -0
index f6fd0de293e583ad6ba505060ce12c74f349a1a2..bf9d00518a60853b27910c47738509c09d53bf19 100644
@@ -383,6 +383,10 @@ static struct fq_flow *fq_classify(struct Qdisc *sch, struct sk_buff *skb,
 
 	if (fq_fastpath_check(sch, skb, now)) {
 		q->internal.stat_fastpath_packets++;
+		if (skb->sk == sk && q->rate_enable &&
+		    READ_ONCE(sk->sk_pacing_status) != SK_PACING_FQ)
+			smp_store_release(&sk->sk_pacing_status,
+					  SK_PACING_FQ);
 		return &q->internal;
 	}
 
Signature · 1 line
2.42.0.655.g421f12c284-goog
#2 lore raw
In reply to Eric Dumazet
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 20 Oct 2023 20:12:54 +0000 you wrote:

If packets of a TCP flows take the fast path, we need to make sure sk->sk_pacing_status is set to SK_PACING_FQ otherwise TCP might fallback to internal pacing, which is not optimal.

Fixes 076433bd78d7 ("net_sched: sch_fq: add fast path for mostly idle qdisc")

[...]

Here is the summary with links:
- [net-next] net_sched: sch_fq: fastpath needs to take care of sk->sk_pacing_status

    https://git.kernel.org/netdev/net-next/c/81a416985698

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html