From: Parvathi Pudi <parvathi@couthit.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Parvathi Pudi <parvathi@couthit.com>,
andrew+netdev <andrew+netdev@lunn.ch>,
davem <davem@davemloft.net>, edumazet <edumazet@google.com>,
pabeni <pabeni@redhat.com>, danishanwar <danishanwar@ti.com>,
rogerq <rogerq@kernel.org>, pmohan <pmohan@couthit.com>,
basharath <basharath@couthit.com>, afd <afd@ti.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
ALOK TIWARI <alok.a.tiwari@oracle.com>, horms <horms@kernel.org>,
pratheesh <pratheesh@ti.com>, j-rameshbabu <j-rameshbabu@ti.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
praneeth <praneeth@ti.com>, srk <srk@ti.com>,
rogerq <rogerq@ti.com>, krishna <krishna@couthit.com>,
mohan <mohan@couthit.com>
Subject: Re: [PATCH net-next v6 2/3] net: ti: icssm-prueth: Adds switchdev support for icssm_prueth driver
Date: Wed, 26 Nov 2025 11:47:03 +0530 (IST) [thread overview]
Message-ID: <1268174479.21081.1764137823922.JavaMail.zimbra@couthit.local> (raw)
In-Reply-To: <20251124200322.615773bb@kernel.org>
Hi,
> On Mon, 24 Nov 2025 19:25:11 +0530 Parvathi Pudi wrote:
>> Subject: [PATCH net-next v6 2/3] net: ti: icssm-prueth: Adds switchdev support
>> for icssm_prueth driver
>
> Adds -> Add
>
>> This patch adds support for offloading the RSTP switch feature to the
>
> s/This patch adds/Add/
>
> imperative mood, please..
>
Sure, we will address this in the next version.
>> +static void icssm_prueth_sw_fdb_work(struct work_struct *work)
>> +{
>> + struct icssm_prueth_sw_fdb_work *fdb_work =
>> + container_of(work, struct icssm_prueth_sw_fdb_work, work);
>> + struct prueth_emac *emac = fdb_work->emac;
>> +
>> + rtnl_lock();
>> +
>> + /* Interface is not up */
>> + if (!emac->prueth->fdb_tbl)
>> + goto free;
>> +
>> + switch (fdb_work->event) {
>> + case FDB_LEARN:
>> + icssm_prueth_sw_insert_fdb_entry(emac, fdb_work->addr, 0);
>> + break;
>> + case FDB_PURGE:
>> + icssm_prueth_sw_do_purge_fdb(emac);
>> + break;
>> + default:
>> + break;
>> + }
>> +
>> +free:
>> + rtnl_unlock();
>> + kfree(fdb_work);
>> + dev_put(emac->ndev);
>
> please use netdev_put() and a netdev tracker
>
We will replace dev_put() with netdev_put() as shown below and
add a netdevice_tracker to the icssm_prueth_sw_fdb_work struct.
"netdev_put(emac->ndev, &fdb_work→ndev_tracker);"
We will address this in the next version.
>> +}
>> +
>> +int icssm_prueth_sw_learn_fdb(struct prueth_emac *emac, u8 *src_mac)
>> +{
>> + struct icssm_prueth_sw_fdb_work *fdb_work;
>> +
>> + fdb_work = kzalloc(sizeof(*fdb_work), GFP_ATOMIC);
>> + if (WARN_ON(!fdb_work))
>> + return -ENOMEM;
>> +
>> + INIT_WORK(&fdb_work->work, icssm_prueth_sw_fdb_work);
>> +
>> + fdb_work->event = FDB_LEARN;
>> + fdb_work->emac = emac;
>> + ether_addr_copy(fdb_work->addr, src_mac);
>> +
>> + dev_hold(emac->ndev);
>
> same here.
>
> This significantly helps debugging in case some code leaks a reference.
> --
> pw-bot: cr
Here as well, we will replace dev_hold() with netdev_hold() as shown below
and will address this in next version.
"netdev_hold(emac->ndev, &fdb_work->ndev_tracker, GFP_ATOMIC);"
Thanks and Regards,
Parvathi.
next prev parent reply other threads:[~2025-11-26 6:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 13:55 [PATCH net-next v6 0/3] STP/RSTP SWITCH support for PRU-ICSSM Ethernet driver Parvathi Pudi
2025-11-24 13:55 ` [PATCH net-next v6 1/3] net: ti: icssm-prueth: Adds helper functions to configure and maintain FDB Parvathi Pudi
2025-11-24 13:55 ` [PATCH net-next v6 2/3] net: ti: icssm-prueth: Adds switchdev support for icssm_prueth driver Parvathi Pudi
2025-11-25 4:03 ` Jakub Kicinski
2025-11-26 6:17 ` Parvathi Pudi [this message]
2025-11-24 13:55 ` [PATCH net-next v6 3/3] net: ti: icssm-prueth: Adds support for ICSSM RSTP switch Parvathi Pudi
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=1268174479.21081.1764137823922.JavaMail.zimbra@couthit.local \
--to=parvathi@couthit.com \
--cc=afd@ti.com \
--cc=alok.a.tiwari@oracle.com \
--cc=andrew+netdev@lunn.ch \
--cc=basharath@couthit.com \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=j-rameshbabu@ti.com \
--cc=krishna@couthit.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mohan@couthit.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pmohan@couthit.com \
--cc=praneeth@ti.com \
--cc=pratheesh@ti.com \
--cc=rogerq@kernel.org \
--cc=rogerq@ti.com \
--cc=srk@ti.com \
--cc=vigneshr@ti.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 NNTP newsgroup(s).