From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796346473; b=UgIw464PwO46YU5zEX4mCES53WpEX9r2lH2GQMIfAV+crpRLSz5o+hHm+uZyUEtEN7xz 3KnDFJmxu5GTmEJZxaaBEXHo8mrzh7u3plJtDNcRR5E06fMKZz6i1gXyDyGfCQBTOitg8 e1iQqTLTyGeKO2TH42+9sp8V2X93WHXuqDieB9kpsSj3jpgZtzSzCGi/xZMDPt0gLapPs Znc00qKnJE+k/dBc9JIpxThIzXHeueifRjFIqhlzUx5md39wl9Wi0N8qMeFHw/GF4FEar QpFBmmpEKQrogUIhmJ6nrJgHztl/EMGGzNzQsQpHYydlcgi4GuFMcdNLZH6N7X68Umw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796346473; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=1l662/EHTOWsp5YEj46LtpSY8GMwLUnzqq+we2Tf7fY=; b=Zi9lWOYLdK15FpAHYauDAESCgIuWZOKDotB0GUNJ30bvdX2lGNucklXpMUxz3i8yT/bv 7hVk07anbuNWnX0UcXfPXxXRcN0emlYhEMZ5ZMw8CYn3zAvpmfVCChy7yPooAXs85dHTF BZlUpteKjUEi0djmhqi3l3e4KliZr8Sz+q3HgFJgufaLdFwKI+iWTpi46d7EWIUm8aUAa ZmMeujM1mAyz8kWZTvImRjdq+9Fj8RTYVtX7tsWbzx3eKcvxq/MZVya79YSdrN19Auvc+ Pol6ZYcsVM2V8+QNknsJenXULl2MctNtfcpw+ub9Db+NkbnEP1h04cVtHEHUuqARO4g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hyqOsx8J; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4134E606A69A for ; Fri, 4 Dec 2026 01:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hyqOsx8J Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E4F81F000C2; Fri, 4 Dec 2026 01:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796346473; bh=1l662/EHTOWsp5YEj46LtpSY8GMwLUnzqq+we2Tf7fY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hyqOsx8JWKFU+6A5pAAIeuo4DBBmogfCmfr60zzXRDj7OS2p8jHGx5OMSQ2Y7pOvI 0u3E/ZVuCnFKszK1KGKW3FZrGrnrs2uAwhzh9EYnU+HgEqEhD6eYa8PcQrU383/IMe z8j7WlkIlukNkC0WqiUnP8AqjaOE1RLNKhqvCEwCW3JGqgUMcz/UXuGyIlqBI6Yctw EI+fLkwoNRk3VjkHRl7HyB5rXdeI37OOUZrklFCovp7xOfRQ5Q2G6unx6rCjalCteR DPxyi4PcuLvhy0YeM3AM88vVuQ0tC6lP1KM2bWjIDDPgydOcoWB/fKfRSVglcy75K+ HRtW/zkB15xvA== Subject: Re: [PATCH net-next 3/4] igb: read SFP module EEPROM through igb_read_sfp_data_byte From: netdev-bot+sashiko@kernel.org To: anthony.l.nguyen@intel.com Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, andrew+netdev@lunn.ch, willemb@google.com, netdev@vger.kernel.org, paweldembicki@gmail.com, dima.ruinskiy@intel.com, pavankumaryalagada@gmail.com, sx.rinitha@intel.com Date: Fri, 04 Dec 2026 01:07:52 +0000 Message-ID: <179634647206.3146.4055667285712409963@kernel.org> In-Reply-To: <20261203005042.348952-4-anthony.l.nguyen@intel.com> References: <20261203005042.348952-4-anthony.l.nguyen@intel.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] Series ordering creates a bisect window, and the commit message gives no context for it. - [Low] igb_get_module_eeprom() (drivers/net/ethernet/intel/igb/igb_ethtool.c) now does one I2CCMD… -- igb: read SFP module EEPROM through igb_read_sfp_data_byte This patch moves igb_get_module_info() and igb_get_module_eeprom() off igb_read_phy_reg_i2c(), which addresses the external PHY register space. They now use igb_read_sfp_data_byte(), which addresses the SFP module EEPROM. The module EEPROM is read one byte at a time through I2CCMD. > igb_get_module_info() and igb_get_module_eeprom() use > igb_read_phy_reg_i2c(), which accesses the external PHY register space. > On designs with an external SGMII PHY this returns PHY register contents > instead of the SFP module EEPROM requested by ethtool -m. [Severity: Low] Can this problem be reached before the previous patch in this series, "igb: detect M88E1112 100BASE-FX SGMII mode"? Before that patch, igb_init_phy_params_82575() returned early for any non-copper media. So phy->addr was never pointed at an external PHY while media_type was serdes: drivers/net/ethernet/intel/igb/e1000_82575.c:igb_init_phy_params_82575() { ... if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; goto out; } ... } The previous patch adds a 100BASE-FX branch. It switches to serdes after igb_get_phy_id_82575() has already set phy->addr to the M88E1112 address: } else if (data == E1000_M88E1112_100BASE_FX) { ... hw->phy.media_type = e1000_media_type_internal_serdes; igb_get_module_info() and igb_get_module_eeprom() return -EOPNOTSUPP for copper and unknown media. So these external SGMII PHY designs seem to reach the old igb_read_phy_reg_i2c() path only after that patch is applied. Consider an M88E1112 strapped for 100BASE-FX at that intermediate commit. ethtool -m would report M88E1112 registers as module EEPROM data. It would also choose SFF-8079 or SFF-8472 based on PHY registers 0x5C/0x5E. Could this patch come before the 100BASE-FX detection patch? Could the commit message also say which change makes this path reachable? One case is unconfirmed. After a MAS media swap, get_invariants runs again and igb_init_phy_params_82575() returns early, which might leave a stale phy->addr. If that path can reach ethtool -m, the problem is older than this series, and a Fixes: tag for stable may be appropriate. > diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c > index ccc7302dc7bdb..12d449bb062ee 100644 > --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c > +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c [ ... ] > @@ -3250,36 +3254,17 @@ static int igb_get_module_eeprom(struct net_device *netdev, > struct igb_adapter *adapter = netdev_priv(netdev); > struct e1000_hw *hw = &adapter->hw; > u32 status = 0; > - u16 *dataword; > - u16 first_word, last_word; > int i = 0; > > if (ee->len == 0) > return -EINVAL; > > - first_word = ee->offset >> 1; > - last_word = (ee->offset + ee->len - 1) >> 1; > - > - dataword = kmalloc_objs(u16, last_word - first_word + 1); > - if (!dataword) > - return -ENOMEM; > - > - /* Read EEPROM block, SFF-8079/SFF-8472, word at a time */ > - for (i = 0; i < last_word - first_word + 1; i++) { > - status = igb_read_phy_reg_i2c(hw, (first_word + i) * 2, > - &dataword[i]); > - if (status) { > - /* Error occurred while reading module */ > - kfree(dataword); > + for (i = 0; i < ee->len; i++) { > + status = igb_read_sfp_data_byte(hw, ee->offset + i, &data[i]); [Severity: Low] Does this double the number of busy-waited I2CCMD transactions in igb_get_module_eeprom()? For a full dump with ee->len = ETH_MODULE_SFF_8472_LEN (512), this loop issues 512 I2CCMD reads. The old word loop issued 256. Each read polls in igb_read_sfp_data_byte(): for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) { udelay(50); data_local = rd32(E1000_I2CCMD); if (data_local & E1000_I2CCMD_READY) break; } This ethtool op runs with RTNL held. Each I2CCMD read returns two bytes. The old code used both, one from bits 7:0 and one from bits 15:8. igb_read_sfp_data_byte() keeps only bits 7:0 and drops the other byte. Could the module EEPROM still be read a word at a time from the SFP address space? That would avoid the extra busy-wait time for ethtool -m. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203005042.348952-1-anthony.l.nguyen%40intel.com