Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: fmancera@suse.de
Cc: Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, pabeni@redhat.com, kuba@kernel.org,
	edumazet@google.com, dsahern@kernel.org, idosch@nvidia.com,
	davem@davemloft.net
Subject: Re: [PATCH 2/3 net-next v6] ipv4: handle devconf post-set actions on netlink updates
Date: Fri, 12 Jun 2026 13:38:20 +0100	[thread overview]
Message-ID: <20260612123820.673243-1-horms@kernel.org> (raw)
In-Reply-To: <20260609204520.4670-2-fmancera@suse.de>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
Full review at: https://sashiko.dev
---
ipv4: handle devconf post-set actions on netlink updates

This commit ensures that IPv4 device configuration parameters updated
via netlink trigger the same post-modification actions as sysctl updates.
It addresses the inconsistency by calling devinet_conf_post_set() inside
inet_set_link_af() and deferring cache flushing.

> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index 8300516fb38f4..a35b72662e431 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -2161,6 +2161,20 @@ static bool devinet_conf_post_set(struct net *net, struct ipv4_devconf *cnf,
[ ... ]
> +	case IPV4_DEVCONF_FORWARDING:
> +		if (new == 1) {
> +			/* it is safe to use container_of() because forwarding case
> +			 * is only used by the netlink path
> +			 */
> +			struct in_device *idev = container_of(cnf, struct in_device, cnf);
> +
> +			netif_disable_lro(idev->dev);

[Severity: High]
Does calling netif_disable_lro() directly here without acquiring the
netdev_lock_ops mutex cause lockdep assertion failures?

Since inet_set_link_af() runs only under rtnl_lock() and does not acquire
the device ops lock, this direct invocation appears to bypass the locking
requirements for netif_disable_lro(), which modifies dev->wanted_features
and invokes netdev_update_features(dev).

On drivers that opt-in to netdev_lock_ops, does this create a concurrent
data race on the device features mask? Should this use dev_disable_lro()
instead, which correctly acquires and releases netdev_lock_ops(dev) around
the netif_disable_lro() call?

> +		}
> +
> +		inet_netconf_notify_devconf(net, RTM_NEWNETCONF,
> +					    NETCONFA_FORWARDING,
> +					    ifindex, cnf);
> +		return true;

  reply	other threads:[~2026-06-12 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 20:45 [PATCH 1/3 net-next v6] ipv4: centralize devconf sysctl handling Fernando Fernandez Mancera
2026-06-09 20:45 ` [PATCH 2/3 net-next v6] ipv4: handle devconf post-set actions on netlink updates Fernando Fernandez Mancera
2026-06-12 12:38   ` Simon Horman [this message]
2026-06-09 20:45 ` [PATCH 3/3 net-next v6] selftests: net: add test for IPv4 devconf netlink notifications 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=20260612123820.673243-1-horms@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=fmancera@suse.de \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --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