Skip to content

Commit 64f962c

Browse files
pmachatakuba-moo
authored andcommitted
mlxsw: spectrum_router: Rename two functions
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>
1 parent e99eb57 commit 64f962c

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,9 +1193,9 @@ static int mlxsw_sp_dpipe_table_adj_counters_update(void *priv, bool enable)
11931193
mlxsw_sp_nexthop_indexes(nh, &adj_index, &adj_size,
11941194
&adj_hash_index);
11951195
if (enable)
1196-
mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
1196+
mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
11971197
else
1198-
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
1198+
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
11991199
mlxsw_sp_nexthop_eth_update(mlxsw_sp,
12001200
adj_index + adj_hash_index, nh,
12011201
true, ratr_pl);

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,8 +3151,8 @@ struct mlxsw_sp_nexthop_group {
31513151
bool can_destroy;
31523152
};
31533153

3154-
void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp,
3155-
struct mlxsw_sp_nexthop *nh)
3154+
void mlxsw_sp_nexthop_counter_enable(struct mlxsw_sp *mlxsw_sp,
3155+
struct mlxsw_sp_nexthop *nh)
31563156
{
31573157
struct devlink *devlink;
31583158

@@ -3167,8 +3167,8 @@ void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp,
31673167
nh->counter_valid = true;
31683168
}
31693169

3170-
void mlxsw_sp_nexthop_counter_free(struct mlxsw_sp *mlxsw_sp,
3171-
struct mlxsw_sp_nexthop *nh)
3170+
void mlxsw_sp_nexthop_counter_disable(struct mlxsw_sp *mlxsw_sp,
3171+
struct mlxsw_sp_nexthop *nh)
31723172
{
31733173
if (!nh->counter_valid)
31743174
return;
@@ -4507,7 +4507,7 @@ static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp,
45074507
if (err)
45084508
return err;
45094509

4510-
mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
4510+
mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
45114511
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
45124512

45134513
if (!dev)
@@ -4531,7 +4531,7 @@ static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp,
45314531

45324532
err_nexthop_neigh_init:
45334533
list_del(&nh->router_list_node);
4534-
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
4534+
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
45354535
mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
45364536
return err;
45374537
}
@@ -4541,7 +4541,7 @@ static void mlxsw_sp_nexthop4_fini(struct mlxsw_sp *mlxsw_sp,
45414541
{
45424542
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
45434543
list_del(&nh->router_list_node);
4544-
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
4544+
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
45454545
mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
45464546
}
45474547

@@ -5006,7 +5006,7 @@ mlxsw_sp_nexthop_obj_init(struct mlxsw_sp *mlxsw_sp,
50065006
break;
50075007
}
50085008

5009-
mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
5009+
mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
50105010
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
50115011
nh->ifindex = dev->ifindex;
50125012

@@ -5030,7 +5030,7 @@ mlxsw_sp_nexthop_obj_init(struct mlxsw_sp *mlxsw_sp,
50305030

50315031
err_type_init:
50325032
list_del(&nh->router_list_node);
5033-
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
5033+
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
50345034
return err;
50355035
}
50365036

@@ -5041,7 +5041,7 @@ static void mlxsw_sp_nexthop_obj_fini(struct mlxsw_sp *mlxsw_sp,
50415041
mlxsw_sp_nexthop_obj_blackhole_fini(mlxsw_sp, nh);
50425042
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
50435043
list_del(&nh->router_list_node);
5044-
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
5044+
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
50455045
nh->should_offload = 0;
50465046
}
50475047

@@ -6734,7 +6734,7 @@ static int mlxsw_sp_nexthop6_init(struct mlxsw_sp *mlxsw_sp,
67346734
#if IS_ENABLED(CONFIG_IPV6)
67356735
nh->neigh_tbl = &nd_tbl;
67366736
#endif
6737-
mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh);
6737+
mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
67386738

67396739
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
67406740

@@ -6750,7 +6750,7 @@ static int mlxsw_sp_nexthop6_init(struct mlxsw_sp *mlxsw_sp,
67506750

67516751
err_nexthop_type_init:
67526752
list_del(&nh->router_list_node);
6753-
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
6753+
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
67546754
return err;
67556755
}
67566756

@@ -6759,7 +6759,7 @@ static void mlxsw_sp_nexthop6_fini(struct mlxsw_sp *mlxsw_sp,
67596759
{
67606760
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
67616761
list_del(&nh->router_list_node);
6762-
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh);
6762+
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
67636763
}
67646764

67656765
static bool mlxsw_sp_rt6_is_gateway(const struct mlxsw_sp *mlxsw_sp,

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ int mlxsw_sp_nexthop_counter_get(struct mlxsw_sp *mlxsw_sp,
156156
int mlxsw_sp_nexthop_eth_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
157157
struct mlxsw_sp_nexthop *nh, bool force,
158158
char *ratr_pl);
159-
void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp,
160-
struct mlxsw_sp_nexthop *nh);
161-
void mlxsw_sp_nexthop_counter_free(struct mlxsw_sp *mlxsw_sp,
162-
struct mlxsw_sp_nexthop *nh);
159+
void mlxsw_sp_nexthop_counter_enable(struct mlxsw_sp *mlxsw_sp,
160+
struct mlxsw_sp_nexthop *nh);
161+
void mlxsw_sp_nexthop_counter_disable(struct mlxsw_sp *mlxsw_sp,
162+
struct mlxsw_sp_nexthop *nh);
163163

164164
static inline bool mlxsw_sp_l3addr_eq(const union mlxsw_sp_l3addr *addr1,
165165
const union mlxsw_sp_l3addr *addr2)

0 commit comments

Comments
 (0)