summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath11k/dp.h
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2019-12-13 18:38:38 +0300
committerKalle Valo <kvalo@codeaurora.org>2019-12-18 20:39:59 +0300
commitd0998eb84ed3cc02c15f92b07223735ddbbe9b06 (patch)
tree986ca99cf9a78b0d8ff4779b85d05bbed9486f28 /drivers/net/wireless/ath/ath11k/dp.h
parent8cfa7ef8127b00de1ce0275a85220c331fe9a4d0 (diff)
downloadlinux-d0998eb84ed3cc02c15f92b07223735ddbbe9b06.tar.xz
ath11k: optimise ath11k_dp_tx_completion_handler
the current code does 4 memcpys for each completion frame. 1) duplicate the desc 2 + 3) inside kfifo insertion 4) kfifo remove The code simply drops the kfifo and uses a trivial ring buffer. This requires a single memcpy for insertion. There is no removal needed as we can simply use the inserted data for processing. As the code runs inside the NAPI context it is atomic and there is no need for most of the locking. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/dp.h')
-rw-r--r--drivers/net/wireless/ath/ath11k/dp.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h
index f7e53509ae07..2f0980f2c762 100644
--- a/drivers/net/wireless/ath/ath11k/dp.h
+++ b/drivers/net/wireless/ath/ath11k/dp.h
@@ -6,7 +6,6 @@
#ifndef ATH11K_DP_H
#define ATH11K_DP_H
-#include <linux/kfifo.h>
#include "hal_rx.h"
struct ath11k_base;
@@ -58,6 +57,8 @@ struct dp_rxdma_ring {
int bufs_max;
};
+#define ATH11K_TX_COMPL_NEXT(x) (((x) + 1) % DP_TX_COMP_RING_SIZE)
+
struct dp_tx_ring {
u8 tcl_data_ring_id;
struct dp_srng tcl_data_ring;
@@ -65,11 +66,9 @@ struct dp_tx_ring {
struct idr txbuf_idr;
/* Protects txbuf_idr and num_pending */
spinlock_t tx_idr_lock;
- DECLARE_KFIFO_PTR(tx_status_fifo, struct hal_wbm_release_ring);
- /* lock to protect tx_status_fifo because tx_status_fifo can be
- * accessed concurrently.
- */
- spinlock_t tx_status_lock;
+ struct hal_wbm_release_ring *tx_status;
+ int tx_status_head;
+ int tx_status_tail;
};
struct ath11k_pdev_mon_stats {