mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 19:03:39 +00:00
154 lines
5.0 KiB
Diff
154 lines
5.0 KiB
Diff
From 00d07d474f2ee3aa8aa2945fc26e473183e9201a Mon Sep 17 00:00:00 2001
|
|
From: Anilkumar Kolli <quic_akolli@quicinc.com>
|
|
Date: Fri, 17 Dec 2021 17:16:11 +0530
|
|
Subject: [PATCH] ath11k: Fix updating rx stats with monitor vif enabled
|
|
|
|
Rx stats update fails when monitor vif is enabled.
|
|
Current code does not update rx stats from monitor
|
|
status ring if monitor vif is enabled.
|
|
Add logic to update rx stats even if monitor vif enabled.
|
|
|
|
Fixes: 1f49c59c7222 ("mac80211: Package upgrade")
|
|
|
|
Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath11k/dp_rx.c | 96 ++++++----------------
|
|
|
|
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
|
index 4e1d40a8189f..80c4e651597d 100644
|
|
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
|
@@ -4126,12 +4126,23 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
|
|
|
|
hal_status = ath11k_hal_rx_parse_mon_status(ab, ppdu_info, skb);
|
|
|
|
- if (ppdu_info->peer_id == HAL_INVALID_PEERID ||
|
|
- hal_status != HAL_RX_MON_STATUS_PPDU_DONE) {
|
|
+ if (ar->monitor_started &&
|
|
+ hal_status == HAL_RX_MON_STATUS_PPDU_DONE &&
|
|
+ pmon->mon_ppdu_status == DP_PPDU_STATUS_START) {
|
|
+ rx_mon_stats->status_ppdu_done++;
|
|
+ pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE;
|
|
+
|
|
+ if (!ab->hw_params.full_monitor_mode) {
|
|
+ ath11k_dp_rx_mon_dest_process(ar, mac_id, budget, napi);
|
|
+ pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if ((ppdu_info->peer_id == HAL_INVALID_PEERID ||
|
|
+ hal_status != HAL_RX_MON_STATUS_PPDU_DONE)) {
|
|
dev_kfree_skb_any(skb);
|
|
continue;
|
|
}
|
|
-
|
|
rcu_read_lock();
|
|
spin_lock_bh(&ab->base_lock);
|
|
peer = ath11k_peer_find_by_id(ab, ppdu_info->peer_id);
|
|
@@ -6369,76 +6380,13 @@ void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id,
|
|
}
|
|
}
|
|
|
|
-static void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar,
|
|
- int mac_id, u32 quota,
|
|
- struct napi_struct *napi)
|
|
-{
|
|
- struct ath11k_pdev_dp *dp = &ar->dp;
|
|
- struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data;
|
|
- struct hal_rx_mon_ppdu_info *ppdu_info;
|
|
- struct sk_buff *status_skb;
|
|
- u32 tlv_status = HAL_TLV_STATUS_BUF_DONE;
|
|
- struct ath11k_pdev_mon_stats *rx_mon_stats;
|
|
-
|
|
- ppdu_info = &pmon->mon_ppdu_info;
|
|
- rx_mon_stats = &pmon->rx_mon_stats;
|
|
-
|
|
- if (pmon->mon_ppdu_status != DP_PPDU_STATUS_START)
|
|
- return;
|
|
-
|
|
- while (!skb_queue_empty(&pmon->rx_status_q)) {
|
|
- status_skb = skb_dequeue(&pmon->rx_status_q);
|
|
-
|
|
- memset(ppdu_info, 0, sizeof(struct hal_rx_mon_ppdu_info));
|
|
-
|
|
- tlv_status = ath11k_hal_rx_parse_mon_status(ar->ab, ppdu_info,
|
|
- status_skb);
|
|
- if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) {
|
|
- rx_mon_stats->status_ppdu_done++;
|
|
- pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE;
|
|
- ath11k_dp_rx_mon_dest_process(ar, mac_id, quota, napi);
|
|
- pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
|
|
- }
|
|
- dev_kfree_skb_any(status_skb);
|
|
- }
|
|
-}
|
|
-
|
|
-static int ath11k_dp_mon_process_rx(struct ath11k_base *ab, int mac_id,
|
|
- struct napi_struct *napi, int budget)
|
|
-{
|
|
- struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id);
|
|
- struct ath11k_pdev_dp *dp = &ar->dp;
|
|
- struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data;
|
|
- int num_buffs_reaped = 0;
|
|
-
|
|
- num_buffs_reaped = ath11k_dp_rx_reap_mon_status_ring(ar->ab, mac_id, &budget,
|
|
- &pmon->rx_status_q);
|
|
- if (num_buffs_reaped)
|
|
- ath11k_dp_rx_mon_status_process_tlv(ar, mac_id, budget, napi);
|
|
-
|
|
- return num_buffs_reaped;
|
|
-}
|
|
-
|
|
int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id,
|
|
struct napi_struct *napi, int budget)
|
|
{
|
|
- struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id);
|
|
- int ret = 0;
|
|
-
|
|
- if (!ar->monitor_started) {
|
|
- ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget);
|
|
-
|
|
- if (ath11k_debug_is_pktlog_cbf_mode_enabled(ar))
|
|
- ret = ath11k_dp_mon_process_rx(ab, mac_id, napi, budget);
|
|
- }
|
|
- else if (!ab->hw_params.full_monitor_mode) {
|
|
- ret = ath11k_dp_mon_process_rx(ab, mac_id, napi, budget);
|
|
- }
|
|
- else {
|
|
- ret = ath11k_dp_full_mon_process_rx(ab, mac_id, napi, budget);
|
|
- }
|
|
-
|
|
- return ret;
|
|
+ if (ab->hw_params.full_monitor_mode)
|
|
+ return ath11k_dp_full_mon_process_rx(ab, mac_id, napi, budget);
|
|
+ else
|
|
+ return ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget);
|
|
}
|
|
|
|
static int ath11k_dp_rx_pdev_mon_status_attach(struct ath11k *ar)
|
|
@@ -6835,6 +6783,13 @@ int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id,
|
|
|
|
spin_lock_bh(&pmon->mon_lock);
|
|
|
|
+ pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
|
|
+ if (!ar->monitor_started) {
|
|
+ quota = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget);
|
|
+ spin_unlock_bh(&pmon->mon_lock);
|
|
+ return quota;
|
|
+ }
|
|
+
|
|
sw_mon_entries = &pmon->sw_mon_entries;
|
|
rx_mon_stats = &pmon->rx_mon_stats;
|
|
|
|
@@ -6880,7 +6835,6 @@ int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id,
|
|
}
|
|
|
|
rx_mon_stats->dest_ppdu_done++;
|
|
- pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
|
|
pmon->mon_status_buf_state = DP_MON_STATUS_LAG;
|
|
pmon->mon_status_paddr = sw_mon_entries->mon_status_paddr;
|
|
pmon->hold_mon_dst_ring = true;
|
|
--
|
|
2.7.4
|
|
|