qcacmn: Add support to configure rbm id through ini

For legacy tx monitor, we need msdu completion in sequence.
Modifying the return buffer manager id during enqueue will serialize
the msdu completion.

Return buffer manager will be over ride only when tx_monitor
is turned enabled.

Change-Id: I500065077b59b3ea3561ec8fc49af8cbe58c1dfe
CRs-Fixed: 3539636
This commit is contained in:
nobelj
2023-06-23 17:28:51 -07:00
committed by Rahul Choudhary
parent 0ef7402a2b
commit 6f8e9cffb0
5 changed files with 104 additions and 0 deletions

View File

@@ -848,12 +848,26 @@ static inline void dp_tx_get_queue(struct dp_vdev *vdev,
} }
#endif #endif
#else #else
#ifdef WLAN_TX_PKT_CAPTURE_ENH
static inline void dp_tx_get_queue(struct dp_vdev *vdev,
qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
{
if (qdf_unlikely(vdev->is_override_rbm_id))
queue->ring_id = vdev->rbm_id;
else
queue->ring_id = qdf_get_cpu();
queue->desc_pool_id = queue->ring_id;
}
#else
static inline void dp_tx_get_queue(struct dp_vdev *vdev, static inline void dp_tx_get_queue(struct dp_vdev *vdev,
qdf_nbuf_t nbuf, struct dp_tx_queue *queue) qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
{ {
queue->ring_id = qdf_get_cpu(); queue->ring_id = qdf_get_cpu();
queue->desc_pool_id = queue->ring_id; queue->desc_pool_id = queue->ring_id;
} }
#endif
#endif #endif
/** /**

View File

@@ -4088,6 +4088,13 @@ struct dp_vdev {
#endif #endif
/* QDF VDEV operating mode */ /* QDF VDEV operating mode */
enum QDF_OPMODE qdf_opmode; enum QDF_OPMODE qdf_opmode;
#ifdef WLAN_TX_PKT_CAPTURE_ENH
/* TX capture feature to over ride return buffer manager */
bool is_override_rbm_id;
/* Return buffer manager ID */
uint8_t rbm_id;
#endif
}; };
enum { enum {

View File

@@ -528,6 +528,13 @@
#define WLAN_CFG_SAWF_STATS_MAX 0x7 #define WLAN_CFG_SAWF_STATS_MAX 0x7
#endif #endif
#define WLAN_CFG_TX_CAPT_RBM_ID_MIN 0
#define WLAN_CFG_TX_CAPT_RBM_ID_MAX 3
#define WLAN_CFG_TX_CAPT_0_RBM_DEFAULT 0
#define WLAN_CFG_TX_CAPT_1_RBM_DEFAULT 1
#define WLAN_CFG_TX_CAPT_2_RBM_DEFAULT 2
#define WLAN_CFG_TX_CAPT_3_RBM_DEFAULT 3
/* /*
* <ini> * <ini>
* "dp_tx_capt_max_mem_mb"- maximum memory used by Tx capture * "dp_tx_capt_max_mem_mb"- maximum memory used by Tx capture
@@ -550,6 +557,34 @@
WLAN_CFG_TX_CAPT_MAX_MEM_DEFAULT, \ WLAN_CFG_TX_CAPT_MAX_MEM_DEFAULT, \
CFG_VALUE_OR_DEFAULT, "Max Memory (in MB) used by Tx Capture") CFG_VALUE_OR_DEFAULT, "Max Memory (in MB) used by Tx Capture")
#define CFG_DP_TX_CAPT_RADIO_0_RBM_ID \
CFG_INI_UINT("dp_tx_capt_pdev_0_rbm_id", \
WLAN_CFG_TX_CAPT_RBM_ID_MIN, \
WLAN_CFG_TX_CAPT_RBM_ID_MAX, \
WLAN_CFG_TX_CAPT_0_RBM_DEFAULT, \
CFG_VALUE_OR_DEFAULT, "RBM_ID used by pdev 0 Tx capture")
#define CFG_DP_TX_CAPT_RADIO_1_RBM_ID \
CFG_INI_UINT("dp_tx_capt_pdev_1_rbm_id", \
WLAN_CFG_TX_CAPT_RBM_ID_MIN, \
WLAN_CFG_TX_CAPT_RBM_ID_MAX, \
WLAN_CFG_TX_CAPT_1_RBM_DEFAULT, \
CFG_VALUE_OR_DEFAULT, "RBM_ID used by pdev 1 Tx capture")
#define CFG_DP_TX_CAPT_RADIO_2_RBM_ID \
CFG_INI_UINT("dp_tx_capt_pdev_2_rbm_id", \
WLAN_CFG_TX_CAPT_RBM_ID_MIN, \
WLAN_CFG_TX_CAPT_RBM_ID_MAX, \
WLAN_CFG_TX_CAPT_2_RBM_DEFAULT, \
CFG_VALUE_OR_DEFAULT, "RBM_ID used by pdev 2 Tx capture")
#define CFG_DP_TX_CAPT_RADIO_3_RBM_ID \
CFG_INI_UINT("dp_tx_capt_pdev_3_rbm_id", \
WLAN_CFG_TX_CAPT_RBM_ID_MIN, \
WLAN_CFG_TX_CAPT_RBM_ID_MAX, \
WLAN_CFG_TX_CAPT_3_RBM_DEFAULT, \
CFG_VALUE_OR_DEFAULT, "RBM_ID used by pdev 3 Tx capture")
/* DP INI Declarations */ /* DP INI Declarations */
#define CFG_DP_HTT_PACKET_TYPE \ #define CFG_DP_HTT_PACKET_TYPE \
CFG_INI_UINT("dp_htt_packet_type", \ CFG_INI_UINT("dp_htt_packet_type", \
@@ -2089,5 +2124,9 @@
CFG_DP_LOCAL_PKT_CAPTURE_CONFIG \ CFG_DP_LOCAL_PKT_CAPTURE_CONFIG \
CFG(CFG_SPECIAL_FRAME_MSK) \ CFG(CFG_SPECIAL_FRAME_MSK) \
CFG(CFG_DP_SW2RXDMA_LINK_RING) \ CFG(CFG_DP_SW2RXDMA_LINK_RING) \
CFG(CFG_DP_TX_CAPT_RADIO_0_RBM_ID) \
CFG(CFG_DP_TX_CAPT_RADIO_1_RBM_ID) \
CFG(CFG_DP_TX_CAPT_RADIO_2_RBM_ID) \
CFG(CFG_DP_TX_CAPT_RADIO_3_RBM_ID) \
CFG_DP_UMAC_RESET_BUFFER_WINDOW_CFG CFG_DP_UMAC_RESET_BUFFER_WINDOW_CFG
#endif /* _CFG_DP_H_ */ #endif /* _CFG_DP_H_ */

View File

@@ -3858,8 +3858,30 @@ wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
{ {
int i = 0;
uint8_t rbm_id = 0;
wlan_cfg_ctx->tx_capt_max_mem_allowed = wlan_cfg_ctx->tx_capt_max_mem_allowed =
cfg_get(psoc, CFG_DP_TX_CAPT_MAX_MEM_MB) * 1024 * 1024; cfg_get(psoc, CFG_DP_TX_CAPT_MAX_MEM_MB) * 1024 * 1024;
for (i = 0; i < MAX_PDEV_CNT; i++) {
switch (i) {
case 0:
rbm_id = cfg_get(psoc, CFG_DP_TX_CAPT_RADIO_0_RBM_ID);
break;
case 1:
rbm_id = cfg_get(psoc, CFG_DP_TX_CAPT_RADIO_1_RBM_ID);
break;
case 2:
rbm_id = cfg_get(psoc, CFG_DP_TX_CAPT_RADIO_2_RBM_ID);
break;
default:
rbm_id = cfg_get(psoc, CFG_DP_TX_CAPT_RADIO_3_RBM_ID);
break;
}
wlan_cfg_ctx->tx_capt_rbm_id[i] = rbm_id;
}
} }
#else #else
static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,

View File

@@ -330,6 +330,7 @@ struct wlan_srng_cfg {
* @txmon_sw_peer_filtering: TxMON sw peer filtering support * @txmon_sw_peer_filtering: TxMON sw peer filtering support
* @num_rxdma_status_rings_per_pdev: Num RXDMA status rings * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings
* @tx_capt_max_mem_allowed: Max memory for Tx packet capture * @tx_capt_max_mem_allowed: Max memory for Tx packet capture
* @tx_capt_rbm_id: Return Buffer Manager ID to be used for Tx packet capture
* @sawf_enabled: Is SAWF enabled * @sawf_enabled: Is SAWF enabled
* @sawf_stats: SAWF Statistics * @sawf_stats: SAWF Statistics
* @mpdu_retry_threshold_1: MPDU retry threshold 1 to increment tx bad count * @mpdu_retry_threshold_1: MPDU retry threshold 1 to increment tx bad count
@@ -532,6 +533,7 @@ struct wlan_cfg_dp_soc_ctxt {
uint8_t num_rxdma_status_rings_per_pdev; uint8_t num_rxdma_status_rings_per_pdev;
#ifdef WLAN_TX_PKT_CAPTURE_ENH #ifdef WLAN_TX_PKT_CAPTURE_ENH
uint32_t tx_capt_max_mem_allowed; uint32_t tx_capt_max_mem_allowed;
uint8_t tx_capt_rbm_id[MAX_PDEV_CNT];
#endif #endif
#ifdef CONFIG_SAWF #ifdef CONFIG_SAWF
bool sawf_enabled; bool sawf_enabled;
@@ -2579,6 +2581,26 @@ wlan_cfg_get_tx_capt_max_mem(struct wlan_cfg_dp_soc_ctxt *cfg)
{ {
return cfg->tx_capt_max_mem_allowed; return cfg->tx_capt_max_mem_allowed;
} }
/**
* wlan_cfg_get_tx_capt_rbm_id - Get RBM_ID to be used for tx capture feature
* @cfg: Configuration Handle
* @idx: Pdev_id
*
* Return: Return Buffer manager id to be used
*/
static inline int
wlan_cfg_get_tx_capt_rbm_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint8_t idx)
{
if (idx >= MAX_PDEV_CNT) {
qdf_err("!!! pdev index is greater than expected");
qdf_assert(0);
/* resetting idx to zero */
idx = 0;
}
return cfg->tx_capt_rbm_id[idx];
}
#endif /* WLAN_TX_PKT_CAPTURE_ENH */ #endif /* WLAN_TX_PKT_CAPTURE_ENH */
#ifdef DP_TX_PACKET_INSPECT_FOR_ILP #ifdef DP_TX_PACKET_INSPECT_FOR_ILP