]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath12k: Handle PPDU spread across multiple buffers
authorP Praneesh <quic_ppranees@quicinc.com>
Mon, 23 Dec 2024 06:01:29 +0000 (11:31 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Sun, 26 Jan 2025 18:41:30 +0000 (10:41 -0800)
Each PPDU contains numerous TLV tags. HAL_RX_PPDU_START marks the start
of the PPDU, and HAL_RX_PPDU_END_STATUS_DONE marks the end. From the
monitor destination rings, the driver retrieves skb containing these
TLV tags and their corresponding data. Sometimes, one PPDU’s information
spreads across multiple skbs. The current parsing logic uses memset on
struct hal_rx_mon_ppdu_info after parsing each skb, leading to information
loss if a PPDU spans multiple skbs. Fix this by setting the
ppdu_continuation flag when the driver fails to get
HAL_RX_PPDU_END_STATUS_DONE, and do memset on struct
hal_rx_mon_ppdu_info only when the ppdu_continuation flag is not set.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Link: https://patch.msgid.link/20241223060132.3506372-12-quic_ppranees@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_mon.c
drivers/net/wireless/ath/ath12k/hal_rx.h

index a11b39ae3774522487ae4fc556e800d0081f69dc..4b35dfcbdfe1888751df8fae2844f20cb4ddd8f8 100644 (file)
@@ -2419,9 +2419,17 @@ move_next:
        if (!num_buffs_reaped)
                return 0;
 
+       /* In some cases, one PPDU worth of data can be spread across multiple NAPI
+        * schedules, To avoid losing existing parsed ppdu_info information, skip
+        * the memset of the ppdu_info structure and continue processing it.
+        */
+       if (!ppdu_info->ppdu_continuation)
+               ath12k_dp_mon_rx_memset_ppdu_info(ppdu_info);
+
        while ((skb = __skb_dequeue(&skb_list))) {
                hal_status = ath12k_dp_mon_parse_rx_dest(ar, pmon, skb);
                if (hal_status != HAL_RX_MON_STATUS_PPDU_DONE) {
+                       ppdu_info->ppdu_continuation = true;
                        dev_kfree_skb_any(skb);
                        continue;
                }
index 04e9f5f8e83ab4784fa8610a21ea9d70c32abb4b..b60c172d131b8dea3ed38767fd6dd0d81a8d265b 100644 (file)
@@ -231,6 +231,7 @@ struct hal_rx_mon_ppdu_info {
        bool first_msdu_in_mpdu;
        bool is_ampdu;
        u8 medium_prot_type;
+       bool ppdu_continuation;
 };
 
 #define HAL_RX_PPDU_START_INFO0_PPDU_ID                        GENMASK(15, 0)