Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2933244ybk; Tue, 12 May 2020 11:39:58 -0700 (PDT) X-Google-Smtp-Source: APiQypI698EMR8IOyvaCJd49deuIZ+OP5SYQIKRrXipC8IKO7JvaTEs15xgxhgha2nh14sVgZRfU X-Received: by 2002:aa7:d0c2:: with SMTP id u2mr19815751edo.78.1589308798057; Tue, 12 May 2020 11:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589308798; cv=none; d=google.com; s=arc-20160816; b=ap94Oqi+aP0+3nhI5DmpF3CTXGmG4pKhbJGlalSaM8JwQo17JmXm3OMy+o6smwolqw DMEwrUw4v5CP8krA64TjkipIHgoKVsakCwFitbJtp6vAI+LC53VelBvKGpkX1qInZiSA AGC12s/KKVr53n9q6FJSWAqkBCr7rVVu5N15/mwc+X3JIPx22WYiqySAEmtJfRokWCjB CSdQ8zbL6AE6bbxoMdr5oGTpX9BUJFtI30q5bvxUbenGTb/XC3L3OmXmzQWKr8eZFML6 HON4yh1M9wtb+YzOAGizQEiX+gPT3ucpZLvbNAV9aUua115R2RSxNytRUvMLo3jeT7B3 ekhw== 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=Ufeokk8l7hSaLGTDg3N7R5AfsEhxXksaL7wPbnpA7cs=; b=R3P0wG3Er6zqzuIQp+zp5hNljqiuYYGfLs75/J9GOhyQpKpw/QmgIpWTAAZEf3L9Zk hl7V3LPVsYSs6B5KHeuVnA4J4OK6lHWNpA4VlGPOWfPIN4RmQ9kW3QudLPpw4BqjaghP HkyixuCIwh8lxn7ud5F+s/ZORdtqRHY+dDtVWakQuGBrnbAjiYU6Ko19755BQCZvhXBq q2pBA55UsZ7MhTIn74Mp3uZQICWeAaDZ7kEbeJHuiSTk+8xEX2sIBjup4g4D9Qf/FDdh PPlaoaKhpSJAGYoq1AgFeniA2zmYjQvaTtls9xm7UJE+CXOttxeob5rbVWxBdK57VYXV STKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=uvUW7RHm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si7774737edj.37.2020.05.12.11.39.29; Tue, 12 May 2020 11:39:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=uvUW7RHm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730210AbgELShp (ORCPT + 99 others); Tue, 12 May 2020 14:37:45 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:56346 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbgELShp (ORCPT ); Tue, 12 May 2020 14:37:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender: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=Ufeokk8l7hSaLGTDg3N7R5AfsEhxXksaL7wPbnpA7cs=; b=uvUW7RHmJoZtXbxZcIkao+l0Gq xbCqZcHgENaKOn49L7K+Lwf1pwXnzRY+jIZUBOw/CO7cy4M5GGp73vZv76HulOnN0qh01Qo/+lhrA kK9oiF+HeM62Jdd3apEYJE6ujxyfVZK+vMNyaNa21lTfTclZ/PZjHN9gyjVFCbhKpjBs=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jYZmc-00218y-G2; Tue, 12 May 2020 20:37:38 +0200 Date: Tue, 12 May 2020 20:37:38 +0200 From: Andrew Lunn To: Doug Berger Cc: "David S. Miller" , Florian Fainelli , Heiner Kallweit , Russell King , bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/4] net: ethernet: validate pause autoneg setting Message-ID: <20200512183738.GD453318@lunn.ch> References: <1589243050-18217-1-git-send-email-opendmb@gmail.com> <1589243050-18217-2-git-send-email-opendmb@gmail.com> <20200512004714.GD409897@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 11:31:39AM -0700, Doug Berger wrote: > On 5/11/2020 5:47 PM, Andrew Lunn wrote: > > On Mon, May 11, 2020 at 05:24:07PM -0700, Doug Berger wrote: > >> A comment in uapi/linux/ethtool.h states "Drivers should reject a > >> non-zero setting of @autoneg when autoneogotiation is disabled (or > >> not supported) for the link". > >> > >> That check should be added to phy_validate_pause() to consolidate > >> the code where possible. > >> > >> Fixes: 22b7d29926b5 ("net: ethernet: Add helper to determine if pause configuration is supported") > > > > Hi Doug > > > > If this is a real fix, please submit this to net, not net-next. > > > > Andrew > > > This was intended as a fix, but I thought it would be better to keep it > as part of this set for context and since net-next is currently open. My real question is, do you think this should be back ported in stable? If so, it should be against net. If this is only intended for new kernels, don't add a Fixes: tag. > Personally, I'm actually not that fond of this change since it can > easily be a source of confusion with the ethtool interface because the > link autonegotiation and the pause autonegotiation are controlled by > different commands. > > Since the ethtool -A command performs a read/modify/write of pause > parameters, you can get strange results like these: > # ethtool -s eth0 speed 100 duplex full autoneg off > # ethtool -A eth0 tx off > Cannot set device pause parameters: Invalid argument > # > Because, the get read pause autoneg as enabled and only the tx_pause > member of the structure was updated. We can at least improve the error message when using netlink ethtool. Using extack, we can pass back a string, saying why this configuration is invalid, that link autoneg is off. Andrew