[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210114172545.a4ikhnt5fgu5dllp@skbuf>
Date: Thu, 14 Jan 2021 19:25:45 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
alexandre.belloni@...tlin.com, andrew@...n.ch,
f.fainelli@...il.com, vivien.didelot@...il.com,
alexandru.marginean@....com, claudiu.manoil@....com,
xiaoliang.yang_1@....com, hongbo.wang@....com, jiri@...nulli.us,
idosch@...sch.org, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v4 net-next 08/10] net: mscc: ocelot: register devlink
ports
On Thu, Jan 14, 2021 at 09:19:43AM -0800, Jakub Kicinski wrote:
> On Thu, 14 Jan 2021 12:27:43 +0200 Vladimir Oltean wrote:
> > On Wed, Jan 13, 2021 at 07:30:33PM -0800, Jakub Kicinski wrote:
> > > On Mon, 11 Jan 2021 19:43:14 +0200 Vladimir Oltean wrote:
> > > > +struct ocelot_devlink_private {
> > > > + struct ocelot *ocelot;
> > > > +};
> > >
> > > I don't think you ever explained to me why you don't put struct ocelot
> > > in the priv.
> > >
> > > - ocelot = devm_kzalloc(&pdev->dev, sizeof(*ocelot), GFP_KERNEL);
> > > - if (!ocelot)
> > > + devlink = devlink_alloc(&ocelot_devlink_ops, sizeof(*ocelot));
> > > + if (!devlink)
> > > return -ENOMEM;
> > > + ocelot = devlink_priv(ocelot->devlink);
> >
> > Because that's not going to be all? The error path handling and teardown
> > all need to change, because I no longer use device-managed allocation,
> > and I wanted to avoid that.
>
> Come on, is it really hard enough to warrant us exchanging multiple
> emails? Having driver structure in devlink priv is the standard way
> of handling this, there's value in uniformity.
I did as you requested in v5 anyway. It does not save me of having to
keep a devlink pointer in struct ocelot though, due to the fact that the
layout with struct devlink being a container of struct ocelot is not
common between the DSA felix driver and the switchdev ocelot driver. So
much for uniformity.
Powered by blists - more mailing lists