diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index f383e04270..9f8ea35544 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -3168,6 +3168,7 @@ struct cdp_pdev_deter_stats { * @peer_unauth_rx_pkt_drop: stats counter for drops due to unauthorized peer * @telemetry_stats: pdev telemetry stats * @deter_stats: + * @invalid_msdu_cnt: Invalid MSDU count received counter */ struct cdp_pdev_stats { struct { @@ -3265,6 +3266,7 @@ struct cdp_pdev_stats { struct cdp_pdev_telemetry_stats telemetry_stats; struct cdp_pdev_deter_stats deter_stats; #endif + uint32_t invalid_msdu_cnt; }; /** diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index f2826b3287..fb26d03745 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -7818,6 +7818,7 @@ dp_print_pdev_rx_stats(struct dp_pdev *pdev) dp_pdev_iterate_peer_lock_safe(pdev, dp_peer_ctrl_frames_stats_get, NULL, DP_MOD_ID_GENERIC_STATS); + /* Get bar_recv_cnt */ DP_PRINT_STATS("BAR Received Count: = %u", pdev->stats.rx.bar_recv_cnt); @@ -7830,6 +7831,9 @@ dp_print_pdev_rx_stats(struct dp_pdev *pdev) DP_PRINT_STATS("\tAllocations from the pool during replenish = %llu", pdev->stats.rx_buffer_pool.num_pool_bufs_replenish); + DP_PRINT_STATS("Invalid MSDU count = %u", + pdev->stats.invalid_msdu_cnt); + dp_rx_basic_fst_stats(pdev); } diff --git a/dp/wifi3.0/monitor/1.0/dp_rx_mon_1.0.h b/dp/wifi3.0/monitor/1.0/dp_rx_mon_1.0.h index 4af0487ee8..5b6be5bc6d 100644 --- a/dp/wifi3.0/monitor/1.0/dp_rx_mon_1.0.h +++ b/dp/wifi3.0/monitor/1.0/dp_rx_mon_1.0.h @@ -894,21 +894,21 @@ uint8_t *dp_rx_mon_get_buffer_data(struct dp_rx_desc *rx_desc) /** * dp_rx_cookie_2_mon_link_desc() - Retrieve Link descriptor based on target * @pdev: core physical device context - * @buf_info: structure holding the buffer info + * @buf_info: ptr to structure holding the buffer info * @mac_id: mac number * * Return: link descriptor address */ static inline void *dp_rx_cookie_2_mon_link_desc(struct dp_pdev *pdev, - struct hal_buf_info buf_info, + struct hal_buf_info *buf_info, uint8_t mac_id) { if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) - return dp_rx_cookie_2_mon_link_desc_va(pdev, &buf_info, + return dp_rx_cookie_2_mon_link_desc_va(pdev, buf_info, mac_id); - return dp_rx_cookie_2_link_desc_va(pdev->soc, &buf_info); + return dp_rx_cookie_2_link_desc_va(pdev->soc, buf_info); } /** diff --git a/dp/wifi3.0/monitor/1.0/dp_rx_mon_dest_1.0.c b/dp/wifi3.0/monitor/1.0/dp_rx_mon_dest_1.0.c index da49d4dcce..8a591e2d80 100644 --- a/dp/wifi3.0/monitor/1.0/dp_rx_mon_dest_1.0.c +++ b/dp/wifi3.0/monitor/1.0/dp_rx_mon_dest_1.0.c @@ -230,6 +230,11 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, is_first_msdu = true; do { + if (!msdu_cnt) { + drop_mpdu = true; + DP_STATS_INC(dp_pdev, invalid_msdu_cnt, 1); + } + /* WAR for duplicate link descriptors received from HW */ if (qdf_unlikely(mon_pdev->mon_last_linkdesc_paddr == buf_info.paddr)) { @@ -239,7 +244,7 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, rx_msdu_link_desc = dp_rx_cookie_2_mon_link_desc(dp_pdev, - buf_info, mac_id); + &buf_info, mac_id); qdf_assert_always(rx_msdu_link_desc); @@ -384,7 +389,7 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, rx_desc_tlv, &first_rx_desc_tlv, &is_frag_non_raw, data); - if (!is_frag) + if (!is_frag && msdu_cnt) msdu_cnt--; dp_rx_mon_dest_debug("total_len %u frag_len %u flags %u", @@ -457,7 +462,7 @@ next_msdu: bm_action) != QDF_STATUS_SUCCESS) dp_err_rl("monitor link desc return failed"); - } while (buf_info.paddr && msdu_cnt); + } while (buf_info.paddr); dp_rx_mon_init_tail_msdu(head_msdu, msdu, last, tail_msdu); dp_rx_mon_remove_raw_frame_fcs_len(soc, head_msdu, tail_msdu); @@ -506,7 +511,7 @@ static int dp_rx_mon_drop_one_mpdu(struct dp_pdev *pdev, do { rx_msdu_link_desc = dp_rx_cookie_2_mon_link_desc(pdev, - buf_info, + &buf_info, mac_id); if (qdf_unlikely(!rx_msdu_link_desc)) { mon_pdev->rx_mon_stats.mon_link_desc_invalid++;