qcacmn: Allocate memory according to num_users in rx path

Allocating memory according to number of users in rx path

Change-Id: I02ced1772ed04e67dfba5beb87737fcd874fd6da
CRs-Fixed: 3264995
This commit is contained in:
Amrit
2022-08-02 22:33:48 +05:30
committed by Madan Koyyalamudi
parent 322be7253c
commit cbc05e67fe
2 changed files with 9 additions and 4 deletions

View File

@@ -2458,7 +2458,6 @@ struct cdp_rx_indication_ppdu {
struct cdp_rx_su_evm_info evm_info; struct cdp_rx_su_evm_info evm_info;
uint32_t rx_antenna; uint32_t rx_antenna;
uint8_t num_users; uint8_t num_users;
struct cdp_rx_stats_ppdu_user user[CDP_MU_MAX_USERS];
uint32_t nf; uint32_t nf;
uint8_t per_chain_rssi[MAX_CHAIN]; uint8_t per_chain_rssi[MAX_CHAIN];
uint8_t is_mcast_bcast; uint8_t is_mcast_bcast;
@@ -2502,6 +2501,7 @@ struct cdp_rx_indication_ppdu {
#endif #endif
uint8_t usr_nss_sum; uint8_t usr_nss_sum;
uint32_t usr_ru_tones_sum; uint32_t usr_ru_tones_sum;
struct cdp_rx_stats_ppdu_user user[];
}; };
/** /**

View File

@@ -1067,6 +1067,8 @@ dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
qdf_nbuf_t ppdu_nbuf; qdf_nbuf_t ppdu_nbuf;
struct cdp_rx_indication_ppdu *cdp_rx_ppdu; struct cdp_rx_indication_ppdu *cdp_rx_ppdu;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev; struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
uint64_t size = 0;
uint8_t num_users = 0;
/* /*
* Do not allocate if fcs error, * Do not allocate if fcs error,
@@ -1123,14 +1125,17 @@ dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
QDF_STATUS_SUCCESS))) QDF_STATUS_SUCCESS)))
return; return;
} }
num_users = ppdu_info->com_info.num_users;
qdf_assert_always(num_users <= CDP_MU_MAX_USERS);
size = sizeof(struct cdp_rx_indication_ppdu) +
num_users * sizeof(struct cdp_rx_stats_ppdu_user);
ppdu_nbuf = qdf_nbuf_alloc(soc->osdev, ppdu_nbuf = qdf_nbuf_alloc(soc->osdev,
sizeof(struct cdp_rx_indication_ppdu), size,
0, 0, FALSE); 0, 0, FALSE);
if (qdf_likely(ppdu_nbuf)) { if (qdf_likely(ppdu_nbuf)) {
cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)qdf_nbuf_data(ppdu_nbuf); cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)qdf_nbuf_data(ppdu_nbuf);
qdf_mem_zero(cdp_rx_ppdu, sizeof(struct cdp_rx_indication_ppdu)); qdf_mem_zero(cdp_rx_ppdu, size);
dp_rx_mon_populate_cfr_info(pdev, ppdu_info, cdp_rx_ppdu); dp_rx_mon_populate_cfr_info(pdev, ppdu_info, cdp_rx_ppdu);
dp_rx_populate_cdp_indication_ppdu(pdev, dp_rx_populate_cdp_indication_ppdu(pdev,
ppdu_info, cdp_rx_ppdu); ppdu_info, cdp_rx_ppdu);