Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3515509imw; Mon, 18 Jul 2022 09:25:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vk8u3s9TQDRFXL7mPuiktyLR8Dx7v1TDQMBM2GNBO+clITuG2+sRHfGd9iG50fzEvSBBN/ X-Received: by 2002:a17:90a:1d0:b0:1ec:7066:49b8 with SMTP id 16-20020a17090a01d000b001ec706649b8mr33642865pjd.163.1658161551381; Mon, 18 Jul 2022 09:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658161551; cv=none; d=google.com; s=arc-20160816; b=aVbF9OXtaxOjvwe1jbyRlGOiYHDm8yAccFhne8PoCf1Emehdl9ZGx9cJxLDu4fR7Lk pDGv4n4tECLi+VtQz8SyeWA3CAykqy7TpYz7B8+ut0+hesfBh24DEcV2K9DD4ZPrXcth Hf5iwq+onsuJzop3Me5LHnlI+Fhr3WaJetDaVUnAxcHM+AZh3ZajizJftMWYNSkFowVA BA2MfcN9Q+bgJNpEwd7CPsVgZyEMQh0wFxPnn7zHzcmwd3XyAJUGD/CSENjLYq/F0fdM RgLEi4cDzqccOgM6Om7mxXWVijDD+kgnrvNqJatjlqU9pYfy2F4RW/1Aw/lp9RTlDfVt hQaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tU1M0l6iXcdV+YPLLftDmPI8G3v7jAoMtfkYILmdfLE=; b=WLHL/0MPuYwQuhQdTLvLbZDOMUbzjZVKVa/9ox3GW0k5GjrMCvKIgnMcYwPevhD3pU ggmvvAkfkW7XwdJ3qHXu42pTa9nsH4iD7SLQl44Bn95v8/PrTLjOmvwXt9mEjC/90wIM YlZAL4zbbFwOh0eAPadxuWomJee+m6+lCFVMxig9Zn9cx19+ZUy/HG9Eo35FZLFY8oEM 4fXLV9Aj/fGop+ScjipIRxPvcXElarSF+BYq9KfOXR+wzI6Yo1hrdHGOhVJRmjW5J6CN SFhC5y44fRAA7nwAgLEYVURo+8Kl0tS+eDPqkGykOpkD6sAYavrorC83KPzE/m9pNR7H Ek6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=MVTsRrFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j14-20020a170903024e00b0016c15d2564csi11097565plh.25.2022.07.18.09.25.36; Mon, 18 Jul 2022 09:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=MVTsRrFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235731AbiGRQXH (ORCPT + 99 others); Mon, 18 Jul 2022 12:23:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235823AbiGRQW5 (ORCPT ); Mon, 18 Jul 2022 12:22:57 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E25442A73C; Mon, 18 Jul 2022 09:22:41 -0700 (PDT) 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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=tU1M0l6iXcdV+YPLLftDmPI8G3v7jAoMtfkYILmdfLE=; b=MVTsRrFbnK/qW6g8A1WcrIka45 EyTq3BHKXSdIo6aqcTe09mj8ZNYcWBKvbKfGn724iZ0P0u9jx5SwLcniDEqdK2gbPMoipAwzNe7S9 vq55+L+d5CeTe9JSQKJgLP7hkHzguH6VmZ9E9B1mTjNVB0Jk4Tb3I0iMyVj06bi2mPQyUdj7wDzRo 4PfnQHJF2Vp37LwweC+IvHeqJq6RlvkZAlSO9zRz74ypmyvRqVigF+N5S4BEhl9S+K0KBHaz2HnEw fv4jLHxEzMqaScE3jZrdnKglUK1Vu7EFHme/IlEoryMawVZf0Z+j3VnSUiERPlaP7CypogrCIOXx7 yJE2jISQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33422) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oDTW1-0001pV-4k; Mon, 18 Jul 2022 17:22:37 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oDTVz-00026J-Ah; Mon, 18 Jul 2022 17:22:35 +0100 Date: Mon, 18 Jul 2022 17:22:35 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Sean Anderson , "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org, Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandru Marginean , Heiner Kallweit , Vladimir Oltean Subject: Re: [PATCH net-next v3 10/47] net: phylink: Adjust link settings based on rate adaptation Message-ID: References: <20220715215954.1449214-1-sean.anderson@seco.com> <20220715215954.1449214-11-sean.anderson@seco.com> <4172fd87-8e51-e67d-bf86-fdc6829fa9b3@seco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 17, 2022 at 03:39:39AM +0200, Andrew Lunn wrote: > > > I would not do this. If the requirements for rate adaptation are not > > > fulfilled, you should turn off rate adaptation. > > > > > > A MAC which knows rate adaptation is going on can help out, by not > > > advertising 10Half, 100Half etc. Autoneg will then fail for modes > > > where rate adaptation does not work. > > > > OK, so maybe it is better to phylink_warn here. Something along the > > lines of "phy using pause-based rate adaptation, but duplex is %s". > > You say 1/2 duplex simply does not work with rate adaptation. So i > would actually return -EINVAL at the point the MAC indicates what > modes it supports if there is a 1/2 duplex mode in the list. If we have a PHY that supports rate adaption using pause frames, which implies a full duplex link between the PHY and MAC, one would hope that someone isn't silly enough to integrate it with a half-duplex only MAC. This ought to be handled while bringing up the PHY. If the PHY uses pause frames but the MAC doesn't support full-duplex at the PHY interface speed, then we should not allow the PHY to do rate adaption. The easiest way to achieve that is to not allow the PHY to advertise anything except the PHY interface speed on its media. If that means there's nothing to advertise, then we fail. > Right, so we need a table somewhere in the documentation listing the > different combinations and what should happen. > > If the MAC does not support rx_pause, rate adaptation is turned off. > If the negotiation results in no rx_pause, force it on anyway with > Pause based adaptation. If ethtool turns pause off, turn off rate > adaptation. That last bit is really awkward - what if the link partner is doing 100M on the media because that's the fastest it's capable of, but our local PHY is doing rate adaption to 1G, and we turn pause off, causing rate adaption in the PHY to be turned off. We need to reconfigure the advertisement to drop anything except the 1G speed and renegotiate the link, which will cause the link to go down. That's going to be really odd behaviour for a user to get their head around. > Does 802.3 say anything about this? I think rate adaption is out of scope of 802.3. > We might also want to add an additional state to the ethtool get for > pause, to indicate rx_pause is enabled because of rate adaptation, not > because of autoneg. That may well be a much better approach; it lets the user see what is going on and it becomes more understandable to the user IMHO. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!