• Vlad Buslov's avatar
    net/mlx5: Add flow counters idr · 12d6066c
    Vlad Buslov authored
    Previous patch in series changed flow counter storage structure from
    rb_tree to linked list in order to improve flow counter traversal
    performance. The drawback of such solution is that flow counter lookup by
    id becomes linear in complexity.
    
    Store pointers to flow counters in idr in order to improve lookup
    performance to logarithmic again. Idr is non-intrusive data structure and
    doesn't require extending flow counter struct with new elements. This means
    that idr can be used for lookup, while linked list from previous patch is
    used for traversal, and struct mlx5_fc size is <= 2 cache lines.
    Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
    Acked-by: default avatarAmir Vadai <amir@vadai.me>
    Reviewed-by: default avatarPaul Blakey <paulb@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    12d6066c
fs_counters.c 9.98 KB