mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 10:51:27 +00:00
132 lines
4.6 KiB
Diff
132 lines
4.6 KiB
Diff
From 007787692b3b906b9ff917d7aed6a11683b5c2f1 Mon Sep 17 00:00:00 2001
|
|
From: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
|
|
Date: Tue, 26 Sep 2023 16:57:22 +0530
|
|
Subject: [PATCH] wifi: ath12k: Drop dynamic fragmentation msdu in Multi-link
|
|
|
|
In MLO, dynamic fragmentation only supported. In that scenario, primary
|
|
UMAC expect partner buffer but this support not yet added. So drop the msdu
|
|
instead of panic assert.
|
|
|
|
In process rx error handler, once drop msdu detected the subsequent
|
|
msdu get dropped unintentionally due to previous drop flag retained
|
|
across the all msdu processing, which is wrong. So fix this issue by
|
|
reset the drop flag to false before processing each descriptor.
|
|
|
|
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath12k/dp_rx.c | 38 ++++++++++++++-----------
|
|
1 file changed, 22 insertions(+), 16 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
|
|
@@ -4353,6 +4353,7 @@ int ath12k_dp_rx_process_err(struct ath1
|
|
{
|
|
u32 msdu_cookies[HAL_NUM_RX_MSDUS_PER_LINK_DESC];
|
|
struct dp_link_desc_bank *link_desc_banks;
|
|
+ struct ath12k_base *src_ab;
|
|
enum hal_rx_buf_return_buf_manager rbm;
|
|
int tot_n_bufs_reaped, quota, ret, i;
|
|
struct dp_rxdma_ring *rx_ring;
|
|
@@ -4364,7 +4365,7 @@ int ath12k_dp_rx_process_err(struct ath1
|
|
struct ath12k *ar = NULL;
|
|
dma_addr_t paddr;
|
|
u32 *desc;
|
|
- bool is_frag, drop = false;
|
|
+ bool is_frag, drop;
|
|
char buf[64] = {0};
|
|
u8 hw_link_id;
|
|
|
|
@@ -4373,7 +4374,6 @@ int ath12k_dp_rx_process_err(struct ath1
|
|
|
|
dp = &ab->dp;
|
|
reo_except = &dp->reo_except_ring;
|
|
- link_desc_banks = dp->link_desc_banks;
|
|
|
|
srng = &ab->hal.srng_list[reo_except->ring_id];
|
|
|
|
@@ -4403,38 +4403,41 @@ int ath12k_dp_rx_process_err(struct ath1
|
|
ar = rcu_dereference(ab->ag->hw_links[hw_link_id]);
|
|
else
|
|
ar = NULL;
|
|
-
|
|
rcu_read_unlock();
|
|
|
|
- if (!ar || ar->ab != ab) {
|
|
- ath12k_err(ab, "invalid src link id %d drop %d on chip id %d err process\n",
|
|
- hw_link_id, drop, ab->chip_id);
|
|
+ if (!ar) {
|
|
+ ath12k_err(ab, "invalid src link id %d on chip id %d err process\n",
|
|
+ hw_link_id, ab->chip_id);
|
|
|
|
ath12k_err_dump(ab, NULL, "rx err desc: ", reo_desc,
|
|
sizeof(*reo_desc), srng);
|
|
BUG_ON(1);
|
|
}
|
|
|
|
+ src_ab = ar->ab;
|
|
+
|
|
/* Below case is added to handle data packet from un-associated clients.
|
|
* As it is expected that AST lookup will fail for
|
|
* un-associated station's data packets.
|
|
*/
|
|
if (u32_get_bits(reo_desc->info0, HAL_REO_DEST_RING_INFO0_BUFFER_TYPE) ==
|
|
HAL_REO_DEST_RING_BUFFER_TYPE_MSDU) {
|
|
- ath12k_dp_h_msdu_buffer_type(ab, desc);
|
|
+ ath12k_dp_h_msdu_buffer_type(src_ab, desc);
|
|
continue;
|
|
}
|
|
|
|
+ dp = &src_ab->dp;
|
|
+ link_desc_banks = dp->link_desc_banks;
|
|
link_desc_va = link_desc_banks[desc_bank].vaddr +
|
|
(paddr - link_desc_banks[desc_bank].paddr);
|
|
ath12k_hal_rx_msdu_link_info_get(link_desc_va, &num_msdus, msdu_cookies,
|
|
&rbm);
|
|
if (rbm != dp->idle_link_rbm_id &&
|
|
rbm != HAL_RX_BUF_RBM_SW3_BM &&
|
|
- rbm != ab->hw_params->hal_params->rx_buf_rbm) {
|
|
+ rbm != src_ab->hw_params->hal_params->rx_buf_rbm) {
|
|
ab->soc_stats.invalid_rbm++;
|
|
ath12k_warn(ab, "invalid return buffer manager %d\n", rbm);
|
|
- ath12k_dp_rx_link_desc_return(ab, desc,
|
|
+ ath12k_dp_rx_link_desc_return(src_ab, desc,
|
|
HAL_WBM_REL_BM_ACT_REL_MSDU);
|
|
continue;
|
|
}
|
|
@@ -4443,18 +4446,22 @@ int ath12k_dp_rx_process_err(struct ath1
|
|
|
|
/* Process only rx fragments with one msdu per link desc below, and drop
|
|
* msdu's indicated due to error reasons.
|
|
+ * Dynamic fragmentation not supported in Multi-link client, so drop.
|
|
*/
|
|
- if (!is_frag || num_msdus > 1) {
|
|
+ if (!is_frag || num_msdus > 1 || src_ab != ab)
|
|
drop = true;
|
|
+ else
|
|
+ drop = false;
|
|
+
|
|
+ if (drop) {
|
|
/* Return the link desc back to wbm idle list */
|
|
- ath12k_dp_rx_link_desc_return(ab, desc,
|
|
+ ath12k_dp_rx_link_desc_return(src_ab, desc,
|
|
HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);
|
|
+
|
|
+ ar->wmm_stats.total_wmm_rx_drop[ar->wmm_stats.rx_type] += num_msdus;
|
|
}
|
|
|
|
for (i = 0; i < num_msdus; i++) {
|
|
- if (drop)
|
|
- ar->wmm_stats.total_wmm_rx_drop[ar->wmm_stats.rx_type]++;
|
|
-
|
|
if (!ath12k_dp_process_rx_err_buf(ar, desc, drop,
|
|
msdu_cookies[i]))
|
|
tot_n_bufs_reaped++;
|
|
@@ -4473,6 +4480,7 @@ exit:
|
|
|
|
spin_unlock_bh(&srng->lock);
|
|
|
|
+ dp = &ab->dp;
|
|
rx_ring = &dp->rx_refill_buf_ring;
|
|
|
|
ath12k_dp_rx_bufs_replenish(ab, rx_ring, tot_n_bufs_reaped,
|