* [PATCH iwl-net] ice: Fix "Unknown bps" during link events
@ 2026-07-22 12:24 Lukasz Czapnik
2026-07-28 10:55 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Czapnik @ 2026-07-22 12:24 UTC (permalink / raw)
To: intel-wired-lan
Cc: netdev, Jakub Kaminski, Lukasz Czapnik, Aleksandr Loktionov,
Tomasz Lichwala
From: Jakub Kaminski <jakub.kaminski@intel.com>
The driver may display "NIC Link is up Unknown bps" messages during
link state changes. This occurs when link status and link speed are
read from different points in time.
The driver processes link events by receiving an asynchronous ARQ event
from firmware containing link_up and link_speed values, then performing
a synchronous AQ query via ice_update_link_info() which overwrites the
phy.link_info structure, and finally calling ice_link_event() with a
link_speed parameter while ice_print_link_msg() read link_speed from
phy.link_info directly.
ice_print_link_msg() always read link_speed from the phy.link_info
structure. This caused link status from the ARQ event to be combined
with link_speed from the later AQ query, mixing information from two
different points in time. When firmware state changed between these
moments, inconsistent messages like "Link is up Unknown bps" appeared.
Add a link_speed parameter to ice_print_link_msg() to ensure link
status and speed are always taken from the same source and point in
time.
Fixes: c2a23e00613b ("ice: Refactor link event flow")
Signed-off-by: Jakub Kaminski <jakub.kaminski@intel.com>
Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Tomasz Lichwala <tomasz.lichwala@intel.com>
---
drivers/net/ethernet/intel/ice/ice.h | 2 +-
drivers/net/ethernet/intel/ice/ice_ethtool.c | 2 +-
drivers/net/ethernet/intel/ice/ice_main.c | 14 +++++++++-----
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index da679793b397..567058c28907 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -1006,7 +1006,7 @@ int ice_get_rss_key(struct ice_vsi *vsi, u8 *seed);
int ice_set_rss_hfunc(struct ice_vsi *vsi, u8 hfunc);
void ice_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size);
int ice_schedule_reset(struct ice_pf *pf, enum ice_reset_req reset);
-void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
+void ice_print_link_msg(struct ice_vsi *vsi, bool isup, u16 link_speed);
int ice_plug_aux_dev(struct ice_pf *pf);
void ice_unplug_aux_dev(struct ice_pf *pf);
void ice_rdma_finalize_setup(struct ice_pf *pf);
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 9ddd7e82a300..c37b72763ce5 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -2814,7 +2814,7 @@ ice_set_link_ksettings(struct net_device *netdev,
/* Tell the OS link is going down, the link will go
* back up when fw says it is ready asynchronously
*/
- ice_print_link_msg(np->vsi, false);
+ ice_print_link_msg(np->vsi, false, 0);
netif_carrier_off(netdev);
netif_tx_stop_all_queues(netdev);
}
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 968a8e18d197..2ab5e2800c30 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -835,8 +835,9 @@ static void ice_print_topo_conflict(struct ice_vsi *vsi)
* ice_print_link_msg - print link up or down message
* @vsi: the VSI whose link status is being queried
* @isup: boolean for if the link is now up or down
+ * @link_speed: current link speed value to display
*/
-void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
+void ice_print_link_msg(struct ice_vsi *vsi, bool isup, u16 link_speed)
{
struct ice_aqc_get_phy_caps_data *caps;
const char *an_advertised;
@@ -860,7 +861,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
return;
}
- switch (vsi->port_info->phy.link_info.link_speed) {
+ switch (link_speed) {
case ICE_AQ_LINK_SPEED_200GB:
speed = "200 G";
break;
@@ -1193,8 +1194,10 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,
/* Check if the link state is up after updating link info, and treat
* this event as an UP event since the link is actually UP now.
*/
- if (phy_info->link_info.link_info & ICE_AQ_LINK_UP)
+ if (phy_info->link_info.link_info & ICE_AQ_LINK_UP) {
link_up = true;
+ link_speed = phy_info->link_info.link_speed;
+ }
vsi = ice_get_main_vsi(pf);
if (!vsi || !vsi->port_info)
@@ -1224,7 +1227,7 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,
ice_set_dflt_mib(pf);
}
ice_vsi_link_event(vsi, link_up);
- ice_print_link_msg(vsi, link_up);
+ ice_print_link_msg(vsi, link_up, link_speed);
ice_vc_notify_link_state(pf);
@@ -6922,7 +6925,8 @@ static int ice_up_complete(struct ice_vsi *vsi)
(vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) &&
((vsi->netdev && (vsi->type == ICE_VSI_PF ||
vsi->type == ICE_VSI_SF)))) {
- ice_print_link_msg(vsi, true);
+ ice_print_link_msg(vsi, true,
+ vsi->port_info->phy.link_info.link_speed);
netif_tx_start_all_queues(vsi->netdev);
netif_carrier_on(vsi->netdev);
ice_ptp_link_change(pf, true);
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH iwl-net] ice: Fix "Unknown bps" during link events
2026-07-22 12:24 [PATCH iwl-net] ice: Fix "Unknown bps" during link events Lukasz Czapnik
@ 2026-07-28 10:55 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2026-07-28 10:55 UTC (permalink / raw)
To: Lukasz Czapnik
Cc: intel-wired-lan, netdev, Jakub Kaminski, Aleksandr Loktionov,
Tomasz Lichwala
On Wed, Jul 22, 2026 at 02:24:48PM +0200, Lukasz Czapnik wrote:
...
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
...
> @@ -1193,8 +1194,10 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,
> /* Check if the link state is up after updating link info, and treat
> * this event as an UP event since the link is actually UP now.
> */
> - if (phy_info->link_info.link_info & ICE_AQ_LINK_UP)
> + if (phy_info->link_info.link_info & ICE_AQ_LINK_UP) {
> link_up = true;
> + link_speed = phy_info->link_info.link_speed;
> + }
>
> vsi = ice_get_main_vsi(pf);
> if (!vsi || !vsi->port_info)
I have a minor concern that the change above effects the following,
which is a little further down in the same function.
/* if the old link up/down and speed is the same as the new */
if (link_up == old_link && link_speed == old_link_speed)
return 0;
Maybe it's obvious why that isn't the case.
But if so, perhaps could be mentioned in the patch description anyway?
> @@ -1224,7 +1227,7 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,
> ice_set_dflt_mib(pf);
> }
> ice_vsi_link_event(vsi, link_up);
> - ice_print_link_msg(vsi, link_up);
> + ice_print_link_msg(vsi, link_up, link_speed);
>
> ice_vc_notify_link_state(pf);
>
...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-28 10:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 12:24 [PATCH iwl-net] ice: Fix "Unknown bps" during link events Lukasz Czapnik
2026-07-28 10:55 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox