diff --git a/dp/wifi3.0/dp_tx.h b/dp/wifi3.0/dp_tx.h index 2af64231a2..937fae321a 100644 --- a/dp/wifi3.0/dp_tx.h +++ b/dp/wifi3.0/dp_tx.h @@ -848,12 +848,26 @@ static inline void dp_tx_get_queue(struct dp_vdev *vdev, } #endif #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, qdf_nbuf_t nbuf, struct dp_tx_queue *queue) { queue->ring_id = qdf_get_cpu(); queue->desc_pool_id = queue->ring_id; } + +#endif #endif /** diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 09386a5c68..398b975d2a 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -4088,6 +4088,13 @@ struct dp_vdev { #endif /* QDF VDEV operating mode */ 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 { diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 60795898fb..a566f9a361 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -528,6 +528,13 @@ #define WLAN_CFG_SAWF_STATS_MAX 0x7 #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 + /* * * "dp_tx_capt_max_mem_mb"- maximum memory used by Tx capture @@ -550,6 +557,34 @@ WLAN_CFG_TX_CAPT_MAX_MEM_DEFAULT, \ 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 */ #define CFG_DP_HTT_PACKET_TYPE \ CFG_INI_UINT("dp_htt_packet_type", \ @@ -2089,5 +2124,9 @@ CFG_DP_LOCAL_PKT_CAPTURE_CONFIG \ CFG(CFG_SPECIAL_FRAME_MSK) \ 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 #endif /* _CFG_DP_H_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 84acae94e5..721e1c00d5 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -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, 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 = 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 static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index cc37967a64..f68f74b370 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -330,6 +330,7 @@ struct wlan_srng_cfg { * @txmon_sw_peer_filtering: TxMON sw peer filtering support * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings * @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_stats: SAWF Statistics * @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; #ifdef WLAN_TX_PKT_CAPTURE_ENH uint32_t tx_capt_max_mem_allowed; + uint8_t tx_capt_rbm_id[MAX_PDEV_CNT]; #endif #ifdef CONFIG_SAWF 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; } + +/** + * 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 */ #ifdef DP_TX_PACKET_INSPECT_FOR_ILP