diff --git a/hif/inc/hif.h b/hif/inc/hif.h index a0e6744cc4..edc7699e19 100644 --- a/hif/inc/hif.h +++ b/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_ */ diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index edd45569f4..9f6c49dc63 100644 --- a/hif/src/ce/ce_main.c +++ b/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); diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index c2d1b9604b..8b5cef8a0d 100644 --- a/hif/src/ce/ce_service.c +++ b/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; diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 347795ec24..715d74581f 100644 --- a/hif/src/hif_main.c +++ b/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; +} diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index e5c88b6c30..acbcacda01 100644 --- a/hif/src/hif_main.h +++ b/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