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:

committed by
nshrivas

parent
d0499517e4
commit
33b1bdd1b6
@@ -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 {
|
||||
|
Reference in New Issue
Block a user