From: Uday Shankar <ushankar@purestorage.com>
To: Breno Leitao <leitao@debian.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
kernel-team@meta.com, kuniyu@amazon.com
Subject: Re: [PATCH net-next v2 2/2] net: Add dev_getbyhwaddr_rtnl() helper
Date: Tue, 11 Feb 2025 01:10:01 -0700 [thread overview]
Message-ID: <Z6sF2RZRdqnH6MQR@dev-ushankar.dev.purestorage.com> (raw)
In-Reply-To: <20250210-arm_fix_selftest-v2-2-ba84b5bc58c8@debian.org>
On Mon, Feb 10, 2025 at 03:56:14AM -0800, Breno Leitao wrote:
> +/**
> + * dev_getbyhwaddr - find a device by its hardware address
> + * @net: the applicable net namespace
> + * @type: media type of device
> + * @ha: hardware address
> + *
> + * Similar to dev_getbyhwaddr_rcu(), but the owner needs to hold
> + * rtnl_lock.
> + *
> + * Return: pointer to the net_device, or NULL if not found
> + */
> +struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type,
> + const char *ha)
> +{
> + struct net_device *dev;
> +
> + ASSERT_RTNL();
> + for_each_netdev(net, dev)
> + if (dev_comp_addr(dev, type, ha))
> + return dev;
> +
> + return NULL;
> +}
> +EXPORT_SYMBOL(dev_getbyhwaddr);
Commit title should change to reflect the new function name in v2.
Separately - how should I combine this with
https://lore.kernel.org/netdev/20250205-netconsole-v3-0-132a31f17199@purestorage.com/?
I see three options:
- combine the two series into one
- wait for your series to land before mine
- figure out how to use take and use RCU correctly to avoid the warning,
then revert those changes and use your new helper in your series
(would want to avoid this, as it's more work for everyone)
next prev parent reply other threads:[~2025-02-11 8:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 11:56 [PATCH net-next v2 0/2] net: core: improvements to device lookup by hardware address Breno Leitao
2025-02-10 11:56 ` [PATCH net-next v2 1/2] net: document return value of dev_getbyhwaddr_rcu() Breno Leitao
2025-02-11 0:53 ` Kuniyuki Iwashima
2025-02-10 11:56 ` [PATCH net-next v2 2/2] net: Add dev_getbyhwaddr_rtnl() helper Breno Leitao
2025-02-11 1:03 ` Kuniyuki Iwashima
2025-02-11 11:38 ` Breno Leitao
2025-02-11 8:10 ` Uday Shankar [this message]
2025-02-11 11:36 ` Breno Leitao
2025-02-11 1:09 ` [PATCH net-next v2 0/2] net: core: improvements to device lookup by hardware address Kuniyuki Iwashima
2025-02-11 11:41 ` Breno Leitao
-- strict thread matches above, loose matches on Subject: below --
2025-02-11 11:49 [PATCH net-next v2 2/2] net: Add dev_getbyhwaddr_rtnl() helper Iwashima, Kuniyuki
2025-02-11 13:16 ` Breno Leitao
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=Z6sF2RZRdqnH6MQR@dev-ushankar.dev.purestorage.com \
--to=ushankar@purestorage.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--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