diff --git a/hif/src/ce/ce_api.h b/hif/src/ce/ce_api.h index ee1610455e23..381c20671b13 100644 --- a/hif/src/ce/ce_api.h +++ b/hif/src/ce/ce_api.h @@ -472,7 +472,7 @@ static inline void ce_pkt_error_count_incr( += 1; } -bool ce_check_rx_pending(struct hif_softc *scn, int ce_id); +bool ce_check_rx_pending(struct CE_state *CE_state); #if defined(FEATURE_LRO) void ce_lro_flush_cb_register(struct hif_opaque_softc *scn, void (handler)(void *), void *data); diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 476a28804007..c5028d8b1308 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -1982,14 +1982,13 @@ bool ce_get_rx_pending(struct hif_softc *scn) /** * ce_check_rx_pending() - ce_check_rx_pending - * @scn: hif_softc - * @ce_id: ce_id + * @CE_state: context of the copy engine to check * - * Return: bool + * Return: true if there per_engine_service + * didn't process all the rx descriptors. */ -bool ce_check_rx_pending(struct hif_softc *scn, int ce_id) +bool ce_check_rx_pending(struct CE_state *CE_state) { - struct CE_state *CE_state = scn->ce_id_to_state[ce_id]; if (qdf_atomic_read(&CE_state->rx_pending)) return true; else diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c index df87f4bc09f0..a0553ababd85 100644 --- a/hif/src/ce/ce_tasklet.c +++ b/hif/src/ce/ce_tasklet.c @@ -204,7 +204,7 @@ static void ce_tasklet(unsigned long data) CE_state->lro_flush_cb(CE_state->lro_data); } - if (ce_check_rx_pending(scn, tasklet_entry->ce_id)) { + if (ce_check_rx_pending(CE_state)) { /* * There are frames pending, schedule tasklet to process them. * Enable the interrupt only when there is no pending frames in diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c index efb9da70e4d3..913714cb016b 100644 --- a/hif/src/hif_napi.c +++ b/hif/src/hif_napi.c @@ -428,7 +428,7 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx, struct napi_struct *napi, int cpu = smp_processor_id(); struct hif_softc *hif = HIF_GET_SOFTC(hif_ctx); struct qca_napi_info *napi_info; - struct CE_state *ce_state; + struct CE_state *ce_state = NULL; NAPI_DEBUG("%s -->(.., budget=%d)", budget); @@ -466,7 +466,7 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx, struct napi_struct *napi, NAPI_DEBUG("%s:%d: nothing processed by CE. Completing NAPI", __func__, __LINE__); - if (rc <= HIF_NAPI_MAX_RECEIVES) { + if ((ce_state != NULL && !ce_check_rx_pending(ce_state)) || 0 == rc) { napi_info->stats[cpu].napi_completes++; /* enable interrupts */ napi_complete(napi);