Skip to contentSkip to conversation

mpls: Do not orphan the skb

PATCH Applied Christoph Paasch 3 participants 3 messages Mar 6, 2024 – Mar 8, 2024

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

PATCH 1/1 mpls: Do not orphan the skb

We observed that TCP-pacing was falling back to the TCP-layer pacing instead of utilizing sch_fq for the pacing. This causes significant CPU-usage due to the hrtimer running on a per-TCP-connection basis.

The issue is that mpls_xmit() calls skb_orphan() and thus sets skb->sk to NULL. Which implies that many of the goodies of TCP won't work. Pacing falls back to TCP-layer pacing. TCP Small Queues does not work, ...

It is safe to remove this call to skb_orphan() in mpls_xmit() as there really is not reason for it to be there. It appears that this call to skb_orphan comes from the very initial implementation of MPLS.

---
 net/mpls/mpls_iptunnel.c | 2 --
 1 file changed, 2 deletions(-)
net/mpls/mpls_iptunnel.c +0 -2
index ef59e25dc482..8fc790f2a01b 100644
@@ -55,8 +55,6 @@ static int mpls_xmit(struct sk_buff *skb)
 	out_dev = dst->dev;
 	net = dev_net(out_dev);
 
-	skb_orphan(skb);
-
 	if (!mpls_output_possible(out_dev) ||
 	    !dst->lwtstate || skb_warn_if_lro(skb))
 		goto drop;
Signature · 1 line
2.39.3 (Apple Git-146)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Christoph Paasch

We observed that TCP-pacing was falling back to the TCP-layer pacing instead of utilizing sch_fq for the pacing. This causes significant CPU-usage due to the hrtimer running on a per-TCP-connection basis.

The issue is that mpls_xmit() calls skb_orphan() and thus sets skb->sk to NULL. Which implies that many of the goodies of TCP won't work. Pacing falls back to TCP-layer pacing. TCP Small Queues does not work, ...

Quoted 8 lines

It is safe to remove this call to skb_orphan() in mpls_xmit() as there really is not reason for it to be there. It appears that this call to skb_orphan comes from the very initial implementation of MPLS.

---

This seems reasonable to me, thanks.

Packets are immediately sent, there is no queue.

#2 lore raw
In reply to Christoph Paasch
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 10 lines · On Wed, 06 Mar 2024 10:11:17 -0800 you wrote:

We observed that TCP-pacing was falling back to the TCP-layer pacing instead of utilizing sch_fq for the pacing. This causes significant CPU-usage due to the hrtimer running on a per-TCP-connection basis.

The issue is that mpls_xmit() calls skb_orphan() and thus sets skb->sk to NULL. Which implies that many of the goodies of TCP won't work. Pacing falls back to TCP-layer pacing. TCP Small Queues does not work, ...

[...]

Here is the summary with links:
- [net-next] mpls: Do not orphan the skb

    https://git.kernel.org/netdev/net-next/c/8edbd3960150

You are awesome, thank you!

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