Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH v2 net-next 1/3] geneve: pass geneve_config pointer to helper functions
Date: Tue, 14 Jul 2026 19:03:59 +0100	[thread overview]
Message-ID: <20260714180359.GN1364329@horms.kernel.org> (raw)
In-Reply-To: <20260707145331.3717941-2-edumazet@google.com>

On Tue, Jul 07, 2026 at 02:53:28PM +0000, Eric Dumazet wrote:
> In preparation for converting geneve->cfg to an RCU-protected pointer,
> update helper functions to explicitly accept a const struct geneve_config
> pointer instead of dereferencing geneve->cfg directly.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Suggested-by: Paolo Abeni <pabeni@redhat.com>
> ---
>  drivers/net/geneve.c | 140 +++++++++++++++++++++++--------------------
>  1 file changed, 76 insertions(+), 64 deletions(-)
> 
> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c

...

> @@ -1306,14 +1313,14 @@ static int geneve_build_skb(struct dst_entry *dst, struct sk_buff *skb,
>  }
>  
>  static u8 geneve_get_dsfield(struct sk_buff *skb, struct net_device *dev,
> +			     const struct geneve_config *cfg,
>  			     const struct ip_tunnel_info *info,
>  			     bool *use_cache)
>  {
> -	struct geneve_dev *geneve = netdev_priv(dev);
>  	u8 dsfield;
>  
>  	dsfield = info->key.tos;
> -	if (dsfield == 1 && !geneve->cfg.collect_md) {
> +	if (cfg && dsfield == 1 && !cfg->collect_md) {

Hi Eric,

Sashiko.dev seems to think that the cfg guard is purely defensive.
Which does seem to be the case.
Perhaps it is an artifact from the development of v2?

>  		dsfield = ip_tunnel_get_dsfield(ip_hdr(skb), skb);
>  		*use_cache = false;
>  	}

...

  reply	other threads:[~2026-07-14 18:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 14:53 [PATCH v2 net-next 0/3] geneve: make geneve_fill_info() RTNL-less Eric Dumazet
2026-07-07 14:53 ` [PATCH v2 net-next 1/3] geneve: pass geneve_config pointer to helper functions Eric Dumazet
2026-07-14 18:03   ` Simon Horman [this message]
2026-07-07 14:53 ` [PATCH v2 net-next 2/3] geneve: convert config to RCU-protected pointer Eric Dumazet
2026-07-07 14:53 ` [PATCH v2 net-next 3/3] geneve: make geneve_fill_info() RTNL independent Eric Dumazet

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=20260714180359.GN1364329@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --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