Thread (17 messages) 17 messages, 3 authors, 2021-08-25

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

From: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Date: 2021-08-25 23:01:48
Also in: ath11k

On Wed, Aug 25, 2021 at 12:39 PM P Praneesh [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
Signed-off-by: Sriram R <redacted>
Signed-off-by: Jouni Malinen <redacted>
Signed-off-by: P Praneesh <redacted>
---
 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]
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help