From 66b1bab7feb1202ee8e971b0de7bc4441d4faf1d Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Thu, 5 Nov 2020 14:52:46 +0530 Subject: [PATCH] qcacld-3.0: Fix wrong calculation of DP thread stats In FISA path number of list elements in head nbuf is not updated, leading to wrong calculation of dp thread stats and packets are dropped. Update the number of list elements in head nbuf before flush. During calculation of outstanding packets to be processed by dp rx thread take rx flushed packets into consideration. Change-Id: Id96ceee71e035fdbe17f0da4b662c6f848296fbd CRs-Fixed: 2811001 --- core/dp/txrx3.0/dp_fisa_rx.c | 2 ++ core/dp/txrx3.0/dp_rx_thread.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/dp/txrx3.0/dp_fisa_rx.c b/core/dp/txrx3.0/dp_fisa_rx.c index 8c198697c8c6..f5f127396978 100644 --- a/core/dp/txrx3.0/dp_fisa_rx.c +++ b/core/dp/txrx3.0/dp_fisa_rx.c @@ -1303,6 +1303,7 @@ dp_rx_fisa_flush_udp_flow(struct dp_vdev *vdev, } qdf_nbuf_set_next(fisa_flow->head_skb, NULL); + QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(fisa_flow->head_skb) = 1; if (fisa_flow->last_skb) qdf_nbuf_set_next(fisa_flow->last_skb, NULL); @@ -1773,6 +1774,7 @@ pull_nbuf: head_nbuf); deliver_nbuf: /* Deliver without FISA */ + QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(head_nbuf) = 1; qdf_nbuf_set_next(head_nbuf, NULL); hex_dump_skb_data(head_nbuf, false); if (!vdev->osif_rx || QDF_STATUS_SUCCESS != diff --git a/core/dp/txrx3.0/dp_rx_thread.c b/core/dp/txrx3.0/dp_rx_thread.c index b8e6b7c37410..8b2c6415e4bc 100644 --- a/core/dp/txrx3.0/dp_rx_thread.c +++ b/core/dp/txrx3.0/dp_rx_thread.c @@ -154,6 +154,7 @@ QDF_STATUS dp_check_and_update_pending(struct dp_rx_tm_handle_cmn uint32_t rx_pending_lo_threshold; uint32_t nbuf_queued_total = 0; uint32_t nbuf_dequeued_total = 0; + uint32_t rx_flushed_total = 0; uint32_t pending = 0; int i; @@ -184,11 +185,14 @@ QDF_STATUS dp_check_and_update_pending(struct dp_rx_tm_handle_cmn rx_tm_hdl->rx_thread[i]->stats.nbuf_queued_total; nbuf_dequeued_total += rx_tm_hdl->rx_thread[i]->stats.nbuf_dequeued; + rx_flushed_total += + rx_tm_hdl->rx_thread[i]->stats.rx_flushed; } } - if (nbuf_queued_total > nbuf_dequeued_total) - pending = nbuf_queued_total - nbuf_dequeued_total; + if (nbuf_queued_total > (nbuf_dequeued_total + rx_flushed_total)) + pending = nbuf_queued_total - (nbuf_dequeued_total + + rx_flushed_total); if (unlikely(pending > rx_pending_hl_threshold)) qdf_atomic_set(&rx_tm_hdl->allow_dropping, 1);