netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: "David S. Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>, <netdev@vger.kernel.org>
Subject: [PATCH v2 net-next 0/6] arp: Random clean up and RCU conversion for ioctl(SIOCGARP).
Date: Thu, 25 Apr 2024 09:59:56 -0700	[thread overview]
Message-ID: <20240425170002.68160-1-kuniyu@amazon.com> (raw)

arp_ioctl() holds rtnl_lock() regardless of cmd (SIOCDARP, SIOCSARP,
and SIOCGARP) to get net_device by __dev_get_by_name().

In the SIOCGARP path, arp_req_get() calls neigh_lookup(), which looks
up a neighbour entry under RCU.

This series cleans up ioctl() code a bit and extends the RCU section not
to take rtnl_lock() and instead use dev_get_by_name_rcu() for SIOCGARP.


Changes:
  v2:
    Patch 5: s/!IS_ERR/IS_ERR/ in arp_req_delete().

  v1: https://lore.kernel.org/netdev/20240422194755.4221-1-kuniyu@amazon.com/


Kuniyuki Iwashima (6):
  arp: Move ATF_COM setting in arp_req_set().
  arp: Validate netmask earlier for SIOCDARP and SIOCSARP in
    arp_ioctl().
  arp: Factorise ip_route_output() call in arp_req_set() and
    arp_req_delete().
  arp: Remove a nest in arp_req_get().
  arp: Get dev after calling arp_req_(delete|set|get)().
  arp: Convert ioctl(SIOCGARP) to RCU.

 net/ipv4/arp.c | 203 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 123 insertions(+), 80 deletions(-)

-- 
2.30.2


             reply	other threads:[~2024-04-25 17:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 16:59 Kuniyuki Iwashima [this message]
2024-04-25 16:59 ` [PATCH v2 net-next 1/6] arp: Move ATF_COM setting in arp_req_set() Kuniyuki Iwashima
2024-04-25 16:59 ` [PATCH v2 net-next 2/6] arp: Validate netmask earlier for SIOCDARP and SIOCSARP in arp_ioctl() Kuniyuki Iwashima
2024-04-25 16:59 ` [PATCH v2 net-next 3/6] arp: Factorise ip_route_output() call in arp_req_set() and arp_req_delete() Kuniyuki Iwashima
2024-04-25 17:00 ` [PATCH v2 net-next 4/6] arp: Remove a nest in arp_req_get() Kuniyuki Iwashima
2024-04-25 17:00 ` [PATCH v2 net-next 5/6] arp: Get dev after calling arp_req_(delete|set|get)() Kuniyuki Iwashima
2024-04-25 17:00 ` [PATCH v2 net-next 6/6] arp: Convert ioctl(SIOCGARP) to RCU Kuniyuki Iwashima
2024-04-25 17:12   ` Eric Dumazet
2024-04-25 17:51     ` Kuniyuki Iwashima
2024-04-25 20:35       ` Eric Dumazet
2024-04-25 20:47         ` 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=20240425170002.68160-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --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).