netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Cosmin Ratiu <cratiu@nvidia.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	Dragos Tatulea <dtatulea@nvidia.com>,
	"sdf@fomichev.me" <sdf@fomichev.me>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"jiri@resnulli.us" <jiri@resnulli.us>,
	"edumazet@google.com" <edumazet@google.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net] net: Lock lower level devices when updating features
Date: Tue, 6 May 2025 11:13:51 -0700	[thread overview]
Message-ID: <aBpRX_afG5X_rT_J@mini-arch> (raw)
In-Reply-To: <8f700330f22b741ad72b398ff30a4468c2cb67e9.camel@nvidia.com>

On 05/06, Cosmin Ratiu wrote:
> On Tue, 2025-05-06 at 10:12 -0700, Stanislav Fomichev wrote:
> > On 05/06, Cosmin Ratiu wrote:
> > > __netdev_update_features() expects the netdevice to be ops-locked,
> > > but
> > > it gets called recursively on the lower level netdevices to sync
> > > their
> > > features, and nothing locks those.
> > > 
> > > This commit fixes that, with the assumption that it shouldn't be
> > > possible
> > > for both higher-level and lover-level netdevices to require the
> > > instance
> > > lock, because that would lead to lock dependency warnings.
> > > 
> > > Without this, playing with higher level (e.g. vxlan) netdevices on
> > > top
> > > of netdevices with instance locking enabled can run into issues:
> > 
> > Mentioning vxlan is a bit confusing here; it shouldn't let you flip
> > lro (I
> > think). Which upper are you testing against?
> 
> It is vxlan, but LRO is just a red herring in this case, 
> mlx5e_set_features calls every feature handler in turn, and this is
> just the example I picked from the sea of stack traces.
> 
> > 
> > Trying to understand if we can cover this case in the selftests.
> > netdevsim also doesn't expose F_LRO feature... (yet?)
> 
> I see you found a way with teaming, but I think in essence a sequence
> of commands that makes __netdev_update_features call itself recursively
> once on the lower dev will trigger the netdev_ops_assert_locked on the
> lower dev.

Right, but netdev_sync_lower_features calls lower's __netdev_update_features
only for NETIF_F_UPPER_DISABLES. So it doesn't propagate all features,
only LRO AFAICT.

  reply	other threads:[~2025-05-06 18:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 14:21 [PATCH net] net: Lock lower level devices when updating features Cosmin Ratiu
2025-05-06 17:12 ` Stanislav Fomichev
2025-05-06 17:40   ` Stanislav Fomichev
2025-05-06 17:47   ` Cosmin Ratiu
2025-05-06 18:13     ` Stanislav Fomichev [this message]
2025-05-07 14:35       ` Cosmin Ratiu
2025-05-07 15:13         ` Cosmin Ratiu
2025-05-07 20:29           ` Cosmin Ratiu
2025-05-07 21:20             ` Stanislav Fomichev
2025-05-08 10:33               ` Cosmin Ratiu

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=aBpRX_afG5X_rT_J@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=cratiu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=sdf@fomichev.me \
    /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;
as well as URLs for NNTP newsgroup(s).