diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2018-07-24 09:52:11 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-09-05 21:14:57 -0700 |
commit | 9aff93d7d0d4b3f3076d7bd12a4ad06ef1cf9804 (patch) | |
tree | 0941d5daab6315479f9f3446b001ccd2629c65f4 /drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | |
parent | 6e5e22839136fdb466af0aa46ff2404713dff974 (diff) |
net/mlx5: Store flow counters in a list
In order to improve performance of flow counter stats query loop that
traverses all configured flow counters, replace rb_tree with double-linked
list. This change improves performance of traversing flow counters by
removing the tree traversal. (profiling data showed that call to rb_next
was most top CPU consumer)
However, lookup of flow flow counter in list becomes linear, instead of
logarithmic. This problem is fixed by next patch in series, which adds idr
for fast lookup. Idr is to be used because it is not an intrusive data
structure and doesn't require adding any new members to struct mlx5_fc,
which allows its control data part to stay <= 1 cache line in size.
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Amir Vadai <amir@vadai.me>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/fs_core.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h index 617d6239c5f3..a06f83c0c2b6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h @@ -139,7 +139,7 @@ struct mlx5_fc_cache { }; struct mlx5_fc { - struct rb_node node; + struct list_head list; struct llist_node addlist; struct llist_node dellist; |