From 9578c2adeca8286fd201687ae42f1d57c61690b4 Mon Sep 17 00:00:00 2001 From: Venkateswara Swamy Bandaru Date: Wed, 10 Oct 2018 19:31:06 +0530 Subject: [PATCH] qcacmn: Fix napi bucket calulation issue In case of fast patch CE_state->receive_count can go beyond HIF_NAPI_MAX_RECEIVES as batch processing is happening. This is causing bucket calculation working. In this case setting receive_count to HIF_NAPI_MAX_RECEIVES as a fix. Change-Id: I3179b6f9f893342ead68e46dc4b75fd55e6c7839 CRs-Fixed: 2331579 --- hif/src/ce/ce_service.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 7e8c392981df..b539aa832176 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -262,6 +262,15 @@ bool hif_ce_service_should_yield(struct hif_softc *scn, struct CE_state *ce_state) { bool yield = hif_max_num_receives_reached(scn, ce_state->receive_count); + + /* Setting receive_count to MAX_NUM_OF_RECEIVES when this count goes + * beyond MAX_NUM_OF_RECEIVES for NAPI backet calulation issue. This + * can happen in fast path handling as processing is happenning in + * batches. + */ + if (yield) + ce_state->receive_count = MAX_NUM_OF_RECEIVES; + return yield; } #else @@ -284,6 +293,14 @@ bool hif_ce_service_should_yield(struct hif_softc *scn, rxpkt_thresh_reached = hif_max_num_receives_reached (scn, ce_state->receive_count); + /* Setting receive_count to MAX_NUM_OF_RECEIVES when this count goes + * beyond MAX_NUM_OF_RECEIVES for NAPI backet calulation issue. This + * can happen in fast path handling as processing is happenning in + * batches. + */ + if (rxpkt_thresh_reached) + ce_state->receive_count = MAX_NUM_OF_RECEIVES; + yield = time_limit_reached || rxpkt_thresh_reached; if (yield && ce_state->htt_rx_data)