[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMdWSKQxbKzo6z9BBO=0HPCxSs1nt8ArAe5zi_X5cPQhtnUVA@mail.gmail.com>
Date: Thu, 10 Sep 2020 00:06:47 +0530
From: Allen <allen.lkml@...il.com>
To: David Miller <davem@...emloft.net>
Cc: jes@...ined-monkey.org, Jakub Kicinski <kuba@...nel.org>,
dougmill@...ux.ibm.com, cooldavid@...ldavid.org,
mlindner@...vell.com, stephen@...workplumber.org,
borisp@...lanox.com, netdev@...r.kernel.org,
Romain Perier <romain.perier@...il.com>
Subject: Re: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new
tasklet_setup() API
>
> > @@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue)
> > }
> >
> >
> > -static void ace_tasklet(unsigned long arg)
> > +static void ace_tasklet(struct tasklet_struct *t)
> > {
> > - struct net_device *dev = (struct net_device *) arg;
> > - struct ace_private *ap = netdev_priv(dev);
> > + struct ace_private *ap = from_tasklet(ap, t, ace_tasklet);
> > + struct net_device *dev = (struct net_device *)((char *)ap -
> > + ALIGN(sizeof(struct net_device), NETDEV_ALIGN));
> > int cur_size;
> >
>
> I don't see this is as an improvement. The 'dev' assignment looks so
> incredibly fragile and exposes so many internal details about netdev
> object allocation, alignment, and layout.
>
> Who is going to find and fix this if someone changes how netdev object
> allocation works?
>
Thanks for pointing it out. I'll see if I can fix it to keep it simple.
> I don't want to apply this, it sets a very bad precedent. The existing
> code is so much cleaner and easier to understand and audit.
>
Will you pick the rest of the patches or would they have to wait till
this one is
fixed.
Thanks,
--
- Allen
Powered by blists - more mailing lists