qcacld-3.0: Adjust tx retries stats on some platforms

On some platforms with TQM, target don't know packet number of
successfully transmitted after more than one retransmission attempt,
and after TQM retry, host data path will be notified.

Adjust tx retries stats number from data path, and indicate to upper
layer when query by wlan_hdd_cfg80211_get_station() on these platforms,
other platforms keep tx retries from wmi vdev stats.

Change-Id: Ie4b9a9f3b9241a59452e3f21f68757f3638b1a19
CRs-Fixed: 2574368
This commit is contained in:
Will Huang 2019-12-05 13:12:07 +08:00 committed by nshrivas
parent 884cb04714
commit 136ca8d298
4 changed files with 93 additions and 3 deletions

1
Kbuild
View File

@ -2718,6 +2718,7 @@ cppflags-$(CONFIG_LITHIUM) += -DFEATURE_AST
cppflags-$(CONFIG_LITHIUM) += -DPEER_PROTECTED_ACCESS
cppflags-$(CONFIG_LITHIUM) += -DSERIALIZE_QUEUE_SETUP
cppflags-$(CONFIG_LITHIUM) += -DDP_RX_PKT_NO_PEER_DELIVER
cppflags-$(CONFIG_LITHIUM) += -DFEATURE_ALIGN_STATS_FROM_DP
cppflags-$(CONFIG_VERBOSE_DEBUG) += -DENABLE_VERBOSE_DEBUG
cppflags-$(CONFIG_RX_DESC_DEBUG_CHECK) += -DRX_DESC_DEBUG_CHECK
cppflags-$(CONFIG_REGISTER_OP_DEBUG) += -DHAL_REGISTER_WRITE_DEBUG

View File

@ -73,6 +73,15 @@ enum cds_driver_state {
CDS_DRIVER_STATE_MODULE_STOPPING = BIT(6),
};
/**
* struce cds_vdev_dp_stats - vdev stats populated from DP
* @tx_retries: packet number of successfully transmitted after more
* than one retransmission attempt
*/
struct cds_vdev_dp_stats {
uint32_t tx_retries;
};
#define __CDS_IS_DRIVER_STATE(_state, _mask) (((_state) & (_mask)) == (_mask))
void cds_set_driver_state(enum cds_driver_state);
@ -502,6 +511,23 @@ uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context);
void cds_incr_arp_stats_tx_tgt_delivered(void);
void cds_incr_arp_stats_tx_tgt_acked(void);
#ifdef FEATURE_ALIGN_STATS_FROM_DP
/**
* cds_dp_get_vdev_stats() - get vdev stats from DP
* @vdev_id: vdev id
* @stats: structure of counters which CP is interested in
*
* Return: if get vdev stats from DP success, return true otherwise false
*/
bool cds_dp_get_vdev_stats(uint8_t vdev_id, struct cds_vdev_dp_stats *stats);
#else
static inline bool
cds_dp_get_vdev_stats(uint8_t vdev_id, struct cds_vdev_dp_stats *stats)
{
return false;
}
#endif
/**
* cds_smmu_mem_map_setup() - Check SMMU S1 stage enable
* status and setup wlan driver

View File

@ -57,6 +57,7 @@
#include <ol_defines.h>
#include <dispatcher_init_deinit.h>
#include <cdp_txrx_handle.h>
#include <cdp_txrx_host_stats.h>
#include "target_type.h"
#include "wlan_ocb_ucfg_api.h"
#include "wlan_ipa_ucfg_api.h"
@ -2760,6 +2761,53 @@ void cds_incr_arp_stats_tx_tgt_acked(void)
adapter->hdd_stats.hdd_arp_stats.tx_ack_cnt++;
}
#ifdef FEATURE_ALIGN_STATS_FROM_DP
/**
* cds_get_cdp_vdev_stats() - Function which retrieves cdp vdev stats
* @vdev_id: vdev id
* @vdev_stats: cdp vdev stats retrieves from DP
*
* Return: If get cdp vdev stats success return true, otherwise return false
*/
static bool
cds_get_cdp_vdev_stats(uint8_t vdev_id, struct cdp_vdev_stats *vdev_stats)
{
void *soc;
struct cdp_pdev *pdev;
struct cdp_vdev *vdev;
if (!vdev_stats)
return false;
if (cds_get_datapath_handles(&soc, &pdev, &vdev, vdev_id))
return false;
if (cdp_host_get_vdev_stats(soc, vdev, vdev_stats, true))
return false;
return true;
}
bool
cds_dp_get_vdev_stats(uint8_t vdev_id, struct cds_vdev_dp_stats *stats)
{
struct cdp_vdev_stats *vdev_stats;
bool ret = false;
vdev_stats = qdf_mem_malloc(sizeof(*vdev_stats));
if (!vdev_stats)
return false;
if (cds_get_cdp_vdev_stats(vdev_id, vdev_stats)) {
stats->tx_retries = vdev_stats->tx.retries;
ret = true;
}
qdf_mem_free(vdev_stats);
return ret;
}
#endif
#ifdef ENABLE_SMMU_S1_TRANSLATION
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)

View File

@ -3073,13 +3073,17 @@ wlan_hdd_cfg80211_stats_ext2_callback(hdd_handle_t hdd_handle,
* wlan_hdd_fill_summary_stats() - populate station_info summary stats
* @stats: summary stats to use as a source
* @info: kernel station_info struct to use as a destination
* @vdev_id: stats get from which vdev id
*
* Return: None
*/
static void wlan_hdd_fill_summary_stats(tCsrSummaryStatsInfo *stats,
struct station_info *info)
struct station_info *info,
uint8_t vdev_id)
{
int i;
struct cds_vdev_dp_stats dp_stats;
uint32_t orig_cnt;
info->rx_packets = stats->rx_frm_cnt;
info->tx_packets = 0;
@ -3092,6 +3096,13 @@ static void wlan_hdd_fill_summary_stats(tCsrSummaryStatsInfo *stats,
info->tx_failed += stats->fail_cnt[i];
}
if (cds_dp_get_vdev_stats(vdev_id, &dp_stats)) {
orig_cnt = info->tx_retries;
info->tx_retries = dp_stats.tx_retries;
hdd_debug("vdev %d tx retries adjust from %d to %d",
vdev_id, orig_cnt, info->tx_retries);
}
info->filled |= HDD_INFO_TX_PACKETS |
HDD_INFO_TX_RETRIES |
HDD_INFO_TX_FAILED |
@ -3120,7 +3131,9 @@ wlan_hdd_get_sap_stats(struct hdd_adapter *adapter, struct station_info *info)
return ret;
}
wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat, info);
wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat,
info,
adapter->vdev_id);
return 0;
}
@ -4599,7 +4612,9 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
rx_nss, rx_dcm, rx_gi);
}
wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat, sinfo);
wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat,
sinfo,
adapter->vdev_id);
sinfo->tx_bytes = adapter->stats.tx_bytes;
sinfo->rx_bytes = adapter->stats.rx_bytes;
sinfo->rx_packets = adapter->stats.rx_packets;