From nobody Fri Sep 12 00:35:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cNFpC1ksNz67dR1; Fri, 12 Sep 2025 00:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cNFpC0f9kz3MXC; Fri, 12 Sep 2025 00:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757637347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9Fv8DAY9UjN7CoNDFdPBZpXZQaXFksGetRd1I+YsqA=; b=mbXDbU6NHjpdDnXDgUDbqVFMO1JONOvQ3FKTXA3L6O2rbcAfzBDo2P+vHPwJnSimsGSUb8 mp9tMSp5Ea5nth8HBeErKMKnzbhjXGVmM6y8F1r51HXsqt2SC4K9HrXiWXUpt5TdlvpgeE ehDsEbxizPwEeSXRtdMv1sz21FZtFdOIUvJwyz2UGXL2p172H50NqhpBKyWpOwaIU87z1Z NhumNNjcrQk4/GGRLiqJQVVz+iUFMB/mRrFpD8C1/pxPPOA4keYNMQhiHjHPdwMkicm01I ZSRiRVLErkUCXclqXgNshaWDouCPq6k2LbyJbdNRiampQre6oYrLmsEH8asvFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757637347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9Fv8DAY9UjN7CoNDFdPBZpXZQaXFksGetRd1I+YsqA=; b=fn055GXqX4ewvc5Xl7XU56JG5zYjspxBgyzvLi7BpiBZV1lwE4d0rikCQgk23ecadj9u2X wcU5PvrPlR4XIi0h63SMRAKuWwsiPd+PQkJOaELzS4AJVOfKp4tOsu+Lz62YoNoY+aWMFy lHRb0+Zmhr1j+2BQX6MjvsvoRY/4woZJ6wbDhoblo2oPqwyyXAX90PA/VLjsZvgwAPHLA/ Jz3yrvq77HUpUleT1t+5lFZCIvnwLAWzTYsw1OR6BLbuS07zwVpzbDbWsKWSUngk6bVXYn ACBkyw8JzWSbs4Wy48MV+mNoEHhBGHet5J49qe43j5HLXkOHz/FSS8mGNQNRww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757637347; a=rsa-sha256; cv=none; b=MZbhVGP7dCNBKKtcm/VARDOoz4WDEqoD5qzaNOSpWjJZX2tWRYGpNT/ccPRe+XMRLAB69W gCWFfIAntPpyH8G6KNeENqckIdNup/0hW3tEoWaRF7Ja87k/M7mwHWIM7IaQuUxaNt2VyA 7hP2tW+/tcMo3t9GcYnE4luVL60hFzTLLXMHleN5aNRAu2Qyo4wOi0MogEsdpga+GrTudi Q+qEi5svvtVFnY8nRmsSKFm4/J+aPzlQrPs32vSdAPLpZLxl5WN202JJuvoJrdwo7XkAC4 /QSvhRHQy9A5kT0AE+n/00zVpW/9VUUW1rEabqB9BumOw2atEP9pOAHrAXTUGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cNFpC0B7jzVR6; Fri, 12 Sep 2025 00:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58C0ZkA7038895; Fri, 12 Sep 2025 00:35:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58C0ZkRG038892; Fri, 12 Sep 2025 00:35:46 GMT (envelope-from git) Date: Fri, 12 Sep 2025 00:35:46 GMT Message-Id: <202509120035.58C0ZkRG038892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 98f7ad4160b1 - stable/15 - ixgbe: Fix incomplete speed coverage in link status logging List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 98f7ad4160b18418e0cea6615906b5d7b3840282 Auto-Submitted: auto-generated The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=98f7ad4160b18418e0cea6615906b5d7b3840282 commit 98f7ad4160b18418e0cea6615906b5d7b3840282 Author: Yogesh Bhosale AuthorDate: 2025-09-09 17:01:04 +0000 Commit: Kevin Bowling CommitDate: 2025-09-12 00:34:42 +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.bhosale@intel.com PR: 288960 Reported by: Mike Belanger - QNX Differential Revision: https://reviews.freebsd.org/D52442 (cherry picked from commit 46347b3619757e3d683a87ca03efaf2ae242335f) --- 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);