Bläddra i källkod

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
Venkateswara Swamy Bandaru 7 år sedan
förälder
incheckning
ed15e74a87
3 ändrade filer med 19 tillägg och 9 borttagningar
  1. 7 1
      dp/wifi3.0/dp_main.c
  2. 1 1
      hif/inc/hif.h
  3. 11 7
      hif/src/hif_exec.c

+ 7 - 1
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,

+ 1 - 1
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,

+ 11 - 7
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();