Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp233280lqs; Mon, 4 Mar 2024 23:32:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVML21vxcSBDjKDtH0xdWV392Fv8MCsBS0+Nidedaonpv67ykP3nh4GK9pXfCU6DyUP4Zws6s6HUmc2j/0FTeJdEjMzvMl1AtwywW8UmQ== X-Google-Smtp-Source: AGHT+IF1huw49DzPcO+xyET0pfiDlaYh9fHBomzGVJl+ovStHYrD46VPCcwkLN7Av+OlwMC3Q9e7 X-Received: by 2002:a05:6a20:54a4:b0:1a0:ea67:ecb2 with SMTP id i36-20020a056a2054a400b001a0ea67ecb2mr1329374pzk.12.1709623972652; Mon, 04 Mar 2024 23:32:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709623972; cv=pass; d=google.com; s=arc-20160816; b=tdk/yu4QkguFpYAkfZuDLvAUHQlSZnGC49gC00PaLuaFAhb457vYbjn8lwmqUV/WqL +8SgeNSMFzp0eb/Uhtj7kx5trJnpr+kERDNFFqz4gZsLoTuc3yhGdmjW6PH7LxRHAlNM H09PZdcw+lQCClEerMBTMlDMSTzpDUg7hmhL+vNbr7RF8FV5bsZWWw5/UIl5GVPVvfAE WNONaAyX6p2d15Waei6L7RaJ8prq3lRQk47SLNebSY8A1xOfzJl8++S8QB78SFUiGj0n Kx1zw56FVRrF5CUrDc1tT2oSgWFPwtKsdIgLoNQeei5CppSLxT98+simqFsKK+LAmgOI NSgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Mz+hrId5aROwbYkjebL0Hf174xSgzMZV4u64JOKYzvc=; fh=oK200zp1wv5k9FSxpf2vjpRnhKXdxYiYUwNDaDk8Y5I=; b=z0UDwilv9vFWOWQlYKEu6+Dplmd5I347buRsa2VMAaQzhmyJyYiHlPoHd27g8WwVZG VuiUhqIYYET8SapTL6XD0WpJ/GHKkcAjsUr9CHIjZX2N5thCZeZp4xV4xaikX8uU8jnY XfEUfRjkGzrK62N9u5zbFrwc1zyUVnbEsLXYbGyoB80RRiU5PpteT0aE/yY2Cq92LMuK yCS7+Octz79/kkMZ5xX9irxF1rndRvWzKi8+ySCXtKjAvHvK9RkAoYY16GSDZgWTwQHi +LMJHIBFWP1liknoriQQ5fHHG3deITJalG3xpYFGgBEPJuff+vUjJbHx/7FFClsynz0K 9G8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FElsCGGa; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-91648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ea27-20020a056a004c1b00b006e635515ebdsi1343006pfb.387.2024.03.04.23.32.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 23:32:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FElsCGGa; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-91648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id ED3C9B2266F for ; Tue, 5 Mar 2024 04:21:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 261AFF9EB; Tue, 5 Mar 2024 04:21:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FElsCGGa" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 CD1CC6FB5; Tue, 5 Mar 2024 04:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709612466; cv=none; b=pbTlOgCU/hV+GvkBjDnAY8ssQdRQIeNpzBr7zHT1TCU0fFfLm3sh1MQ+bOE5Z1mbrpuoM5Hui9iOQHZLdjNB4gj7ZHISfnnDJkNBHcgWAmI0lFARFnsOuojjOn9ZfnLiObolb8Bz7DWhAOTr4/Vnd8qstfKYuzM6sd3EgtG1cPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709612466; c=relaxed/simple; bh=1WHkQK/Ja5W+APKzZ4IYM8Vsp3euVtIzyGWw7tf7y6A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JqQROgEGxcRVgaiNv4F7+9Sb+szqrp2/qJtgloNWaNcNgSuITLlWWBKnyhZXQBKBmPJfqhGNXwHQZ8NboNOFgK0UttgNTWwR7ZqHjBTQt/HSFzGtZi87oHisXs4IXY8pVeTI/wTB7JSLIZt39jV5k+MfpM54eXjiIeCTp5uZ9bY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=FElsCGGa; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709612463; x=1741148463; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=1WHkQK/Ja5W+APKzZ4IYM8Vsp3euVtIzyGWw7tf7y6A=; b=FElsCGGa4+8opnGv+3B2XTWr1ARr9LwLFhe8t6sp1K2RQelQNjrnkI+C nwpbbNYgFFNXSQWwTfH9eSyH1vOvKSjiUEmat4swCBeDcSSs8SvxcRezw XNR4DRbptPV97nfN2l/EJzC2Cyfs9ZCMGE+xWTU4AzfpwznE/9iLCqxfl ktT6dKGaKgj61JZYz2do65CqZ2Xk2wDXk1HWaPZN4bhBVxKzekjjqwOxt tpgmkNyQM7A/GPUzGwB7pErEEk6RdKHYUeTpB3wHKK7T7li+u11Bt8Hz8 rwxixG/v6bzOk5WHYezhaFUPmH19qNU56yoT4wy+3m5dCySXO5GmoH8K0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11003"; a="4300750" X-IronPort-AV: E=Sophos;i="6.06,205,1705392000"; d="scan'208";a="4300750" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 20:21:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,205,1705392000"; d="scan'208";a="40216302" Received: from choongyo-mobl.gar.corp.intel.com (HELO [10.247.102.58]) ([10.247.102.58]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 20:20:55 -0800 Message-ID: <6fbbd36a-20f5-43db-97fc-c8755a82a159@linux.intel.com> Date: Tue, 5 Mar 2024 12:20:39 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v5 1/9] net: phylink: provide mac_get_pcs_neg_mode() function To: "Voon, Weifeng" , Russell King 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" , "Sit, Michael Wei Hong" , "Lai, Peter Jun Ann" , "Abdul Rahim, Faizal" References: <20240215030500.3067426-1-yong.liang.choong@linux.intel.com> <20240215030500.3067426-2-yong.liang.choong@linux.intel.com> Content-Language: en-US From: Choong Yong Liang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 23/2/2024 2:58 pm, Voon, Weifeng wrote: >>> 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: > > The example given here is a very specific condition and that probably why there are some confusions here. Basically, this patch provides an optional function for MAC driver to change the phy interface on-the-fly without the need of reinitialize the Ethernet driver. As we know that the 2500base-x is messy, in our case the 2500base-x does not support inband. To complete the picture, we are using SGMII c37 to handle speed 10/100/1000. Hence, to enable user to switch link speed from 2500 to 1000/100/10 and vice versa on-the-fly, the phy interface need to be configured to inband SGMII for speed 10/100/1000, and outband 2500base-x for speed 2500. Lastly, the newly introduced "mac_get_pcs_neg_mode"callback function enables MAC driver to reconfigure pcs negotiation mode to inband or outband based on the interface mode, current link negotiation mode, and advertising link mode. > >> >> 1) are you sure that the hardware can't be programmed for the SGMII >> symbol repititions? >> > > No, the HW can be program for SGMII symbol repetitions. > >> 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. >> > > Above explanation should have already cleared your doubts. Inband or outband capability is configured based on the phy interface. > >> 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. > > It should be a typo mistake. SGMII should return PHYLINK_PCS_NEG_INBAND_ENABLED. > >> >> 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. >> > > Hi Russell, > If I understand you correctly, MAC driver should not interfere with pcs negotiation mode and it should be standardized in the generic function, e.g., phylink_pcs_neg_mode()? > >> 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.) >> > > Agreed. And I have also seen some of your comments regarding the 2500SGMII and 2500BASEX. > Hi Russell, Did the previous reply clear your doubt? If we understand you correctly that MAC driver should not interfere with pcs negotiation mode and it should be standardized in the generic function. If implement what you suggested earlier that during interface mode change then update the `cur_link_an_mode` but not cfg_link_an_mode: https://patchwork.kernel.org/project/netdevbpf/patch/20230921121946.3025771-4-yong.liang.choong@linux.intel.com/? Would that be a better solution? So that 'phylink_pcs_neg_mode' function still can serve as the generic for all the drivers. Do you have anything in mind that we can handle better for this patch series? or the solution can be aligned with what you are going to implement in the future?