netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mpls_xmit() calls skb_orphan()
@ 2023-12-08 21:06 Christoph Paasch
  2023-12-08 21:15 ` Christoph Paasch
  2024-02-22 16:34 ` Paolo Abeni
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Paasch @ 2023-12-08 21:06 UTC (permalink / raw)
  To: netdev, Roopa Prabhu; +Cc: Craig Taylor

Hello,

we observed an issue when running a TCP-connection with BBR on top of an MPLS-tunnel in that we saw a lot of CPU-time spent coming from tcp_pace_kick(), although sch_fq was configured on this host.

The reason for this seems to be because mpls_xmit() calls skb_orphan(), thus settings skb->sk to NULL, preventing the qdisc to set sk_pacing_status (which would allow to avoid the call to tcp_pace_kick()).

The question is: Why is this call to skb_orphan in mpls_xmit necessary ?


Thanks,
Christoph

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mpls_xmit() calls skb_orphan()
  2023-12-08 21:06 mpls_xmit() calls skb_orphan() Christoph Paasch
@ 2023-12-08 21:15 ` Christoph Paasch
  2023-12-08 23:44   ` Jakub Kicinski
  2024-02-22 16:34 ` Paolo Abeni
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Paasch @ 2023-12-08 21:15 UTC (permalink / raw)
  To: netdev, Roopa Prabhu; +Cc: Craig Taylor


> On Dec 8, 2023, at 1:06 PM, Christoph Paasch <cpaasch@apple.com> wrote:
> 
> Hello,
> 
> we observed an issue when running a TCP-connection with BBR on top of an MPLS-tunnel in that we saw a lot of CPU-time spent coming from tcp_pace_kick(), although sch_fq was configured on this host.
> 
> The reason for this seems to be because mpls_xmit() calls skb_orphan(), thus settings skb->sk to NULL, preventing the qdisc to set sk_pacing_status (which would allow to avoid the call to tcp_pace_kick()).
> 
> The question is: Why is this call to skb_orphan in mpls_xmit necessary ?
> 
> 
> Thanks,
> Christoph

Resend in plain-text. Sorry about that!


Christoph

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mpls_xmit() calls skb_orphan()
  2023-12-08 21:15 ` Christoph Paasch
@ 2023-12-08 23:44   ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2023-12-08 23:44 UTC (permalink / raw)
  To: Christoph Paasch; +Cc: netdev, Roopa Prabhu, Craig Taylor

Updating Roopa's email.

On Fri, 08 Dec 2023 13:15:04 -0800 Christoph Paasch wrote:
> > On Dec 8, 2023, at 1:06 PM, Christoph Paasch <cpaasch@apple.com> wrote:
> > 
> > Hello,
> > 
> > we observed an issue when running a TCP-connection with BBR on top of an MPLS-tunnel in that we saw a lot of CPU-time spent coming from tcp_pace_kick(), although sch_fq was configured on this host.
> > 
> > The reason for this seems to be because mpls_xmit() calls skb_orphan(), thus settings skb->sk to NULL, preventing the qdisc to set sk_pacing_status (which would allow to avoid the call to tcp_pace_kick()).
> > 
> > The question is: Why is this call to skb_orphan in mpls_xmit necessary ?
> > 
> > 
> > Thanks,
> > Christoph  
> 
> Resend in plain-text. Sorry about that!


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mpls_xmit() calls skb_orphan()
  2023-12-08 21:06 mpls_xmit() calls skb_orphan() Christoph Paasch
  2023-12-08 21:15 ` Christoph Paasch
@ 2024-02-22 16:34 ` Paolo Abeni
  1 sibling, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2024-02-22 16:34 UTC (permalink / raw)
  To: Christoph Paasch, netdev, Roopa Prabhu; +Cc: Craig Taylor

Reviving this old thread, as I stumbled upon it again...

On Fri, 2023-12-08 at 13:06 -0800, Christoph Paasch wrote:
> we observed an issue when running a TCP-connection with BBR on top 
> of an MPLS-tunnel in that we saw a lot of CPU-time spent coming 
> from tcp_pace_kick(), although sch_fq was configured on this host.
> 
> The reason for this seems to be because mpls_xmit() calls skb_orphan(), 
> thus settings skb->sk to NULL, preventing the qdisc to set 
> sk_pacing_status (which would allow to avoid the call to tcp_pace_kick()).
> 
> The question is: Why is this call to skb_orphan in mpls_xmit necessary ?

I guess the skb_orphan() call initially landed into mpls_xmit() to
provide isolation in case such xmit would correspond to netns crossing.

We had a similar situation for most IP tunnels before commit
9c4c325252c5 ("skbuff: preserve sock reference when scrubbing the
skb."). 

According to such commit changelog the skb socket reference is handled
carefully WRT netns boundaries elsewhere in the net stack, the
orphaning on TX is not required.

TL;DR: I believe removing the mentioned skb_orphan() is safe.

Cheers,

Paolo


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-22 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 21:06 mpls_xmit() calls skb_orphan() Christoph Paasch
2023-12-08 21:15 ` Christoph Paasch
2023-12-08 23:44   ` Jakub Kicinski
2024-02-22 16:34 ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).