qcacmn: Add support to pass napi budget as module parameter

Add module parameter to pass napi budget for dp interrupts. Default value is
set to 128.

Change-Id: I6b3761c6908ed9cec4e40118a657b39da6ac2532
CRs-Fixed: 2095242
This commit is contained in:
Venkateswara Swamy Bandaru
2017-08-18 19:13:10 +05:30
committed by snandini
parent 7b24441d5e
commit ed15e74a87
3 changed files with 19 additions and 9 deletions

View File

@@ -69,6 +69,12 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc)
#define TX_RING_MASK_VAL 0xF #define TX_RING_MASK_VAL 0xF
#define RX_RING_MASK_VAL 0xF #define RX_RING_MASK_VAL 0xF
#endif #endif
unsigned int napi_budget = 128;
module_param(napi_budget, uint, 0644);
MODULE_PARM_DESC(napi_budget,
"tasklet mode: more than 0xffff , napi budget if <= 0xffff");
/** /**
* default_dscp_tid_map - Default DSCP-TID mapping * default_dscp_tid_map - Default DSCP-TID mapping
* *
@@ -1152,7 +1158,7 @@ static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc)
ret = hif_register_ext_group(soc->hif_handle, ret = hif_register_ext_group(soc->hif_handle,
num_irq, irq_id_map, dp_service_srngs, num_irq, irq_id_map, dp_service_srngs,
&soc->intr_ctx[i], "dp_intr", &soc->intr_ctx[i], "dp_intr",
HIF_EXEC_NAPI_TYPE); napi_budget);
if (ret) { if (ret) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,

View File

@@ -889,7 +889,7 @@ uint32_t hif_configure_ext_group_interrupts(struct hif_opaque_softc *hif_ctx);
uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx, uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
uint32_t numirq, uint32_t irq[], ext_intr_handler handler, uint32_t numirq, uint32_t irq[], ext_intr_handler handler,
void *cb_ctx, const char *context_name, void *cb_ctx, const char *context_name,
enum hif_exec_type type); uint32_t budget);
void hif_update_pipe_callback(struct hif_opaque_softc *osc, void hif_update_pipe_callback(struct hif_opaque_softc *osc,
u_int8_t pipeid, u_int8_t pipeid,

View File

@@ -162,7 +162,7 @@ struct hif_execution_ops napi_sched_ops = {
/** /**
* hif_exec_napi_create() - allocate and initialize a napi exec context * hif_exec_napi_create() - allocate and initialize a napi exec context
*/ */
static struct hif_exec_context *hif_exec_napi_create(void) static struct hif_exec_context *hif_exec_napi_create(uint32_t budget)
{ {
struct hif_napi_exec_context *ctx; struct hif_napi_exec_context *ctx;
@@ -174,13 +174,13 @@ static struct hif_exec_context *hif_exec_napi_create(void)
ctx->exec_ctx.inited = true; ctx->exec_ctx.inited = true;
init_dummy_netdev(&(ctx->netdev)); init_dummy_netdev(&(ctx->netdev));
netif_napi_add(&(ctx->netdev), &(ctx->napi), hif_exec_poll, netif_napi_add(&(ctx->netdev), &(ctx->napi), hif_exec_poll,
QCA_NAPI_BUDGET); budget);
napi_enable(&ctx->napi); napi_enable(&ctx->napi);
return &ctx->exec_ctx; return &ctx->exec_ctx;
} }
#else #else
static struct hif_exec_context *hif_exec_napi_create(void) static struct hif_exec_context *hif_exec_napi_create(uint32_t budget)
{ {
HIF_WARN("%s: FEATURE_NAPI not defined, making tasklet"); HIF_WARN("%s: FEATURE_NAPI not defined, making tasklet");
return hif_exec_tasklet_create(); return hif_exec_tasklet_create();
@@ -340,7 +340,7 @@ void hif_exec_kill(struct hif_opaque_softc *hif_ctx)
*/ */
uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx, uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
uint32_t numirq, uint32_t irq[], ext_intr_handler handler, uint32_t numirq, uint32_t irq[], ext_intr_handler handler,
void *cb_ctx, const char *context_name, enum hif_exec_type type) void *cb_ctx, const char *context_name, uint32_t budget)
{ {
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
@@ -361,7 +361,7 @@ uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
hif_ext_group = hif_exec_create(type); hif_ext_group = hif_exec_create(budget);
if (hif_ext_group == NULL) if (hif_ext_group == NULL)
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
@@ -385,11 +385,15 @@ uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
* hif_exec_create() - create an execution context * hif_exec_create() - create an execution context
* @type: the type of execution context to create * @type: the type of execution context to create
*/ */
struct hif_exec_context *hif_exec_create(enum hif_exec_type type) struct hif_exec_context *hif_exec_create(uint32_t budget)
{ {
uint32_t type = budget <= 0xFFFF ?
HIF_EXEC_NAPI_TYPE : HIF_EXEC_TASKLET_TYPE;
HIF_INFO("%s: create exec_type %d budget %d\n", __func__, type, budget);
switch (type) { switch (type) {
case HIF_EXEC_NAPI_TYPE: case HIF_EXEC_NAPI_TYPE:
return hif_exec_napi_create(); return hif_exec_napi_create(budget);
case HIF_EXEC_TASKLET_TYPE: case HIF_EXEC_TASKLET_TYPE:
return hif_exec_tasklet_create(); return hif_exec_tasklet_create();