Skip to content

Commit

Permalink
net/mlx5e: Move AM logic enums
Browse files Browse the repository at this point in the history
More movement to help make this code more generic.

Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Acked-by: Tal Gilboa <talgi@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andy Gospodarek authored and David S. Miller committed Jan 10, 2018
1 parent 138968e commit f5e7f67
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
26 changes: 26 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/en_dim.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,32 @@ struct mlx5e_rx_am { /* Adaptive Moderation */
u8 tired;
};

/* Adaptive moderation logic */
enum {
MLX5E_AM_START_MEASURE,
MLX5E_AM_MEASURE_IN_PROGRESS,
MLX5E_AM_APPLY_NEW_PROFILE,
};

enum {
MLX5E_AM_PARKING_ON_TOP,
MLX5E_AM_PARKING_TIRED,
MLX5E_AM_GOING_RIGHT,
MLX5E_AM_GOING_LEFT,
};

enum {
MLX5E_AM_STATS_WORSE,
MLX5E_AM_STATS_SAME,
MLX5E_AM_STATS_BETTER,
};

enum {
MLX5E_AM_STEPPED,
MLX5E_AM_TOO_TIRED,
MLX5E_AM_ON_EDGE,
};

void mlx5e_rx_am(struct mlx5e_rx_am *am,
u16 event_ctr,
u64 packets,
Expand Down
25 changes: 0 additions & 25 deletions drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,6 @@ struct mlx5e_cq_moder mlx5e_am_get_def_profile(u8 rx_cq_period_mode)
return mlx5e_am_get_profile(rx_cq_period_mode, default_profile_ix);
}

/* Adaptive moderation logic */
enum {
MLX5E_AM_START_MEASURE,
MLX5E_AM_MEASURE_IN_PROGRESS,
MLX5E_AM_APPLY_NEW_PROFILE,
};

enum {
MLX5E_AM_PARKING_ON_TOP,
MLX5E_AM_PARKING_TIRED,
MLX5E_AM_GOING_RIGHT,
MLX5E_AM_GOING_LEFT,
};

enum {
MLX5E_AM_STATS_WORSE,
MLX5E_AM_STATS_SAME,
MLX5E_AM_STATS_BETTER,
};

enum {
MLX5E_AM_STEPPED,
MLX5E_AM_TOO_TIRED,
MLX5E_AM_ON_EDGE,
};

static bool mlx5e_am_on_top(struct mlx5e_rx_am *am)
{
Expand Down

0 comments on commit f5e7f67

Please sign in to comment.