Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Ernesto Castellotti <ernesto@castellotti.net>,
	<intel-wired-lan@osuosl.org>,
	"Kwapulinski, Piotr" <piotr.kwapulinski@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ixgbe: Add 1000BASE-BX support
Date: Wed, 7 Feb 2024 13:43:09 -0800	[thread overview]
Message-ID: <bfddfb36-3625-ae0f-75c6-e46ac1ca482a@intel.com> (raw)
In-Reply-To: <20240127174803.20793-1-ernesto@castellotti.net>

+ Piotr

On 1/27/2024 9:48 AM, Ernesto Castellotti wrote:
> Added support for 1000BASE-BX, i.e. Gigabit Ethernet over single strand
> of single-mode fiber).
> The initialization of a 1000BASE-BX SFP is the same as 1000BASE-SX/LX
> with the only difference that the Bit Rate Nominal Value must be
> checked to make sure it is a Gigabit Ethernet transceiver, as described
> by the SFF-8472 specification.
> 

Some nits on the patch...

> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
> @@ -1539,6 +1539,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
>   	u8 oui_bytes[3] = {0, 0, 0};
>   	u8 cable_tech = 0;
>   	u8 cable_spec = 0;
> +	u8 bitrate_nominal = 0;

This should be reverse xmas tree (longest line to shortest) so this 
should go under oui_bytes.

>   	u16 enforce_sfp = 0;
>   
>   	if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) {
> @@ -1577,6 +1578,13 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
>   					     IXGBE_SFF_CABLE_TECHNOLOGY,
>   					     &cable_tech);
>   
> +	if (status)
> +		goto err_read_i2c_eeprom;

No newline between function call and error check please.

> +
> +	status = hw->phy.ops.read_i2c_eeprom(hw,
> +					     IXGBE_SFF_BITRATE_NOMINAL,
> +					     &bitrate_nominal);
> +
>   	if (status)
>   		goto err_read_i2c_eeprom;

Same here.

>   
> @@ -1659,6 +1667,17 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
>   			else
>   				hw->phy.sfp_type =
>   					ixgbe_sfp_type_1g_lx_core1;
> +		// Support only 1000BASE-BX10, checking the Bit Rate Nominal Value as per SFF-8472
> +		// by convention 1.25 Gb/s should be rounded up to 0Dh (13 in units of 100 MBd)
> +		// for Ethernet 1000BASE-X

This isn't the correct commenting style for kernel or netdev [1]. Also, 
please wrap to 80 chars.

> +		} else if ((comp_codes_1g & IXGBE_SFF_BASEBX10_CAPABLE) &&
> +			   (bitrate_nominal == 0xD)) {
> +			if (hw->bus.lan_id == 0)
> +				hw->phy.sfp_type =
> +					ixgbe_sfp_type_1g_bx_core0;
> +			else
> +				hw->phy.sfp_type =
> +					ixgbe_sfp_type_1g_bx_core1;
>   		} else {
>   			hw->phy.sfp_type = ixgbe_sfp_type_unknown;
>   		}

Thanks,
Tony

[1] 
https://docs.kernel.org/process/maintainer-netdev.html#multi-line-comments

  reply	other threads:[~2024-02-07 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-27 17:48 [Intel-wired-lan] [PATCH iwl-next] ixgbe: Add 1000BASE-BX support Ernesto Castellotti
2024-02-07 21:43 ` Tony Nguyen [this message]
2024-02-07 22:23   ` Ernesto Castellotti
2024-02-07 22:39     ` Tony Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfddfb36-3625-ae0f-75c6-e46ac1ca482a@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=ernesto@castellotti.net \
    --cc=intel-wired-lan@osuosl.org \
    --cc=piotr.kwapulinski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox