]> git.itanic.dy.fi Git - linux-stable/commitdiff
net/mlx5: DR, Rename list field in matcher struct to list_node
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Tue, 16 Nov 2021 15:57:57 +0000 (17:57 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 31 Dec 2021 08:17:03 +0000 (00:17 -0800)
In dr_types structs, some list fields are list heads, and some
are just list nodes that are stored on the other structs' lists.
Rename the appropriate list field to reflect this distinction.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h

index 613074d502120b2f25a36eb16b52de7794d1a6e0..af2cbbb6ef95303f24344f1c14bcbfbd7b7e5b00 100644 (file)
@@ -721,7 +721,7 @@ static int dr_matcher_add_to_tbl(struct mlx5dr_matcher *matcher)
        int ret;
 
        next_matcher = NULL;
-       list_for_each_entry(tmp_matcher, &tbl->matcher_list, matcher_list) {
+       list_for_each_entry(tmp_matcher, &tbl->matcher_list, list_node) {
                if (tmp_matcher->prio >= matcher->prio) {
                        next_matcher = tmp_matcher;
                        break;
@@ -731,11 +731,11 @@ static int dr_matcher_add_to_tbl(struct mlx5dr_matcher *matcher)
 
        prev_matcher = NULL;
        if (next_matcher && !first)
-               prev_matcher = list_prev_entry(next_matcher, matcher_list);
+               prev_matcher = list_prev_entry(next_matcher, list_node);
        else if (!first)
                prev_matcher = list_last_entry(&tbl->matcher_list,
                                               struct mlx5dr_matcher,
-                                              matcher_list);
+                                              list_node);
 
        if (dmn->type == MLX5DR_DOMAIN_TYPE_FDB ||
            dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX) {
@@ -756,12 +756,12 @@ static int dr_matcher_add_to_tbl(struct mlx5dr_matcher *matcher)
        }
 
        if (prev_matcher)
-               list_add(&matcher->matcher_list, &prev_matcher->matcher_list);
+               list_add(&matcher->list_node, &prev_matcher->list_node);
        else if (next_matcher)
-               list_add_tail(&matcher->matcher_list,
-                             &next_matcher->matcher_list);
+               list_add_tail(&matcher->list_node,
+                             &next_matcher->list_node);
        else
-               list_add(&matcher->matcher_list, &tbl->matcher_list);
+               list_add(&matcher->list_node, &tbl->matcher_list);
 
        return 0;
 }
@@ -968,7 +968,7 @@ mlx5dr_matcher_create(struct mlx5dr_table *tbl,
        matcher->prio = priority;
        matcher->match_criteria = match_criteria_enable;
        refcount_set(&matcher->refcount, 1);
-       INIT_LIST_HEAD(&matcher->matcher_list);
+       INIT_LIST_HEAD(&matcher->list_node);
 
        mlx5dr_domain_lock(tbl->dmn);
 
@@ -1031,15 +1031,15 @@ static int dr_matcher_remove_from_tbl(struct mlx5dr_matcher *matcher)
        struct mlx5dr_domain *dmn = tbl->dmn;
        int ret = 0;
 
-       if (list_is_last(&matcher->matcher_list, &tbl->matcher_list))
+       if (list_is_last(&matcher->list_node, &tbl->matcher_list))
                next_matcher = NULL;
        else
-               next_matcher = list_next_entry(matcher, matcher_list);
+               next_matcher = list_next_entry(matcher, list_node);
 
-       if (matcher->matcher_list.prev == &tbl->matcher_list)
+       if (matcher->list_node.prev == &tbl->matcher_list)
                prev_matcher = NULL;
        else
-               prev_matcher = list_prev_entry(matcher, matcher_list);
+               prev_matcher = list_prev_entry(matcher, list_node);
 
        if (dmn->type == MLX5DR_DOMAIN_TYPE_FDB ||
            dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX) {
@@ -1059,7 +1059,7 @@ static int dr_matcher_remove_from_tbl(struct mlx5dr_matcher *matcher)
                        return ret;
        }
 
-       list_del(&matcher->matcher_list);
+       list_del(&matcher->list_node);
 
        return 0;
 }
index 30ae3cda6d2e0f87cc565ed8872e80b13adc152d..4c40178e7d1e740bcded57f77795e22bfd1238de 100644 (file)
@@ -19,7 +19,7 @@ int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
        if (!list_empty(&tbl->matcher_list))
                last_matcher = list_last_entry(&tbl->matcher_list,
                                               struct mlx5dr_matcher,
-                                              matcher_list);
+                                              list_node);
 
        if (tbl->dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX ||
            tbl->dmn->type == MLX5DR_DOMAIN_TYPE_FDB) {
index 75bfdd7890dad2a4ea5725aa95a914a506060d8d..a19b40a6e813d8ad9f27838acd163f35c29d2f30 100644 (file)
@@ -881,7 +881,7 @@ struct mlx5dr_matcher {
        struct mlx5dr_table *tbl;
        struct mlx5dr_matcher_rx_tx rx;
        struct mlx5dr_matcher_rx_tx tx;
-       struct list_head matcher_list;
+       struct list_head list_node;
        u32 prio;
        struct mlx5dr_match_param mask;
        u8 match_criteria;