[PATCH v2 07/12] ath11k: add branch predictors in process_rx

Sergey Ryazanov ryazanov.s.a at gmail.com
Wed Aug 25 15:49:02 PDT 2021


On Wed, Aug 25, 2021 at 12:39 PM P Praneesh <ppranees at codeaurora.org> wrote:
> In datapath, add branch predictors where required in the process rx().
> This protects high value rx path without having performance overhead.
>
> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1
>
> Co-developed-by: Sriram R <srirrama at codeaurora.org>
> Signed-off-by: Sriram R <srirrama at codeaurora.org>
> Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
> Signed-off-by: P Praneesh <ppranees at codeaurora.org>
> ---
>  drivers/net/wireless/ath/ath11k/dp_rx.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
> index e105bdc..5d805881 100644
> --- a/drivers/net/wireless/ath/ath11k/dp_rx.c
> +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
> @@ -2535,13 +2535,13 @@ static void ath11k_dp_rx_process_received_packets(struct ath11k_base *ab,
>         rcu_read_lock();
>
>         ar = ab->pdevs[mac_id].ar;
> -       if (!rcu_dereference(ab->pdevs_active[mac_id])) {
> +       if (unlikely(!rcu_dereference(ab->pdevs_active[mac_id]))) {
>                 __skb_queue_purge(msdu_list);
>                 rcu_read_unlock();
>                 return;
>         }

The pointer that is returned by the rcu_dereference() is not
dereferenced, so it is preferable to use rcu_access_pointer() here.

And since rcu_access_pointer() did not require the RCU protection, the
whole block with check and list purging could be moved before the
rcu_read_lock() call.

-- 
Sergey



More information about the ath11k mailing list