Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1942302imw; Sat, 16 Jul 2022 19:45:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ss9wg+t5CaBjxRJtX/uMtP1Gpk6IBItZF5ER4i7KFOk/HhznhVKO86xWmVaxd3B1PM9zRM X-Received: by 2002:a05:6402:448e:b0:43a:9d20:a4ec with SMTP id er14-20020a056402448e00b0043a9d20a4ecmr29344208edb.269.1658025952383; Sat, 16 Jul 2022 19:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658025952; cv=none; d=google.com; s=arc-20160816; b=Ow8k2+582xgrByjZj5z+uqYYyPwmw5H0ioYRBPqwLbBNdLMjD60szXT/li+2lsggGF CyEVeK4MubCvRiBNkNyT0Z2wyTkVQOeXzhK/e1RJafen72+X2aRqduB1Ae0kqTOSJ1Q3 AUCj6OvVpgV2taFx9J8xl18Q5MvD+DP6bEc/u2DHgB5u1ZyBRS4NlcWFfoes8xWoN3G6 JPaaCM3ZEUmR/bYucEwhtE2LAcsaQXMR1Y1ub67wqehctKB35WCT0pOn8OYDGdzpsZZ/ Y+Xu8SBAQ6b7CBRmfbkz5UCkxkWe7wtYhG8U/xvxnMbJCzotcZf8HNS90qfGN7opBm0m Caiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vHboTQVyDPjyOiJ7fhjhnLV2AN9SVlX5UirCaUIKjro=; b=nfu9o1jLfpxeNx6NtPmtMoUFge2/oU66XRUhSyk4JdiBf1jOPBGx75LAyOxUZ3x/08 ucDT0UYB45qRm3I5HV6hf07nE8aBMabhw6PM6vciLRCQL5zjh0g/DPVsGv/43dv8uq/o OtT/+XdqTkTNAMMlRH8ukOt+YlDhu6LlH9+JYEHgZmQ7CV4kDuTRNRNFxZ0gVUHektM+ lo1DqjkPW2T8NQ/JCJ1He+Vs31NVg8FO3be0CLRWTthyb0uz6HtNqnnICetbomZE5GND sixOnW3IfSzwI5S0iJzbD6UtcBRd52rssXEPlpvV4CKpr7CLN0LPQqD5gjm8cDJBAMJL vogg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=flUpDHGr; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa44-20020a17090786ac00b0071256ff7906si11200869ejc.692.2022.07.16.19.45.25; Sat, 16 Jul 2022 19:45:52 -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=pass header.i=@lunn.ch header.s=20171124 header.b=flUpDHGr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232667AbiGQBjv (ORCPT + 99 others); Sat, 16 Jul 2022 21:39:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232621AbiGQBjv (ORCPT ); Sat, 16 Jul 2022 21:39:51 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 502C61AD9E; Sat, 16 Jul 2022 18:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=vHboTQVyDPjyOiJ7fhjhnLV2AN9SVlX5UirCaUIKjro=; b=flUpDHGrs8Da2Zxp4G8Z4nuLqx AMJ2U5n+ifO9ta3oX36I2yuEzpAXsPxy57F5P6mEA5xWHP8ptjACCyqPr/gYslTtc4GKPRfqnxG/J pqY2w6y4HVLV+ta47zE0TKloBZvBSfoDbb72P+MFmdz/Xvu+niBre44yGv8tGHGj15xI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oCtFz-00Aanj-Ju; Sun, 17 Jul 2022 03:39:39 +0200 Date: Sun, 17 Jul 2022 03:39:39 +0200 From: Andrew Lunn To: Sean Anderson Cc: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org, Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, Russell King , 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: <4172fd87-8e51-e67d-bf86-fdc6829fa9b3@seco.com> 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_PASS,SPF_PASS 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 > > 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. > > > The MAC should also be declaring what sort of pause it supports, so > > disable rate adaptation if it does not have async pause. > > That's what we do in the previous patch. > > The problem is that rx_pause and tx_pause are resolved based on our > advertisement and the link partner's advertisement. However, the link > partner may not support pause frames at all. In that case, we will get > rx_pause and tx_pause as false. However, we still want to enable rx_pause, > because we know that the phy will be emitting pause frames. And of course > the user can always force disable pause frames anyway through ethtool. 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. Does 802.3 say anything about this? 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. Andrew