Skip to content

Commit e984046

Browse files
gnitkaanguy11
authored andcommitted
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: 258f5f9 ("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> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 210b35d commit e984046

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,6 +4382,15 @@ int ice_get_phy_lane_number(struct ice_hw *hw)
43824382
unsigned int lane;
43834383
int err;
43844384

4385+
/* E82X does not have sequential IDs, lane number is PF ID.
4386+
* For E825 device, the exception is the variant with external
4387+
* PHY (0x579F), in which there is also 1:1 pf_id -> lane_number
4388+
* mapping.
4389+
*/
4390+
if (hw->mac_type == ICE_MAC_GENERIC ||
4391+
hw->device_id == ICE_DEV_ID_E825C_SGMII)
4392+
return hw->pf_id;
4393+
43854394
options = kcalloc(ICE_AQC_PORT_OPT_MAX, sizeof(*options), GFP_KERNEL);
43864395
if (!options)
43874396
return -ENOMEM;

0 commit comments

Comments
 (0)