Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Nov 2022 21:45:18 -0500
From:      Kyle Evans <kevans@freebsd.org>
To:        Warner Losh <imp@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: 75217c2b4700 - main - bnxt: Only build on 64-bit platforms
Message-ID:  <CACNAnaHBEBgFKHbvLFEA_rvt7qO8tdXY35i02vbcAFy6gFBLgQ@mail.gmail.com>
In-Reply-To: <202211042255.2A4Mtxr8032843@gitrepo.freebsd.org>
References:  <202211042255.2A4Mtxr8032843@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 4, 2022 at 5:56 PM Warner Losh <imp@freebsd.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=75217c2b4700a1954971b1ec3722c39dd934e287
>
> commit 75217c2b4700a1954971b1ec3722c39dd934e287
> Author:     Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2022-11-04 22:49:10 +0000
> Commit:     Warner Losh <imp@FreeBSD.org>
> CommitDate: 2022-11-04 22:49:10 +0000
>
>     bnxt: Only build on 64-bit platforms
>
>     The driver uses bus_space_read_8 and friends, which do not exist on
>     32-bit i386 and break the build.
>
>     Sponsored by:           Netflix
> ---
>  sys/modules/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/sys/modules/Makefile b/sys/modules/Makefile
> index 3a009f071cab..091fa7543164 100644
> --- a/sys/modules/Makefile
> +++ b/sys/modules/Makefile
[ ... skip ...]
> @@ -424,6 +424,12 @@ SUBDIR+=   dtrace
>  SUBDIR+=       opensolaris
>  .endif
>
> +# Requires bus_space_read_8
> +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "aarch64" || \
> +       ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc64le"
> +_bnxt=         bnxt
> +.endif
> +
>  .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
>  .if exists(${SRCTOP}/sys/opencrypto)
>  _crypto=       crypto

It looks like i386 really is the outlier here, any reason not to do
this instead? (minor build fix for 32-bit platforms included, I
test-built armv6, armv7, powerpc)

diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c
index c362e01a1f8b..28e4ef7201ff 100644
--- a/sys/dev/bnxt/bnxt_hwrm.c
+++ b/sys/dev/bnxt/bnxt_hwrm.c
@@ -1483,7 +1483,7 @@ bnxt_hwrm_l2_filter_alloc(struct bnxt_softc
*softc, uint16_t vlan_tag,

        if (*filter_id != -1) {
                device_printf(softc->dev, "Attempt to re-allocate l2 ctx "
-                               "filter (fid: 0x%lx)\n", *filter_id);
+                               "filter (fid: 0x%jx)\n", (uintmax_t)*filter_id);
                return EDOOFUS;
        }

diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 091fa7543164..bd55beb316fc 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -425,8 +425,7 @@ SUBDIR+=    opensolaris
 .endif

 # Requires bus_space_read_8
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "aarch64" || \
-       ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc64le"
+.if ${MACHINE_ARCH} == "i386"
 _bnxt=         bnxt
 .endif

Thanks,

Kyle Evans



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