Menu

Confused witch FID and STU...

Francis
2012-07-25
2012-07-25
  • Francis

    Francis - 2012-07-25

    Hello, First of all thank you for sharing your excellent work. I have started playing with code a few days ago, but I there are some things that I can not fit with my driver deps code.

    I am using a switch that does not have the concept of FID, STU,...terms that I confess that are not familiar with me.

    In my switch, MSTP port states are handled in each vlan entry, which has a mstp-port-state field, which contains a bit mask state for all ports.

    VLAN_ENTRY_fields-> VID||MASK_PORTS_USE||MASK_PORTS_TAG||MASK_PORTS_MSTP_STATUS||VALID

    MAC address table, when independent vlan learning enabled (default), represents forwarding database, for VLAN domain, How does it fit FID concept..?

    In this context, What is expected to do when driver_set_new_state(per_tree_port_t *ptp, int new_state) is called for a port_tree?... This port will belong to several vlans, and only through each vlan entry, MSTI port state could be set,

    So if new_state is set for a MSTI, which could have several FID, containing each a list of vlans, each vlan entry must be updated... It isnt?

    Besides, I dont understand the purpose of having multiple FID on a MSTI, I wonder, if could be valid the approach of 1-1 mapping from MSTID and FID.

    Thanks and sorry for my ignorance...

     

    Last edit: Francis 2012-07-25
  • Vitalii Demianets

    Hello, Francis!
    Thank you for appreciating my work.
    First of all I must warn you - I don't know anybody who has put mstpd in production (including myself) - it is still in testing phase. So, if you are brave enough to face up to some bugs, you are welcome.
    Second, forget about STU - that's Marvell-specific concept. On the other hand FID is universal concept and it means "Forwarding Information Database". Each FID is independent MAC learning table. The switch can have several FIDs if it needs independent learning. In your case:

    MAC address table, when independent vlan learning enabled (default), represents forwarding database, for VLAN domain, How does it fit FID concept..?

    it sounds like you have only one bit named "independent learning" - and when that bit is set MACs in each VLAN are being learned independently, If my understanding is correct, then you have FIDs - as many FIDs as many VLANs you have. Generally, the concept of FID is somewhat broader - each FID can include several VLANs, so that the group of several VLANs can have shared MAC learning table. Nevertheless, I think, you can live with what you have - one-to-one correspondence between FIDs and VLANs.

    Now, to the other questions:

    In this context, What is expected to do when driver_set_new_state(per_tree_port_t *ptp, int new_state) is called for a port_tree?
    ...
    So if new_state is set for a MSTI, which could have several FID, containing each a list of vlans, each vlan entry must be updated?

    Yes, each VLAN in each FID belonging to this MSTi must be updated. You can accomplish it as follows:

    The per_tree_port_t struct represents all the port info which is specific to the given tree (tree == MSTI). In the context of this function we need following fields of that structure:
    1) ptp->port - is the pointer to the port_t struct,
    2) ptp->tree - is the pointer to the tree_t struct.
    You also need the list of FIDs which are mapped to the tree. To get it you first need the pointer to the bridge_t struct, which can be accessed as ptp->port->bridge or ptp->tree->bridge (both ways give us the same pointer to the same bridge_t struct). There is fid2mstid array in the bridge_t struct, indexed by FID. To find all the FIDs mapped to the given tree you can use the loop:

    for(fid = 0; fid <= MAX_FID; ++fid)
    {
      if(ptp->MSTID == ptp->tree->bridge->fid2mstid[fid])
      {
        InstructDriverToSetNewState(__be16_to_cpu(ptp->port->port_number), fid, new_state);
      }
    }
    

    Also, you can always identify port by its Linux interface name (ptp->port->sysdeps.name) and not by port_number as in example.

    In your case we have one-to-one correspondence between fid and VLAN, so the info about VLAN can be easily restored from the fid number. Moreover, this fid-to-VLAN correspondence must be set by you with "mstpctl setvid2fid" command. The most natural way is to set one-to-one correspondence for all the VLANs you are going to use. For example, if the switch is using only VLANs 10, 20 and 30 - issue the command:

    mstpctl setvid2fid 10:10 20:20 30:30
    

    Besides, I dont understand the purpose of having multiple FID on a MSTI, I wonder, if could be valid the approach of 1-1 mapping from MSTID and FID.

    In your case of one-to-one FID-to-VID correspondence the purpose is obvious: to have multiple VLANs in one MSTI. In that case the whole group of several VLANs is sharing the same spanning tree.
    Of course, if your setup requires that each VLAN should have its own spanning tree, you can always assign exactly one FID (and thus, in your case, exactly one VLAN) to the tree - it is perfectly valid setup.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.