From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <pabeni@redhat.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <horms@kernel.org>,
<kuba@kernel.org>, <kuni1840@gmail.com>, <kuniyu@amazon.com>,
<netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next 3/7] neighbour: Allocate skb in neigh_get().
Date: Thu, 24 Apr 2025 16:10:57 -0700 [thread overview]
Message-ID: <20250424231059.70667-1-kuniyu@amazon.com> (raw)
In-Reply-To: <c932825f-6249-48c0-bb10-8c5754e01f8e@redhat.com>
From: Paolo Abeni <pabeni@redhat.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!
next prev parent reply other threads:[~2025-04-24 23:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 1:26 [PATCH v2 net-next 0/7] neighbour: Convert RTM_GETNEIGH and RTM_{GET,SET}NEIGHTBL to RCU Kuniyuki Iwashima
2025-04-18 1:26 ` [PATCH v2 net-next 1/7] neighbour: Make neigh_valid_get_req() return ndmsg Kuniyuki Iwashima
2025-04-18 1:26 ` [PATCH v2 net-next 2/7] neighbour: Move two validations from neigh_get() to neigh_valid_get_req() Kuniyuki Iwashima
2025-04-18 1:26 ` [PATCH v2 net-next 3/7] neighbour: Allocate skb in neigh_get() Kuniyuki Iwashima
2025-04-24 8:29 ` Paolo Abeni
2025-04-24 23:10 ` Kuniyuki Iwashima [this message]
2025-04-18 1:26 ` [PATCH v2 net-next 4/7] neighbour: Move neigh_find_table() to neigh_get() Kuniyuki Iwashima
2025-04-18 1:26 ` [PATCH v2 net-next 5/7] neighbour: Convert RTM_GETNEIGH to RCU Kuniyuki Iwashima
2025-04-24 8:31 ` Paolo Abeni
2025-04-24 23:17 ` Kuniyuki Iwashima
2025-04-18 1:26 ` [PATCH v2 net-next 6/7] neighbour: Convert RTM_GETNEIGHTBL " Kuniyuki Iwashima
2025-04-24 8:19 ` Paolo Abeni
2025-04-24 23:03 ` Kuniyuki Iwashima
2025-04-18 1:26 ` [PATCH v2 net-next 7/7] neighbour: Convert RTM_SETNEIGHTBL " Kuniyuki Iwashima
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=20250424231059.70667-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 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).