qcacmn: Fix compilation error when FEATURE_NAPI disabled

Modify hif_update_napi_max_poll_time API to take ce_id instead of
pointer that is defined under feature flag to avoid compilation error.

Change-Id: Iec4a06e816ed1714ec5c00ecdc5a7c6d6eb217e3
CRs-Fixed: 2249802
This commit is contained in:
Kiran Venkatappa
2018-05-24 22:34:46 +05:30
committed by nshrivas
parent 26d9f36f90
commit d4a55e0c77
3 changed files with 34 additions and 17 deletions

View File

@@ -1980,8 +1980,7 @@ more_data:
goto more_data; goto more_data;
} }
hif_update_napi_max_poll_time(ce_state, scn->napi_data.napis[ce_id], hif_update_napi_max_poll_time(ce_state, ce_id, qdf_get_cpu());
qdf_get_cpu());
qdf_atomic_set(&ce_state->rx_pending, 0); qdf_atomic_set(&ce_state->rx_pending, 0);
if (TARGET_REGISTER_ACCESS_ALLOWED(scn)) { if (TARGET_REGISTER_ACCESS_ALLOWED(scn)) {

View File

@@ -952,12 +952,16 @@ out:
qdf_export_symbol(hif_napi_poll); qdf_export_symbol(hif_napi_poll);
void hif_update_napi_max_poll_time(struct CE_state *ce_state, void hif_update_napi_max_poll_time(struct CE_state *ce_state,
struct qca_napi_info *napi_info, int ce_id,
int cpu_id) int cpu_id)
{ {
struct hif_softc *hif;
struct qca_napi_info *napi_info;
unsigned long long napi_poll_time = sched_clock() - unsigned long long napi_poll_time = sched_clock() -
ce_state->ce_service_start_time; ce_state->ce_service_start_time;
hif = ce_state->scn;
napi_info = hif->napi_data.napis[ce_id];
if (napi_poll_time > if (napi_poll_time >
napi_info->stats[cpu_id].napi_max_poll_time) napi_info->stats[cpu_id].napi_max_poll_time)
napi_info->stats[cpu_id].napi_max_poll_time = napi_poll_time; napi_info->stats[cpu_id].napi_max_poll_time = napi_poll_time;
@@ -1014,7 +1018,7 @@ void hif_napi_update_yield_stats(struct CE_state *ce_state,
else else
napi_data->napis[ce_id]->stats[cpu_id].rxpkt_thresh_reached++; napi_data->napis[ce_id]->stats[cpu_id].rxpkt_thresh_reached++;
hif_update_napi_max_poll_time(ce_state, napi_data->napis[ce_id], hif_update_napi_max_poll_time(ce_state, ce_id,
cpu_id); cpu_id);
} }

View File

@@ -184,6 +184,19 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx,
#define HNC_ACT_COLLAPSE (1) #define HNC_ACT_COLLAPSE (1)
#define HNC_ACT_DISPERSE (-1) #define HNC_ACT_DISPERSE (-1)
/**
* hif_update_napi_max_poll_time() - updates NAPI max poll time
* @ce_state: ce state
* @ce_id: Copy engine ID
* @cpu_id: cpu id
*
* This API updates NAPI max poll time per CE per SPU.
*
* Return: void
*/
void hif_update_napi_max_poll_time(struct CE_state *ce_state,
int ce_id,
int cpu_id);
/** /**
* Local interface to HIF implemented functions of NAPI CPU affinity management. * Local interface to HIF implemented functions of NAPI CPU affinity management.
* Note: * Note:
@@ -241,6 +254,20 @@ static inline int hif_napi_schedule(struct hif_opaque_softc *hif, int ce_id)
static inline int hif_napi_poll(struct napi_struct *napi, int budget) static inline int hif_napi_poll(struct napi_struct *napi, int budget)
{ return -EPERM; } { return -EPERM; }
/**
* hif_update_napi_max_poll_time() - updates NAPI max poll time
* @ce_state: ce state
* @ce_id: Copy engine ID
* @cpu_id: cpu id
*
* This API updates NAPI max poll time per CE per SPU.
*
* Return: void
*/
static inline void hif_update_napi_max_poll_time(struct CE_state *ce_state,
int ce_id,
int cpu_id)
{ return; }
#endif /* FEATURE_NAPI */ #endif /* FEATURE_NAPI */
#if defined(HIF_IRQ_AFFINITY) && defined(FEATURE_NAPI) #if defined(HIF_IRQ_AFFINITY) && defined(FEATURE_NAPI)
@@ -286,17 +313,4 @@ static inline int hif_napi_cpu_blacklist(struct qca_napi_data *napid,
{ return 0; } { return 0; }
#endif /* HIF_IRQ_AFFINITY */ #endif /* HIF_IRQ_AFFINITY */
/**
* hif_update_napi_max_poll_time() - updates NAPI max poll time
* @ce_state: ce state
* @napi_info: pointer to napi info structure
* @cpu_id: cpu id
*
* This API updates NAPI max poll time per CE per SPU.
*
* Return: void
*/
void hif_update_napi_max_poll_time(struct CE_state *ce_state,
struct qca_napi_info *napi_info,
int cpu_id);
#endif /* __HIF_NAPI_H__ */ #endif /* __HIF_NAPI_H__ */