diff options
| author | Yun Park <yunp@codeaurora.org> | 2017-03-23 13:58:47 -0700 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2018-01-09 18:34:22 -0800 |
| commit | 2bda75ca02e5099ad1ab3604532eee2dd9d39d9e (patch) | |
| tree | 3333e1cb7106cafe545e70669b32977715a068da | |
| parent | 341bbe88c748b3e8d47c96d57a5ade3f9aaf6b7b (diff) | |
qcacld-3.0: Implement clearStats for TSO and NAPI statistics
Implement missing clearStats for TSO and NAPI statistics.
Change-Id: I384a6abcecca8276dadc647e93720e067f324aab
CRs-Fixed: 2024016
| -rw-r--r-- | core/dp/txrx/ol_txrx.c | 24 | ||||
| -rw-r--r-- | core/hdd/inc/wlan_hdd_napi.h | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_napi.c | 30 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_wext.c | 3 |
4 files changed, 60 insertions, 1 deletions
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 79438eca02de..5beb45521793 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -1162,7 +1162,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, @@ -1185,6 +1199,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) */ /** @@ -4855,6 +4876,9 @@ QDF_STATUS ol_txrx_clear_stats(uint16_t value) case WLAN_TXRX_STATS: ol_txrx_stats_clear(pdev); break; + case WLAN_TXRX_TSO_STATS: + ol_txrx_tso_stats_clear(pdev); + break; case WLAN_DUMP_TX_FLOW_POOL_INFO: ol_tx_clear_flow_pool_stats(); break; diff --git a/core/hdd/inc/wlan_hdd_napi.h b/core/hdd/inc/wlan_hdd_napi.h index 94c15c29e355..ece8d0bb3ef0 100644 --- a/core/hdd/inc/wlan_hdd_napi.h +++ b/core/hdd/inc/wlan_hdd_napi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -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; diff --git a/core/hdd/src/wlan_hdd_napi.c b/core/hdd/src/wlan_hdd_napi.c index b0aabcb0e8c4..aaa5cc193fe2 100644 --- a/core/hdd/src/wlan_hdd_napi.c +++ b/core/hdd/src/wlan_hdd_napi.c @@ -515,3 +515,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; +} diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 9c73ec6a53a9..4a385aa1dd4f 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -8559,6 +8559,9 @@ static int __iw_setint_getnone(struct net_device *dev, case WLAN_HIF_STATS: hdd_clear_hif_stats(); break; + case WLAN_NAPI_STATS: + hdd_clear_napi_stats(); + break; default: if (ol_txrx_clear_stats(set_value) == QDF_STATUS_E_INVAL) { |
