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: <20251126153245.66281590@kernel.org>
Date: Wed, 26 Nov 2025 15:32:45 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: 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, Birger Koblitz
 <mail@...ger-koblitz.de>, 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



> @@ -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?

>  		} else {
>  			hw->phy.sfp_type = ixgbe_sfp_type_unknown;
>  		}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ