From nobody Fri Oct 09 10:12:39 2026 X-Original-To: dev-commits-src-main@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 4j1N2v4zF2z6vRTc for ; Fri, 09 Oct 2026 10:12:39 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j1N2v1zyvz4Y61 for ; Fri, 09 Oct 2026 10:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791540759; 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=6RoH1TmtGmUjtzLIrcmk2AcZYluEPzXAn3dP9xppTXA=; b=Q2jH6WDqxyo/iQug0szUmbomZ8sqOFiQBO2zbBHpZpNoOZ6kh3nzHqM5Uodj29v8FDFEYD 4wKwX6mPx98W3gIjKuQAY6kZeMoYIHeyZGrr7jVGOeUxNp6UyqAr6JmYK5cu1gKph8C1XN 449mRCJVvd0+VTzrPSIszy/W5+qUp9N9N8MRLPfgR6F8l7W5+1OofEQb1IFiKTqQUC6jgY S7rmbluNTuwgvoNLyldy+2OLhxjmpWHb/jZP0yQ0pbyGmc6X55BZq45JehnSRgXLoIqJ07 h1cKalXXpf5VbiDLyUW/xt4YoSnoH4/hVUc3wjKxXaMhTdpeKNYKMyKcc+jbDw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791540759; b=sFimqkY9pp1zQbuHghMUqXECAt0A3UYCKems+Ig+SzHLPFZOXCQJeg1z/oy1tJM0OqOOiH 413aUIAUuO6m2VXxqmKqq4nKJgtDCE6C8Uva+PcA9xmhJgosUqS4GvSr1+Zj2Jl1BcDnpH 95YmfCApksaxuPv0pWPVSsb4/iaw/5MSmkBpKH7o9+KiZKfTkYH3LL3gXUJVFc+eTbhqL5 yQWRrPZEen0vQF8d6FDIy4A296VGcGMi1iSP8nCeWeDAoSFZWdzzd1QR7+aOuNko1SCIwv KYuiru1cnjn2SxsjmeiGTutVbGgjj6v//ORfKR7j3XwvO61NaDEjGimvGJtr1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791540759; 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=6RoH1TmtGmUjtzLIrcmk2AcZYluEPzXAn3dP9xppTXA=; b=WPFx5lPLPZFH3D0+IjjG+m7SwbT5fBVrQko4+Ycou+oIcsV1n/iDD7A1F0GIcNX3gbUEMU C1L3Fr+bhnbo7A9QAP6ZsJdsJVfyGgXT8fOTAoa8Li82L5cHbI44b3Pzhmi3CD2yM/c5KP 3+MHOfuOAq4JMM0w7++WX7ACMMIVITNRnCbcSzBcfaFPxvp9izXvxoRsJ4yl/uIB43/rx2 h87G7zOoV6mtiTKjAeA+6Y0rBUvTb+EcIUqUdn5RK8UB+x1smrMmmUqqqADYUZ6nV6b53W oPZcSkBE3yWnFjGD2CLtWHHGPFaZbna1M2srFNXJnuPu64Z6WiwA0O+9thlUig== 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 4j1N2v11wfz1L3w for ; Fri, 09 Oct 2026 10:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43a81 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Oct 2026 10:12:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sumit Saxena From: Sumit Saxena Subject: git: 42988358a921 - main - if_bnxt: add bnxt_compat.h version-compat shim List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: 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: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42988358a9210ccf7ff500895785b49fe5615567 Auto-Submitted: auto-generated Date: Fri, 09 Oct 2026 10:12:39 +0000 Message-Id: <6ac8be17.43a81.1b29599f@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=42988358a9210ccf7ff500895785b49fe5615567 commit 42988358a9210ccf7ff500895785b49fe5615567 Author: Sumit Saxena AuthorDate: 2026-07-29 12:13:39 +0000 Commit: Sumit Saxena CommitDate: 2026-10-09 08:24:43 +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. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Broadcom Inc. Differential Revision: https://reviews.freebsd.org/D58604 --- sys/dev/bnxt/bnxt_en/bnxt.h | 1 + sys/dev/bnxt/bnxt_en/bnxt_compat.h | 87 ++++++++++++++++++++++++++++++++++++++ sys/modules/bnxt/bnxt_en/Makefile | 1 + 3 files changed, 89 insertions(+) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index 1de100915f97..04f0f0bf20ec 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..0a1c47b6cd92 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_compat.h @@ -0,0 +1,87 @@ +/* + * 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) +#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