public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>,
	Fernando Fernandez Mancera <fmancera@suse.de>
Cc: netdev@vger.kernel.org, tgraf@infradead.org, horms@kernel.org,
	pabeni@redhat.com, edumazet@google.com, davem@davemloft.net
Subject: Re: [PATCH net v4] ipv4: bump rt_genid when a relevant devconf value changes through netlink
Date: Sat, 14 Mar 2026 10:16:50 -0600	[thread overview]
Message-ID: <41885d77-2509-445c-af01-0b1e556703ec@kernel.org> (raw)
In-Reply-To: <20260314090614.116f38cc@kernel.org>

On 3/14/26 10:06 AM, Jakub Kicinski wrote:
> On Fri, 13 Mar 2026 16:13:20 +0100 Fernando Fernandez Mancera wrote:
>>> Also, you are flushing the cache for more values than sysfs does.  
>>
>> I don't think so. The problem is that the handling of sysctl is 
>> scattered in several places.
>>
>> IPV4_DEVCONF_FORWARDING is flushed at devinet_sysctl_forward().
>>
>> IPV4_DEVCONF_NOXFRM, IPV4_DEVCONF_NOPOLICY, 
>> IPV4_DEVCONF_PROMOTE_SECONDARIES, IPV4_DEVCONF_ROUTE_LOCALNET, and 
>> IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST are flushed at 
>> ipv4_doint_and_flush() used by macro DEVINET_SYSCTL_FLUSHING_ENTRY.
>>
>> Finally, IPV4_DEVCONF_BC_FORWARDING and IPV4_DEVCONF_ACCEPT_LOCAL are 
>> flushed at devinet_conf_proc().
>>
>> Yes, I know, the fact that they are scattered around is quite confusing. 
>> This could be all unified in a single place but that would be too much 
>> for net tree IMHO.
>>
>> Please let me know if I am missing something.
> 
> I think David means that for some knobs procfs only flushes when value
> changes "in one direct", eg
> 
>                 if (i == IPV4_DEVCONF_ACCEPT_LOCAL - 1 ||                       
>                     i == IPV4_DEVCONF_ROUTE_LOCALNET - 1)                       
>                         if ((new_value == 0) && (old_value != 0))               
>                                 rt_cache_flush(net);       
> 
> which means only flush on the 1 -> 0 transition.

logic subtleties like this example is why I was asking about a proper
refactor.

since this bug has been around for years, why worry about a patch for
-net and the back propagation to stable releases that will follow?

  reply	other threads:[~2026-03-14 16:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 14:45 [PATCH net v4] ipv4: bump rt_genid when a relevant devconf value changes through netlink Fernando Fernandez Mancera
2026-03-13 14:56 ` David Ahern
2026-03-13 15:13   ` Fernando Fernandez Mancera
2026-03-14 16:06     ` Jakub Kicinski
2026-03-14 16:16       ` David Ahern [this message]
2026-03-14 17:52         ` Fernando Fernandez Mancera

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=41885d77-2509-445c-af01-0b1e556703ec@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fmancera@suse.de \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tgraf@infradead.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