• Vladimir Oltean's avatar
    net: dsa: make LAG IDs one-based · 3d4a0a2a
    Vladimir Oltean authored
    The DSA LAG API will be changed to become more similar with the bridge
    data structures, where struct dsa_bridge holds an unsigned int num,
    which is generated by DSA and is one-based. We have a similar thing
    going with the DSA LAG, except that isn't stored anywhere, it is
    calculated dynamically by dsa_lag_id() by iterating through dst->lags.
    
    The idea of encoding an invalid (or not requested) LAG ID as zero for
    the purpose of simplifying checks in drivers means that the LAG IDs
    passed by DSA to drivers need to be one-based too. So back-and-forth
    conversion is needed when indexing the dst->lags array, as well as in
    drivers which assume a zero-based index.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    3d4a0a2a
chip.c 196 KB