qcacmn: enable FSE with MLO support
from Beryllium onwards a single Flow Search Table will be used across multiple radios. to ensure this a single FST attach is called for the first SOC's pdev and FST detach is called only during last pdev of last SOC. the same FST instance is saved in all pdevs of all the SOCs CRs-Fixed: 3366409 Change-Id: I42fbdc6f09fb902021877e100a2831a1a24bc975
This commit is contained in:

committed by
Madan Koyyalamudi

parent
6bab9eec62
commit
328ea67a32
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2023 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
|
||||
@@ -5788,6 +5788,132 @@ static inline void dp_soc_tx_history_detach(struct dp_soc *soc)
|
||||
}
|
||||
#endif /* WLAN_FEATURE_DP_TX_DESC_HISTORY */
|
||||
|
||||
#ifdef WLAN_SUPPORT_RX_FLOW_TAG
|
||||
/**
|
||||
* dp_rx_fst_attach_wrapper() - wrapper API for dp_rx_fst_attach
|
||||
* @soc: SoC handle
|
||||
* @pdev: Pdev handle
|
||||
*
|
||||
* Return: Handle to flow search table entry
|
||||
*/
|
||||
QDF_STATUS
|
||||
dp_rx_fst_attach_wrapper(struct dp_soc *soc, struct dp_pdev *pdev)
|
||||
{
|
||||
struct dp_rx_fst *rx_fst = NULL;
|
||||
QDF_STATUS ret = QDF_STATUS_SUCCESS;
|
||||
|
||||
/* for Lithium the below API is not registered
|
||||
* hence fst attach happens for each pdev
|
||||
*/
|
||||
if (!soc->arch_ops.dp_get_rx_fst)
|
||||
return dp_rx_fst_attach(soc, pdev);
|
||||
|
||||
rx_fst = soc->arch_ops.dp_get_rx_fst(soc);
|
||||
|
||||
/* for BE the FST attach is called only once per
|
||||
* ML context. if rx_fst is already registered
|
||||
* increase the ref count and return.
|
||||
*/
|
||||
if (rx_fst) {
|
||||
soc->rx_fst = rx_fst;
|
||||
pdev->rx_fst = rx_fst;
|
||||
soc->arch_ops.dp_rx_fst_ref(soc);
|
||||
} else {
|
||||
ret = dp_rx_fst_attach(soc, pdev);
|
||||
if ((ret != QDF_STATUS_SUCCESS) &&
|
||||
(ret != QDF_STATUS_E_NOSUPPORT))
|
||||
return ret;
|
||||
|
||||
soc->arch_ops.dp_set_rx_fst(soc, soc->rx_fst);
|
||||
soc->arch_ops.dp_rx_fst_ref(soc);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_rx_fst_detach_wrapper() - wrapper API for dp_rx_fst_detach
|
||||
* @soc: SoC handle
|
||||
* @pdev: Pdev handle
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void
|
||||
dp_rx_fst_detach_wrapper(struct dp_soc *soc, struct dp_pdev *pdev)
|
||||
{
|
||||
struct dp_rx_fst *rx_fst = NULL;
|
||||
|
||||
/* for Lithium the below API is not registered
|
||||
* hence fst detach happens for each pdev
|
||||
*/
|
||||
if (!soc->arch_ops.dp_get_rx_fst) {
|
||||
dp_rx_fst_detach(soc, pdev);
|
||||
return;
|
||||
}
|
||||
|
||||
rx_fst = soc->arch_ops.dp_get_rx_fst(soc);
|
||||
|
||||
/* for BE the FST detach is called only when last
|
||||
* ref count reaches 1.
|
||||
*/
|
||||
if (rx_fst) {
|
||||
if (soc->arch_ops.dp_rx_fst_deref(soc) == 1)
|
||||
dp_rx_fst_detach(soc, pdev);
|
||||
}
|
||||
pdev->rx_fst = NULL;
|
||||
}
|
||||
#elif defined(WLAN_SUPPORT_RX_FISA)
|
||||
/**
|
||||
* dp_rx_fst_attach_wrapper() - wrapper API for dp_rx_fst_attach
|
||||
* @soc: SoC handle
|
||||
* @pdev: Pdev handle
|
||||
*
|
||||
* Return: Handle to flow search table entry
|
||||
*/
|
||||
QDF_STATUS
|
||||
dp_rx_fst_attach_wrapper(struct dp_soc *soc, struct dp_pdev *pdev)
|
||||
{
|
||||
return dp_rx_fst_attach(soc, pdev);
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_rx_fst_detach_wrapper() - wrapper API for dp_rx_fst_detach
|
||||
* @soc: SoC handle
|
||||
* @pdev: Pdev handle
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void
|
||||
dp_rx_fst_detach_wrapper(struct dp_soc *soc, struct dp_pdev *pdev)
|
||||
{
|
||||
dp_rx_fst_detach(soc, pdev);
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* dp_rx_fst_attach_wrapper() - wrapper API for dp_rx_fst_attach
|
||||
* @soc: SoC handle
|
||||
* @pdev: Pdev handle
|
||||
*
|
||||
* Return: Handle to flow search table entry
|
||||
*/
|
||||
QDF_STATUS
|
||||
dp_rx_fst_attach_wrapper(struct dp_soc *soc, struct dp_pdev *pdev)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_rx_fst_detach_wrapper() - wrapper API for dp_rx_fst_detach
|
||||
* @soc: SoC handle
|
||||
* @pdev: Pdev handle
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void
|
||||
dp_rx_fst_detach_wrapper(struct dp_soc *soc, struct dp_pdev *pdev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* dp_pdev_attach_wifi3() - attach txrx pdev
|
||||
* @txrx_soc: Datapath SOC handle
|
||||
@@ -5805,11 +5931,13 @@ QDF_STATUS dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
||||
uint8_t pdev_id = params->pdev_id;
|
||||
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
|
||||
int nss_cfg;
|
||||
QDF_STATUS ret;
|
||||
|
||||
pdev_context_size =
|
||||
soc->arch_ops.txrx_get_context_size(DP_CONTEXT_TYPE_PDEV);
|
||||
if (pdev_context_size)
|
||||
pdev = dp_context_alloc_mem(soc, DP_PDEV_TYPE, pdev_context_size);
|
||||
pdev = dp_context_alloc_mem(soc, DP_PDEV_TYPE,
|
||||
pdev_context_size);
|
||||
|
||||
if (!pdev) {
|
||||
dp_init_err("%pK: DP PDEV memory allocation failed",
|
||||
@@ -5880,8 +6008,17 @@ QDF_STATUS dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
||||
goto fail6;
|
||||
}
|
||||
|
||||
ret = dp_rx_fst_attach_wrapper(soc, pdev);
|
||||
if ((ret != QDF_STATUS_SUCCESS) && (ret != QDF_STATUS_E_NOSUPPORT)) {
|
||||
dp_init_err("%pK: RX FST attach failed: pdev %d err %d",
|
||||
soc, pdev_id, ret);
|
||||
goto fail7;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
fail7:
|
||||
dp_free_ipa_rx_alt_refill_buf_ring(soc, pdev);
|
||||
fail6:
|
||||
dp_monitor_pdev_detach(pdev);
|
||||
fail5:
|
||||
@@ -6016,7 +6153,6 @@ static void dp_pdev_deinit(struct cdp_pdev *txrx_pdev, int force)
|
||||
return;
|
||||
|
||||
dp_tx_me_exit(pdev);
|
||||
dp_rx_fst_detach(pdev->soc, pdev);
|
||||
dp_rx_pdev_buffers_free(pdev);
|
||||
dp_rx_pdev_desc_pool_deinit(pdev);
|
||||
dp_pdev_bkp_stats_detach(pdev);
|
||||
@@ -6133,6 +6269,7 @@ static void dp_pdev_detach(struct cdp_pdev *txrx_pdev, int force)
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)txrx_pdev;
|
||||
struct dp_soc *soc = pdev->soc;
|
||||
|
||||
dp_rx_fst_detach_wrapper(soc, pdev);
|
||||
dp_pdev_htt_stats_dbgfs_deinit(pdev);
|
||||
dp_rx_pdev_desc_pool_free(pdev);
|
||||
dp_monitor_pdev_detach(pdev);
|
||||
@@ -17109,7 +17246,6 @@ static QDF_STATUS dp_pdev_init(struct cdp_soc_t *txrx_soc,
|
||||
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
|
||||
int nss_cfg;
|
||||
void *sojourn_buf;
|
||||
QDF_STATUS ret;
|
||||
|
||||
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
||||
struct dp_pdev *pdev = soc->pdev_list[pdev_id];
|
||||
@@ -17231,23 +17367,15 @@ static QDF_STATUS dp_pdev_init(struct cdp_soc_t *txrx_soc,
|
||||
goto fail4;
|
||||
}
|
||||
|
||||
ret = dp_rx_fst_attach(soc, pdev);
|
||||
if ((ret != QDF_STATUS_SUCCESS) &&
|
||||
(ret != QDF_STATUS_E_NOSUPPORT)) {
|
||||
dp_init_err("%pK: RX Flow Search Table attach failed: pdev %d err %d",
|
||||
soc, pdev_id, ret);
|
||||
goto fail5;
|
||||
}
|
||||
|
||||
if (dp_pdev_bkp_stats_attach(pdev) != QDF_STATUS_SUCCESS) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("dp_pdev_bkp_stats_attach failed"));
|
||||
goto fail6;
|
||||
goto fail5;
|
||||
}
|
||||
|
||||
if (dp_monitor_pdev_init(pdev)) {
|
||||
dp_init_err("%pK: dp_monitor_pdev_init failed\n", soc);
|
||||
goto fail7;
|
||||
goto fail6;
|
||||
}
|
||||
|
||||
/* initialize sw rx descriptors */
|
||||
@@ -17264,10 +17392,8 @@ static QDF_STATUS dp_pdev_init(struct cdp_soc_t *txrx_soc,
|
||||
qdf_skb_total_mem_stats_read());
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
fail7:
|
||||
dp_pdev_bkp_stats_detach(pdev);
|
||||
fail6:
|
||||
dp_rx_fst_detach(soc, pdev);
|
||||
dp_pdev_bkp_stats_detach(pdev);
|
||||
fail5:
|
||||
dp_ipa_uc_detach(soc, pdev);
|
||||
fail4:
|
||||
|
Reference in New Issue
Block a user