• Danielle Ratson's avatar
    mlxsw: spectrum_router: Add RIF MAC profiles support · 605d25cd
    Danielle Ratson authored
    Currently, mlxsw enforces that all the router interfaces (RIFs) have the
    same MAC prefix.
    
    Relax this limitation by using RIF MAC profiles. Each profile is
    associated with a particular MAC prefix and multiple RIFs can use the
    same profile. Therefore, the number of possible MAC prefixes is no
    longer one, but the number of profiles supported by the device.
    
    Store the profiles in an IDR and reference count them according to the
    number of RIFs using them.
    
    Associate a RIF with a profile when the RIF is created and remove the
    association when the RIF is deleted.
    
    Change the association following 'NETDEV_CHANGEADDR' events, except when
    only one RIF is using the profile. In which case, change the MAC prefix
    of the profile itself instead of associating the RIF with a new profile.
    Signed-off-by: default avatarDanielle Ratson <danieller@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    605d25cd
spectrum_router.h 9.07 KB