Loading dp/wifi3.0/dp_internal.h +18 −0 Original line number Diff line number Diff line Loading @@ -2108,6 +2108,24 @@ void dp_set_max_page_size(struct qdf_mem_multi_page_t *pages, } #endif /* MAX_ALLOC_PAGE_SIZE */ /** * dp_history_get_next_index() - get the next entry to record an entry * in the history. * @curr_idx: Current index where the last entry is written. * @max_entries: Max number of entries in the history * * This function assumes that the max number os entries is a power of 2. * * Returns: The index where the next entry is to be written. */ static inline uint32_t dp_history_get_next_index(qdf_atomic_t *curr_idx, uint32_t max_entries) { uint32_t idx = qdf_atomic_inc_return(curr_idx); return idx & (max_entries - 1); } #ifdef DP_MEM_PRE_ALLOC /** * dp_desc_multi_pages_mem_alloc() - alloc memory over multiple pages Loading dp/wifi3.0/dp_ipa.c +6 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ #include "dp_rx.h" #include "dp_ipa.h" /* Ring index for WBM2SW2 release ring */ #define IPA_TX_COMP_RING_IDX HAL_IPA_TX_COMP_RING_IDX /* Hard coded config parameters until dp_ops_cfg.cfg_attach implemented */ #define CFG_IPA_UC_TX_BUF_SIZE_DEFAULT (2048) Loading Loading @@ -1665,7 +1668,9 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) } if (soc->ipa_first_tx_db_access) { hal_srng_dst_init_hp(wbm_srng, ipa_res->tx_comp_doorbell_vaddr); hal_srng_dst_init_hp( soc->hal_soc, wbm_srng, ipa_res->tx_comp_doorbell_vaddr); soc->ipa_first_tx_db_access = false; } Loading dp/wifi3.0/dp_ipa.h +1 −2 Original line number Diff line number Diff line /* * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2020, The Linux Foundation. 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 above Loading @@ -21,7 +21,6 @@ #define DP_IPA_MAX_IFACE 3 #define IPA_TCL_DATA_RING_IDX 2 #define IPA_TX_COMP_RING_IDX 2 #define IPA_REO_DEST_RING_IDX 3 #define IPA_RX_REFILL_BUF_RING_IDX 2 Loading dp/wifi3.0/dp_main.c +62 −28 Original line number Diff line number Diff line Loading @@ -94,12 +94,6 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc) #define SET_PEER_REF_CNT_ONE(_peer) #endif #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY struct dp_rx_history dp_rx_ring_hist[MAX_REO_DEST_RINGS]; struct dp_rx_reinject_history dp_rx_reinject_ring_hist; struct dp_rx_err_history dp_rx_err_ring_hist; #endif /* * The max size of cdp_peer_stats_param_t is limited to 16 bytes. * If the buffer size is exceeding this size limit, Loading Loading @@ -3762,6 +3756,66 @@ static QDF_STATUS dp_htt_ppdu_stats_attach(struct dp_pdev *pdev) return QDF_STATUS_SUCCESS; } #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY /** * dp_soc_rx_history_attach() - Attach the ring history record buffers * @soc: DP soc structure * * This function allocates the memory for recording the rx ring, rx error * ring and the reinject ring entries. There is no error returned in case * of allocation failure since the record function checks if the history is * initialized or not. We do not want to fail the driver load in case of * failure to allocate memory for debug history. * * Returns: None */ static void dp_soc_rx_history_attach(struct dp_soc *soc) { int i; uint32_t rx_ring_hist_size; uint32_t rx_err_ring_hist_size; uint32_t rx_reinject_hist_size; rx_ring_hist_size = sizeof(*soc->rx_ring_history[i]); rx_err_ring_hist_size = sizeof(*soc->rx_err_ring_history); rx_reinject_hist_size = sizeof(*soc->rx_reinject_ring_history); for (i = 0; i < MAX_REO_DEST_RINGS; i++) { soc->rx_ring_history[i] = qdf_mem_malloc(rx_ring_hist_size); if (soc->rx_ring_history[i]) qdf_atomic_init(&soc->rx_ring_history[i]->index); } soc->rx_err_ring_history = qdf_mem_malloc(rx_err_ring_hist_size); if (soc->rx_err_ring_history) qdf_atomic_init(&soc->rx_err_ring_history->index); soc->rx_reinject_ring_history = qdf_mem_malloc(rx_reinject_hist_size); if (soc->rx_reinject_ring_history) qdf_atomic_init(&soc->rx_reinject_ring_history->index); } static void dp_soc_rx_history_detach(struct dp_soc *soc) { int i; for (i = 0; i < MAX_REO_DEST_RINGS; i++) qdf_mem_free(soc->rx_ring_history[i]); qdf_mem_free(soc->rx_err_ring_history); qdf_mem_free(soc->rx_reinject_ring_history); } #else static inline void dp_soc_rx_history_attach(struct dp_soc *soc) { } static inline void dp_soc_rx_history_detach(struct dp_soc *soc) { } #endif /* * dp_pdev_attach_wifi3() - attach txrx pdev * @txrx_soc: Datapath SOC handle Loading Loading @@ -4738,6 +4792,7 @@ static void dp_soc_detach(struct cdp_soc_t *txrx_soc) soc->dp_soc_reinit = 0; wlan_cfg_soc_detach(soc->wlan_cfg_ctx); dp_soc_rx_history_detach(soc); qdf_minidump_remove(soc); qdf_mem_free(soc); Loading Loading @@ -10961,28 +11016,6 @@ static void dp_process_wow_ack_rsp(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) } } #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY static void dp_soc_rx_history_attach(struct dp_soc *soc) { int i; for (i = 0; i < MAX_REO_DEST_RINGS; i++) { soc->rx_ring_history[i] = &dp_rx_ring_hist[i]; qdf_atomic_init(&soc->rx_ring_history[i]->index); } soc->rx_err_ring_history = &dp_rx_err_ring_hist; soc->rx_reinject_ring_history = &dp_rx_reinject_ring_hist; qdf_atomic_init(&soc->rx_err_ring_history->index); qdf_atomic_init(&soc->rx_reinject_ring_history->index); } #else static inline void dp_soc_rx_history_attach(struct dp_soc *soc) { } #endif /** * dp_process_target_suspend_req() - process target suspend request * @soc_hdl: datapath soc handle Loading Loading @@ -11220,6 +11253,7 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, fail2: htt_soc_detach(htt_soc); fail1: dp_soc_rx_history_detach(soc); qdf_mem_free(soc); fail0: return NULL; Loading dp/wifi3.0/dp_rx.c +19 −3 Original line number Diff line number Diff line Loading @@ -1902,18 +1902,33 @@ bool dp_rx_is_raw_frame_dropped(qdf_nbuf_t nbuf) #endif #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY /** * dp_rx_ring_record_entry() - Record an entry into the rx ring history. * @soc: Datapath soc structure * @ring_num: REO ring number * @ring_desc: REO ring descriptor * * Returns: None */ static inline void dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) { struct dp_buf_info_record *record; uint8_t rbm; struct hal_buf_info hbi; uint32_t idx; if (qdf_unlikely(!&soc->rx_ring_history[ring_num])) return; hal_rx_reo_buf_paddr_get(ring_desc, &hbi); rbm = hal_rx_ret_buf_manager_get(ring_desc); idx = dp_history_get_next_index(&soc->rx_ring_history[ring_num]->index, DP_RX_HIST_MAX); idx = dp_history_get_next_index(&soc->rx_ring_history[ring_num]->index, DP_RX_HIST_MAX); /* No NULL check needed for record since its an array */ record = &soc->rx_ring_history[ring_num]->entry[idx]; record->timestamp = qdf_get_log_timestamp(); Loading @@ -1923,7 +1938,8 @@ dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ri } #else static inline void dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) { } #endif Loading Loading
dp/wifi3.0/dp_internal.h +18 −0 Original line number Diff line number Diff line Loading @@ -2108,6 +2108,24 @@ void dp_set_max_page_size(struct qdf_mem_multi_page_t *pages, } #endif /* MAX_ALLOC_PAGE_SIZE */ /** * dp_history_get_next_index() - get the next entry to record an entry * in the history. * @curr_idx: Current index where the last entry is written. * @max_entries: Max number of entries in the history * * This function assumes that the max number os entries is a power of 2. * * Returns: The index where the next entry is to be written. */ static inline uint32_t dp_history_get_next_index(qdf_atomic_t *curr_idx, uint32_t max_entries) { uint32_t idx = qdf_atomic_inc_return(curr_idx); return idx & (max_entries - 1); } #ifdef DP_MEM_PRE_ALLOC /** * dp_desc_multi_pages_mem_alloc() - alloc memory over multiple pages Loading
dp/wifi3.0/dp_ipa.c +6 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ #include "dp_rx.h" #include "dp_ipa.h" /* Ring index for WBM2SW2 release ring */ #define IPA_TX_COMP_RING_IDX HAL_IPA_TX_COMP_RING_IDX /* Hard coded config parameters until dp_ops_cfg.cfg_attach implemented */ #define CFG_IPA_UC_TX_BUF_SIZE_DEFAULT (2048) Loading Loading @@ -1665,7 +1668,9 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) } if (soc->ipa_first_tx_db_access) { hal_srng_dst_init_hp(wbm_srng, ipa_res->tx_comp_doorbell_vaddr); hal_srng_dst_init_hp( soc->hal_soc, wbm_srng, ipa_res->tx_comp_doorbell_vaddr); soc->ipa_first_tx_db_access = false; } Loading
dp/wifi3.0/dp_ipa.h +1 −2 Original line number Diff line number Diff line /* * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2020, The Linux Foundation. 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 above Loading @@ -21,7 +21,6 @@ #define DP_IPA_MAX_IFACE 3 #define IPA_TCL_DATA_RING_IDX 2 #define IPA_TX_COMP_RING_IDX 2 #define IPA_REO_DEST_RING_IDX 3 #define IPA_RX_REFILL_BUF_RING_IDX 2 Loading
dp/wifi3.0/dp_main.c +62 −28 Original line number Diff line number Diff line Loading @@ -94,12 +94,6 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc) #define SET_PEER_REF_CNT_ONE(_peer) #endif #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY struct dp_rx_history dp_rx_ring_hist[MAX_REO_DEST_RINGS]; struct dp_rx_reinject_history dp_rx_reinject_ring_hist; struct dp_rx_err_history dp_rx_err_ring_hist; #endif /* * The max size of cdp_peer_stats_param_t is limited to 16 bytes. * If the buffer size is exceeding this size limit, Loading Loading @@ -3762,6 +3756,66 @@ static QDF_STATUS dp_htt_ppdu_stats_attach(struct dp_pdev *pdev) return QDF_STATUS_SUCCESS; } #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY /** * dp_soc_rx_history_attach() - Attach the ring history record buffers * @soc: DP soc structure * * This function allocates the memory for recording the rx ring, rx error * ring and the reinject ring entries. There is no error returned in case * of allocation failure since the record function checks if the history is * initialized or not. We do not want to fail the driver load in case of * failure to allocate memory for debug history. * * Returns: None */ static void dp_soc_rx_history_attach(struct dp_soc *soc) { int i; uint32_t rx_ring_hist_size; uint32_t rx_err_ring_hist_size; uint32_t rx_reinject_hist_size; rx_ring_hist_size = sizeof(*soc->rx_ring_history[i]); rx_err_ring_hist_size = sizeof(*soc->rx_err_ring_history); rx_reinject_hist_size = sizeof(*soc->rx_reinject_ring_history); for (i = 0; i < MAX_REO_DEST_RINGS; i++) { soc->rx_ring_history[i] = qdf_mem_malloc(rx_ring_hist_size); if (soc->rx_ring_history[i]) qdf_atomic_init(&soc->rx_ring_history[i]->index); } soc->rx_err_ring_history = qdf_mem_malloc(rx_err_ring_hist_size); if (soc->rx_err_ring_history) qdf_atomic_init(&soc->rx_err_ring_history->index); soc->rx_reinject_ring_history = qdf_mem_malloc(rx_reinject_hist_size); if (soc->rx_reinject_ring_history) qdf_atomic_init(&soc->rx_reinject_ring_history->index); } static void dp_soc_rx_history_detach(struct dp_soc *soc) { int i; for (i = 0; i < MAX_REO_DEST_RINGS; i++) qdf_mem_free(soc->rx_ring_history[i]); qdf_mem_free(soc->rx_err_ring_history); qdf_mem_free(soc->rx_reinject_ring_history); } #else static inline void dp_soc_rx_history_attach(struct dp_soc *soc) { } static inline void dp_soc_rx_history_detach(struct dp_soc *soc) { } #endif /* * dp_pdev_attach_wifi3() - attach txrx pdev * @txrx_soc: Datapath SOC handle Loading Loading @@ -4738,6 +4792,7 @@ static void dp_soc_detach(struct cdp_soc_t *txrx_soc) soc->dp_soc_reinit = 0; wlan_cfg_soc_detach(soc->wlan_cfg_ctx); dp_soc_rx_history_detach(soc); qdf_minidump_remove(soc); qdf_mem_free(soc); Loading Loading @@ -10961,28 +11016,6 @@ static void dp_process_wow_ack_rsp(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) } } #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY static void dp_soc_rx_history_attach(struct dp_soc *soc) { int i; for (i = 0; i < MAX_REO_DEST_RINGS; i++) { soc->rx_ring_history[i] = &dp_rx_ring_hist[i]; qdf_atomic_init(&soc->rx_ring_history[i]->index); } soc->rx_err_ring_history = &dp_rx_err_ring_hist; soc->rx_reinject_ring_history = &dp_rx_reinject_ring_hist; qdf_atomic_init(&soc->rx_err_ring_history->index); qdf_atomic_init(&soc->rx_reinject_ring_history->index); } #else static inline void dp_soc_rx_history_attach(struct dp_soc *soc) { } #endif /** * dp_process_target_suspend_req() - process target suspend request * @soc_hdl: datapath soc handle Loading Loading @@ -11220,6 +11253,7 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, fail2: htt_soc_detach(htt_soc); fail1: dp_soc_rx_history_detach(soc); qdf_mem_free(soc); fail0: return NULL; Loading
dp/wifi3.0/dp_rx.c +19 −3 Original line number Diff line number Diff line Loading @@ -1902,18 +1902,33 @@ bool dp_rx_is_raw_frame_dropped(qdf_nbuf_t nbuf) #endif #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY /** * dp_rx_ring_record_entry() - Record an entry into the rx ring history. * @soc: Datapath soc structure * @ring_num: REO ring number * @ring_desc: REO ring descriptor * * Returns: None */ static inline void dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) { struct dp_buf_info_record *record; uint8_t rbm; struct hal_buf_info hbi; uint32_t idx; if (qdf_unlikely(!&soc->rx_ring_history[ring_num])) return; hal_rx_reo_buf_paddr_get(ring_desc, &hbi); rbm = hal_rx_ret_buf_manager_get(ring_desc); idx = dp_history_get_next_index(&soc->rx_ring_history[ring_num]->index, DP_RX_HIST_MAX); idx = dp_history_get_next_index(&soc->rx_ring_history[ring_num]->index, DP_RX_HIST_MAX); /* No NULL check needed for record since its an array */ record = &soc->rx_ring_history[ring_num]->entry[idx]; record->timestamp = qdf_get_log_timestamp(); Loading @@ -1923,7 +1938,8 @@ dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ri } #else static inline void dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num, hal_ring_desc_t ring_desc) { } #endif Loading