[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc9eae8f17e3e0ad142c9efa3fe5dff7afe2554c.camel@redhat.com>
Date: Thu, 02 May 2024 14:02:28 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: MD Danish Anwar <danishanwar@...com>, Dan Carpenter
<dan.carpenter@...aro.org>, Andrew Lunn <andrew@...n.ch>, Jan Kiszka
<jan.kiszka@...mens.com>, Simon Horman <horms@...nel.org>, Niklas Schnelle
<schnelle@...ux.ibm.com>, Randy Dunlap <rdunlap@...radead.org>, Diogo Ivo
<diogo.ivo@...mens.com>, Wolfram Sang <wsa+renesas@...g-engineering.com>,
Vignesh Raghavendra <vigneshr@...com>, Richard Cochran
<richardcochran@...il.com>, Roger Quadros <rogerq@...nel.org>, Jakub
Kicinski <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>, "David S.
Miller" <davem@...emloft.net>
Cc: linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, srk@...com, r-gunasekaran@...com, Roger
Quadros <rogerq@...com>, Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH net-next v5] net: ti: icssg_prueth: add TAPRIO offload
support
On Thu, 2024-05-02 at 13:59 +0200, Paolo Abeni wrote:
> On Mon, 2024-04-29 at 16:00 +0530, MD Danish Anwar wrote:
> > +static int emac_taprio_replace(struct net_device *ndev,
> > + struct tc_taprio_qopt_offload *taprio)
> > +{
> > + struct prueth_emac *emac = netdev_priv(ndev);
> > + struct tc_taprio_qopt_offload *est_new;
> > + int ret;
> > +
> > + if (taprio->cycle_time_extension) {
> > + NL_SET_ERR_MSG_MOD(taprio->extack, "Cycle time extension not supported");
> > + return -EOPNOTSUPP;
> > + }
> > +
> > + if (taprio->cycle_time < TAS_MIN_CYCLE_TIME) {
> > + NL_SET_ERR_MSG_FMT_MOD(taprio->extack, "cycle_time %llu is less than min supported cycle_time %d",
> > + taprio->cycle_time, TAS_MIN_CYCLE_TIME);
> > + return -EINVAL;
> > + }
> > +
> > + if (taprio->num_entries > TAS_MAX_CMD_LISTS) {
> > + NL_SET_ERR_MSG_FMT_MOD(taprio->extack, "num_entries %lu is more than max supported entries %d",
> > + taprio->num_entries, TAS_MAX_CMD_LISTS);
> > + return -EINVAL;
> > + }
> > +
> > + if (emac->qos.tas.taprio_admin)
> > + devm_kfree(&ndev->dev, emac->qos.tas.taprio_admin);
>
> it looks like 'qos.tas.taprio_admin' is initialized from
> taprio_offload_get(), so it should be free with taprio_offload_free(),
> right?
>
> > +
> > + est_new = devm_kzalloc(&ndev->dev,
> > + struct_size(est_new, entries, taprio->num_entries),
> > + GFP_KERNEL);
> > + if (!est_new)
> > + return -ENOMEM;
>
> Why are you allocating 'est_new'? it looks like it's not used
> anywhere?!?
>
> > +
> > + emac->qos.tas.taprio_admin = taprio_offload_get(taprio);
> > + ret = tas_update_oper_list(emac);
> > + if (ret)
> > + return ret;
>
> Should the above clear 'taprio_admin' on error, as well?
Side note: the patch itself is rather big, I guess it would be better
split it. You can make a small series putting the the struct definition
move in a separate patch.
Thanks,
Paolo
Powered by blists - more mailing lists