[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ce87a72f-09b3-4615-aab9-2be8648300f8@lunn.ch>
Date: Wed, 15 Oct 2025 00:17:14 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Parvathi Pudi <parvathi@...thit.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, danishanwar@...com,
rogerq@...nel.org, pmohan@...thit.com, basharath@...thit.com,
afd@...com, linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, pratheesh@...com,
prajith@...com, vigneshr@...com, praneeth@...com, srk@...com,
rogerq@...com, krishna@...thit.com, mohan@...thit.com
Subject: Re: [PATCH net-next v3 2/3] net: ti: icssm-prueth: Adds switchdev
support for icssm_prueth driver
> +static struct prueth_fw_offsets fw_offsets_v2_1;
> +
> +static void icssm_prueth_set_fw_offsets(struct prueth *prueth)
> +{
> + /* Set VLAN/Multicast filter control and table offsets */
> + if (PRUETH_IS_EMAC(prueth)) {
> + prueth->fw_offsets->mc_ctrl_byte =
> + ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_OFFSET;
> + prueth->fw_offsets->mc_filter_mask =
> + ICSS_EMAC_FW_MULTICAST_FILTER_MASK_OFFSET;
> + prueth->fw_offsets->mc_filter_tbl =
> + ICSS_EMAC_FW_MULTICAST_FILTER_TABLE;
I know for some of these SoCs, there can be multiple instances of the
hardware blocks. It looks like that will go wrong here, because there
is only one fw_offsets_v2_1 ?
Humm, actually, if this are constant, why have fw_offsets_v2_1? Just
use ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_OFFSET directly?
> +static void icssm_emac_mc_filter_ctrl(struct prueth_emac *emac, bool enable)
> +{
> + struct prueth *prueth = emac->prueth;
> + void __iomem *mc_filter_ctrl;
> + void __iomem *ram;
> + u32 mc_ctrl_byte;
> + u32 reg;
> +
> + ram = prueth->mem[emac->dram].va;
> + mc_ctrl_byte = prueth->fw_offsets->mc_ctrl_byte;
> + mc_filter_ctrl = ram + mc_ctrl_byte;
mc_filter_ctrl = ram + ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_OFFSET; ???
> +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) {
> + rtnl_unlock();
> + goto free;
> + }
I would probably put the rtnl_unlock() after free: label.
> +
> + 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;
> + }
> + rtnl_unlock();
> +
> +free:
> + kfree(fdb_work);
> + dev_put(emac->ndev);
> +}
Andrew
Powered by blists - more mailing lists