[PATCH net-next v6 2/3] net: ti: icssm-prueth: Adds switchdev support for icssm_prueth driver

Parvathi Pudi parvathi at couthit.com
Tue Nov 25 22:17:03 PST 2025


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.



More information about the linux-arm-kernel mailing list