提交 b3b06a32 编写于 作者: E Eyal Shapira 提交者: Emmanuel Grumbach

iwlwifi: mvm: rs: overhaul search cycle state machine

Rewrite the search cycle state machine to use a more data
oriented approach where the different Tx columns (configs)
limitations and next columns to search are reprsented in
tables which are easy to change. This overhaul also includes
several major fixes:

1. Prevent going back to a specific Tx column in a search
cycle if it was already explored.

2. Avoid switching to a Tx column that doesn't have any chance
if it performs perfectly to beat the current throughput we're
getting.

These issues were degrading throughput as they were causing
switching to "bad" Tx columns.
Signed-off-by: NEyal Shapira <eyal@wizery.com>
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
上级 a56db7d1
...@@ -157,37 +157,6 @@ enum { ...@@ -157,37 +157,6 @@ enum {
#define IWL_RATE_INCREASE_TH 6400 /* 50% */ #define IWL_RATE_INCREASE_TH 6400 /* 50% */
#define RS_SR_FORCE_DECREASE 1920 /* 15% */ #define RS_SR_FORCE_DECREASE 1920 /* 15% */
/* possible actions when in legacy mode */
enum {
IWL_LEGACY_SWITCH_ANTENNA,
IWL_LEGACY_SWITCH_SISO,
IWL_LEGACY_SWITCH_MIMO2,
IWL_LEGACY_FIRST_ACTION = IWL_LEGACY_SWITCH_ANTENNA,
IWL_LEGACY_LAST_ACTION = IWL_LEGACY_SWITCH_MIMO2,
};
/* possible actions when in siso mode */
enum {
IWL_SISO_SWITCH_ANTENNA,
IWL_SISO_SWITCH_MIMO2,
IWL_SISO_SWITCH_GI,
IWL_SISO_FIRST_ACTION = IWL_SISO_SWITCH_ANTENNA,
IWL_SISO_LAST_ACTION = IWL_SISO_SWITCH_GI,
};
/* possible actions when in mimo mode */
enum {
IWL_MIMO2_SWITCH_SISO_A,
IWL_MIMO2_SWITCH_SISO_B,
IWL_MIMO2_SWITCH_GI,
IWL_MIMO2_FIRST_ACTION = IWL_MIMO2_SWITCH_SISO_A,
IWL_MIMO2_LAST_ACTION = IWL_MIMO2_SWITCH_GI,
};
#define IWL_MAX_SEARCH IWL_MIMO2_LAST_ACTION
#define IWL_ACTION_LIMIT 3 /* # possible actions */
#define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000) /* 4 milliseconds */ #define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000) /* 4 milliseconds */
#define LINK_QUAL_AGG_TIME_LIMIT_MAX (8000) #define LINK_QUAL_AGG_TIME_LIMIT_MAX (8000)
#define LINK_QUAL_AGG_TIME_LIMIT_MIN (100) #define LINK_QUAL_AGG_TIME_LIMIT_MIN (100)
...@@ -282,6 +251,23 @@ struct iwl_rate_scale_data { ...@@ -282,6 +251,23 @@ struct iwl_rate_scale_data {
s32 average_tpt; /* success ratio * expected throughput */ s32 average_tpt; /* success ratio * expected throughput */
}; };
/* Possible Tx columns
* Tx Column = a combo of legacy/siso/mimo x antenna x SGI
*/
enum rs_column {
RS_COLUMN_LEGACY_ANT_A = 0,
RS_COLUMN_LEGACY_ANT_B,
RS_COLUMN_SISO_ANT_A,
RS_COLUMN_SISO_ANT_B,
RS_COLUMN_SISO_ANT_A_SGI,
RS_COLUMN_SISO_ANT_B_SGI,
RS_COLUMN_MIMO2,
RS_COLUMN_MIMO2_SGI,
RS_COLUMN_LAST = RS_COLUMN_MIMO2_SGI,
RS_COLUMN_INVALID,
};
/** /**
* struct iwl_scale_tbl_info -- tx params and success history for all rates * struct iwl_scale_tbl_info -- tx params and success history for all rates
* *
...@@ -290,13 +276,18 @@ struct iwl_rate_scale_data { ...@@ -290,13 +276,18 @@ struct iwl_rate_scale_data {
*/ */
struct iwl_scale_tbl_info { struct iwl_scale_tbl_info {
struct rs_rate rate; struct rs_rate rate;
u8 action; /* change modulation; IWL_[LEGACY/SISO/MIMO]_SWITCH_* */ enum rs_column column;
u8 max_search; /* maximun number of tables we can search */
s32 *expected_tpt; /* throughput metrics; expected_tpt_G, etc. */ s32 *expected_tpt; /* throughput metrics; expected_tpt_G, etc. */
u32 current_rate; /* rate_n_flags, uCode API format */ u32 current_rate; /* rate_n_flags, uCode API format */
struct iwl_rate_scale_data win[IWL_RATE_COUNT]; /* rate histories */ struct iwl_rate_scale_data win[IWL_RATE_COUNT]; /* rate histories */
}; };
enum {
RS_STATE_SEARCH_CYCLE_STARTED,
RS_STATE_SEARCH_CYCLE_ENDED,
RS_STATE_STAY_IN_COLUMN,
};
/** /**
* struct iwl_lq_sta -- driver's rate scaling private structure * struct iwl_lq_sta -- driver's rate scaling private structure
* *
...@@ -304,8 +295,7 @@ struct iwl_scale_tbl_info { ...@@ -304,8 +295,7 @@ struct iwl_scale_tbl_info {
*/ */
struct iwl_lq_sta { struct iwl_lq_sta {
u8 active_tbl; /* index of active table, range 0-1 */ u8 active_tbl; /* index of active table, range 0-1 */
u8 enable_counter; /* indicates HT mode */ u8 rs_state; /* RS_STATE_* */
u8 stay_in_tbl; /* 1: disallow, 0: allow search for new mode */
u8 search_better_tbl; /* 1: currently trying alternate mode */ u8 search_better_tbl; /* 1: currently trying alternate mode */
s32 last_tpt; s32 last_tpt;
...@@ -318,7 +308,9 @@ struct iwl_lq_sta { ...@@ -318,7 +308,9 @@ struct iwl_lq_sta {
u32 total_success; /* total successful frames, any/all rates */ u32 total_success; /* total successful frames, any/all rates */
u64 flush_timer; /* time staying in mode before new search */ u64 flush_timer; /* time staying in mode before new search */
u8 action_counter; /* # mode-switch actions tried */ u32 visited_columns; /* Bitmask marking which Tx columns were
* explored during a search cycle
*/
bool is_vht; bool is_vht;
enum ieee80211_band band; enum ieee80211_band band;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册