From cf5baf10bf22f6fd770935154ac8d210f3d84dd5 Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Fri, 15 Oct 2021 15:20:56 +0530 Subject: [PATCH] qcacld-3.0: Update tx Failed Count Currently, we are updating tx failed based upon MPDU tx fail count received from FW. In addition to the fail count received from FW add MPDU tx retries done in case of successful transmission to tx failed. Change-Id: Ib993c71a99dd4d59df116a454336716352122a8e CRs-Fixed: 3058364 --- core/cds/inc/cds_api.h | 4 ++++ core/cds/src/cds_api.c | 3 +++ core/hdd/src/wlan_hdd_stats.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 58ccfe78758d..673b2284ec8c 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -79,9 +80,12 @@ enum cds_driver_state { * struce cds_vdev_dp_stats - vdev stats populated from DP * @tx_retries: packet number of successfully transmitted after more * than one retransmission attempt + * @tx_mpdu_success_with_retries: Number of MPDU transmission retries done + * in case of successful transmission. */ struct cds_vdev_dp_stats { uint32_t tx_retries; + uint32_t tx_mpdu_success_with_retries; }; #define __CDS_IS_DRIVER_STATE(_state, _mask) (((_state) & (_mask)) == (_mask)) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index ae2d37821270..8f99a4b81192 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2817,6 +2818,8 @@ cds_dp_get_vdev_stats(uint8_t vdev_id, struct cds_vdev_dp_stats *stats) if (cds_get_cdp_vdev_stats(vdev_id, vdev_stats)) { stats->tx_retries = vdev_stats->tx.retries; + stats->tx_mpdu_success_with_retries = + vdev_stats->tx.mpdu_success_with_retries; ret = true; } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 315ba5f24a3f..026ba84dc9c4 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3820,6 +3821,7 @@ static void wlan_hdd_fill_summary_stats(tCsrSummaryStatsInfo *stats, int i; struct cds_vdev_dp_stats dp_stats; uint32_t orig_cnt; + uint32_t orig_fail_cnt; info->rx_packets = stats->rx_frm_cnt; info->tx_packets = 0; @@ -3834,9 +3836,13 @@ static void wlan_hdd_fill_summary_stats(tCsrSummaryStatsInfo *stats, if (cds_dp_get_vdev_stats(vdev_id, &dp_stats)) { orig_cnt = info->tx_retries; + orig_fail_cnt = info->tx_failed; info->tx_retries = dp_stats.tx_retries; + info->tx_failed += dp_stats.tx_mpdu_success_with_retries; hdd_debug("vdev %d tx retries adjust from %d to %d", vdev_id, orig_cnt, info->tx_retries); + hdd_debug("tx failed adjust from %d to %d", + orig_fail_cnt, info->tx_failed); } info->filled |= HDD_INFO_TX_PACKETS |