From patchwork Thu Feb 6 03:53:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan Periyasamy X-Patchwork-Id: 862963 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA9002B9BF for ; Thu, 6 Feb 2025 03:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738814083; cv=none; b=tHQE0E4XkMDQID+Cs19OdxqUQHFUaeKu4AYoQ14pG0EFAx3w3RfbgDl/AU/3wy59Arnlb7X9OOn0UOQ0qqJ7zylO7NFC8dHcX1flOlFoujSF57kHB/oD46I3qCO8fbYjkXqsVB3bjy/Q7oeRZ4OAUuOdF65R0RfACGplguH7wqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738814083; c=relaxed/simple; bh=kJgQOAfT3XKYqK3Bay/SiROCez9k2uQJXO5uiAOTUGY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=suoeXgrv58lBbVsFIJP7uACmtSGk0hpjk+HKpSt0Qglk+hbZz7g/P6UR7HOBQqWdkVv1T23Ckzyi/8r3o4WMBDEg3q4odFepBHtlaWuErpDR2c4vH/EahotogZv9vvgWm04cJ66A10tRwOCCJwL6yDUfHZhTBzCo07w5jzwgT5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Wce36Nu9; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Wce36Nu9" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5160Pclc022435; Thu, 6 Feb 2025 03:54:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= xZBViIe3/bPXAObLa3bBX3g0zLDw8fllayPJwrytkTg=; b=Wce36Nu9dRTI4sCQ ZCzNllCGCj3pESMJ/uoO6uZuhBmMT6CJguuvFtBdr6jJQZuNBehsNH4Rb0hRngAC Wqbh/FM7qq76J15+ugFiheQFDrTScQzT6WLEMr6h+pgJe1/mS8IUunq+JUoRbF8o 7NdesFGFeEMGgBPWUZi336HZ8xz1/Y4CqixnPcdCFgayjHH94PZo++8o9dAtc6E8 5FByT3tFxQq9M1Nx9WeZmQykkWwq1gNw/A/k7FsLqcj1G2AcagYCdjug7Wc901qu LSZIf57TzXkYDcGJslMZmAQh6wzdZQ01NMlB6mwmgSSJ/rs+38UFVa7m4kOZGuqS nuEIXA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44mj2dre3d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Feb 2025 03:54:38 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 5163sbhd003122 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 6 Feb 2025 03:54:37 GMT Received: from hu-periyasa-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 5 Feb 2025 19:54:35 -0800 From: Karthikeyan Periyasamy To: CC: , P Praneesh , Nicolas Escande , Vasanthakumar Thiagarajan , Karthikeyan Periyasamy Subject: [PATCH v5 6/7] wifi: ath12k: Avoid packet offset and FCS length from Rx TLV Date: Thu, 6 Feb 2025 09:23:56 +0530 Message-ID: <20250206035357.310868-7-quic_periyasa@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250206035357.310868-1-quic_periyasa@quicinc.com> References: <20250206035357.310868-1-quic_periyasa@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: xAtFYFZgGyHuxgiT9ynoE6kXgrba_YEY X-Proofpoint-ORIG-GUID: xAtFYFZgGyHuxgiT9ynoE6kXgrba_YEY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-06_01,2025-02-05_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 mlxlogscore=672 clxscore=1015 priorityscore=1501 mlxscore=0 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502060029 From: P Praneesh Currently, the packet offset and FCS length are fetched from the MSDU Rx TLV data, a logic inherited from ath11k. However, for ath12k 802.11be hardware, the Rx TLV will not be present in the MSDU data. Instead, this information is constant. Therefore, remove the existing FCS trim and the packet offset fetch code. Handle the packet offset with the constant 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 Tested-by: Nicolas Escande Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Karthikeyan Periyasamy --- drivers/net/wireless/ath/ath12k/dp_mon.c | 23 +++++------------------ drivers/net/wireless/ath/ath12k/dp_mon.h | 1 + 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index ae925a281fdd..f2836b0b8953 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c @@ -1688,18 +1688,6 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k *ar, return HAL_RX_MON_STATUS_PPDU_NOT_DONE; } -static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k *ar, - struct sk_buff *head_msdu, - struct sk_buff *tail_msdu) -{ - u32 rx_pkt_offset, l2_hdr_offset; - - rx_pkt_offset = ar->ab->hal.hal_desc_sz; - l2_hdr_offset = - ath12k_dp_rx_h_l3pad(ar->ab, (struct hal_rx_desc *)tail_msdu->data); - skb_pull(head_msdu, rx_pkt_offset + l2_hdr_offset); -} - static void ath12k_dp_mon_fill_rx_stats_info(struct ath12k *ar, struct hal_rx_mon_ppdu_info *ppdu_info, @@ -1815,7 +1803,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar, { 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 sk_buff *head_msdu; struct hal_rx_desc *rx_desc; u8 *hdr_desc, *dest, decap_format = mon_mpdu->decap_format; struct ieee80211_hdr_3addr *wh; @@ -1825,7 +1813,6 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar, mpdu_buf = NULL; head_msdu = mon_mpdu->head; - tail_msdu = mon_mpdu->tail; if (!head_msdu) goto err_merge_fail; @@ -1855,14 +1842,14 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar, ath12k_dp_mon_fill_rx_rate(ar, ppdu_info, rxs); if (decap_format == DP_RX_DECAP_TYPE_RAW) { - ath12k_dp_mon_rx_msdus_set_payload(ar, head_msdu, tail_msdu); + skb_pull(head_msdu, ATH12K_MON_RX_PKT_OFFSET); prev_buf = head_msdu; msdu = head_msdu->next; head_frag_list = NULL; while (msdu) { - ath12k_dp_mon_rx_msdus_set_payload(ar, msdu, tail_msdu); + skb_pull(msdu, ATH12K_MON_RX_PKT_OFFSET); if (!head_frag_list) head_frag_list = msdu; @@ -1874,7 +1861,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar, prev_buf->next = NULL; - skb_trim(prev_buf, prev_buf->len - HAL_RX_FCS_LEN); + skb_trim(prev_buf, prev_buf->len); if (head_frag_list) { skb_shinfo(head_msdu)->frag_list = head_frag_list; head_msdu->data_len = frag_list_sum_len; @@ -1897,7 +1884,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar, msdu = head_msdu; while (msdu) { - ath12k_dp_mon_rx_msdus_set_payload(ar, msdu, tail_msdu); + skb_pull(msdu, ATH12K_MON_RX_PKT_OFFSET); if (qos_pkt) { dest = skb_push(msdu, sizeof(__le16)); if (!dest) diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.h b/drivers/net/wireless/ath/ath12k/dp_mon.h index b039f6b9277c..9f3adee51cb2 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.h +++ b/drivers/net/wireless/ath/ath12k/dp_mon.h @@ -10,6 +10,7 @@ #include "core.h" #define ATH12K_MON_RX_DOT11_OFFSET 5 +#define ATH12K_MON_RX_PKT_OFFSET 8 enum dp_monitor_mode { ATH12K_DP_TX_MONITOR_MODE,