[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250424231059.70667-1-kuniyu@amazon.com>
Date: Thu, 24 Apr 2025 16:10:57 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <pabeni@...hat.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <horms@...nel.org>,
<kuba@...nel.org>, <kuni1840@...il.com>, <kuniyu@...zon.com>,
<netdev@...r.kernel.org>
Subject: Re: [PATCH v2 net-next 3/7] neighbour: Allocate skb in neigh_get().
From: Paolo Abeni <pabeni@...hat.com>
Date: Thu, 24 Apr 2025 10:29:19 +0200
> On 4/18/25 3:26 AM, Kuniyuki Iwashima wrote:
> > @@ -3013,23 +2982,30 @@ static int neigh_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
> > pn = pneigh_lookup(tbl, net, dst, dev, 0);
>
> pneigh_lookup() can create the neighbor when the last argument is 1, and
> contains an ASSERT_RTNL() on such code path that may confuse the casual
> reader.
Agree, I didn't like the ASSERT_RTNL() in the middle of the function...
> I think here you could use __pneigh_lookup().
read_lock_bh() is needed, but yes.
Only one caller passes 1 to pneigh_lookup(), and only pndisc_is_router()
calls __pneigh_lookup().
I'll clean them up in v3 too.
Thanks!
Powered by blists - more mailing lists