From nobody Fri Apr 3 20:55:00 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8116E37104E; Mon, 23 Mar 2026 08:21:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774254078; cv=none; b=ktKJEMgSz70bHSGc5o1Z3tBlB/7WRUqffysE80lBzEcY1JeEV/tgl6c1WjTbqkfeKnr9lMYM0KTFmPp7HGN5lwq3OmF1zBJH9D3NZZcP6++hPvex6rOM10Qv02Zel7uBXgP+SWM9dTilqB0mB3hRjc5g5F5vRiHU+S5FQ+4uwRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774254078; c=relaxed/simple; bh=qNhWPu5HjvRRDOABzZBW+TX71Rg3S7gQG7xVx4hvlHc=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=gDHRNsijHZltDLP3Up1bwbx6YIVRdgaz/lOCGA7P6UiZOZ3OrTAWt0rYCnO1vLQzGLdjTFwgN3Gi219RguHCyL7cAM/CpaCPlJ7mBCfaQOd8lohtgjd1kC7vbX7TRd1BfWdAbpNMx8RmiBd5nq8EjkFzouOC1HE/qcOSIUnemFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=CKdi5VuT; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="CKdi5VuT" Received: by linux.microsoft.com (Postfix, from userid 1204) id 6499420B710C; Mon, 23 Mar 2026 01:21:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6499420B710C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1774254077; bh=v/zgGi4KnjBvHxMREYCKdbfOdu/jxb/Ui7FVSLqycy4=; h=Date:From:To:Subject:From; b=CKdi5VuTiQB9IpVdyfyTwIqnm2v5nCt8M4S98WbE+nU4Bs7FnNXyNQv+m68595nGQ Cna+S0Tdh54funfgEyq0yYe31AuP6dK5HkNIXnCJ/4iUIBcMA4fa1iwQaD0ClLYX9i cffIZcdJNXtclSuWBRw4Sj4wT82C6dshpXRokKHU= Date: Mon, 23 Mar 2026 01:21:17 -0700 From: Dipayaan Roy To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, leon@kernel.org, longli@microsoft.com, kotaranov@microsoft.com, horms@kernel.org, shradhagupta@linux.microsoft.com, ssengar@linux.microsoft.com, ernis@linux.microsoft.com, shirazsaleem@microsoft.com, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, stephen@networkplumber.org, dipayanroy@microsoft.com Subject: [PATCH net] net: mana: Fix RX skb truesize accounting Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" MANA passes rxq->alloc_size to napi_build_skb() for all RX buffers. It is correct for fragment-backed RX buffers, where alloc_size matches the actual backing allocation used for each packet buffer. However, in the non-fragment RX path mana allocates a full page, or a higher-order page, per RX buffer. In that case alloc_size only reflects the usable packet area and not the actual backing memory. This causes napi_build_skb() to underestimate the skb backing allocation in the single-buffer RX path, so skb->truesize is derived from a value smaller than the real RX buffer allocation. Fix this by updating alloc_size in the non-fragment RX path to the actual backing allocation size before it is passed to napi_build_skb(). Fixes: 730ff06d3f5c ("net: mana: Use page pool fragments for RX buffers ins= tead of full pages to improve memory efficiency.") Signed-off-by: Dipayaan Roy --- drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/et= hernet/microsoft/mana/mana_en.c index ea71de39f996..884f8e548174 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -766,6 +766,13 @@ static void mana_get_rxbuf_cfg(struct mana_port_contex= t *apc, } =20 *frag_count =3D 1; + + /* In the single-buffer path, napi_build_skb() must see the + * actual backing allocation size so skb->truesize reflects + * the full page (or higher-order page), not just the usable + * packet area. + */ + *alloc_size =3D PAGE_SIZE << get_order(*alloc_size); return; } =20 --=20 2.43.0