diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 2abe09f1dd2a..32266a6a06b2 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -69,6 +69,12 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc) #define TX_RING_MASK_VAL 0xF #define RX_RING_MASK_VAL 0xF #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 * @@ -1152,7 +1158,7 @@ static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc) ret = hif_register_ext_group(soc->hif_handle, num_irq, irq_id_map, dp_service_srngs, &soc->intr_ctx[i], "dp_intr", - HIF_EXEC_NAPI_TYPE); + napi_budget); if (ret) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, diff --git a/hif/inc/hif.h b/hif/inc/hif.h index 98b24c0c8111..a5cf67230b74 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -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 numirq, uint32_t irq[], ext_intr_handler handler, 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, u_int8_t pipeid, diff --git a/hif/src/hif_exec.c b/hif/src/hif_exec.c index 7c26f627ddde..bebabe88a3ad 100644 --- a/hif/src/hif_exec.c +++ b/hif/src/hif_exec.c @@ -162,7 +162,7 @@ struct hif_execution_ops napi_sched_ops = { /** * 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; @@ -174,13 +174,13 @@ static struct hif_exec_context *hif_exec_napi_create(void) ctx->exec_ctx.inited = true; init_dummy_netdev(&(ctx->netdev)); netif_napi_add(&(ctx->netdev), &(ctx->napi), hif_exec_poll, - QCA_NAPI_BUDGET); + budget); napi_enable(&ctx->napi); return &ctx->exec_ctx; } #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"); 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 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_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; } - hif_ext_group = hif_exec_create(type); + hif_ext_group = hif_exec_create(budget); if (hif_ext_group == NULL) 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 * @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) { case HIF_EXEC_NAPI_TYPE: - return hif_exec_napi_create(); + return hif_exec_napi_create(budget); case HIF_EXEC_TASKLET_TYPE: return hif_exec_tasklet_create();