Re: [PATCH net-next v2] netdevice: define and allocate &net_device _properly_

Breno Leitao
2024-07-09T20:22:05Z

On Tue, Jul 09, 2024 at 08:27:45AM -0700, Eric Dumazet wrote:
> On Tue, Jul 9, 2024 at 5:54 AM Breno Leitao <leitao@debian.org> wrote:

> > @@ -2596,7 +2599,7 @@ void dev_net_set(struct net_device *dev, struct net *net)
> > */
> > static inline void *netdev_priv(const struct net_device *dev)
> > {
> > - return (char *)dev + ALIGN(sizeof(struct net_device), NETDEV_ALIGN);
> > + return (void *)dev->priv;

> Minor remark : the cast is not needed, but this is fine.

Thanks. I will fix it in a v3, which needs to be done to address some
kernel-doc warnings identified by Simon..

> It would be great to get rid of NETDEV_ALIGN eventually.

Would you mind sharing what do you have in mind? What do you use as a
replacement?

Thanks