From f64cf6e11b5db7febef4a23c7ef56d4824f852d1 Mon Sep 17 00:00:00 2001 From: Vivek Date: Fri, 10 Jun 2022 09:51:56 +0530 Subject: [PATCH] qcacmn: Add CDP ops to get SAWF stats from telemetry agent The telemetry agent on certain intervals needs to pull the SAWF stats from the driver. Add CDP ops to pull the SAWF stats from the driver. CRs-Fixed: 3210834 Change-Id: Ibc27059ff13b33acc4e71d3174a0415756dcfc5e --- dp/inc/cdp_txrx_ops.h | 14 +++++++++ dp/inc/cdp_txrx_sawf.h | 65 ++++++++++++++++++++++++++++++++++++++++++ dp/wifi3.0/dp_main.c | 3 ++ 3 files changed, 82 insertions(+) diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 842ee74bf9..4de9d170d7 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -2074,6 +2074,20 @@ struct cdp_sawf_ops { (*txrx_sawf_set_sla_params)(uint32_t num_pkt, uint32_t time_secs); QDF_STATUS (*txrx_sawf_init_telemtery_params)(void); + QDF_STATUS + (*telemetry_get_throughput_stats)(void *arg, uint64_t *in_bytes, + uint64_t *in_cnt, uint64_t *tx_bytes, + uint64_t *tx_cnt, uint8_t tid, + uint8_t msduq); + QDF_STATUS + (*telemetry_get_mpdu_stats)(void *arg, uint64_t *svc_int_pass, + uint64_t *svc_int_fail, + uint64_t *burst_pass, uint64_t *burst_fail, + uint8_t tid, uint8_t msduq); + QDF_STATUS + (*telemetry_get_drop_stats)(void *arg, uint64_t *pass, uint64_t *drop, + uint64_t *drop_ttl, uint8_t tid, + uint8_t msduq); #endif }; #endif diff --git a/dp/inc/cdp_txrx_sawf.h b/dp/inc/cdp_txrx_sawf.h index df306b0f6f..d302ef49c3 100644 --- a/dp/inc/cdp_txrx_sawf.h +++ b/dp/inc/cdp_txrx_sawf.h @@ -19,6 +19,9 @@ #ifndef _CDP_TXRX_SAWF_H_ #define _CDP_TXRX_SAWF_H_ +#include +#include + static inline QDF_STATUS cdp_sawf_peer_svcid_map(ol_txrx_soc_handle soc, uint8_t *mac, uint8_t svc_id) @@ -247,6 +250,68 @@ cdp_sawf_init_telemtery_params(ol_txrx_soc_handle soc) return soc->ops->sawf_ops->txrx_sawf_init_telemtery_params(); } +static inline QDF_STATUS +cdp_get_throughput_stats(ol_txrx_soc_handle soc, void *arg, + uint64_t *in_bytes, uint64_t *in_cnt, + uint64_t *tx_bytes, uint64_t *tx_cnt, + uint8_t tid, uint8_t msduq) +{ + if (!soc || !soc->ops) { + dp_cdp_debug("Invalid Instance"); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->sawf_ops || + !soc->ops->sawf_ops->telemetry_get_throughput_stats) + return QDF_STATUS_E_FAILURE; + + return soc->ops->sawf_ops->telemetry_get_throughput_stats( + arg, in_bytes, in_cnt, tx_bytes, + tx_cnt, tid, msduq); +} + +static inline QDF_STATUS +cdp_get_mpdu_stats(ol_txrx_soc_handle soc, void *arg, + uint64_t *svc_int_pass, uint64_t *svc_int_fail, + uint64_t *burst_pass, uint64_t *burst_fail, + uint8_t tid, uint8_t msduq) +{ + if (!soc || !soc->ops) { + dp_cdp_debug("Invalid Instance"); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->sawf_ops || + !soc->ops->sawf_ops->telemetry_get_mpdu_stats) + return QDF_STATUS_E_FAILURE; + + return soc->ops->sawf_ops->telemetry_get_mpdu_stats( + arg, svc_int_pass, svc_int_fail, burst_pass, + burst_fail, tid, msduq); +} + +static inline QDF_STATUS +cdp_get_drop_stats(ol_txrx_soc_handle soc, void *arg, + uint64_t *pass, uint64_t *drop, + uint64_t *drop_ttl, + uint8_t tid, uint8_t msduq) +{ + if (!soc || !soc->ops) { + dp_cdp_debug("Invalid Instance"); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->sawf_ops || + !soc->ops->sawf_ops->telemetry_get_drop_stats) + return QDF_STATUS_E_FAILURE; + + return soc->ops->sawf_ops->telemetry_get_drop_stats( + arg, pass, drop, drop_ttl, tid, msduq); +} + #else static inline QDF_STATUS cdp_get_peer_sawf_delay_stats(ol_txrx_soc_handle soc, uint32_t svc_id, diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index d841324183..b7eac74f91 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -12793,6 +12793,9 @@ static struct cdp_sawf_ops dp_ops_sawf = { .txrx_sawf_set_mov_avg_params = dp_sawf_set_mov_avg_params, .txrx_sawf_set_sla_params = dp_sawf_set_sla_params, .txrx_sawf_init_telemtery_params = dp_sawf_init_telemetry_params, + .telemetry_get_throughput_stats = dp_sawf_get_tx_stats, + .telemetry_get_mpdu_stats = dp_sawf_get_mpdu_sched_stats, + .telemetry_get_drop_stats = dp_sawf_get_drop_stats, #endif }; #endif