qcacmn: Make napi rely on rx_pending flag

Use the rx_pending flag to determine if there is more work.
hif_napi_poll should not rely on the amount of work done
to determine if there is more work to do.

Change-Id: Ibf83cfb8f9aed6fdc3400b6a6945156283f56485
CRs-Fixed: 998319
This commit is contained in:
Houston Hoffman 2016-04-01 12:53:50 -07:00 • committed by Gerrit - the friendly Code Review server
commit eb2516c244
4 changed files with 8 additions and 9 deletions

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -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);