[PATCH v3 3/7] wifi: ath12k: Avoid fetch Error bitmap and decap format from Rx TLV
Vasanthakumar Thiagarajan
quic_vthiagar at quicinc.com
Tue Jan 28 22:04:18 PST 2025
On 1/27/2025 5:10 PM, Karthikeyan Periyasamy wrote:
> From: P Praneesh <quic_ppranees at quicinc.com>
>
> Currently, error bitmap and decap format information are fetched from the
> MSDU Rx TLV data. This logic is inherited from ath11k. However, for ath12k
> 802.11be hardware, the Rx TLV will not be present in the MSDU data.
> Instead, this information is reported separately under the MSDU END TLV
> tag. Therefore, remove the existing fetch code, handle the MSDU END TLV
> tag and fetch the above information to store it in the mon_mpdu data
> structure for use in the merge MSDU procedure.
>
> 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 at quicinc.com>
> Signed-off-by: Karthikeyan Periyasamy <quic_periyasa at quicinc.com>
> Tested-by: Nicolas Escande <nico.escande at gmail.com>
> ---
> drivers/net/wireless/ath/ath12k/dp_mon.c | 58 ++++++++++--------------
> 1 file changed, 23 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
> index e9f53ac169b4..5be47c94bed1 100644
> --- a/drivers/net/wireless/ath/ath12k/dp_mon.c
> +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
> @@ -1733,30 +1733,26 @@ static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k *ar,
>
> static struct sk_buff *
> ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
> - struct sk_buff *head_msdu, struct sk_buff *tail_msdu,
> - struct ieee80211_rx_status *rxs, bool *fcs_err)
> + struct dp_mon_mpdu *mon_mpdu,
> + struct ieee80211_rx_status *rxs)
> {
> struct ath12k_base *ab = ar->ab;
> struct sk_buff *msdu, *mpdu_buf, *prev_buf, *head_frag_list;
> + struct sk_buff *head_msdu, *tail_msdu;
> struct hal_rx_desc *rx_desc, *tail_rx_desc;
> - u8 *hdr_desc, *dest, decap_format;
> + u8 *hdr_desc, *dest, decap_format = mon_mpdu->decap_format;
> struct ieee80211_hdr_3addr *wh;
> - u32 err_bitmap, frag_list_sum_len = 0;
> + u32 frag_list_sum_len = 0;
>
> mpdu_buf = NULL;
> + head_msdu = mon_mpdu->head;
> + tail_msdu = mon_mpdu->tail;
>
> if (!head_msdu)
> goto err_merge_fail;
>
> - rx_desc = (struct hal_rx_desc *)head_msdu->data;
> tail_rx_desc = (struct hal_rx_desc *)tail_msdu->data;
>
> - err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, tail_rx_desc);
> - if (err_bitmap & HAL_RX_MPDU_ERR_FCS)
> - *fcs_err = true;
> -
> - decap_format = ath12k_dp_rx_h_decap_type(ab, tail_rx_desc);
> -
> ath12k_dp_rx_h_ppdu(ar, tail_rx_desc, rxs);
>
> if (decap_format == DP_RX_DECAP_TYPE_RAW) {
> @@ -1985,7 +1981,8 @@ static void ath12k_dp_mon_update_radiotap(struct ath12k *ar,
>
> static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *napi,
> struct sk_buff *msdu,
> - struct ieee80211_rx_status *status)
> + struct ieee80211_rx_status *status,
> + u8 decap)
> {
> static const struct ieee80211_radiotap_he known = {
> .data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN |
> @@ -1997,7 +1994,6 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct
> struct ieee80211_sta *pubsta = NULL;
> struct ath12k_peer *peer;
> struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
> - u8 decap = DP_RX_DECAP_TYPE_RAW;
> bool is_mcbc = rxcb->is_mcbc;
> bool is_eapol_tkip = rxcb->is_eapol;
>
> @@ -2010,8 +2006,6 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct
> status->flag |= RX_FLAG_RADIOTAP_HE;
> }
>
> - if (!(status->flag & RX_FLAG_ONLY_MONITOR))
> - decap = ath12k_dp_rx_h_decap_type(ar->ab, rxcb->rx_desc);
> spin_lock_bh(&ar->ab->base_lock);
> peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu);
> if (peer && peer->sta) {
> @@ -2068,25 +2062,23 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct
> }
>
> static int ath12k_dp_mon_rx_deliver(struct ath12k *ar,
> - struct sk_buff *head_msdu, struct sk_buff *tail_msdu,
> + struct dp_mon_mpdu *mon_mpdu,
> struct hal_rx_mon_ppdu_info *ppduinfo,
> struct napi_struct *napi)
> {
> struct ath12k_pdev_dp *dp = &ar->dp;
> struct sk_buff *mon_skb, *skb_next, *header;
> struct ieee80211_rx_status *rxs = &dp->rx_status;
> - bool fcs_err = false;
> + u8 decap = DP_RX_DECAP_TYPE_RAW;
>
> - mon_skb = ath12k_dp_mon_rx_merg_msdus(ar,
> - head_msdu, tail_msdu,
> - rxs, &fcs_err);
> + mon_skb = ath12k_dp_mon_rx_merg_msdus(ar, mon_mpdu, rxs);
> if (!mon_skb)
> goto mon_deliver_fail;
>
> header = mon_skb;
> rxs->flag = 0;
>
> - if (fcs_err)
> + if (mon_mpdu->err_bitmap & HAL_RX_MPDU_ERR_FCS)
> rxs->flag = RX_FLAG_FAILED_FCS_CRC;
>
> do {
> @@ -2103,8 +2095,12 @@ static int ath12k_dp_mon_rx_deliver(struct ath12k *ar,
> rxs->flag |= RX_FLAG_ALLOW_SAME_PN;
> }
> rxs->flag |= RX_FLAG_ONLY_MONITOR;
> +
> + if (!(rxs->flag & RX_FLAG_ONLY_MONITOR))
> + decap = mon_mpdu->decap_format;
> +
> ath12k_dp_mon_update_radiotap(ar, ppduinfo, mon_skb, rxs);
> - ath12k_dp_mon_rx_deliver_msdu(ar, napi, mon_skb, rxs);
> + ath12k_dp_mon_rx_deliver_msdu(ar, napi, mon_skb, rxs, decap);
> mon_skb = skb_next;
> } while (mon_skb);
> rxs->flag = 0;
> @@ -2112,7 +2108,7 @@ static int ath12k_dp_mon_rx_deliver(struct ath12k *ar,
> return 0;
>
> mon_deliver_fail:
> - mon_skb = head_msdu;
> + mon_skb = mon_mpdu->head;
> while (mon_skb) {
> skb_next = mon_skb->next;
> dev_kfree_skb_any(mon_skb);
> @@ -2318,7 +2314,6 @@ ath12k_dp_mon_rx_parse_mon_status(struct ath12k *ar,
> struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info;
> struct dp_mon_mpdu *tmp;
> struct dp_mon_mpdu *mon_mpdu = pmon->mon_mpdu;
> - struct sk_buff *head_msdu, *tail_msdu;
> enum hal_rx_mon_status hal_status;
>
> hal_status = ath12k_dp_mon_parse_rx_dest(ar, pmon, skb);
> @@ -2327,13 +2322,9 @@ ath12k_dp_mon_rx_parse_mon_status(struct ath12k *ar,
>
> list_for_each_entry_safe(mon_mpdu, tmp, &pmon->dp_rx_mon_mpdu_list, list) {
> list_del(&mon_mpdu->list);
> - head_msdu = mon_mpdu->head;
> - tail_msdu = mon_mpdu->tail;
>
> - if (head_msdu && tail_msdu) {
> - ath12k_dp_mon_rx_deliver(ar, head_msdu,
> - tail_msdu, ppdu_info, napi);
> - }
> + if (mon_mpdu->head && mon_mpdu->tail)
> + ath12k_dp_mon_rx_deliver(ar, mon_mpdu, ppdu_info, napi);
>
> kfree(mon_mpdu);
> }
> @@ -3018,16 +3009,13 @@ ath12k_dp_mon_tx_process_ppdu_info(struct ath12k *ar,
> struct dp_mon_tx_ppdu_info *tx_ppdu_info)
> {
> struct dp_mon_mpdu *tmp, *mon_mpdu;
> - struct sk_buff *head_msdu, *tail_msdu;
>
> list_for_each_entry_safe(mon_mpdu, tmp,
> &tx_ppdu_info->dp_tx_mon_mpdu_list, list) {
> list_del(&mon_mpdu->list);
> - head_msdu = mon_mpdu->head;
> - tail_msdu = mon_mpdu->tail;
>
> - if (head_msdu)
> - ath12k_dp_mon_rx_deliver(ar, head_msdu, tail_msdu,
> + if (mon_mpdu->head)
> + ath12k_dp_mon_rx_deliver(ar, mon_mpdu,
> &tx_ppdu_info->rx_status, napi);
>
> kfree(mon_mpdu);
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan at oss.qualcomm.com>
More information about the ath12k
mailing list