Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2128600lqp; Sun, 24 Mar 2024 04:40:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXm/TaCW9U6RJXOCPzk3f1L6GwWum9BOv6SHYDhQXG0RBkCT9+PZjVIJoX2uHWODb3asZIhYs9Q8s/IMZBCCmGEgUz5aywvJWRnXcnqSg== X-Google-Smtp-Source: AGHT+IGjE2iLGmj61rs/zPQ9kYcPeHInLZ/huCu76J8vBmTmJ55Mg/GP2CKRZsMEHrQ70btcZXG8 X-Received: by 2002:a05:6512:34ca:b0:513:d6d9:b0e7 with SMTP id w10-20020a05651234ca00b00513d6d9b0e7mr2726443lfr.28.1711280404594; Sun, 24 Mar 2024 04:40:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711280404; cv=pass; d=google.com; s=arc-20160816; b=WxxaZrISn0ois9RlT7LMAeg5eynzFwAPxYA0UMLbKIa3Qj8EggAQPwi8VIh8ajiDE2 3NuFeL7GzbofWM2FwhEtDMhrojMXLdpVF0Nr/39O9ynJ6zi+ixhcxpNor+3tIJ6dOrWQ Wrc1RUFzPJcrTTEzba7wZKVdSH8k5lPQRCAQFT1lJm54ss5Pxl69VHY3g3t3WYOOb4Oa Ni5aFVmslJ9NHOmyW/paBhMDxj1agz8BW0mTJW218SOr+q8568eDRFf9ycg6H2E+hcCE tqYy5NgtSYDvowFYPeBjvscGnF5TGTdn4ORp182XZstagO7mhjorLeycpWFkruWbZVw7 vbVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/pm71XqUg2Me/5kzVzyvAIWcLcizOGK383LNxU+r5/U=; fh=XKDYj1rmEKz7uaIfXT7W2+PRgtjCpsksRJyvdhEDr+s=; b=BvlCLQnqLNP/YqTfOde+Auz8JJnVku7y8SHumTSRngnTBJtvNlgJwRN6kHoSi2AGEA 2R/tzF95sqD6t2ymIJx/O2onyO+wmG/rzuLEfyZmcxHGwx5XGSLD3Zk9AwLm9fEqR82K Odh9XI8+T9acPwuOpsDMyPS3kn25WRz82sdNbo9VUDepUPXgYcbMssrwyH6sEZM0Pvtq Y0I+Ygj/BkgM3bbtDJvF6OJyuyd8STOvGl9rHVFITFpvkHTD/Wsl0Qvh0NFFB/vebuxY Zv+NFSfP8Ovr/NadGdhZ50Gbuwwxj3AN+lEdtraQ6XJTA+Rt6ULGM2CfhMgI49g/LXsH MPHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=wpDcD+vY; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-112650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id oz11-20020a170906cd0b00b00a4737a8d237si1644816ejb.429.2024.03.24.04.40.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 04:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=wpDcD+vY; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-112650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 025A91F21432 for ; Sun, 24 Mar 2024 11:40:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3DBB179AF; Sun, 24 Mar 2024 11:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="wpDcD+vY" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 699246FB5; Sun, 24 Mar 2024 11:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711280389; cv=none; b=qJ0rKQYL3BpxH/mKY2h7anNLd5qwU7um7pHjb3cTDHVhJEK5wYbmCbuTq2x0oRXZgZdiTCg9NtkfMBHPWZffx8v/x4N8gQy3XWimPbB7RLsxRw83ifaorjsXsUCnR3B++TC4sBXeaXhBUuSm/HzsmOyNroA3XZLjSr+wsSKzHaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711280389; c=relaxed/simple; bh=3DAN+ZuR4BCK0R8mQkOH/01GQK1FQY2hVj9coW1xG4k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ksNQwmYojcfflDl1rOC2v0a6uKUfMwXMP1NHr7XivScvmCrokhPHhZ5A7K+o4Tgps5761R8uTEeAULnRhe1KN74lG/DRA1ptliWI0/aqsZtndJ2KFhl0zgSLMU18B19eJqZH6CDh8H3F4VrRrkhQQwZN53+6KaqRq567IniFEuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=wpDcD+vY; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/pm71XqUg2Me/5kzVzyvAIWcLcizOGK383LNxU+r5/U=; b=wpDcD+vYSME5DYWATYlNDH/YEg /jTLStgE7PwCf0v4Whv7leAPkpSEkEs08V3YRE91IZ0qWmO7QOBStdHNfbEwxncMIqr4agFzSG94Z eC1i59HSLICUSu/PbGSGEnjt0s2ar/Upqey60Jd3DoTiAiIrbMNSBtEVRHEOAkXFEsGBvGZaVemYs 9tb8rb+A2OBfdHY8c7uVIzCcQMLQorS6o26D9Dp67R48HrLs0Nf6ntIpYMENrpaELL/DW+qAcfWSr gyTYpakQ9VyLcSGyEoFS0wjOJ6Ja5eaXk9tf8zXSaPGi32wYs/rLH6VnAfGd+L75WSPgjlG7Fh7Lk dR4fLziA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:59938) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1roMC7-0002Ei-1W; Sun, 24 Mar 2024 11:39:19 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1roMC0-0006UM-Tn; Sun, 24 Mar 2024 11:39:13 +0000 Date: Sun, 24 Mar 2024 11:39:12 +0000 From: "Russell King (Oracle)" To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Florian Fainelli , Daniel Golle , Andrew Lunn , DENG Qingfang , Sean Wang , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , =?iso-8859-1?Q?Ren=E9?= van Dorst , SkyLake Huang , Heiner Kallweit , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 0/3] Fix EEE support for MT7531 and MT7988 SoC switch Message-ID: References: <20240318-for-net-mt7530-fix-eee-for-mt7531-mt7988-v> <00ec9779-19ce-4005-83f0-f4abf37350fc@arinc9.com> <6cb585f6-6da8-45a2-a28b-2fb556f95672@lunn.ch> <38798882-c033-4949-9446-4c6f15c25ebe@gmail.com> <0fbe7ba2-6529-4118-b050-8ea76d28b712@arinc9.com> <11b2a4d1-66d8-4bcf-b1a8-20a635b99cc4@gmail.com> <5a4c0436-cd78-419f-af14-9c4e0c0435e3@arinc9.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5a4c0436-cd78-419f-af14-9c4e0c0435e3@arinc9.com> Sender: Russell King (Oracle) On Sun, Mar 24, 2024 at 12:47:08PM +0300, Arınç ÜNAL wrote: > On 21/03/2024 18:31, Florian Fainelli wrote: > > On 3/21/24 09:09, Arınç ÜNAL wrote: > > > I have started testing MT7531 with EEE enabled and immediately experienced > > > frames that wouldn't egress the switch or improperly received on the link > > > partner. > > > > > > SoC MAC       <-EEE off-> MT7531 P6 MAC (acting as PHY) > > > MT7531 P0 MAC <-EEE on -> MT7531 P0 PHY > > > MT7531 P0 PHY <-EEE on -> Computer connected with twisted pair > > > > OK, so this is intended to describe that the SoC's Ethernet MAC link to the integrated switch did not use EEE only the user-facing ports. That makes sense because it's all digital logic and you are not going to be seeing much power saving from having EEE enabled between the SoC's Ethernet MAC and CPU port of the switch, that said, however, I wonder if this has an impact on any form of flow control within the switch that is reacting to LPI and you need EEE to be enabled end-to-end? > > I've tested pinging between my computers with EEE enabled interfaces. The > behaviour is identical. > > > > > > > > > I've tested pinging from the SoC's CPU. Packet capturing on the twisted > > > pair computer showed very few frames were being received. > > > > > > # ping 192.168.2.2 > > > PING 192.168.2.2 (192.168.2.2): 56 data bytes > > > 64 bytes from 192.168.2.2: seq=36 ttl=64 time=0.486 ms > > > ^C > > > --- 192.168.2.2 ping statistics --- > > > 64 packets transmitted, 1 packets received, 98% packet loss > > > round-trip min/avg/max = 0.486/0.486/0.486 ms > > > > > > It seems there's less loss when frames are passed more frequently. > > > > That would point to an issue getting in and out of LPI, do you see these packet losses even with different LPI timeouts? > > The NICs on my computers don't seem to allow changing the tx-lpi and > tx-timer options. > > Computer 1 (Intel I219-V, driver: e1000e): > > $ sudo ethtool --set-eee eno1 tx-timer 15 > netlink error: Invalid argument > > $ sudo ethtool --show-eee eno1 > EEE settings for eno1: > EEE status: enabled - active > Tx LPI: 17 (us) > Supported EEE link modes: 100baseT/Full > 1000baseT/Full > Advertised EEE link modes: 100baseT/Full > 1000baseT/Full > Link partner advertised EEE link modes: 100baseT/Full > 1000baseT/Full > > Computer 2 (Realtek RTL8111H, driver: r8169): > > $ sudo ethtool --set-eee eno1 tx-lpi on > > $ sudo ethtool --show-eee eno1 > EEE settings for eno1: > EEE status: enabled - active > Tx LPI: disabled > Supported EEE link modes: 100baseT/Full > 1000baseT/Full > Advertised EEE link modes: 100baseT/Full > 1000baseT/Full > Link partner advertised EEE link modes: 100baseT/Full > 1000baseT/Full > > I've tested with switch ports interfaces' tx-timer from 0 to 40, same > tx-timer for both interfaces. Loss is still there. EEE implementations tend to be a mess in the way drivers implement the API, so one can't at the moment rely on what ethtool says about the status. Sadly, this is what happens when driver authors are left to their own ends. :( > I suppose the MT7531 switch PHYs need calibration for EEE that is currently > missing from the mediatek-ge driver. EEE is quite simple from the software point of view. There is software negotiation of the modules that EEE supports, and then there is are one or more timers that affect the behaviour of EEE. The LPI timer is "how long the link needs to be idle for before _this_ end signals that it _can_ enter low power state". The link only enters low power state when *both* ends of the link signal that they can enter low power state. What calibration would be necessary? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!