• Petr Machata's avatar
    mlxsw: spectrum_qdisc: Track children per qdisc · 51d52ed9
    Petr Machata authored
    mlxsw currently allows a two-level structure of qdiscs: the root and
    possibly a number of children. In order to support offloading more general
    qdisc trees, introduce to struct mlxsw_sp_qdisc a pointer to child qdiscs.
    Refer to the child qdiscs through this pointer, instead of going through
    the tclass_qdiscs in qdisc_state. Additionally introduce a field
    num_classes, which holds number of given qdisc's children.
    
    Also introduce a generic function for walking qdisc trees. Rewrite
    mlxsw_sp_qdisc_find() and _find_by_handle() to use the generic walker.
    
    For now, keep the qdisc_state.tclass_qdisc, and just point root_qdiscs's
    children to this array. Following patches will make the allocation dynamic.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    51d52ed9
spectrum_qdisc.c 54.1 KB