From nobody Tue Sep 9 17:40:03 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 4cLrgR4VV1z67DL3; Tue, 09 Sep 2025 17:40:03 +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 4cLrgR3vFxz3cc6; Tue, 09 Sep 2025 17:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757439603; 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=EwkqKYJcwCknBzdcDRQFdD2oaM2+EjFMIhaNT2mHgQE=; b=g+lNiBrVvLl/ljxHCElizY/vz70JuebFwsGglPM4ztAbWES0ZFZlMiSzmKmFhVd7L0m54h 859750/Fwydne6JU6GP3/mAijK7rbk/Yny4NJ/toG77vanOGQeuYF50SdXdUUlOHSa+qoU Thv0dlW6r1AzBH1Bb4vujPbONMagI6ROqQqe+98KhPPodBvEnBChB6cg5GEXj6ewdxVk0j IPlz1ofEK157qwPT4KJJqETH5kEYTHAlAXpxPfOnVWAlIyjJe68dD2YZNug1x6gV1IRKcZ dkrQ/P+/xXIrEzZCmrAEBcB0LOg5D5S9pdDQirCSIFif6S/PJix/7VNMEE5/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757439603; 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=EwkqKYJcwCknBzdcDRQFdD2oaM2+EjFMIhaNT2mHgQE=; b=lQ7JAHC4Qr1NqJWW35bN/O4Mg1U1F0Ycy4Zhl6JvpIkXlCXQmmPcfFSvdQavl1KLIeRhai ommTvVb35vX8rreCAzDLQK0bfLEISePi+iNPcc4h3gQagQF3BhWEJqoh21mQPQkGsRfXkZ ffMNQL4lD2bKzg8CvUWQa65cbATNY65PzTD4TdXiFNXxhMOa/ZlBeGPDRXi8lsLNB7ZZIv z4aP6b+WPpE0cK3EJeeMsJ4c3M9G7or/BOhUrx1h86tE2iEKXyJGKvzx+OMagCbphPUuM2 Yyb1ddNjl8AULHohlBXsaArGyiZY7MDdXpxfr8fBS8LGKTe2kmKI7KLGXYHzYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757439603; a=rsa-sha256; cv=none; b=ior619u9zm6mzIq/9i5qILSBJf9e0FQjKKLvGaObsTD4VzpfM8X5EdqESEBv4oh364ekR9 hxEt55JFxoEUcZT7bsejUpcl/+kRvofXAJkWZ1PeSlr/L4vAhhrxbQQyqo2e001aYLnbIM lOYz+92lJTLYeLU6J3VeOxPeGg0v80GY+jSCa4M90H8Qms/co2lJA5MuXGzEfINfhyM+yM KEz+gUtGKJjxYfbIlg1n91RPa4rLXOGvyIoAeEf28vjdFJQfAyJrCOJWAxof3Y7mwmQ3ZQ pKl1biExr4sjmrZYEnSh9d/h7YaFSxj/tRjIhkSylhTIlWbSJsQc2IfQ/V7Enw== 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 4cLrgR32qRzmRG; Tue, 09 Sep 2025 17:40:03 +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 589He32V031522; Tue, 9 Sep 2025 17:40:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 589He3CW031517; Tue, 9 Sep 2025 17:40:03 GMT (envelope-from git) Date: Tue, 9 Sep 2025 17:40:03 GMT Message-Id: <202509091740.589He3CW031517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 46347b361975 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 46347b3619757e3d683a87ca03efaf2ae242335f Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=46347b3619757e3d683a87ca03efaf2ae242335f commit 46347b3619757e3d683a87ca03efaf2ae242335f Author: Yogesh Bhosale AuthorDate: 2025-09-09 17:01:04 +0000 Commit: Kevin Bowling 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.bhosale@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);