Article View: linux.kernel.netdev
Article #26637Re: [PATCH net-next 3/4] igb: read SFP module EEPROM through igb_read_sfp_data_byte
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 01:07
Date: Fri, 04 Dec 2026 01:07
128 lines
12768 bytes
12768 bytes
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
Technical Details
Message-ID:
<179634647206.3146.4055667285712409963@kernel.org>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376944-linux-kernel-netdev=dewy.ruReferences:
<20261203005042.348952-4-anthony.l.nguyen@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376944-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 3/4] igb: read SFP module EEPROM through igb_read_sfp_data_byte Date: Fri, 04 Dec 2026 01:07:52 +0000 Organization: Usenet Network Message-ID: <179634647206.3146.4055667285712409963@kernel.org> References: <20261203005042.348952-4-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2643772"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:+X+bOyeCupVpXEMorA6lUqdCSeE= sha256:TkLyW4ixCcolGFEzTiApaeDtJgAfZYah47rM8hoz4to= sha1:7RdVehg3YtGN5KIE4HWdtNwtPfU= sha256:Q91CBdfwfhcREKUNzRMzZryOi4/FWVep2CH0GrZvg14= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id A85FF117A93; Fri, 4 Dec 2026 04:08:16 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4y7MXPPPECCm; Fri, 4 Dec 2026 04:08:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376944-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 97B76117A94; Fri, 4 Dec 2026 04:08:05 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 1B671258CE; Fri, 4 Dec 2026 01:08:02 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796346474; b=Q9xvb9Ej1yWJedKiptk+hDwACFL8FWyWLNKGnwKLipnpDbN6BIzYyt7fxax7LbqYLky/ unW2khNi288yXnAbABPAQHx+Vgr4y8roq4PKwvBUw3lqxdCyFv1/MfX5MJJsyG0go+MDJ I9ohvAA5ezofUKSlQ82NqG9KTMpnXzNeFif12b0mLD9OvIdyRgufc9v5U49cCQhkUmjI7 pj6JkIKVjGzBJff2K36NTdX++jkLxHf9vcPlrcWcCPILNEJO5lLM8KFplqHnEan/uvWoM vEj2+W8mF3gTH0Wy/WLTKVl5HRIrC6evKYclAtpxvGKssq42VxaqRChNFB7eJaunenQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796346474; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=1l662/EHTOWsp5YEj46LtpSY8GMwLUnzqq+we2Tf7fY=; b=Sq+htd8NWwMf6h5lV/sLYvpQXhJlWOyaFPByMC/kN2zPoGwQ2BjbBn8zK4Pt9imfwyWY IYcq2fxQY4VIaFzivg1oaSWdSjUFvn9Yz4Kdbrwgc2yqN70xGSOG7jJo/WYFzkaa5TVUd qr4xVkYsvSrMgejkj1nXHrRrKXlZIxutg5x4Z5ZrWwEpWkMFx8bNpzdGSkAIDB498tv5o kW7x9tULqE5vZ2OARAu/3yFabcIxPHNJ4lOhltko/u348A7KhGdIRQi09Oq147ECjEc7M 965qUIBxe7xA8GiyM65+ebBnkuK/1P3S+izmay0BTLp+ZSvM+bWyICg8OPOCDwaVkBw== X-ARC-Authentication-Results: i=2; 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=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E06B606A684; Fri, 4 Dec 2026 01:07:54 +0000 (UTC) X-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 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-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== X-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== X-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 X-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 <netdev@vger.kernel.org>; Fri, 4 Dec 2026 01:07:53 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E4F81F000C2; Fri, 4 Dec 2026 01:07:52 +0000 (UTC) X-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== X-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 X-In-Reply-To: <20261203005042.348952-4-anthony.l.nguyen@intel.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list