• Petr Machata's avatar
    mlxsw: spectrum_buffers: Use devlink pool indices throughout · 3a4dbfb0
    Petr Machata authored
    Currently, mlxsw assumes that each ingress pool has its egress
    counterpart, and that pool index for purposes of caching matches the
    index with which the hardware should be configured. As we want to expose
    the MC pool, both of these assumptions break.
    
    Instead, maintain the pool index as long as possible. Unify ingress and
    egress caches and use the pool index as cache index as well. Only
    translate to FW pool numbering when actually packing the registers. This
    simplifies things considerably, as the pool index is the only quantity
    necessary to uniquely identify a pool, and the pool/direction split is
    not necessary until firmware is talked to.
    
    To support the mapping between pool indices and pool numbers and
    directions, which is not neatly mathematical anymore, introduce a pool
    descriptor table, indexed by pool index, to facilitate the translation.
    
    Include the MC pool in the descriptor table as well, so that it can be
    referenced from mlxsw_sp_sb_cms_egress.
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    3a4dbfb0
spectrum_buffers.c 27 KB