From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C877C88E4D for ; Fri, 11 Sep 2026 21:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lVlFXXS0Y6100599x+SkiEbiGjCXQZYo+KZ+IT1mUds=; b=xjwA7vP/BdVnBBBZetK9DTUpeV 4cBv7bqfeMTvHGgrQskrgJxoWkVzB79zfexSwIOD/3EUzTDpLWXIMhOiQi3S77YF5HDAWXAeconvU 4k94jt201GTfa2gaUmWKAXxPVWzgiJ1YsGOM7pVUH8Pg1BUV/BOzLXX/629PfoAP9ftZljHP/eU+/ aNk3+nNomCKkQwgSDmaVanY06meBY2jmYczm+yUFCXoaXyAgXyArG+OkDOM1m7Tqh9z41Qcu5o1B/ 8MvzPtCoOOMWYUUlo0/oOzHxNXuB5qQjtLWtmbwC7soVI9g5shSlhG29mYKT+1oq20iM3+6m+ciPN bVRYOGEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x58gr-00000000AAt-1Lrn; Fri, 11 Sep 2026 21:21:45 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x58gl-00000000A6A-0xh7 for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2026 21:21:43 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 75CD64E40240; Fri, 11 Sep 2026 21:21:37 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4A7D7601A3; Fri, 11 Sep 2026 21:21:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 803A111C7AF95; Fri, 11 Sep 2026 23:21:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1789161691; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=lVlFXXS0Y6100599x+SkiEbiGjCXQZYo+KZ+IT1mUds=; b=e0oZoW/NeajrzMZfAtHlmyRmvl8y+c82WNxSszyjf/Z9R8zzTU8zotCd+uuFOEsalNEnqT mgwFUFOgttZlV3H/Je6oYnrW8/LtkviIawv2b5BXDRb4MV+TkpbRC8QeHH61eH/F6n/Ahy H5VTdsHGHkI5UMod2Bi0gPrNh4aJybdYJ8WMVEzgYWwJ/ZzbYvBJCWNYAK7QHv74BhEACK HeXA9H4L82Zm9+JfZ1HNxlKLwfH6/rB5GMhlKCDSqnkFSsv6fgcuqKnkmOkRFx07iz6pWc 9XvMDvDRjcskGPdZShfcpEFXfiCXbXH5QYEvPDi/PVQZcOx14AkEc3uLSp8aSw== From: Maxime Chevallier To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Heiner Kallweit , =?UTF-8?q?Alexis=20Lothor=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, Nicolai Buchwitz Cc: Maxime Chevallier , 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 Subject: [PATCH net v3 6/6] net: stmmac: selftests: Account for alignment shift on dwmac1000 for Jumbo test Date: Fri, 11 Sep 2026 23:20:26 +0200 Message-ID: <20260911212028.1497613-7-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260911212028.1497613-1-maxime.chevallier@bootlin.com> References: <20260911212028.1497613-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260911_142139_416309_3CB588C0 X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On dwmac1000, we currently only support single-descriptor frames. The Jumbo test started failing when NET_IP_ALIGN was added to align the IP header, as this tests tries to send the biggest possible frame. On dwmac1000 the DMA transfer is aligned on 4-bytes, so adding a 2-byte shift at the start-of-buffer address means it takes a whole extra 4-byte DMA burst to receive the Jumbo packet, causing it to spill over the next descriptor. This doesn't seem to happen on dwmac4 and xgmac that appear to correctly handle unaligned xfers (only tested on dwmac4) Let's account for that in the Jumbo test, reduce the size of our big packet by the align size. Fixes: 23680bf5f8c6 ("net: stmmac: restore NET_IP_ALIGN in the RX DMA offset") Reviewed-by: Nicolai Buchwitz Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index 315c3cf82230..cd7dc99095a0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -1781,6 +1781,9 @@ static int __stmmac_test_jumbo(struct stmmac_priv *priv, u16 queue) struct stmmac_packet_attrs attr = { }; int size = priv->dma_conf.dma_buf_sz; + if (!dwmac_is_xmac(priv->plat->core_type)) + size -= NET_IP_ALIGN; + attr.dst = priv->dev->dev_addr; attr.max_size = size - ETH_FCS_LEN; attr.queue_mapping = queue; -- 2.55.0