From: MD Danish Anwar <danishanwar@ti.com>
To: Paolo Abeni <pabeni@redhat.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
Andrew Lunn <andrew@lunn.ch>, Jan Kiszka <jan.kiszka@siemens.com>,
Simon Horman <horms@kernel.org>,
Niklas Schnelle <schnelle@linux.ibm.com>,
Randy Dunlap <rdunlap@infradead.org>,
Diogo Ivo <diogo.ivo@siemens.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Richard Cochran <richardcochran@gmail.com>,
Roger Quadros <rogerq@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>
Cc: <linux-arm-kernel@lists.infradead.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <srk@ti.com>,
<r-gunasekaran@ti.com>, Roger Quadros <rogerq@ti.com>,
Vinicius Costa Gomes <vinicius.gomes@intel.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next v5] net: ti: icssg_prueth: add TAPRIO offload support
Date: Mon, 13 May 2024 12:09:57 +0530 [thread overview]
Message-ID: <7542d6ed-28aa-467d-a81a-ab44f82cef72@ti.com> (raw)
In-Reply-To: <cc9eae8f17e3e0ad142c9efa3fe5dff7afe2554c.camel@redhat.com>
On 02/05/24 5:32 pm, Paolo Abeni wrote:
> 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.
Sure Paolo, I will split the "struct definition move" to a separate
patch and post both the patches as a small series in v6.
>
> Thanks,
>
> Paolo
>
--
Thanks and Regards,
Danish
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-05-13 6:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 10:30 [PATCH net-next v5] net: ti: icssg_prueth: add TAPRIO offload support MD Danish Anwar
2024-05-01 15:17 ` Simon Horman
2024-05-02 11:59 ` Paolo Abeni
2024-05-02 12:02 ` Paolo Abeni
2024-05-13 6:39 ` MD Danish Anwar [this message]
2024-05-13 6:26 ` MD Danish Anwar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7542d6ed-28aa-467d-a81a-ab44f82cef72@ti.com \
--to=danishanwar@ti.com \
--cc=andrew@lunn.ch \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=diogo.ivo@siemens.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jan.kiszka@siemens.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=r-gunasekaran@ti.com \
--cc=rdunlap@infradead.org \
--cc=richardcochran@gmail.com \
--cc=rogerq@kernel.org \
--cc=rogerq@ti.com \
--cc=schnelle@linux.ibm.com \
--cc=srk@ti.com \
--cc=vigneshr@ti.com \
--cc=vinicius.gomes@intel.com \
--cc=vladimir.oltean@nxp.com \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).