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 2F8CF37E300 for ; Fri, 18 Sep 2026 12:45:42 +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=1789735547; cv=none; b=u+HCT1ihy/axrpfd7aqpBAFelvCTxIyBXX7W9cOhK8BIo9GfNYVFmb1us02PQ9UxJ5N23U6NDGf7VyVqzEZ38A0Jz0UK/4hAk5LvtFr0r/ta3ottBLSLrNQJBAvybj6g+h2Zuv7K28g1Mcn0kRG20UhYmVEN7KRyUT0/TzQq2+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789735547; c=relaxed/simple; bh=iWjO1eSo+3/EJWsO63nQhJLs5VsBn4+/GTQ15xaFdP8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=M2P2BvDY0U9dXLAkfs5r0CW1HT2OAYB7MheXsqBrSxJxtyzMkp//HcvpleqgWygJu4CSSm5Ue9CHoqWPXPgon02O5opU+blYhxoJX1DavWh2EPwcXxdDuoLAgRffaGMf/cR6E5lx/x7H3aaLjZSBttxFtAW6rwaLwIoL89MbxCc= 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=meBchw49; 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="meBchw49" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 9DC551A0979; Fri, 18 Sep 2026 12:45:35 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6718860649; Fri, 18 Sep 2026 12:45:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8411110328E57; Fri, 18 Sep 2026 14:45:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1789735534; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=wDnz042JhVx8TouMwH/GponpahIwHIiyB0UKPpUXJhA=; b=meBchw49EU3xYhJ2R+QquSCXhUZhoes8nlbjSzVB+TRW9BDqkMcAIzkt7zkR3aylnWG62l oePWdC51PtWnOwkOOT8oKe57qmJqDqkCKcZh528nSwchgU4a8YN4KI+v+/JmMuRpuaDwPy E2r7s5g5hDvOYsl+iapbu9v1lF+xdb9ErqBX4CrqhfkKQH+TtYM2XQSEhq54G//LXFFr/O t+R7rRJf11mzaF2Pd0I7175KWvgQYWbm3xYThqxJl4PnVbbmJWKepTfvr+4AQuuZbPUD+p nRhotCmyam8ZPHAby10qIsjAKFO09pGUbrxmrdI788XtveRAHzOLobph5sYUFQ== Message-ID: Date: Fri, 18 Sep 2026 14:45:10 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v4 5/7] net: stmmac: dwmac4: Use the correct bufzise when the len is exactly 8K To: Nicolai Buchwitz Cc: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Heiner Kallweit , =?UTF-8?Q?Alexis_Lothor=C3=A9?= , Maxime Coquelin , Alexandre Torgue , Emil Renner Berthing , Minda Chen , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Jan Petrous , Ovidiu Panait , Jose.Abreu@synopsys.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, PKneuper@dspace.de, David Laight References: <20260917215339.2022523-1-maxime.chevallier@bootlin.com> <20260917215339.2022523-6-maxime.chevallier@bootlin.com> <4b3c26c482ac1d26f39b53fea072e4d1@tipi-net.de> Content-Language: en-US From: Maxime Chevallier In-Reply-To: <4b3c26c482ac1d26f39b53fea072e4d1@tipi-net.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 On 9/18/26 14:25, Nicolai Buchwitz wrote: > Hi Maxime > > On 17.9.2026 23:53, Maxime Chevallier wrote: >> DMA bufsize selection isn't made on the MTU but the actual frame length, >> so including the L2 header. On DWMAC4, if the len is exactly BUF_SIZE_8KiB, >> the next larger size is incorrectly selected. >> >> Lets fix the comparison and while at it, rename the parameter from len >> to mtu. > > Isn't it "[...] from mtu to len"? :( Bah, if respin is required I'll fix this >> >> Fixes: c3efed5ad1b0 ("net: stmmac: Enable dwmac4 jumbo frame more than 8KiB"). >> Signed-off-by: Maxime Chevallier >> --- >>  drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 4 ++-- >>  drivers/net/ethernet/stmicro/stmmac/hwif.h         | 2 +- >>  drivers/net/ethernet/stmicro/stmmac/ring_mode.c    | 4 ++-- >>  3 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c >> index 2994df41ec2c..c6a8f8d73501 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c >> @@ -474,11 +474,11 @@ static void dwmac4_set_sarc(struct dma_desc *p, u32 sarc_type) >>                        sarc_type)); >>  } >> >> -static int set_16kib_bfsize(int mtu) >> +static int set_16kib_bfsize(int len) >>  { >>      int ret = 0; >> >> -    if (unlikely(mtu >= BUF_SIZE_8KiB)) >> +    if (unlikely(len > BUF_SIZE_8KiB)) > > Should we drop set_16kib_bfsize() instead? > > After 6/7 it looks to me like the same test as the first branch of > stmmac_set_bfsize(). The caller ends up there anyway when it returns 0 > and chain_mode_ops doesn't have it at all. True yeah :) however maybe we can wait for this to be merged and have the cleanup in net-next ? Sashiko is getting crazy with the "pre-existing issues" everytime we touch stmmac, cleanups are long overdue and this could be included in there :( Maxime