[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241106163251.97101-1-kuniyu@amazon.com>
Date: Wed, 6 Nov 2024 08:32:51 -0800
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <pabeni@...hat.com>
CC: <andrew+netdev@...n.ch>, <daniel@...earbox.net>, <davem@...emloft.net>,
<edumazet@...gle.com>, <horms@...nel.org>, <kuba@...nel.org>,
<kuni1840@...il.com>, <kuniyu@...zon.com>, <mailhol.vincent@...adoo.fr>,
<mkl@...gutronix.de>, <netdev@...r.kernel.org>, <razor@...ckwall.org>
Subject: Re: [PATCH v2 net-next 6/7] rtnetlink: Convert RTM_NEWLINK to per-netns RTNL.
From: Paolo Abeni <pabeni@...hat.com>
Date: Wed, 6 Nov 2024 10:00:26 +0100
> On 11/6/24 03:24, Kuniyuki Iwashima wrote:
> > @@ -7001,7 +7021,8 @@ static struct pernet_operations rtnetlink_net_ops = {
> > };
> >
> > static const struct rtnl_msg_handler rtnetlink_rtnl_msg_handlers[] __initconst = {
> > - {.msgtype = RTM_NEWLINK, .doit = rtnl_newlink},
> > + {.msgtype = RTM_NEWLINK, .doit = rtnl_newlink,
> > + .flags = RTNL_FLAG_DOIT_PERNET},
> > {.msgtype = RTM_DELLINK, .doit = rtnl_dellink},
> > {.msgtype = RTM_GETLINK, .doit = rtnl_getlink,
> > .dumpit = rtnl_dump_ifinfo, .flags = RTNL_FLAG_DUMP_SPLIT_NLM_DONE},
>
> It looks like this still causes look problems - srcu/rtnl acquired in
> both orders:
>
> https://netdev-3.bots.linux.dev/vmksft-net-dbg/results/847881/12-rtnetlink-sh/stderr
>
> It looks like __rtnl_link_unregister() should release the rtnl lock
> around synchronize_srcu(). I'm unsure if would cause other problems, too.
It seems I need to unexport __rtnl_link_unregister(), add mutex for
rtnl_link_ops, and move ops deletion before down_write(&pernet_ops_rwsem)
in rtnl_link_unregister().
It would be better than releasing RTNL after rtnl_lock_unregistering_all().
>
> Please have a self-tests run with lockdep enabled before the next iteration:
>
> https://github.com/linux-netdev/nipa/wiki/How-to-run-netdev-selftests-CI-style
>
> The whole test suite could be quite cumbersome, but the rtnetlink.sh
> test should give a good coverage.
Sure, sorry for the churn for other patches..
I noticed rmmod wasn't tested on my QEMU because I enabled drivers
as =y so that I need not copy .ko. I'll run test with netdevsim
as =m at least.
>
> Thanks.
>
> Paolo
>
> p.s. kudos to Jakub for the extra miles to create and maintain the CI
> infra: it's really catching up non trivial things.
+100
Thank you!
Powered by blists - more mailing lists