DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] net/ice: updates for link speed setting
@ 2026-09-10 15:08 Bruce Richardson
  2026-09-10 15:08 ` [PATCH 1/2] net/ice: check for missing fixed " Bruce Richardson
  2026-09-10 15:08 ` [PATCH 2/2] net/ice: disable link negotiation for fixed speed selection Bruce Richardson
  0 siblings, 2 replies; 3+ messages in thread
From: Bruce Richardson @ 2026-09-10 15:08 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

A pair of patches to improve the setting of link speeds for ice

Bruce Richardson (2):
  net/ice: check for missing fixed speed setting
  net/ice: disable link negotiation for fixed speed selection

 drivers/net/intel/ice/ice_ethdev.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

--
2.53.0


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

* [PATCH 1/2] net/ice: check for missing fixed speed setting
  2026-09-10 15:08 [PATCH 0/2] net/ice: updates for link speed setting Bruce Richardson
@ 2026-09-10 15:08 ` Bruce Richardson
  2026-09-10 15:08 ` [PATCH 2/2] net/ice: disable link negotiation for fixed speed selection Bruce Richardson
  1 sibling, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2026-09-10 15:08 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable, Anatoly Burakov, Kaiwen Deng, Qi Zhang

When the user requests a fixed speed for a NIC link, the speeds bitmask
passed must have a speed value actually set in it, as well as the
"FIXED" flag. Catch this case and log an error message.

Fixes: 36afbc269081 ("net/ice: support link speed change")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ice/ice_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 76b8ff0a72..dc955d130b 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -4936,6 +4936,10 @@ ice_apply_link_speed(struct rte_eth_dev *dev)
 					RTE_ETH_LINK_SPEED_100M;
 	}
 	speed = ice_parse_link_speeds(conf->link_speeds);
+	if (speed == ICE_AQ_LINK_SPEED_UNKNOWN) {
+		PMD_DRV_LOG(ERR, "No valid link speed setting specified");
+		return -EINVAL;
+	}
 
 	return ice_phy_conf_link(hw, speed, true);
 }
-- 
2.53.0


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

* [PATCH 2/2] net/ice: disable link negotiation for fixed speed selection
  2026-09-10 15:08 [PATCH 0/2] net/ice: updates for link speed setting Bruce Richardson
  2026-09-10 15:08 ` [PATCH 1/2] net/ice: check for missing fixed " Bruce Richardson
@ 2026-09-10 15:08 ` Bruce Richardson
  1 sibling, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2026-09-10 15:08 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Anatoly Burakov

When the user has requested fixed link parameters, e.g. speed, duplex,
etc., disable the HW link negotiation, i.e. AN Clause 28, Clause 37 etc.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ice/ice_ethdev.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index dc955d130b..592e7c4c21 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -124,7 +124,8 @@ static int ice_dev_info_get(struct rte_eth_dev *dev,
 			    struct rte_eth_dev_info *dev_info);
 static int ice_phy_conf_link(struct ice_hw *hw,
 					u16 force_speed,
-					bool link_up);
+					bool link_up,
+					bool link_autoneg);
 static int ice_link_update(struct rte_eth_dev *dev,
 			   int wait_to_complete);
 static int ice_dev_set_link_up(struct rte_eth_dev *dev);
@@ -4941,13 +4942,15 @@ ice_apply_link_speed(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
-	return ice_phy_conf_link(hw, speed, true);
+	bool link_autoneg = (conf->link_speeds & RTE_ETH_LINK_SPEED_FIXED) == 0;
+	return ice_phy_conf_link(hw, speed, true, link_autoneg);
 }
 
 static int
 ice_phy_conf_link(struct ice_hw *hw,
 		   u16 link_speeds_bitmap,
-		   bool link_up)
+		   bool link_up,
+		   bool link_autoneg)
 {
 	struct ice_aqc_set_phy_cfg_data cfg = { 0 };
 	struct ice_port_info *pi = hw->port_info;
@@ -4991,6 +4994,10 @@ ice_phy_conf_link(struct ice_hw *hw,
 
 	cfg.caps = phy_caps->caps | ICE_AQ_PHY_ENA_AUTO_LINK_UPDT;
 	cfg.low_power_ctrl_an = phy_caps->low_power_ctrl_an;
+	if (!link_autoneg)
+		cfg.low_power_ctrl_an &= ~(ICE_AQC_PHY_AN_EN_CLAUSE28 |
+				ICE_AQC_PHY_AN_EN_CLAUSE73 |
+				ICE_AQC_PHY_AN_EN_CLAUSE37);
 	cfg.eee_cap = phy_caps->eee_cap;
 	cfg.eeer_value = phy_caps->eeer_value;
 	cfg.link_fec_opt = phy_caps->link_fec_options;
@@ -5018,7 +5025,7 @@ ice_dev_set_link_down(struct rte_eth_dev *dev)
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint8_t speed = ICE_LINK_SPEED_UNKNOWN;
 
-	return ice_phy_conf_link(hw, speed, false);
+	return ice_phy_conf_link(hw, speed, false, true);
 }
 
 static int
-- 
2.53.0


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

end of thread, other threads:[~2026-09-10 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10 15:08 [PATCH 0/2] net/ice: updates for link speed setting Bruce Richardson
2026-09-10 15:08 ` [PATCH 1/2] net/ice: check for missing fixed " Bruce Richardson
2026-09-10 15:08 ` [PATCH 2/2] net/ice: disable link negotiation for fixed speed selection Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox