qcacmn: Memory stats for SKB usage and Tx desc cnt in datapath
Add sysfs node for DP level memory stats: /sys/kernel/wifi/wlan/wlan_dp_mem_stats These include Tx, Rx SKB memory allocated, Tx/Rx buffer count, outstanding Tx desc count. Change-Id: I839a5f2ec4e763ca11cdea2093368ca6dc52d8cf CRs-Fixed: 2724460
This commit is contained in:
@@ -74,6 +74,34 @@ static const uint8_t sec_type_map[MAX_CDP_SEC_TYPE] = {
|
||||
HAL_TX_ENCRYPT_TYPE_AES_GCMP_256,
|
||||
HAL_TX_ENCRYPT_TYPE_WAPI_GCM_SM4};
|
||||
|
||||
#ifdef CONFIG_WLAN_SYSFS_MEM_STATS
|
||||
/**
|
||||
* dp_update_tx_desc_stats - Update the increase or decrease in
|
||||
* outstanding tx desc count
|
||||
* values on pdev and soc
|
||||
* @vdev: DP pdev handle
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void
|
||||
dp_update_tx_desc_stats(struct dp_pdev *pdev)
|
||||
{
|
||||
int32_t tx_descs_cnt =
|
||||
qdf_atomic_read(&pdev->num_tx_outstanding);
|
||||
if (pdev->tx_descs_max < tx_descs_cnt)
|
||||
pdev->tx_descs_max = tx_descs_cnt;
|
||||
qdf_mem_tx_desc_cnt_update(pdev->num_tx_outstanding,
|
||||
pdev->tx_descs_max);
|
||||
}
|
||||
|
||||
#else /* CONFIG_WLAN_SYSFS_MEM_STATS */
|
||||
|
||||
static inline void
|
||||
dp_update_tx_desc_stats(struct dp_pdev *pdev)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_WLAN_SYSFS_MEM_STATS */
|
||||
|
||||
#ifdef QCA_TX_LIMIT_CHECK
|
||||
/**
|
||||
* dp_tx_limit_check - Check if allocated tx descriptors reached
|
||||
@@ -146,6 +174,7 @@ dp_tx_outstanding_inc(struct dp_pdev *pdev)
|
||||
|
||||
qdf_atomic_inc(&pdev->num_tx_outstanding);
|
||||
qdf_atomic_inc(&soc->num_tx_outstanding);
|
||||
dp_update_tx_desc_stats(pdev);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,6 +190,7 @@ dp_tx_outstanding_dec(struct dp_pdev *pdev)
|
||||
|
||||
qdf_atomic_dec(&pdev->num_tx_outstanding);
|
||||
qdf_atomic_dec(&soc->num_tx_outstanding);
|
||||
dp_update_tx_desc_stats(pdev);
|
||||
}
|
||||
|
||||
#else //QCA_TX_LIMIT_CHECK
|
||||
@@ -180,12 +210,14 @@ static inline void
|
||||
dp_tx_outstanding_inc(struct dp_pdev *pdev)
|
||||
{
|
||||
qdf_atomic_inc(&pdev->num_tx_outstanding);
|
||||
dp_update_tx_desc_stats(pdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_tx_outstanding_dec(struct dp_pdev *pdev)
|
||||
{
|
||||
qdf_atomic_dec(&pdev->num_tx_outstanding);
|
||||
dp_update_tx_desc_stats(pdev);
|
||||
}
|
||||
#endif //QCA_TX_LIMIT_CHECK
|
||||
|
||||
@@ -5034,7 +5066,7 @@ QDF_STATUS dp_tx_pdev_init(struct dp_pdev *pdev)
|
||||
|
||||
/* Initialize Flow control counters */
|
||||
qdf_atomic_init(&pdev->num_tx_outstanding);
|
||||
|
||||
pdev->tx_descs_max = 0;
|
||||
if (wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
|
||||
/* Initialize descriptors in TCL Ring */
|
||||
hal_tx_init_data_ring(soc->hal_soc,
|
||||
|
مرجع در شماره جدید
Block a user