netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iwl-net v1] ice: fix lane number calculation
@ 2025-02-21  9:39 Grzegorz Nitka
  2025-02-25  9:50 ` Simon Horman
  2025-10-03  7:45 ` [Intel-wired-lan] " Rinitha, SX
  0 siblings, 2 replies; 4+ messages in thread
From: Grzegorz Nitka @ 2025-02-21  9:39 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: netdev, Grzegorz Nitka, Karol Kolacinski, Przemek Kitszel,
	Milena Olech

E82X adapters do not have sequential IDs, lane number is PF ID.

Add check for ICE_MAC_GENERIC and skip checking port options.

Also, adjust logical port number for specific E825 device with external
PHY support (PCI device id 0x579F). For this particular device,
with 2x25G (PHY0) and 2x10G (PHY1) port configuration, modification of
pf_id -> lane_number mapping is required. PF IDs on the 2nd PHY start
from 4 in such scenario. Otherwise, the lane number cannot be
determined correctly, leading to PTP init errors during PF initialization.

Fixes: 258f5f9058159 ("ice: Add correct PHY lane assignment")
Co-developed-by: Karol Kolacinski <karol.kolacinski@intel.com>
Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Milena Olech <milena.olech@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_common.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index 7a2a2e8da8fa..83b72414760a 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -4171,6 +4171,15 @@ int ice_get_phy_lane_number(struct ice_hw *hw)
 	unsigned int lane;
 	int err;
 
+	/* E82X does not have sequential IDs, lane number is PF ID.
+	 * For E825 device, the exception is the variant with external
+	 * PHY (0x579F), in which there is also 1:1 pf_id -> lane_number
+	 * mapping.
+	 */
+	if (hw->mac_type == ICE_MAC_GENERIC ||
+	    hw->device_id == ICE_DEV_ID_E825C_SGMII)
+		return hw->pf_id;
+
 	options = kcalloc(ICE_AQC_PORT_OPT_MAX, sizeof(*options), GFP_KERNEL);
 	if (!options)
 		return -ENOMEM;

base-commit: c4813820042d447c687cf4f1d5e240740638e586
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH iwl-net v1] ice: fix lane number calculation
  2025-02-21  9:39 [PATCH iwl-net v1] ice: fix lane number calculation Grzegorz Nitka
@ 2025-02-25  9:50 ` Simon Horman
  2025-02-27 17:27   ` Simon Horman
  2025-10-03  7:45 ` [Intel-wired-lan] " Rinitha, SX
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Horman @ 2025-02-25  9:50 UTC (permalink / raw)
  To: Grzegorz Nitka
  Cc: intel-wired-lan, netdev, Karol Kolacinski, Przemek Kitszel,
	Milena Olech

On Fri, Feb 21, 2025 at 10:39:49AM +0100, Grzegorz Nitka wrote:
> E82X adapters do not have sequential IDs, lane number is PF ID.
> 
> Add check for ICE_MAC_GENERIC and skip checking port options.

This I see.

> 
> Also, adjust logical port number for specific E825 device with external
> PHY support (PCI device id 0x579F). For this particular device,
> with 2x25G (PHY0) and 2x10G (PHY1) port configuration, modification of
> pf_id -> lane_number mapping is required. PF IDs on the 2nd PHY start
> from 4 in such scenario. Otherwise, the lane number cannot be
> determined correctly, leading to PTP init errors during PF initialization.
> 
> Fixes: 258f5f9058159 ("ice: Add correct PHY lane assignment")
> Co-developed-by: Karol Kolacinski <karol.kolacinski@intel.com>
> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
> Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Reviewed-by: Milena Olech <milena.olech@intel.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH iwl-net v1] ice: fix lane number calculation
  2025-02-25  9:50 ` Simon Horman
@ 2025-02-27 17:27   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-02-27 17:27 UTC (permalink / raw)
  To: Grzegorz Nitka
  Cc: intel-wired-lan, netdev, Karol Kolacinski, Przemek Kitszel,
	Milena Olech

On Tue, Feb 25, 2025 at 09:50:21AM +0000, Simon Horman wrote:
> On Fri, Feb 21, 2025 at 10:39:49AM +0100, Grzegorz Nitka wrote:
> > E82X adapters do not have sequential IDs, lane number is PF ID.
> > 
> > Add check for ICE_MAC_GENERIC and skip checking port options.
> 
> This I see.

Sorry, this was part of an earlier draft. Please ignore.

> 
> > 
> > Also, adjust logical port number for specific E825 device with external
> > PHY support (PCI device id 0x579F). For this particular device,
> > with 2x25G (PHY0) and 2x10G (PHY1) port configuration, modification of
> > pf_id -> lane_number mapping is required. PF IDs on the 2nd PHY start
> > from 4 in such scenario. Otherwise, the lane number cannot be
> > determined correctly, leading to PTP init errors during PF initialization.
> > 
> > Fixes: 258f5f9058159 ("ice: Add correct PHY lane assignment")
> > Co-developed-by: Karol Kolacinski <karol.kolacinski@intel.com>
> > Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
> > Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
> > Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> > Reviewed-by: Milena Olech <milena.olech@intel.com>
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

I only meant to send this part :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net v1] ice: fix lane number calculation
  2025-02-21  9:39 [PATCH iwl-net v1] ice: fix lane number calculation Grzegorz Nitka
  2025-02-25  9:50 ` Simon Horman
@ 2025-10-03  7:45 ` Rinitha, SX
  1 sibling, 0 replies; 4+ messages in thread
From: Rinitha, SX @ 2025-10-03  7:45 UTC (permalink / raw)
  To: Nitka, Grzegorz, intel-wired-lan@lists.osuosl.org
  Cc: netdev@vger.kernel.org, Kolacinski, Karol, Olech, Milena,
	Kitszel, Przemyslaw

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Grzegorz Nitka
> Sent: 21 February 2025 15:10
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Kolacinski, Karol <karol.kolacinski@intel.com>; Olech, Milena <milena.olech@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net v1] ice: fix lane number calculation
>
> E82X adapters do not have sequential IDs, lane number is PF ID.
>
> Add check for ICE_MAC_GENERIC and skip checking port options.
>
> Also, adjust logical port number for specific E825 device with external PHY support (PCI device id 0x579F). For this particular device, with 2x25G (PHY0) and 2x10G (PHY1) port configuration, modification of pf_id -> lane_number mapping is required. PF IDs on the 2nd PHY start from 4 in such scenario. Otherwise, the lane number cannot be determined correctly, leading to PTP init errors during PF initialization.
>
> Fixes: 258f5f9058159 ("ice: Add correct PHY lane assignment")
> Co-developed-by: Karol Kolacinski <karol.kolacinski@intel.com>
> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
> Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Reviewed-by: Milena Olech <milena.olech@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_common.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>

Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-03  7:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21  9:39 [PATCH iwl-net v1] ice: fix lane number calculation Grzegorz Nitka
2025-02-25  9:50 ` Simon Horman
2025-02-27 17:27   ` Simon Horman
2025-10-03  7:45 ` [Intel-wired-lan] " Rinitha, SX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).