* [PATCH] ath11k: Make the tx_status_fifo for each Tx completion ring
@ 2019-04-24 4:48 Karthikeyan Periyasamy
2019-05-02 13:31 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Karthikeyan Periyasamy @ 2019-04-24 4:48 UTC (permalink / raw)
To: ath11k; +Cc: Karthikeyan Periyasamy
tx_statu_fifo is allocated with DP_TX_COMP_RING_SIZE and used
by three Tx completion ring, which get full when we start
Tx with different AC packets. To avoid this resource error,
Make the tx_status_fifo for each tx completion ring with
DP_TX_COMP_RING_SIZE, so that Tx path will not encounter
the resource full error.
Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
---
drivers/net/wireless/ath/ath11k/dp.c | 22 ++++++++++++----------
drivers/net/wireless/ath/ath11k/dp.h | 10 +++++-----
drivers/net/wireless/ath/ath11k/dp_tx.c | 19 +++++++++----------
3 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index 127eb56..5a7b480 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -820,9 +820,11 @@ void ath11k_dp_free(struct ath11k_base *sc)
ath11k_dp_tx_pending_cleanup, sc);
idr_destroy(&dp->tx_ring[i].txbuf_idr);
spin_unlock_bh(&dp->tx_ring[i].tx_idr_lock);
- }
- kfifo_free(&dp->tx_status_fifo);
+ spin_lock_bh(&dp->tx_ring[i].tx_status_lock);
+ kfifo_free(&dp->tx_ring[i].tx_status_fifo);
+ spin_unlock_bh(&dp->tx_ring[i].tx_status_lock);
+ }
/* Deinit any SOC level resource */
}
@@ -850,19 +852,19 @@ int ath11k_dp_alloc(struct ath11k_base *sc)
if (ret)
goto fail_link_desc_cleanup;
+ size = roundup_pow_of_two(DP_TX_COMP_RING_SIZE);
+
for (i = 0; i < DP_TCL_NUM_RING_MAX; i++) {
idr_init(&dp->tx_ring[i].txbuf_idr);
spin_lock_init(&dp->tx_ring[i].tx_idr_lock);
dp->tx_ring[i].tcl_data_ring_id = i;
- }
- size = roundup_pow_of_two(DP_TX_COMP_RING_SIZE);
-
- spin_lock_init(&dp->tx_status_lock);
- ret = kfifo_alloc(&dp->tx_status_fifo, size,
- GFP_KERNEL);
- if (ret)
- goto fail_cmn_srng_cleanup;
+ spin_lock_init(&dp->tx_ring[i].tx_status_lock);
+ ret = kfifo_alloc(&dp->tx_ring[i].tx_status_fifo, size,
+ GFP_KERNEL);
+ if (ret)
+ goto fail_cmn_srng_cleanup;
+ }
for (i = 0; i < HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX; i++)
ath11k_hal_tx_set_dscp_tid_map(sc, i);
diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h
index 5674053..efdfb5f 100644
--- a/drivers/net/wireless/ath/ath11k/dp.h
+++ b/drivers/net/wireless/ath/ath11k/dp.h
@@ -65,6 +65,11 @@ struct dp_tx_ring {
u32 num_tx_pending;
/* 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 ath11k_pdev_dp {
@@ -158,11 +163,6 @@ struct ath11k_dp {
struct list_head reo_cmd_cache_flush_list;
/* protects access to reo_cmd_list and reo_cmd_cache_flush_list */
spinlock_t reo_cmd_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;
};
/* HTT definitions */
diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index b2807a8..88f7fb1 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -435,7 +435,7 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
struct sk_buff *msdu;
struct hal_wbm_release_ring tx_status;
struct hal_tx_status ts;
- struct dp_tx_ring *tx_ring;
+ struct dp_tx_ring *tx_ring = &dp->tx_ring[ring_id];
u32 *desc;
u32 msdu_id;
u8 pool_id;
@@ -446,27 +446,27 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
ath11k_hal_srng_access_begin(ab, status_ring);
- spin_lock_bh(&dp->tx_status_lock);
- while (!kfifo_is_full(&dp->tx_status_fifo) &&
+ spin_lock_bh(&tx_ring->tx_status_lock);
+ while (!kfifo_is_full(&tx_ring->tx_status_fifo) &&
(desc = ath11k_hal_srng_dst_get_next_entry(ab, status_ring))) {
ath11k_hal_tx_status_desc_sync((void *)desc,
(void *)&tx_status);
- kfifo_put(&dp->tx_status_fifo, tx_status);
+ kfifo_put(&tx_ring->tx_status_fifo, tx_status);
}
if ((ath11k_hal_srng_dst_peek(ab, status_ring) != NULL) &&
- kfifo_is_full(&dp->tx_status_fifo)) {
+ kfifo_is_full(&tx_ring->tx_status_fifo)) {
/* TODO: Process pending tx_status messages when kfifo_is_full() */
ath11k_warn(ab, "Unable to process some of the tx_status ring desc because status_fifo is full \n");
}
- spin_unlock_bh(&dp->tx_status_lock);
+ spin_unlock_bh(&tx_ring->tx_status_lock);
ath11k_hal_srng_access_end(ab, status_ring);
spin_unlock_bh(&status_ring->lock);
- spin_lock_bh(&dp->tx_status_lock);
- while (kfifo_get(&dp->tx_status_fifo, &tx_status)) {
+ spin_lock_bh(&tx_ring->tx_status_lock);
+ while (kfifo_get(&tx_ring->tx_status_fifo, &tx_status)) {
memset(&ts, 0, sizeof(ts));
ath11k_hal_tx_status_parse(ab, &tx_status, &ts);
@@ -474,7 +474,6 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
pool_id = FIELD_GET(DP_TX_DESC_ID_POOL_ID, ts.desc_id);
msdu_id = FIELD_GET(DP_TX_DESC_ID_MSDU_ID, ts.desc_id);
tcl_id = ath11k_txq_tcl_ring_map[pool_id];
- tx_ring = &dp->tx_ring[tcl_id];
if (ts.buf_rel_source == HAL_WBM_REL_SRC_MODULE_FW) {
ath11k_dp_process_htt_tx_complete(ab,
@@ -506,7 +505,7 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
*/
ath11k_dp_tx_complete_msdu(ar, msdu, &ts);
}
- spin_unlock_bh(&dp->tx_status_lock);
+ spin_unlock_bh(&tx_ring->tx_status_lock);
}
int ath11k_dp_send_reo_cmd(struct ath11k_base *ab, struct dp_rx_tid *rx_tid,
--
1.9.1
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ath11k: Make the tx_status_fifo for each Tx completion ring
2019-04-24 4:48 [PATCH] ath11k: Make the tx_status_fifo for each Tx completion ring Karthikeyan Periyasamy
@ 2019-05-02 13:31 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-05-02 13:31 UTC (permalink / raw)
To: Karthikeyan Periyasamy; +Cc: ath11k
Karthikeyan Periyasamy <periyasa@codeaurora.org> writes:
> tx_statu_fifo is allocated with DP_TX_COMP_RING_SIZE and used
> by three Tx completion ring, which get full when we start
> Tx with different AC packets. To avoid this resource error,
> Make the tx_status_fifo for each tx completion ring with
> DP_TX_COMP_RING_SIZE, so that Tx path will not encounter
> the resource full error.
>
> Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
Applied.
--
Kalle Valo
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-02 13:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-24 4:48 [PATCH] ath11k: Make the tx_status_fifo for each Tx completion ring Karthikeyan Periyasamy
2019-05-02 13:31 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox