From nobody Thu Nov 21 05:53:54 2024 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 4Xv6qQ5BW3z5fHR7; Thu, 21 Nov 2024 05:53:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xv6qQ2Wykz4r7T; Thu, 21 Nov 2024 05:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732168434; 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=4sOlLNiTLO/vT5rICOVIaqjvXbgu+Zyk7xbVgTLiID4=; b=hzm4x7MjmCwYaHBbnO9+kS9UvxuyHBRj/3XF9VWX2AxeBvk8qNmWb/0ZjwTRHHZFmZJtNf ZDt7PJsXHm8DglgO0r0yIgBiHnXNBs/YOoN9SzxwSUARif/6ilOEQla5/RliR9WOmKP9tQ nu5vyXClJLYT3o/ymDvGTvWDhKHMfNgtPAwF8w0x7FKBbDEh09m7csfpSyDabVbstGEdmk NZiRV7yJ9wKfwF8gYLjlfgBYngJYbFUIQ9AjCEK1YYLv7YAodiUtAyhchckYn6KDSPh6ZP eZLt5VbxiNW8jc/6fcyvE93U5Pd4MBKktAbbBmTPFQzrIRbaiqskQr7yypZaIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732168434; 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=4sOlLNiTLO/vT5rICOVIaqjvXbgu+Zyk7xbVgTLiID4=; b=nw2QFxtejh2DO3zD0U5mJcne9iZS+f2qrXxuR8PkpDPSVS5dBq09ay2+vOmiEYqxf0kRCa +DfxtR8+dzIGMlgoWrjpn58Achn12EMx5Cxrfwl9O9V8TlKGSfeA2q5DOd4WqSbnhieFeR DtYQ31g58NtU8bq966BWsMU6IbGJ1gzX2gXt8YEWndtICpkJbAO6LcMQ2OKRV9x2KR2QgJ ZUd/FgxPzXRZEZ+Gk5y6aMDXjnbb0Te6ofv4HFwiWL2VIWfiXh6OAEmV/mHURCFKBg3k3/ TMIdwWOtOfqkjGTFlpu6ZGrn93ajf3VylcmlkO9UtoIHVpW1Y/lhw9lwnwGyPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732168434; a=rsa-sha256; cv=none; b=k+nOpU9vjcyp9+GYWLDNbykw6YDrGrOXuOiUoKsgfOVz2/k3UD41NE0GJS7mMTnElYBTOn 50gm3/Vc0Kso3Mch5scWvwc2Vp2PAQVzYpOMhP1Yzw2xD2hbFZVWwRwKbuJmHqGpMgktwb joGwY44ZzEceABPeF+EdVVnnkMskYj4ik3FVXC5/STRFGqE8vajU95h/T3SunzX+OZ1wJ3 0oRYdIrY62+ynCGBZCj0WCVYyXpgDjy7QHTrh42M2iz+R+zRfe2E8GYwROuPM5ri0u8iyH +EjNxtAgqLYzxN6XwF0yJ6zd/2lPIV4yOstNdz19NlcWJZqJ4e6CGEHDkYoFiw== 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 4Xv6qQ27dvzRf2; Thu, 21 Nov 2024 05:53:54 +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 4AL5rsxf038830; Thu, 21 Nov 2024 05:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AL5rsM6038827; Thu, 21 Nov 2024 05:53:54 GMT (envelope-from git) Date: Thu, 21 Nov 2024 05:53:54 GMT Message-Id: <202411210553.4AL5rsM6038827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f6a3934d63fd - stable/13 - ixgbe: Add support for 1Gbit DAC links 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f6a3934d63fd1439f363d5a733a0fa71525c6e7d Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f6a3934d63fd1439f363d5a733a0fa71525c6e7d commit f6a3934d63fd1439f363d5a733a0fa71525c6e7d Author: Kevin Bowling AuthorDate: 2024-11-14 06:33:28 +0000 Commit: Kevin Bowling CommitDate: 2024-11-21 05:53:37 +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 Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D47352 (cherry picked from commit 48ddd1b9f88753c6875566fbb67bc622453e4993) --- 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 23e378ba70c6..8ddb0315f254 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1316,9 +1316,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); @@ -2310,6 +2312,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 */