]> xenbits.xensource.com Git - people/aperard/linux.git/commitdiff
mlxsw: spectrum_router: Rename two functions
authorPetr Machata <petrm@nvidia.com>
Fri, 8 Mar 2024 12:59:47 +0000 (13:59 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 Mar 2024 21:14:07 +0000 (14:14 -0700)
The function mlxsw_sp_nexthop_counter_alloc() doesn't directly allocate
anything, and mlxsw_sp_nexthop_counter_free() doesn't directly free. For
the following patches, we will need names for functions that actually do
those things. Therefore rename to mlxsw_sp_nexthop_counter_enable() and
mlxsw_sp_nexthop_counter_disable() to free up the namespace.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/f59272958697a718f090f59f892d32beabcd8972.1709901020.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h

index c8a356accdf8eff67ab7d99f0d7880721dd70aef..22e3dcb1d67ad127600c551ed01fca9e03ad7469 100644 (file)
@@ -1193,9 +1193,9 @@ static int mlxsw_sp_dpipe_table_adj_counters_update(void *priv, bool enable)
                mlxsw_sp_nexthop_indexes(nh, &adj_index, &adj_size,
                                         &adj_hash_index);
                if (enable)
-                       mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
+                       mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
                else
-                       mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
+                       mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
                mlxsw_sp_nexthop_eth_update(mlxsw_sp,
                                            adj_index + adj_hash_index, nh,
                                            true, ratr_pl);
index 87617df694ab29a6c790a1755fab44095fb14f4a..9bb58fb0d1daa8d5ce1569fb4c6d83c191b87300 100644 (file)
@@ -3151,8 +3151,8 @@ struct mlxsw_sp_nexthop_group {
        bool can_destroy;
 };
 
-void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp,
-                                   struct mlxsw_sp_nexthop *nh)
+void mlxsw_sp_nexthop_counter_enable(struct mlxsw_sp *mlxsw_sp,
+                                    struct mlxsw_sp_nexthop *nh)
 {
        struct devlink *devlink;
 
@@ -3167,8 +3167,8 @@ void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp,
        nh->counter_valid = true;
 }
 
-void mlxsw_sp_nexthop_counter_free(struct mlxsw_sp *mlxsw_sp,
-                                  struct mlxsw_sp_nexthop *nh)
+void mlxsw_sp_nexthop_counter_disable(struct mlxsw_sp *mlxsw_sp,
+                                     struct mlxsw_sp_nexthop *nh)
 {
        if (!nh->counter_valid)
                return;
@@ -4507,7 +4507,7 @@ static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp,
        if (err)
                return err;
 
-       mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
        list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
 
        if (!dev)
@@ -4531,7 +4531,7 @@ static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp,
 
 err_nexthop_neigh_init:
        list_del(&nh->router_list_node);
-       mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
        mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
        return err;
 }
@@ -4541,7 +4541,7 @@ static void mlxsw_sp_nexthop4_fini(struct mlxsw_sp *mlxsw_sp,
 {
        mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
        list_del(&nh->router_list_node);
-       mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
        mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
 }
 
@@ -5006,7 +5006,7 @@ mlxsw_sp_nexthop_obj_init(struct mlxsw_sp *mlxsw_sp,
                break;
        }
 
-       mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
        list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
        nh->ifindex = dev->ifindex;
 
@@ -5030,7 +5030,7 @@ mlxsw_sp_nexthop_obj_init(struct mlxsw_sp *mlxsw_sp,
 
 err_type_init:
        list_del(&nh->router_list_node);
-       mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
        return err;
 }
 
@@ -5041,7 +5041,7 @@ static void mlxsw_sp_nexthop_obj_fini(struct mlxsw_sp *mlxsw_sp,
                mlxsw_sp_nexthop_obj_blackhole_fini(mlxsw_sp, nh);
        mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
        list_del(&nh->router_list_node);
-       mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
        nh->should_offload = 0;
 }
 
@@ -6734,7 +6734,7 @@ static int mlxsw_sp_nexthop6_init(struct mlxsw_sp *mlxsw_sp,
 #if IS_ENABLED(CONFIG_IPV6)
        nh->neigh_tbl = &nd_tbl;
 #endif
-       mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
 
        list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
 
@@ -6750,7 +6750,7 @@ static int mlxsw_sp_nexthop6_init(struct mlxsw_sp *mlxsw_sp,
 
 err_nexthop_type_init:
        list_del(&nh->router_list_node);
-       mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
        return err;
 }
 
@@ -6759,7 +6759,7 @@ static void mlxsw_sp_nexthop6_fini(struct mlxsw_sp *mlxsw_sp,
 {
        mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
        list_del(&nh->router_list_node);
-       mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
+       mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
 }
 
 static bool mlxsw_sp_rt6_is_gateway(const struct mlxsw_sp *mlxsw_sp,
index ed3b628caafe5ca0135cd3989b307be282cfd209..bc5894c405a67741e7c898f86ff08d17690c700c 100644 (file)
@@ -156,10 +156,10 @@ int mlxsw_sp_nexthop_counter_get(struct mlxsw_sp *mlxsw_sp,
 int mlxsw_sp_nexthop_eth_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
                                struct mlxsw_sp_nexthop *nh, bool force,
                                char *ratr_pl);
-void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp,
-                                   struct mlxsw_sp_nexthop *nh);
-void mlxsw_sp_nexthop_counter_free(struct mlxsw_sp *mlxsw_sp,
-                                  struct mlxsw_sp_nexthop *nh);
+void mlxsw_sp_nexthop_counter_enable(struct mlxsw_sp *mlxsw_sp,
+                                    struct mlxsw_sp_nexthop *nh);
+void mlxsw_sp_nexthop_counter_disable(struct mlxsw_sp *mlxsw_sp,
+                                     struct mlxsw_sp_nexthop *nh);
 
 static inline bool mlxsw_sp_l3addr_eq(const union mlxsw_sp_l3addr *addr1,
                                      const union mlxsw_sp_l3addr *addr2)