diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2018-07-24 16:37:40 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-09-06 07:14:57 +0300 |
commit | 12d6066c3b29c5606c4a2466f964fbd9ede803c5 (patch) | |
tree | e59bff5027755fb2007712819af7837da8b69b88 /include/linux/mlx5/driver.h | |
parent | 9aff93d7d0d4b3f3076d7bd12a4ad06ef1cf9804 (diff) | |
download | linux-12d6066c3b29c5606c4a2466f964fbd9ede803c5.tar.xz |
net/mlx5: Add flow counters idr
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: 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 'include/linux/mlx5/driver.h')
-rw-r--r-- | include/linux/mlx5/driver.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 61bed33e6675..2a0c845f6bdb 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -583,6 +583,8 @@ struct mlx5_irq_info { }; struct mlx5_fc_stats { + spinlock_t counters_idr_lock; /* protects counters_idr */ + struct idr counters_idr; struct list_head counters; struct llist_head addlist; struct llist_head dellist; |