Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1529340pxb; Thu, 28 Oct 2021 05:33:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAti+B6jeiLXvkXZ7vrYKWWLAbaiU4rfClWoBCLzxOxSla0D6ejIsjcMtDH2AJQbTrYFFA X-Received: by 2002:a63:84c6:: with SMTP id k189mr2917887pgd.245.1635424404094; Thu, 28 Oct 2021 05:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635424404; cv=none; d=google.com; s=arc-20160816; b=p3ARGBKx5k2nZDVjn11bMF5WxNLr8LPAq06OS6R7wIuqwSHO9OPZDPuxGhKBPJJVM0 PtOR73Su9/Vmqnmd5jKSDYxUo+9NbkCiyeAucdWigLKeX/Wx9YZnh+WTYCxOKwPpgCp+ gPH1j/BzhIRJqLoM7CaUa1a86atYwJPCX+jRq1Jr+CB6tyRBybaIaE0edy+0GItfieVk dPog/uwGlyv/1PU/OO10jSr5jPmsqHl4D6E9CGr6JhYd7hZ5zyhf25eCB4lC7/xM0SNj VkHMbOdshBhhwS/3s4aHO/TzRUHEpiCljLOzK/fBtONl2GK2mTi1KNuaeSUzFVdS16Hf GZlQ== 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=xEBKoPrmRsIIkkMzN6IAirZdQjATcebsXUv59Brc72A=; b=GcAliecqfL+BqoYfi7jKFjnlxKJ0ld7cFBhGFDHly8hNIBnFDuo7hvtRU6TpVFc7sU v2mmKZxvyiCsEmKNMbKZonW640a22Rk8qKNRZrlUDxQh1BBVXmW6arFX2xM2HkKfv7hs 3ZU3Qhh/HDin9cJK8tQfVJcBXtmdW8eN5ogadFp0Nnw1s75PsTQHPW6VBQUy+uBH26bZ qDXk8igEKGyAGEokB9CroijqPJFpsiC++f4dueiK33vCP+OwKUjBf0EtyF1wjJGqSdpg 5wmAgja37qvHp60HpOevpppwjgchdPJyxyiPbPXr+8FpHmz8dajkdy479IG95ZaWkn02 5Yuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=hbPsAgRz; 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 17si4608136pgr.614.2021.10.28.05.33.10; Thu, 28 Oct 2021 05:33:24 -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=pass header.i=@lunn.ch header.s=20171124 header.b=hbPsAgRz; 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 S229981AbhJ1MdO (ORCPT + 99 others); Thu, 28 Oct 2021 08:33:14 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:35644 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbhJ1MdN (ORCPT ); Thu, 28 Oct 2021 08:33:13 -0400 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=xEBKoPrmRsIIkkMzN6IAirZdQjATcebsXUv59Brc72A=; b=hbPsAgRz/N44KSKUhIjWS+PnUf iyLzSIw6C41F3zhgF9Xk4QINEaFK6cEfV0riqMpxGHrjRzy3Spzyv8o788FQxLKu/MZfC8Bckydrk sMy+rwaoSFHRNTcuXwtvImOGmzkuRlT4riDlmTvZfkcTPQvK61OT8DPlO7D8x3nam7Kg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mg4YJ-00BzVI-Jh; Thu, 28 Oct 2021 14:30:39 +0200 Date: Thu, 28 Oct 2021 14:30:39 +0200 From: Andrew Lunn To: "huangguangbin (A)" Cc: davem@davemloft.net, kuba@kernel.org, wangjie125@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lipeng321@huawei.com, chenhao288@hisilicon.com Subject: Re: [PATCH net 1/7] net: hns3: fix pause config problem after autoneg disabled Message-ID: References: <20211027121149.45897-1-huangguangbin2@huawei.com> <20211027121149.45897-2-huangguangbin2@huawei.com> <09eda9fe-196b-006b-6f01-f54e75715961@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09eda9fe-196b-006b-6f01-f54e75715961@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi Andrew, thanks very much for your guidance on how to use pause autoneg, > it confuses me before because PHY registers actually have no separate setting > bit of pause autoneg. > > So, summarize what you mean: > 1. If pause autoneg is on, driver should always use the autoneg result to program > the MAC. Eventhough general autoneg is off now and link state is no changed then > driver just needs to keep the last configuration for the MAC, if link state is > changed and phy goes down and up then driver needs to program the MAC according > to the autoneg result in the link_adjust callback. > 2. If pause autoneg is off, driver should directly configure the MAC with tx pause > and rx pause. Eventhough general autoneg is on, driver should ignore the autoneg > result. > > Do I understand right? Yes, that fits my understanding of ethtool, etc. phylink tried to clear up some of these problems by fully implementing the call within phylink. All the MAC driver needs to provide is a method to configure the MAC pause settings. Take a look at phylink_ethtool_set_pauseparam() and the commit messages related to that. Andrew