From nobody Thu Oct 29 23:37:27 2026 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 4jG0yH66Mkz6xr7P for ; Thu, 29 Oct 2026 23:37:27 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jG0yH39fRz4ssh for ; Thu, 29 Oct 2026 23:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793317047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vEthStbT2PvQyUXBlUbcE0I6iSYsUq8jgFGWp/nhgE0=; b=eA71twiXvTV5BMKBbzhg3Fyox9nCBmPke/vfU0R15Vht4bGiczuT+5IgR004KtcYogrClC vopylx6MkN0zb4YXMngbvryRHGFIiz+hYu6IEhn3nmjyn28ZzTa8eCx+ZhnldYDHrWEbnE jvwMm+QiTSZPxAVzr9i57hSLphrvamJqPeU5uHykR4QtscEZYDVwL4697iG1GEmYhZ9eki TWSodK+OxCitoRZRGDJVpFAgt4Cu+rIG3tprJ84Ho4nuePWfvXjEeqk1pnbCzdI0zH4YcE fYRfJ6+ohEvaRcvmaoFRopmFFY7V8zBwQ0esu5pLwW91chVXcsqxQcL281Xxrg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793317047; b=W6APBhU+zN1929ZWzmogAaBMAEBBEIaOd8QBKGHFOyIEIXFCOEeVfXurOmv+16uf6rR+Dc v7hMFDG3MMP5pz99gpV56xXHDcjgeAxHxEkRujnfm4f30HUlkz1MQJ04cRXpLXJkyDxzqT 7jPn0U5jrRpNq64Titdt6OcGRtiT/JgNJq1IwVsLLNtUCRxSMaAPhq84uzMIFJtZEcjl88 mcvbzzhQHVUt2AaoMlwK6nDXY+paa4TOgRs/VakN50bGtYg6r1qDKh7vNqghHXMRRKLiAn lm162YOYcxZAJQXe198H4qFwnarattPZU1LMYTJ9r6/W8zPUEOgnx/Jcco1Y1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793317047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vEthStbT2PvQyUXBlUbcE0I6iSYsUq8jgFGWp/nhgE0=; b=leEC1mGLEGWsQhHALscyw1xKIXM+jrMuGpSFWNAonsGkoCkTwxkhb7uz4n43cmuIs2Pfi5 ma9H9Cq5ZjO+GavmForl/NfIyUI7cQ3sXSp7J5tcpBHHLQinpchrG0VYY5iy560/InMrrP SYu+ZtGW8rSAnWcV6ZIhlegO65AdpYZwW/kAjunA48AWXdwXsqziFJbMxBo6ni6spl25G9 u2g1FC/l2FW+Krao4OL2+aPANusCQfNju5DgPtg3X/2qqWcNfQWaMFYDY1Ist/bogL5UjG E7bKiGgWhtbyn9jthMDAJKu/050LynyKhR2nkLUGX9fWX+UFzVbYYJIgx0GjWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jG0yH2jZfz12Hf for ; Thu, 29 Oct 2026 23:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bd73 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 23:37:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Sumit Saxena From: Kevin Bowling Subject: git: 2bddcff5a870 - stable/15 - if_bnxt: add bnxt_compat.h version-compat shim List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/15 X-Git-Reftype: branch X-Git-Commit: 2bddcff5a87090d37ae183a13eb7cf07be185771 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 23:37:27 +0000 Message-Id: <6ae3d8b7.3bd73.74881d05@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2bddcff5a87090d37ae183a13eb7cf07be185771 commit 2bddcff5a87090d37ae183a13eb7cf07be185771 Author: Sumit Saxena AuthorDate: 2026-07-29 12:13:39 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 23:25:50 +0000 if_bnxt: add bnxt_compat.h version-compat shim Add bnxt_compat.h, a small __FreeBSD_version-gated compatibility shim: if_getmtu()/if_name()/if_getsoftc()/if_getflags() fallbacks for pre-1500000, and a config-task vs. config-gtask abstraction over the iflib API split at 1403000. On this branch's FreeBSD version it also unconditionally enables KTLS_IFLIB_SUPPORT/KTLS_REC_SEQ_NUMBER, which the upcoming kTLS patch depends on. For stable/15, enable the existing iflib kTLS and TLS record-sequence interfaces starting at __FreeBSD_version 1501506. Reviewed by: gallatin Sponsored by: Broadcom Inc. Differential Revision: https://reviews.freebsd.org/D58604 (cherry picked from commit 42988358a9210ccf7ff500895785b49fe5615567) --- sys/dev/bnxt/bnxt_en/bnxt.h | 1 + sys/dev/bnxt/bnxt_en/bnxt_compat.h | 88 ++++++++++++++++++++++++++++++++++++++ sys/modules/bnxt/bnxt_en/Makefile | 1 + 3 files changed, 90 insertions(+) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index 923c069afb81..3d0d63eb2244 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -45,6 +45,7 @@ #include #include +#include "bnxt_compat.h" #include "hsi_struct_def.h" #include "bnxt_dcb.h" #include "bnxt_auxbus_compat.h" diff --git a/sys/dev/bnxt/bnxt_en/bnxt_compat.h b/sys/dev/bnxt/bnxt_en/bnxt_compat.h new file mode 100644 index 000000000000..97742b16153c --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_compat.h @@ -0,0 +1,88 @@ +/* + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2026 Broadcom, All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifndef BNXT_COMPAT_H +#define BNXT_COMPAT_H + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + + +#if (__FreeBSD_version < 1500000) + +#define if_getmtu(ifp) (ifp)->if_mtu +#ifndef if_name +#define if_name(ifp) (ifp)->if_xname +#endif +#define if_getsoftc(ifp) (ifp)->if_softc +#define if_getflags(ifp) (ifp)->if_flags + +#endif + + +#if (__FreeBSD_version >= 1403000) + +#define BNXT_CP_TASK_TYPE struct task +#define BNXT_CP_TASK_FUNC(name) void name(void *context, int pending) +#define BNXT_CP_TASK_INIT(ctx, task, func) \ + iflib_config_task_init(ctx, task, func) +#define BNXT_CP_TASK_ENQUEUE(ctx, task) \ + iflib_config_task_enqueue(ctx, task) + +#else + +#define BNXT_CP_TASK_TYPE struct grouptask +#define BNXT_CP_TASK_FUNC(name) void name(void *context) +#define BNXT_CP_TASK_INIT(ctx, task, func) \ + iflib_config_gtask_init(ctx, task, func, "dflt_cp") +#define BNXT_CP_TASK_ENQUEUE(ctx, task) \ + GROUPTASK_ENQUEUE(task) + +#endif + +#if (__FreeBSD_version >= 1600007) || \ + (__FreeBSD_version >= 1501506 && __FreeBSD_version < 1600000) +#define KTLS_IFLIB_SUPPORT +#define KTLS_REC_SEQ_NUMBER +#endif + +#endif /* BNXT_COMPAT_H */ diff --git a/sys/modules/bnxt/bnxt_en/Makefile b/sys/modules/bnxt/bnxt_en/Makefile index e0d371c264de..57958d0c5922 100644 --- a/sys/modules/bnxt/bnxt_en/Makefile +++ b/sys/modules/bnxt/bnxt_en/Makefile @@ -16,6 +16,7 @@ SRCS += bnxt_log_data.c bnxt_log_data.h SRCS += bnxt_coredump.c bnxt_coredump.h SRCS += bnxt_ptp.c bnxt_ptp.h SRCS += bnxt_mpc.c bnxt_mpc.h +SRCS += bnxt_compat.h SRCS += ${LINUXKPI_GENSRCS} CFLAGS+= -DIFLIB