qcacmn: Featurization of DP_TX_EXT_DESC_POOL_OPTIMIZE

This flag DP_TX_EXT_DESC_POOL_OPTIMIZE if enabled will reduce the number
of ext tx desc pool to 1.

1. Changes done to split the tx_desc and ext_tx_desc pool number
variables in alloc and free path. Based on this flag the reduced
ext_desc_pool count will be returned.

2. In Tx path, since the pool id is selected based on the CPU, changes done
to override the desc_pool_id of ext_desc_pool via new API
dp_tx_ext_desc_pool_override to 0 with which from whatever core the packets
comes from, pool 0 will be chosen for ext_desc.

Change-Id: Iae8bf9952a136ba2c55256d8f305b6d5fbde5d83
CRs-Fixed: 3552532
This commit is contained in:
Hariharan Ramanathan
2023-07-11 18:00:17 +05:30
committed by Rahul Choudhary
parent 68e0b883b4
commit 5ec64fb74d
3 changed files with 75 additions and 19 deletions

View File

@@ -6467,24 +6467,26 @@ static void dp_tx_tso_cmn_desc_pool_free(struct dp_soc *soc, uint8_t num_pool)
#ifndef WLAN_SOFTUMAC_SUPPORT
void dp_soc_tx_desc_sw_pools_free(struct dp_soc *soc)
{
uint8_t num_pool;
uint8_t num_pool, num_ext_pool;
num_pool = wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
num_ext_pool = dp_get_ext_tx_desc_pool_num(soc);
dp_tx_tso_cmn_desc_pool_free(soc, num_pool);
dp_tx_ext_desc_pool_free(soc, num_pool);
dp_tx_ext_desc_pool_free(soc, num_ext_pool);
dp_tx_delete_static_pools(soc, num_pool);
}
void dp_soc_tx_desc_sw_pools_deinit(struct dp_soc *soc)
{
uint8_t num_pool;
uint8_t num_pool, num_ext_pool;
num_pool = wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
num_ext_pool = dp_get_ext_tx_desc_pool_num(soc);
dp_tx_flow_control_deinit(soc);
dp_tx_tso_cmn_desc_pool_deinit(soc, num_pool);
dp_tx_ext_desc_pool_deinit(soc, num_pool);
dp_tx_ext_desc_pool_deinit(soc, num_ext_pool);
dp_tx_deinit_static_pools(soc, num_pool);
}
#else
@@ -6568,36 +6570,38 @@ static QDF_STATUS dp_tx_tso_cmn_desc_pool_init(struct dp_soc *soc,
#ifndef WLAN_SOFTUMAC_SUPPORT
QDF_STATUS dp_soc_tx_desc_sw_pools_alloc(struct dp_soc *soc)
{
uint8_t num_pool;
uint8_t num_pool, num_ext_pool;
uint32_t num_desc;
uint32_t num_ext_desc;
num_pool = wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
num_ext_pool = dp_get_ext_tx_desc_pool_num(soc);
num_desc = wlan_cfg_get_num_tx_desc(soc->wlan_cfg_ctx);
num_ext_desc = wlan_cfg_get_num_tx_ext_desc(soc->wlan_cfg_ctx);
dp_info("Tx Desc Alloc num_pool: %d descs: %d", num_pool, num_desc);
if ((num_pool > MAX_TXDESC_POOLS) ||
(num_ext_pool > MAX_TXDESC_POOLS) ||
(num_desc > WLAN_CFG_NUM_TX_DESC_MAX))
goto fail1;
if (dp_tx_alloc_static_pools(soc, num_pool, num_desc))
goto fail1;
if (dp_tx_ext_desc_pool_alloc(soc, num_pool, num_ext_desc))
if (dp_tx_ext_desc_pool_alloc(soc, num_ext_pool, num_ext_desc))
goto fail2;
if (wlan_cfg_is_tso_desc_attach_defer(soc->wlan_cfg_ctx))
return QDF_STATUS_SUCCESS;
if (dp_tx_tso_cmn_desc_pool_alloc(soc, num_pool, num_ext_desc))
if (dp_tx_tso_cmn_desc_pool_alloc(soc, num_ext_pool, num_ext_desc))
goto fail3;
return QDF_STATUS_SUCCESS;
fail3:
dp_tx_ext_desc_pool_free(soc, num_pool);
dp_tx_ext_desc_pool_free(soc, num_ext_pool);
fail2:
dp_tx_delete_static_pools(soc, num_pool);
fail1:
@@ -6606,24 +6610,25 @@ fail1:
QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc)
{
uint8_t num_pool;
uint8_t num_pool, num_ext_pool;
uint32_t num_desc;
uint32_t num_ext_desc;
num_pool = wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
num_ext_pool = dp_get_ext_tx_desc_pool_num(soc);
num_desc = wlan_cfg_get_num_tx_desc(soc->wlan_cfg_ctx);
num_ext_desc = wlan_cfg_get_num_tx_ext_desc(soc->wlan_cfg_ctx);
if (dp_tx_init_static_pools(soc, num_pool, num_desc))
goto fail1;
if (dp_tx_ext_desc_pool_init(soc, num_pool, num_ext_desc))
if (dp_tx_ext_desc_pool_init(soc, num_ext_pool, num_ext_desc))
goto fail2;
if (wlan_cfg_is_tso_desc_attach_defer(soc->wlan_cfg_ctx))
return QDF_STATUS_SUCCESS;
if (dp_tx_tso_cmn_desc_pool_init(soc, num_pool, num_ext_desc))
if (dp_tx_tso_cmn_desc_pool_init(soc, num_ext_pool, num_ext_desc))
goto fail3;
dp_tx_flow_control_init(soc);
@@ -6631,7 +6636,7 @@ QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc)
return QDF_STATUS_SUCCESS;
fail3:
dp_tx_ext_desc_pool_deinit(soc, num_pool);
dp_tx_ext_desc_pool_deinit(soc, num_ext_pool);
fail2:
dp_tx_deinit_static_pools(soc, num_pool);
fail1:
@@ -6681,16 +6686,16 @@ QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc)
QDF_STATUS dp_tso_soc_attach(struct cdp_soc_t *txrx_soc)
{
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
uint8_t num_pool;
uint8_t num_ext_desc_pool;
uint32_t num_ext_desc;
num_pool = wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
num_ext_desc_pool = dp_get_ext_tx_desc_pool_num(soc);
num_ext_desc = wlan_cfg_get_num_tx_ext_desc(soc->wlan_cfg_ctx);
if (dp_tx_tso_cmn_desc_pool_alloc(soc, num_pool, num_ext_desc))
if (dp_tx_tso_cmn_desc_pool_alloc(soc, num_ext_desc_pool, num_ext_desc))
return QDF_STATUS_E_FAILURE;
if (dp_tx_tso_cmn_desc_pool_init(soc, num_pool, num_ext_desc))
if (dp_tx_tso_cmn_desc_pool_init(soc, num_ext_desc_pool, num_ext_desc))
return QDF_STATUS_E_FAILURE;
return QDF_STATUS_SUCCESS;
@@ -6699,10 +6704,10 @@ QDF_STATUS dp_tso_soc_attach(struct cdp_soc_t *txrx_soc)
QDF_STATUS dp_tso_soc_detach(struct cdp_soc_t *txrx_soc)
{
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
uint8_t num_pool = wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
uint8_t num_ext_desc_pool = dp_get_ext_tx_desc_pool_num(soc);
dp_tx_tso_cmn_desc_pool_deinit(soc, num_pool);
dp_tx_tso_cmn_desc_pool_free(soc, num_pool);
dp_tx_tso_cmn_desc_pool_deinit(soc, num_ext_desc_pool);
dp_tx_tso_cmn_desc_pool_free(soc, num_ext_desc_pool);
return QDF_STATUS_SUCCESS;
}