All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Cosmin Ratiu <cratiu@nvidia.com>
Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Mina Almasry <almasrymina@google.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>,
	Dragos Tatulea <dtatulea@nvidia.com>
Subject: Re: [PATCH net v3] net: Lock lower level devices when updating features
Date: Fri, 9 May 2025 08:04:44 -0700	[thread overview]
Message-ID: <aB4ZjJDLYEJnqGGH@mini-arch> (raw)
In-Reply-To: <20250509072850.2002821-1-cratiu@nvidia.com>

On 05/09, 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:
> 
> WARNING: CPU: 59 PID: 206496 at ./include/net/netdev_lock.h:17 netif_napi_add_weight_locked+0x753/0xa60
> [...]
> Call Trace:
>  <TASK>
>  mlx5e_open_channel+0xc09/0x3740 [mlx5_core]
>  mlx5e_open_channels+0x1f0/0x770 [mlx5_core]
>  mlx5e_safe_switch_params+0x1b5/0x2e0 [mlx5_core]
>  set_feature_lro+0x1c2/0x330 [mlx5_core]
>  mlx5e_handle_feature+0xc8/0x140 [mlx5_core]
>  mlx5e_set_features+0x233/0x2e0 [mlx5_core]
>  __netdev_update_features+0x5be/0x1670
>  __netdev_update_features+0x71f/0x1670
>  dev_ethtool+0x21c5/0x4aa0
>  dev_ioctl+0x438/0xae0
>  sock_ioctl+0x2ba/0x690
>  __x64_sys_ioctl+0xa78/0x1700
>  do_syscall_64+0x6d/0x140
>  entry_SYSCALL_64_after_hwframe+0x4b/0x53
>  </TASK>
> 
> Fixes: 7e4d784f5810 ("net: hold netdev instance lock during rtnetlink operations")
> Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>

Acked-by: Stanislav Fomichev <sdf@fomichev.me>

  reply	other threads:[~2025-05-09 15:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  7:28 [PATCH net v3] net: Lock lower level devices when updating features Cosmin Ratiu
2025-05-09 15:04 ` Stanislav Fomichev [this message]
2025-05-13  2:00 ` patchwork-bot+netdevbpf

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=aB4ZjJDLYEJnqGGH@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=almasrymina@google.com \
    --cc=cratiu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=sdf@fomichev.me \
    --cc=tariqt@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.