Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp566966rdb; Thu, 15 Feb 2024 08:27:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUjdaj1H6FXnUbvdS01chfcyOnzeATuzNUdk7aQyyGH5pyd+/jeyGp9xbhxnuxF6TotC1O9g6e5fDCnEE19TC599S71spMw387H6bp7jQ== X-Google-Smtp-Source: AGHT+IGWKQCE7R+Bie/p58QcgABsa+0OulFLOA2gfKcq8FpI18j0e1yf2YznFhjXTPdW9r+jkZGt X-Received: by 2002:a05:6214:29c7:b0:68c:4f18:b057 with SMTP id gh7-20020a05621429c700b0068c4f18b057mr2528302qvb.39.1708014462758; Thu, 15 Feb 2024 08:27:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708014462; cv=pass; d=google.com; s=arc-20160816; b=vzwgHWWHiAiuxryIwswDm/1CSRZrm7T1BorKOu4m5F8aBYkTqlxH8P8d7VmDsze5Rs 8BDtpCflJvauOSTfMpsB2E6VLzrpXtGo+nUzmNLBgBbtkmuwojmPvq8ZiT//D6dhF2FF UUhs+ciVnofjvn7zFjLbdNcc4RijIXS9T6RQerYidBUcf/IQpXZLhd7tPOOB1E9kklRx GGxp6Y0Ojr+LPeyp6DfmghGidHwoFZWWZz0aP/UaHeCUsj+Cet+itnBqSeVZ2DBRgxAN LeNtad4vukNQmg0ZV5JQoV05rrX7QoU2UPK68/J+Lq4Pl4pS96q0JAU02biKiJwzFrTq QYgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=EWZIyim+Tuvyt3wOnNkE0nCb5ATARobWhzBcyG/FuL0=; fh=xcsdSkRwrFShB2LIU215m+1AaKnl9orXrpE3ZN/8pjo=; b=Abjxr+tOGPiwFLQmVM4Z9xz2wzubIemxlDs5AoXvvqrRHOocmHjS6THTacIdYrlF4/ s93Inrru5XYhsy4urk7mW08f66thSm7DAZlcAy8eeWzaXRR+Hf0LroBDgPhexlGHy9it 6MQrtBI85vNqhl2iYbKGhfJqk4XGsCEzijcE9OBg+KkcQ8llCkAkK2oRp1Ok1SuaBNHF hEGLKXrTXy9bXZ07ipz0sXwRMsb/vxyzEVXTxG2szCuH5azKZkZ9FHFRH5NoTwCHH61j 5/gpBTWEnGEyppr0/Wm3WZ/wnmY1uKHZgBMZuvhLheT1jPY7Lm58M8JqRTYMRRDDSv/r iwEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=O3eXekOJ; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-67308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ed1-20020ad44ea1000000b0068c60027bd4si1832326qvb.519.2024.02.15.08.27.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 08:27:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=O3eXekOJ; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-67308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 758EA1C21BC9 for ; Thu, 15 Feb 2024 16:27:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66F16134CDC; Thu, 15 Feb 2024 16:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="O3eXekOJ" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 018D513399E; Thu, 15 Feb 2024 16:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708014447; cv=none; b=rYNlXKBL5IrnTfegumx/DLSmrDgCAYMdmY5ANZ8jXYGbEJqVB9QXOye5bJBVS+d7NgEbmlWZnW/hpg7/FCAxdMBuhOwvQIS2qgixuLlNyZm9ESvU2CYpFB05u5dUDgUCCgB7y72Bee50B/EkzBjK+0zpx+iNS6sqJBR8WfdcpE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708014447; c=relaxed/simple; bh=CyRI1uCzCoGWcjKACcwDD3OCyQCqdt4SPHYVdoOyQ1A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CI5iDFmU55BTUuyGe+7/o9kEZijUHkK3oXFhZc2ufWt0+XnSSaqIy39MiHAeSPN7LaSxZzIc9dCGlpbLSYGT0K0IYhLwA1lMTOyOCa1hichXRsPztjuRNusXFViawbycDOAEOeL5yGU8W9cjsaRcavtmOadQ0kZrNvdlBPeJppQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=O3eXekOJ; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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=EWZIyim+Tuvyt3wOnNkE0nCb5ATARobWhzBcyG/FuL0=; b=O3eXekOJVXDVMI39FdMDQkdpcQ PyjL5Dp5oG/MIRx71Pmy9Oi9Hqr6Y5DXH1kPsFJECm5WupOzQxQbOVHAWtYrJvcQR6gWYx+INfcsj RgJ5BhvXhBy8LpAGO6Bn9EVL+nCHFpRakzgLNGrKYS6chsqYXFfNQMp5Nd1DEibb8RGpESJD22vtb mxLpMMerGDK7pWuuZvnrxKzUtE77cgbAHo+Sa3QVBQX9uYcpWwISHvv0IwKzm14Mn+ILqGbTXFctw zuJqNDDoa8H2VHQp77/Mb+L9J5ruUXBZddwARnpiVsfxS6tP/jxZCuvDl3nVDDB7Iy5CRJ2DGWnBp sIXX7vsQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:50496) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1raeZg-0004Qb-2H; Thu, 15 Feb 2024 16:27:00 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1raeZb-0004pl-Eb; Thu, 15 Feb 2024 16:26:55 +0000 Date: Thu, 15 Feb 2024 16:26:55 +0000 From: "Russell King (Oracle)" To: Choong Yong Liang Cc: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrew Lunn , Heiner Kallweit , Philipp Zabel , Andrew Halaney , Serge Semin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng , Michael Sit Wei Hong , Lai Peter Jun Ann , Abdul Rahim Faizal Subject: Re: [PATCH net-next v5 1/9] net: phylink: provide mac_get_pcs_neg_mode() function Message-ID: References: <20240215030500.3067426-1-yong.liang.choong@linux.intel.com> <20240215030500.3067426-2-yong.liang.choong@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240215030500.3067426-2-yong.liang.choong@linux.intel.com> Sender: Russell King (Oracle) On Thu, Feb 15, 2024 at 11:04:51AM +0800, Choong Yong Liang wrote: > Phylink invokes the 'mac_get_pcs_neg_mode' function during interface mode > switching and initial startup. > > This function is optional; if 'phylink_pcs_neg_mode' fails to accurately > reflect the current PCS negotiation mode, the MAC driver can determine the > mode based on the interface mode, current link negotiation mode, and > advertising link mode. > > For instance, if the interface switches from 2500baseX to SGMII mode, > and the current link mode is MLO_AN_PHY, calling 'phylink_pcs_neg_mode' > would yield PHYLINK_PCS_NEG_OUTBAND. Since the MAC and PCS driver require > PHYLINK_PCS_NEG_INBAND_ENABLED, the 'mac_get_pcs_neg_mode' function > will calculate the mode based on the interface, current link negotiation > mode, and advertising link mode, returning PHYLINK_PCS_NEG_OUTBAND to > enable the PCS to configure the correct settings. This paragraph doesn't make sense - at least to me. It first talks about requiring PHYLINK_PCS_NEG_INBAND_ENABLED when in SGMII mode. On this: 1) are you sure that the hardware can't be programmed for the SGMII symbol repititions? 2) what happens if you're paired with a PHY (e.g. on a SFP module) which uses SGMII but has no capability of providing the inband data? (They do exist.) If your hardware truly does require inband data, it is going to be fundamentally inoperative with these modules. Next, you then talk about returning PHYLINK_PCS_NEG_OUTBAND for the "correct settings". How does this relate to the first part where you basically describe the problem as SGMII requring inband? Basically the two don't follow. How, from a design point of view, because this fundamentally allows drivers to change how the system behaves, it will allow radically different behaviours for the same parameters between different drivers. I am opposed to that - I want to see a situation where we have uniform behaviour for the same configuration, and where hardware doesn't support something, we have some way to indicate that via some form of capabilities. The issue of whether 2500base-X has inband or not is a long standing issue, and there are arguments (and hardware) that take totally opposing views on this. There is hardware where 2500base-X inband _must_ be used or the link doesn't come up. There is also hardware where 2500base-X inband is not "supported" in documentation but works in practice. There is also hardware where 2500base-X inband doesn't work. The whole thing is a total mess (thanks IEEE 802.3 for not getting on top of this early enough... and what's now stated in 802.3 for 2500base-X is now irrelevant because they were too late to the party.) I haven't been able to look at this issue over the last few weeks because of being at a summit, and then suffering with flu and its recovery. However, I have been working on how we can identify the capabilities of the PCS and PHY w.r.t. inband support in various interface modes, and how we can handle the result. That work is ongoing (as and when I have a clear head from after-flu effects.) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!