From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 177B12BE7C6 for ; Mon, 26 Jan 2026 14:55:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769439359; cv=none; b=q5dnwXCxhUkd5yK9KsDp3VxVdYfh6q0GRecZjpolZWAV9eqdtM2WSVbt+UmegmtSYYP3xqm8mv1UsOcdNhPnBvFqcgRa4t0KaMNkFusar4lSh8eSgY1q0GeC8EE0+kbiz9koCaI0EY9RCp36AMHj/Wl23SNG/6hj3txjnaAZTY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769439359; c=relaxed/simple; bh=MDmBBGGuPsR8+N/8tM8Hw6z+AHRj6CTwlvcV3NwZhVQ=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=kb+aDJux4FAwMqQu1JBEi6V5eJPHgyWoENg1cMc4yaBQ5D1fQYwOEq/CM2twjzDGJQi2ezKgkD3ZecLT7bpT7QoOWpWhZV3epXXLD6Cg9aZh03+ORnsaTxBIt2B5Fki+QFfq7r42IDsftAVtoZ0BgSGKjA/LwjkrYw47xe3n/bQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=VPONkrhe; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VPONkrhe" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 76B291A2A53; Mon, 26 Jan 2026 14:55:55 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4B1F260717; Mon, 26 Jan 2026 14:55:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 17F1C119A860F; Mon, 26 Jan 2026 15:55:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1769439353; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4o0SETIqk3lQBmYw6tEO8k7aX0EALyrPx6wDM4E+Fk8=; b=VPONkrheDRNRn9V2KaC61AyMtfNCPIXg0+3bWkSyAljOFv/ypEIzSKRGw/d5BP1WmPKy5p 6E+6KrZ7G/jlyqHV+4njs3zoZNJ0Kb7Tr1/ztdw9RQnSIxt+CkwTzYL9kGOj7lDFJPX5Mk CmzUsefqE8KNtO+fdFPE0uEiZ2o/+9ojoaCXwIxDrOI2sPId9OdOa3G2pYg5T99icV/XE6 KKEuqV/sAVLN7YEnllM0nLoR90fbadvttrk5eCHOgQM4D5FkpB3hRsajL86xip8M+zuq2q YFIr5Jhk9wu/Eme3UnIooxrerWzuMc5iKjA0c/5URBkD7e0sEFjuG3sGf5QsAg== Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 26 Jan 2026 15:55:49 +0100 Message-Id: From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH net-next 3/8] cadence: macb: Add page pool support handle multi-descriptor frame rx Cc: "Nicolas Ferre" , "Claudiu Beznea" , "Andrew Lunn" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Lorenzo Bianconi" , =?utf-8?q?Th=C3=A9o_Lebrun?= , =?utf-8?q?Gr=C3=A9gory_Clement?= , "Thomas Petazzoni" To: "Paolo Valerio" , X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260115222531.313002-1-pvalerio@redhat.com> <20260115222531.313002-4-pvalerio@redhat.com> In-Reply-To: <20260115222531.313002-4-pvalerio@redhat.com> X-Last-TLS-Session-Version: TLSv1.3 Hi Paolo, On Thu Jan 15, 2026 at 11:25 PM CET, Paolo Valerio wrote: > Use the page pool allocator for the data buffers and enable skb recycling > support, instead of relying on netdev_alloc_skb allocating the entire skb > during the refill. > > The patch also add support for receiving network frames that span multipl= e > DMA descriptors in the Cadence MACB/GEM Ethernet driver. > > The patch removes the requirement that limited frame reception to > a single descriptor (RX_SOF && RX_EOF), also avoiding potential > contiguous multi-page allocation for large frames. [...] > --- a/drivers/net/ethernet/cadence/macb.h > +++ b/drivers/net/ethernet/cadence/macb.h > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > =20 > #define MACB_GREGS_NBR 16 > #define MACB_GREGS_VERSION 2 > @@ -1266,6 +1267,8 @@ struct macb_queue { > void *rx_buffers; > struct napi_struct napi_rx; > struct queue_stats stats; > + struct page_pool *page_pool; > + struct sk_buff *skb; There might be a cleanup issue with the GRO queue->skb field. It gets cleaned up by gem_rx() in - various error codepaths with the free_frags label, or, - the happy path where we hand off the skb with napi_gro_receive(). If we get closed in the middle of a transfer we have queue->skb that is valid. It sounds like an issue if we shutdown (and leak the SKB) or if we reopen (and have the old SKB laying around). I have not encountered this on HW, but I haven't tried. Do you agree? A job for gem_free_rx_buffers()? Thanks, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com