From nobody Fri Sep 12 00:38:25 2025 X-Original-To: dev-commits-src-branches@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 4cNFsF3tKYz67d9k; Fri, 12 Sep 2025 00:38:25 +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 4cNFsF35ynz3NKC; Fri, 12 Sep 2025 00:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757637505; 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=vhwnkgWWAEoqBLZcmaLaM/sMUH8joNJmveBLhMkWqQo=; b=KisnL408sqEjaxkvubWqYiv3ZgW7Eju7/+HXNhM3wcu0K3xBJex8vQN0fWo/xbHiz8Stog BoydvNfbssVq+Kzf4sGQLaO0VmAha8lqXIV5cEMiwblKLihbYULd8pr4630QL6OljpZteC tVpBUwZs4U4lis5U5ttxSxPMrEBobu5y/TgOYBFdOsExT9ubMWQd1LqaAvO3GUNpztl7RT YwB14rHcFJ8g2z6YRUvIEbqgDSoYrTK6URcyUnflKZsRlppET+3RYjOJD6P4rThlj5iv8L TOtBvg/ToTJoW3rEL2+SWX8KlwE/vcBIollLxg22pkK7Uq3aODDo69mbS3de/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757637505; 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=vhwnkgWWAEoqBLZcmaLaM/sMUH8joNJmveBLhMkWqQo=; b=shhtk4LFHA5E9PQU86FCPrvXJVEWZURiI8jOj5AmcJF8RT2zVTLxis/1ZYfKjhHby/bhuc fFeI/xMz0Z9K8HGrA8M/no9UzI3QVWuJ/ZZOJfxTvY7iqaUWDTUsXoQi6NVK/g7g1KBkSK hSAhUJo5ws36eg3jt9KcnDgbphN4PDURyEH7wdOAICnfV9t8XW92AZcevnvFdKeTJZrT6W oYQn8Q/80iKXIr0QOBgtJqxQw6BruuV16OKv7YFKKb9gPCg7E7UHFdhMUFbjNQyku51cs0 cpCp4QwRa1CyLxLqAFPbMwrGoRTA5O7XXD+hMRp+JexLKsuv8p8HNimKhCWSMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757637505; a=rsa-sha256; cv=none; b=nKmX2HWpZ5rVYZxDrqdqmPz0TnnokqofbYWgE2HABwkjvc2r143P148LVlL+Cx7BgICXKZ HfL3O5LoDS+azsnlpUBooetdzYC/wjhV1ljfHMhTTQlTRUGYPJKG5hELMFAhSVRnT/2rW9 74jQ33/N7qEYPHRY8lm9FHaPsJ1/TzjlrGX9WifyguMCIRhq9s4frfNxLX7DzuCY0oVfBj tfcVoP7e+M89JArCv6C3TX7RSwV4TuXyQAUSoW21je0u5TNXhTM6QHG1TYw0feN7/E4i7V djCveI16zmAbwiqPcrkE4fzkcJVf/owNAzEsttRqzPngdvEsqZrdv5wbSe+5mw== 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 4cNFsF2TM3zVXT; Fri, 12 Sep 2025 00:38:25 +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 58C0cPX9039840; Fri, 12 Sep 2025 00:38:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58C0cPkK039837; Fri, 12 Sep 2025 00:38:25 GMT (envelope-from git) Date: Fri, 12 Sep 2025 00:38:25 GMT Message-Id: <202509120038.58C0cPkK039837@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: 7dc494e63774 - stable/14 - ixgbe: Fix incomplete speed coverage in link status logging List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 7dc494e6377451469763a8a687032dee2b8324b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=7dc494e6377451469763a8a687032dee2b8324b2 commit 7dc494e6377451469763a8a687032dee2b8324b2 Author: Yogesh Bhosale AuthorDate: 2025-09-09 17:01:04 +0000 Commit: Kevin Bowling CommitDate: 2025-09-12 00:37:50 +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 959afa79e7da..53c06bc43dd3 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -174,6 +174,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); @@ -3857,6 +3858,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 * @@ -3873,9 +3901,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);