lkml.org 
[lkml]   [2022]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 net-next 02/10] net: bridge: mst: Allow changing a VLAN's MSTI
Date
On Fri, Mar 04, 2022 at 00:27, Vladimir Oltean <olteanv@gmail.com> wrote:
> On Tue, Mar 01, 2022 at 11:03:13AM +0100, Tobias Waldekranz wrote:
>> Allow a VLAN to move out of the CST (MSTI 0), to an independent tree.
>>
>> The user manages the VID to MSTI mappings via a global VLAN
>> setting. The proposed iproute2 interface would be:
>>
>> bridge vlan global set dev br0 vid <VID> msti <MSTI>
>>
>> Changing the state in non-zero MSTIs is still not supported, but will
>> be addressed in upcoming changes.
>>
>> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
>> ---
>
>> +static void br_mst_vlan_sync_state(struct net_bridge_vlan *pv, u16 msti)
>> +{
>> + struct net_bridge_vlan_group *vg = nbp_vlan_group(pv->port);
>> + struct net_bridge_vlan *v;
>> +
>> + list_for_each_entry(v, &vg->vlan_list, vlist) {
>> + /* If this port already has a defined state in this
>> + * MSTI (through some other VLAN membership), inherit
>> + * it.
>> + */
>> + if (v != pv && v->brvlan->msti == msti) {
>> + br_mst_vlan_set_state(pv->port, pv, v->state);
>> + return;
>> + }
>> + }
>> +
>> + /* Otherwise, start out in a new MSTI with all ports disabled. */
>> + return br_mst_vlan_set_state(pv->port, pv, BR_STATE_DISABLED);
>> +}
>> +
>> +int br_mst_vlan_set_msti(struct net_bridge_vlan *mv, u16 msti)
>> +{
>> + struct net_bridge_vlan_group *vg;
>> + struct net_bridge_vlan *pv;
>> + struct net_bridge_port *p;
>
> No attempt to detect non-changes to the MSTI, and exit early? In a later
> patch you will also notify switchdev uselessly because of this.

Yeah you're right. Will fix in v3. Thanks

\
 
 \ /
  Last update: 2022-03-07 15:54    [W:0.047 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site