The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=46347b3619757e3d683a87ca03efaf2ae242335f
commit 46347b3619757e3d683a87ca03efaf2ae242335f Author: Yogesh Bhosale <yogesh.bhos...@intel.com> AuthorDate: 2025-09-09 17:01:04 +0000 Commit: Kevin Bowling <kbowl...@freebsd.org> CommitDate: 2025-09-09 17:39:10 +0000 ixgbe: Fix incomplete speed coverage in link status logging Originally ixgbe_if_update_admin_status() only handled 1G and 10G speeds, causing any other speeds to display as "1 Gbps" in link status logs. This issue is fixed by adding link speed to string conversion logic through the introduction of a helper function, ixgbe_link_speed_to_str(), which corrects the misleading logs to reflect accurate link speeds. Signed-off-by: Yogesh Bhosale yogesh.bhos...@intel.com PR: 288960 Reported by: Mike Belanger - QNX MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52442 --- sys/dev/ixgbe/if_ix.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 73c0fd1ab16f..e1e05e008e8d 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -184,6 +184,7 @@ static int ixgbe_if_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); static void ixgbe_if_queues_free(if_ctx_t); static void ixgbe_if_timer(if_ctx_t, uint16_t); +static const char *ixgbe_link_speed_to_str(u32 link_speed); static void ixgbe_if_update_admin_status(if_ctx_t); static void ixgbe_if_vlan_register(if_ctx_t, u16); static void ixgbe_if_vlan_unregister(if_ctx_t, u16); @@ -4026,6 +4027,33 @@ ixgbe_if_stop(if_ctx_t ctx) return; } /* ixgbe_if_stop */ +/************************************************************************ + * ixgbe_link_speed_to_str - Convert link speed to string + * + * Helper function to convert link speed constants to human-readable + * string representations in Gbps. + ************************************************************************/ +static const char * +ixgbe_link_speed_to_str(u32 link_speed) +{ + switch (link_speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + return "10 Gbps"; + case IXGBE_LINK_SPEED_5GB_FULL: + return "5 Gbps"; + case IXGBE_LINK_SPEED_2_5GB_FULL: + return "2.5 Gbps"; + case IXGBE_LINK_SPEED_1GB_FULL: + return "1 Gbps"; + case IXGBE_LINK_SPEED_100_FULL: + return "100 Mbps"; + case IXGBE_LINK_SPEED_10_FULL: + return "10 Mbps"; + default: + return "Unknown"; + } +} /* ixgbe_link_speed_to_str */ + /************************************************************************ * ixgbe_update_link_status - Update OS on link state * @@ -4042,9 +4070,9 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) if (sc->link_up) { if (sc->link_active == false) { if (bootverbose) - device_printf(dev, "Link is up %d Gbps %s \n", - ((sc->link_speed == 128) ? 10 : 1), - "Full Duplex"); + device_printf(dev, + "Link is up %s Full Duplex\n", + ixgbe_link_speed_to_str(sc->link_speed)); sc->link_active = true; /* Update any Flow Control changes */ ixgbe_fc_enable(&sc->hw);