Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp890079pxb; Wed, 27 Oct 2021 14:33:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPSzkUjNTz6YxWjT9WfTLvqMZd27NEqtzvn+qSsKz3xV5l6Bh/27hb/vq6KdajZQwjM7T4 X-Received: by 2002:a17:907:971e:: with SMTP id jg30mr96489ejc.169.1635370384395; Wed, 27 Oct 2021 14:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370384; cv=none; d=google.com; s=arc-20160816; b=H24rHm/hwN8VT0nINoDPI/HEoqhYgw+L4KcXpX9oHeXhUUs2ibRN/z0sIgNfrz6z5o eZ111jydYHsJzwLhKqxEQ0LhRi0kHSWJl6qLxtDjfAr4wuPkOtdwwMxFwcP1j0tyloAg MduoHMmQW57HTFsv2btxmz9WQOHPfhVX+jFoUyMRGHkrXlUTYspqYwwb9n5OwufxQuiW No0dyt/FdYUw60/lamCTulF+bI1NNKlDAd4ye0Bm1WsnVHbJe/T3pHd19jW3sxp1+RzS AEM2QLSFlJU3/CGjHiULFMM4pmMPn41zF5l2OV2CWD5Xz10Qu7YduCBsj7QEYDfwM+q1 m71g== 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=xYqWqnNTYblorxJSKWICYNXuprkqD63Vt4PUk5Lzeb8=; b=ysdG7yKZcRYQC7ua+ic4sGT8G2e0nmOUxdorTN+fkXi4+SZ1thXn5MIy0wKvRGMNIG HguVE18B1zwZSst/E7fvdFyqvRuh8sqemii5pSKb5OvhHDnl8num53TrjkKxacdiJnSp j/b7V8M9crkpetqjbd+xX7gPmRa7Tg0c4TvMaoRHiQ0xpVBA6GQN/69HGbxbBrUf4ocr Fix/OfleEQZ8k0sOhT4sqdDTbCjOjHzVhJnObVm4iN5CqBhZb2HnnAxKwcacRWA4v6EW DCaGEb7LR8UfQYqTmypEptnpKo8ywqSCSbonKFiwuoLruyThOuQ3qX459mVXS/w3Enre haZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=AMVbIQmq; 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 o18si1874923ejy.243.2021.10.27.14.32.42; Wed, 27 Oct 2021 14:33:04 -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=AMVbIQmq; 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 S238027AbhJ0RZu (ORCPT + 97 others); Wed, 27 Oct 2021 13:25:50 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:34014 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbhJ0RZt (ORCPT ); Wed, 27 Oct 2021 13:25:49 -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=xYqWqnNTYblorxJSKWICYNXuprkqD63Vt4PUk5Lzeb8=; b=AMVbIQmqzSTQvatVfYwNEWu09n Jgp2AnaAirNSQIxo0sjtKDPHBFV2osLPss77sgQjhAoJFrnqEWz/dTMDxIp/MYP+8adCg5ezAygNY ff2rfKXC04DoiVdD7pnT7V8Uy7CZAb7OeAUHMpL8+nR0GJYDvrwa00lX/0lRUCTQnNpI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mfmdv-00Bv5N-EP; Wed, 27 Oct 2021 19:23:15 +0200 Date: Wed, 27 Oct 2021 19:23:15 +0200 From: Andrew Lunn To: Guangbin Huang 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211027121149.45897-2-huangguangbin2@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 08:11:43PM +0800, Guangbin Huang wrote: The semantics are not too well defined here, the ethtool documentation is not too clear. Here is how i interpret it. > If a TP port is configured by follow steps: > 1.ethtool -s ethx autoneg off speed 100 duplex full So you turn general autoneg off > 2.ethtool -A ethx rx on tx on You did not use autoneg off here. Pause autoneg is separate to general autoneg. So pause autoneg is still enabled at this point. That means you should not directly configure the MAC with the pause configuration, you only do that when pause autoneg is off. You can consider this as setting how you want pause to be negotiated once general autoneg is re-enabled. > 3.ethtool -s ethx autoneg on(rx&tx negotiated pause results are off) So you reenable general autoneg. As part of that general autoneg, pause will re-renegotiated, and it should you the preferences you set in 2, that rx and tx pause can be used. What is actually used depends on the link peer. The link_adjust callback from phylib tells you how to program the MAC. > 4.ethtool -s ethx autoneg off speed 100 duplex full So you turn general autoneg off again. It is unclear how you are supposed to program the MAC, but i guess most systems keep with the result from the last autoneg. Looking at your patch, there are suspicious calls to phy_syspend and phy_resume. They don't look correct at all, and i'm not aware of any other MAC driver doing this. Now, i know the behaviour is not well defined here, but i'm not sure your interpretation is valid and how others interpret it. Andrew