DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [PATCH 2/2] net/ice: disable link negotiation for fixed speed selection
Date: Thu, 10 Sep 2026 16:08:17 +0100	[thread overview]
Message-ID: <20260910150817.1521317-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260910150817.1521317-1-bruce.richardson@intel.com>

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


      parent reply	other threads:[~2026-09-10 15:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=20260910150817.1521317-3-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    /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