Skip to content

Commit f5e7f67

Browse files
CCX-Stingraydavem330
authored andcommitted
net/mlx5e: Move AM logic enums
More movement to help make this code more generic. Signed-off-by: Andy Gospodarek <[email protected]> Acked-by: Tal Gilboa <[email protected]> Acked-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 138968e commit f5e7f67

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_dim.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,32 @@ struct mlx5e_rx_am { /* Adaptive Moderation */
6666
u8 tired;
6767
};
6868

69+
/* Adaptive moderation logic */
70+
enum {
71+
MLX5E_AM_START_MEASURE,
72+
MLX5E_AM_MEASURE_IN_PROGRESS,
73+
MLX5E_AM_APPLY_NEW_PROFILE,
74+
};
75+
76+
enum {
77+
MLX5E_AM_PARKING_ON_TOP,
78+
MLX5E_AM_PARKING_TIRED,
79+
MLX5E_AM_GOING_RIGHT,
80+
MLX5E_AM_GOING_LEFT,
81+
};
82+
83+
enum {
84+
MLX5E_AM_STATS_WORSE,
85+
MLX5E_AM_STATS_SAME,
86+
MLX5E_AM_STATS_BETTER,
87+
};
88+
89+
enum {
90+
MLX5E_AM_STEPPED,
91+
MLX5E_AM_TOO_TIRED,
92+
MLX5E_AM_ON_EDGE,
93+
};
94+
6995
void mlx5e_rx_am(struct mlx5e_rx_am *am,
7096
u16 event_ctr,
7197
u64 packets,

drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,31 +82,6 @@ struct mlx5e_cq_moder mlx5e_am_get_def_profile(u8 rx_cq_period_mode)
8282
return mlx5e_am_get_profile(rx_cq_period_mode, default_profile_ix);
8383
}
8484

85-
/* Adaptive moderation logic */
86-
enum {
87-
MLX5E_AM_START_MEASURE,
88-
MLX5E_AM_MEASURE_IN_PROGRESS,
89-
MLX5E_AM_APPLY_NEW_PROFILE,
90-
};
91-
92-
enum {
93-
MLX5E_AM_PARKING_ON_TOP,
94-
MLX5E_AM_PARKING_TIRED,
95-
MLX5E_AM_GOING_RIGHT,
96-
MLX5E_AM_GOING_LEFT,
97-
};
98-
99-
enum {
100-
MLX5E_AM_STATS_WORSE,
101-
MLX5E_AM_STATS_SAME,
102-
MLX5E_AM_STATS_BETTER,
103-
};
104-
105-
enum {
106-
MLX5E_AM_STEPPED,
107-
MLX5E_AM_TOO_TIRED,
108-
MLX5E_AM_ON_EDGE,
109-
};
11085

11186
static bool mlx5e_am_on_top(struct mlx5e_rx_am *am)
11287
{

0 commit comments

Comments
 (0)