Search Linux Wireless

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 25, 2021 at 12:39 PM P Praneesh <ppranees@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx>
> Signed-off-by: Sriram R <srirrama@xxxxxxxxxxxxxx>
> Signed-off-by: Jouni Malinen <jouni@xxxxxxxxxxxxxx>
> Signed-off-by: P Praneesh <ppranees@xxxxxxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux