qcacmn: Dump flow pool stats as part of periodic stats display
Dump flow pool stats even for low verbosity level as part of periodic stats display. Change-Id: Iea59d20b0a81cfd0bfdac65ad54a11fa33f30f2f CRs-Fixed: 3031168
This commit is contained in:

committed by
Madan Koyyalamudi

parent
719e90b6dc
commit
ccb6664db1
@@ -2267,8 +2267,20 @@ void dp_vdev_peer_stats_update_protocol_cnt_tx(struct dp_vdev *vdev_hdl,
|
|||||||
|
|
||||||
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
|
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
|
||||||
void dp_tx_dump_flow_pool_info(struct cdp_soc_t *soc_hdl);
|
void dp_tx_dump_flow_pool_info(struct cdp_soc_t *soc_hdl);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_tx_dump_flow_pool_info_compact() - dump flow pool info
|
||||||
|
* @soc: DP soc context
|
||||||
|
*
|
||||||
|
* Return: none
|
||||||
|
*/
|
||||||
|
void dp_tx_dump_flow_pool_info_compact(struct dp_soc *soc);
|
||||||
int dp_tx_delete_flow_pool(struct dp_soc *soc, struct dp_tx_desc_pool_s *pool,
|
int dp_tx_delete_flow_pool(struct dp_soc *soc, struct dp_tx_desc_pool_s *pool,
|
||||||
bool force);
|
bool force);
|
||||||
|
#else
|
||||||
|
static inline void dp_tx_dump_flow_pool_info_compact(struct dp_soc *soc)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
|
#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
|
||||||
|
|
||||||
#ifdef QCA_OL_DP_SRNG_LOCK_LESS_ACCESS
|
#ifdef QCA_OL_DP_SRNG_LOCK_LESS_ACCESS
|
||||||
|
@@ -7475,7 +7475,7 @@ static struct cdp_cfg *dp_get_ctrl_pdev_from_vdev_wifi3(
|
|||||||
*
|
*
|
||||||
* Return: outstanding tx
|
* Return: outstanding tx
|
||||||
*/
|
*/
|
||||||
static uint32_t dp_get_tx_pending(struct cdp_pdev *pdev_handle)
|
static int32_t dp_get_tx_pending(struct cdp_pdev *pdev_handle)
|
||||||
{
|
{
|
||||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||||
|
|
||||||
@@ -9564,6 +9564,8 @@ static QDF_STATUS dp_txrx_dump_stats(struct cdp_soc_t *psoc, uint16_t value,
|
|||||||
case CDP_DUMP_TX_FLOW_POOL_INFO:
|
case CDP_DUMP_TX_FLOW_POOL_INFO:
|
||||||
if (level == QDF_STATS_VERBOSITY_LEVEL_HIGH)
|
if (level == QDF_STATS_VERBOSITY_LEVEL_HIGH)
|
||||||
cdp_dump_flow_pool_info((struct cdp_soc_t *)soc);
|
cdp_dump_flow_pool_info((struct cdp_soc_t *)soc);
|
||||||
|
else
|
||||||
|
dp_tx_dump_flow_pool_info_compact(soc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDP_DP_NAPI_STATS:
|
case CDP_DP_NAPI_STATS:
|
||||||
@@ -10899,6 +10901,7 @@ static QDF_STATUS dp_runtime_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
|||||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||||
struct dp_pdev *pdev;
|
struct dp_pdev *pdev;
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
int32_t tx_pending;
|
||||||
|
|
||||||
pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||||
if (!pdev) {
|
if (!pdev) {
|
||||||
@@ -10907,8 +10910,10 @@ static QDF_STATUS dp_runtime_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Abort if there are any pending TX packets */
|
/* Abort if there are any pending TX packets */
|
||||||
if (dp_get_tx_pending(dp_pdev_to_cdp_pdev(pdev)) > 0) {
|
tx_pending = dp_get_tx_pending(dp_pdev_to_cdp_pdev(pdev));
|
||||||
dp_init_info("%pK: Abort suspend due to pending TX packets", soc);
|
if (tx_pending) {
|
||||||
|
dp_init_info("%pK: Abort suspend due to pending TX packets %d",
|
||||||
|
soc, tx_pending);
|
||||||
|
|
||||||
/* perform a force flush if tx is pending */
|
/* perform a force flush if tx is pending */
|
||||||
for (i = 0; i < soc->num_tcl_data_rings; i++) {
|
for (i = 0; i < soc->num_tcl_data_rings; i++) {
|
||||||
@@ -11376,6 +11381,7 @@ static QDF_STATUS dp_bus_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
|||||||
struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||||
int timeout = SUSPEND_DRAIN_WAIT;
|
int timeout = SUSPEND_DRAIN_WAIT;
|
||||||
int drain_wait_delay = 50; /* 50 ms */
|
int drain_wait_delay = 50; /* 50 ms */
|
||||||
|
int32_t tx_pending;
|
||||||
|
|
||||||
if (qdf_unlikely(!pdev)) {
|
if (qdf_unlikely(!pdev)) {
|
||||||
dp_err("pdev is NULL");
|
dp_err("pdev is NULL");
|
||||||
@@ -11383,10 +11389,11 @@ static QDF_STATUS dp_bus_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Abort if there are any pending TX packets */
|
/* Abort if there are any pending TX packets */
|
||||||
while (dp_get_tx_pending((struct cdp_pdev *)pdev) > 0) {
|
while ((tx_pending = dp_get_tx_pending((struct cdp_pdev *)pdev))) {
|
||||||
qdf_sleep(drain_wait_delay);
|
qdf_sleep(drain_wait_delay);
|
||||||
if (timeout <= 0) {
|
if (timeout <= 0) {
|
||||||
dp_err("TX frames are pending, abort suspend");
|
dp_info("TX frames are pending %d, abort suspend",
|
||||||
|
tx_pending);
|
||||||
return QDF_STATUS_E_TIMEOUT;
|
return QDF_STATUS_E_TIMEOUT;
|
||||||
}
|
}
|
||||||
timeout = timeout - drain_wait_delay;
|
timeout = timeout - drain_wait_delay;
|
||||||
|
@@ -5959,6 +5959,8 @@ void dp_txrx_path_stats(struct dp_soc *soc)
|
|||||||
pdev->stats.tx.dropped.fw_rem_notx);
|
pdev->stats.tx.dropped.fw_rem_notx);
|
||||||
DP_PRINT_STATS("Invalid peer on tx path: %u",
|
DP_PRINT_STATS("Invalid peer on tx path: %u",
|
||||||
pdev->soc->stats.tx.tx_invalid_peer.num);
|
pdev->soc->stats.tx.tx_invalid_peer.num);
|
||||||
|
DP_PRINT_STATS("Tx desc freed in non-completion path: %u",
|
||||||
|
pdev->soc->stats.tx.tx_comp_exception);
|
||||||
|
|
||||||
DP_PRINT_STATS("Tx packets sent per interrupt:");
|
DP_PRINT_STATS("Tx packets sent per interrupt:");
|
||||||
DP_PRINT_STATS("Single Packet: %u",
|
DP_PRINT_STATS("Single Packet: %u",
|
||||||
|
@@ -4702,6 +4702,7 @@ more_data:
|
|||||||
!tx_desc->flags)) {
|
!tx_desc->flags)) {
|
||||||
dp_tx_comp_info_rl("Descriptor freed in vdev_detach %d",
|
dp_tx_comp_info_rl("Descriptor freed in vdev_detach %d",
|
||||||
tx_desc->id);
|
tx_desc->id);
|
||||||
|
DP_STATS_INC(soc, tx.tx_comp_exception, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2015-2021 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -29,6 +29,8 @@
|
|||||||
#include "dp_internal.h"
|
#include "dp_internal.h"
|
||||||
#define INVALID_FLOW_ID 0xFF
|
#define INVALID_FLOW_ID 0xFF
|
||||||
#define MAX_INVALID_BIN 3
|
#define MAX_INVALID_BIN 3
|
||||||
|
#define GLOBAL_FLOW_POOL_STATS_LEN 25
|
||||||
|
#define FLOW_POOL_LOG_LEN 50
|
||||||
|
|
||||||
#ifdef QCA_AC_BASED_FLOW_CONTROL
|
#ifdef QCA_AC_BASED_FLOW_CONTROL
|
||||||
/**
|
/**
|
||||||
@@ -222,6 +224,46 @@ void dp_tx_dump_flow_pool_info(struct cdp_soc_t *soc_hdl)
|
|||||||
qdf_spin_unlock_bh(&soc->flow_pool_array_lock);
|
qdf_spin_unlock_bh(&soc->flow_pool_array_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dp_tx_dump_flow_pool_info_compact(struct dp_soc *soc)
|
||||||
|
{
|
||||||
|
struct dp_txrx_pool_stats *pool_stats = &soc->pool_stats;
|
||||||
|
struct dp_tx_desc_pool_s *pool = NULL;
|
||||||
|
char *comb_log_str;
|
||||||
|
uint32_t comb_log_str_size;
|
||||||
|
int bytes_written = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
comb_log_str_size = GLOBAL_FLOW_POOL_STATS_LEN +
|
||||||
|
(FLOW_POOL_LOG_LEN * MAX_TXDESC_POOLS) + 1;
|
||||||
|
comb_log_str = qdf_mem_malloc(comb_log_str_size);
|
||||||
|
if (!comb_log_str)
|
||||||
|
return;
|
||||||
|
|
||||||
|
bytes_written = qdf_snprintf(&comb_log_str[bytes_written],
|
||||||
|
comb_log_str_size, "G:(%d,%d,%d) ",
|
||||||
|
pool_stats->pool_map_count,
|
||||||
|
pool_stats->pool_unmap_count,
|
||||||
|
pool_stats->pkt_drop_no_pool);
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_TXDESC_POOLS; i++) {
|
||||||
|
pool = &soc->tx_desc[i];
|
||||||
|
if (pool->status > FLOW_POOL_INVALID)
|
||||||
|
continue;
|
||||||
|
bytes_written += qdf_snprintf(&comb_log_str[bytes_written],
|
||||||
|
(bytes_written >= comb_log_str_size) ? 0 :
|
||||||
|
comb_log_str_size - bytes_written,
|
||||||
|
"| %d %d: (%d,%d,%d)",
|
||||||
|
pool->flow_pool_id, pool->status,
|
||||||
|
pool->pool_size, pool->avail_desc,
|
||||||
|
pool->pkt_drop_no_desc);
|
||||||
|
}
|
||||||
|
|
||||||
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||||
|
"FLOW_POOL_STATS %s", comb_log_str);
|
||||||
|
|
||||||
|
qdf_mem_free(comb_log_str);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_tx_clear_flow_pool_stats() - clear flow pool statistics
|
* dp_tx_clear_flow_pool_stats() - clear flow pool statistics
|
||||||
*
|
*
|
||||||
|
@@ -948,6 +948,8 @@ struct dp_soc_stats {
|
|||||||
uint32_t tx_comp_loop_pkt_limit_hit;
|
uint32_t tx_comp_loop_pkt_limit_hit;
|
||||||
/* Head pointer Out of sync at the end of dp_tx_comp_handler */
|
/* Head pointer Out of sync at the end of dp_tx_comp_handler */
|
||||||
uint32_t hp_oos2;
|
uint32_t hp_oos2;
|
||||||
|
/* tx desc freed as part of vdev detach */
|
||||||
|
uint32_t tx_comp_exception;
|
||||||
} tx;
|
} tx;
|
||||||
|
|
||||||
/* SOC level RX stats */
|
/* SOC level RX stats */
|
||||||
|
@@ -1143,7 +1143,7 @@ enum qdf_dp_tx_rx_status qdf_dp_get_status_from_a_status(uint8_t status)
|
|||||||
|
|
||||||
void qdf_trace_display(void);
|
void qdf_trace_display(void);
|
||||||
|
|
||||||
void __printf(3, 4) qdf_snprintf(char *str_buffer, unsigned int size,
|
int __printf(3, 4) qdf_snprintf(char *str_buffer, unsigned int size,
|
||||||
char *str_format, ...);
|
char *str_format, ...);
|
||||||
|
|
||||||
#define QDF_SNPRINTF qdf_snprintf
|
#define QDF_SNPRINTF qdf_snprintf
|
||||||
|
@@ -135,15 +135,18 @@ static char qdf_module_param[QDF_PARAM_MAX][QDF_PARAM_STR_LENGTH] = {
|
|||||||
* string contains printf-like replacement parameters, which follow
|
* string contains printf-like replacement parameters, which follow
|
||||||
* this parameter in the variable argument list.
|
* this parameter in the variable argument list.
|
||||||
*
|
*
|
||||||
* Return: None
|
* Return: num of bytes written to buffer
|
||||||
*/
|
*/
|
||||||
void qdf_snprintf(char *str_buffer, unsigned int size, char *str_format, ...)
|
int qdf_snprintf(char *str_buffer, unsigned int size, char *str_format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
int i;
|
||||||
|
|
||||||
va_start(args, str_format);
|
va_start(args, str_format);
|
||||||
vsnprintf(str_buffer, size, str_format, args);
|
i = vsnprintf(str_buffer, size, str_format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
qdf_export_symbol(qdf_snprintf);
|
qdf_export_symbol(qdf_snprintf);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user