netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Cosmin Ratiu <cratiu@nvidia.com>
Cc: netdev@vger.kernel.org, Stanislav Fomichev <sdf@fomichev.me>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"jiri @ resnulli . us" <jiri@resnulli.us>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Dragos Tatulea <dtatulea@nvidia.com>,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net] net: Lock lower level devices when updating features
Date: Tue, 6 May 2025 10:40:27 -0700	[thread overview]
Message-ID: <aBpJi3t0RhUj5HPE@mini-arch> (raw)
In-Reply-To: <aBpC9_SgUaAA2P0f@mini-arch>

On 05/06, 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?
> 
> Trying to understand if we can cover this case in the selftests.
> netdevsim also doesn't expose F_LRO feature... (yet?)

Ok, yeah, I can see it with the teaming on top of netdevsim and the following
patch applied. Might try to send a testcase to cover this and the promisc part
that I missed.

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

diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 2aa999345fe1..af545d42961c 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -881,11 +881,13 @@ static void nsim_setup(struct net_device *dev)
 			 NETIF_F_SG |
 			 NETIF_F_FRAGLIST |
 			 NETIF_F_HW_CSUM |
+			 NETIF_F_LRO |
 			 NETIF_F_TSO;
 	dev->hw_features |= NETIF_F_HW_TC |
 			    NETIF_F_SG |
 			    NETIF_F_FRAGLIST |
 			    NETIF_F_HW_CSUM |
+			    NETIF_F_LRO |
 			    NETIF_F_TSO;
 	dev->max_mtu = ETH_MAX_MTU;
 	dev->xdp_features = NETDEV_XDP_ACT_HW_OFFLOAD;

  reply	other threads:[~2025-05-06 17:40 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 [this message]
2025-05-06 17:47   ` Cosmin Ratiu
2025-05-06 18:13     ` Stanislav Fomichev
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=aBpJi3t0RhUj5HPE@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).