diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-08-04 10:39:54 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-09-03 15:49:03 -0400 |
commit | a43ad46a450b1a4466f34b057522f56c125710fb (patch) | |
tree | 159676d19db2aea3a1be06dee0daae20210efb25 | |
parent | 2ce89cd6dfc2ea57497ab38f88d4878c06869a81 (diff) |
iwlwifi: mvm: add some debugging to quota allocation
In order to follow more easily what's going on, add some
debug statements to the quota allocation algorithm.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/quota.c | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 295083510e72..0a70bcd241f5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -145,6 +145,7 @@ do { \ | |||
145 | #define IWL_DL_HCMD 0x00000004 | 145 | #define IWL_DL_HCMD 0x00000004 |
146 | #define IWL_DL_STATE 0x00000008 | 146 | #define IWL_DL_STATE 0x00000008 |
147 | /* 0x000000F0 - 0x00000010 */ | 147 | /* 0x000000F0 - 0x00000010 */ |
148 | #define IWL_DL_QUOTA 0x00000010 | ||
148 | #define IWL_DL_TE 0x00000020 | 149 | #define IWL_DL_TE 0x00000020 |
149 | #define IWL_DL_EEPROM 0x00000040 | 150 | #define IWL_DL_EEPROM 0x00000040 |
150 | #define IWL_DL_RADIO 0x00000080 | 151 | #define IWL_DL_RADIO 0x00000080 |
@@ -189,6 +190,7 @@ do { \ | |||
189 | #define IWL_DEBUG_LED(p, f, a...) IWL_DEBUG(p, IWL_DL_LED, f, ## a) | 190 | #define IWL_DEBUG_LED(p, f, a...) IWL_DEBUG(p, IWL_DL_LED, f, ## a) |
190 | #define IWL_DEBUG_WEP(p, f, a...) IWL_DEBUG(p, IWL_DL_WEP, f, ## a) | 191 | #define IWL_DEBUG_WEP(p, f, a...) IWL_DEBUG(p, IWL_DL_WEP, f, ## a) |
191 | #define IWL_DEBUG_HC(p, f, a...) IWL_DEBUG(p, IWL_DL_HCMD, f, ## a) | 192 | #define IWL_DEBUG_HC(p, f, a...) IWL_DEBUG(p, IWL_DL_HCMD, f, ## a) |
193 | #define IWL_DEBUG_QUOTA(p, f, a...) IWL_DEBUG(p, IWL_DL_QUOTA, f, ## a) | ||
192 | #define IWL_DEBUG_TE(p, f, a...) IWL_DEBUG(p, IWL_DL_TE, f, ## a) | 194 | #define IWL_DEBUG_TE(p, f, a...) IWL_DEBUG(p, IWL_DL_TE, f, ## a) |
193 | #define IWL_DEBUG_EEPROM(d, f, a...) IWL_DEBUG_DEV(d, IWL_DL_EEPROM, f, ## a) | 195 | #define IWL_DEBUG_EEPROM(d, f, a...) IWL_DEBUG_DEV(d, IWL_DL_EEPROM, f, ## a) |
194 | #define IWL_DEBUG_CALIB(p, f, a...) IWL_DEBUG(p, IWL_DL_CALIB, f, ## a) | 196 | #define IWL_DEBUG_CALIB(p, f, a...) IWL_DEBUG(p, IWL_DL_CALIB, f, ## a) |
diff --git a/drivers/net/wireless/iwlwifi/mvm/quota.c b/drivers/net/wireless/iwlwifi/mvm/quota.c index 4e20b3ce2b6a..300639ce78be 100644 --- a/drivers/net/wireless/iwlwifi/mvm/quota.c +++ b/drivers/net/wireless/iwlwifi/mvm/quota.c | |||
@@ -161,6 +161,9 @@ static void iwl_mvm_adjust_quota_for_noa(struct iwl_mvm *mvm, | |||
161 | quota *= (beacon_int - mvm->noa_duration); | 161 | quota *= (beacon_int - mvm->noa_duration); |
162 | quota /= beacon_int; | 162 | quota /= beacon_int; |
163 | 163 | ||
164 | IWL_DEBUG_QUOTA(mvm, "quota: adjust for NoA from %d to %d\n", | ||
165 | le32_to_cpu(cmd->quotas[i].quota), quota); | ||
166 | |||
164 | cmd->quotas[i].quota = cpu_to_le32(quota); | 167 | cmd->quotas[i].quota = cpu_to_le32(quota); |
165 | } | 168 | } |
166 | #endif | 169 | #endif |
@@ -222,6 +225,9 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, | |||
222 | quota = (QUOTA_100 - QUOTA_LOWLAT_MIN) / n_non_lowlat; | 225 | quota = (QUOTA_100 - QUOTA_LOWLAT_MIN) / n_non_lowlat; |
223 | quota_rem = QUOTA_100 - n_non_lowlat * quota - | 226 | quota_rem = QUOTA_100 - n_non_lowlat * quota - |
224 | QUOTA_LOWLAT_MIN; | 227 | QUOTA_LOWLAT_MIN; |
228 | IWL_DEBUG_QUOTA(mvm, | ||
229 | "quota: low-latency binding active, remaining quota per other binding: %d\n", | ||
230 | quota); | ||
225 | } else if (num_active_macs) { | 231 | } else if (num_active_macs) { |
226 | /* | 232 | /* |
227 | * There are 0 or more than 1 low latency bindings, or all the | 233 | * There are 0 or more than 1 low latency bindings, or all the |
@@ -230,6 +236,9 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, | |||
230 | */ | 236 | */ |
231 | quota = QUOTA_100 / num_active_macs; | 237 | quota = QUOTA_100 / num_active_macs; |
232 | quota_rem = QUOTA_100 % num_active_macs; | 238 | quota_rem = QUOTA_100 % num_active_macs; |
239 | IWL_DEBUG_QUOTA(mvm, | ||
240 | "quota: splitting evenly per binding: %d\n", | ||
241 | quota); | ||
233 | } else { | 242 | } else { |
234 | /* values don't really matter - won't be used */ | 243 | /* values don't really matter - won't be used */ |
235 | quota = 0; | 244 | quota = 0; |
@@ -271,6 +280,9 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, | |||
271 | for (i = 0; i < MAX_BINDINGS; i++) { | 280 | for (i = 0; i < MAX_BINDINGS; i++) { |
272 | if (le32_to_cpu(cmd.quotas[i].quota) != 0) { | 281 | if (le32_to_cpu(cmd.quotas[i].quota) != 0) { |
273 | le32_add_cpu(&cmd.quotas[i].quota, quota_rem); | 282 | le32_add_cpu(&cmd.quotas[i].quota, quota_rem); |
283 | IWL_DEBUG_QUOTA(mvm, | ||
284 | "quota: giving remainder of %d to binding %d\n", | ||
285 | quota_rem, i); | ||
274 | break; | 286 | break; |
275 | } | 287 | } |
276 | } | 288 | } |