From b82e526a72d5bf9b9861a55c586b5df888d59af0 Mon Sep 17 00:00:00 2001 From: Padma Raghunathan Date: Thu, 26 Nov 2020 16:32:41 +0530 Subject: [PATCH] qcacmn: Handle FP BARs without errors in wbm release ring Only BAR frames with REO/RXDMA push reason as error are handled in host. FP BAR frames without errors, are routed to host via REO/RXDMA with push reason as route. Instead of leaking the buffer, handle the routed BAR frames gracefully. Free the buffer and log stats to detect such cases. Change-Id: I6e09e8b948d9b2d9d3de3b6558e54f0c70901c62 CRs-Fixed: 2814303 --- dp/wifi3.0/dp_rx_err.c | 8 ++++++++ dp/wifi3.0/dp_stats.c | 4 ++++ dp/wifi3.0/dp_types.h | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index 6d25b29bb6..6260b7c7ef 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -2256,6 +2256,10 @@ done: wbm_err_info.reo_err_code); qdf_nbuf_free(nbuf); } + } else if (wbm_err_info.reo_psh_rsn + == HAL_RX_WBM_REO_PSH_RSN_ROUTE) { + DP_STATS_INC(soc, rx.reo2rel_route_drop, 1); + qdf_nbuf_free(nbuf); } } else if (wbm_err_info.wbm_err_src == HAL_RX_WBM_ERR_SRC_RXDMA) { @@ -2320,6 +2324,10 @@ done: dp_err_rl("RXDMA error %d", wbm_err_info.rxdma_err_code); } + } else if (wbm_err_info.rxdma_psh_rsn + == HAL_RX_WBM_RXDMA_PSH_RSN_ROUTE) { + DP_STATS_INC(soc, rx.rxdma2rel_route_drop, 1); + qdf_nbuf_free(nbuf); } } else { /* Should not come here */ diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index a140655a1a..1c3b48bd8f 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -6640,6 +6640,10 @@ dp_print_soc_rx_stats(struct dp_soc *soc) soc->stats.rx.err.reo_cmd_send_fail); DP_PRINT_STATS("Rx BAR frames:%d", soc->stats.rx.bar_frame); + DP_PRINT_STATS("Rxdma2rel route drop:%d", + soc->stats.rx.rxdma2rel_route_drop); + DP_PRINT_STATS("Reo2rel route drop:%d", + soc->stats.rx.reo2rel_route_drop); } #ifdef FEATURE_TSO_STATS diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index da1ab39a17..42d0faaa09 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -892,6 +892,10 @@ struct dp_soc_stats { uint32_t msdu_scatter_wait_break; /* Number of bar frames received */ uint32_t bar_frame; + /* Number of frames routed from rxdma */ + uint32_t rxdma2rel_route_drop; + /* Number of frames routed from reo*/ + uint32_t reo2rel_route_drop; struct { /* Invalid RBM error count */