Re: [PATCH net-next v2 2/2] net: Add dev_getbyhwaddr_rtnl() helper

From: Breno Leitao
Date: Tue Feb 11 2025 - 06:44:56 EST


Hello Uday,

On Tue, Feb 11, 2025 at 01:10:01AM -0700, Uday Shankar wrote:
> 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@xxxxxxxxxxxxxxx/?
> I see three options:
> - combine the two series into one

I would suggest you combine the two series into one.

I will send a v3 today adjusting the comments, and you can integrated
them into your patchset.

Thanks
--breno