Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Feb 2025 00:25:59 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: c34817d9aef7 - stable/14 - ixgbe: Add support for 1000BASE-BX SFP modules
Message-ID:  <202502160025.51G0PxBd016244@gitrepo.freebsd.org>

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

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

commit c34817d9aef7e97578f5ccb0b24381f5b4b9013f
Author:     Tore Amundsen <tore@amundsen.org>
AuthorDate: 2024-11-06 21:31:01 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2025-02-16 00:25:04 +0000

    ixgbe: Add support for 1000BASE-BX SFP modules
    
    Add support for 1Gbit BiDi modules
    
    Signed-off-by:  Tore Amundsen <tore@amundsen.org>
    Relnotes:       yes
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1518
    
    (cherry picked from commit 89d4096950c4db748e39758c941cfb708c2ff808)
---
 sys/dev/ixgbe/if_ix.c       |  5 ++++-
 sys/dev/ixgbe/ixgbe_82599.c |  4 +++-
 sys/dev/ixgbe/ixgbe_phy.c   | 23 +++++++++++++++++++----
 sys/dev/ixgbe/ixgbe_phy.h   |  2 ++
 sys/dev/ixgbe/ixgbe_type.h  |  2 ++
 5 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index e94e120e27f9..959afa79e7da 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -1424,8 +1424,10 @@ ixgbe_add_media_types(if_ctx_t ctx)
 		ifmedia_add(sc->media, IFM_ETHER | IFM_2500_SX, 0, NULL);
 	}
 #endif
-	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX)
+	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) {
 		device_printf(dev, "Media supported: 1000baseBX\n");
+		ifmedia_add(sc->media, IFM_ETHER | IFM_1000_BX, 0, NULL);
+	}
 
 	if (hw->device_id == IXGBE_DEV_ID_82598AT) {
 		ifmedia_add(sc->media, IFM_ETHER | IFM_1000_T | IFM_FDX,
@@ -2567,6 +2569,7 @@ ixgbe_if_media_change(if_ctx_t ctx)
 #endif
 	case IFM_1000_LX:
 	case IFM_1000_SX:
+	case IFM_1000_BX:
 		speed |= IXGBE_LINK_SPEED_1GB_FULL;
 		break;
 	case IFM_1000_T:
diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c
index b2b40371648b..50902c6c356d 100644
--- a/sys/dev/ixgbe/ixgbe_82599.c
+++ b/sys/dev/ixgbe/ixgbe_82599.c
@@ -435,7 +435,9 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
 	    hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
 	    hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
 	    hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
-	    hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) {
+	    hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 ||
+	    hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core0 ||
+	    hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core1) {
 		*speed = IXGBE_LINK_SPEED_1GB_FULL;
 		*autoneg = true;
 		goto out;
diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c
index ea815c6c88e5..2a735ead9a12 100644
--- a/sys/dev/ixgbe/ixgbe_phy.c
+++ b/sys/dev/ixgbe/ixgbe_phy.c
@@ -1423,6 +1423,13 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
 				else
 					hw->phy.sfp_type =
 						ixgbe_sfp_type_1g_lx_core1;
+			} else if (comp_codes_1g & IXGBE_SFF_BASEBX10_CAPABLE) {
+				if (hw->bus.lan_id == 0)
+					hw->phy.sfp_type =
+						ixgbe_sfp_type_1g_bx_core0;
+				else
+					hw->phy.sfp_type =
+						ixgbe_sfp_type_1g_bx_core1;
 			} else {
 				hw->phy.sfp_type = ixgbe_sfp_type_unknown;
 			}
@@ -1513,7 +1520,9 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
 		      hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
 		      hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
 		      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
-		      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
+		      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 ||
+		      hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core0 ||
+		      hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core1)) {
 			hw->phy.type = ixgbe_phy_sfp_unsupported;
 			status = IXGBE_ERR_SFP_NOT_SUPPORTED;
 			goto out;
@@ -1532,7 +1541,9 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
 		      hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
 		      hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
 		      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
-		      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
+		      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 ||
+		      hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core0 ||
+		      hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core1)) {
 			/* Make sure we're a supported PHY type */
 			if (hw->phy.type == ixgbe_phy_sfp_intel) {
 				status = IXGBE_SUCCESS;
@@ -1615,6 +1626,8 @@ u64 ixgbe_get_supported_phy_sfp_layer_generic(struct ixgbe_hw *hw)
 			physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T;
 		else if (comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE)
 			physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_SX;
+		else if (comp_codes_1g & IXGBE_SFF_BASEBX10_CAPABLE)
+			physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_BX;
 		break;
 	case ixgbe_phy_qsfp_intel:
 	case ixgbe_phy_qsfp_unknown:
@@ -1863,12 +1876,14 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
 	if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 ||
 	    sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
 	    sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
-	    sfp_type == ixgbe_sfp_type_1g_sx_core0)
+	    sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
+	    sfp_type == ixgbe_sfp_type_1g_bx_core0)
 		sfp_type = ixgbe_sfp_type_srlr_core0;
 	else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 ||
 		 sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
 		 sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
-		 sfp_type == ixgbe_sfp_type_1g_sx_core1)
+		 sfp_type == ixgbe_sfp_type_1g_sx_core1 ||
+		 sfp_type == ixgbe_sfp_type_1g_bx_core1)
 		sfp_type = ixgbe_sfp_type_srlr_core1;
 
 	/* Read offset to PHY init contents */
diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h
index 1fa2acb77354..c1ba73851397 100644
--- a/sys/dev/ixgbe/ixgbe_phy.h
+++ b/sys/dev/ixgbe/ixgbe_phy.h
@@ -49,6 +49,7 @@
 #define IXGBE_SFF_1GBE_COMP_CODES	0x6
 #define IXGBE_SFF_10GBE_COMP_CODES	0x3
 #define IXGBE_SFF_CABLE_TECHNOLOGY	0x8
+#define IXGBE_SFF_BITRATE_NOMINAL	0xC
 #define IXGBE_SFF_CABLE_SPEC_COMP	0x3C
 #define IXGBE_SFF_SFF_8472_SWAP		0x5C
 #define IXGBE_SFF_SFF_8472_COMP		0x5E
@@ -73,6 +74,7 @@
 #define IXGBE_SFF_1GBASET_CAPABLE	0x8
 #define IXGBE_SFF_10GBASESR_CAPABLE	0x10
 #define IXGBE_SFF_10GBASELR_CAPABLE	0x20
+#define IXGBE_SFF_BASEBX10_CAPABLE	0x40
 #define IXGBE_SFF_SOFT_RS_SELECT_MASK	0x8
 #define IXGBE_SFF_SOFT_RS_SELECT_10G	0x8
 #define IXGBE_SFF_SOFT_RS_SELECT_1G	0x0
diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h
index a414e27142ec..91b46da72c75 100644
--- a/sys/dev/ixgbe/ixgbe_type.h
+++ b/sys/dev/ixgbe/ixgbe_type.h
@@ -3807,6 +3807,8 @@ enum ixgbe_sfp_type {
 	ixgbe_sfp_type_1g_sx_core1 = 12,
 	ixgbe_sfp_type_1g_lx_core0 = 13,
 	ixgbe_sfp_type_1g_lx_core1 = 14,
+	ixgbe_sfp_type_1g_bx_core0 = 15,
+	ixgbe_sfp_type_1g_bx_core1 = 16,
 	ixgbe_sfp_type_not_present = 0xFFFE,
 	ixgbe_sfp_type_unknown = 0xFFFF
 };



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