summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2018-07-23 10:55:39 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2018-09-05 21:14:56 -0700
commit83033688b7ade18d2dbbcefa810f02ff66ba549d (patch)
treebd0e1f5d9a10124476220f36445e91a65af29d7b /drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
parent05dcc71298643256948a2e17db7dbecc748719d2 (diff)
net/mlx5: Change flow counters addlist type to single linked list
In order to prevent flow counters stats work function from traversing whole flow counters tree while searching for deleted flow counters, new list to store deleted flow counters will be added to struct mlx5_fc_stats. However, the flow counter structure itself has no space left to store any more data in first cache line. To free space that is needed to store additional list node, convert current addlist double linked list (two pointers per node) to atomic single linked list (one pointer per node). Lockless NULL-terminated single linked list data type doesn't require any additional external synchronization for operations used by flow counters module (add single new element, remove all elements from list and traverse them). Remove addlist_lock that is no longer needed. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Amir Vadai <amir@vadai.me> Reviewed-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@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.h3
1 files changed, 2 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 32070e5d993d..f68590291e0c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
@@ -36,6 +36,7 @@
#include <linux/refcount.h>
#include <linux/mlx5/fs.h>
#include <linux/rhashtable.h>
+#include <linux/llist.h>
enum fs_node_type {
FS_TYPE_NAMESPACE,
@@ -139,7 +140,7 @@ struct mlx5_fc_cache {
struct mlx5_fc {
struct rb_node node;
- struct list_head list;
+ struct llist_node addlist;
/* last{packets,bytes} members are used when calculating the delta since
* last reading