Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next 1/2] geneve: convert config to RCU-protected pointer
Date: Tue, 7 Jul 2026 15:15:55 +0200	[thread overview]
Message-ID: <6c4a0a58-8233-408f-ae6b-c66f38d8f3a9@redhat.com> (raw)
In-Reply-To: <20260701120454.3533252-2-edumazet@google.com>

On 7/1/26 2:04 PM, Eric Dumazet wrote:
> @@ -1137,21 +1144,22 @@ static int geneve_sock_add(struct geneve_dev *geneve, bool ipv6)
>  static int geneve_open(struct net_device *dev)
>  {
>  	struct geneve_dev *geneve = netdev_priv(dev);
> -	bool dualstack = geneve->cfg.dualstack;
> +	const struct geneve_config *cfg = rtnl_dereference(geneve->cfg);

Minor nit only mentioned because a repost is likely needed: here and in
a few other places the variable declaration order is not respected.

[...]
> @@ -1539,28 +1551,36 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
>  static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
>  	struct geneve_dev *geneve = netdev_priv(dev);
> -	struct ip_tunnel_info *info = NULL;
> +	const struct ip_tunnel_info *info = NULL;
> +	const struct geneve_config *cfg;
>  	int err;
>  
> -	if (geneve->cfg.collect_md) {
> +	rcu_read_lock();
> +	cfg = rcu_dereference(geneve->cfg);
> +	if (unlikely(!cfg)) {

I also *think* the conditional is not needed here.

[...]
> @@ -1717,6 +1790,8 @@ static void geneve_setup(struct net_device *dev)
>  	dev->netdev_ops = &geneve_netdev_ops;
>  	dev->ethtool_ops = &geneve_ethtool_ops;
>  	dev->needs_free_netdev = true;
> +	dev->priv_destructor = geneve_free_dev;

Both sashikos point out this may cause double free.

Side note: I think that ideally it would be good to break this patch into 2:
- passing an explicit `const struct geneve_config *` argument where needed.
- doing the rcu conversion.

/P


  parent reply	other threads:[~2026-07-07 13:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 12:04 [PATCH net-next 0/2] geneve: make geneve_fill_info() RTNL-less Eric Dumazet
2026-07-01 12:04 ` [PATCH net-next 1/2] geneve: convert config to RCU-protected pointer Eric Dumazet
2026-07-02  2:49   ` Kuniyuki Iwashima
2026-07-07 13:15   ` Paolo Abeni [this message]
2026-07-01 12:04 ` [PATCH net-next 2/2] geneve: make geneve_fill_info() RTNL independent Eric Dumazet
2026-07-02  2:50   ` Kuniyuki Iwashima

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=6c4a0a58-8233-408f-ae6b-c66f38d8f3a9@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    /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