qcacmn: Retrieve per PPDU phy tx duration
Add support to retrieve per PPDU phy tx duration without response time. Add support to retrieve per User phy tx duration for MU-MIMO and OFDMA. These metrics are useful for ATF stats feature. Stats processing done only if atf stats flag is set. CRs-Fixed: 2709102 Change-Id: I90db41aa45843808e07343a80750c154abbde9cd
This commit is contained in:
@@ -1019,6 +1019,7 @@ enum cdp_peer_param_type {
|
|||||||
* @CDP_MONITOR_CHANNEL: monitor channel
|
* @CDP_MONITOR_CHANNEL: monitor channel
|
||||||
* @CDP_MONITOR_FREQUENCY: monitor frequency
|
* @CDP_MONITOR_FREQUENCY: monitor frequency
|
||||||
* @CDP_CONFIG_BSS_COLOR: configure bss color
|
* @CDP_CONFIG_BSS_COLOR: configure bss color
|
||||||
|
* @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
|
||||||
*/
|
*/
|
||||||
enum cdp_pdev_param_type {
|
enum cdp_pdev_param_type {
|
||||||
CDP_CONFIG_DEBUG_SNIFFER,
|
CDP_CONFIG_DEBUG_SNIFFER,
|
||||||
@@ -1048,6 +1049,7 @@ enum cdp_pdev_param_type {
|
|||||||
CDP_MONITOR_CHANNEL,
|
CDP_MONITOR_CHANNEL,
|
||||||
CDP_MONITOR_FREQUENCY,
|
CDP_MONITOR_FREQUENCY,
|
||||||
CDP_CONFIG_BSS_COLOR,
|
CDP_CONFIG_BSS_COLOR,
|
||||||
|
CDP_SET_ATF_STATS_ENABLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1104,6 +1106,7 @@ enum cdp_pdev_param_type {
|
|||||||
* @cdp_pdev_param_fltr_mcast: filter multicast data
|
* @cdp_pdev_param_fltr_mcast: filter multicast data
|
||||||
* @cdp_pdev_param_fltr_none: filter no data
|
* @cdp_pdev_param_fltr_none: filter no data
|
||||||
* @cdp_pdev_param_monitor_chan: monitor channel
|
* @cdp_pdev_param_monitor_chan: monitor channel
|
||||||
|
* @cdp_pdev_param_atf_stats_enable: ATF stats enable
|
||||||
*
|
*
|
||||||
* @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
|
* @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
|
||||||
* @cdp_psoc_param_en_nss_cfg: set nss cfg
|
* @cdp_psoc_param_en_nss_cfg: set nss cfg
|
||||||
@@ -1165,6 +1168,7 @@ typedef union cdp_config_param_t {
|
|||||||
uint32_t cdp_pdev_param_osif_drop;
|
uint32_t cdp_pdev_param_osif_drop;
|
||||||
uint32_t cdp_pdev_param_en_perpkt_txstats;
|
uint32_t cdp_pdev_param_en_perpkt_txstats;
|
||||||
uint32_t cdp_pdev_param_tx_pending;
|
uint32_t cdp_pdev_param_tx_pending;
|
||||||
|
bool cdp_pdev_param_atf_stats_enable;
|
||||||
|
|
||||||
/* psoc params */
|
/* psoc params */
|
||||||
bool cdp_psoc_param_en_rate_stats;
|
bool cdp_psoc_param_en_rate_stats;
|
||||||
@@ -1613,6 +1617,7 @@ struct cdp_delayed_tx_completion_ppdu_user {
|
|||||||
* @mon_procd: to indicate user processed in ppdu of the sched cmd
|
* @mon_procd: to indicate user processed in ppdu of the sched cmd
|
||||||
* @debug_copied: flag to indicate bar frame copied
|
* @debug_copied: flag to indicate bar frame copied
|
||||||
* @peer_last_delayed_ba: flag to indicate peer last delayed ba
|
* @peer_last_delayed_ba: flag to indicate peer last delayed ba
|
||||||
|
* @phy_tx_time_us: Phy TX duration for the User
|
||||||
*/
|
*/
|
||||||
struct cdp_tx_completion_ppdu_user {
|
struct cdp_tx_completion_ppdu_user {
|
||||||
uint32_t completion_status:8,
|
uint32_t completion_status:8,
|
||||||
@@ -1708,6 +1713,8 @@ struct cdp_tx_completion_ppdu_user {
|
|||||||
bool mon_procd;
|
bool mon_procd;
|
||||||
bool debug_copied;
|
bool debug_copied;
|
||||||
bool peer_last_delayed_ba;
|
bool peer_last_delayed_ba;
|
||||||
|
|
||||||
|
uint16_t phy_tx_time_us;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1853,12 +1860,15 @@ struct cdp_tx_mgmt_comp_info {
|
|||||||
* @bss_color: 6 bit value for full bss color
|
* @bss_color: 6 bit value for full bss color
|
||||||
* @doppler: value for doppler (will be 0 most of the times)
|
* @doppler: value for doppler (will be 0 most of the times)
|
||||||
* @spatial_reuse: value for spatial reuse used in radiotap HE header
|
* @spatial_reuse: value for spatial reuse used in radiotap HE header
|
||||||
|
* @usr_nss_sum: Sum of user nss
|
||||||
|
* @usr_ru_tones_sum: Sum of user ru_tones
|
||||||
* @bar_ppdu_id: BAR ppdu_id
|
* @bar_ppdu_id: BAR ppdu_id
|
||||||
* @bar_tx_duration: BAR tx duration
|
* @bar_tx_duration: BAR tx duration
|
||||||
* @bar_ppdu_start_timestamp: BAR start timestamp
|
* @bar_ppdu_start_timestamp: BAR start timestamp
|
||||||
* @bar_ppdu_end_timestamp: BAR end timestamp
|
* @bar_ppdu_end_timestamp: BAR end timestamp
|
||||||
* @tlv_bitmap: tlv_bitmap for the PPDU
|
* @tlv_bitmap: tlv_bitmap for the PPDU
|
||||||
* @sched_cmdid: schedule command id
|
* @sched_cmdid: schedule command id
|
||||||
|
* @phy_ppdu_tx_time_us: Phy per PPDU TX duration
|
||||||
* @user: per-User stats (array of per-user structures)
|
* @user: per-User stats (array of per-user structures)
|
||||||
*/
|
*/
|
||||||
struct cdp_tx_completion_ppdu {
|
struct cdp_tx_completion_ppdu {
|
||||||
@@ -1894,12 +1904,15 @@ struct cdp_tx_completion_ppdu {
|
|||||||
uint8_t bss_color;
|
uint8_t bss_color;
|
||||||
uint8_t doppler;
|
uint8_t doppler;
|
||||||
uint8_t spatial_reuse;
|
uint8_t spatial_reuse;
|
||||||
|
uint8_t usr_nss_sum;
|
||||||
|
uint32_t usr_ru_tones_sum;
|
||||||
uint32_t bar_ppdu_id;
|
uint32_t bar_ppdu_id;
|
||||||
uint32_t bar_tx_duration;
|
uint32_t bar_tx_duration;
|
||||||
uint32_t bar_ppdu_start_timestamp;
|
uint32_t bar_ppdu_start_timestamp;
|
||||||
uint32_t bar_ppdu_end_timestamp;
|
uint32_t bar_ppdu_end_timestamp;
|
||||||
uint32_t tlv_bitmap;
|
uint32_t tlv_bitmap;
|
||||||
uint16_t sched_cmdid;
|
uint16_t sched_cmdid;
|
||||||
|
uint16_t phy_ppdu_tx_time_us;
|
||||||
struct cdp_tx_completion_ppdu_user user[];
|
struct cdp_tx_completion_ppdu_user user[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -2274,6 +2274,8 @@ static void dp_process_ppdu_stats_common_tlv(struct dp_pdev *pdev,
|
|||||||
ppdu_desc->phy_mode = HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_GET(*tag_buf);
|
ppdu_desc->phy_mode = HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_GET(*tag_buf);
|
||||||
|
|
||||||
tag_buf = start_tag_buf + HTT_GET_STATS_CMN_INDEX(RESV_NUM_UL_BEAM);
|
tag_buf = start_tag_buf + HTT_GET_STATS_CMN_INDEX(RESV_NUM_UL_BEAM);
|
||||||
|
ppdu_desc->phy_ppdu_tx_time_us =
|
||||||
|
HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_GET(*tag_buf);
|
||||||
ppdu_desc->beam_change =
|
ppdu_desc->beam_change =
|
||||||
HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_GET(*tag_buf);
|
HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_GET(*tag_buf);
|
||||||
ppdu_desc->doppler =
|
ppdu_desc->doppler =
|
||||||
@@ -2481,6 +2483,7 @@ static void dp_process_ppdu_stats_user_rate_tlv(struct dp_pdev *pdev,
|
|||||||
ppdu_user_desc->ru_tones =
|
ppdu_user_desc->ru_tones =
|
||||||
(HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(*tag_buf) -
|
(HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(*tag_buf) -
|
||||||
HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(*tag_buf)) + 1;
|
HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(*tag_buf)) + 1;
|
||||||
|
ppdu_desc->usr_ru_tones_sum += ppdu_user_desc->ru_tones;
|
||||||
|
|
||||||
tag_buf += 2;
|
tag_buf += 2;
|
||||||
|
|
||||||
@@ -2501,6 +2504,7 @@ static void dp_process_ppdu_stats_user_rate_tlv(struct dp_pdev *pdev,
|
|||||||
ppdu_user_desc->bw =
|
ppdu_user_desc->bw =
|
||||||
HTT_PPDU_STATS_USER_RATE_TLV_BW_GET(*tag_buf) - 2;
|
HTT_PPDU_STATS_USER_RATE_TLV_BW_GET(*tag_buf) - 2;
|
||||||
ppdu_user_desc->nss = HTT_PPDU_STATS_USER_RATE_TLV_NSS_GET(*tag_buf);
|
ppdu_user_desc->nss = HTT_PPDU_STATS_USER_RATE_TLV_NSS_GET(*tag_buf);
|
||||||
|
ppdu_desc->usr_nss_sum += ppdu_user_desc->nss;
|
||||||
ppdu_user_desc->mcs = HTT_PPDU_STATS_USER_RATE_TLV_MCS_GET(*tag_buf);
|
ppdu_user_desc->mcs = HTT_PPDU_STATS_USER_RATE_TLV_MCS_GET(*tag_buf);
|
||||||
ppdu_user_desc->preamble =
|
ppdu_user_desc->preamble =
|
||||||
HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_GET(*tag_buf);
|
HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_GET(*tag_buf);
|
||||||
@@ -3401,6 +3405,52 @@ static void dp_process_ppdu_tag(struct dp_pdev *pdev, uint32_t *tag_buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WLAN_ATF_ENABLE
|
||||||
|
static void
|
||||||
|
dp_ppdu_desc_user_phy_tx_time_update(struct dp_pdev *pdev,
|
||||||
|
struct cdp_tx_completion_ppdu *ppdu_desc,
|
||||||
|
struct cdp_tx_completion_ppdu_user *user)
|
||||||
|
{
|
||||||
|
uint32_t nss_ru_width_sum = 0;
|
||||||
|
|
||||||
|
if (!pdev || !ppdu_desc || !user)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!pdev->dp_atf_stats_enable)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ppdu_desc->frame_type != CDP_PPDU_FTYPE_DATA)
|
||||||
|
return;
|
||||||
|
|
||||||
|
nss_ru_width_sum = ppdu_desc->usr_nss_sum * ppdu_desc->usr_ru_tones_sum;
|
||||||
|
if (!nss_ru_width_sum)
|
||||||
|
nss_ru_width_sum = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For SU-MIMO PPDU phy Tx time is same for the single user.
|
||||||
|
* For MU-MIMO phy Tx time is calculated per user as below
|
||||||
|
* user phy tx time =
|
||||||
|
* Entire PPDU duration * MU Ratio * OFDMA Ratio
|
||||||
|
* MU Ratio = usr_nss / Sum_of_nss_of_all_users
|
||||||
|
* OFDMA_ratio = usr_ru_width / Sum_of_ru_width_of_all_users
|
||||||
|
* usr_ru_widt = ru_end – ru_start + 1
|
||||||
|
*/
|
||||||
|
if (ppdu_desc->htt_frame_type == HTT_STATS_FTYPE_TIDQ_DATA_SU) {
|
||||||
|
user->phy_tx_time_us = ppdu_desc->phy_ppdu_tx_time_us;
|
||||||
|
} else {
|
||||||
|
user->phy_tx_time_us = (ppdu_desc->phy_ppdu_tx_time_us *
|
||||||
|
user->nss * user->ru_tones) / nss_ru_width_sum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static void
|
||||||
|
dp_ppdu_desc_user_phy_tx_time_update(struct dp_pdev *pdev,
|
||||||
|
struct cdp_tx_completion_ppdu *ppdu_desc,
|
||||||
|
struct cdp_tx_completion_ppdu_user *user)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_ppdu_desc_user_stats_update(): Function to update TX user stats
|
* dp_ppdu_desc_user_stats_update(): Function to update TX user stats
|
||||||
* @pdev: DP pdev handle
|
* @pdev: DP pdev handle
|
||||||
@@ -3442,6 +3492,7 @@ dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev,
|
|||||||
} else {
|
} else {
|
||||||
num_users = ppdu_desc->num_users;
|
num_users = ppdu_desc->num_users;
|
||||||
}
|
}
|
||||||
|
qdf_assert_always(ppdu_desc->num_users <= ppdu_desc->max_users);
|
||||||
|
|
||||||
for (i = 0; i < num_users; i++) {
|
for (i = 0; i < num_users; i++) {
|
||||||
ppdu_desc->num_mpdu += ppdu_desc->user[i].num_mpdu;
|
ppdu_desc->num_mpdu += ppdu_desc->user[i].num_mpdu;
|
||||||
@@ -3499,6 +3550,9 @@ dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev,
|
|||||||
dp_tx_rate_stats_update(peer, &ppdu_desc->user[i]);
|
dp_tx_rate_stats_update(peer, &ppdu_desc->user[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dp_ppdu_desc_user_phy_tx_time_update(pdev, ppdu_desc,
|
||||||
|
&ppdu_desc->user[i]);
|
||||||
|
|
||||||
dp_peer_unref_delete(peer);
|
dp_peer_unref_delete(peer);
|
||||||
tlv_bitmap_expected = tlv_bitmap_default;
|
tlv_bitmap_expected = tlv_bitmap_default;
|
||||||
}
|
}
|
||||||
|
@@ -7920,6 +7920,23 @@ static QDF_STATUS dp_get_peer_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WLAN_ATF_ENABLE
|
||||||
|
static void dp_set_atf_stats_enable(struct dp_pdev *pdev, bool value)
|
||||||
|
{
|
||||||
|
if (!pdev) {
|
||||||
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
|
"Invalid pdev");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pdev->dp_atf_stats_enable = value;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static void dp_set_atf_stats_enable(struct dp_pdev *pdev, bool value)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dp_set_peer_param: function to set parameters in peer
|
* dp_set_peer_param: function to set parameters in peer
|
||||||
* @cdp_soc: DP soc handle
|
* @cdp_soc: DP soc handle
|
||||||
@@ -8103,6 +8120,10 @@ static QDF_STATUS dp_set_pdev_param(struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
|
|||||||
case CDP_CONFIG_BSS_COLOR:
|
case CDP_CONFIG_BSS_COLOR:
|
||||||
dp_mon_set_bsscolor(pdev, val.cdp_pdev_param_bss_color);
|
dp_mon_set_bsscolor(pdev, val.cdp_pdev_param_bss_color);
|
||||||
break;
|
break;
|
||||||
|
case CDP_SET_ATF_STATS_ENABLE:
|
||||||
|
dp_set_atf_stats_enable(pdev,
|
||||||
|
val.cdp_pdev_param_atf_stats_enable);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return QDF_STATUS_E_INVAL;
|
return QDF_STATUS_E_INVAL;
|
||||||
}
|
}
|
||||||
|
@@ -2032,6 +2032,11 @@ struct dp_pdev {
|
|||||||
/* Flag to hold on to monitor destination ring */
|
/* Flag to hold on to monitor destination ring */
|
||||||
bool hold_mon_dest_ring;
|
bool hold_mon_dest_ring;
|
||||||
|
|
||||||
|
#ifdef WLAN_ATF_ENABLE
|
||||||
|
/* ATF stats enable */
|
||||||
|
bool dp_atf_stats_enable;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Maintains first status buffer's paddr of a PPDU */
|
/* Maintains first status buffer's paddr of a PPDU */
|
||||||
uint64_t status_buf_addr;
|
uint64_t status_buf_addr;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user