The branch main has been updated by kbowling:

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

commit 48ddd1b9f88753c6875566fbb67bc622453e4993
Author:     Kevin Bowling <kbowl...@freebsd.org>
AuthorDate: 2024-11-14 06:33:28 +0000
Commit:     Kevin Bowling <kbowl...@freebsd.org>
CommitDate: 2024-11-14 07:11:08 +0000

    ixgbe: Add support for 1Gbit DAC links
    
    This is a relatively well known trick for the X520 (82599), can be
    useful for testing and lab settings.  It's not an official standard or
    particularly common but ubiquitous Broadcom switch ASICs deal with it.
    
    We'll call it 1000Base-KX because it's SerDes on the passive cable and
    I don't think it's worth adding another media type for this.
    
    Reviewed by:    emaste
    MFC after:      1 week
    Sponsored by:   BBOX.io
    Differential Revision:  https://reviews.freebsd.org/D47352
---
 sys/dev/ixgbe/if_ix.c       |  7 ++++++-
 sys/dev/ixgbe/ixgbe_82599.c | 11 +++++++++++
 sys/dev/ixgbe/ixgbe_phy.c   |  3 ++-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 80f288a4ccf0..f8a620295aa4 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -1315,9 +1315,11 @@ ixgbe_add_media_types(if_ctx_t ctx)
        }
 
        if (layer & IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU ||
-           layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA)
+           layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA) {
                ifmedia_add(sc->media, IFM_ETHER | IFM_10G_TWINAX, 0,
                    NULL);
+               ifmedia_add(sc->media, IFM_ETHER | IFM_1000_KX, 0, NULL);
+       }
 
        if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) {
                ifmedia_add(sc->media, IFM_ETHER | IFM_10G_LR, 0, NULL);
@@ -2323,6 +2325,9 @@ ixgbe_if_media_status(if_ctx_t ctx, struct ifmediareq * 
ifmr)
                case IXGBE_LINK_SPEED_10GB_FULL:
                        ifmr->ifm_active |= IFM_10G_TWINAX | IFM_FDX;
                        break;
+               case IXGBE_LINK_SPEED_1GB_FULL:
+                       ifmr->ifm_active |= IFM_1000_KX | IFM_FDX;
+                       break;
                }
        if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR)
                switch (sc->link_speed) {
diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c
index 1ecab83a4e92..b2b40371648b 100644
--- a/sys/dev/ixgbe/ixgbe_82599.c
+++ b/sys/dev/ixgbe/ixgbe_82599.c
@@ -441,6 +441,17 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
                goto out;
        }
 
+       if (hw->phy.sfp_type == ixgbe_sfp_type_da_cu_core0 ||
+           hw->phy.sfp_type == ixgbe_sfp_type_da_cu_core1) {
+               *speed = IXGBE_LINK_SPEED_10GB_FULL;
+               *autoneg = true;
+
+               if (hw->phy.multispeed_fiber)
+                       *speed |= IXGBE_LINK_SPEED_1GB_FULL;
+
+               goto out;
+       }
+
        /*
         * Determine link capabilities based on the stored value of AUTOC,
         * which represents EEPROM defaults.  If AUTOC value has not
diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c
index da7d16a514d0..218a9dac3b78 100644
--- a/sys/dev/ixgbe/ixgbe_phy.c
+++ b/sys/dev/ixgbe/ixgbe_phy.c
@@ -1436,7 +1436,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                if (((comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) &&
                   (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)) ||
                   ((comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) &&
-                  (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)))
+                  (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)) ||
+                  (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE))
                        hw->phy.multispeed_fiber = true;
 
                /* Determine PHY vendor */

Reply via email to