Fri, Jul 01, 2016 at 07:16:23PM IDT, d...@cumulusnetworks.com wrote:
>On 7/1/16 8:04 AM, Jiri Pirko wrote:
>> @@ -327,6 +333,19 @@ mlxsw_sp_port_vport_find_by_fid(const struct 
>> mlxsw_sp_port *mlxsw_sp_port,
>>      return NULL;
>>  }
>>
>> +static inline struct mlxsw_sp_rif *
>> +mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp,
>> +                     const struct net_device *dev)
>> +{
>> +    int i;
>> +
>> +    for (i = 0; i < MLXSW_SP_RIF_MAX; i++)
>> +            if (mlxsw_sp->rifs[i] && mlxsw_sp->rifs[i]->dev == dev)
>> +                    return mlxsw_sp->rifs[i];
>> +
>> +    return NULL;
>> +}
>> +
>
>Why not add the rif to mlxsw_sp_port which is the priv data for a mlxsw dev?

We create 'mlxsw_sp_port' for physical ports and vPorts (VLAN netdevs),
but not for master devices such as bridge and team, which can also be
assigned RIFs. The reason for this is that in most cases any bridge /
team setting eventually needs to be programmed to the device via each
slave 'mlxsw_sp_port'. You can see, for example, that in our netdev
notification block we simply propagate team/bond CHANGEUPPER to each
slave port.

Thanks for taking the time to review this!

Reply via email to