From a34dd02dd0710c1ae181d79eadf4a2162ef240cd Mon Sep 17 00:00:00 2001 From: Chaithanya Garrepalli Date: Wed, 26 Oct 2022 11:49:23 +0530 Subject: [PATCH] qcacmn: Add skb fast recycler check in rx replenish In ethernet TX fast recycle bit is set to buffer after invalidate. In Rx replenish API do not invalidate buffer if fast recycle bit is set as it is already done Change-Id: Ic74a96033a659baac381c921aff75296d155f169 CRs-Fixed: 3321142 --- dp/wifi3.0/dp_rx.h | 18 ++++++++++++++++++ dp/wifi3.0/dp_stats.c | 2 ++ dp/wifi3.0/dp_types.h | 1 + 3 files changed, 21 insertions(+) diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index 72f8d7bfcd..a683aad0a2 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -2415,6 +2415,7 @@ void dp_rx_buffers_lt_replenish_simple(struct dp_soc *soc, uint32_t mac_id, rx_desc_pool); } +#ifndef QCA_DP_NBUF_FAST_RECYCLE_CHECK static inline qdf_dma_addr_t dp_rx_nbuf_sync_no_dsb(struct dp_soc *dp_soc, qdf_nbuf_t nbuf, @@ -2425,6 +2426,23 @@ qdf_dma_addr_t dp_rx_nbuf_sync_no_dsb(struct dp_soc *dp_soc, return (qdf_dma_addr_t)qdf_mem_virt_to_phys(nbuf->data); } +#else +static inline +qdf_dma_addr_t dp_rx_nbuf_sync_no_dsb(struct dp_soc *dp_soc, + qdf_nbuf_t nbuf, + uint32_t buf_size) +{ + if (unlikely(!nbuf->fast_recycled)) { + qdf_nbuf_dma_inv_range_no_dsb((void *)nbuf->data, + (void *)(nbuf->data + buf_size)); + } else { + DP_STATS_INC(dp_soc, rx.fast_recycled, 1); + } + + nbuf->fast_recycled = 0; + return (qdf_dma_addr_t)qdf_mem_virt_to_phys(nbuf->data); +} +#endif static inline qdf_dma_addr_t dp_rx_nbuf_sync(struct dp_soc *dp_soc, diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index 15f5ac4867..676a1cd849 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -7862,6 +7862,8 @@ dp_print_soc_rx_stats(struct dp_soc *soc) DP_PRINT_STATS("No of AST Entries = %d", soc->num_ast_entries); DP_PRINT_STATS("SOC Rx Stats:\n"); + DP_PRINT_STATS("Fast recycled packets: %llu", + soc->stats.rx.fast_recycled); DP_PRINT_STATS("Fragmented packets: %u", soc->stats.rx.rx_frags); DP_PRINT_STATS("Reo reinjected packets: %u", diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index f9bab4845d..f4fab09388 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1147,6 +1147,7 @@ struct dp_soc_stats { uint32_t rxdma2rel_route_drop; /* Number of frames routed from reo*/ uint32_t reo2rel_route_drop; + uint64_t fast_recycled; struct { /* Invalid RBM error count */