Netdev List
 help / color / mirror / Atom feed
From: Yuya Kusakabe <yuya.kusakabe@gmail.com>
To: edumazet@google.com
Cc: andrea.mayer@uniroma2.it, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] seg6: reallocate the skb head on L2 encapsulation only when needed
Date: Thu,  3 Sep 2026 14:09:05 +0900	[thread overview]
Message-ID: <20260903130525.28296-1-yuya.kusakabe@gmail.com> (raw)
In-Reply-To: <CANn89iKUqjbrRkr68+S9nKAu49C3K01e3XSNwkY1NCgmuPMPag@mail.gmail.com>

On Wed, Sep 2, 2026 at 11:00 AM Eric Dumazet <edumazet@google.com> wrote:
> This is a nice improvement for forwarded traffic, but locally
> generated TCP traffic
> is still hitting two expensive reallocations (second one in
> __seg6_do_srh_encap())
>
> Can we combine needed headrooms so that only a single re-alloc occurs?
Thanks for looking at this.  I will send a v2 with the combined
headroom.

One clarification on the locally generated case: seg6_build_state()
does not redirect the output path for the L2 modes, so locally
generated traffic never reaches this branch:

	newts->flags |= LWTUNNEL_STATE_INPUT_REDIRECT;

	if (tuninfo->mode != SEG6_IPTUN_MODE_L2ENCAP &&
	    tuninfo->mode != SEG6_IPTUN_MODE_L2ENCAP_RED)
		newts->flags |= LWTUNNEL_STATE_OUTPUT_REDIRECT;

Two reallocations do happen on the forwarded path, though: with a
header-cloned skb whose headroom is below the total, asking only for
skb->mac_len leaves the second reallocation to __seg6_do_srh_encap(),
because the cow that unclones the skb does not also make room for the
outer header.  So the combined headroom is the right shape either way.

      reply	other threads:[~2026-09-03  5:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  8:34 [PATCH net-next] seg6: reallocate the skb head on L2 encapsulation only when needed Yuya Kusakabe
2026-09-02  9:00 ` Eric Dumazet
2026-09-03  5:09   ` Yuya Kusakabe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260903130525.28296-1-yuya.kusakabe@gmail.com \
    --to=yuya.kusakabe@gmail.com \
    --cc=andrea.mayer@uniroma2.it \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox