From 4c39342f6a2475b8dbd97739004e9f241f7ad448 Mon Sep 17 00:00:00 2001 From: Varsha Mishra Date: Thu, 9 Apr 2020 22:41:40 +0530 Subject: [PATCH] qcacmn: Lockless access of reo destination rings Remove lock to access REO destination rings because 4 rings are accessed in 4 individual cores. Change-Id: Ia3f92cc5136dbdbeea1e9cda8d52b474356a3e1a CRs-Fixed: 2660901 --- dp/wifi3.0/dp_rx.c | 4 ++-- dp/wifi3.0/dp_rx.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 4055b008fc..fe6402ba7c 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -1886,7 +1886,7 @@ more_data: qdf_mem_zero(head, sizeof(head)); qdf_mem_zero(tail, sizeof(tail)); - if (qdf_unlikely(dp_srng_access_start(int_ctx, soc, hal_ring_hdl))) { + if (qdf_unlikely(dp_rx_srng_access_start(int_ctx, soc, hal_ring_hdl))) { /* * Need API to convert from hal_ring pointer to @@ -2081,7 +2081,7 @@ more_data: break; } done: - dp_srng_access_end(int_ctx, soc, hal_ring_hdl); + dp_rx_srng_access_end(int_ctx, soc, hal_ring_hdl); for (mac_id = 0; mac_id < MAX_PDEV_CNT; mac_id++) { /* diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index fb2d94c474..c07d841f66 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -1192,4 +1192,51 @@ void dp_rx_deliver_to_stack(struct dp_soc *soc, qdf_nbuf_t nbuf_head, qdf_nbuf_t nbuf_tail); +#ifdef QCA_OL_RX_LOCK_LESS_ACCESS +/* + * dp_rx_ring_access_start()- Wrapper function to log access start of a hal ring + * @int_ctx: pointer to DP interrupt context + * @dp_soc - DP soc structure pointer + * @hal_ring_hdl - HAL ring handle + * + * Return: 0 on success; error on failure + */ +static inline int +dp_rx_srng_access_start(struct dp_intr *int_ctx, struct dp_soc *soc, + hal_ring_handle_t hal_ring_hdl) +{ + return hal_srng_access_start_unlocked(soc->hal_soc, hal_ring_hdl); +} + +/* + * dp_rx_ring_access_end()- Wrapper function to log access end of a hal ring + * @int_ctx: pointer to DP interrupt context + * @dp_soc - DP soc structure pointer + * @hal_ring_hdl - HAL ring handle + * + * Return - None + */ +static inline void +dp_rx_srng_access_end(struct dp_intr *int_ctx, struct dp_soc *soc, + hal_ring_handle_t hal_ring_hdl) +{ + hal_srng_access_end_unlocked(soc->hal_soc, hal_ring_hdl); +} +#else +static inline int +dp_rx_srng_access_start(struct dp_intr *int_ctx, struct dp_soc *soc, + hal_ring_handle_t hal_ring_hdl) +{ + return dp_srng_access_start(int_ctx, soc, hal_ring_hdl); +} + +static inline void +dp_rx_srng_access_end(struct dp_intr *int_ctx, struct dp_soc *soc, + hal_ring_handle_t hal_ring_hdl) +{ + dp_srng_access_end(int_ctx, soc, hal_ring_hdl); +} + +#endif + #endif /* _DP_RX_H */