Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Ren Wei <weir@nebusec.ai>, netdev@vger.kernel.org
Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, horms@kernel.org,
	tom@herbertland.com, vega@nebusec.ai, petalzu987@gmail.com
Subject: Re: [PATCH net v5 1/1] ip6_tunnel: snapshot encap in xmit
Date: Tue, 15 Sep 2026 11:20:56 +0200	[thread overview]
Message-ID: <7a67cc6c-9b3d-4332-b9a9-f63d959d5e58@redhat.com> (raw)
In-Reply-To: <e651fe9e-2d84-4320-99a1-6fddcfc00889@redhat.com>

On 9/15/26 11:20 AM, Paolo Abeni wrote:
> On 9/9/26 9:01 PM, Ren Wei wrote:
>> diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
>> index 7c9aadfe8fe3..ab217ddbeb20 100644
>> --- a/include/net/ip_tunnels.h
>> +++ b/include/net/ip_tunnels.h
>> @@ -522,6 +522,16 @@ skb_vlan_inet_prepare(struct sk_buff *skb, bool inner_proto_inherit)
>>  	return SKB_NOT_DROPPED_YET;
>>  }
>>  
>> +static inline void
>> +ip_tunnel_encap_snapshot(struct ip_tunnel_encap *dst,
>> +			 const struct ip_tunnel_encap *src)
>> +{
>> +	dst->type = READ_ONCE(src->type);
>> +	dst->flags = READ_ONCE(src->flags);
>> +	dst->sport = READ_ONCE(src->sport);
>> +	dst->dport = READ_ONCE(src->dport);
> 
> The above can still race with ip6_tnl_encap_setup() giving inconsistent
> results. As noted by Eric in v4 the solution would be convering the encap
> to RCU. I think that the additional dereference would be actually faster
> than the extra memory copy.
whoops... I almost forgot: I think such work should target net-next with
not fixes tag.

/P


  reply	other threads:[~2026-09-15  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 19:01 [PATCH net v5 0/1] ip6_tunnel: snapshot encap in xmit Ren Wei
2026-09-09 19:01 ` [PATCH net v5 1/1] " Ren Wei
2026-09-15  9:20   ` Paolo Abeni
2026-09-15  9:20     ` Paolo Abeni [this message]
2026-09-19 13:43       ` Artem Lytkin

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=7a67cc6c-9b3d-4332-b9a9-f63d959d5e58@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petalzu987@gmail.com \
    --cc=tom@herbertland.com \
    --cc=vega@nebusec.ai \
    --cc=weir@nebusec.ai \
    /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