Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10111248ybl; Thu, 26 Dec 2019 11:02:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxNvk3SsgBn1lWwggMbL0e1NcxYzFH237+MQuY5vZTUCPof3IHPYrXV2K4bVg/VBXXr0g1e X-Received: by 2002:aca:f0b:: with SMTP id 11mr2852644oip.34.1577386963830; Thu, 26 Dec 2019 11:02:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577386963; cv=none; d=google.com; s=arc-20160816; b=R/M8HH074NRv+WAM2hH69O7MrEgp4jAAqggOxpTaoeI8Vnme2s2+1Ns813yMVeK13m RrADKm+o/BbFc78NxHqF+h4DOBCXSTWOirxy9trgbvv7NeM9NXme+PbY7DMlRrj2TE1G gMpybL54h43PRzHdwJbFmJNQ2uUn/3Hn7gOSLAvWOBSeozTPZA5PPoKOOYXJBSDmmXvn 2n0eHfq8U9lMSgEqXvO3Gjz28zLGH9PIk1s3/dp44ZL68u4SLYhEkuOiAJw3cg2QeVcv s1PLFwOr6aV3eA2O6SGUVHo+f00QZ1c2uCJ9CY1SH2GCcbDaCRo5VWnHxT+bQcW3ukG2 VMFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ncp0cKjiqSNqZtUZj6kSVhT3fNnvKYgj+9vZwHCvLHU=; b=xLpMf77SLh4Lan9PophVZQlwzR3T6M5MFP0tzc4gtKfcAthQDdA/mtwcA9B9Ai/XXY NaG28mi8jqdBr6gGqwrzNnPIA0nayRybJ/If0xS3icZPeEOgRC+XmpyU+rInTAWmZM5L L7MDKK3CVtP3aiUSGgg9FFNBA7KbushifsnQsX9AUX59gcloajSDqm13nRCSI+Nw4MPG DJrtq5DYbH3TVbY0C664d5w4VwiuG01BrkmjaZ5rDTa/+LTz9kpLRX+0p2BeMbPKEsXF xotIsJO07xmpf7DwrWNEnUOf69eG3im8qeyjVajkYvbZqVpCseOtCFdxqiqb7Vi6B6GE Flzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=OG2vGorW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h203si14647482oif.3.2019.12.26.11.02.31; Thu, 26 Dec 2019 11:02:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=OG2vGorW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726943AbfLZTBQ (ORCPT + 99 others); Thu, 26 Dec 2019 14:01:16 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:33361 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726511AbfLZTBQ (ORCPT ); Thu, 26 Dec 2019 14:01:16 -0500 Received: by mail-wm1-f65.google.com with SMTP id d139so5551312wmd.0; Thu, 26 Dec 2019 11:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ncp0cKjiqSNqZtUZj6kSVhT3fNnvKYgj+9vZwHCvLHU=; b=OG2vGorWxsVVWtHw8LcxkzPlVF8DTxDoodaUSMIy1WNJTNkvvSkZRVTN8+QAcO4TF+ BeA84DgZvW64FGHilCuwScNiEckg8lvJjC1G4siYN5zQujILB1NMUkzwKGzEC3KGGlUZ Tkm578bVH9QmfnZYmUFbaErWmfWeqB1PK8jdwfkme/0Jldsdqi4XI3A1cVO52nwz6mD7 EJ+izmSGSCbYVk9y9J4DcSuMczsoLYpsXPnf7WTcFeQ+r5pUpUeGQQHK8qHx9KjjOLXT dxYkeNK3g9ji0vmpZd2jeU9cI3WrTFSTtfFnbD7spBii7q20Hbe6/Cd8a4no2QihtKF+ SHzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ncp0cKjiqSNqZtUZj6kSVhT3fNnvKYgj+9vZwHCvLHU=; b=TZ9nAsV7I0r0QRBpxqWdkoS0+r2kIwOvWI1oN9SlkhbEig9toD2ozETX+/hHWXMpfU Ns1w/DBZ9XVTKgq3uXHOeiUGeT+VfFPO11u3JPEKXJrPIzubySItmf8hfq65pnd4Zcnk qgBGtSh3o69OC6n37HWDq2H8sd6HacQ+H4h6xAcieJsbXHoORolnScBmrWOwDgY6MR+U v9dWIiKDUHB+Y9qmwtcRPsykhueAXS7TdIkKVk+PPMY1myp7aATGRVGZ/GtsglffMA63 C5E4QE3rTcxuIrpExYywi8l+lp5iQHPE11l/83VZ4hmmt+Cugr7de85qde93D2iDaMjf VdYw== X-Gm-Message-State: APjAAAVULtimJJ+1b89dzBPA8aVlBN4I9Ys3bjJOGrd6Ap04R1VkXJyL +UWwc+6dlkB3vx5CeFfTEuQ= X-Received: by 2002:a7b:c08d:: with SMTP id r13mr16253154wmh.104.1577386873950; Thu, 26 Dec 2019 11:01:13 -0800 (PST) Received: from localhost.localdomain (p200300F1373A1900428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:373a:1900:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id u18sm31777854wrt.26.2019.12.26.11.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 11:01:13 -0800 (PST) From: Martin Blumenstingl To: andrew@lunn.ch, f.fainelli@gmail.com, davem@davemloft.net, netdev@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Martin Blumenstingl Subject: [PATCH v2 0/1] dwmac-meson8b: Ethernet RGMII TX delay fix Date: Thu, 26 Dec 2019 20:01:00 +0100 Message-Id: <20191226190101.3766479-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Ethernet TX performance has been historically bad on Meson8b and Meson8m2 SoCs because high packet loss was seen. Today I (presumably) found out why this is: the input clock (which feeds the RGMII TX clock) has to be at least 4 times 125MHz. With the fixed "divide by 2" in the clock tree this means that m250_div needs to be at least 2. With this patch and a 2ns TX delay generated by either the MAC *or* the PHY this results in improved Ethernet TX performance and no packet loss anymore: # iperf3 -c 192.168.1.100 Connecting to host 192.168.1.100, port 5201 [ 5] local 192.168.1.163 port 42636 connected to 192.168.1.100 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 105 MBytes 878 Mbits/sec 0 609 KBytes [ 5] 1.00-2.00 sec 106 MBytes 885 Mbits/sec 0 683 KBytes [ 5] 2.00-3.09 sec 73.7 MBytes 570 Mbits/sec 0 683 KBytes [ 5] 3.09-4.00 sec 81.9 MBytes 754 Mbits/sec 0 795 KBytes [ 5] 4.00-5.00 sec 104 MBytes 869 Mbits/sec 0 877 KBytes [ 5] 5.00-6.00 sec 105 MBytes 878 Mbits/sec 0 877 KBytes [ 5] 6.00-7.00 sec 68.0 MBytes 571 Mbits/sec 0 877 KBytes [ 5] 7.00-8.00 sec 80.7 MBytes 676 Mbits/sec 0 877 KBytes [ 5] 8.00-9.01 sec 102 MBytes 853 Mbits/sec 0 877 KBytes [ 5] 9.01-10.00 sec 101 MBytes 859 Mbits/sec 0 877 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 927 MBytes 778 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 927 MBytes 777 Mbits/sec receiver The .dts of these boards are still using an incorrect TX delay of 4ns. This will be fixed in follow-up patches when it's clear whether the MAC really generates an RX delay and how this can be configured. Changes since v1 [0]: - update cover-letter title - dropped the .dts patches after discussion with Andrew in [1] - slightly reworded the patch description of patch #1 to indicate that the goal is to fix the TX delay generated by the MAC, without suggesting that it's recommended to let the MAC actually generate it. [0] https://patchwork.kernel.org/cover/11309887/ [1] https://patchwork.kernel.org/patch/11309891/ Martin Blumenstingl (1): net: stmmac: dwmac-meson8b: Fix the RGMII TX delay on Meson8b/8m2 SoCs .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- 2.24.1