diff --git a/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c b/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c index 44f0c44741..3645b2450c 100644 --- a/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c +++ b/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c @@ -1455,8 +1455,10 @@ struct dp_mon_ops monitor_ops_2_0 = { .mon_lite_mon_vdev_delete = dp_lite_mon_vdev_delete, .mon_lite_mon_disable_rx = dp_lite_mon_disable_rx, .mon_lite_mon_is_rx_adv_filter_enable = dp_lite_mon_is_rx_adv_filter_enable, +#ifdef QCA_KMEM_CACHE_SUPPORT .mon_rx_ppdu_info_cache_create = dp_rx_mon_ppdu_info_cache_create, .mon_rx_ppdu_info_cache_destroy = dp_rx_mon_ppdu_info_cache_destroy, +#endif .mon_rx_pdev_tlv_logger_init = dp_mon_pdev_tlv_logger_init, .mon_rx_pdev_tlv_logger_deinit = dp_mon_pdev_tlv_logger_deinit, }; diff --git a/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.c b/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.c index fa343a1a63..daded6ed5e 100644 --- a/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.c +++ b/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.c @@ -41,36 +41,27 @@ #define F_MASK 0xFFFF #define TEST_MASK 0xCBF -#if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) &&\ - defined(WLAN_SUPPORT_RX_TAG_STATISTICS) -/** dp_mon_rx_update_rx_protocol_tag_stats() - Update mon protocols's - * statistics - * @pdev: pdev handle - * @protocol_index: Protocol index for which the stats should be incremented - * @ring_index: REO ring number from which this tag was received. +/** + * dp_rx_mon_free_mpdu_queue() - Free MPDU queue + * @mon_pdev: monitor pdev + * @ppdu_info: PPDU info * - * Return: void + * Return: Void */ -static void dp_mon_rx_update_rx_protocol_tag_stats(struct dp_pdev *pdev, - uint16_t protocol_index) -{ - pdev->mon_proto_tag_stats[protocol_index].tag_ctr++; -} -#ifdef QCA_TEST_MON_PF_TAGS_STATS -static -void dp_rx_mon_print_tag_buf(uint8_t *buf, uint16_t room) +static void dp_rx_mon_free_mpdu_queue(struct dp_mon_pdev *mon_pdev, + struct hal_rx_ppdu_info *ppdu_info) { - print_hex_dump(KERN_ERR, "TLV BUFFER: ", DUMP_PREFIX_NONE, - 32, 2, buf, room, false); -} + uint8_t user; + qdf_nbuf_t mpdu; -#else -static -void dp_rx_mon_print_tag_buf(uint8_t *buf, uint16_t room) -{ + for (user = 0; user < HAL_MAX_UL_MU_USERS; user++) { + if (!qdf_nbuf_is_queue_empty(&ppdu_info->mpdu_q[user])) { + while ((mpdu = qdf_nbuf_queue_remove(&ppdu_info->mpdu_q[user])) != NULL) + dp_mon_free_parent_nbuf(mon_pdev, mpdu); + } + } } -#endif /** * dp_rx_mon_update_drop_cnt() - Update drop statistics @@ -101,6 +92,7 @@ void dp_rx_mon_set_zero(qdf_nbuf_t nbuf) qdf_mem_zero(qdf_nbuf_head(nbuf), DP_RX_MON_TLV_ROOM); } +#ifdef QCA_KMEM_CACHE_SUPPORT /** * dp_rx_mon_get_ppdu_info() - Get PPDU info from freelist * @@ -108,7 +100,7 @@ void dp_rx_mon_set_zero(qdf_nbuf_t nbuf) * * Return: ppdu_info */ -static inline struct hal_rx_ppdu_info* +struct hal_rx_ppdu_info* dp_rx_mon_get_ppdu_info(struct dp_mon_pdev *mon_pdev) { struct dp_mon_pdev_be *mon_pdev_be = @@ -133,7 +125,7 @@ dp_rx_mon_get_ppdu_info(struct dp_mon_pdev *mon_pdev) return ppdu_info; } -static inline void +void __dp_rx_mon_free_ppdu_info(struct dp_mon_pdev *mon_pdev, struct hal_rx_ppdu_info *ppdu_info) { @@ -149,6 +141,25 @@ __dp_rx_mon_free_ppdu_info(struct dp_mon_pdev *mon_pdev, qdf_spin_unlock_bh(&mon_pdev_be->ppdu_info_lock); } +/** + * dp_rx_mon_free_ppdu_info() - Free PPDU info + * @pdev: DP pdev + * @ppdu_info: PPDU info + * + * Return: Void + */ +void +dp_rx_mon_free_ppdu_info(struct dp_pdev *pdev, + struct hal_rx_ppdu_info *ppdu_info) +{ + struct dp_mon_pdev *mon_pdev; + + mon_pdev = (struct dp_mon_pdev *)pdev->monitor_pdev; + dp_rx_mon_free_mpdu_queue(mon_pdev, ppdu_info); + __dp_rx_mon_free_ppdu_info(mon_pdev, ppdu_info); +} +#endif + /** * dp_rx_mon_nbuf_add_rx_frag() - Add frag to SKB * @@ -180,6 +191,38 @@ dp_rx_mon_nbuf_add_rx_frag(qdf_nbuf_t nbuf, qdf_frag_t *frag, return QDF_STATUS_E_FAILURE; } +#if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) &&\ + defined(WLAN_SUPPORT_RX_TAG_STATISTICS) +/** dp_mon_rx_update_rx_protocol_tag_stats() - Update mon protocols's + * statistics + * @pdev: pdev handle + * @protocol_index: Protocol index for which the stats should be incremented + * @ring_index: REO ring number from which this tag was received. + * + * Return: void + */ +static void dp_mon_rx_update_rx_protocol_tag_stats(struct dp_pdev *pdev, + uint16_t protocol_index) +{ + pdev->mon_proto_tag_stats[protocol_index].tag_ctr++; +} + +#ifdef QCA_TEST_MON_PF_TAGS_STATS + +static +void dp_rx_mon_print_tag_buf(uint8_t *buf, uint16_t room) +{ + print_hex_dump(KERN_ERR, "TLV BUFFER: ", DUMP_PREFIX_NONE, + 32, 2, buf, room, false); +} + +#else +static +void dp_rx_mon_print_tag_buf(uint8_t *buf, uint16_t room) +{ +} +#endif + void dp_rx_mon_shift_pf_tag_in_headroom(qdf_nbuf_t nbuf, struct dp_soc *soc, struct hal_rx_ppdu_info *ppdu_info) @@ -342,36 +385,6 @@ dp_mon_rx_update_rx_protocol_tag_stats(struct dp_pdev *pdev, { } -static inline void -dp_rx_mon_update_drop_cnt(struct dp_mon_pdev *mon_pdev, - struct hal_mon_desc *hal_mon_rx_desc) -{ -} - -static inline void dp_rx_mon_set_zero(qdf_nbuf_t nbuf) -{ -} - -static inline QDF_STATUS -dp_rx_mon_nbuf_add_rx_frag(qdf_nbuf_t nbuf, qdf_frag_t *frag, - uint16_t frag_len, uint16_t offset, - uint16_t buf_size, bool frag_ref) -{ - return QDF_STATUS_SUCCESS; -} - -static inline struct hal_rx_ppdu_info* -dp_rx_mon_get_ppdu_info(struct dp_mon_pdev *mon_pdev) -{ - return NULL; -} - -static inline void -__dp_rx_mon_free_ppdu_info(struct dp_mon_pdev *mon_pdev, - struct hal_rx_ppdu_info *ppdu_info) -{ -} - static inline void dp_rx_mon_shift_pf_tag_in_headroom(qdf_nbuf_t nbuf, struct dp_soc *soc, struct hal_rx_ppdu_info *ppdu_info) @@ -631,46 +644,6 @@ void dp_mon_free_parent_nbuf(struct dp_mon_pdev *mon_pdev, qdf_nbuf_free(nbuf); } -/** - * dp_rx_mon_free_mpdu_queue() - Free MPDU queue - * @mon_pdev: monitor pdev - * @ppdu_info: PPDU info - * - * Return: Void - */ - -static void dp_rx_mon_free_mpdu_queue(struct dp_mon_pdev *mon_pdev, - struct hal_rx_ppdu_info *ppdu_info) -{ - uint8_t user; - qdf_nbuf_t mpdu; - - for (user = 0; user < HAL_MAX_UL_MU_USERS; user++) { - if (!qdf_nbuf_is_queue_empty(&ppdu_info->mpdu_q[user])) { - while ((mpdu = qdf_nbuf_queue_remove(&ppdu_info->mpdu_q[user])) != NULL) - dp_mon_free_parent_nbuf(mon_pdev, mpdu); - } - } -} - -/** - * dp_rx_mon_free_ppdu_info() - Free PPDU info - * @pdev: DP pdev - * @ppdu_info: PPDU info - * - * Return: Void - */ -static void -dp_rx_mon_free_ppdu_info(struct dp_pdev *pdev, - struct hal_rx_ppdu_info *ppdu_info) -{ - struct dp_mon_pdev *mon_pdev; - - mon_pdev = (struct dp_mon_pdev *)pdev->monitor_pdev; - dp_rx_mon_free_mpdu_queue(mon_pdev, ppdu_info); - __dp_rx_mon_free_ppdu_info(mon_pdev, ppdu_info); -} - void dp_rx_mon_drain_wq(struct dp_pdev *pdev) { struct dp_mon_pdev *mon_pdev; @@ -2338,6 +2311,7 @@ dp_rx_mon_process_2_0(struct dp_soc *soc, struct dp_intr *int_ctx, return work_done; } +#ifdef QCA_KMEM_CACHE_SUPPORT QDF_STATUS dp_rx_mon_ppdu_info_cache_create(struct dp_pdev *pdev) { struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev; @@ -2395,6 +2369,7 @@ void dp_rx_mon_ppdu_info_cache_destroy(struct dp_pdev *pdev) dp_mon_debug(" total free element: %d", mon_pdev_be->total_free_elem); qdf_kmem_cache_destroy(mon_pdev_be->ppdu_info_cache); } +#endif /** * dp_mon_pdev_ext_init_2_0() - Init pdev ext param diff --git a/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.h b/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.h index a51f15055d..7b09d7bb19 100644 --- a/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.h +++ b/dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.h @@ -56,8 +56,45 @@ #ifdef WLAN_PKT_CAPTURE_RX_2_0 QDF_STATUS dp_mon_pdev_ext_init_2_0(struct dp_pdev *pdev); QDF_STATUS dp_mon_pdev_ext_deinit_2_0(struct dp_pdev *pdev); +#ifdef QCA_KMEM_CACHE_SUPPORT QDF_STATUS dp_rx_mon_ppdu_info_cache_create(struct dp_pdev *pdev); void dp_rx_mon_ppdu_info_cache_destroy(struct dp_pdev *pdev); +struct hal_rx_ppdu_info* +dp_rx_mon_get_ppdu_info(struct dp_mon_pdev *mon_pdev); +void +dp_rx_mon_free_ppdu_info(struct dp_pdev *pdev, + struct hal_rx_ppdu_info *ppdu_info); +void +__dp_rx_mon_free_ppdu_info(struct dp_mon_pdev *mon_pdev, + struct hal_rx_ppdu_info *ppdu_info); +#else +static inline QDF_STATUS dp_rx_mon_ppdu_info_cache_create(struct dp_pdev *pdev) +{ + return QDF_STATUS_SUCCESS; +} + +static inline void dp_rx_mon_ppdu_info_cache_destroy(struct dp_pdev *pdev) +{ +} + +static inline struct hal_rx_ppdu_info* +dp_rx_mon_get_ppdu_info(struct dp_mon_pdev *mon_pdev) +{ + return &mon_pdev->ppdu_info; +} + +static inline void +dp_rx_mon_free_ppdu_info(struct dp_pdev *pdev, + struct hal_rx_ppdu_info *ppdu_info) +{ +} + +static inline void +__dp_rx_mon_free_ppdu_info(struct dp_mon_pdev *mon_pdev, + struct hal_rx_ppdu_info *ppdu_info) +{ +} +#endif QDF_STATUS dp_rx_mon_pdev_htt_srng_setup_2_0(struct dp_soc *soc, struct dp_pdev *pdev, int mac_id, @@ -197,6 +234,18 @@ static inline void dp_rx_mon_ppdu_info_cache_destroy(struct dp_pdev *pdev) { } +static inline struct hal_rx_ppdu_info* +dp_rx_mon_get_ppdu_info(struct dp_mon_pdev *mon_pdev) +{ + return NULL; +} + +static inline void +dp_rx_mon_free_ppdu_info(struct dp_pdev *pdev, + struct hal_rx_ppdu_info *ppdu_info) +{ +} + static inline QDF_STATUS dp_rx_mon_buffers_alloc(struct dp_soc *soc, uint32_t size) {