From 7f8901419548cc34c91b004cd62ec75aa3023de7 Mon Sep 17 00:00:00 2001 From: Saket Jha Date: Wed, 10 Jul 2019 18:31:36 -0700 Subject: [PATCH] qcacmn: Add WAR to ignore duplicate RX desc Check if host is reaping a descriptor which is already reaped then drop RX desc processing instead of asserting. Macro DUP_RX_DESC_WAR added before dp_rx_dump_info_and_assert function which does not assert for the case WAR is enabled. Change-Id: I4f3c1cc16de79f2483cd415582970e093e81d465 CRs-Fixed: 2486057 --- dp/wifi3.0/dp_rx.c | 27 ++++++++++++++++----------- dp/wifi3.0/dp_rx.h | 10 ++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 86617ec71191..21bc8e034abe 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -45,16 +45,16 @@ static inline bool dp_rx_check_ap_bridge(struct dp_vdev *vdev) return vdev->ap_bridge_enabled; } -/* - * dp_rx_dump_info_and_assert() - dump RX Ring info and Rx Desc info - * - * @soc: core txrx main context - * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced - * @ring_desc: opaque pointer to the RX ring descriptor - * @rx_desc: host rs descriptor - * - * Return: void - */ +#ifdef DUP_RX_DESC_WAR +void dp_rx_dump_info_and_assert(struct dp_soc *soc, void *hal_ring, + void *ring_desc, struct dp_rx_desc *rx_desc) +{ + void *hal_soc = soc->hal_soc; + + hal_srng_dump_ring_desc(hal_soc, hal_ring, ring_desc); + dp_rx_desc_dump(rx_desc); +} +#else void dp_rx_dump_info_and_assert(struct dp_soc *soc, void *hal_ring, void *ring_desc, struct dp_rx_desc *rx_desc) { @@ -65,6 +65,7 @@ void dp_rx_dump_info_and_assert(struct dp_soc *soc, void *hal_ring, hal_srng_dump_ring(hal_soc, hal_ring); qdf_assert_always(0); } +#endif /* * dp_rx_buffers_replenish() - replenish rxdma ring with rx nbufs @@ -1509,6 +1510,7 @@ static inline bool dp_rx_enable_eol_data_check(struct dp_soc *soc) } #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */ + /** * dp_rx_process() - Brain of the Rx processing functionality * Called from the bottom half (tasklet/NET_RX_SOFTIRQ) @@ -1626,7 +1628,6 @@ more_data: rx_desc = dp_rx_cookie_2_va_rxdma_buf(soc, rx_buf_cookie); qdf_assert(rx_desc); - dp_rx_desc_nbuf_sanity_check(ring_desc, rx_desc); /* * this is a unlikely scenario where the host is reaping * a descriptor which it already reaped just a while ago @@ -1639,6 +1640,8 @@ more_data: dp_err("Reaping rx_desc not in use!"); dp_rx_dump_info_and_assert(soc, hal_ring, ring_desc, rx_desc); + /* ignore duplicate RX desc and continue to process */ + continue; } if (qdf_unlikely(!dp_rx_desc_check_magic(rx_desc))) { @@ -1648,6 +1651,8 @@ more_data: ring_desc, rx_desc); } + dp_rx_desc_nbuf_sanity_check(ring_desc, rx_desc); + /* TODO */ /* * Need a separate API for unmapping based on diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index e5c00fb4c079..2f22e6ca350f 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -1157,6 +1157,16 @@ int dp_wds_rx_policy_check(uint8_t *rx_tlv_hdr, struct dp_vdev *vdev, qdf_nbuf_t dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev); +/* + * dp_rx_dump_info_and_assert() - dump RX Ring info and Rx Desc info + * + * @soc: core txrx main context + * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced + * @ring_desc: opaque pointer to the RX ring descriptor + * @rx_desc: host rs descriptor + * + * Return: void + */ void dp_rx_dump_info_and_assert(struct dp_soc *soc, void *hal_ring, void *ring_desc, struct dp_rx_desc *rx_desc);