Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Aug 2023 00:28:13 GMT
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f5255126772e - stable/13 - ixgbe: Warn once for unsupported SFPs
Message-ID:  <202308100028.37A0SD4H025576@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=f5255126772e3c03442220939c7d2b12b12c2a3a

commit f5255126772e3c03442220939c7d2b12b12c2a3a
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2023-08-03 05:59:37 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2023-08-10 00:27:31 +0000

    ixgbe: Warn once for unsupported SFPs
    
    The driver belabors the point about unsupported SFPs, printing multiple
    times on link up. Limit it to once.
    
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D39785
    
    (cherry picked from commit a93409fc3cd7b4d4aeb35d7ef27f84c1ae13a42d)
---
 sys/dev/ixgbe/ixgbe_phy.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c
index eef1d40448d3..1ab4f057f810 100644
--- a/sys/dev/ixgbe/ixgbe_phy.c
+++ b/sys/dev/ixgbe/ixgbe_phy.c
@@ -1302,6 +1302,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
 	u8 cable_tech = 0;
 	u8 cable_spec = 0;
 	u16 enforce_sfp = 0;
+	static bool warned_once = false;
 
 	DEBUGFUNC("ixgbe_identify_sfp_module_generic");
 
@@ -1536,13 +1537,16 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
 				status = IXGBE_SUCCESS;
 			} else {
 				if (hw->allow_unsupported_sfp == true) {
-					EWARN(hw,
-						"WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. "
-						"Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. "
-						"Intel Corporation is not responsible for any harm caused by using untested modules.\n");
+					if (!warned_once)
+						EWARN(hw,
+							"WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. "
+							"Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. "
+							"Intel Corporation is not responsible for any harm caused by using untested modules.\n");
+					warned_once = true;
 					status = IXGBE_SUCCESS;
 				} else {
-					DEBUGOUT("SFP+ module not supported\n");
+					DEBUGOUT
+					    ("SFP+ module not supported\n");
 					hw->phy.type =
 						ixgbe_phy_sfp_unsupported;
 					status = IXGBE_ERR_SFP_NOT_SUPPORTED;
@@ -1647,6 +1651,7 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
 	u8 cable_length = 0;
 	u8 device_tech = 0;
 	bool active_cable = false;
+	static bool warned_once = false;
 
 	DEBUGFUNC("ixgbe_identify_qsfp_module_generic");
 
@@ -1792,10 +1797,12 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
 				status = IXGBE_SUCCESS;
 			} else {
 				if (hw->allow_unsupported_sfp == true) {
-					EWARN(hw,
-						"WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. "
-						"Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. "
-						"Intel Corporation is not responsible for any harm caused by using untested modules.\n");
+					if (!warned_once)
+						EWARN(hw,
+							"WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. "
+							"Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. "
+							"Intel Corporation is not responsible for any harm caused by using untested modules.\n");
+					warned_once = true;
 					status = IXGBE_SUCCESS;
 				} else {
 					DEBUGOUT("QSFP module not supported\n");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308100028.37A0SD4H025576>