qcacmn: Mapping between NAPI budget and internal budget

There is a scale factor mapping between NAPI budget and internal
budget. Add logic for this dynamic translation.

CRs-Fixed: 2140049
Change-Id: Iac03bd431ab7a416a87e488b14bc8b5c1bb7869f
This commit is contained in:
chenguo
2017-11-08 16:33:25 +08:00
committed by snandini
parent 98b30de852
commit f254886c3d
4 changed files with 41 additions and 15 deletions

View File

@@ -167,16 +167,20 @@ struct CE_state;
#ifndef NAPI_YIELD_BUDGET_BASED
#ifdef HIF_CONFIG_SLUB_DEBUG_ON
#define QCA_NAPI_BUDGET 64
#define QCA_NAPI_DEF_SCALE 2
#define QCA_NAPI_DEF_SCALE_BIN_SHIFT 1
#else /* PERF build */
#define QCA_NAPI_BUDGET 64
#define QCA_NAPI_DEF_SCALE 16
#ifdef CONFIG_WIN
#define QCA_NAPI_DEF_SCALE_BIN_SHIFT 1
#else
#define QCA_NAPI_DEF_SCALE_BIN_SHIFT 4
#endif /* CONFIG_WIN */
#endif /* SLUB_DEBUG_ON */
#else /* NAPI_YIELD_BUDGET_BASED */
#else /* NAPI_YIELD_BUDGET_BASED */
#define QCA_NAPI_DEF_SCALE_BIN_SHIFT 2
#endif /* NAPI_YIELD_BUDGET_BASED */
#define QCA_NAPI_BUDGET 64
#define QCA_NAPI_DEF_SCALE 4
#endif
#define QCA_NAPI_DEF_SCALE \
(1 << QCA_NAPI_DEF_SCALE_BIN_SHIFT)
#define HIF_NAPI_MAX_RECEIVES (QCA_NAPI_BUDGET * QCA_NAPI_DEF_SCALE)
/* NOTE: "napi->scale" can be changed,