From owner-dev-commits-src-all@freebsd.org Sun Jan 10 14:33:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 100414CE7C7; Sun, 10 Jan 2021 14:33:03 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDK7f6vlDz4jsZ; Sun, 10 Jan 2021 14:33:02 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: vmaffione) by smtp.freebsd.org (Postfix) with ESMTPSA id D8E662778A; Sun, 10 Jan 2021 14:33:02 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: by mail-pj1-f50.google.com with SMTP id l23so8878871pjg.1; Sun, 10 Jan 2021 06:33:02 -0800 (PST) X-Gm-Message-State: AOAM531SfvMDm9hOnxOd6STailoiXNTShGJqVQVTWbyA5N+Dt2HQJL0k y4tQBdJGtfjcpFd6R3Ib8OUzmmWpRjssfAzVzTE= X-Google-Smtp-Source: ABdhPJxX8mgLyR8p1xt6hvIvM/iwVI126OymhdXBIJHdvHoR1C+16ZrSVzBT/+O/WAshE0VUgIIX8I/ir+hHAsAXMnE= X-Received: by 2002:a17:90a:5303:: with SMTP id x3mr13539225pjh.54.1610289181818; Sun, 10 Jan 2021 06:33:01 -0800 (PST) MIME-Version: 1.0 References: <202101101359.10ADxhCg027384@gitrepo.freebsd.org> <3bd51ab4-2ead-513e-2a8-bcaa562b22a9@fledge.watson.org> In-Reply-To: <3bd51ab4-2ead-513e-2a8-bcaa562b22a9@fledge.watson.org> From: Vincenzo Maffione Date: Sun, 10 Jan 2021 15:32:50 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Build breakage (was: Re: git: 4ba9ad0dc316 - main - iflib: add assert to prevent out-of-bounds array access) To: Robert Watson Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2021 14:33:03 -0000 Sorry, my bad. I'll fix it right away. Thanks, Vincenzo Il giorno dom 10 gen 2021 alle ore 15:26 Robert Watson ha scritto: > > With recent iflib/netmap commits, I'm getting the following on my > cross-built > GENERIC-MMCCAM-NODEBUG kernel, which is essentially the FreeBSD/arm64 > GENERIC-MMCCAM as in the tree, but with GENERIC-NODEBUG as the base. This > configuration built fine until this morning, but I've not had a chance to > bisect to figure out which was the commit that triggered the breakage: > > >>> stage 3.1: building everything > /usr/home/robert/cheri/freebsd/sys/net/iflib.c:2384:2: error: implicit > declaration of function 'netmap_disable_all_rings' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > netmap_disable_all_rings(ifp); > ^ > /usr/home/robert/cheri/freebsd/sys/net/iflib.c:2444:2: error: implicit > declaration of function 'netmap_enable_all_rings' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > netmap_enable_all_rings(ifp); > ^ > /usr/home/robert/cheri/freebsd/sys/net/iflib.c:2444:2: note: did you mean > 'netmap_disable_all_rings'? > /usr/home/robert/cheri/freebsd/sys/net/iflib.c:2384:2: note: > 'netmap_disable_all_rings' declared here > netmap_disable_all_rings(ifp); > ^ > /usr/home/robert/cheri/freebsd/sys/net/iflib.c:2495:2: error: implicit > declaration of function 'netmap_disable_all_rings' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > netmap_disable_all_rings(ctx->ifc_ifp); > ^ > 3 errors generated. > --- iflib.o --- > *** [iflib.o] Error code 1 > make[2]: stopped in > > /usr/home/robert/cheri/build/freebsd-aarch64-build/usr/home/robert/cheri/freebsd/arm64.aarch64/sys/GENERIC-MMCCAM-NODEBUG > --- all_subdir_bge --- > --- modules-all --- > *** [modules-all] Error code 2 > make[2]: stopped in > > /usr/home/robert/cheri/build/freebsd-aarch64-build/usr/home/robert/cheri/freebsd/arm64.aarch64/sys/GENERIC-MMCCAM-NODEBUG > 2 errors > make[2]: stopped in > > /usr/home/robert/cheri/build/freebsd-aarch64-build/usr/home/robert/cheri/freebsd/arm64.aarch64/sys/GENERIC-MMCCAM-NODEBUG > --- buildkernel --- > --- buildkernel --- > Fatal error: Command `nice make -DDB_FROM_SRC -DNO_CLEAN > -DI_REALLY_MEAN_NO_CLEAN -DNO_ROOT -DBUILD_WITH_STRICT_TMPPATH > TARGET_ARCH=aarch64 TARGET=arm64 DEBUG_FLAGS=-g > 'LOCAL_XTOOL_DIRS=lib/libnetbsd usr.sbin/makefs usr.bin/mkimg' > LD=/usr/bin/ld.lld XLD=/usr/bin/ld.lld 'HACK_EXTRA_FLAGS=-shared > -fuse-ld=/usr/bin/ld.lld' TRAMP_LDFLAGS=-fuse-ld=/usr/bin/ld.lld > KERNCONF=GENERIC-MMCCAM-NODEBUG -DWITHOUT_CLEAN -DWITH_TESTS > -DWITHOUT_PROFILE > -DWITHOUT_DEBUG_FILES -DWITHOUT_OFED -DWITHOUT_MAN -DWITH_GOOGLETEST > -DWITHOUT_GCC -DWITHOUT_CLANG -DWITHOUT_LLD -DWITHOUT_LLDB > -DWITHOUT_GCC_BOOTSTRAP -DWITHOUT_CLANG_BOOTSTRAP -DWITHOUT_LLD_BOOTSTRAP > -DWITHOUT_LIB32 -DWITH_ELFTOOLCHAIN_BOOTSTRAP -DWITH_TOOLCHAIN > -DWITHOUT_BINUTILS_BOOTSTRAP -s -de buildkernel -j6` failed with non-zero > exit > code 2 > > > > > On Sun, 10 Jan 2021, Vincenzo Maffione wrote: > > > The branch main has been updated by vmaffione: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=4ba9ad0dc316940f32065b05f24259f942c0692d > > > > commit 4ba9ad0dc316940f32065b05f24259f942c0692d > > Author: Vincenzo Maffione > > AuthorDate: 2021-01-10 13:49:51 +0000 > > Commit: Vincenzo Maffione > > CommitDate: 2021-01-10 13:59:20 +0000 > > > > iflib: add assert to prevent out-of-bounds array access > > > > The iflib_queues_alloc() allocates isc_nrxqs iflib_dma_info structs > > for each rxqset, and links each struct to a different free list. > > As a result, it must be isc_nrxqs >= isc_nfl (plus the completion > > queue, if present). > > Add an assertion to make this constraint explicit. > > > > MFC after: 2 weeks > > --- > > sys/net/iflib.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/sys/net/iflib.c b/sys/net/iflib.c > > index 3de80ecaeb0c..e53c5031d3a7 100644 > > --- a/sys/net/iflib.c > > +++ b/sys/net/iflib.c > > @@ -5547,11 +5547,14 @@ iflib_queues_alloc(if_ctx_t ctx) > > uint8_t nrxqs = sctx->isc_nrxqs; > > uint8_t ntxqs = sctx->isc_ntxqs; > > int nfree_lists = sctx->isc_nfl ? sctx->isc_nfl : 1; > > + int fl_offset = (sctx->isc_flags & IFLIB_HAS_RXCQ ? 1 : 0); > > caddr_t *vaddrs; > > uint64_t *paddrs; > > > > KASSERT(ntxqs > 0, ("number of queues per qset must be at least > 1")); > > KASSERT(nrxqs > 0, ("number of queues per qset must be at least > 1")); > > + KASSERT(nrxqs >= fl_offset + nfree_lists, > > + ("there must be at least a rxq for each free list")); > > > > /* Allocate the TX ring struct memory */ > > if (!(ctx->ifc_txqs = > > @@ -5659,11 +5662,7 @@ iflib_queues_alloc(if_ctx_t ctx) > > } > > rxq->ifr_ctx = ctx; > > rxq->ifr_id = i; > > - if (sctx->isc_flags & IFLIB_HAS_RXCQ) { > > - rxq->ifr_fl_offset = 1; > > - } else { > > - rxq->ifr_fl_offset = 0; > > - } > > + rxq->ifr_fl_offset = fl_offset; > > rxq->ifr_nfl = nfree_lists; > > if (!(fl = > > (iflib_fl_t) malloc(sizeof(struct iflib_fl) * > nfree_lists, M_IFLIB, M_NOWAIT | M_ZERO))) { > > >