mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
qcacmn: Fix bucket calculation in NAPI case
Take care of corner case when normlized value is just one more than QCA_NAPI_BUDGET and add normlized to debug prints. Change-Id: Ife2010b0ada534a487639dbb780e24445d98c045 CRs-Fixed: 2286601
This commit is contained in:
parent
d0499517e4
commit
33b1bdd1b6
1 changed files with 6 additions and 3 deletions
|
|
@ -932,11 +932,14 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx,
|
|||
normalized = (rc / napi_info->scale);
|
||||
if (normalized == 0)
|
||||
normalized++;
|
||||
bucket = normalized / (QCA_NAPI_BUDGET / QCA_NAPI_NUM_BUCKETS);
|
||||
bucket = (normalized - 1) /
|
||||
(QCA_NAPI_BUDGET / QCA_NAPI_NUM_BUCKETS);
|
||||
if (bucket >= QCA_NAPI_NUM_BUCKETS) {
|
||||
bucket = QCA_NAPI_NUM_BUCKETS - 1;
|
||||
HIF_ERROR("Bad bucket#(%d) > QCA_NAPI_NUM_BUCKETS(%d)",
|
||||
bucket, QCA_NAPI_NUM_BUCKETS);
|
||||
HIF_ERROR("Bad bucket#(%d) > QCA_NAPI_NUM_BUCKETS(%d)"
|
||||
" normalized %d, napi budget %d",
|
||||
bucket, QCA_NAPI_NUM_BUCKETS,
|
||||
normalized, QCA_NAPI_BUDGET);
|
||||
}
|
||||
napi_info->stats[cpu].napi_budget_uses[bucket]++;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue