• V
    net: dsa: make LAG IDs one-based · 3d4a0a2a
    Vladimir Oltean 提交于
    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: NVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: NJakub Kicinski <kuba@kernel.org>
    3d4a0a2a
dsa2.c 40.4 KB