From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796397883; b=rYmr+XwBwxDPtAJGeyX7NMPbgF4WTogaFMYZ2y55nmdQ8+zZkU47urSgBRJlWFUOA72s Z2g89CZ2icJ57pRon/a0hHw6GhrhU2T+6LNDVyCH1T4TF6zSmfKLyfp8PoEv/HsQ/LkaP vNV2xkp/RE+UjIUmnIQQoKe6j4paLsiQhdgf0pec6edvXo6kK18285/q/YRjVVlJDT6GK tLkyNNeIPHoEMyhHodVaSvHP1WakrhmfhRMRsmsWLDgE0P9H/GwxImERBCpstsiWcOEdF 2l/vag31KG1TrlVOfs6qOo0bRRZKNjyOjd7j57/66ie6TUN2XUtQWpHEB2dCLJBD91w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796397883; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Authority-Analysis: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Info:X-Proofpoint-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=vpMuE83eHrYGFKykc7PklAntCSG5nSIzWXk0TuVQyhU=; b=OPIzAcir7pwAbCpjIjevnlo4GIxgTcR4aSZmbDMML6Q8MamO8w17iKOMfN/cS3De7+aB uSE7LUXS9PIb58k+Xi6WIT0Tgw/FK1vheendB5fZIwVk2NT0vTP+3x18FAwmoVqILIUzy AYDTr0B36ulbQAtOJPxG0Kft9wBjPFdJ6hwBu6wZMWA+w+oVh7K69HNUL3Zs2/aw9irtQ De0CnSGDNZt8dbkLjK+JzzBQB8x+bmkdoOJR8gffFcYbkdwGATmRgftUEzACA0UIpJ9XK pg4cpg6RXDKzoPGV0mrBXx6PNWnGDHgmOQ3Gqadd4D9EzCB/S0jfgXUW8fHexiysNNA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=CXr5NMmf; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=RVLN5Zjf; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63D84606A322 for ; Fri, 4 Dec 2026 15:24:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 63D84606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=CXr5NMmf; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=RVLN5Zjf Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4EQcHC4096408 for ; Fri, 4 Dec 2026 15:24:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=vpMuE83eHrYGFKykc7PklAnt CSG5nSIzWXk0TuVQyhU=; b=CXr5NMmf/pIR11cLeSWoCB+yWvrMaUU6abNlRnjw xaOG2bGMdDv8kQinYIoMZNTvMGzBt6A/Y5EHDX+LLoo6d3k76Nne5DJCivU9UqjU 4IXzbyiw7qC/Xie99fNI+/zlVZ7bd3JO3/wFeXpt630epJL10D6Pcn/FboMJt6PM m31lERKoX/5wlTuH41w/CdwF68aV20FWddZ4uwAw/lTf3vlthE5WHLD2aBBaKoCu YpS70PepWk2afGfMDSusAxb+vR0IV+HujmH/rfh5B7ld3vem9XKj5jL22XpSWjfd 0T7xfHeptFT5cBer62lsLBBtFiDWC00Kd/U8qlxMSKcsIw== Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jbq7qsty9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 04 Dec 2026 15:24:42 +0000 (GMT) Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-8b4bb8bf464so13916067b3.2 for ; Fri, 04 Dec 2026 07:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796397882; x=1797002682; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=vpMuE83eHrYGFKykc7PklAntCSG5nSIzWXk0TuVQyhU=; b=RVLN5ZjfqoEG4H52F5rRtFN1ip+PGpXpgjV9iGeNM1y/iNmZ8bZV7Idd9O38UVwaOT /gSF6sUHct37hvsNoQdJwn7HMfcfl7GzRkyOQlTUgY21VRdfKiZGwB4ZVifUD7Xx+v91 89J/3cYMgu3JUjAgyZHkdMXLQOW+CUuF9C94es5lJSW9RoHfflaKfYOyy/dQJDO24cJW pChBPMqM3wgTuRAV9tqdZ/hxLpQfsIeP85/M0m/BIgSsQrEmt9kQwRxMJzoTP04TbwwK 0fWK89drDNdIj8G1FD5Zn7bYj6v7LzDZI27hrmeFLSdbZJri60LG8YYIwlovF7lbslYi IR0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796397882; x=1797002682; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=vpMuE83eHrYGFKykc7PklAntCSG5nSIzWXk0TuVQyhU=; b=qULy2bgG6xNv3czxutheW3ubEkmhd5bdcwCIrAO39VKUVh8ivf6n+/6VnrIqWLJrzU M+RoTJF+l3nIcDPtsQG2XhZTbNML1sJEdBHTS4WMP+yL6JpdcU4Ag2zEMsJePVf9+xgT rl/QhcGhIZMSEaDsVsST1lbBw3/dAGvc9AbjimRKvsorWi8Mibo7fTVDDrmyq+IIeIQQ JTxgsgQyVgbkihuP67iUuGoX+fKfY8MYKUdi6Szv7T6v2N4i2GRdGlzczqKhOplhiOCb YVeftkQDbx8N4OQ/+bUdMujV/nGpnF0k1nlLIuZDhPQLE4LAqXEUC2zOa9y/4xK6EucH /BRA== X-Forwarded-Encrypted: i=1; AL+hErHs46IWUil+/ojY+TRlY4re4c8Qxpl3KTC+hKmewWeL/Nt20247z5gwutzG0dgRIxnqMUUsbtBZ3kABgFCQrg==@vger.kernel.org X-Gm-Message-State: AB4q+uES7BfXS0QQ8f5WfUMYZWMK6xbZJsNg4yaHiQMP1KxTRBYdyB8m zsFhuKzElxcbNIwNCiMhnBJo1pQttyhJ7o6LjwnzFYAHUFqhyl+IlBS5b7VdkA5gHd/lrWZrH1X qwsiw+vbukMMlvz5hMrT5PGB/MCJwVp8mWO+eZU5OhD9sAus0BCyEWr45LqvNvoWjOgZaLQ== X-Gm-Gg: AZFdTZfmCJeJc1gzxBRCzwQuBeyB5lzNXj1FTEoEjmnk6J/i8Hh9tXWWTszTU0BwYPM /omWfiAzCppumSXXl7pG+0pyAfDqyl1xLBVxsJSFiGyA2mmPEwwME0hGpjiZiNp0bhJscuFB3fs lq+8PffVRqEjWGK7ErnjIbp6mSXc+GtpJQN1fq/toAby4EPocGwOdr69gtkHrdjm+7+oySBjN6B arvnVOQ8NDF8yYPi0KjrGQ1nWltesMqiNc6BWexxcBdbAph7wJNoCH6Cc1pwFEiAn0o5MKbAfYy voUEaTx0wJwfms3cleF1tN1EDng1655fFzSkPm5ZYajNgohfp4BHR7q7fPqiGaQYRoXr/doa5GS W4yd0KxdK+CE9WxN6nzLsLANZVdHuyKKY+rLdK9Fz1x5W5RgvKa+IiCAQ5n5fmw== X-Received: by 2002:a05:690e:4006:b0:67e:58f:5736 with SMTP id 956f58d0204a3-67f6eca41eamr927928d50.77.1796397881109; Fri, 04 Dec 2026 07:24:41 -0800 (PST) X-Received: by 2002:a05:690e:4006:b0:67e:58f:5736 with SMTP id 956f58d0204a3-67f6eca41eamr927911d50.77.1796397880452; Fri, 04 Dec 2026 07:24:40 -0800 (PST) Received: from localhost ([130.25.105.85]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbea2acc6esm65276305e9.14.2026.12.04.07.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 07:24:39 -0800 (PST) Date: Fri, 4 Dec 2026 16:24:38 +0100 From: Lorenzo Bianconi To: Vasanthakumar Thiagarajan Cc: Jeff Johnson , Baochen Qiang , Carl Huang , Bhagavathi Perumal S , Pradeep Kumar Chitrapu , Karthikeyan Periyasamy , Sriram R , Ramya Gnanasekar , Wen Gong , P Praneesh , Balamurugan Selvarajan , linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, Jeff Johnson Subject: Re: [PATCH ath-next v2 4/4] wifi: ath12k: use ieee80211_rx_list() to deliver packets to mac80211 Message-ID: References: <20261113-ath12k-rx-avoid-realloc-v2-0-46d186f8688b@oss.qualcomm.com> <20261113-ath12k-rx-avoid-realloc-v2-4-46d186f8688b@oss.qualcomm.com> <8f3969c6-3f95-4251-a628-c8239578d7d5@oss.qualcomm.com> X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YveFCg1vkwcuAoYF" Content-Disposition: inline In-Reply-To: <8f3969c6-3f95-4251-a628-c8239578d7d5@oss.qualcomm.com> X-Authority-Analysis: v=2.4 cv=Ne9zRGD4 c=1 sm=1 tr=0 ts=6b12db3a cx=c_pps a=g1v0Z557R90hA0UpD/5Yag==:117 a=RcFDq6c+avmIvxkL9iwlxA==:17 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=VKocS1VX_NnpdBhnEqcA:9 a=CjuIK1q_8ugA:10 a=nnwUs0Bb4toIsA4c468A:9 a=MFSWADHSvvjO3QEy5MdX:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA0MDA2MSBTYWx0ZWRfX3ak7/vp5pAIT BmrjiH016wG+HjM/l2c7la1B7/9Ls1dLn0/JJf0kp+E6t3ePFGoVUJcMfHFvOeD4F/kM10zdpEb B+xeR2BpCtVeNQ0xhfnk5lyU18Im/HuaUGFNEcaeBr0CCYPybjRe+mkpyZJ19Wwjuc7e++9HOWI h8qoQDod8gQG6Ro0d3nVoNn8TUcLyPYsPYmzTttDQd7DZKBcHXpLMoLnaLi8+KIEqpRFIFqOOLH 9eXA/MVEdv3FfQoYX149j3g/EUJ7NgEAfupOJnM067vcRmZTJPEQurukibA9A2Si7v1skotcUM9 zOgarabodDzeRhrObk84SgPWuYFcSLuPavmVbQdES4AM3/xbfWcARUxGuztOtMdeJqsZezhoqiV +hFAT7hOEAPzzoazfGd8W1BtzvIyuIkX83wecgYJW0iNQcfV1shuuOsAH+M8rD+zOn7MDIdiy/B i/HdlqBDjA5mlgZAeyA== X-Proofpoint-ORIG-GUID: NjS4d7ZPUHP7Hai7w79oDAJ2J7_6fz7D X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA0MDA2MSBTYWx0ZWRfXw1lC31sYFxfb 6end/y4JDqZri9oa1uTqpqYtvSh8JqNEY3XPpxZ8VB+3BZZhzbxRQngCC2Q3F15UNDqxUFss6Cs S/jj7yn5OwOFI958V4cmZPQpKq/Ey44= X-Proofpoint-GUID: NjS4d7ZPUHP7Hai7w79oDAJ2J7_6fz7D X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-04_03,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 malwarescore=0 clxscore=1015 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612040061 --YveFCg1vkwcuAoYF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable >=20 >=20 > On 13-11-2026 20:21, Lorenzo Bianconi wrote: > > Currently the regular rx path hands MSDUs to mac80211 one by one through > > ieee80211_rx_napi(), and MSDUs spread over multiple rx buffers > > (MSDU_CONTINUATION) are first linearized by > > ath12k_wifi7_dp_rx_msdu_coalesce(), which may require a > > pskb_expand_head() reallocation. > >=20 > > Rework the receive path to collect processed frames on a list and > > deliver them to mac80211 as a batch with ieee80211_rx_list(), feeding > > the result to napi_gro_receive() once the received packets have been > > processed. Delivering frames in batches improves the icache footprint > > and lets GRO process more frames together. > >=20 > > While at it, drop the linearization for multi-buffer MSDUs: chain the > > continuation buffers on the head skb with frag_list and deliver a single > > (possibly non-linear) skb per MSDU, running the per-frame processing > > (h_ppdu, h_mpdu, link station lookup and rx_status copy) only on the > > head. > >=20 > > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0= _SILICONZ_UPSTREAM-3 > >=20 > > Signed-off-by: Lorenzo Bianconi > > --- > > drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c | 257 +++++++++++++----= --------- > > 1 file changed, 126 insertions(+), 131 deletions(-) > >=20 > > diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c b/drivers/ne= t/wireless/ath/ath12k/wifi7/dp_rx.c > > index f151f7de5554..c51faac4eb20 100644 > > --- a/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c > > +++ b/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c > > @@ -441,114 +441,28 @@ static int ath12k_wifi7_dp_rx_h_mpdu(struct ath1= 2k_pdev_dp *dp_pdev, > > return 0; > > } > > -static int ath12k_wifi7_dp_rx_msdu_coalesce(struct ath12k_hal *hal, > > - struct sk_buff_head *msdu_list, > > - struct sk_buff *first, struct sk_buff *last, > > - u8 l3pad_bytes, int msdu_len, > > - struct hal_rx_desc_data *rx_info) > > -{ > > - struct sk_buff *skb; > > - struct ath12k_skb_rxcb *rxcb =3D ATH12K_SKB_RXCB(first); > > - int buf_first_hdr_len, buf_first_len; > > - struct hal_rx_desc *ldesc; > > - int space_extra, rem_len, buf_len; > > - u32 hal_rx_desc_sz =3D hal->hal_desc_sz; > > - bool is_continuation; > > - > > - /* As the msdu is spread across multiple rx buffers, > > - * find the offset to the start of msdu for computing > > - * the length of the msdu in the first buffer. > > - */ > > - buf_first_hdr_len =3D hal_rx_desc_sz + l3pad_bytes; > > - buf_first_len =3D DP_RX_BUFFER_SIZE - buf_first_hdr_len; > > - > > - if (WARN_ON_ONCE(msdu_len <=3D buf_first_len)) { > > - skb_put(first, buf_first_hdr_len + msdu_len); > > - skb_pull(first, buf_first_hdr_len); > > - return 0; > > - } > > - > > - ldesc =3D (struct hal_rx_desc *)last->data; > > - rxcb->is_first_msdu =3D rx_info->is_first_msdu; > > - rxcb->is_last_msdu =3D rx_info->is_last_msdu; > > - > > - /* MSDU spans over multiple buffers because the length of the MSDU > > - * exceeds DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. So assume the data > > - * in the first buf is of length DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. > > - */ > > - skb_put(first, DP_RX_BUFFER_SIZE); > > - skb_pull(first, buf_first_hdr_len); > > - > > - /* When an MSDU spread over multiple buffers MSDU_END > > - * tlvs are valid only in the last buffer. Copy those tlvs. > > - */ > > - ath12k_dp_rx_desc_end_tlv_copy(hal, rxcb->rx_desc, ldesc); > > - > > - space_extra =3D msdu_len - (buf_first_len + skb_tailroom(first)); > > - if (space_extra > 0 && > > - (pskb_expand_head(first, 0, space_extra, GFP_ATOMIC) < 0)) { > > - /* Free up all buffers of the MSDU */ > > - while ((skb =3D __skb_dequeue(msdu_list)) !=3D NULL) { > > - rxcb =3D ATH12K_SKB_RXCB(skb); > > - if (!rxcb->is_continuation) { > > - dev_kfree_skb_any(skb); > > - break; > > - } > > - dev_kfree_skb_any(skb); > > - } > > - return -ENOMEM; > > - } > > - > > - rem_len =3D msdu_len - buf_first_len; > > - while ((skb =3D __skb_dequeue(msdu_list)) !=3D NULL && rem_len > 0) { > > - rxcb =3D ATH12K_SKB_RXCB(skb); > > - is_continuation =3D rxcb->is_continuation; > > - if (is_continuation) > > - buf_len =3D DP_RX_BUFFER_SIZE - hal_rx_desc_sz; > > - else > > - buf_len =3D rem_len; > > - > > - if (buf_len > (DP_RX_BUFFER_SIZE - hal_rx_desc_sz)) { > > - WARN_ON_ONCE(1); > > - dev_kfree_skb_any(skb); > > - return -EINVAL; > > - } > > - > > - skb_put(skb, buf_len + hal_rx_desc_sz); > > - skb_pull(skb, hal_rx_desc_sz); > > - skb_copy_from_linear_data(skb, skb_put(first, buf_len), > > - buf_len); > > - dev_kfree_skb_any(skb); > > - > > - rem_len -=3D buf_len; > > - if (!is_continuation) > > - break; > > - } > > - > > - return 0; > > -} > > - > > static int ath12k_wifi7_dp_rx_process_msdu(struct ath12k_pdev_dp *dp_= pdev, > > struct sk_buff *msdu, > > struct sk_buff_head *msdu_list, > > - struct hal_rx_desc_data *rx_info) > > + struct hal_rx_desc_data *rx_info, > > + struct list_head *list) > > { > > - struct ath12k_dp *dp =3D dp_pdev->dp; > > + struct ieee80211_rx_status *rx_status =3D IEEE80211_SKB_RXCB(msdu); > > + struct ieee80211_rx_status *status =3D rx_info->rx_status; > > + struct ath12k_skb_rxcb *rxcb =3D ATH12K_SKB_RXCB(msdu); > > + struct sk_buff *last_buf, *frag_list =3D NULL; > > + struct ieee80211_link_sta *link_sta =3D NULL; > > struct hal_rx_desc *rx_desc, *lrx_desc; > > - struct ath12k_skb_rxcb *rxcb; > > - struct sk_buff *last_buf; > > + int ret, msdu_len, rx_desc_headroom; > > + struct ath12k_dp *dp =3D dp_pdev->dp; > > struct ath12k_hal *hal =3D dp->hal; > > - u8 l3_pad_bytes; > > - u16 msdu_len; > > - int ret; > > - u32 hal_rx_desc_sz =3D hal->hal_desc_sz; > > + struct ath12k_dp_peer *peer; > > last_buf =3D ath12k_dp_rx_get_msdu_last_buf(msdu_list, msdu); > > if (!last_buf) { > > ath12k_warn(dp->ab, > > "No valid Rx buffer to access MSDU_END tlv\n"); > > - ret =3D -EIO; > > - goto free_out; > > + return -EIO; > > } > > rx_desc =3D (struct hal_rx_desc *)msdu->data; > > @@ -557,56 +471,131 @@ static int ath12k_wifi7_dp_rx_process_msdu(struc= t ath12k_pdev_dp *dp_pdev, > > ath12k_dp_extract_rx_desc_data(hal, rx_info, rx_desc, lrx_desc); > > if (!rx_info->msdu_done) { > > ath12k_warn(dp->ab, "msdu_done bit in msdu_end is not set\n"); > > - ret =3D -EIO; > > - goto free_out; > > + return -EIO; > > } > > - rxcb =3D ATH12K_SKB_RXCB(msdu); > > rxcb->rx_desc =3D rx_desc; > > + rxcb->is_first_msdu =3D rx_info->is_first_msdu; > > + rxcb->is_last_msdu =3D rx_info->is_last_msdu; > > msdu_len =3D rx_info->msdu_len; > > - l3_pad_bytes =3D rx_info->l3_pad_bytes; > > + rx_desc_headroom =3D hal->hal_desc_sz + rx_info->l3_pad_bytes; > > + /* When an MSDU spread over multiple buffers MSDU_END > > + * tlvs are valid only in the last buffer. Copy those tlvs. > > + */ > > + if (rxcb->is_continuation) > > + ath12k_dp_rx_desc_end_tlv_copy(hal, rxcb->rx_desc, lrx_desc); > > if (rxcb->is_frag) { > > - skb_pull(msdu, hal_rx_desc_sz); > > - } else if (!rxcb->is_continuation) { > > - if ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE) { > > - ret =3D -EINVAL; > > - ath12k_warn(dp->ab, "invalid msdu len %u\n", msdu_len); > > - ath12k_dbg_dump(dp->ab, ATH12K_DBG_DATA, NULL, "", rx_desc, > > - sizeof(*rx_desc)); > > - goto free_out; > > - } > > - skb_put(msdu, hal_rx_desc_sz + l3_pad_bytes + msdu_len); > > - skb_pull(msdu, hal_rx_desc_sz + l3_pad_bytes); > > + skb_pull(msdu, hal->hal_desc_sz); > > } else { > > - ret =3D ath12k_wifi7_dp_rx_msdu_coalesce(hal, msdu_list, > > - msdu, last_buf, > > - l3_pad_bytes, msdu_len, > > - rx_info); > > - if (ret) { > > - ath12k_warn(dp->ab, > > - "failed to coalesce msdu rx buffer%d\n", ret); > > - goto free_out; > > + if (!rxcb->is_continuation && > > + msdu_len + hal->hal_desc_sz > DP_RX_BUFFER_SIZE) { > > + ath12k_warn(dp->ab, "invalid msdu len %u\n", msdu_len); > > + ath12k_dbg_dump(dp->ab, ATH12K_DBG_DATA, NULL, "", > > + rx_desc, sizeof(*rx_desc)); > > + return -EINVAL; > > } > > + > > + if (!rxcb->is_continuation || > > + msdu_len <=3D DP_RX_BUFFER_SIZE - rx_desc_headroom) > > + skb_put(msdu, rx_desc_headroom + msdu_len); > > + else > > + skb_put(msdu, DP_RX_BUFFER_SIZE); > > + skb_pull(msdu, rx_desc_headroom); > > } > > - if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, msdu, > > - rx_info))) { > > - ret =3D -EINVAL; > > - goto free_out; > > + if (!rxcb->is_frag && rxcb->is_continuation) { > > + unsigned int frag_len =3D 0, truesize =3D 0; > > + struct sk_buff *skb, *last_frag; > > + > > + /* The MSDU is spread across multiple rx buffers */ > > + msdu_len -=3D (DP_RX_BUFFER_SIZE - rx_desc_headroom); > > + > > + while (msdu_len > 0) { > > + struct ath12k_skb_rxcb *cb; > > + int len; > > + > > + skb =3D __skb_dequeue(msdu_list); > > + if (!skb) { > > + WARN_ON_ONCE(msdu_len > 0); > > + goto free_frag_list; > > + } > > + > > + cb =3D ATH12K_SKB_RXCB(skb); > > + if (cb->is_continuation) > > + len =3D DP_RX_BUFFER_SIZE - hal->hal_desc_sz; > > + else > > + len =3D msdu_len; > > + > > + if (len > DP_RX_BUFFER_SIZE - hal->hal_desc_sz) { > > + dev_kfree_skb_any(skb); > > + goto free_frag_list; > > + } > > + > > + skb_put(skb, len + hal->hal_desc_sz); > > + skb_pull(skb, hal->hal_desc_sz); > > + > > + if (!frag_list) > > + frag_list =3D skb; > > + else > > + last_frag->next =3D skb; > > + > > + skb->next =3D NULL; > > + last_frag =3D skb; > > + > > + msdu_len -=3D len; > > + frag_len +=3D skb->len; > > + truesize +=3D skb->truesize; > > + if (!cb->is_continuation) > > + break; > > + } > > + > > + if (frag_list) { > > + skb_shinfo(msdu)->frag_list =3D frag_list; > > + msdu->data_len =3D frag_len; > > + msdu->len +=3D frag_len; > > + msdu->truesize +=3D truesize; > > + msdu->next =3D NULL; > > + } >=20 > nit: This multi-buffer MSDU processingt and frag_list preparation along w= ith > the clean ups can be better done in a separate function? ack, I will fix it in v3. Regards, Lorenzo >=20 --YveFCg1vkwcuAoYF Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCaxLbNgAKCRA6cBh0uS2t rHk+AP9eBbLibzTg59F8yBjLl90WQdrKrZgiy/txZmY4VDCIGAEAgcTSOqLtO1ut M2O8cVQor8POgh0HCriOFo73n0pxGwA= =ayLZ -----END PGP SIGNATURE----- --YveFCg1vkwcuAoYF--