Loading dp/inc/cdp_txrx_ops.h +2 −0 Original line number Diff line number Diff line Loading @@ -1369,6 +1369,8 @@ struct cdp_peer_ops { uint8_t *peer_mac, bool val); void (*set_peer_as_tdls_peer)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac, bool val); void (*peer_flush_frags)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, uint8_t *peer_mac); }; /** Loading dp/inc/cdp_txrx_peer_ops.h +21 −1 Original line number Diff line number Diff line /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021 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 Loading Loading @@ -569,4 +569,24 @@ cdp_peer_set_tdls_offchan_enabled(ol_txrx_soc_handle soc, uint8_t vdev_id, peer_mac, val); } /** * cdp_peer_flush_frags() - Flush frags on peer * @soc - data path soc handle * @vdev_id - virtual interface id * @peer_mac - peer mac addr * * Return: None */ static inline void cdp_peer_flush_frags(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac) { if (!soc || !soc->ops || !soc->ops->peer_ops) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, "%s invalid instance", __func__); return; } if (soc->ops->peer_ops->peer_flush_frags) soc->ops->peer_ops->peer_flush_frags(soc, vdev_id, peer_mac); } #endif /* _CDP_TXRX_PEER_H_ */ dp/wifi3.0/dp_internal.h +11 −0 Original line number Diff line number Diff line Loading @@ -2728,4 +2728,15 @@ static inline QDF_STATUS dp_runtime_init(struct dp_soc *soc) } #endif /** * dp_peer_flush_frags() - Flush all fragments for a particular * peer * @soc_hdl - data path soc handle * @vdev_id - vdev id * @peer_addr - peer mac address * * Return: None */ void dp_peer_flush_frags(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, uint8_t *peer_mac); #endif /* #ifndef _DP_INTERNAL_H_ */ dp/wifi3.0/dp_main.c +112 −0 Original line number Diff line number Diff line Loading @@ -4157,6 +4157,41 @@ static QDF_STATUS dp_htt_ppdu_stats_attach(struct dp_pdev *pdev) return QDF_STATUS_SUCCESS; } #ifdef DP_TX_HW_DESC_HISTORY /** * dp_soc_tx_hw_desc_history_attach - Attach TX HW descriptor history * * @soc: DP soc handle * * Return: None */ static void dp_soc_tx_hw_desc_history_attach(struct dp_soc *soc) { soc->tx_hw_desc_history = dp_context_alloc_mem( soc, DP_TX_HW_DESC_HIST_TYPE, sizeof(struct dp_tx_hw_desc_evt)); if (soc->tx_hw_desc_history) soc->tx_hw_desc_history->index = 0; } static void dp_soc_tx_hw_desc_history_detach(struct dp_soc *soc) { dp_context_free_mem(soc, DP_TX_HW_DESC_HIST_TYPE, soc->tx_hw_desc_history); } #else /* DP_TX_HW_DESC_HISTORY */ static inline void dp_soc_tx_hw_desc_history_attach(struct dp_soc *soc) { } static inline void dp_soc_tx_hw_desc_history_detach(struct dp_soc *soc) { } #endif /* DP_TX_HW_DESC_HISTORY */ #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY #ifndef RX_DEFRAG_DO_NOT_REINJECT /** Loading Loading @@ -4198,10 +4233,12 @@ static void dp_soc_rx_history_attach(struct dp_soc *soc) uint32_t rx_ring_hist_size; uint32_t rx_err_ring_hist_size; uint32_t rx_reinject_hist_size; uint32_t rx_refill_ring_hist_size; rx_ring_hist_size = sizeof(*soc->rx_ring_history[0]); rx_err_ring_hist_size = sizeof(*soc->rx_err_ring_history); rx_reinject_hist_size = sizeof(*soc->rx_reinject_ring_history); rx_refill_ring_hist_size = sizeof(*soc->rx_refill_ring_history[0]); for (i = 0; i < MAX_REO_DEST_RINGS; i++) { soc->rx_ring_history[i] = dp_context_alloc_mem( Loading @@ -4216,6 +4253,16 @@ static void dp_soc_rx_history_attach(struct dp_soc *soc) qdf_atomic_init(&soc->rx_err_ring_history->index); dp_soc_rx_reinject_ring_history_attach(soc); for (i = 0; i < MAX_PDEV_CNT; i++) { soc->rx_refill_ring_history[i] = dp_context_alloc_mem( soc, DP_RX_REFILL_RING_HIST_TYPE, rx_refill_ring_hist_size); if (soc->rx_refill_ring_history[i]) qdf_atomic_init(&soc->rx_refill_ring_history[i]->index); } } static void dp_soc_rx_history_detach(struct dp_soc *soc) Loading @@ -4235,6 +4282,10 @@ static void dp_soc_rx_history_detach(struct dp_soc *soc) */ dp_context_free_mem(soc, DP_RX_REINJECT_RING_HIST_TYPE, soc->rx_reinject_ring_history); for (i = 0; i < MAX_PDEV_CNT; i++) dp_context_free_mem(soc, DP_RX_REFILL_RING_HIST_TYPE, soc->rx_refill_ring_history[i]); } #else Loading @@ -4247,6 +4298,62 @@ static inline void dp_soc_rx_history_detach(struct dp_soc *soc) } #endif #ifdef WLAN_FEATURE_DP_TX_DESC_HISTORY /** * dp_soc_tx_history_attach() - Attach the ring history record buffers * @soc: DP soc structure * * This function allocates the memory for recording the tx tcl ring and * the tx comp 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_tx_history_attach(struct dp_soc *soc) { uint32_t tx_tcl_hist_size; uint32_t tx_comp_hist_size; tx_tcl_hist_size = sizeof(*soc->tx_tcl_history); soc->tx_tcl_history = dp_context_alloc_mem(soc, DP_TX_TCL_HIST_TYPE, tx_tcl_hist_size); if (soc->tx_tcl_history) qdf_atomic_init(&soc->tx_tcl_history->index); tx_comp_hist_size = sizeof(*soc->tx_comp_history); soc->tx_comp_history = dp_context_alloc_mem(soc, DP_TX_COMP_HIST_TYPE, tx_comp_hist_size); if (soc->tx_comp_history) qdf_atomic_init(&soc->tx_comp_history->index); } /** * dp_soc_tx_history_detach() - Detach the ring history record buffers * @soc: DP soc structure * * This function frees the memory for recording the tx tcl ring and * the tx comp ring entries. * * Returns: None */ static void dp_soc_tx_history_detach(struct dp_soc *soc) { dp_context_free_mem(soc, DP_TX_TCL_HIST_TYPE, soc->tx_tcl_history); dp_context_free_mem(soc, DP_TX_COMP_HIST_TYPE, soc->tx_comp_history); } #else static inline void dp_soc_tx_history_attach(struct dp_soc *soc) { } static inline void dp_soc_tx_history_detach(struct dp_soc *soc) { } #endif /* WLAN_FEATURE_DP_TX_DESC_HISTORY */ /* * dp_pdev_attach_wifi3() - attach txrx pdev * @txrx_soc: Datapath SOC handle Loading Loading @@ -4811,6 +4918,8 @@ static void dp_soc_detach(struct cdp_soc_t *txrx_soc) dp_hw_link_desc_ring_free(soc); dp_hw_link_desc_pool_banks_free(soc, WLAN_INVALID_PDEV_ID); wlan_cfg_soc_detach(soc->wlan_cfg_ctx); dp_soc_tx_hw_desc_history_detach(soc); dp_soc_tx_history_detach(soc); dp_soc_rx_history_detach(soc); if (soc->mon_vdev_timer_state & MON_VDEV_TIMER_INIT) { qdf_timer_free(&soc->mon_vdev_timer); Loading Loading @@ -11964,6 +12073,7 @@ static struct cdp_peer_ops dp_ops_peer = { .get_vdev_by_peer_addr = dp_get_vdev_by_peer_addr, .peer_get_peer_mac_addr = dp_peer_get_peer_mac_addr, .get_peer_state = dp_get_peer_state, .peer_flush_frags = dp_peer_flush_frags, }; #endif Loading Loading @@ -12102,7 +12212,9 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, /* Reset wbm sg list and flags */ dp_rx_wbm_sg_list_reset(soc); dp_soc_tx_hw_desc_history_attach(soc); dp_soc_rx_history_attach(soc); dp_soc_tx_history_attach(soc); wlan_set_srng_cfg(&soc->wlan_srng_cfg); soc->wlan_cfg_ctx = wlan_cfg_soc_attach(soc->ctrl_psoc); if (!soc->wlan_cfg_ctx) { Loading dp/wifi3.0/dp_peer.c +31 −4 Original line number Diff line number Diff line Loading @@ -1223,12 +1223,12 @@ void dp_peer_unlink_ast_entry(struct dp_soc *soc, struct dp_peer *peer) { if (!peer) { dp_err_rl("NULL peer"); dp_info_rl("NULL peer"); return; } if (ast_entry->peer_id == HTT_INVALID_PEER) { dp_err_rl("Invalid peer id in AST entry mac addr:"QDF_MAC_ADDR_FMT" type:%d", dp_info_rl("Invalid peer id in AST entry mac addr:"QDF_MAC_ADDR_FMT" type:%d", QDF_MAC_ADDR_REF(ast_entry->mac_addr.raw), ast_entry->type); return; Loading Loading @@ -1270,12 +1270,12 @@ void dp_peer_del_ast(struct dp_soc *soc, struct dp_ast_entry *ast_entry) struct dp_peer *peer = NULL; if (!ast_entry) { dp_err_rl("NULL AST entry"); dp_info_rl("NULL AST entry"); return; } if (ast_entry->delete_in_progress) { dp_err_rl("AST entry deletion in progress mac addr:"QDF_MAC_ADDR_FMT" type:%d", dp_info_rl("AST entry deletion in progress mac addr:"QDF_MAC_ADDR_FMT" type:%d", QDF_MAC_ADDR_REF(ast_entry->mac_addr.raw), ast_entry->type); return; Loading Loading @@ -4503,3 +4503,30 @@ void dp_get_rx_reo_queue_info( dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_GENERIC_STATS); } #endif /* DUMP_REO_QUEUE_INFO_IN_DDR */ void dp_peer_flush_frags(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, uint8_t *peer_mac) { struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); struct dp_peer *peer = dp_peer_find_hash_find(soc, peer_mac, 0, vdev_id, DP_MOD_ID_CDP); struct dp_rx_tid *rx_tid; uint8_t tid; if (!peer) return; dp_info("Flushing fragments for peer " QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(peer->mac_addr.raw)); for (tid = 0; tid < DP_MAX_TIDS; tid++) { rx_tid = &peer->rx_tid[tid]; qdf_spin_lock_bh(&rx_tid->tid_lock); dp_rx_defrag_waitlist_remove(peer, tid); dp_rx_reorder_flush_frag(peer, tid); qdf_spin_unlock_bh(&rx_tid->tid_lock); } dp_peer_unref_delete(peer, DP_MOD_ID_CDP); } Loading
dp/inc/cdp_txrx_ops.h +2 −0 Original line number Diff line number Diff line Loading @@ -1369,6 +1369,8 @@ struct cdp_peer_ops { uint8_t *peer_mac, bool val); void (*set_peer_as_tdls_peer)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac, bool val); void (*peer_flush_frags)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, uint8_t *peer_mac); }; /** Loading
dp/inc/cdp_txrx_peer_ops.h +21 −1 Original line number Diff line number Diff line /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021 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 Loading Loading @@ -569,4 +569,24 @@ cdp_peer_set_tdls_offchan_enabled(ol_txrx_soc_handle soc, uint8_t vdev_id, peer_mac, val); } /** * cdp_peer_flush_frags() - Flush frags on peer * @soc - data path soc handle * @vdev_id - virtual interface id * @peer_mac - peer mac addr * * Return: None */ static inline void cdp_peer_flush_frags(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac) { if (!soc || !soc->ops || !soc->ops->peer_ops) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, "%s invalid instance", __func__); return; } if (soc->ops->peer_ops->peer_flush_frags) soc->ops->peer_ops->peer_flush_frags(soc, vdev_id, peer_mac); } #endif /* _CDP_TXRX_PEER_H_ */
dp/wifi3.0/dp_internal.h +11 −0 Original line number Diff line number Diff line Loading @@ -2728,4 +2728,15 @@ static inline QDF_STATUS dp_runtime_init(struct dp_soc *soc) } #endif /** * dp_peer_flush_frags() - Flush all fragments for a particular * peer * @soc_hdl - data path soc handle * @vdev_id - vdev id * @peer_addr - peer mac address * * Return: None */ void dp_peer_flush_frags(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, uint8_t *peer_mac); #endif /* #ifndef _DP_INTERNAL_H_ */
dp/wifi3.0/dp_main.c +112 −0 Original line number Diff line number Diff line Loading @@ -4157,6 +4157,41 @@ static QDF_STATUS dp_htt_ppdu_stats_attach(struct dp_pdev *pdev) return QDF_STATUS_SUCCESS; } #ifdef DP_TX_HW_DESC_HISTORY /** * dp_soc_tx_hw_desc_history_attach - Attach TX HW descriptor history * * @soc: DP soc handle * * Return: None */ static void dp_soc_tx_hw_desc_history_attach(struct dp_soc *soc) { soc->tx_hw_desc_history = dp_context_alloc_mem( soc, DP_TX_HW_DESC_HIST_TYPE, sizeof(struct dp_tx_hw_desc_evt)); if (soc->tx_hw_desc_history) soc->tx_hw_desc_history->index = 0; } static void dp_soc_tx_hw_desc_history_detach(struct dp_soc *soc) { dp_context_free_mem(soc, DP_TX_HW_DESC_HIST_TYPE, soc->tx_hw_desc_history); } #else /* DP_TX_HW_DESC_HISTORY */ static inline void dp_soc_tx_hw_desc_history_attach(struct dp_soc *soc) { } static inline void dp_soc_tx_hw_desc_history_detach(struct dp_soc *soc) { } #endif /* DP_TX_HW_DESC_HISTORY */ #ifdef WLAN_FEATURE_DP_RX_RING_HISTORY #ifndef RX_DEFRAG_DO_NOT_REINJECT /** Loading Loading @@ -4198,10 +4233,12 @@ static void dp_soc_rx_history_attach(struct dp_soc *soc) uint32_t rx_ring_hist_size; uint32_t rx_err_ring_hist_size; uint32_t rx_reinject_hist_size; uint32_t rx_refill_ring_hist_size; rx_ring_hist_size = sizeof(*soc->rx_ring_history[0]); rx_err_ring_hist_size = sizeof(*soc->rx_err_ring_history); rx_reinject_hist_size = sizeof(*soc->rx_reinject_ring_history); rx_refill_ring_hist_size = sizeof(*soc->rx_refill_ring_history[0]); for (i = 0; i < MAX_REO_DEST_RINGS; i++) { soc->rx_ring_history[i] = dp_context_alloc_mem( Loading @@ -4216,6 +4253,16 @@ static void dp_soc_rx_history_attach(struct dp_soc *soc) qdf_atomic_init(&soc->rx_err_ring_history->index); dp_soc_rx_reinject_ring_history_attach(soc); for (i = 0; i < MAX_PDEV_CNT; i++) { soc->rx_refill_ring_history[i] = dp_context_alloc_mem( soc, DP_RX_REFILL_RING_HIST_TYPE, rx_refill_ring_hist_size); if (soc->rx_refill_ring_history[i]) qdf_atomic_init(&soc->rx_refill_ring_history[i]->index); } } static void dp_soc_rx_history_detach(struct dp_soc *soc) Loading @@ -4235,6 +4282,10 @@ static void dp_soc_rx_history_detach(struct dp_soc *soc) */ dp_context_free_mem(soc, DP_RX_REINJECT_RING_HIST_TYPE, soc->rx_reinject_ring_history); for (i = 0; i < MAX_PDEV_CNT; i++) dp_context_free_mem(soc, DP_RX_REFILL_RING_HIST_TYPE, soc->rx_refill_ring_history[i]); } #else Loading @@ -4247,6 +4298,62 @@ static inline void dp_soc_rx_history_detach(struct dp_soc *soc) } #endif #ifdef WLAN_FEATURE_DP_TX_DESC_HISTORY /** * dp_soc_tx_history_attach() - Attach the ring history record buffers * @soc: DP soc structure * * This function allocates the memory for recording the tx tcl ring and * the tx comp 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_tx_history_attach(struct dp_soc *soc) { uint32_t tx_tcl_hist_size; uint32_t tx_comp_hist_size; tx_tcl_hist_size = sizeof(*soc->tx_tcl_history); soc->tx_tcl_history = dp_context_alloc_mem(soc, DP_TX_TCL_HIST_TYPE, tx_tcl_hist_size); if (soc->tx_tcl_history) qdf_atomic_init(&soc->tx_tcl_history->index); tx_comp_hist_size = sizeof(*soc->tx_comp_history); soc->tx_comp_history = dp_context_alloc_mem(soc, DP_TX_COMP_HIST_TYPE, tx_comp_hist_size); if (soc->tx_comp_history) qdf_atomic_init(&soc->tx_comp_history->index); } /** * dp_soc_tx_history_detach() - Detach the ring history record buffers * @soc: DP soc structure * * This function frees the memory for recording the tx tcl ring and * the tx comp ring entries. * * Returns: None */ static void dp_soc_tx_history_detach(struct dp_soc *soc) { dp_context_free_mem(soc, DP_TX_TCL_HIST_TYPE, soc->tx_tcl_history); dp_context_free_mem(soc, DP_TX_COMP_HIST_TYPE, soc->tx_comp_history); } #else static inline void dp_soc_tx_history_attach(struct dp_soc *soc) { } static inline void dp_soc_tx_history_detach(struct dp_soc *soc) { } #endif /* WLAN_FEATURE_DP_TX_DESC_HISTORY */ /* * dp_pdev_attach_wifi3() - attach txrx pdev * @txrx_soc: Datapath SOC handle Loading Loading @@ -4811,6 +4918,8 @@ static void dp_soc_detach(struct cdp_soc_t *txrx_soc) dp_hw_link_desc_ring_free(soc); dp_hw_link_desc_pool_banks_free(soc, WLAN_INVALID_PDEV_ID); wlan_cfg_soc_detach(soc->wlan_cfg_ctx); dp_soc_tx_hw_desc_history_detach(soc); dp_soc_tx_history_detach(soc); dp_soc_rx_history_detach(soc); if (soc->mon_vdev_timer_state & MON_VDEV_TIMER_INIT) { qdf_timer_free(&soc->mon_vdev_timer); Loading Loading @@ -11964,6 +12073,7 @@ static struct cdp_peer_ops dp_ops_peer = { .get_vdev_by_peer_addr = dp_get_vdev_by_peer_addr, .peer_get_peer_mac_addr = dp_peer_get_peer_mac_addr, .get_peer_state = dp_get_peer_state, .peer_flush_frags = dp_peer_flush_frags, }; #endif Loading Loading @@ -12102,7 +12212,9 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, /* Reset wbm sg list and flags */ dp_rx_wbm_sg_list_reset(soc); dp_soc_tx_hw_desc_history_attach(soc); dp_soc_rx_history_attach(soc); dp_soc_tx_history_attach(soc); wlan_set_srng_cfg(&soc->wlan_srng_cfg); soc->wlan_cfg_ctx = wlan_cfg_soc_attach(soc->ctrl_psoc); if (!soc->wlan_cfg_ctx) { Loading
dp/wifi3.0/dp_peer.c +31 −4 Original line number Diff line number Diff line Loading @@ -1223,12 +1223,12 @@ void dp_peer_unlink_ast_entry(struct dp_soc *soc, struct dp_peer *peer) { if (!peer) { dp_err_rl("NULL peer"); dp_info_rl("NULL peer"); return; } if (ast_entry->peer_id == HTT_INVALID_PEER) { dp_err_rl("Invalid peer id in AST entry mac addr:"QDF_MAC_ADDR_FMT" type:%d", dp_info_rl("Invalid peer id in AST entry mac addr:"QDF_MAC_ADDR_FMT" type:%d", QDF_MAC_ADDR_REF(ast_entry->mac_addr.raw), ast_entry->type); return; Loading Loading @@ -1270,12 +1270,12 @@ void dp_peer_del_ast(struct dp_soc *soc, struct dp_ast_entry *ast_entry) struct dp_peer *peer = NULL; if (!ast_entry) { dp_err_rl("NULL AST entry"); dp_info_rl("NULL AST entry"); return; } if (ast_entry->delete_in_progress) { dp_err_rl("AST entry deletion in progress mac addr:"QDF_MAC_ADDR_FMT" type:%d", dp_info_rl("AST entry deletion in progress mac addr:"QDF_MAC_ADDR_FMT" type:%d", QDF_MAC_ADDR_REF(ast_entry->mac_addr.raw), ast_entry->type); return; Loading Loading @@ -4503,3 +4503,30 @@ void dp_get_rx_reo_queue_info( dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_GENERIC_STATS); } #endif /* DUMP_REO_QUEUE_INFO_IN_DDR */ void dp_peer_flush_frags(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, uint8_t *peer_mac) { struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); struct dp_peer *peer = dp_peer_find_hash_find(soc, peer_mac, 0, vdev_id, DP_MOD_ID_CDP); struct dp_rx_tid *rx_tid; uint8_t tid; if (!peer) return; dp_info("Flushing fragments for peer " QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(peer->mac_addr.raw)); for (tid = 0; tid < DP_MAX_TIDS; tid++) { rx_tid = &peer->rx_tid[tid]; qdf_spin_lock_bh(&rx_tid->tid_lock); dp_rx_defrag_waitlist_remove(peer, tid); dp_rx_reorder_flush_frag(peer, tid); qdf_spin_unlock_bh(&rx_tid->tid_lock); } dp_peer_unref_delete(peer, DP_MOD_ID_CDP); }