From nobody Thu Aug 10 00:28:13 2023
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 4RLnp60Hxwz4mW9v;
	Thu, 10 Aug 2023 00:28:14 +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 "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4RLnp56ZXZz4Yjd;
	Thu, 10 Aug 2023 00:28:13 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1691627294;
	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=FYnYoovI0g0HQJY+2rvjr8CbaSi+KkmakJTZy5VXt8I=;
	b=vz0gajZvlQtiogYavJDKxxbdNrDl1PHiMidgqlHfexDn67y8pSfBlKHJ9KICcCXo7kI8R6
	AH5Pka3lO+yKUEOMpq3TmxDL/seqJI2Xg7OKXWW66Mnhd8wFAdBlg0EL5TTo9N0sT/L/CZ
	DqyWX8Ki/5pKbo4zkkn4laylNwSr2rD9nZjFxVR8iyQM5q9h4hbwXUetOEZYVxC5TmP8VK
	1/gPuXcotDDPa7N3DLdmhZIQSx53bxVbJmN4ByfdRW9ed22a2GciorU5R3Jq0u8eThaYIk
	I9s6IXu/KmaF6BHcnyBteKzaDgS/9juKknFltNQ46ffjrk3WDNuM+lSIMJyu9A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1691627293;
	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=FYnYoovI0g0HQJY+2rvjr8CbaSi+KkmakJTZy5VXt8I=;
	b=RlcxEYsqHvXZbOk9RPYkDMe/49gOLEKecKdzKrVhfHsInvitq6eTMNoy0VuKuQxV058PF9
	/+nULLYh69jxcfUKEDe+UCvQvpdSlrWuI80tBHLhu7DSH/nML4Epfeg/pn/9W/190PjxEY
	QJ6RiM4n3UgNFjdTOWU0Ql0NP7yycCWFUqbtgSNp+X9YWmSxOivRC5FNrN4/zSpN47qSLj
	kRyebvhDgWzeDx7SUz0wDIIgCJlobNyZYQIgv7c7BMTi/ivrlwpk7RxXR1fnOD5N/+Vj2m
	EdmjAKmei6rwTX87qEj4ZVMSOwPCU94OHOSemUMZvlqvsZWgTiugn/HiL1vx+g==
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691627293; a=rsa-sha256; cv=none;
	b=eu//GjyEZvHadHX0F++2M4Nt4RZ0XkJ26VgBS8lIUH7iSppe1ftJRAY4OPHtQeZ9JzQviN
	rsxEnWweWWMquQHBUNK72dpR65t6sJN6dyfdFI0TKIDV/DHecl8OvyP1HQa/amjkj5VtZr
	p1tJOvJ7pv0ghxhhIlKKQFYTFJg7NSVhqiY1K2NMlSMQDgD8fCYt8l8e8Xj75GNVxdgTHy
	h9xSV8cwhoSeg/bcT79sqobWzMwMRXyJha5/A3tvtWxOA7FhxaAeEaPXdhYgLTuyvCqI3w
	+8dWDTDLjfIobuUei2GXw5Q0uMHPjwXr2/9RprUHGEFvM9QnfofDtnWHThW9fA==
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 4RLnp55dMKzcGy;
	Thu, 10 Aug 2023 00:28:13 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from gitrepo.freebsd.org ([127.0.1.44])
	by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37A0SDDp025579;
	Thu, 10 Aug 2023 00:28:13 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37A0SD4H025576;
	Thu, 10 Aug 2023 00:28:13 GMT
	(envelope-from git)
Date: Thu, 10 Aug 2023 00:28:13 GMT
Message-Id: <202308100028.37A0SD4H025576@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-branches@FreeBSD.org
From: Kevin Bowling <kbowling@FreeBSD.org>
Subject: git: f5255126772e - stable/13 - ixgbe: Warn once for
  unsupported SFPs
List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches
List-Help: <mailto:dev-commits-src-branches+help@freebsd.org>
List-Post: <mailto:dev-commits-src-branches@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org>
Sender: owner-dev-commits-src-branches@freebsd.org
X-BeenThere: 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/13
X-Git-Reftype: branch
X-Git-Commit: f5255126772e3c03442220939c7d2b12b12c2a3a
Auto-Submitted: auto-generated

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");