Skip to content

Commit f99c579

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-10-28 (ice, ixgbe, igb, igc) For ice, Grzegorz fixes setting of PHY lane number and logical PF ID for E82x devices. He also corrects access of CGU (Clock Generation Unit) on dual complex devices. Kohei Enju resolves issues with error path cleanup for probe when in recovery mode on ixgbe and ensures PHY is powered on for link testing on igc. Lastly, he converts incorrect use of -ENOTSUPP to -EOPNOTSUPP on igb, igc, and ixgbe. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ixgbe: use EOPNOTSUPP instead of ENOTSUPP in ixgbe_ptp_feature_enable() igc: use EOPNOTSUPP instead of ENOTSUPP in igc_ethtool_get_sset_count() igb: use EOPNOTSUPP instead of ENOTSUPP in igb_get_sset_count() igc: power up the PHY before the link test ixgbe: fix memory leak and use-after-free in ixgbe_recovery_probe() ice: fix usage of logical PF id ice: fix destination CGU for dual complex E825 ice: fix lane number calculation ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 8df206f + f82acf6 commit f99c579

7 files changed

Lines changed: 42 additions & 7 deletions

File tree

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

Lines changed: 33 additions & 2 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;
@@ -6496,6 +6505,28 @@ u32 ice_get_link_speed(u16 index)
64966505
return ice_aq_to_link_speed[index];
64976506
}
64986507

6508+
/**
6509+
* ice_get_dest_cgu - get destination CGU dev for given HW
6510+
* @hw: pointer to the HW struct
6511+
*
6512+
* Get CGU client id for CGU register read/write operations.
6513+
*
6514+
* Return: CGU device id to use in SBQ transactions.
6515+
*/
6516+
static enum ice_sbq_dev_id ice_get_dest_cgu(struct ice_hw *hw)
6517+
{
6518+
/* On dual complex E825 only complex 0 has functional CGU powering all
6519+
* the PHYs.
6520+
* SBQ destination device cgu points to CGU on a current complex and to
6521+
* access primary CGU from the secondary complex, the driver should use
6522+
* cgu_peer as a destination device.
6523+
*/
6524+
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825 && ice_is_dual(hw) &&
6525+
!ice_is_primary(hw))
6526+
return ice_sbq_dev_cgu_peer;
6527+
return ice_sbq_dev_cgu;
6528+
}
6529+
64996530
/**
65006531
* ice_read_cgu_reg - Read a CGU register
65016532
* @hw: Pointer to the HW struct
@@ -6510,8 +6541,8 @@ u32 ice_get_link_speed(u16 index)
65106541
int ice_read_cgu_reg(struct ice_hw *hw, u32 addr, u32 *val)
65116542
{
65126543
struct ice_sbq_msg_input cgu_msg = {
6544+
.dest_dev = ice_get_dest_cgu(hw),
65136545
.opcode = ice_sbq_msg_rd,
6514-
.dest_dev = ice_sbq_dev_cgu,
65156546
.msg_addr_low = addr
65166547
};
65176548
int err;
@@ -6542,8 +6573,8 @@ int ice_read_cgu_reg(struct ice_hw *hw, u32 addr, u32 *val)
65426573
int ice_write_cgu_reg(struct ice_hw *hw, u32 addr, u32 val)
65436574
{
65446575
struct ice_sbq_msg_input cgu_msg = {
6576+
.dest_dev = ice_get_dest_cgu(hw),
65456577
.opcode = ice_sbq_msg_wr,
6546-
.dest_dev = ice_sbq_dev_cgu,
65476578
.msg_addr_low = addr,
65486579
.data = val
65496580
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
14791479
per_pf = ICE_PROF_MASK_COUNT / hw->dev_caps.num_funcs;
14801480

14811481
hw->blk[blk].masks.count = per_pf;
1482-
hw->blk[blk].masks.first = hw->pf_id * per_pf;
1482+
hw->blk[blk].masks.first = hw->logical_pf_id * per_pf;
14831483

14841484
memset(hw->blk[blk].masks.masks, 0, sizeof(hw->blk[blk].masks.masks));
14851485

drivers/net/ethernet/intel/ice/ice_sbq_cmd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ enum ice_sbq_dev_id {
5050
ice_sbq_dev_phy_0 = 0x02,
5151
ice_sbq_dev_cgu = 0x06,
5252
ice_sbq_dev_phy_0_peer = 0x0D,
53+
ice_sbq_dev_cgu_peer = 0x0F,
5354
};
5455

5556
enum ice_sbq_msg_opcode {

drivers/net/ethernet/intel/igb/igb_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,7 @@ static int igb_get_sset_count(struct net_device *netdev, int sset)
22812281
case ETH_SS_PRIV_FLAGS:
22822282
return IGB_PRIV_FLAGS_STR_LEN;
22832283
default:
2284-
return -ENOTSUPP;
2284+
return -EOPNOTSUPP;
22852285
}
22862286
}
22872287

drivers/net/ethernet/intel/igc/igc_ethtool.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ static int igc_ethtool_get_sset_count(struct net_device *netdev, int sset)
810810
case ETH_SS_PRIV_FLAGS:
811811
return IGC_PRIV_FLAGS_STR_LEN;
812812
default:
813-
return -ENOTSUPP;
813+
return -EOPNOTSUPP;
814814
}
815815
}
816816

@@ -2094,6 +2094,9 @@ static void igc_ethtool_diag_test(struct net_device *netdev,
20942094
netdev_info(adapter->netdev, "Offline testing starting");
20952095
set_bit(__IGC_TESTING, &adapter->state);
20962096

2097+
/* power up PHY for link test */
2098+
igc_power_up_phy_copper(&adapter->hw);
2099+
20972100
/* Link test performed before hardware reset so autoneg doesn't
20982101
* interfere with test result
20992102
*/

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11507,10 +11507,10 @@ static int ixgbe_recovery_probe(struct ixgbe_adapter *adapter)
1150711507
shutdown_aci:
1150811508
mutex_destroy(&adapter->hw.aci.lock);
1150911509
ixgbe_release_hw_control(adapter);
11510-
devlink_free(adapter->devlink);
1151111510
clean_up_probe:
1151211511
disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
1151311512
free_netdev(netdev);
11513+
devlink_free(adapter->devlink);
1151411514
pci_release_mem_regions(pdev);
1151511515
if (disable_dev)
1151611516
pci_disable_device(pdev);

drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ static int ixgbe_ptp_feature_enable(struct ptp_clock_info *ptp,
641641
* disabled
642642
*/
643643
if (rq->type != PTP_CLK_REQ_PPS || !adapter->ptp_setup_sdp)
644-
return -ENOTSUPP;
644+
return -EOPNOTSUPP;
645645

646646
if (on)
647647
adapter->flags2 |= IXGBE_FLAG2_PTP_PPS_ENABLED;

0 commit comments

Comments
 (0)