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

Parvathi Pudi
2025-10-16T11:55:45Z

Hi,

>> +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?
>

Sure we will evaluate this and address in the next version.

>> +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; ???
>

Sure we will evaluate this and address 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) {
>> + rtnl_unlock();
>> + goto free;
>> + }
>
> I would probably put the rtnl_unlock() after free: label.
>

We will address this in the next version.

Thanks and Regards,
Parvathi.