The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/3] net: core: improvements to device lookup by hardware address.
@ 2025-02-12 17:47 Breno Leitao
  2025-02-12 17:47 ` [PATCH net-next v3 1/3] net: document return value of dev_getbyhwaddr_rcu() Breno Leitao
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Breno Leitao @ 2025-02-12 17:47 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Andrew Lunn, David Ahern
  Cc: linux-kernel, netdev, Breno Leitao, kuniyu, ushankar, kernel-team,
	Kuniyuki Iwashima

The first patch adds missing documentation for the return value of
dev_getbyhwaddr_rcu(), fixing a warning reported by NIPA. The kdoc
comment now properly specifies that the function returns either a
pointer to net_device or NULL when no matching device is found.

The second patch adds a new dev_getbyhwaddr() helper function for
finding devices by hardware address when the RTNL lock is held. This
prevents PROVE_LOCKING warnings that occurred when RTNL was held but the
RCU read lock wasn't. The common address comparison logic is extracted
into dev_comp_addr() to avoid code duplication.

The third part coverts arp_req_set_public() to the new helper.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes in v3:
- Fixed the cover letter (Kuniyuki Iwashima)
- Added a third patch converting arp_req_set_public() to the new helper
  (Kuniyuki Iwashima)
- Link to v2:
  https://lore.kernel.org/r/20250210-arm_fix_selftest-v2-0-ba84b5bc58c8@debian.org

Changes in v2:
- Fixed the documentation (Jakub)
- Renamed the function from dev_getbyhwaddr_rtnl() to dev_getbyhwaddr()
  (Jakub)
- Exported the function in the header (Jakub)
- Link to v1: https://lore.kernel.org/r/20250207-arm_fix_selftest-v1-1-487518d2fd1c@debian.org

---
Breno Leitao (3):
      net: document return value of dev_getbyhwaddr_rcu()
      net: Add dev_getbyhwaddr_rtnl() helper
      arp: switch to dev_getbyhwaddr() in arp_req_set_public()

 include/linux/netdevice.h |  2 ++
 net/core/dev.c            | 38 ++++++++++++++++++++++++++++++++++----
 net/ipv4/arp.c            |  2 +-
 3 files changed, 37 insertions(+), 5 deletions(-)
---
base-commit: 4e41231249f4083a095085ff86e317e29313c2c3
change-id: 20250207-arm_fix_selftest-ee29dbc33a06

Best regards,
-- 
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-02-13 12:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 17:47 [PATCH net-next v3 0/3] net: core: improvements to device lookup by hardware address Breno Leitao
2025-02-12 17:47 ` [PATCH net-next v3 1/3] net: document return value of dev_getbyhwaddr_rcu() Breno Leitao
2025-02-13  7:36   ` Kuniyuki Iwashima
2025-02-13  7:47     ` Kuniyuki Iwashima
2025-02-13 10:16       ` Breno Leitao
2025-02-13 10:45         ` Kuniyuki Iwashima
2025-02-12 17:47 ` [PATCH net-next v3 2/3] net: Add dev_getbyhwaddr_rtnl() helper Breno Leitao
2025-02-13  7:31   ` Kuniyuki Iwashima
2025-02-13 10:29     ` Breno Leitao
2025-02-13 10:52       ` Kuniyuki Iwashima
2025-02-13 12:29         ` Breno Leitao
2025-02-12 17:47 ` [PATCH net-next v3 3/3] arp: switch to dev_getbyhwaddr() in arp_req_set_public() Breno Leitao
2025-02-13  7:45   ` Kuniyuki Iwashima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox