lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93508e7f-cf7e-40f6-bf28-fb9e70ea3184@birger-koblitz.de>
Date: Thu, 27 Nov 2025 07:33:13 +0100
From: Birger Koblitz <mail@...ger-koblitz.de>
To: Jakub Kicinski <kuba@...nel.org>, Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
 andrew+netdev@...n.ch, netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
 Paul Menzel <pmenzel@...gen.mpg.de>,
 Aleksandr Loktionov <aleksandr.loktionov@...el.com>,
 Rinitha S <sx.rinitha@...el.com>
Subject: Re: [PATCH net-next 03/11] ixgbe: Add 10G-BX support



On 27/11/2025 12:32 am, Jakub Kicinski wrote:
> 
> 
>> @@ -1678,6 +1680,31 @@ int ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
>>   			else
>>   				hw->phy.sfp_type =
>>   					ixgbe_sfp_type_1g_bx_core1;
>> +		/* Support Ethernet 10G-BX, checking the Bit Rate
>> +		 * Nominal Value as per SFF-8472 to be 12.5 Gb/s (67h) and
>> +		 * Single Mode fibre with at least 1km link length
>> +		 */
>> +		} else if ((!comp_codes_10g) && (bitrate_nominal == 0x67) &&
>> +			   (!(cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)) &&
>> +			   (!(cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE))) {
>> +			status = hw->phy.ops.read_i2c_eeprom(hw,
>> +					    IXGBE_SFF_SM_LENGTH_KM,
>> +					    &sm_length_km);
>> +			if (status != 0)
>> +				goto err_read_i2c_eeprom;
>> +			status = hw->phy.ops.read_i2c_eeprom(hw,
>> +					    IXGBE_SFF_SM_LENGTH_100M,
>> +					    &sm_length_100m);
>> +			if (status != 0)
>> +				goto err_read_i2c_eeprom;
>> +			if (sm_length_km > 0 || sm_length_100m >= 10) {
>> +				if (hw->bus.lan_id == 0)
>> +					hw->phy.sfp_type =
>> +						ixgbe_sfp_type_10g_bx_core0;
>> +				else
>> +					hw->phy.sfp_type =
>> +						ixgbe_sfp_type_10g_bx_core1;
>> +			}
>                          ^^^^
> 
> Claude says:
> 
> In ixgbe_identify_sfp_module_generic(), what happens when a module has
> the 10G-BX characteristics (empty comp_codes_10g, bitrate 0x67, fiber
> mode) but the link length check fails (both sm_length values < 1km)?
> 
> The outer else-if condition matches, so we skip the final else clause
> that sets sfp_type to unknown. But the inner if condition fails, so we
> don't set the 10g_bx type either. This leaves hw->phy.sfp_type
> unchanged from whatever value it had previously.
> 
> All other branches in this if-else chain explicitly set sfp_type, but
> this path only conditionally sets it. Should there be an else clause
> after the inner if to set sfp_type = ixgbe_sfp_type_unknown when the
> link length requirement isn't met?
The ixgbe_identify_sfp_module_generic detects SFP modules that it knows 
how to initialize in a positive manner, that is all the conditions have 
to be fulfilled. If this is not the case, then the default from 
ixgbe_main.c:ixgbe_probe() kicks in, which sets
	hw->phy.sfp_type = ixgbe_sfp_type_unknown;
before probing the SFP. The else is unnecessary.

If the SFP module cannot be positively identified, then that functions 
logs an error:
	e_dev_err("failed to load because an unsupported SFP+ or QSFP module 
type was detected.\n");
	e_dev_err("Reload the driver after installing a supported module.\n");


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ