Browse Source

qcacmn: Add API to set ce service max rx indication flush

Add API to set ce service max rx indication flush num
during load time for handling of messages in CE based on
ini configured one.

Change-Id: I49c3d6ebac34076cd5ad5e352e78d2fec7c8ee89
CRs-Fixed: 2068375
Poddar, Siddarth 7 years ago
parent
commit
1ea8292209
5 changed files with 37 additions and 8 deletions
  1. 19 0
      hif/inc/hif.h
  2. 1 0
      hif/src/ce/ce_main.c
  3. 3 8
      hif/src/ce/ce_service.c
  4. 13 0
      hif/src/hif_main.c
  5. 1 0
      hif/src/hif_main.h

+ 19 - 0
hif/inc/hif.h

@@ -603,6 +603,12 @@ struct hif_pipe_addl_info {
 	struct hif_dl_pipe_info dl_pipe;
 };
 
+#ifdef CONFIG_SLUB_DEBUG_ON
+#define MSG_FLUSH_NUM 16
+#else /* PERF build */
+#define MSG_FLUSH_NUM 32
+#endif /* SLUB_DEBUG_ON */
+
 struct hif_bus_id;
 
 void hif_claim_device(struct hif_opaque_softc *hif_ctx);
@@ -945,4 +951,17 @@ void hif_set_ce_service_max_yield_time(struct hif_opaque_softc *hif,
  */
 unsigned long long
 hif_get_ce_service_max_yield_time(struct hif_opaque_softc *hif);
+
+/**
+ * hif_set_ce_service_max_rx_ind_flush() - sets CE service max rx ind flush
+ * @hif: hif context
+ * @ce_service_max_rx_ind_flush: CE service max rx ind flush to set
+ *
+ * This API stores CE service max rx ind flush in hif context based
+ * on ini value.
+ *
+ * Return: void
+ */
+void hif_set_ce_service_max_rx_ind_flush(struct hif_opaque_softc *hif,
+				       uint8_t ce_service_max_rx_ind_flush);
 #endif /* _HIF_H_ */

+ 1 - 0
hif/src/ce/ce_main.c

@@ -2769,6 +2769,7 @@ int hif_config_ce(struct hif_softc *scn)
 	QDF_STATUS rv = QDF_STATUS_SUCCESS;
 
 	scn->notice_send = true;
+	scn->ce_service_max_rx_ind_flush = MSG_FLUSH_NUM;
 
 	hif_post_static_buf_to_target(scn);
 

+ 3 - 8
hif/src/ce/ce_service.c

@@ -1844,11 +1844,6 @@ static void ce_fastpath_rx_handle(struct CE_state *ce_state,
 	dest_ring->write_index = write_index;
 }
 
-#ifdef CONFIG_SLUB_DEBUG_ON
-#define MSG_FLUSH_NUM 16
-#else /* PERF build */
-#define MSG_FLUSH_NUM 32
-#endif /* SLUB_DEBUG_ON */
 /**
  * ce_per_engine_service_fast() - CE handler routine to service fastpath msgs
  * @scn: hif_context
@@ -1945,15 +1940,15 @@ more_data:
 		 * we are not posting the buffers back instead
 		 * reusing the buffers
 		 */
-		if (nbuf_cmpl_idx == MSG_FLUSH_NUM) {
+		if (nbuf_cmpl_idx == scn->ce_service_max_rx_ind_flush) {
 			hif_record_ce_desc_event(scn, ce_state->id,
 						 FAST_RX_SOFTWARE_INDEX_UPDATE,
 						 NULL, NULL, sw_index, 0);
 			dest_ring->sw_index = sw_index;
 			ce_fastpath_rx_handle(ce_state, cmpl_msdus,
-					      MSG_FLUSH_NUM, ctrl_addr);
+						nbuf_cmpl_idx, ctrl_addr);
 
-			ce_state->receive_count += MSG_FLUSH_NUM;
+			ce_state->receive_count += nbuf_cmpl_idx;
 			if (qdf_unlikely(hif_ce_service_should_yield(
 						scn, ce_state))) {
 				ce_state->force_break = 1;

+ 13 - 0
hif/src/hif_main.c

@@ -1276,3 +1276,16 @@ hif_get_ce_service_max_yield_time(struct hif_opaque_softc *hif)
 
 	return hif_ctx->ce_service_max_yield_time;
 }
+
+void hif_set_ce_service_max_rx_ind_flush(struct hif_opaque_softc *hif,
+				       uint8_t ce_service_max_rx_ind_flush)
+{
+	struct hif_softc *hif_ctx = HIF_GET_SOFTC(hif);
+
+	if (ce_service_max_rx_ind_flush == 0 ||
+	    ce_service_max_rx_ind_flush > MSG_FLUSH_NUM)
+		hif_ctx->ce_service_max_rx_ind_flush = MSG_FLUSH_NUM;
+	else
+		hif_ctx->ce_service_max_rx_ind_flush =
+						ce_service_max_rx_ind_flush;
+}

+ 1 - 0
hif/src/hif_main.h

@@ -178,6 +178,7 @@ struct hif_softc {
 #endif /* FEATURE_NAPI */
 	/* stores ce_service_max_yield_time in ns */
 	unsigned long long ce_service_max_yield_time;
+	uint8_t ce_service_max_rx_ind_flush;
 	struct hif_driver_state_callbacks callbacks;
 	uint32_t hif_con_param;
 #ifdef QCA_NSS_WIFI_OFFLOAD_SUPPORT