[PATCH v2 11/12] ath11k: add branch predictors in dp_tx path

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


On Wed, Aug 25, 2021 at 12:39 PM P Praneesh <ppranees at codeaurora.org> wrote:
> Add branch prediction in dp_tx code path in
> tx and tx completion handlers.
>
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2
>
> 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_tx.c | 45 +++++++++++++++++----------------
>  drivers/net/wireless/ath/ath11k/mac.c   |  2 +-
>  2 files changed, 24 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
> index 8bba523..ab9ccf0 100644
> --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
> +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c

[skipped]

> @@ -432,12 +432,12 @@ static void ath11k_dp_tx_complete_msdu(struct ath11k *ar,
>
>         rcu_read_lock();
>
> -       if (!rcu_dereference(ab->pdevs_active[ar->pdev_idx])) {
> +       if (unlikely(!rcu_dereference(ab->pdevs_active[ar->pdev_idx]))) {
>                 dev_kfree_skb_any(msdu);
>                 goto exit;
>         }

This is another place where rcu_dereference() could be replaced by the
rcu_access_pointer() and the whole block could be moved above the
rcu_read_lock().

On the other hand this is an _unlikely_ path, so it looks like a
matter of taste which macro to use here.

-- 
Sergey



More information about the ath11k mailing list