diff options
author | Andy Gospodarek <gospo@broadcom.com> | 2018-01-09 16:06:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-10 15:27:35 -0500 |
commit | f5e7f67d9bc90d2556e131c44d83a14f85cee9c3 (patch) | |
tree | fac3b9d5f07499fadf2eb2da93dcda560b3dcf98 | |
parent | 138968e9979f0c4afb7cc86b8ddca8bf46911771 (diff) |
net/mlx5e: Move AM logic enums
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>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_dim.h | 26 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c | 25 |
2 files changed, 26 insertions, 25 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dim.h b/drivers/net/ethernet/mellanox/mlx5/core/en_dim.h index 7d5499a3d738..a1497bab7154 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dim.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dim.h | |||
@@ -66,6 +66,32 @@ struct mlx5e_rx_am { /* Adaptive Moderation */ | |||
66 | u8 tired; | 66 | u8 tired; |
67 | }; | 67 | }; |
68 | 68 | ||
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 | |||
69 | void mlx5e_rx_am(struct mlx5e_rx_am *am, | 95 | void mlx5e_rx_am(struct mlx5e_rx_am *am, |
70 | u16 event_ctr, | 96 | u16 event_ctr, |
71 | u64 packets, | 97 | u64 packets, |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c index 1630076844ef..337dd6024487 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c | |||
@@ -82,31 +82,6 @@ struct mlx5e_cq_moder mlx5e_am_get_def_profile(u8 rx_cq_period_mode) | |||
82 | return mlx5e_am_get_profile(rx_cq_period_mode, default_profile_ix); | 82 | return mlx5e_am_get_profile(rx_cq_period_mode, default_profile_ix); |
83 | } | 83 | } |
84 | 84 | ||
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 | }; | ||
110 | 85 | ||
111 | static bool mlx5e_am_on_top(struct mlx5e_rx_am *am) | 86 | static bool mlx5e_am_on_top(struct mlx5e_rx_am *am) |
112 | { | 87 | { |