mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
qcacld-3.0: Implement clearStats for TSO and NAPI statistics
Implement missing clearStats for TSO and NAPI statistics. Change-Id: I384a6abcecca8276dadc647e93720e067f324aab CRs-Fixed: 2024016
This commit is contained in:
parent
db5d42b894
commit
1027e8ca6d
4 changed files with 59 additions and 0 deletions
|
|
@ -1124,7 +1124,21 @@ static void ol_txrx_stats_display_tso(ol_txrx_pdev_handle pdev)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ol_txrx_tso_stats_clear(ol_txrx_pdev_handle pdev)
|
||||
{
|
||||
qdf_mem_zero(&pdev->stats.pub.tx.tso.tso_pkts,
|
||||
sizeof(struct ol_txrx_stats_elem));
|
||||
#if defined(FEATURE_TSO)
|
||||
qdf_mem_zero(&pdev->stats.pub.tx.tso.tso_info,
|
||||
sizeof(struct ol_txrx_stats_tso_info));
|
||||
qdf_mem_zero(&pdev->stats.pub.tx.tso.tso_hist,
|
||||
sizeof(struct ol_txrx_tso_histogram));
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void ol_txrx_stats_display_tso(ol_txrx_pdev_handle pdev)
|
||||
{
|
||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||
|
|
@ -1147,6 +1161,13 @@ static void ol_txrx_tso_stats_deinit(ol_txrx_pdev_handle pdev)
|
|||
*/
|
||||
}
|
||||
|
||||
static void ol_txrx_tso_stats_clear(ol_txrx_pdev_handle pdev)
|
||||
{
|
||||
/*
|
||||
* keeping the body empty and not keeping an error print as print will
|
||||
* will show up everytime during driver unload if TSO is not enabled.
|
||||
*/
|
||||
}
|
||||
#endif /* defined(FEATURE_TSO) && defined(FEATURE_TSO_DEBUG) */
|
||||
|
||||
/**
|
||||
|
|
@ -4676,6 +4697,9 @@ static void ol_txrx_clear_stats(uint16_t value)
|
|||
case CDP_TXRX_PATH_STATS:
|
||||
ol_txrx_stats_clear(pdev);
|
||||
break;
|
||||
case CDP_TXRX_TSO_STATS:
|
||||
ol_txrx_tso_stats_clear(pdev);
|
||||
break;
|
||||
case CDP_DUMP_TX_FLOW_POOL_INFO:
|
||||
ol_tx_clear_flow_pool_stats();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ int hdd_napi_enabled(int id);
|
|||
int hdd_napi_create(void);
|
||||
int hdd_napi_destroy(int force);
|
||||
int hdd_display_napi_stats(void);
|
||||
int hdd_clear_napi_stats(void);
|
||||
|
||||
/* the following triggers napi_enable/disable as required */
|
||||
int hdd_napi_event(enum qca_napi_event event, void *data);
|
||||
|
|
@ -88,6 +89,7 @@ static inline int hdd_napi_enabled(int id) { return 0; }
|
|||
static inline int hdd_napi_create(void) { return 0; }
|
||||
static inline int hdd_napi_destroy(int force) { return 0; }
|
||||
static inline int hdd_display_napi_stats(void) { return 0; }
|
||||
static inline int hdd_clear_napi_stats(void) { return 0; }
|
||||
static inline int hdd_napi_event(enum qca_napi_event event, void *data)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -455,3 +455,33 @@ int hdd_display_napi_stats(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_clear_napi_stats() - clear NAPI stats
|
||||
*
|
||||
* Return: == 0: success; !=0: failure
|
||||
*/
|
||||
int hdd_clear_napi_stats(void)
|
||||
{
|
||||
int i, j;
|
||||
struct qca_napi_data *napid;
|
||||
struct qca_napi_info *napii;
|
||||
struct qca_napi_stat *napis;
|
||||
|
||||
napid = hdd_napi_get_all();
|
||||
if (NULL == napid) {
|
||||
hdd_err("%s unable to retrieve napi structure", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
for (i = 0; i < CE_COUNT_MAX; i++)
|
||||
if (napid->ce_map & (0x01 << i)) {
|
||||
napii = napid->napis[i];
|
||||
for (j = 0; j < NR_CPUS; j++) {
|
||||
napis = &(napii->stats[j]);
|
||||
qdf_mem_zero(napis,
|
||||
sizeof(struct qca_napi_stat));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8880,6 +8880,9 @@ static int __iw_setint_getnone(struct net_device *dev,
|
|||
case CDP_HIF_STATS:
|
||||
hdd_clear_hif_stats();
|
||||
break;
|
||||
case CDP_NAPI_STATS:
|
||||
hdd_clear_napi_stats();
|
||||
break;
|
||||
default:
|
||||
cdp_clear_stats(cds_get_context(QDF_MODULE_ID_SOC),
|
||||
set_value);
|
||||
|
|
|
|||
Loading…
Reference in a new issue