netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: "Maciej Żenczykowski" <maze@google.com>,
	davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
	martin.lau@linux.dev, daniel@iogearbox.net,
	john.fastabend@gmail.com, eddyz87@gmail.com, sdf@fomichev.me,
	haoluo@google.com, willemb@google.com,
	william.xuanziyang@huawei.com, alan.maguire@oracle.com,
	bpf@vger.kernel.org
Subject: Re: [PATCH net] net: clear the dst when changing skb protocol
Date: Thu, 5 Jun 2025 17:31:42 -0700	[thread overview]
Message-ID: <20250605173142.1c370506@kernel.org> (raw)
In-Reply-To: <684231d3bb907_208a5f2945f@willemb.c.googlers.com.notmuch>

On Thu, 05 Jun 2025 20:09:55 -0400 Willem de Bruijn wrote:
> > > It does make a fair bit of sense.
> > > Question: does calling it as a kfunc require kernel BTF?
> > > Specifically some ram limited devices want to disable CONFIG_DEBUG_INFO_BTF...
> > > I know normal bpf helpers don't need that...
> > > I guess you could always convert ipv4 -> ipv6 -> ipv4 ;-)  
> > 
> > Not sure how BPF folks feel about that, but technically we could
> > also add a flag to bpf_skb_adjust_room() or bpf_skb_change_proto().  
> 
> To invert the question: what is the value in keeping the dst?

I guess simplicity defined as "how many English words are needed to
explain the semantics".

The semantics I have in mind would be - dst is dropped if (1) proto 
is changed (this patch), or (2) "CLEAR_DST" flag is explicitly set
(future extension).

If we drop on encap (which I supposed is the counter proposal)
we may end up with: dst is dropped if (1) proto is changed, 
(2) encap flags are set (1+2 = alternative patch), or (3) "CLEAR_DST"
flag is explicitly set (future extension). 

Don't think we can rule out the need for a CLEAR_DST flag as not all
re-routings are encaps.

But both you and Maciej consider dropping for all encaps more
intuitive, so I'll do that in v2 unless someone objects.

> The test refers to a nat6to4.bpf.o, but this is not included.

I reused an existing BPF prog, it does what we need -
it turns a v4 packet into a v6 one :)

  reply	other threads:[~2025-06-06  0:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 21:06 [PATCH net] net: clear the dst when changing skb protocol Jakub Kicinski
2025-06-04 21:21 ` Maciej Żenczykowski
2025-06-05 13:22   ` Jakub Kicinski
2025-06-05 13:50     ` Maciej Żenczykowski
2025-06-05 14:01       ` Jakub Kicinski
2025-06-06  0:09         ` Willem de Bruijn
2025-06-06  0:31           ` Jakub Kicinski [this message]
2025-06-06  9:40             ` Maciej Żenczykowski
2025-06-06 17:11               ` Jakub Kicinski
2025-06-06 17:36                 ` Maciej Żenczykowski
2025-06-06 15:55             ` Willem de Bruijn
2025-06-06 17:09               ` Jakub Kicinski
2025-06-04 21:45 ` Daniel Borkmann

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=20250605173142.1c370506@kernel.org \
    --to=kuba@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=haoluo@google.com \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=william.xuanziyang@huawei.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;
as well as URLs for NNTP newsgroup(s).