From owner-dev-commits-src-main@freebsd.org Mon Feb 1 05:02:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 419CF4F872F; Mon, 1 Feb 2021 05:02:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTbR60r64z3jBv; Mon, 1 Feb 2021 05:02:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x432.google.com with SMTP id 7so15157008wrz.0; Sun, 31 Jan 2021 21:02:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GDPRJ6jy/PSlUOykqXLo0BG9UpoAFHbEQDe8G+sN4ak=; b=XbBfiqe0GxEck3HY6NusRoKORQ+EpfuzgDwtgAqzAkctkfYXM31THXiT668Cy/F8rv mgKZr+tyefQIZ2uYUMIMiSQt4deJoqfACnFXN9DXdNO+0QhK2IFJjcwt1Eofm840t+eN 9hfY5stUPDayXSzHtt7tTa02DrS8ngMbjEiLMWgITWuGPwe543CDdwdEJqFpS1eQ0RvG FRxDuyfgJp9/r2ePVVzLjAqtqgP9bdySVC5lDVOBM7t3yMsjtxafm7uCaHcf47ynzSJ7 uDcuaXGJwfhK8Oz0gThGa+VsRBkPqIoeE9v9XmyCUVhXBol+2FbflX8rknYjBA+Fi78I TV5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GDPRJ6jy/PSlUOykqXLo0BG9UpoAFHbEQDe8G+sN4ak=; b=TE6W/11xqMamdN1lvazUQLlD5LGQWy6yAKSPQz5m1wlMR079nDdqsdAhl1FOYS3rrc TDnqWCzeL4Obi6HP/QNbkA5Ry2TU5Dy2w+zhZhACJmUFIqOBhGc7cnjczimIW40gN4E+ 9lxKuyT+y9kNdsguA/4lmUjsTdLhtvrqcdn4KzxoYCldPllxl3FATS++yCNrgcz39/oR rv7rkXnKs8YhyUArvFNBhtTI3FhLU1Q28d/bc0ilR9U/MdCnsZZcvTAFl2iQkDwgcqQI FXIeeLQNmCZ5dgifrYA5p+f0r2gpqvAqsirNNiy6mViEF+oq4tbtcgFer9ovaUUTmEFN ZI0g== X-Gm-Message-State: AOAM5328lIvifPCqXH09kuGktBlO6ymlGWSIUMg8RlMzGZPxNNggIi+B PIYOQh4yeMJR75UPy0YjBjkEaVxnX/J7kkVewSPcS/ktT+E= X-Google-Smtp-Source: ABdhPJx3d4UGo5EeVl3/N+NuiLPVTKy1XAtxHs8KcIBB1ctFsomamfyA7tLUwbHJEAkR/HJZ8f/gk/A1o4vTQuJ0AMc= X-Received: by 2002:adf:e511:: with SMTP id j17mr16100257wrm.17.1612155743695; Sun, 31 Jan 2021 21:02:23 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Sun, 31 Jan 2021 21:02:22 -0800 (PST) In-Reply-To: <202101312144.10VLiwhn025787@gitrepo.freebsd.org> References: <202101312144.10VLiwhn025787@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 1 Feb 2021 06:02:22 +0100 Message-ID: Subject: Re: git: e0a0a3efcb09 - main - mips: fix early kernel panic when setting up interrupt counters To: Oleksandr Tymoshenko Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DTbR60r64z3jBv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 05:02:26 -0000 This breaks building mips XLP64: linking kernel.full ld: error: undefined symbol: intrcnt >>> referenced by kern_clock.c:813 (/usr/src/sys/kern/kern_clock.c:813) >>> kern_clock.o:(hardclock) >>> referenced by kern_clock.c:813 (/usr/src/sys/kern/kern_clock.c:813) >>> kern_clock.o:(hardclock) >>> referenced by kern_clock.c:813 (/usr/src/sys/kern/kern_clock.c:813) >>> kern_clock.o:(hardclock) >>> referenced 21 more times and so on On 1/31/21, Oleksandr Tymoshenko wrote: > The branch main has been updated by gonzo: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=e0a0a3efcb09a10ad1de29aca622ea580b2663d2 > > commit e0a0a3efcb09a10ad1de29aca622ea580b2663d2 > Author: Oleksandr Tymoshenko > AuthorDate: 2021-01-30 06:11:24 +0000 > Commit: Oleksandr Tymoshenko > CommitDate: 2021-01-31 21:44:45 +0000 > > mips: fix early kernel panic when setting up interrupt counters > > Commit 248f0ca converted intrcnt and intrnames from u_long[] > and char[] to u_long* and char* respectively, but for non-INTRNG mips > these symbols were defined in .S file as a pre-allocated static arrays, > so the problem wasn't cought at compile time. Conversion from an array > to a pointer requires pointer initialization and it wasn't done > for MIPS, so whatever happenned to be in the begginning of intcnt[] > array was used as a pointer value. > > Move intrcnt/intrnames to C code and allocate them dynamically > although with a fixed size at the moment. > > Reviewed by: emaste > PR: 253051 > Differential Revision: https://reviews.freebsd.org/D28424 > MFC after: 1 day > --- > sys/mips/mips/exception.S | 36 ------------------------------------ > sys/mips/mips/intr_machdep.c | 22 ++++++++++++++++++++++ > 2 files changed, 22 insertions(+), 36 deletions(-) > > diff --git a/sys/mips/mips/exception.S b/sys/mips/mips/exception.S > index 892bebc8f37f..719904ac83b7 100644 > --- a/sys/mips/mips/exception.S > +++ b/sys/mips/mips/exception.S > @@ -80,12 +80,6 @@ dtrace_invop_calltrap_addr: > .text > #endif > > -/* > - * Reasonable limit > - */ > -#define INTRCNT_COUNT 256 > - > - > /* > > *---------------------------------------------------------------------------- > * > @@ -1206,36 +1200,6 @@ FPReturn: > .set pop > END(MipsFPTrap) > > -#ifndef INTRNG > -/* > - * Interrupt counters for vmstat. > - */ > - .data > - .globl intrcnt > - .globl sintrcnt > - .globl intrnames > - .globl sintrnames > -intrnames: > - .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > -sintrnames: > -#ifdef __mips_n64 > - .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > -#else > - .int INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > -#endif > - > - .align (_MIPS_SZLONG / 8) > -intrcnt: > - .space INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 > -sintrcnt: > -#ifdef __mips_n64 > - .quad INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 > -#else > - .int INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 > -#endif > -#endif /* INTRNG */ > - > - > /* > * Vector to real handler in KSEG1. > */ > diff --git a/sys/mips/mips/intr_machdep.c b/sys/mips/mips/intr_machdep.c > index 3b278276865c..a36944f657ca 100644 > --- a/sys/mips/mips/intr_machdep.c > +++ b/sys/mips/mips/intr_machdep.c > @@ -50,6 +50,19 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifndef INTRNG > +#define INTRCNT_COUNT 256 > +#define INTRNAME_LEN (2*MAXCOMLEN + 1) > + > +MALLOC_DECLARE(M_MIPSINTR); > +MALLOC_DEFINE(M_MIPSINTR, "mipsintr", "MIPS interrupt handling"); > + > +u_long *intrcnt; > +char *intrnames; > +size_t sintrcnt; > +size_t sintrnames; > +#endif > + > static struct intr_event *hardintr_events[NHARD_IRQS]; > static struct intr_event *softintr_events[NSOFT_IRQS]; > static mips_intrcnt_t mips_intr_counters[NSOFT_IRQS + NHARD_IRQS]; > @@ -121,6 +134,15 @@ cpu_init_interrupts() > int i; > char name[MAXCOMLEN + 1]; > > +#ifndef INTRNG > + intrcnt = mallocarray(INTRCNT_COUNT, sizeof(u_long), M_MIPSINTR, > + M_WAITOK | M_ZERO); > + intrnames = mallocarray(INTRCNT_COUNT, INTRNAME_LEN, M_MIPSINTR, > + M_WAITOK | M_ZERO); > + sintrcnt = INTRCNT_COUNT * sizeof(u_long); > + sintrnames = INTRCNT_COUNT * INTRNAME_LEN; > +#endif > + > /* > * Initialize all available vectors so spare IRQ > * would show up in systat output > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to > "dev-commits-src-all-unsubscribe@freebsd.org" > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Mon Feb 1 05:02:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 51AA14F87FA; Mon, 1 Feb 2021 05:02:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTbRR0VhJz3jDb; Mon, 1 Feb 2021 05:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 EE20315983; Mon, 1 Feb 2021 05:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11152gv5098971; Mon, 1 Feb 2021 05:02:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152gTJ098970; Mon, 1 Feb 2021 05:02:42 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:42 GMT Message-Id: <202102010502.11152gTJ098970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: bbfb1edd70e1 - main - cache: move hash computation into the parsing loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbfb1edd70e15241d852d82eb7e1c1049a01b886 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 05:02:43 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bbfb1edd70e15241d852d82eb7e1c1049a01b886 commit bbfb1edd70e15241d852d82eb7e1c1049a01b886 Author: Mateusz Guzik AuthorDate: 2021-01-31 18:25:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:36:45 +0000 cache: move hash computation into the parsing loop --- sys/kern/vfs_cache.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 1780e8235dd3..028e3af38ef9 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -722,6 +722,27 @@ cache_get_hash(char *name, u_char len, struct vnode *dvp) return (fnv_32_buf(name, len, dvp->v_nchash)); } +static uint32_t +cache_get_hash_iter_start(struct vnode *dvp) +{ + + return (dvp->v_nchash); +} + +static uint32_t +cache_get_hash_iter(char c, uint32_t hash) +{ + + return (fnv_32_buf(&c, 1, hash)); +} + +static uint32_t +cache_get_hash_iter_finish(uint32_t hash) +{ + + return (hash); +} + static inline struct nchashhead * NCP2BUCKET(struct namecache *ncp) { @@ -3693,11 +3714,11 @@ struct cache_fpl { struct nameidata *ndp; struct componentname *cnp; char *nulchar; - struct pwd **pwd; struct vnode *dvp; struct vnode *tvp; seqc_t dvp_seqc; seqc_t tvp_seqc; + uint32_t hash; struct nameidata_saved snd; struct nameidata_outer snd_outer; int line; @@ -3705,6 +3726,7 @@ struct cache_fpl { bool in_smr; bool fsearch; bool savename; + struct pwd **pwd; #ifdef INVARIANTS struct cache_fpl_debug debug; #endif @@ -4951,6 +4973,7 @@ cache_fplookup_next(struct cache_fpl *fpl) cnp = fpl->cnp; dvp = fpl->dvp; + hash = fpl->hash; if (__predict_false(cnp->cn_nameptr[0] == '.')) { if (cnp->cn_namelen == 1) { @@ -4963,8 +4986,6 @@ cache_fplookup_next(struct cache_fpl *fpl) MPASS(!cache_fpl_isdotdot(cnp)); - hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); - CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) @@ -5246,10 +5267,13 @@ cache_fplookup_parse(struct cache_fpl *fpl) { struct nameidata *ndp; struct componentname *cnp; + struct vnode *dvp; char *cp; + uint32_t hash; ndp = fpl->ndp; cnp = fpl->cnp; + dvp = fpl->dvp; /* * Find the end of this path component, it is either / or nul. @@ -5257,6 +5281,8 @@ cache_fplookup_parse(struct cache_fpl *fpl) * Store / as a temporary sentinel so that we only have one character * to test for. Pathnames tend to be short so this should not be * resulting in cache misses. + * + * TODO: fix this to be word-sized. */ KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 1] == fpl->nulchar, ("%s: mismatch between pathlen (%zu) and nulchar (%p != %p), string [%s]\n", @@ -5265,17 +5291,30 @@ cache_fplookup_parse(struct cache_fpl *fpl) KASSERT(*fpl->nulchar == '\0', ("%s: expected nul at %p; string [%s]\n", __func__, fpl->nulchar, cnp->cn_pnbuf)); + hash = cache_get_hash_iter_start(dvp); *fpl->nulchar = '/'; for (cp = cnp->cn_nameptr; *cp != '/'; cp++) { KASSERT(*cp != '\0', ("%s: encountered unexpected nul; string [%s]\n", __func__, cnp->cn_nameptr)); + hash = cache_get_hash_iter(*cp, hash); continue; } *fpl->nulchar = '\0'; + fpl->hash = cache_get_hash_iter_finish(hash); cnp->cn_namelen = cp - cnp->cn_nameptr; cache_fpl_pathlen_sub(fpl, cnp->cn_namelen); + +#ifdef INVARIANTS + if (cnp->cn_namelen <= NAME_MAX) { + if (fpl->hash != cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp)) { + panic("%s: mismatched hash for [%s] len %ld", __func__, + cnp->cn_nameptr, cnp->cn_namelen); + } + } +#endif + /* * Hack: we have to check if the found path component's length exceeds * NAME_MAX. However, the condition is very rarely true and check can From owner-dev-commits-src-main@freebsd.org Mon Feb 1 05:02:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 42D6B4F88DA; Mon, 1 Feb 2021 05:02:44 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTbRS1D5xz3jTk; Mon, 1 Feb 2021 05:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 1A32D15984; Mon, 1 Feb 2021 05:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11152iH2098994; Mon, 1 Feb 2021 05:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152imw098993; Mon, 1 Feb 2021 05:02:44 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:44 GMT Message-Id: <202102010502.11152imw098993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 6f19dc2124a3 - main - cache: add delayed degenerate path handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f19dc2124a31aadf419743288d2ec1abd895563 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 05:02:44 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6f19dc2124a31aadf419743288d2ec1abd895563 commit 6f19dc2124a31aadf419743288d2ec1abd895563 Author: Mateusz Guzik AuthorDate: 2021-01-31 20:54:35 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:53:23 +0000 cache: add delayed degenerate path handling --- sys/kern/vfs_cache.c | 57 +++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 028e3af38ef9..7f0e59f1a1ee 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3737,7 +3737,6 @@ static int cache_fplookup_cross_mount(struct cache_fpl *fpl); static int cache_fplookup_partial_setup(struct cache_fpl *fpl); static int cache_fplookup_skip_slashes(struct cache_fpl *fpl); static int cache_fplookup_trailingslash(struct cache_fpl *fpl); -static int cache_fplookup_preparse(struct cache_fpl *fpl); static void cache_fpl_pathlen_dec(struct cache_fpl *fpl); static void cache_fpl_pathlen_inc(struct cache_fpl *fpl); static void cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n); @@ -4518,6 +4517,9 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) struct vnode *dvp; enum vgetstate dvs; int error, lkflags; +#ifdef INVARIANTS + char *cp; +#endif fpl->tvp = fpl->dvp; fpl->tvp_seqc = fpl->dvp_seqc; @@ -4525,6 +4527,14 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) cnp = fpl->cnp; dvp = fpl->dvp; +#ifdef INVARIANTS + for (cp = cnp->cn_pnbuf; *cp != '\0'; cp++) { + KASSERT(*cp == '/', + ("%s: encountered non-slash; string [%s]\n", __func__, + cnp->cn_pnbuf)); + } +#endif + if (__predict_false(cnp->cn_nameiop != LOOKUP)) { cache_fpl_smr_exit(fpl); return (cache_fpl_handled_error(fpl, EISDIR)); @@ -4589,6 +4599,9 @@ cache_fplookup_noentry(struct cache_fpl *fpl) } if (cnp->cn_nameptr[0] == '\0') { + if (fpl->tvp == NULL) { + return (cache_fplookup_degenerate(fpl)); + } return (cache_fplookup_trailingslash(fpl)); } @@ -4897,7 +4910,7 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) cache_fpl_pathlen_add(fpl, adjust); cnp->cn_nameptr = cnp->cn_pnbuf; fpl->nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; - + fpl->tvp = NULL; return (0); } @@ -4957,8 +4970,7 @@ cache_fplookup_symlink(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } } - - return (cache_fplookup_preparse(fpl)); + return (0); } static int @@ -5238,30 +5250,6 @@ cache_fpl_pathlen_dec(struct cache_fpl *fpl) } #endif -static int __always_inline -cache_fplookup_preparse(struct cache_fpl *fpl) -{ - struct componentname *cnp; - - cnp = fpl->cnp; - - if (__predict_false(cnp->cn_nameptr[0] == '\0')) { - return (cache_fplookup_degenerate(fpl)); - } - - /* - * By this point the shortest possible pathname is one character + nul - * terminator, hence 2. - */ - KASSERT(fpl->debug.ni_pathlen >= 2, ("%s: pathlen %zu\n", __func__, - fpl->debug.ni_pathlen)); - KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 2] == fpl->nulchar - 1, - ("%s: mismatch on string (%p != %p) [%s]\n", __func__, - &cnp->cn_nameptr[fpl->debug.ni_pathlen - 2], fpl->nulchar - 1, - cnp->cn_pnbuf)); - return (0); -} - static void cache_fplookup_parse(struct cache_fpl *fpl) { @@ -5533,6 +5521,13 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; + /* + * Hack: delayed degenerate path checking. + */ + if (cnp->cn_nameptr[0] == '\0' && fpl->tvp == NULL) { + return (cache_fplookup_degenerate(fpl)); + } + /* * Hack: delayed name len checking. */ @@ -5624,10 +5619,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - error = cache_fplookup_preparse(fpl); - if (__predict_false(cache_fpl_terminated(fpl))) { - return (error); - } + MPASS(fpl->tvp == NULL); for (;;) { cache_fplookup_parse(fpl); @@ -5787,6 +5779,7 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, fpl.nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; fpl.fsearch = false; fpl.savename = (cnp->cn_flags & SAVENAME) != 0; + fpl.tvp = NULL; /* for degenerate path handling */ fpl.pwd = pwdp; pwd = pwd_get_smr(); *(fpl.pwd) = pwd; From owner-dev-commits-src-main@freebsd.org Mon Feb 1 05:02:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 66D454F8A4D; Mon, 1 Feb 2021 05:02:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTbRT22nZz3jDp; Mon, 1 Feb 2021 05:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 361DB1577A; Mon, 1 Feb 2021 05:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11152jnN099014; Mon, 1 Feb 2021 05:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152jb4099013; Mon, 1 Feb 2021 05:02:45 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:45 GMT Message-Id: <202102010502.11152jb4099013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: aae89f6f0957 - main - amd64: use compiler intrinsics for bsf* and bsr* MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aae89f6f09576351cc3a9a54959649e60fdd849b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 05:02:45 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=aae89f6f09576351cc3a9a54959649e60fdd849b commit aae89f6f09576351cc3a9a54959649e60fdd849b Author: Mateusz Guzik AuthorDate: 2021-01-31 23:35:30 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:53:23 +0000 amd64: use compiler intrinsics for bsf* and bsr* --- sys/amd64/include/cpufunc.h | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 763ed2c64c8a..8ef298e1d7d5 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -65,41 +65,13 @@ breakpoint(void) __asm __volatile("int $3"); } -static __inline __pure2 u_int -bsfl(u_int mask) -{ - u_int result; - - __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} - -static __inline __pure2 u_long -bsfq(u_long mask) -{ - u_long result; - - __asm __volatile("bsfq %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} - -static __inline __pure2 u_int -bsrl(u_int mask) -{ - u_int result; +#define bsfl(mask) __builtin_ctz(mask) - __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} +#define bsfq(mask) __builtin_ctzl(mask) -static __inline __pure2 u_long -bsrq(u_long mask) -{ - u_long result; +#define bsrl(mask) (__builtin_clz(mask) ^ 0x1f) - __asm __volatile("bsrq %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} +#define bsrq(mask) (__builtin_clzl(mask) ^ 0x3f) static __inline void clflush(u_long addr) From owner-dev-commits-src-main@freebsd.org Mon Feb 1 05:02:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B9A3A4F8968; Mon, 1 Feb 2021 05:02:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTbRV5Tglz3jH5; Mon, 1 Feb 2021 05:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5BAAE15159; Mon, 1 Feb 2021 05:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11152krd099034; Mon, 1 Feb 2021 05:02:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152kNF099033; Mon, 1 Feb 2021 05:02:46 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:46 GMT Message-Id: <202102010502.11152kNF099033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: e6ff6154d203 - main - x86: use compiler intrinsics for bswap* MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6ff6154d2034c13f3d0da73c1e00d69fdb36516 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 05:02:48 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e6ff6154d2034c13f3d0da73c1e00d69fdb36516 commit e6ff6154d2034c13f3d0da73c1e00d69fdb36516 Author: Mateusz Guzik AuthorDate: 2021-02-01 03:00:13 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:53:23 +0000 x86: use compiler intrinsics for bswap* --- sys/x86/include/endian.h | 62 +++--------------------------------------------- 1 file changed, 3 insertions(+), 59 deletions(-) diff --git a/sys/x86/include/endian.h b/sys/x86/include/endian.h index 9c39f4fddf80..18d52fb8a6fa 100644 --- a/sys/x86/include/endian.h +++ b/sys/x86/include/endian.h @@ -65,65 +65,9 @@ #define BYTE_ORDER _BYTE_ORDER #endif -#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) -#define __bswap32_gen(x) \ - (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16)) -#define __bswap64_gen(x) \ - (((__uint64_t)__bswap32((x) & 0xffffffff) << 32) | __bswap32((x) >> 32)) - -#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) -#define __bswap32(x) \ - (__builtin_constant_p(x) ? \ - __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) -#define __bswap64(x) \ - (__builtin_constant_p(x) ? \ - __bswap64_gen((__uint64_t)(x)) : __bswap64_var(x)) -#else -/* XXX these are broken for use in static initializers. */ -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) -#define __bswap64(x) __bswap64_var(x) -#endif - -/* These are defined as functions to avoid multiple evaluation of x. */ - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return (__bswap16_gen(_x)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - -#ifdef __GNUCLIKE_ASM - __asm("bswap %0" : "+r" (_x)); - return (_x); -#else - return (__bswap32_gen(_x)); -#endif -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - -#if defined(__amd64__) && defined(__GNUCLIKE_ASM) - __asm("bswap %0" : "+r" (_x)); - return (_x); -#else - /* - * It is important for the optimizations that the following is not - * really generic, but expands to 2 __bswap32_var()'s. - */ - return (__bswap64_gen(_x)); -#endif -} +#define __bswap16(x) __builtin_bswap16(x) +#define __bswap32(x) __builtin_bswap32(x) +#define __bswap64(x) __builtin_bswap64(x) #define __htonl(x) __bswap32(x) #define __htons(x) __bswap16(x) From owner-dev-commits-src-main@freebsd.org Mon Feb 1 07:59:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 45AC34F42B6; Mon, 1 Feb 2021 07:59:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTgMC1MSRz4tJd; Mon, 1 Feb 2021 07:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 20D1F17C72; Mon, 1 Feb 2021 07:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1117xJ6A022041; Mon, 1 Feb 2021 07:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1117xJS9022040; Mon, 1 Feb 2021 07:59:19 GMT (envelope-from git) Date: Mon, 1 Feb 2021 07:59:19 GMT Message-Id: <202102010759.1117xJS9022040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oleksandr Tymoshenko Subject: git: d6f9c5a6d2f8 - main - mips: fix NLM platforms breakage caused by e0a0a3ef MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gonzo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 07:59:19 -0000 The branch main has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e commit d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e Author: Oleksandr Tymoshenko AuthorDate: 2021-02-01 07:56:22 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-02-01 07:56:22 +0000 mips: fix NLM platforms breakage caused by e0a0a3ef NetLogic platforms have their own implementation of cpu_init_interrupts. Apply the same logic to it as to intr_machdep.c. PR: 253051 --- sys/mips/nlm/intr_machdep.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/mips/nlm/intr_machdep.c b/sys/mips/nlm/intr_machdep.c index b66118c06ee8..33bfad1fe882 100644 --- a/sys/mips/nlm/intr_machdep.c +++ b/sys/mips/nlm/intr_machdep.c @@ -59,6 +59,17 @@ __FBSDID("$FreeBSD$"); #include #include +#define INTRCNT_COUNT 256 +#define INTRNAME_LEN (2*MAXCOMLEN + 1) + +MALLOC_DECLARE(M_MIPSINTR); +MALLOC_DEFINE(M_MIPSINTR, "mipsintr", "MIPS interrupt handling"); + +u_long *intrcnt; +char *intrnames; +size_t sintrcnt; +size_t sintrnames; + struct xlp_intrsrc { void (*bus_ack)(int, void *); /* Additional ack */ void *bus_ack_arg; /* arg for additional ack */ @@ -295,6 +306,13 @@ cpu_init_interrupts() int i; char name[MAXCOMLEN + 1]; + intrcnt = mallocarray(INTRCNT_COUNT, sizeof(u_long), M_MIPSINTR, + M_WAITOK | M_ZERO); + intrnames = mallocarray(INTRCNT_COUNT, INTRNAME_LEN, M_MIPSINTR, + M_WAITOK | M_ZERO); + sintrcnt = INTRCNT_COUNT * sizeof(u_long); + sintrnames = INTRCNT_COUNT * INTRNAME_LEN; + /* * Initialize all available vectors so spare IRQ * would show up in systat output From owner-dev-commits-src-main@freebsd.org Mon Feb 1 08:00:30 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CC6874F4925; Mon, 1 Feb 2021 08:00:30 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTgNZ5H4zz4tkl; Mon, 1 Feb 2021 08:00:30 +0000 (UTC) (envelope-from gonzo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bluezbox.com; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+SaUEJbbm+kslGpSjVzvjK5lPInJ8Kh2BIzYZHtUva8=; b=szGT4Zm6I3ym+t0uanQoqJCcXG hJ/0ukU6i9lJ4hqGZr8Fg8xTbaNvGYbcMl+lm3Of2TNRnLHK+64e6ZEnTCzzDIZYYIFpcRj8/xVFu ZSHrzIQL/6KsFFpfW6Uh1lYFRCSiCRQrFramdEFz3Wze4MPpUi8d+t2B+P3Rce4nnOJg=; Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1l6U8E-0007kV-RI; Mon, 01 Feb 2021 00:00:23 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id 11180M4L029790; Mon, 1 Feb 2021 00:00:22 -0800 (PST) (envelope-from gonzo@freebsd.org) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@freebsd.org using -f Date: Mon, 1 Feb 2021 00:00:22 -0800 From: Oleksandr Tymoshenko To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e0a0a3efcb09 - main - mips: fix early kernel panic when setting up interrupt counters Message-ID: <20210201080022.GA29734@bluezbox.com> References: <202101312144.10VLiwhn025787@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Mateusz Guzik (mjguzik@gmail.com) wrote: > This breaks building mips XLP64: Sorry about that and thanks for reporting. Should be fixed now. -- gonzo Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 4DTgNZ5H4zz4tkl X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 08:00:30 -0000 Mateusz Guzik (mjguzik@gmail.com) wrote: > This breaks building mips XLP64: Sorry about that and thanks for reporting. Should be fixed now. -- gonzo From owner-dev-commits-src-main@freebsd.org Mon Feb 1 09:39:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 35E8D4F8926; Mon, 1 Feb 2021 09:39:33 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTjZs0tnVz51jl; Mon, 1 Feb 2021 09:39:32 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f48.google.com with SMTP id p20so3936969ejb.6; Mon, 01 Feb 2021 01:39:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qDgIXXlXn/ZsMLGnpHxLL5Mf5Ks35K5i0ppD9ym/oTE=; b=ThKALNjVUEBYE+ZuguiPxzTRQLKWsisH1zsbtaGTqtEgi0hk2lwt/tnXBgzcNt93sP tyaSiysySe4k5Wpn+nUw8CkTgVDIOa++5R8ALM1pXLO0c50W02YjvYtIO1BrCSr5Zn6/ r3Gs3NkJiXeKfYevpJ7oQl+OXXZxqlGRZLkmlKSL+uoB8pSZGYpL9u/5gQ7IRP3XdzPw kS1dIMCCyuRENmMp0BHCQteDdFWd7na+PW7Xa+/uBdE2ddavXdUeKRPiZSDER8WGM/uh 0h21beqx/LLaWV2O/5ygzPL1SvYVDSdNFNfVM/FkM9ajv9Vyy3jLkcCMmI8jueOgZtCD aU9w== X-Gm-Message-State: AOAM5320DkQNSEKpezl1XLwX0TvL8yiw8dXrzyvL9waE187DNhRyrohk 4Og2kmQ0k0GwNtbTt6kTgSJfBGmaYxPXlw== X-Google-Smtp-Source: ABdhPJzftq0SHA+c1pVCC2EynF5dr8756F7fQzpA9FeDIKam9r12P0JlNEDcb4cu9hiio14kqSCgSg== X-Received: by 2002:a17:907:20aa:: with SMTP id pw10mr16835664ejb.314.1612172371572; Mon, 01 Feb 2021 01:39:31 -0800 (PST) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54]) by smtp.gmail.com with ESMTPSA id s18sm8599305edw.66.2021.02.01.01.39.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Feb 2021 01:39:31 -0800 (PST) Received: by mail-wm1-f54.google.com with SMTP id j18so12005195wmi.3; Mon, 01 Feb 2021 01:39:30 -0800 (PST) X-Received: by 2002:a05:600c:201:: with SMTP id 1mr14016391wmi.104.1612172370699; Mon, 01 Feb 2021 01:39:30 -0800 (PST) MIME-Version: 1.0 References: <202101071105.107B5tUX011254@gitrepo.freebsd.org> <20210110121242.1d9809ff@coosemans.org> In-Reply-To: From: Alexander Richardson Date: Mon, 1 Feb 2021 09:39:19 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 7fa2f2a62f04 - main - Rename NO_WERROR -> MK_WERROR=no To: Antoine Brodin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, =?UTF-8?Q?T=C4=B3l_Coosemans?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4DTjZs0tnVz51jl X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 09:39:33 -0000 On Sun, 31 Jan 2021 at 19:12, Antoine Brodin wrote: > > On Sun, Jan 10, 2021 at 12:12 PM T=C4=B3l Coosemans = wrote: > > > > On Thu, 7 Jan 2021 11:05:55 GMT Alex Richardson > > wrote: > > > The branch main has been updated by arichardson: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7fa2f2a62f04f095e1e27a= d55aa22a8f59b1df8f > > > > > > commit 7fa2f2a62f04f095e1e27ad55aa22a8f59b1df8f > > > Author: Alex Richardson > > > AuthorDate: 2021-01-06 17:55:06 +0000 > > > Commit: Alex Richardson > > > CommitDate: 2021-01-07 09:31:03 +0000 > > > > > > Rename NO_WERROR -> MK_WERROR=3Dno > > > > > > As suggested in D27598. This also supports MK_WERROR.clang=3Dno a= nd > > > MK_WERROR.gcc=3Dno to support the existing NO_WERROR. u= ses. > > > > > > Reviewed By: brooks > > > Differential Revision: https://reviews.freebsd.org/D27601 > > > --- > > > diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk > > > index d0e7f1cb00ba..88c73cc6bfe4 100644 > > > --- a/share/mk/bsd.opts.mk > > > +++ b/share/mk/bsd.opts.mk > > > @@ -65,7 +65,8 @@ __DEFAULT_YES_OPTIONS =3D \ > > > SSP \ > > > TESTS \ > > > TOOLCHAIN \ > > > - WARNS > > > + WARNS \ > > > + WERROR > > > > > > __DEFAULT_NO_OPTIONS =3D \ > > > BIND_NOW \ > > > @@ -103,7 +104,8 @@ __DEFAULT_DEPENDENT_OPTIONS =3D \ > > > INSTALLLIB \ > > > MAN \ > > > PROFILE \ > > > - WARNS > > > + WARNS \ > > > + WERROR > > > .if defined(NO_${var}) > > > .error "NO_${var} is defined, but deprecated. Please use MK_${var}= =3Dno instead." > > > MK_${var}:=3Dno > > > > NO_WERROR is also used by some ports [1] (which have to build against > > multiple version of FreeBSD) and this turns it into an error. Can you > > remove this change or turn it into a warning maybe? Changes to share/m= k > > should always go through a ports exp-run IMHO. > > Ping Alex Richardson? > > Antoine (with hat: portmgr) Hi Antoine, I submitted https://reviews.freebsd.org/D28084 to change this error to a .i= nfo. However, T=C4=B3l said that there weren't many affected ports so this change should not be needed. I can commit this workaround, but if I do this just postpones the problem to when we want to remove the workaround (and might mean it will never be removed). Maybe those ports should just be built with a lower WARNS? Thanks, Alex From owner-dev-commits-src-main@freebsd.org Mon Feb 1 10:07:53 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5E1CA4F904A; Mon, 1 Feb 2021 10:07:53 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTkCY2CZRz52yB; Mon, 1 Feb 2021 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3EBE41961B; Mon, 1 Feb 2021 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111A7rbg091528; Mon, 1 Feb 2021 10:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111A7rgD091527; Mon, 1 Feb 2021 10:07:53 GMT (envelope-from git) Date: Mon, 1 Feb 2021 10:07:53 GMT Message-Id: <202102011007.111A7rgD091527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 5cf6f1c4bc28 - main - Remove the MK_LIBCPLUSPLUS option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5cf6f1c4bc281ac45ced086bc2e393f732f2fcc2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 10:07:53 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5cf6f1c4bc281ac45ced086bc2e393f732f2fcc2 commit 5cf6f1c4bc281ac45ced086bc2e393f732f2fcc2 Author: Alex Richardson AuthorDate: 2021-01-30 17:56:35 +0000 Commit: Alex Richardson CommitDate: 2021-02-01 09:32:07 +0000 Remove the MK_LIBCPLUSPLUS option This option has been equivalent to any form of C++ support since libstdc++ was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D27974 --- Makefile.inc1 | 8 ++++---- lib/Makefile | 2 +- lib/libproc/Makefile | 4 +--- share/man/man5/src.conf.5 | 4 +--- share/mk/bsd.libnames.mk | 1 - share/mk/bsd.prog.mk | 4 ---- share/mk/src.libnames.mk | 4 ---- share/mk/src.opts.mk | 1 - tools/build/mk/OptionalObsoleteFiles.inc | 2 +- tools/build/options/WITHOUT_LIBCPLUSPLUS | 2 -- tools/build/options/WITH_LIBCPLUSPLUS | 2 -- 11 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 6387c68d25a5..005d9d25afb3 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2867,7 +2867,7 @@ _prereq_libs+= lib/libssp_nonshared _startup_libs= lib/csu _startup_libs+= lib/libc _startup_libs+= lib/libc_nonshared -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" _startup_libs+= lib/libcxxrt .endif @@ -2876,7 +2876,7 @@ _startup_libs+= lib/libgcc_eh lib/libgcc_s lib/libgcc_s__L: lib/libc__L lib/libgcc_s__L: lib/libc_nonshared__L -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" lib/libcxxrt__L: lib/libgcc_s__L .endif @@ -2925,7 +2925,7 @@ gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncurses__L _prebuild_libs+= lib/libregex .endif -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" _prebuild_libs+= lib/libc++ .endif @@ -3089,7 +3089,7 @@ lib/libradius__L: lib/libmd__L lib/libproc__L: \ ${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L -.if ${MK_CXX} != "no" && ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" lib/libproc__L: lib/libcxxrt__L .endif diff --git a/lib/Makefile b/lib/Makefile index ddb627917215..48276fcd361e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -182,7 +182,7 @@ SUBDIR.${MK_STATS}+= libstats _libclang_rt= libclang_rt .endif -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" _libcxxrt= libcxxrt _libcplusplus= libc++ _libcplusplus+= libc++experimental diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile index 80423741e4a9..434d78bb6933 100644 --- a/lib/libproc/Makefile +++ b/lib/libproc/Makefile @@ -18,10 +18,8 @@ CFLAGS+= -I${.CURDIR} .if ${MK_CXX} == "no" CFLAGS+= -DNO_CXA_DEMANGLE -.elif ${MK_LIBCPLUSPLUS} != "no" -LIBADD+= cxxrt .else -LIBADD+= supcplusplus +LIBADD+= cxxrt .endif LIBADD+= elf procstat rtld_db util diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 0e853db0d1bc..81656db323ed 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 30, 2021 +.Dd February 1, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -859,8 +859,6 @@ runtime linker. .Pp This is a default setting on arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mips, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. -.It Va WITHOUT_LIBCPLUSPLUS -Set to avoid building libcxxrt and libc++. .It Va WITH_LIBSOFT On armv6 only, set to enable soft float ABI compatibility libraries. This option is for transitioning to the new hard float ABI. diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index d030292d3c5e..7f591d3fd3f7 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -141,7 +141,6 @@ LIBSPL?= ${LIBDESTDIR}${LIBDIR_BASE}/libspl.a LIBSSL?= ${LIBDESTDIR}${LIBDIR_BASE}/libssl.a LIBSSP_NONSHARED?= ${LIBDESTDIR}${LIBDIR_BASE}/libssp_nonshared.a LIBSTATS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstats.a -LIBSTDCPLUSPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdc++.a LIBSTDTHREADS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdthreads.a LIBSYSDECODE?= ${LIBDESTDIR}${LIBDIR_BASE}/libsysdecode.a LIBTACPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libtacplus.a diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 5e7aaaeb37f8..44a774957cfb 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -261,11 +261,7 @@ _EXTRADEPEND: .else echo ${PROG_FULL}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) -.if ${COMPILER_TYPE} == "clang" && empty(CXXFLAGS:M-stdlib=libstdc++) echo ${PROG_FULL}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} -.else - echo ${PROG_FULL}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} -.endif .endif .endif .endif # !defined(NO_EXTRADEPEND) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 32cd1677bcd4..1d3195f53eb1 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -298,11 +298,7 @@ _DP_radius= crypto _DP_rtld_db= elf procstat _DP_procstat= kvm util elf .if ${MK_CXX} == "yes" -.if ${MK_LIBCPLUSPLUS} != "no" _DP_proc= cxxrt -.else -_DP_proc= supcplusplus -.endif .endif .if ${MK_CDDL} != "no" _DP_proc+= ctf diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index e531916b5976..d3f7e33f276c 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -125,7 +125,6 @@ __DEFAULT_YES_OPTIONS = \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ - LIBCPLUSPLUS \ LLD \ LLD_BOOTSTRAP \ LLD_IS_LD \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 4a075a78cf70..87fab14e45e7 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -3793,7 +3793,7 @@ OLD_LIBS+=${DEBUG_LIB32_LIBS} . endif .endif -.if ${MK_LIBCPLUSPLUS} == no +.if ${MK_CXX} == no OLD_LIBS+=lib/libcxxrt.so.1 OLD_FILES+=usr/lib/libc++.a OLD_FILES+=usr/lib/libc++_p.a diff --git a/tools/build/options/WITHOUT_LIBCPLUSPLUS b/tools/build/options/WITHOUT_LIBCPLUSPLUS deleted file mode 100644 index 2449e30d4b10..000000000000 --- a/tools/build/options/WITHOUT_LIBCPLUSPLUS +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Set to avoid building libcxxrt and libc++. diff --git a/tools/build/options/WITH_LIBCPLUSPLUS b/tools/build/options/WITH_LIBCPLUSPLUS deleted file mode 100644 index 0f30dd8c1e4f..000000000000 --- a/tools/build/options/WITH_LIBCPLUSPLUS +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Set to build libcxxrt and libc++. From owner-dev-commits-src-main@freebsd.org Mon Feb 1 10:48:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1EEAE4FA106 for ; Mon, 1 Feb 2021 10:48:22 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic302-21.consmr.mail.gq1.yahoo.com (sonic302-21.consmr.mail.gq1.yahoo.com [98.137.68.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTl6D6PQnz54h6 for ; Mon, 1 Feb 2021 10:48:20 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1612176499; bh=X1VJDGxsp874mh5ozSLnl9ZTDbm37WiJr1MbLWmRJPT=; h=From:Subject:Date:To:From:Subject:Reply-To; b=WPgvdrUWzdkKpeEuMp5KJXGgQNudYTmkSsZmHsSb6k8qPMFwE60gm+ICehmlboWXSMvPI2+dsknO+Ok0ZvM7bFh8w0nbrFnxVrvIqGOeIH2AemgEszN2Jfb3+/dN77BdWp6cYVYSuZsIcLSCGp8sQ0H5ZhmG9Vnwjm31UUClzOTc6rx9K8FxlISh47tL10w58fohTZSOvdoyhw6XyyLuxygSClwgz0KS+ai9LSIZtzTanFJVcgWUwCBmXhsgtStP4a/d9jYzr2FU3umQqnHpz+A1BZnWRB+I4LYTHNIlz3Zw7jijuY2bpN+1trIFRQEeVVXcce8XBqqKr9xHfR4tpg== X-YMail-OSG: TNt_EqMVM1n3DzpYiW9xpcVVFvVxOAgc0Wpoccqg3sFpU_FRXThES.r7HeyQgwA VfY6YmcvLu6WMNjGemR7m.azcH_vbKQhYjv9Raj.D0MSK.rsNj3rv9MdXSIn8C_K07TBJ4JS1Sg6 ETinqxhLLmSrDXYLU2QGmGNM.aC9I4bGns8PMw7cEmPnWmXSb4beaNb7lJ6XkhCogf6DEYLAmkjD FujAcHoXXv8rJOPxW6zzNCKcpeXoES1uxg.rYEUmHuv0Rjfxb17e1.PysBNl4EqJU9KEItSiaYZ1 TA_A81YIeN36IjGWKz7lOMGn96lJtu5fgLGg2eVi.3MGbiGtxk.qOFKB.ASMSYHYbTtOo4yMpvP9 pxcfiy4RJ49eZYLowKOrKpEIDB3KrSsbRgEy2Rua1ebu0.vmUtOhxcGTKehd5TP8cXBIHCRhLaZz iWDIapNjoVUY5JlfqBLhJAMXdsn.hSLf9n.YGUdCijpOoOlFMkDLUbZNFSygcW9u0qik6QMRrJA3 ucNnMEd0hJ9VfHXb7Gv9Z.1QvZMqCBuZYHd1KT5_iEwobfgoIaI.qr1CLj.SGEdw8eC6PEQAV4jw Db6sBbIs.3OJS3wO45o6XF51gC4jgSo1sqnQwUHeMaWyfFEqJmtZ1O2lGxsuLXz0JSCBzkiweD7d ix60BsWsilSsfaCn.4aLHSglmnA52RK4Hpc.9tvDoqhnW6LiZO_hWCkYuRgPZcsY9yheM5kMSmWp Ma9pV1ZQ.IIIYvtHqPU7tHFk8ung2asK8qqR976umQLN5szSxXwizGYEQt6tFOb46zbXmEth5mMZ aM_ve14Ct65i2JyUKGkWNe9hnRk7UCOEACLD_S2UvPquZAc7k.5vO7A8QmqbWlvu1isDSCfBQdaR 2MqQuasbYHUGqheuSjWb712lXmyiZFX4HENqkj0IPXsqozxKnBuek7FwolQd9pANc8zXafecWTEf a8mkw.b9mzDKgeu.BFeQR8.jI242YRiU1BzzMp3FV_kZZLxvRXUURP2PYRZ3jqK4eRYVtc1fuNXc nv8YpbwDOdX.kopDFDVWG1aODxQX61Mf.J1FSS4e0.ST24W_VUp1.of1_xULCRTMs.yBkrg5CnVA .Y4g2_ToOGYR5U_jFfUK2pdcMBDrw8iec4ILKOdY1yaH2jzYox5ADQhuWPkQNtSBIWlZ0GZ2_D83 rxkqhqHhuiXByRiLlv2SzNejtXwEHfgZILmK_8ei_HGgdEinOEr0k1N7eSP2pLj3HwaLnZh3lrZH cFM6aPdyVNuvU.Jjp1GeTRmXIL9VFDrsO4Fg_vfzASFelcLmLVMG06MIRmLfX1ZAZ9BhDJwimt_G V7bQCGJKwe28L33_FG1aqRdz2xj7ZHvPXJDfvugsHFc8DUkh58FjI7XmQ7wEhWisz4twnBM4ht1x NcRUSVkWmPOGAmv7yjxFO4QLb7X_fngnp1Bf106UmOCNfYndc2iTp6se5kW58oe_6dgE8Yf02Zy5 pCfXqkrPspTBU83krVIvypgsGUUskhXwMacFCZiLAlPEcK_9jX0NyDkURN_CSyzWW87a6t8E8VcF WwboO1AcjgcIKAVNQ3.hbkuq.R_KtP3xbOE4mt_vZfBZEmrysurGP3d.N0XlU33SWgXv7fSsHIju AcOIFYQ.h3Tyu1yljNk3hFnXndaezScba7DF0G2swa5_ShfaeY3ZeISMo6HdJx1tHMVPqCCmLeVN OXTqV7A1d5wjwG5TF6IM7n2cCz16S9walTZ8dk2Eae4AZanKQxuv1xJUnqoPSKeNp3gtypzTcmwr 9qZkkz.ZZWFTyvvARer33OcrHgz.AAKpnJcTAI5AKpH0ktKHFesERgdEwXLkcwSXViLCM.h.Y5QQ 5JQoSNgUWXrz.YFlofPf3xov5804DipMSgrJkI0exeZbF6z3SFDnTxu8GXjICALh4cQL6sa4Pgee 0lw5GC1p6PV18ZrVmB5InX1_302kq_hkAw.OPxotyJ_OK_UYLkqhAsHqa7kxT9Qdu_DPwUzdAavq mAk.A1SljEm2jpK176Q.3toReaQ.f_1DUXMzn_djXWPVxioaJEV9WLNfIessl7LmkngYhE.qpmgp _ifrruPdwkLzqJ5amLOhH_0_92PRJZFZL7kZXBS0zTYKxusvnitnKiY2Gsp9eVZXw1ke_4dKJSl0 95dvF4.JNyCZdzoT7xGjleCGBopOoEP3qVKResL1S5pOWUCTXwkeCby1RpaxbzTfb9lRBoAPekod 3lzWz4FJsSSbxOpyOr14lSIuTPA.64bUmYQNLrwtwiNcmxqO66S2FZCRG3krEObT3o7Vb6dJkRia c7YbT9JBPBr8yZNvISRQ6qF6eVi48Alboz7qD0qss64uKdjGCv7lLy6we6nxuFG7uEzWSIV5LoNu yyaTPAb9Pev5RAWXX15sszN1_S.tvLZSZGhvWLBbcTf5vrmh.zEqsOMRqNOHtcWGNrxE4hm7Bo0N D3bV4NAjWEdViWvMd5Fp9sDKKsVgedJtgRPmUgQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Mon, 1 Feb 2021 10:48:19 +0000 Received: by smtp420.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 3734aa63e7ce1d1fd54539f7437964f8; Mon, 01 Feb 2021 10:48:14 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: git: 7fa2f2a62f04 - main - Rename NO_WERROR -> MK_WERROR=no Message-Id: <9110AE5B-4BC0-4BF0-A33E-5E1C78224B9E@yahoo.com> Date: Mon, 1 Feb 2021 02:48:12 -0800 To: "arichardson@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3654.40.0.2.32) References: <9110AE5B-4BC0-4BF0-A33E-5E1C78224B9E.ref@yahoo.com> X-Rspamd-Queue-Id: 4DTl6D6PQnz54h6 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.68.147:from]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.68.147:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.147:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.147:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 10:48:22 -0000 > On Sun, 31 Jan 2021 at 19:12, Antoine Brodin = wrote: > > > > On Sun, Jan 10, 2021 at 12:12 PM T=C4=B3l Coosemans wrote: > > > > > > On Thu, 7 Jan 2021 11:05:55 GMT Alex Richardson > > > wrote: . . . > > > NO_WERROR is also used by some ports [1] (which have to build = against > > > multiple version of FreeBSD) and this turns it into an error. Can = you > > > remove this change or turn it into a warning maybe? Changes to = share/mk > > > should always go through a ports exp-run IMHO. > > > > Ping Alex Richardson? > > > > Antoine (with hat: portmgr) >=20 > Hi Antoine, >=20 > I submitted https://reviews.freebsd.org/D28084 to change this error to = a .info. > However, T=C4=B3l said that there weren't many affected ports so this > change should not be needed. > I can commit this workaround, but if I do this just postpones the > problem to when we want to remove the workaround (and might mean it > will never be removed). Maybe those ports should just be built with a > lower WARNS? If one mistakenly leaves NO_WERROR in someplace like, say, /etc/make.conf and so the errors occur during something that uses make in a way that happens to do the check, such as possibly in etcupdate's use of make, is the overall behavior of the overall operation known to always avoid doing anything nasty? The same sort of question applies to a warning or such but more is the same as before in that case and so problems seem possibly less likely. As far as I can tell, NO_WERROR becoming depreciated had no transition period of notifications about progressing past 12 to 13 or later. Existing procedures may just suddenly stop working as intended where NO_WERROR was in use for whatever reason. (I had an example of missing a NO_WERROR removal and having to recover from odd behavior that I expect was a consequence, although I've not proven such. Having found and removed the NO_WERROR, I've had no more such odd behaviors, which is at least suggestive.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-main@freebsd.org Mon Feb 1 11:01:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6FC044FA5C1; Mon, 1 Feb 2021 11:01:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTlPG2nrTz55Xf; Mon, 1 Feb 2021 11:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 52EAC19F5C; Mon, 1 Feb 2021 11:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111B1MUu065147; Mon, 1 Feb 2021 11:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111B1M2H065146; Mon, 1 Feb 2021 11:01:22 GMT (envelope-from git) Date: Mon, 1 Feb 2021 11:01:22 GMT Message-Id: <202102011101.111B1M2H065146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 3447df8bc5b3 - main - cxgbe(4): Fixes to tx coalescing. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3447df8bc5b342bd88d565641435284ff620ee2a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 11:01:22 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3447df8bc5b342bd88d565641435284ff620ee2a commit 3447df8bc5b342bd88d565641435284ff620ee2a Author: Navdeep Parhar AuthorDate: 2021-02-01 11:00:09 +0000 Commit: Navdeep Parhar CommitDate: 2021-02-01 11:00:09 +0000 cxgbe(4): Fixes to tx coalescing. - The behavior implemented in r362905 resulted in delayed transmission of packets in some cases, causing performance issues. Use a different heuristic to predict tx requests. - Add a tunable/sysctl (hw.cxgbe.tx_coalesce) to disable tx coalescing entirely. It can be changed at any time. There is no change in default behavior. --- sys/dev/cxgbe/adapter.h | 4 ++- sys/dev/cxgbe/t4_main.c | 1 + sys/dev/cxgbe/t4_sge.c | 69 ++++++++++++++++++++++++++++++++++++++++--------- sys/dev/cxgbe/t4_vf.c | 1 + 4 files changed, 62 insertions(+), 13 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 37afa7cf7780..4b2f86d00052 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -561,7 +561,7 @@ struct txpkts { uint8_t wr_type; /* type 0 or type 1 */ uint8_t npkt; /* # of packets in this work request */ uint8_t len16; /* # of 16B pieces used by this work request */ - uint8_t score; /* 1-10. coalescing attempted if score > 3 */ + uint8_t score; uint8_t max_npkt; /* maximum number of packets allowed */ uint16_t plen; /* total payload (sum of all packets) */ @@ -584,6 +584,7 @@ struct sge_txq { struct sglist *gl; __be32 cpl_ctrl0; /* for convenience */ int tc_idx; /* traffic class */ + uint64_t last_tx; /* cycle count when eth_tx was last called */ struct txpkts txp; struct task tx_reclaim_task; @@ -599,6 +600,7 @@ struct sge_txq { uint64_t txpkts1_wrs; /* # of type1 coalesced tx work requests */ uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ + uint64_t txpkts_flush; /* # of times txp had to be sent by tx_update */ uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */ uint64_t vxlan_tso_wrs; /* # of VXLAN TSO work requests */ uint64_t vxlan_txcsum; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 994fe2e78de5..18a83df763ab 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -10718,6 +10718,7 @@ clear_stats(struct adapter *sc, u_int port_id) txq->txpkts1_wrs = 0; txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; + txq->txpkts_flush = 0; txq->raw_wrs = 0; txq->vxlan_tso_wrs = 0; txq->vxlan_txcsum = 0; diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index f9553bbbce67..45f07358f0db 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -212,6 +212,22 @@ static counter_u64_t defrags; SYSCTL_COUNTER_U64(_hw_cxgbe, OID_AUTO, defrags, CTLFLAG_RD, &defrags, "Number of mbuf defrags performed"); +static int t4_tx_coalesce = 1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce, CTLFLAG_RWTUN, &t4_tx_coalesce, 0, + "tx coalescing allowed"); + +/* + * The driver will make aggressive attempts at tx coalescing if it sees these + * many packets eligible for coalescing in quick succession, with no more than + * the specified gap in between the eth_tx calls that delivered the packets. + */ +static int t4_tx_coalesce_pkts = 32; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce_pkts, CTLFLAG_RWTUN, + &t4_tx_coalesce_pkts, 0, + "# of consecutive packets (1 - 255) that will trigger tx coalescing"); +static int t4_tx_coalesce_gap = 5; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce_gap, CTLFLAG_RWTUN, + &t4_tx_coalesce_gap, 0, "tx gap (in microseconds)"); static int service_iq(struct sge_iq *, int); static int service_iq_fl(struct sge_iq *, int); @@ -3120,6 +3136,26 @@ set_txupdate_flags(struct sge_txq *txq, u_int avail, } } +#if defined(__i386__) || defined(__amd64__) +extern uint64_t tsc_freq; +#endif + +static inline bool +record_eth_tx_time(struct sge_txq *txq) +{ + const uint64_t cycles = get_cyclecount(); + const uint64_t last_tx = txq->last_tx; +#if defined(__i386__) || defined(__amd64__) + const uint64_t itg = tsc_freq * t4_tx_coalesce_gap / 1000000; +#else + const uint64_t itg = 0; +#endif + + MPASS(cycles >= last_tx); + txq->last_tx = cycles; + return (cycles - last_tx < itg); +} + /* * r->items[cidx] to r->items[pidx], with a wraparound at r->size, are ready to * be consumed. Return the actual number consumed. 0 indicates a stall. @@ -3137,10 +3173,11 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) u_int n, avail, dbdiff; /* # of hardware descriptors */ int i, rc; struct mbuf *m0; - bool snd; + bool snd, recent_tx; void *wr; /* start of the last WR written to the ring */ TXQ_LOCK_ASSERT_OWNED(txq); + recent_tx = record_eth_tx_time(txq); remaining = IDXDIFF(pidx, cidx, r->size); if (__predict_false(discard_tx(eq))) { @@ -3159,17 +3196,15 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) } /* How many hardware descriptors do we have readily available. */ - if (eq->pidx == eq->cidx) { + if (eq->pidx == eq->cidx) avail = eq->sidx - 1; - if (txp->score++ >= 5) - txp->score = 5; /* tx is completely idle, reset. */ - } else + else avail = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; total = 0; if (remaining == 0) { - if (txp->score-- == 1) /* egr_update had to drain txpkts */ - txp->score = 1; + txp->score = 0; + txq->txpkts_flush++; goto send_txpkts; } @@ -3183,7 +3218,17 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) if (avail < 2 * SGE_MAX_WR_NDESC) avail += reclaim_tx_descs(txq, 64); - if (txp->npkt > 0 || remaining > 1 || txp->score > 3 || + if (t4_tx_coalesce == 0 && txp->npkt == 0) + goto skip_coalescing; + if (cannot_use_txpkts(m0)) + txp->score = 0; + else if (recent_tx) { + if (++txp->score == 0) + txp->score = UINT8_MAX; + } else + txp->score = 1; + if (txp->npkt > 0 || remaining > 1 || + txp->score >= t4_tx_coalesce_pkts || atomic_load_int(&txq->eq.equiq) != 0) { if (vi->flags & TX_USES_VM_WR) rc = add_to_txpkts_vf(sc, txq, m0, avail, &snd); @@ -3198,8 +3243,6 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) for (i = 0; i < txp->npkt; i++) ETHER_BPF_MTAP(ifp, txp->mb[i]); if (txp->npkt > 1) { - if (txp->score++ >= 10) - txp->score = 10; MPASS(avail >= tx_len16_to_desc(txp->len16)); if (vi->flags & TX_USES_VM_WR) n = write_txpkts_vm_wr(sc, txq); @@ -3239,7 +3282,7 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) MPASS(rc != 0 && rc != EAGAIN); MPASS(txp->npkt == 0); - +skip_coalescing: n = tx_len16_to_desc(mbuf_len16(m0)); if (__predict_false(avail < n)) { avail += reclaim_tx_descs(txq, min(n, 32)); @@ -4304,7 +4347,6 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx, M_ZERO | M_WAITOK); txp = &txq->txp; - txp->score = 5; MPASS(nitems(txp->mb) >= sc->params.max_pkts_per_eth_tx_pkts_wr); txq->txp.max_npkt = min(nitems(txp->mb), sc->params.max_pkts_per_eth_tx_pkts_wr); @@ -4363,6 +4405,9 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx, SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts1_pkts", CTLFLAG_RD, &txq->txpkts1_pkts, "# of frames tx'd using type1 txpkts work requests"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts_flush", + CTLFLAG_RD, &txq->txpkts_flush, + "# of times txpkts had to be flushed out by an egress-update"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "raw_wrs", CTLFLAG_RD, &txq->raw_wrs, "# of raw work requests (non-packets)"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vxlan_tso_wrs", diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c index 223ffe7aeaa0..6c736e37faac 100644 --- a/sys/dev/cxgbe/t4_vf.c +++ b/sys/dev/cxgbe/t4_vf.c @@ -893,6 +893,7 @@ t4vf_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, txq->txpkts1_wrs = 0; txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; + txq->txpkts_flush = 0; mp_ring_reset_stats(txq->r); } } From owner-dev-commits-src-main@freebsd.org Mon Feb 1 12:20:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1FE364FD959; Mon, 1 Feb 2021 12:20:32 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTn8c0VWXz3CG5; Mon, 1 Feb 2021 12:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 03CBA1B11E; Mon, 1 Feb 2021 12:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111CKVdl068679; Mon, 1 Feb 2021 12:20:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CKVrt068678; Mon, 1 Feb 2021 12:20:31 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:20:31 GMT Message-Id: <202102011220.111CKVrt068678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 69c5fa5cd1ec - main - zfs: remove incomplete ifdefs for lockless symlink support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69c5fa5cd1ec9b09ed88a086607a8a0993818db9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 12:20:32 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=69c5fa5cd1ec9b09ed88a086607a8a0993818db9 commit 69c5fa5cd1ec9b09ed88a086607a8a0993818db9 Author: Mateusz Guzik AuthorDate: 2021-02-01 12:18:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:18:27 +0000 zfs: remove incomplete ifdefs for lockless symlink support This wil be handled differently upstream and merged later. --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 35e54a2e1560..42f5786ce5c7 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -4463,7 +4463,6 @@ zfs_freebsd_fplookup_vexec(struct vop_fplookup_vexec_args *v) } #endif -#if __FreeBSD_version >= 1400001 static int zfs_freebsd_fplookup_symlink(struct vop_fplookup_symlink_args *v) { @@ -4483,7 +4482,6 @@ zfs_freebsd_fplookup_symlink(struct vop_fplookup_symlink_args *v) } return (cache_symlink_resolve(v->a_fpl, target, strlen(target))); } -#endif #ifndef _SYS_SYSPROTO_H_ struct vop_access_args { @@ -5797,9 +5795,7 @@ struct vop_vector zfs_vnodeops = { #if __FreeBSD_version >= 1300102 .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, #endif -#if __FreeBSD_version >= 1400001 .vop_fplookup_symlink = zfs_freebsd_fplookup_symlink, -#endif .vop_access = zfs_freebsd_access, .vop_allocate = VOP_EINVAL, .vop_lookup = zfs_cache_lookup, @@ -5849,9 +5845,7 @@ struct vop_vector zfs_fifoops = { #if __FreeBSD_version >= 1300102 .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, #endif -#if __FreeBSD_version >= 1400001 .vop_fplookup_symlink = zfs_freebsd_fplookup_symlink, -#endif .vop_access = zfs_freebsd_access, .vop_getattr = zfs_freebsd_getattr, .vop_inactive = zfs_freebsd_inactive, @@ -5875,9 +5869,7 @@ struct vop_vector zfs_shareops = { #if __FreeBSD_version >= 1300121 .vop_fplookup_vexec = VOP_EAGAIN, #endif -#if __FreeBSD_version >= 1400001 .vop_fplookup_symlink = VOP_EAGAIN, -#endif .vop_access = zfs_freebsd_access, .vop_inactive = zfs_freebsd_inactive, .vop_reclaim = zfs_freebsd_reclaim, From owner-dev-commits-src-main@freebsd.org Mon Feb 1 13:05:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D1A945285CB; Mon, 1 Feb 2021 13:05:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTp8J5Y9Wz3LyW; Mon, 1 Feb 2021 13:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B16841BCDD; Mon, 1 Feb 2021 13:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111D5KKH026513; Mon, 1 Feb 2021 13:05:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111D5Kck026512; Mon, 1 Feb 2021 13:05:20 GMT (envelope-from git) Date: Mon, 1 Feb 2021 13:05:20 GMT Message-Id: <202102011305.111D5Kck026512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: bdd4630c9a9c - main - sctp: small cleanup, no functional change intended. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bdd4630c9a9cea64830f981fc897ac953c48892c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 13:05:20 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bdd4630c9a9cea64830f981fc897ac953c48892c commit bdd4630c9a9cea64830f981fc897ac953c48892c Author: Michael Tuexen AuthorDate: 2021-02-01 13:03:41 +0000 Commit: Michael Tuexen CommitDate: 2021-02-01 13:04:57 +0000 sctp: small cleanup, no functional change intended. MFC after: 3 days --- sys/netinet/sctputil.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 084b7bd6af72..319344842d5f 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2032,14 +2032,13 @@ sctp_timeout_handler(void *t) sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_FROM_INPKILL_TIMER); inp = NULL; - goto out_no_decr; + goto out_decr; case SCTP_TIMER_TYPE_ASOCKILL: KASSERT(inp != NULL && stcb != NULL && net == NULL, ("timeout of type %d: inp = %p, stcb = %p, net = %p", type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timoassockill); /* Can we free it yet? */ - SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1); (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, @@ -2049,7 +2048,7 @@ sctp_timeout_handler(void *t) * duplicate unlock or unlock of a free mtx :-0 */ stcb = NULL; - goto out_no_decr; + goto out_decr; case SCTP_TIMER_TYPE_ADDR_WQ: KASSERT(inp == NULL && stcb == NULL && net == NULL, ("timeout of type %d: inp = %p, stcb = %p, net = %p", @@ -2107,7 +2106,6 @@ out_decr: if (net != NULL) { sctp_free_remote_addr(net); } -out_no_decr: SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d handler finished.\n", type); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); From owner-dev-commits-src-main@freebsd.org Mon Feb 1 13:06:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CAF345288B0; Mon, 1 Feb 2021 13:06:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4DTp9G4ZFzz3MmQ; Mon, 1 Feb 2021 13:06:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8EA40260487; Mon, 1 Feb 2021 14:06:08 +0100 (CET) Subject: Re: git: 1a714ff20419 - main - This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. To: Mateusz Guzik , Michael Tuexen , Konstantin Belousov Cc: Randall Stewart , Randall Stewart , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <48fe9f24-e96b-1078-ada2-a8691ead6cf1@selasky.org> Date: Mon, 1 Feb 2021 14:05:54 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------4CEF225002A76A7E4D6C5E4E" Content-Language: en-US X-Rspamd-Queue-Id: 4DTp9G4ZFzz3MmQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 13:06:10 -0000 This is a multi-part message in MIME format. --------------4CEF225002A76A7E4D6C5E4E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, The attached patch should fix it. (Waiting for a quick review). But there are more issues: For i386 I now see: > ld: error: undefined symbol: xdr_export_sec_context_res >>>> referenced by gss_impl.c >>>> gss_impl.o:(kgss_transfer_context) > > ld: error: undefined symbol: gssd_import_name_1 >>>> referenced by gss_import_name.c >>>> gss_import_name.o:(gss_import_name) > > ld: error: undefined symbol: gssd_pname_to_uid_1 >>>> referenced by gss_pname_to_uid.c >>>> gss_pname_to_uid.o:(gss_pname_to_uid) >>>> referenced by gss_pname_to_uid.c >>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) > > ld: error: undefined symbol: xdr_pname_to_uid_res >>>> referenced by gss_pname_to_uid.c >>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) > > ld: error: undefined symbol: gssd_release_cred_1 >>>> referenced by gss_release_cred.c >>>> gss_release_cred.o:(gss_release_cred) > > ld: error: undefined symbol: gssd_release_name_1 >>>> referenced by gss_release_name.c >>>> gss_release_name.o:(gss_release_name) > Maybe xdr needs to be added to LINT now? Passing the ball onto Konstantin. --HPS --------------4CEF225002A76A7E4D6C5E4E Content-Type: text/x-patch; charset=UTF-8; name="a.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="a.diff" commit 38dc40d5b501932e60eb1fb52933a280d5035488 Author: Hans Petter Selasky Date: Mon Feb 1 13:23:21 2021 +0100 Fix LINT kernel builds after 1a714ff20419 . MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28357 Sponsored by: Mellanox Technologies // NVIDIA Networking diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index aeb1ed6906b..8f2cf3d8d06 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -372,17 +372,6 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "using", CTLFLAG_RD, - &rs->rs_rlt[i].using, 0, - "Number of flows using"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "enobufs", CTLFLAG_RD, - &rs->rs_rlt[i].rs_num_enobufs, 0, - "Number of enobufs logged on this rate"); - } } #endif @@ -678,8 +667,6 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; - rs->rs_rlt[i].using = 0; - rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1076,28 +1063,16 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* @@ -1214,9 +1189,11 @@ rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t bytes_per_sec, rte = NULL; } else { KASSERT((inp->inp_snd_tag != NULL) , - ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", - inp, rte, rte->rate, rs)); + ("Setup rate has no snd_tag inp:%p rte:%p rate:%llu rs:%p", + inp, rte, (unsigned long long)rte->rate, rs)); +#ifdef INET counter_u64_add(rate_limit_new, 1); +#endif } } if (rte) { @@ -1462,8 +1439,11 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if (error) *error = err; return (NULL); - } else + } else { +#ifdef INET counter_u64_add(rate_limit_chg, 1); +#endif + } if (error) *error = 0; tp->t_pacing_rate = nrte->rate; diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index d3f82fab3ee..b69f0e634b6 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -44,8 +44,6 @@ struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ uint64_t rate; /* Rate we get in Bytes per second (Bps) */ - uint64_t using; /* Temporary -- rrs remove */ - uint64_t rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; --------------4CEF225002A76A7E4D6C5E4E-- From owner-dev-commits-src-main@freebsd.org Mon Feb 1 13:18:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8093C528E44; Mon, 1 Feb 2021 13:18:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTpRt2zP5z3NRJ; Mon, 1 Feb 2021 13:18:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x335.google.com with SMTP id c127so13133609wmf.5; Mon, 01 Feb 2021 05:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pJ7oBfLV7TuEINkxTvap+YXzKPJqYwo9ROTd55JO/To=; b=HPQSczK4lbvTz0/tAQt61iU78VOP7EeJCClFKo5h/fYBcY5QRWcsYraecGC9rwzFHX /GiMh1DMChxPh2UgJXpO7+VGJF1BoenCFPw5b55BxDcQwT1TtFD+2Npg655v6YEuJkZC SYnJQloOTPdRNgOhKHydyPk0iTe7wFCh152z8ACXfqDdoNWzTjKDtnUQHzAekRe3hsGP /vDx3f6sQiDNPQu10n7hZvemAswrGPCTL2vT4OhL7onlRPn2iX+vMz9WVgZXbecizSe+ Abe7Vxi9sIE5J5LvrdJVcj6ApMtwPnfN1HT9MgvnqAbu/PgyD5cX1gtZHWz2c5/Ayytd uArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pJ7oBfLV7TuEINkxTvap+YXzKPJqYwo9ROTd55JO/To=; b=a4FR8AyBdpf5+1q9mPQanV/gwwEuQ1zWSRgtdL/tqpFuNk6cB5ffrj6pK4EoiDnvDK ZSIEHXKanlCCTC35k6OWQEnPNY9FlJ8G7ZZrXl2C0Af9eIopTJuxwNY3QPipC7fu0wTD T1cdOY8Lx5ydsRrvuIJFGZmmlqkxnJak1zz0Gh2hLK1IKxpzZTqlT6obuRoH6uAwYYOo EXcMabg5fUFArHp9+Q0iQa81OBQGDvz4QVz5yqL1FTASTEzVq9OiuxmjeqY9AyAW2Gtx XhoMAWt9J6walZ4EGhrWLt3B6sypRA/Ii6A1fSi4iNObvXwzo+CgIrNwYejdoh/Mly2S wlOg== X-Gm-Message-State: AOAM532pli/bNoLwCfTwKc3FP0TbMVYsRjfMi1/17Ck57GY6aL0gc1dU 2jPIEMyk/2/wT5jXpNRS4vFcYKT0DecUlIRHq4A= X-Google-Smtp-Source: ABdhPJwYVloFm2c5P//4Cw2HLH0PWvY4gkuvLxxEiK5MtClnclUxVS0TITvrl3GYmgbUIqm1v0k/ZWHU7EbHFD/Bflw= X-Received: by 2002:a1c:98d4:: with SMTP id a203mr3454461wme.10.1612185528879; Mon, 01 Feb 2021 05:18:48 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Mon, 1 Feb 2021 05:18:47 -0800 (PST) In-Reply-To: <48fe9f24-e96b-1078-ada2-a8691ead6cf1@selasky.org> References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> <48fe9f24-e96b-1078-ada2-a8691ead6cf1@selasky.org> From: Mateusz Guzik Date: Mon, 1 Feb 2021 14:18:47 +0100 Message-ID: Subject: Re: git: 1a714ff20419 - main - This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. To: Hans Petter Selasky Cc: Michael Tuexen , Konstantin Belousov , Randall Stewart , Randall Stewart , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DTpRt2zP5z3NRJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 13:18:50 -0000 I cannot test the patch right now, but tinderbox builds for me with the offending commit reverted. On 2/1/21, Hans Petter Selasky wrote: > Hi, > > The attached patch should fix it. (Waiting for a quick review). But > there are more issues: > > For i386 I now see: > >> ld: error: undefined symbol: xdr_export_sec_context_res >>>>> referenced by gss_impl.c >>>>> gss_impl.o:(kgss_transfer_context) >> >> ld: error: undefined symbol: gssd_import_name_1 >>>>> referenced by gss_import_name.c >>>>> gss_import_name.o:(gss_import_name) >> >> ld: error: undefined symbol: gssd_pname_to_uid_1 >>>>> referenced by gss_pname_to_uid.c >>>>> gss_pname_to_uid.o:(gss_pname_to_uid) >>>>> referenced by gss_pname_to_uid.c >>>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) >> >> ld: error: undefined symbol: xdr_pname_to_uid_res >>>>> referenced by gss_pname_to_uid.c >>>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) >> >> ld: error: undefined symbol: gssd_release_cred_1 >>>>> referenced by gss_release_cred.c >>>>> gss_release_cred.o:(gss_release_cred) >> >> ld: error: undefined symbol: gssd_release_name_1 >>>>> referenced by gss_release_name.c >>>>> gss_release_name.o:(gss_release_name) >> > > Maybe xdr needs to be added to LINT now? > > Passing the ball onto Konstantin. > > --HPS > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Mon Feb 1 13:25:15 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EC2D052928A; Mon, 1 Feb 2021 13:25:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTpbH6QQSz3P63; Mon, 1 Feb 2021 13:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 CF2371C0DA; Mon, 1 Feb 2021 13:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111DPFvM052346; Mon, 1 Feb 2021 13:25:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111DPFt2052345; Mon, 1 Feb 2021 13:25:15 GMT (envelope-from git) Date: Mon, 1 Feb 2021 13:25:15 GMT Message-Id: <202102011325.111DPFt2052345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: db46c0d0cb3d - main - Fix LINT kernel builds after 1a714ff20419 . MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db46c0d0cb3da2813727e56df1f2db292065867a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 13:25:16 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=db46c0d0cb3da2813727e56df1f2db292065867a commit db46c0d0cb3da2813727e56df1f2db292065867a Author: Hans Petter Selasky AuthorDate: 2021-02-01 12:23:21 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-01 13:24:15 +0000 Fix LINT kernel builds after 1a714ff20419 . MFC after: 1 week Discussed with: rrs@ Differential Revision: https://reviews.freebsd.org/D28357 Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/tcp_ratelimit.c | 36 ++++++++---------------------------- sys/netinet/tcp_ratelimit.h | 2 -- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index aeb1ed6906b5..8f2cf3d8d061 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -372,17 +372,6 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "using", CTLFLAG_RD, - &rs->rs_rlt[i].using, 0, - "Number of flows using"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "enobufs", CTLFLAG_RD, - &rs->rs_rlt[i].rs_num_enobufs, 0, - "Number of enobufs logged on this rate"); - } } #endif @@ -678,8 +667,6 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; - rs->rs_rlt[i].using = 0; - rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1076,28 +1063,16 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* @@ -1214,9 +1189,11 @@ use_real_interface: rte = NULL; } else { KASSERT((inp->inp_snd_tag != NULL) , - ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", - inp, rte, rte->rate, rs)); + ("Setup rate has no snd_tag inp:%p rte:%p rate:%llu rs:%p", + inp, rte, (unsigned long long)rte->rate, rs)); +#ifdef INET counter_u64_add(rate_limit_new, 1); +#endif } } if (rte) { @@ -1462,8 +1439,11 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if (error) *error = err; return (NULL); - } else + } else { +#ifdef INET counter_u64_add(rate_limit_chg, 1); +#endif + } if (error) *error = 0; tp->t_pacing_rate = nrte->rate; diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index d3f82fab3ee1..b69f0e634b60 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -44,8 +44,6 @@ struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ uint64_t rate; /* Rate we get in Bytes per second (Bps) */ - uint64_t using; /* Temporary -- rrs remove */ - uint64_t rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; From owner-dev-commits-src-main@freebsd.org Mon Feb 1 14:27:23 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6297652BB56; Mon, 1 Feb 2021 14:27:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTqyz2MSWz3jvL; Mon, 1 Feb 2021 14:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 43FE81CB3B; Mon, 1 Feb 2021 14:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111ERNqF031255; Mon, 1 Feb 2021 14:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111ERNL7031254; Mon, 1 Feb 2021 14:27:23 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:27:23 GMT Message-Id: <202102011427.111ERNL7031254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 88be0e11205e - main - bridge: fix STP roles and protos strings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 14:27:23 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c commit 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c Author: Jonah Caplan AuthorDate: 2021-01-30 13:54:09 +0000 Commit: Kristof Provost CommitDate: 2021-02-01 14:27:06 +0000 bridge: fix STP roles and protos strings Add the missing commas that got lost in e5539fb618cc7. PR: 252532 Reviewd by: kp@, donner@, freqlabs@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28425 --- sys/net/if_bridgevar.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index fef252821be7..c12ee4598548 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -278,15 +278,15 @@ struct ifbpstpconf { "discarding" #define STP_PROTOS \ - "stp" \ - "-" \ + "stp", \ + "-", \ "rstp" #define STP_ROLES \ - "disabled" \ - "root" \ - "designated" \ - "alternate" \ + "disabled", \ + "root", \ + "designated", \ + "alternate", \ "backup" #define PV2ID(pv, epri, eaddr) do { \ From owner-dev-commits-src-main@freebsd.org Mon Feb 1 14:40:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A0AFF52C311; Mon, 1 Feb 2021 14:40:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTrGS42VFz3kdN; Mon, 1 Feb 2021 14:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7A5FF1D00E; Mon, 1 Feb 2021 14:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111Eem0n054361; Mon, 1 Feb 2021 14:40:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Eemlb054360; Mon, 1 Feb 2021 14:40:48 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:40:48 GMT Message-Id: <202102011440.111Eemlb054360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: e5cc1c474841 - main - src.opts.mk: set MK_ZFS conditional on MK_OPENSSL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5cc1c47484160969e0a7c13cdbc71081d7dd60e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 14:40:48 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e5cc1c47484160969e0a7c13cdbc71081d7dd60e commit e5cc1c47484160969e0a7c13cdbc71081d7dd60e Author: Mitchell Horne AuthorDate: 2021-01-30 19:04:08 +0000 Commit: Mitchell Horne CommitDate: 2021-02-01 14:31:17 +0000 src.opts.mk: set MK_ZFS conditional on MK_OPENSSL libzfs has a dependency on libcrypto. This causes a buildworld link failure when WITHOUT_OPENSSL/WITHOUT_CRYPT is set. This dependency was added implicitly by the switch to OpenZFS, and explicitly in 40d0fd287510 and cd568e2b1b67. PR: 252841 Reviewed by: kevans, freqlabs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28431 --- share/mk/src.opts.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index d3f7e33f276c..6cfab4b50613 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -438,6 +438,7 @@ MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_SVN:= no MK_SVNLITE:= no +MK_ZFS:= no .endif .if ${MK_LDNS} == "no" From owner-dev-commits-src-main@freebsd.org Mon Feb 1 14:40:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C12AC52BFF7; Mon, 1 Feb 2021 14:40:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTrGT4wz3z3kkV; Mon, 1 Feb 2021 14:40:49 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9C4771CB5F; Mon, 1 Feb 2021 14:40:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111Eenct054392; Mon, 1 Feb 2021 14:40:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Eenh4054391; Mon, 1 Feb 2021 14:40:49 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:40:49 GMT Message-Id: <202102011440.111Eenh4054391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 243125c81af5 - main - src.conf(5): regenerate after MK_ZFS change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 243125c81af5a4947a25e5977056c68db0474c42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 14:40:49 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=243125c81af5a4947a25e5977056c68db0474c42 commit 243125c81af5a4947a25e5977056c68db0474c42 Author: Mitchell Horne AuthorDate: 2021-02-01 14:34:11 +0000 Commit: Mitchell Horne CommitDate: 2021-02-01 14:39:55 +0000 src.conf(5): regenerate after MK_ZFS change With e5cc1c474841, this option is also disabled by WITHOUT_OPENSSL and WITHOUT_CRYPT. --- share/man/man5/src.conf.5 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 81656db323ed..3b57c443353d 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -400,6 +400,8 @@ When set, it enforces these options: .Va WITHOUT_SVNLITE .It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: @@ -1290,6 +1292,8 @@ When set, it enforces these options: .Va WITHOUT_SVNLITE .It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: From owner-dev-commits-src-main@freebsd.org Mon Feb 1 14:41:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2283F52C248; Mon, 1 Feb 2021 14:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTrHR0WyGz3l0g; Mon, 1 Feb 2021 14:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 04D311CC79; Mon, 1 Feb 2021 14:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111EfcEd056174; Mon, 1 Feb 2021 14:41:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Efc7G056173; Mon, 1 Feb 2021 14:41:38 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:41:38 GMT Message-Id: <202102011441.111Efc7G056173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: 45ecda8ebf80 - main - stand/amd64: remove unused addr parameter from bi_load64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45ecda8ebf80bb341aa3b4955810518ae6fab158 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 14:41:39 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=45ecda8ebf80bb341aa3b4955810518ae6fab158 commit 45ecda8ebf80bb341aa3b4955810518ae6fab158 Author: Roger Pau Monné AuthorDate: 2021-01-29 11:29:37 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-01 14:41:26 +0000 stand/amd64: remove unused addr parameter from bi_load64 All callers of bi_load64 pass 0 as the addr parameter, so just remove it and always calculate the last load address from the module chain. No functional change. Sponsored by: Citrix Systems R&D Reviewed by: tsoome, imp Differential revision: https://reviews.freebsd.org/D28412 --- stand/i386/libi386/bootinfo64.c | 14 +++++++------- stand/i386/libi386/elf64_freebsd.c | 2 +- stand/i386/libi386/libi386.h | 2 +- stand/i386/libi386/multiboot.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index 9f038f2a4f2b..1ffa4188d926 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -182,7 +182,7 @@ bi_checkcpu(void) * - Module metadata are formatted and placed in kernel space. */ int -bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, +bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, int add_smap) { struct preloaded_file *xp, *kfp; @@ -191,6 +191,7 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, uint64_t kernend; uint64_t envp; uint64_t module; + uint64_t addr; vm_offset_t size; char *rootdevname; int howto; @@ -217,12 +218,11 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, /* Try reading the /etc/fstab file to select the root device */ getrootmount(i386_fmtdev((void *)rootdev)); - if (addr == 0) { - /* find the last module in the chain */ - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } + addr = 0; + /* find the last module in the chain */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + if (addr < (xp->f_addr + xp->f_size)) + addr = xp->f_addr + xp->f_size; } /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); diff --git a/stand/i386/libi386/elf64_freebsd.c b/stand/i386/libi386/elf64_freebsd.c index 6bf884045eea..1108a9e4d713 100644 --- a/stand/i386/libi386/elf64_freebsd.c +++ b/stand/i386/libi386/elf64_freebsd.c @@ -80,7 +80,7 @@ elf64_exec(struct preloaded_file *fp) return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); - err = bi_load64(fp->f_args, 0, &modulep, &kernend, 1); + err = bi_load64(fp->f_args, &modulep, &kernend, 1); if (err != 0) return(err); diff --git a/stand/i386/libi386/libi386.h b/stand/i386/libi386/libi386.h index dbd6565f8d1c..a52a1190e7ec 100644 --- a/stand/i386/libi386/libi386.h +++ b/stand/i386/libi386/libi386.h @@ -151,7 +151,7 @@ void bi_setboothowto(int howto); vm_offset_t bi_copyenv(vm_offset_t addr); int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernend); -int bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, +int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend, int add_smap); void pxe_enable(void *pxeinfo); diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c index 71fd63bb4c88..2d0a4a9b2274 100644 --- a/stand/i386/libi386/multiboot.c +++ b/stand/i386/libi386/multiboot.c @@ -274,7 +274,7 @@ multiboot_exec(struct preloaded_file *fp) bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES); - error = bi_load64(fp->f_args, 0, &modulep, &kernend, 0); + error = bi_load64(fp->f_args, &modulep, &kernend, 0); if (error != 0) { printf("bi_load64 failed: %d\n", error); goto error; From owner-dev-commits-src-main@freebsd.org Mon Feb 1 16:18:00 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C1F9D52ED35; Mon, 1 Feb 2021 16:18:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTtQc5B59z3twn; Mon, 1 Feb 2021 16:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A4C711E14A; Mon, 1 Feb 2021 16:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111GI0io074674; Mon, 1 Feb 2021 16:18:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111GI0bo074673; Mon, 1 Feb 2021 16:18:00 GMT (envelope-from git) Date: Mon, 1 Feb 2021 16:18:00 GMT Message-Id: <202102011618.111GI0bo074673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 38bfc6dee33b - main - iflib: Free resources in a consistent order during detach MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38bfc6dee33bedb290e1ea2540f97a86fe3caee0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 16:18:00 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=38bfc6dee33bedb290e1ea2540f97a86fe3caee0 commit 38bfc6dee33bedb290e1ea2540f97a86fe3caee0 Author: Sai Rajesh Tallamraju AuthorDate: 2021-02-01 16:13:00 +0000 Commit: Mark Johnston CommitDate: 2021-02-01 16:15:54 +0000 iflib: Free resources in a consistent order during detach Memory and PCI resources are freed with no particular order. This could cause use-after-frees when detaching following a failed attach. For instance, iflib_tx_structures_free() frees ctx->ifc_txqs[] but iflib_tqg_detach() attempts to access this array. Similarly, adapter queues gets freed by IFDI_QUEUES_FREE() but IFDI_DETACH() attempts to access adapter queues to free PCI resources. MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D27634 --- sys/dev/e1000/if_em.c | 19 ++++++------------- sys/dev/ixl/if_ixl.c | 2 +- sys/net/iflib.c | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index fb15a3e1f610..b24280dae412 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1102,10 +1102,11 @@ em_if_attach_post(if_ctx_t ctx) struct adapter *adapter = iflib_get_softc(ctx); struct e1000_hw *hw = &adapter->hw; int error = 0; - + /* Setup OS specific network interface */ error = em_setup_interface(ctx); if (error != 0) { + device_printf(adapter->dev, "Interface setup failed: %d\n", error); goto err_late; } @@ -1123,14 +1124,10 @@ em_if_attach_post(if_ctx_t ctx) INIT_DEBUGOUT("em_if_attach_post: end"); - return (error); + return (0); err_late: - em_release_hw_control(adapter); - em_free_pci_resources(ctx); - em_if_queues_free(ctx); - free(adapter->mta, M_DEVBUF); - + /* upon attach_post() error, iflib calls _if_detach() to free resources. */ return (error); } @@ -1155,6 +1152,8 @@ em_if_detach(if_ctx_t ctx) em_release_manageability(adapter); em_release_hw_control(adapter); em_free_pci_resources(ctx); + free(adapter->mta, M_DEVBUF); + adapter->mta = NULL; return (0); } @@ -2981,12 +2980,6 @@ em_if_queues_free(if_ctx_t ctx) free(adapter->rx_queues, M_DEVBUF); adapter->rx_queues = NULL; } - - em_release_hw_control(adapter); - - if (adapter->mta != NULL) { - free(adapter->mta, M_DEVBUF); - } } /********************************************************************* diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 50eb448a1154..097d4b480891 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1253,7 +1253,7 @@ ixl_if_queues_free(if_ctx_t ctx) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; - if (!vsi->enable_head_writeback) { + if (vsi->tx_queues != NULL && !vsi->enable_head_writeback) { struct ixl_tx_queue *que; int i = 0; diff --git a/sys/net/iflib.c b/sys/net/iflib.c index cfc6972bf987..cce56d0e7335 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4900,7 +4900,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct device_printf(dev, "Cannot use iflib with only 1 MSI-X interrupt!\n"); err = ENODEV; - goto fail_intr_free; + goto fail_queues; } ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); @@ -4936,13 +4936,14 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct fail_detach: ether_ifdetach(ctx->ifc_ifp); -fail_intr_free: - iflib_free_intr_mem(ctx); fail_queues: + iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); - iflib_tqg_detach(ctx); IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); +fail_intr_free: + iflib_free_intr_mem(ctx); fail_unlock: CTX_UNLOCK(ctx); iflib_deregister(ctx); @@ -5139,11 +5140,12 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sctx, if_ctx_t *ctxp, fail_detach: ether_ifdetach(ctx->ifc_ifp); fail_queues: + iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); - iflib_tqg_detach(ctx); fail_iflib_detach: IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); fail_unlock: CTX_UNLOCK(ctx); iflib_deregister(ctx); @@ -5173,6 +5175,8 @@ iflib_pseudo_deregister(if_ctx_t ctx) iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); + IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); iflib_deregister(ctx); @@ -5233,8 +5237,12 @@ iflib_device_deregister(if_ctx_t ctx) led_destroy(ctx->ifc_led_dev); iflib_tqg_detach(ctx); + iflib_tx_structures_free(ctx); + iflib_rx_structures_free(ctx); + CTX_LOCK(ctx); IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); CTX_UNLOCK(ctx); /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ @@ -5242,9 +5250,6 @@ iflib_device_deregister(if_ctx_t ctx) bus_generic_detach(dev); - iflib_tx_structures_free(ctx); - iflib_rx_structures_free(ctx); - iflib_deregister(ctx); device_set_softc(ctx->ifc_dev, NULL); @@ -5828,7 +5833,6 @@ iflib_tx_structures_free(if_ctx_t ctx) } free(ctx->ifc_txqs, M_IFLIB); ctx->ifc_txqs = NULL; - IFDI_QUEUES_FREE(ctx); } /********************************************************************* From owner-dev-commits-src-main@freebsd.org Mon Feb 1 17:26:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EA4A95307A1; Mon, 1 Feb 2021 17:26:11 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTvxH64gVz4Sgx; Mon, 1 Feb 2021 17:26:11 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x435.google.com with SMTP id g10so17496666wrx.1; Mon, 01 Feb 2021 09:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=dX8xAAO4C4f7Cya1TWNvn2ZKMoTfiFZLn8fxDBfrGUA=; b=oKsw26hTroXVGbeHBFKU0VDajjuucAFT/K26rl1xTy2SawVjhIqJBcKdLCpYIl1Z7X OZAJh4VvMGiOrY4aEJip/pb8ZUBi30i+IThEOgdsAejXDmLSaMtjPNkfWEcdzzqlCNeH aOt9SmjbrK3nbkL4R5Y7luXxVEIi/GKjhCHBysPj7kVFV8GnIUqzVJyn8MO25EjQWelo VlF8i6KTHCxnwC+MoitmgGCTKPrN8SZzlie7vBjzHyKAyykhxXd8X4F1As7xzuHV4rgL vKaqpTdWYmqyPvy7khcwg9pROuSk8uH59lSW3sg1rxDZ75UpQ6dk5K1dCWmm9bsHyJ9v UpFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=dX8xAAO4C4f7Cya1TWNvn2ZKMoTfiFZLn8fxDBfrGUA=; b=NkX9dG/0nfmlCQ6/pamdXs0nKjlpjLg11m/2hMWB57ZFS2dIzm/aVNGKZ+t1qzvnab WWpWXDNwofwSA3ob1nTOTDD+1GToLteGIQvxoubzbcC9eUpzNsbmLHNU58tYDMUST2+h ainnI+uEIctDGHDSBzMTMueDC+kbwC8W437bOk8y+4scv319jjWBiJXTMLYbfVuSSO4w 1CLRlJLCGUBgkddDfn4UXRl7IaI0dCQ3VjyVpDK8vjS9nXAFgTsK1evQzZMvE9rV27OW xvP9I/pgRNuy4M50YcAOyPlG/xjaBLVx98N1haRiZYr30XSeSSD8jdOXNS/phkZ/5A42 lqJA== X-Gm-Message-State: AOAM533eeyG6Y4EL+xV3RNxKXzaMysVf9Ts7ELs82ukpc4Jw3j4C2CRC nJLL4pM1k149Tt/AhH3FujlbnOJrPdM= X-Google-Smtp-Source: ABdhPJx3UCkT4pMKjnliwJbx8BD0R1w+rOq8SXQlfR/APk/xJmy8LgoEX9Di1lQ088GSONqdOVkpGw== X-Received: by 2002:adf:80c8:: with SMTP id 66mr4546429wrl.344.1612200370152; Mon, 01 Feb 2021 09:26:10 -0800 (PST) Received: from brick (cpc159423-cmbg20-2-0-cust338.5-4.cable.virginm.net. [86.7.147.83]) by smtp.gmail.com with ESMTPSA id o14sm26427984wri.48.2021.02.01.09.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 09:26:08 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 1 Feb 2021 17:26:07 +0000 From: Edward Tomasz Napierala To: Shawn Webb Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5299d64b2b9f - main - libc: fix buffer overrun in getrpcport(3) Message-ID: Mail-Followup-To: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> <20210131215556.eautrr6esynyic6f@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210131215556.eautrr6esynyic6f@mutt-hbsd> X-Rspamd-Queue-Id: 4DTvxH64gVz4Sgx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 17:26:12 -0000 On 0131T1655, Shawn Webb wrote: > On Sun, Jan 31, 2021 at 09:43:41PM +0000, Edward Tomasz Napierala wrote: > > The branch main has been updated by trasz: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=5299d64b2b9f7a25e423ef1785d9402a0ef198d3 > > > > commit 5299d64b2b9f7a25e423ef1785d9402a0ef198d3 > > Author: Edward Tomasz Napierala > > AuthorDate: 2021-01-31 21:41:55 +0000 > > Commit: Edward Tomasz Napierala > > CommitDate: 2021-01-31 21:42:02 +0000 > > > > libc: fix buffer overrun in getrpcport(3) > > > > Reviewed By: markj > > Sponsored by: NetApp, Inc. > > Sponsored by: Klara, Inc. > > Differential Revision: https://reviews.freebsd.org/D27332 > > --- > > lib/libc/rpc/getrpcport.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c > > index 2b2d459c8887..4abc9a0c16af 100644 > > --- a/lib/libc/rpc/getrpcport.c > > +++ b/lib/libc/rpc/getrpcport.c > > @@ -62,14 +62,14 @@ getrpcport(char *host, int prognum, int versnum, int proto) > > > > assert(host != NULL); > > > > - if ((hp = gethostbyname(host)) == NULL) > > + if ((hp = gethostbyname2(host, AF_INET)) == NULL) > > return (0); > > memset(&addr, 0, sizeof(addr)); > > addr.sin_len = sizeof(struct sockaddr_in); > > addr.sin_family = AF_INET; > > addr.sin_port = 0; > > - if (hp->h_length > addr.sin_len) > > - hp->h_length = addr.sin_len; > > + if (hp->h_length > sizeof(addr.sin_addr.s_addr)) > > + hp->h_length = sizeof(addr.sin_addr.s_addr); > > memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length); > > /* Inconsistent interfaces need casts! :-( */ > > return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum, > > Does a fix like this need to get a security advisory report? Also, any > plans to MFC? Sorry, I should have used a better commit message... I don't think this is exploitable, or even triggerable - from my understanding, the gethostbyname(3) function cannot return non-AF_INET address, unless some internal resolver option has been set, which none of the programs using getrpcport(3) seems to do. From owner-dev-commits-src-main@freebsd.org Mon Feb 1 17:27:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8C5A6530466; Mon, 1 Feb 2021 17:27:55 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTvzG6HKmz4SrR; Mon, 1 Feb 2021 17:27:54 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id m13so17499614wro.12; Mon, 01 Feb 2021 09:27:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=a/hKBx7VpQ8WKvvQJF6IUVudGnZL0JRH+0qxeH8zRgU=; b=oPbX73pPNmPqcqZJlvyxpZF9ucD3m2x6npGBCDewqw81Tfmf8AxNOdIxqZn1RRh4BO 08tg8iO16KWRYjvNX1XoqKNYfJjZ9aGoEWPc47hbPKFyS1ScZ+2YQ+9E+z7FOaQzv1/E 5QmMAsO1FaoVl86FNY1n28pniKrn7aQEIqeusDOE0g7FncNKHUNE2+wjlTRMDC/uPQSc PltZPxahHGnjOPCuc3cSw8QqRM07c+GyaK7Sw3veaBUWaJLWZZC+3L+ZmA+QbwMENNBl gP3OiFQCtDYpQhT3ECYS9GssZ7j2/invWp9Nv9hfJrg321sQbxGOGh6FG8Dc+rCx2jVf ISFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=a/hKBx7VpQ8WKvvQJF6IUVudGnZL0JRH+0qxeH8zRgU=; b=AMzm3PaLt+MsvDX+F8Cd28rb2oIwYRqdC7cKZ10tb6/ZucYkeZ+5hF/9CNQ7D2wjT6 8DDF1ry/PrEEJPC4tj6cA6+vCf+IomJ8Ro2sa1WBcz2bFqlKE7FeiwWFgNZYEjgjeD4Q a275U+JjDNXhIxME49VAEltce3md8mUyXRW35S5mRI8zbLRNTas458Sfp9XutHag8H0v p1UhbOwkrHKKQ3l/y8Vp7w5k2QvWtT0s6eGHBp6Y4mKTrJC1IoNLwwIi+q1+OFCkCMv5 K7mudpBnDfNqh81e4VikBcr4PoAp5rE4ugsEZJ6lpitrSG1PKeLXy9thUi5kAmXgAjTa qEng== X-Gm-Message-State: AOAM532vHWdJ/yeTFdScME3V2vtP7ygQ4fbVFJsl4jUYdMVSVCxvGcHf bCcyQjOauh0DF5ntFmTTEqQFXH5Fbcs= X-Google-Smtp-Source: ABdhPJwku5CqSiO8XekEkN6Epcxc3JAa0MlwaUVldYgLNJpdlgm3hBh8Tr9Y0293IK0Tw+cehninxw== X-Received: by 2002:adf:e9cf:: with SMTP id l15mr19101717wrn.317.1612200473370; Mon, 01 Feb 2021 09:27:53 -0800 (PST) Received: from brick (cpc159423-cmbg20-2-0-cust338.5-4.cable.virginm.net. [86.7.147.83]) by smtp.gmail.com with ESMTPSA id h14sm8966540wmq.39.2021.02.01.09.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 09:27:52 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 1 Feb 2021 17:27:50 +0000 From: Edward Tomasz Napierala To: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5299d64b2b9f - main - libc: fix buffer overrun in getrpcport(3) Message-ID: Mail-Followup-To: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> <20210131215556.eautrr6esynyic6f@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DTvzG6HKmz4SrR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=oPbX73pP; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 2a00:1450:4864:20::42a as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[86.7.147.83:received]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::42a:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::42a:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::42a:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 17:27:55 -0000 On 0201T1726, Edward Tomasz Napierala wrote: > On 0131T1655, Shawn Webb wrote: > > On Sun, Jan 31, 2021 at 09:43:41PM +0000, Edward Tomasz Napierala wrote: [..] > > Does a fix like this need to get a security advisory report? Also, any > > plans to MFC? > > Sorry, I should have used a better commit message... I don't think > this is exploitable, or even triggerable - from my understanding, the > gethostbyname(3) function cannot return non-AF_INET address, unless > some internal resolver option has been set, which none of the programs > using getrpcport(3) seems to do. Oh, and yes, MFC is planned; I'm not sure what's the current way to mark commits to get an MFC reminder. From owner-dev-commits-src-main@freebsd.org Mon Feb 1 19:47:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 51F60534F91; Mon, 1 Feb 2021 19:47:43 +0000 (UTC) (envelope-from kp@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTz4Y515bz4q4D; Mon, 1 Feb 2021 19:47:40 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id C76E6215B1; Mon, 1 Feb 2021 19:47:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 1323233102; Mon, 1 Feb 2021 20:47:38 +0100 (CET) From: "Kristof Provost" To: "Edward Tomasz Napierala" Cc: "Shawn Webb" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5299d64b2b9f - main - libc: fix buffer overrun in getrpcport(3) Date: Mon, 01 Feb 2021 20:47:37 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: <300465C7-7F6C-446E-A35A-63DB0B6D9EA5@FreeBSD.org> In-Reply-To: References: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> <20210131215556.eautrr6esynyic6f@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 19:47:45 -0000 On 1 Feb 2021, at 18:27, Edward Tomasz Napierala wrote: > I'm not sure what's the current way to mark commits to get an MFC > reminder. > The old ways work just fine. Just set ‘MFC after: xxx’ and theMFC Notification Service will do its thing as usual. Best regards, Kristof From owner-dev-commits-src-main@freebsd.org Mon Feb 1 20:26:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 26BAE535B52; Mon, 1 Feb 2021 20:26:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTzwq6HfCz4tMr; Mon, 1 Feb 2021 20:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 CA26B2185A; Mon, 1 Feb 2021 20:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111KQ3Yq001097; Mon, 1 Feb 2021 20:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111KQ3Ce001096; Mon, 1 Feb 2021 20:26:03 GMT (envelope-from git) Date: Mon, 1 Feb 2021 20:26:03 GMT Message-Id: <202102012026.111KQ3Ce001096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 682c31db4ecf - main - ipfw(8) crashes when ext6hdr option is omitted MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 20:26:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1 commit 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1 Author: Evgeniy Khramtsov <2khramtsov@gmail.com> AuthorDate: 2021-02-01 19:03:57 +0000 Commit: Kristof Provost CommitDate: 2021-02-01 20:25:11 +0000 ipfw(8) crashes when ext6hdr option is omitted Verify that the option is passed, error out if it's not. The problem can be trivially triggered with `ipfw add allow ext6hdr`. PR: 253169 Reviewed by: kp@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28447 --- sbin/ipfw/ipfw2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 67303d8bb1e7..19f7f331091d 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4961,6 +4961,7 @@ read_options: break; case TOK_EXT6HDR: + NEED1("missing extension header"); fill_ext6hdr( cmd, *av ); av++; break; From owner-dev-commits-src-main@freebsd.org Mon Feb 1 21:14:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 78610537286; Mon, 1 Feb 2021 21:14:29 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV10j2yz7z3Dkl; Mon, 1 Feb 2021 21:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 58A6F22600; Mon, 1 Feb 2021 21:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111LET2F065660; Mon, 1 Feb 2021 21:14:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111LETDG065659; Mon, 1 Feb 2021 21:14:29 GMT (envelope-from git) Date: Mon, 1 Feb 2021 21:14:29 GMT Message-Id: <202102012114.111LETDG065659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: bcaa6aa15383 - main - config: Fix typo in comment. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcaa6aa15383cacf5f20179be919bb8dd45cc5f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 21:14:29 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bcaa6aa15383cacf5f20179be919bb8dd45cc5f4 commit bcaa6aa15383cacf5f20179be919bb8dd45cc5f4 Author: John Baldwin AuthorDate: 2021-02-01 21:13:36 +0000 Commit: John Baldwin CommitDate: 2021-02-01 21:13:36 +0000 config: Fix typo in comment. --- usr.sbin/config/mkheaders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c index 62f81553bb5c..5dfde12c1db8 100644 --- a/usr.sbin/config/mkheaders.c +++ b/usr.sbin/config/mkheaders.c @@ -38,7 +38,7 @@ static const char rcsid[] = #endif /* not lint */ /* - * This used to generate a bunch of hearders files related to devices when + * This used to generate a bunch of headers files related to devices when * device counters were supported. Support for that was removed in 2005. * Since then, all we've done is to report unknown devices in this file. * It's kept its historical name, despite no longer generating headers. From owner-dev-commits-src-main@freebsd.org Mon Feb 1 21:21:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8D35E53704A; Mon, 1 Feb 2021 21:21:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV19H3fqQz3FDQ; Mon, 1 Feb 2021 21:21:55 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7070F2256A; Mon, 1 Feb 2021 21:21:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111LLths077292; Mon, 1 Feb 2021 21:21:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111LLt8l077291; Mon, 1 Feb 2021 21:21:55 GMT (envelope-from git) Date: Mon, 1 Feb 2021 21:21:55 GMT Message-Id: <202102012121.111LLt8l077291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 8fb966790e1c - main - zfs: update zfs_config.h to match OpenZFS gf11b09dec MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fb966790e1c87276cc26932efee1b29c046cb8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 21:21:55 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=8fb966790e1c87276cc26932efee1b29c046cb8a commit 8fb966790e1c87276cc26932efee1b29c046cb8a Author: Martin Matuska AuthorDate: 2021-02-01 21:08:19 +0000 Commit: Martin Matuska CommitDate: 2021-02-01 21:21:33 +0000 zfs: update zfs_config.h to match OpenZFS gf11b09dec Update zfs_config.h to match latest merge in FreeBSD The version string is declared as 2.0.0-FreeBSD_gf11b09dec to provide more information about the loaded module: - the OpenZFS version in base is 2.0 - we are using the in tree-module ("FreeBSD") - the last merged OpenZFS git revision ("gf11b09dec") With future merges the git revision tag should be updated. As we are merging from OpenZFS master branch and already include features like dRAID, referencing patchlevel releases (2.0.1, 2.0.2) is pointless. Reviewed by: freqlabs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28447 --- sys/modules/zfs/zfs_config.h | 131 ++++++++++++++++++++++++++++++++----------- 1 file changed, 97 insertions(+), 34 deletions(-) diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h index 6d73d1b8a341..358ecb609a05 100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@ -21,9 +21,6 @@ /* bdi_setup_and_register() wants 2 args */ /* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ -/* lookup_bdev() wants 2 args */ -/* #undef HAVE_2ARGS_LOOKUP_BDEV */ - /* vfs_getattr wants 2 args */ /* #undef HAVE_2ARGS_VFS_GETATTR */ @@ -85,6 +82,12 @@ #define HAVE_AVX512VL 1 #endif +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + /* bio->bi_opf is defined */ /* #undef HAVE_BIO_BI_OPF */ @@ -94,6 +97,9 @@ /* bio has bi_iter */ /* #undef HAVE_BIO_BVEC_ITER */ +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + /* bio_set_dev() is available */ /* #undef HAVE_BIO_SET_DEV */ @@ -115,6 +121,9 @@ /* blk_alloc_queue() expects request function */ /* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + /* blk queue backing_dev_info is dynamic */ /* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ @@ -154,12 +163,24 @@ the CoreFoundation framework. */ /* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + /* clear_inode() is available */ /* #undef HAVE_CLEAR_INODE */ /* dentry uses const struct dentry_operations */ /* #undef HAVE_CONST_DENTRY_OPERATIONS */ +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + /* current_time() exists */ /* #undef HAVE_CURRENT_TIME */ @@ -170,6 +191,9 @@ /* DECLARE_EVENT_CLASS() is available */ /* #undef HAVE_DECLARE_EVENT_CLASS */ +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + /* sops->dirty_inode() wants flags */ /* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ @@ -212,10 +236,10 @@ /* fops->fsync() without dentry */ /* #undef HAVE_FSYNC_WITHOUT_DENTRY */ -/* generic_start_io_acct()/generic_end_io_acct() available */ +/* generic_*_io_acct() 3 arg available */ /* #undef HAVE_GENERIC_IO_ACCT_3ARG */ -/* generic_start_io_acct()/generic_end_io_acct() 4 arg available */ +/* generic_*_io_acct() 4 arg available */ /* #undef HAVE_GENERIC_IO_ACCT_4ARG */ /* generic_readlink is global */ @@ -230,9 +254,6 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ /* #undef HAVE_GETTEXT */ -/* get_disk_and_module() is available */ -/* #undef HAVE_GET_DISK_AND_MODULE */ - /* iops->get_link() cookie */ /* #undef HAVE_GET_LINK_COOKIE */ @@ -242,6 +263,9 @@ /* group_info->gid exists */ /* #undef HAVE_GROUP_INFO_GID */ +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + /* Define if you have the iconv() function and it works. */ #define HAVE_ICONV 1 @@ -266,6 +290,27 @@ /* in_compat_syscall() is available */ /* #undef HAVE_IN_COMPAT_SYSCALL */ +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT_LEGACY */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + /* yes */ /* #undef HAVE_IO_SCHEDULE_TIMEOUT */ @@ -287,6 +332,9 @@ /* kernel does stack verification */ /* #undef HAVE_KERNEL_OBJTOOL */ +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + /* kernel_read() take loff_t pointer */ /* #undef HAVE_KERNEL_READ_PPOS */ @@ -320,25 +368,22 @@ /* kernel has large stacks */ /* #undef HAVE_LARGE_STACKS */ -/* Define if you have libaio */ +/* Define if you have [aio] */ /* #undef HAVE_LIBAIO */ -/* Define if you have libblkid */ +/* Define if you have [blkid] */ /* #undef HAVE_LIBBLKID */ -/* Define if you have libssl */ -#define HAVE_LIBSSL 1 +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 -/* Define to 1 if you have the `tirpc' library (-ltirpc). */ +/* Define if you have [tirpc] */ /* #undef HAVE_LIBTIRPC */ -/* Define if you have libudev */ +/* Define if you have [udev] */ /* #undef HAVE_LIBUDEV */ -/* Define if udev_device_get_is_initialized is available */ -/* #undef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED */ - -/* Define if you have libuuid */ +/* Define if you have [uuid] */ /* #undef HAVE_LIBUUID */ /* lseek_execute() is available */ @@ -365,6 +410,9 @@ /* Define to 1 if you have the `mlockall' function. */ #define HAVE_MLOCKALL 1 +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + /* Define if host toolchain supports MOVBE */ #define HAVE_MOVBE 1 @@ -377,6 +425,9 @@ /* Define if host toolchain supports PCLMULQDQ */ #define HAVE_PCLMULQDQ 1 +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + /* posix_acl_chmod() exists */ /* #undef HAVE_POSIX_ACL_CHMOD */ @@ -431,6 +482,12 @@ /* REQ_PREFLUSH is defined */ /* #undef HAVE_REQ_PREFLUSH */ +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + /* struct rw_semaphore has member activity */ /* #undef HAVE_RWSEM_ACTIVITY */ @@ -440,6 +497,9 @@ /* linux/sched/signal.h exists */ /* #undef HAVE_SCHED_SIGNAL_HEADER */ +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + /* setattr_prepare() is available */ /* #undef HAVE_SETATTR_PREPARE */ @@ -499,6 +559,9 @@ /* Define to 1 if you have the `strlcpy' function. */ #define HAVE_STRLCPY 1 +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + /* super_setup_bdi_name() exits */ /* #undef HAVE_SUPER_SETUP_BDI_NAME */ @@ -520,6 +583,9 @@ /* kernel has totalram_pages() */ /* #undef HAVE_TOTALRAM_PAGES_FUNC */ +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + /* kernel has __kernel_fpu_* functions */ /* #undef HAVE_UNDERSCORE_KERNEL_FPU */ @@ -541,6 +607,9 @@ /* aops->direct_IO() uses iov_iter with rw and offset */ /* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + /* fops->iterate() is available */ /* #undef HAVE_VFS_ITERATE */ @@ -595,15 +664,12 @@ /* xattr_handler->set() wants xattr_handler */ /* #undef HAVE_XATTR_SET_HANDLER */ -/* Define if you have zlib */ +/* Define if you have [z] */ #define HAVE_ZLIB 1 /* __posix_acl_chmod() exists */ /* #undef HAVE___POSIX_ACL_CHMOD */ -/* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST - /* kernel exports FPU functions */ /* #undef KERNEL_EXPORTS_X86_FPU */ @@ -635,7 +701,7 @@ /* #undef SYSTEM_LINUX */ /* zfs debugging enabled */ -/* #define ZFS_DEBUG 1 */ +/* #undef ZFS_DEBUG */ /* /dev/zfs minor */ /* #undef ZFS_DEVICE_MINOR */ @@ -649,9 +715,6 @@ /* enum node_stat_item contains NR_INACTIVE_FILE */ /* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ -/* enum node_stat_item contains NR_SLAB_RECLAIMABLE */ -/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE */ - /* enum zone_stat_item contains NR_FILE_PAGES */ /* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ @@ -661,9 +724,6 @@ /* enum zone_stat_item contains NR_INACTIVE_FILE */ /* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ -/* enum zone_stat_item contains NR_SLAB_RECLAIMABLE */ -/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_SLAB_RECLAIMABLE */ - /* global_node_page_state() exists */ /* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ @@ -674,16 +734,16 @@ /* #undef ZFS_IS_GPL_COMPATIBLE */ /* Define the project alias string. */ -#define ZFS_META_ALIAS "zfs-0.8.0-1" +#define ZFS_META_ALIAS "zfs-2.0.0-FreeBSD_gf11b09dec" /* Define the project author. */ -#define ZFS_META_AUTHOR "OpenZFS on Linux" +#define ZFS_META_AUTHOR "OpenZFS" /* Define the project release date. */ /* #undef ZFS_META_DATA */ /* Define the maximum compatible kernel version. */ -#define ZFS_META_KVER_MAX "5.6" +#define ZFS_META_KVER_MAX "5.10" /* Define the minimum compatible kernel version. */ #define ZFS_META_KVER_MIN "3.10" @@ -704,8 +764,11 @@ #define ZFS_META_NAME "zfs" /* Define the project release. */ -#define ZFS_META_RELEASE "1" +#define ZFS_META_RELEASE "FreeBSD_gf11b09dec" /* Define the project version. */ -#define ZFS_META_VERSION "0.8.0" +#define ZFS_META_VERSION "2.0.0" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ From owner-dev-commits-src-main@freebsd.org Mon Feb 1 21:33:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 014AC537DF7 for ; Mon, 1 Feb 2021 21:33:33 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV1Qh6VQ3z3G18 for ; Mon, 1 Feb 2021 21:33:32 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb35.google.com with SMTP id e67so18315431ybc.12 for ; Mon, 01 Feb 2021 13:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LNFgxSz5EKYvwmBybfKVqKzZLo7JJDZ13SuqmxGjHmI=; b=MYrVVdrrIqLevP+gEcU2gleqZWT1JrFsyhe1wMOZg2Zrd3cnw0b5DW5Na1nd8QswWy PEid3UGjGAmtay6mkj8qcHt3Oi19wv7u4axEM8EAPStxlN+IHxqNilew+9ANOu1Q8FbD K3QWNqvbwWFOCzSANN/8ssP4gM1kpkHO3QBpU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LNFgxSz5EKYvwmBybfKVqKzZLo7JJDZ13SuqmxGjHmI=; b=i7Alp4mTjc7VHcz1NgvsM497NzjAnJs2V8hh5ng28P7V06suJIOt8pGWN53KBj0DEn E8sxrCtINxR+oJ5t8ccimC3KDZR9wmLLQ8trzju78EuCdx7xwgpRDxgxB9Bt3RB3oz7n 31QNl88UiZhc3igHX/Fmj/w3up5hyue3Pk1yDImAOF4F8D+VcBZG4jN6tpku6AmUI8tM 86GVI6spIf3UaqAhkss8+x26UhWN1yWhDcUePK8n+RvkFKSvji3tWiTribuudCD43tLR vrDgpSlBMLGi8utvcb9JrscKJ0+RJA4hUCFP5h+1nTDmcdoJj6qQICrkxnaUFYXCqVIt wcUA== X-Gm-Message-State: AOAM530FgaonPO2GxbNNQ4DPHhEahG3VkYUR/VZeknD7nlPWoMqVGMu6 EqnB8hzbXGHtCQdJ4gZrGfMgjttebdWS0qe8Egtw98V2eJ4ygA== X-Google-Smtp-Source: ABdhPJwFVxxaFFmNfNqRLJK0NdAM17WN2/C9eId2VzgataFp4+ObWAQHDQKpnLX0q16eX9VyDHXTmVdE+nyuefu6S9w= X-Received: by 2002:a25:8083:: with SMTP id n3mr19995392ybk.330.1612215211707; Mon, 01 Feb 2021 13:33:31 -0800 (PST) MIME-Version: 1.0 References: <202102012121.111LLt8l077291@gitrepo.freebsd.org> In-Reply-To: <202102012121.111LLt8l077291@gitrepo.freebsd.org> From: Kevin Bowling Date: Mon, 1 Feb 2021 14:33:21 -0700 Message-ID: Subject: Re: git: 8fb966790e1c - main - zfs: update zfs_config.h to match OpenZFS gf11b09dec To: Martin Matuska Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DV1Qh6VQ3z3G18 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 21:33:33 -0000 On Mon, Feb 1, 2021 at 2:21 PM Martin Matuska wrote: > > The branch main has been updated by mm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8fb966790e1c87276cc26932efee1b29c046cb8a > > commit 8fb966790e1c87276cc26932efee1b29c046cb8a > Author: Martin Matuska > AuthorDate: 2021-02-01 21:08:19 +0000 > Commit: Martin Matuska > CommitDate: 2021-02-01 21:21:33 +0000 > > zfs: update zfs_config.h to match OpenZFS gf11b09dec > > Update zfs_config.h to match latest merge in FreeBSD > > The version string is declared as 2.0.0-FreeBSD_gf11b09dec to provide > more information about the loaded module: > - the OpenZFS version in base is 2.0 > - we are using the in tree-module ("FreeBSD") > - the last merged OpenZFS git revision ("gf11b09dec") > > With future merges the git revision tag should be updated. > As we are merging from OpenZFS master branch and already include features > like dRAID, referencing patchlevel releases (2.0.1, 2.0.2) is pointless. I'm not sure this statement wrt patchlevel will remain accurate, at least intentionally. The intent is 13.x will follow OpenZFS 2.1, which will begin the release process "Soon". From owner-dev-commits-src-main@freebsd.org Mon Feb 1 22:34:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D3D8D4E9E84; Mon, 1 Feb 2021 22:34:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV2n75dwMz3Lt5; Mon, 1 Feb 2021 22:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B0195234DF; Mon, 1 Feb 2021 22:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111MYZg0070811; Mon, 1 Feb 2021 22:34:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111MYZ2A070810; Mon, 1 Feb 2021 22:34:35 GMT (envelope-from git) Date: Mon, 1 Feb 2021 22:34:35 GMT Message-Id: <202102012234.111MYZ2A070810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 1912d2b15e6d - main - vt: parse_font_info_static should set refcount, not parse_font_info MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 22:34:35 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd commit 1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd Author: Toomas Soome AuthorDate: 2021-01-31 21:04:59 +0000 Commit: Toomas Soome CommitDate: 2021-02-01 22:33:58 +0000 vt: parse_font_info_static should set refcount, not parse_font_info As we get started with no memory allocator, we set up static font data for font passed by loader (if there is any). At this time, we also must set refcount 1, and refcount will get incremented in cnprobe() callback. At some point the memory allocator will be available, and we will set up properly allocated font data, but we should not disturb the refcount. PR: 253147 --- sys/dev/vt/vt_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index ac89d8635e78..05c383829f49 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1487,6 +1487,8 @@ parse_font_info_static(struct font_info *fi) vfp = &vt_font_loader; vfp->vf_height = fi->fi_height; vfp->vf_width = fi->fi_width; + /* This is default font, set refcount 1 to disable removal. */ + vfp->vf_refcount = 1; for (unsigned i = 0; i < VFNT_MAPS; i++) { if (fi->fi_map_count[i] == 0) continue; @@ -1499,6 +1501,12 @@ parse_font_info_static(struct font_info *fi) return (vfp); } +/* + * Set up default font with allocated data structures. + * However, we can not set refcount here, because it is already set and + * incremented in vtterm_cnprobe() to avoid being released by font load from + * userland. + */ static struct vt_font * parse_font_info(struct font_info *fi) { @@ -1528,8 +1536,6 @@ parse_font_info(struct font_info *fi) ptr = roundup2(ptr, 8); vfp = &vt_font_loader; - /* This is default font, set refcount 1 to disable removal. */ - vfp->vf_refcount = 1; vfp->vf_height = fi->fi_height; vfp->vf_width = fi->fi_width; for (unsigned i = 0; i < VFNT_MAPS; i++) { From owner-dev-commits-src-main@freebsd.org Tue Feb 2 00:28:51 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D23384ED525; Tue, 2 Feb 2021 00:28:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV5Jz5NrDz3j8m; Tue, 2 Feb 2021 00:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 ABBFA24C10; Tue, 2 Feb 2021 00:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1120SpnB014479; Tue, 2 Feb 2021 00:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1120Spr5014478; Tue, 2 Feb 2021 00:28:51 GMT (envelope-from git) Date: Tue, 2 Feb 2021 00:28:51 GMT Message-Id: <202102020028.1120Spr5014478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chuck Silvers Subject: git: 7787e7eed9d2 - main - tail: fix "tail -F" file rotation detection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7787e7eed9d2a43fb6eb66666040f1b495995a2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 00:28:51 -0000 The branch main has been updated by chs: URL: https://cgit.FreeBSD.org/src/commit/?id=7787e7eed9d2a43fb6eb66666040f1b495995a2f commit 7787e7eed9d2a43fb6eb66666040f1b495995a2f Author: Chuck Silvers AuthorDate: 2021-02-02 00:21:14 +0000 Commit: Chuck Silvers CommitDate: 2021-02-02 00:21:14 +0000 tail: fix "tail -F" file rotation detection When checking if the newly opened file is the same as the old one, we need to fstat() the new file descriptor, not the old one again. Reviewed by: glebius Sponsored by: Netflix --- usr.bin/tail/forward.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 2888bd18816e..878cb5a4550b 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -367,7 +367,7 @@ follow(file_info_t *files, enum STYLE style, off_t off) continue; ftmp = fileargs_fopen(fa, file->file_name, "r"); if (ftmp == NULL || - fstat(fileno(file->fp), &sb2) == -1) { + fstat(fileno(ftmp), &sb2) == -1) { if (errno != ENOENT) ierr(file->file_name); show(file); From owner-dev-commits-src-main@freebsd.org Tue Feb 2 00:36:25 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E4D844ED9ED; Tue, 2 Feb 2021 00:36:25 +0000 (UTC) (envelope-from jhb@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV5Tj67gNz3jnY; Tue, 2 Feb 2021 00:36:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:18c1:8fb3:c83d:4682]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 49F5E23810; Tue, 2 Feb 2021 00:36:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: aa906e2a4957 - main - OpenSSL: Support for kernel TLS offload (KTLS) To: Guido Falsi , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101281825.10SIPTGJ021104@gitrepo.freebsd.org> <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> From: John Baldwin Message-ID: <07c2a98a-e6cc-5241-c75e-9a635d282e18@FreeBSD.org> Date: Mon, 1 Feb 2021 16:36:24 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 00:36:26 -0000 On 1/31/21 10:41 AM, Guido Falsi wrote: > On 28/01/21 19:25, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> >> commit aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> Author: John Baldwin >> AuthorDate: 2021-01-16 00:17:31 +0000 >> Commit: John Baldwin >> CommitDate: 2021-01-28 18:24:13 +0000 >> >> OpenSSL: Support for kernel TLS offload (KTLS) >> >> This merges upstream patches from OpenSSL's master branch to add >> KTLS infrastructure for TLS 1.0-1.3 including both RX and TX >> offload and SSL_sendfile support on both Linux and FreeBSD. >> >> Note that TLS 1.3 only supports TX offload. >> >> A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with >> KTLS support. It defaults to enabled on amd64 and disabled on all >> other architectures. >> >> Reviewed by: jkim (earlier version) >> Approved by: secteam >> Obtained from: OpenSSL (patches from master) >> MFC after: 1 week >> Relnotes: yes >> Sponsored by: Netflix >> Differential Revision: https://reviews.freebsd.org/D28273 >> --- > > This commit causes a strange interaction/regression with subverison > client when using https protocol. > > I filed a bug report about this: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253135 > > Workarounds: > > - Compiling system defining WITHOUT_OPENSSL_KTLS > - using the svn:// scheme Hmm, that is certainly odd. I did reproduce it locally and it wasn't even trying to use KTLS (didn't invoke the socket option in the ktrace I had). I will work on debugging this more tomorrow. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Tue Feb 2 01:15:54 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E0A9C4F876F; Tue, 2 Feb 2021 01:15: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV6MG5x4yz3nLK; Tue, 2 Feb 2021 01:15:54 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BE8F1254C3; Tue, 2 Feb 2021 01:15:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1121FsYQ078895; Tue, 2 Feb 2021 01:15:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121Fs8g078894; Tue, 2 Feb 2021 01:15:54 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:15:54 GMT Message-Id: <202102020115.1121Fs8g078894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0b7f1af804f0 - main - Bump shared library versions after ncurses bump in 13. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b7f1af804f06a285717b490bef80e24648adcbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 01:15:54 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0b7f1af804f06a285717b490bef80e24648adcbe commit 0b7f1af804f06a285717b490bef80e24648adcbe Author: John Baldwin AuthorDate: 2021-02-02 01:09:33 +0000 Commit: John Baldwin CommitDate: 2021-02-02 01:11:49 +0000 Bump shared library versions after ncurses bump in 13. A few shared libraries in the base system link against ncurses. An upgrade from a 12.x host to 13 results in ABI breakage for existing binaries since the newer versions of these libraries link against the newer ncurses while the binary itself links against the older ncurses. For example, dialog4ports built on 12.x sometimes crashes on 13 since it depends on libdialog which links against ncurses internally. MFC after: 3 days Reviewed by: kib, delphij Differential Revision: https://reviews.freebsd.org/D28448 --- ObsoleteFiles.inc | 11 +++++++++++ gnu/lib/libdialog/Makefile | 2 +- lib/libdpv/Makefile | 2 +- lib/libedit/Makefile | 2 +- lib/ncurses/form/Makefile | 1 + lib/ncurses/menu/Makefile | 1 + lib/ncurses/panel/Makefile | 1 + 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 29cf25e152e6..696243470b14 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20210201: bump shared libraries which link against ncurses +OLD_LIBS+=lib/libedit.so.7 +OLD_LIBS+=usr/lib/libdialog.so.8 +OLD_LIBS+=usr/lib/libdpv.so.1 +OLD_LIBS+=usr/lib/libform.so.5 +OLD_LIBS+=usr/lib/libformw.so.5 +OLD_LIBS+=usr/lib/libmenu.so.5 +OLD_LIBS+=usr/lib/libmenuw.so.5 +OLD_LIBS+=usr/lib/libpanel.so.5 +OLD_LIBS+=usr/lib/libpanelw.so.5 + # 20210125: ndis driver support removed OLD_FILES+=usr/sbin/ndiscvt OLD_FILES+=usr/sbin/ndisgen diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile index 69d8dbd3fdb8..e4f1b62121d9 100644 --- a/gnu/lib/libdialog/Makefile +++ b/gnu/lib/libdialog/Makefile @@ -3,7 +3,7 @@ DIALOG= ${SRCTOP}/contrib/dialog LIB= dialog -SHLIB_MAJOR= 8 +SHLIB_MAJOR= 9 SRCS= argv.c arrows.c buildlist.c buttons.c calendar.c checklist.c \ columns.c dlg_keys.c editbox.c fselect.c formbox.c guage.c \ help.c inputbox.c inputstr.c menubox.c mixedform.c \ diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile index d2334ee38186..be28debc70bc 100644 --- a/lib/libdpv/Makefile +++ b/lib/libdpv/Makefile @@ -2,7 +2,7 @@ PACKAGE= dpv LIB= dpv -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index f1dbad42db22..963063ef90fa 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -7,7 +7,7 @@ PACKAGE=clibs EDITDIR= ${SRCTOP}/contrib/libedit .PATH: ${EDITDIR} -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 SHLIBDIR?= /lib WARNS?= 3 diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile index a8e636d6ce1b..a6b186936dc5 100644 --- a/lib/ncurses/form/Makefile +++ b/lib/ncurses/form/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/form LIB= formw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/menu/Makefile b/lib/ncurses/menu/Makefile index 7844cd4d936c..9bd92723fed9 100644 --- a/lib/ncurses/menu/Makefile +++ b/lib/ncurses/menu/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/menu LIB= menuw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile index a22df4d89570..9dd950496b1b 100644 --- a/lib/ncurses/panel/Makefile +++ b/lib/ncurses/panel/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/panel LIB= panelw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ From owner-dev-commits-src-main@freebsd.org Tue Feb 2 01:19:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7CF9F4F8C2E; Tue, 2 Feb 2021 01:19:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV6RD320zz3nZM; Tue, 2 Feb 2021 01:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5A30D25435; Tue, 2 Feb 2021 01:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1121JKJR079523; Tue, 2 Feb 2021 01:19:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121JKr0079522; Tue, 2 Feb 2021 01:19:20 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:19:20 GMT Message-Id: <202102020119.1121JKr0079522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 4cd1807c7d2a - main - Retire the K&R/STD C __P prototype declarations. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4cd1807c7d2a67b633dd0c0bfde15091543a2514 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 01:19:20 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4cd1807c7d2a67b633dd0c0bfde15091543a2514 commit 4cd1807c7d2a67b633dd0c0bfde15091543a2514 Author: Cy Schubert AuthorDate: 2021-01-26 06:24:28 +0000 Commit: Cy Schubert CommitDate: 2021-02-02 01:19:15 +0000 Retire the K&R/STD C __P prototype declarations. In the old days when K&R C and STD C were each in use a workaround (read hack) was required to allow the same code to work on each without modification. All C compilers support STD C. We can finally put the __P prototype to rest. MFC after: 1 week --- contrib/ipfilter/bpf_filter.c | 4 +- contrib/ipfilter/ip_dstlist.c | 70 ++--- contrib/ipfilter/ip_dstlist.h | 4 +- contrib/ipfilter/ip_fil.c | 12 +- contrib/ipfilter/ip_fil_compat.c | 122 ++++---- contrib/ipfilter/ip_msnrpc_pxy.c | 12 +- contrib/ipfilter/ipf.h | 340 ++++++++++----------- contrib/ipfilter/iplang/iplang.h | 2 +- contrib/ipfilter/iplang/iplang_l.l | 16 +- contrib/ipfilter/iplang/iplang_y.y | 162 +++++----- contrib/ipfilter/ipmon.h | 14 +- contrib/ipfilter/ipsend/ipresend.c | 4 +- contrib/ipfilter/ipsend/ipsend.c | 8 +- contrib/ipfilter/ipsend/ipsend.h | 52 ++-- contrib/ipfilter/ipsend/iptest.c | 4 +- contrib/ipfilter/ipsend/resend.c | 2 +- contrib/ipfilter/ipsend/sock.c | 4 +- contrib/ipfilter/ipt.h | 6 +- contrib/ipfilter/kmem.h | 6 +- contrib/ipfilter/lib/facpri.h | 8 +- contrib/ipfilter/lib/inet_addr.c | 2 +- contrib/ipfilter/lib/initparse.c | 2 +- contrib/ipfilter/lib/interror.c | 2 +- contrib/ipfilter/lib/ipft_hx.c | 8 +- contrib/ipfilter/lib/ipft_pc.c | 10 +- contrib/ipfilter/lib/ipft_tx.c | 12 +- contrib/ipfilter/lib/kmem.h | 6 +- contrib/ipfilter/lib/printipfexpr.c | 8 +- contrib/ipfilter/lib/save_execute.c | 8 +- contrib/ipfilter/lib/save_file.c | 12 +- contrib/ipfilter/lib/save_nothing.c | 6 +- contrib/ipfilter/lib/save_syslog.c | 8 +- contrib/ipfilter/lib/save_v1trap.c | 20 +- contrib/ipfilter/lib/save_v2trap.c | 24 +- contrib/ipfilter/lib/var.c | 4 +- contrib/ipfilter/man/ipf.4 | 2 +- contrib/ipfilter/md5.c | 2 +- contrib/ipfilter/md5.h | 6 +- contrib/ipfilter/radix_ipf.c | 20 +- contrib/ipfilter/radix_ipf.h | 24 +- contrib/ipfilter/tools/ipf.c | 32 +- contrib/ipfilter/tools/ipf_y.y | 52 ++-- contrib/ipfilter/tools/ipfcomp.c | 38 +-- contrib/ipfilter/tools/ipfs.c | 28 +- contrib/ipfilter/tools/ipfstat.c | 76 ++--- contrib/ipfilter/tools/ipfsyncd.c | 22 +- contrib/ipfilter/tools/ipftest.c | 40 +-- contrib/ipfilter/tools/ipmon.c | 48 +-- contrib/ipfilter/tools/ipmon_y.y | 22 +- contrib/ipfilter/tools/ipnat.c | 24 +- contrib/ipfilter/tools/ipnat_y.y | 38 +-- contrib/ipfilter/tools/ippool.c | 34 +-- contrib/ipfilter/tools/ippool_y.y | 10 +- contrib/ipfilter/tools/ipscan_y.y | 32 +- contrib/ipfilter/tools/ipsyncm.c | 4 +- contrib/ipfilter/tools/ipsyncs.c | 4 +- contrib/ipfilter/tools/lexer.c | 14 +- contrib/ipfilter/tools/lexer.h | 14 +- sys/contrib/ipfilter/netinet/fil.c | 148 +++++----- sys/contrib/ipfilter/netinet/ip_auth.c | 14 +- sys/contrib/ipfilter/netinet/ip_auth.h | 40 +-- sys/contrib/ipfilter/netinet/ip_compat.h | 38 ++- sys/contrib/ipfilter/netinet/ip_dns_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_dstlist.c | 70 ++--- sys/contrib/ipfilter/netinet/ip_dstlist.h | 4 +- sys/contrib/ipfilter/netinet/ip_fil.h | 408 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 6 +- sys/contrib/ipfilter/netinet/ip_frag.c | 28 +- sys/contrib/ipfilter/netinet/ip_frag.h | 54 ++-- sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 78 ++--- sys/contrib/ipfilter/netinet/ip_htable.c | 76 ++--- sys/contrib/ipfilter/netinet/ip_htable.h | 6 +- sys/contrib/ipfilter/netinet/ip_ipsec_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_irc_pxy.c | 14 +- sys/contrib/ipfilter/netinet/ip_lookup.c | 16 +- sys/contrib/ipfilter/netinet/ip_lookup.h | 92 +++--- sys/contrib/ipfilter/netinet/ip_nat.c | 98 +++---- sys/contrib/ipfilter/netinet/ip_nat.h | 176 +++++------ sys/contrib/ipfilter/netinet/ip_nat6.c | 30 +- sys/contrib/ipfilter/netinet/ip_netbios_pxy.c | 6 +- sys/contrib/ipfilter/netinet/ip_pool.c | 74 ++--- sys/contrib/ipfilter/netinet/ip_pool.h | 2 +- sys/contrib/ipfilter/netinet/ip_pptp_pxy.c | 18 +- sys/contrib/ipfilter/netinet/ip_proxy.c | 4 +- sys/contrib/ipfilter/netinet/ip_proxy.h | 76 ++--- sys/contrib/ipfilter/netinet/ip_raudio_pxy.c | 10 +- sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c | 22 +- sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c | 60 ++-- sys/contrib/ipfilter/netinet/ip_rules.h | 16 +- sys/contrib/ipfilter/netinet/ip_scan.c | 12 +- sys/contrib/ipfilter/netinet/ip_scan.h | 16 +- sys/contrib/ipfilter/netinet/ip_state.c | 72 ++--- sys/contrib/ipfilter/netinet/ip_state.h | 66 ++--- sys/contrib/ipfilter/netinet/ip_sync.c | 18 +- sys/contrib/ipfilter/netinet/ip_sync.h | 34 +-- sys/contrib/ipfilter/netinet/ip_tftp_pxy.c | 26 +- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 16 +- sys/contrib/ipfilter/netinet/radix_ipf.c | 20 +- sys/contrib/ipfilter/netinet/radix_ipf.h | 22 +- 99 files changed, 1795 insertions(+), 1801 deletions(-) diff --git a/contrib/ipfilter/bpf_filter.c b/contrib/ipfilter/bpf_filter.c index bd465761a34e..85a38a88bf57 100644 --- a/contrib/ipfilter/bpf_filter.c +++ b/contrib/ipfilter/bpf_filter.c @@ -71,8 +71,8 @@ static const char rcsid[] = #define int32 bpf_int32 #define u_int32 bpf_u_int32 -static int m_xword __P((mb_t *, int, int *)); -static int m_xhalf __P((mb_t *, int, int *)); +static int m_xword(mb_t *, int, int *); +static int m_xhalf(mb_t *, int, int *); #ifndef LBL_ALIGN /* diff --git a/contrib/ipfilter/ip_dstlist.c b/contrib/ipfilter/ip_dstlist.c index 99c7a22668df..14b071b0b95f 100644 --- a/contrib/ipfilter/ip_dstlist.c +++ b/contrib/ipfilter/ip_dstlist.c @@ -73,41 +73,41 @@ typedef struct ipf_dstl_softc_s { } ipf_dstl_softc_t; -static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *)); -static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int, - void *, u_int)); -static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *, - iplookupflush_t *)); -static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int, - void *)); -static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *, - ipflookupiter_t *)); -static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *)); -static void *ipf_dstlist_table_find __P((void *, int, char *)); -static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_remove __P((ipf_main_softc_t *, - ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *, - ippool_dst_t *)); -static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *)); -static void *ipf_dstlist_select_ref __P((void *, int, char *)); -static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *)); -static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *)); -static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *)); +static void *ipf_dstlist_soft_create(ipf_main_softc_t *); +static void ipf_dstlist_soft_destroy(ipf_main_softc_t *, void *); +static int ipf_dstlist_soft_init(ipf_main_softc_t *, void *); +static void ipf_dstlist_soft_fini(ipf_main_softc_t *, void *); +static int ipf_dstlist_addr_find(ipf_main_softc_t *, void *, int, + void *, u_int); +static size_t ipf_dstlist_flush(ipf_main_softc_t *, void *, + iplookupflush_t *); +static int ipf_dstlist_iter_deref(ipf_main_softc_t *, void *, int, int, + void *); +static int ipf_dstlist_iter_next(ipf_main_softc_t *, void *, ipftoken_t *, + ipflookupiter_t *); +static int ipf_dstlist_node_add(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_node_del(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_stats_get(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_add(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_del(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_deref(ipf_main_softc_t *, void *, void *); +static void *ipf_dstlist_table_find(void *, int, char *); +static void ipf_dstlist_table_free(ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_remove(ipf_main_softc_t *, + ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_clearnodes(ipf_dstl_softc_t *, + ippool_dst_t *); +static ipf_dstnode_t *ipf_dstlist_select(fr_info_t *, ippool_dst_t *); +static void *ipf_dstlist_select_ref(void *, int, char *); +static void ipf_dstlist_node_free(ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *); +static int ipf_dstlist_node_deref(void *, ipf_dstnode_t *); +static void ipf_dstlist_expire(ipf_main_softc_t *, void *); +static void ipf_dstlist_sync(ipf_main_softc_t *, void *); ipf_lookup_t ipf_dstlist_backend = { IPLT_DSTLIST, diff --git a/contrib/ipfilter/ip_dstlist.h b/contrib/ipfilter/ip_dstlist.h index e2885e5c47ad..c4acd78dfd94 100644 --- a/contrib/ipfilter/ip_dstlist.h +++ b/contrib/ipfilter/ip_dstlist.h @@ -62,7 +62,7 @@ typedef struct dstlist_stat_s { extern ipf_lookup_t ipf_dstlist_backend; -extern int ipf_dstlist_select_node __P((fr_info_t *, void *, u_32_t *, - frdest_t *)); +extern int ipf_dstlist_select_node(fr_info_t *, void *, u_32_t *, + frdest_t *); #endif /* __IP_DSTLIST_H__ */ diff --git a/contrib/ipfilter/ip_fil.c b/contrib/ipfilter/ip_fil.c index 794d7e205bb3..327f90fc356c 100644 --- a/contrib/ipfilter/ip_fil.c +++ b/contrib/ipfilter/ip_fil.c @@ -23,12 +23,12 @@ static int nifs = 0; struct rtentry; -static void ipf_setifpaddr __P((struct ifnet *, char *)); -void init_ifp __P((void)); -static int no_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); -static int write_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); +static void ipf_setifpaddr(struct ifnet *, char *); +void init_ifp(void); +static int no_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); +static int write_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); struct ifaddr { struct sockaddr_storage ifa_addr; diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c index 271c2e065738..fbcfc8a0088f 100644 --- a/contrib/ipfilter/ip_fil_compat.c +++ b/contrib/ipfilter/ip_fil_compat.c @@ -73,7 +73,7 @@ typedef struct tcpinfo4 { tcpdata_t ts_data[2]; } tcpinfo4_t; -static void ipf_v5tcpinfoto4 __P((tcpinfo_t *, tcpinfo4_t *)); +static void ipf_v5tcpinfoto4(tcpinfo_t *, tcpinfo4_t *); static void ipf_v5tcpinfoto4(v5, v4) @@ -1190,66 +1190,66 @@ typedef struct ipfrstat_4_1_1 { } ipfrstat_4_1_1_t; /* ------------------------------------------------------------------------ */ -static int ipf_addfrstr __P((char *, int, char *, int)); -static void ipf_v4iptov5 __P((frip4_t *, fr_ip_t *)); -static void ipf_v5iptov4 __P((fr_ip_t *, frip4_t *)); -static void ipfv4tuctov5 __P((frtuc4_t *, frtuc_t *)); -static void ipfv5tuctov4 __P((frtuc_t *, frtuc4_t *)); -static int ipf_v4fripftov5 __P((fripf4_t *, char *)); -static void ipf_v5fripftov4 __P((fripf_t *, fripf4_t *)); -static int fr_frflags4to5 __P((u_32_t)); -static int fr_frflags5to4 __P((u_32_t)); - -static void friostat_current_to_4_1_0 __P((void *, friostat_4_1_0_t *, int)); -static void friostat_current_to_4_1_33 __P((void *, friostat_4_1_33_t *, int)); -static void ipstate_current_to_4_1_0 __P((void *, ipstate_4_1_0_t *)); -static void ipstate_current_to_4_1_16 __P((void *, ipstate_4_1_16_t *)); -static void ipnat_current_to_4_1_0 __P((void *, ipnat_4_1_0_t *)); -static void ipnat_current_to_4_1_14 __P((void *, ipnat_4_1_14_t *)); -static void frauth_current_to_4_1_11 __P((void *, frauth_4_1_11_t *)); -static void frauth_current_to_4_1_23 __P((void *, frauth_4_1_23_t *)); -static void frauth_current_to_4_1_24 __P((void *, frauth_4_1_24_t *)); -static void frauth_current_to_4_1_29 __P((void *, frauth_4_1_29_t *)); -static void frentry_current_to_4_1_0 __P((void *, frentry_4_1_0_t *)); -static void frentry_current_to_4_1_16 __P((void *, frentry_4_1_16_t *)); -static void frentry_current_to_4_1_34 __P((void *, frentry_4_1_34_t *)); -static void fr_info_current_to_4_1_11 __P((void *, fr_info_4_1_11_t *)); -static void fr_info_current_to_4_1_23 __P((void *, fr_info_4_1_23_t *)); -static void fr_info_current_to_4_1_24 __P((void *, fr_info_4_1_24_t *)); -static void nat_save_current_to_4_1_3 __P((void *, nat_save_4_1_3_t *)); -static void nat_save_current_to_4_1_14 __P((void *, nat_save_4_1_14_t *)); -static void nat_save_current_to_4_1_16 __P((void *, nat_save_4_1_16_t *)); -static void ipstate_save_current_to_4_1_0 __P((void *, ipstate_save_4_1_0_t *)); -static void ipstate_save_current_to_4_1_16 __P((void *, ipstate_save_4_1_16_t *)); -static void ips_stat_current_to_4_1_0 __P((void *, ips_stat_4_1_0_t *)); -static void ips_stat_current_to_4_1_21 __P((void *, ips_stat_4_1_21_t *)); -static void natstat_current_to_4_1_0 __P((void *, natstat_4_1_0_t *)); -static void natstat_current_to_4_1_16 __P((void *, natstat_4_1_16_t *)); -static void natstat_current_to_4_1_27 __P((void *, natstat_4_1_27_t *)); -static void natstat_current_to_4_1_32 __P((void *, natstat_4_1_32_t *)); -static void nat_current_to_4_1_3 __P((void *, nat_4_1_3_t *)); -static void nat_current_to_4_1_14 __P((void *, nat_4_1_14_t *)); -static void nat_current_to_4_1_25 __P((void *, nat_4_1_25_t *)); - -static void friostat_4_1_0_to_current __P((friostat_4_1_0_t *, void *)); -static void friostat_4_1_33_to_current __P((friostat_4_1_33_t *, void *)); -static void ipnat_4_1_0_to_current __P((ipnat_4_1_0_t *, void *, int)); -static void ipnat_4_1_14_to_current __P((ipnat_4_1_14_t *, void *, int)); -static void frauth_4_1_11_to_current __P((frauth_4_1_11_t *, void *)); -static void frauth_4_1_23_to_current __P((frauth_4_1_23_t *, void *)); -static void frauth_4_1_24_to_current __P((frauth_4_1_24_t *, void *)); -static void frauth_4_1_29_to_current __P((frauth_4_1_29_t *, void *)); -static void frauth_4_1_32_to_current __P((frauth_4_1_32_t *, void *)); -static void frentry_4_1_0_to_current __P((ipf_main_softc_t *, frentry_4_1_0_t *, void *, int)); -static void frentry_4_1_16_to_current __P((ipf_main_softc_t *, frentry_4_1_16_t *, void *, int)); -static void frentry_4_1_34_to_current __P((ipf_main_softc_t *, frentry_4_1_34_t *, void *, int)); -static void fr_info_4_1_11_to_current __P((fr_info_4_1_11_t *, void *)); -static void fr_info_4_1_23_to_current __P((fr_info_4_1_23_t *, void *)); -static void fr_info_4_1_24_to_current __P((fr_info_4_1_24_t *, void *)); -static void fr_info_4_1_32_to_current __P((fr_info_4_1_32_t *, void *)); -static void nat_save_4_1_3_to_current __P((ipf_main_softc_t *, nat_save_4_1_3_t *, void *)); -static void nat_save_4_1_14_to_current __P((ipf_main_softc_t *, nat_save_4_1_14_t *, void *)); -static void nat_save_4_1_16_to_current __P((ipf_main_softc_t *, nat_save_4_1_16_t *, void *)); +static int ipf_addfrstr(char *, int, char *, int); +static void ipf_v4iptov5(frip4_t *, fr_ip_t *); +static void ipf_v5iptov4(fr_ip_t *, frip4_t *); +static void ipfv4tuctov5(frtuc4_t *, frtuc_t *); +static void ipfv5tuctov4(frtuc_t *, frtuc4_t *); +static int ipf_v4fripftov5(fripf4_t *, char *); +static void ipf_v5fripftov4(fripf_t *, fripf4_t *); +static int fr_frflags4to5(u_32_t); +static int fr_frflags5to4(u_32_t); + +static void friostat_current_to_4_1_0(void *, friostat_4_1_0_t *, int); +static void friostat_current_to_4_1_33(void *, friostat_4_1_33_t *, int); +static void ipstate_current_to_4_1_0(void *, ipstate_4_1_0_t *); +static void ipstate_current_to_4_1_16(void *, ipstate_4_1_16_t *); +static void ipnat_current_to_4_1_0(void *, ipnat_4_1_0_t *); +static void ipnat_current_to_4_1_14(void *, ipnat_4_1_14_t *); +static void frauth_current_to_4_1_11(void *, frauth_4_1_11_t *); +static void frauth_current_to_4_1_23(void *, frauth_4_1_23_t *); +static void frauth_current_to_4_1_24(void *, frauth_4_1_24_t *); +static void frauth_current_to_4_1_29(void *, frauth_4_1_29_t *); +static void frentry_current_to_4_1_0(void *, frentry_4_1_0_t *); +static void frentry_current_to_4_1_16(void *, frentry_4_1_16_t *); +static void frentry_current_to_4_1_34(void *, frentry_4_1_34_t *); +static void fr_info_current_to_4_1_11(void *, fr_info_4_1_11_t *); +static void fr_info_current_to_4_1_23(void *, fr_info_4_1_23_t *); +static void fr_info_current_to_4_1_24(void *, fr_info_4_1_24_t *); +static void nat_save_current_to_4_1_3(void *, nat_save_4_1_3_t *); +static void nat_save_current_to_4_1_14(void *, nat_save_4_1_14_t *); +static void nat_save_current_to_4_1_16(void *, nat_save_4_1_16_t *); +static void ipstate_save_current_to_4_1_0(void *, ipstate_save_4_1_0_t *); +static void ipstate_save_current_to_4_1_16(void *, ipstate_save_4_1_16_t *); +static void ips_stat_current_to_4_1_0(void *, ips_stat_4_1_0_t *); +static void ips_stat_current_to_4_1_21(void *, ips_stat_4_1_21_t *); +static void natstat_current_to_4_1_0(void *, natstat_4_1_0_t *); +static void natstat_current_to_4_1_16(void *, natstat_4_1_16_t *); +static void natstat_current_to_4_1_27(void *, natstat_4_1_27_t *); +static void natstat_current_to_4_1_32(void *, natstat_4_1_32_t *); +static void nat_current_to_4_1_3(void *, nat_4_1_3_t *); +static void nat_current_to_4_1_14(void *, nat_4_1_14_t *); +static void nat_current_to_4_1_25(void *, nat_4_1_25_t *); + +static void friostat_4_1_0_to_current(friostat_4_1_0_t *, void *); +static void friostat_4_1_33_to_current(friostat_4_1_33_t *, void *); +static void ipnat_4_1_0_to_current(ipnat_4_1_0_t *, void *, int); +static void ipnat_4_1_14_to_current(ipnat_4_1_14_t *, void *, int); +static void frauth_4_1_11_to_current(frauth_4_1_11_t *, void *); +static void frauth_4_1_23_to_current(frauth_4_1_23_t *, void *); +static void frauth_4_1_24_to_current(frauth_4_1_24_t *, void *); +static void frauth_4_1_29_to_current(frauth_4_1_29_t *, void *); +static void frauth_4_1_32_to_current(frauth_4_1_32_t *, void *); +static void frentry_4_1_0_to_current(ipf_main_softc_t *, frentry_4_1_0_t *, void *, int); +static void frentry_4_1_16_to_current(ipf_main_softc_t *, frentry_4_1_16_t *, void *, int); +static void frentry_4_1_34_to_current(ipf_main_softc_t *, frentry_4_1_34_t *, void *, int); +static void fr_info_4_1_11_to_current(fr_info_4_1_11_t *, void *); +static void fr_info_4_1_23_to_current(fr_info_4_1_23_t *, void *); +static void fr_info_4_1_24_to_current(fr_info_4_1_24_t *, void *); +static void fr_info_4_1_32_to_current(fr_info_4_1_32_t *, void *); +static void nat_save_4_1_3_to_current(ipf_main_softc_t *, nat_save_4_1_3_t *, void *); +static void nat_save_4_1_14_to_current(ipf_main_softc_t *, nat_save_4_1_14_t *, void *); +static void nat_save_4_1_16_to_current(ipf_main_softc_t *, nat_save_4_1_16_t *, void *); /* ------------------------------------------------------------------------ */ /* In this section is a series of short routines that deal with translating */ diff --git a/contrib/ipfilter/ip_msnrpc_pxy.c b/contrib/ipfilter/ip_msnrpc_pxy.c index 40bc084cbb5d..9cddd398edde 100644 --- a/contrib/ipfilter/ip_msnrpc_pxy.c +++ b/contrib/ipfilter/ip_msnrpc_pxy.c @@ -33,12 +33,12 @@ typedef struct msnrpchdr { u_char mrh_ans; } msnrpchdr_t; -int ippr_msnrpc_init __P((void)); -void ippr_msnrpc_fini __P((void)); -int ippr_msnrpc_new __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_out __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_in __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_check __P((ip_t *, msnrpchdr_t *)); +int ippr_msnrpc_init(void); +void ippr_msnrpc_fini(void); +int ippr_msnrpc_new(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_out(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_in(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_check(ip_t *, msnrpchdr_t *); static frentry_t msnfr; diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 834ba83f51f0..c7f7308a9ba9 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -175,12 +175,12 @@ typedef struct proxyrule { #if defined(__NetBSD__) || defined(__FreeBSD_version) || \ SOLARIS # include -typedef int (* ioctlfunc_t) __P((int, ioctlcmd_t, ...)); +typedef int (* ioctlfunc_t)(int, ioctlcmd_t, ...); #else -typedef int (* ioctlfunc_t) __P((dev_t, ioctlcmd_t, void *)); +typedef int (* ioctlfunc_t)(dev_t, ioctlcmd_t, void *); #endif -typedef int (* addfunc_t) __P((int, ioctlfunc_t, void *)); -typedef int (* copyfunc_t) __P((void *, void *, size_t)); +typedef int (* addfunc_t)(int, ioctlfunc_t, void *); +typedef int (* copyfunc_t)(void *, void *, size_t); extern char thishost[MAXHOSTNAMELEN]; @@ -200,178 +200,178 @@ extern wordtab_t natfields[]; extern wordtab_t poolfields[]; -extern int addicmp __P((char ***, struct frentry *, int)); -extern int addipopt __P((char *, struct ipopt_names *, int, char *)); -extern int addkeep __P((char ***, struct frentry *, int)); -extern alist_t *alist_new __P((int, char *)); -extern void alist_free __P((alist_t *)); -extern void assigndefined __P((char *)); -extern void binprint __P((void *, size_t)); -extern u_32_t buildopts __P((char *, char *, int)); -extern int checkrev __P((char *)); -extern int connecttcp __P((char *, int)); -extern int count6bits __P((u_32_t *)); -extern int count4bits __P((u_32_t)); -extern char *fac_toname __P((int)); -extern int fac_findname __P((char *)); -extern const char *familyname __P((const int)); -extern void fill6bits __P((int, u_int *)); -extern wordtab_t *findword __P((wordtab_t *, char *)); -extern int ftov __P((int)); -extern char *ipf_geterror __P((int, ioctlfunc_t *)); -extern int genmask __P((int, char *, i6addr_t *)); -extern int gethost __P((int, char *, i6addr_t *)); -extern int geticmptype __P((int, char *)); -extern int getport __P((struct frentry *, char *, u_short *, char *)); -extern int getportproto __P((char *, int)); -extern int getproto __P((char *)); -extern char *getnattype __P((struct nat *)); -extern char *getsumd __P((u_32_t)); -extern u_32_t getoptbyname __P((char *)); -extern u_32_t getoptbyvalue __P((int)); -extern u_32_t getv6optbyname __P((char *)); -extern u_32_t getv6optbyvalue __P((int)); -extern char *icmptypename __P((int, int)); -extern void initparse __P((void)); -extern void ipf_dotuning __P((int, char *, ioctlfunc_t)); -extern int ipf_addrule __P((int, ioctlfunc_t, void *)); -extern void ipf_mutex_clean __P((void)); -extern int ipf_parsefile __P((int, addfunc_t, ioctlfunc_t *, char *)); -extern int ipf_parsesome __P((int, addfunc_t, ioctlfunc_t *, FILE *)); -extern void ipf_perror __P((int, char *)); -extern int ipf_perror_fd __P(( int, ioctlfunc_t, char *)); -extern void ipf_rwlock_clean __P((void)); -extern char *ipf_strerror __P((int)); -extern void ipferror __P((int, char *)); -extern int ipmon_parsefile __P((char *)); -extern int ipmon_parsesome __P((FILE *)); -extern int ipnat_addrule __P((int, ioctlfunc_t, void *)); -extern int ipnat_parsefile __P((int, addfunc_t, ioctlfunc_t, char *)); -extern int ipnat_parsesome __P((int, addfunc_t, ioctlfunc_t, FILE *)); -extern int ippool_parsefile __P((int, char *, ioctlfunc_t)); -extern int ippool_parsesome __P((int, FILE *, ioctlfunc_t)); -extern int kmemcpywrap __P((void *, void *, size_t)); -extern char *kvatoname __P((ipfunc_t, ioctlfunc_t)); -extern int load_dstlist __P((struct ippool_dst *, ioctlfunc_t, - ipf_dstnode_t *)); -extern int load_dstlistnode __P((int, char *, struct ipf_dstnode *, - ioctlfunc_t)); -extern alist_t *load_file __P((char *)); -extern int load_hash __P((struct iphtable_s *, struct iphtent_s *, - ioctlfunc_t)); -extern int load_hashnode __P((int, char *, struct iphtent_s *, int, - ioctlfunc_t)); -extern alist_t *load_http __P((char *)); -extern int load_pool __P((struct ip_pool_s *list, ioctlfunc_t)); -extern int load_poolnode __P((int, char *, ip_pool_node_t *, int, ioctlfunc_t)); -extern alist_t *load_url __P((char *)); -extern alist_t *make_range __P((int, struct in_addr, struct in_addr)); -extern void mb_hexdump __P((mb_t *, FILE *)); -extern ipfunc_t nametokva __P((char *, ioctlfunc_t)); -extern void nat_setgroupmap __P((struct ipnat *)); -extern int ntomask __P((int, int, u_32_t *)); -extern u_32_t optname __P((char ***, u_short *, int)); -extern wordtab_t *parsefields __P((wordtab_t *, char *)); -extern int *parseipfexpr __P((char *, char **)); -extern int parsewhoisline __P((char *, addrfamily_t *, addrfamily_t *)); -extern void pool_close __P((void)); -extern int pool_fd __P((void)); -extern int pool_ioctl __P((ioctlfunc_t, ioctlcmd_t, void *)); -extern int pool_open __P((void)); -extern char *portname __P((int, int)); -extern int pri_findname __P((char *)); -extern char *pri_toname __P((int)); -extern void print_toif __P((int, char *, char *, struct frdest *)); -extern void printaps __P((ap_session_t *, int, int)); -extern void printaddr __P((int, int, char *, int, u_32_t *, u_32_t *)); -extern void printbuf __P((char *, int, int)); -extern void printfieldhdr __P((wordtab_t *, wordtab_t *)); -extern void printfr __P((struct frentry *, ioctlfunc_t)); -extern struct iphtable_s *printhash __P((struct iphtable_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct iphtable_s *printhash_live __P((iphtable_t *, int, char *, - int, wordtab_t *)); -extern ippool_dst_t *printdstl_live __P((ippool_dst_t *, int, char *, - int, wordtab_t *)); -extern void printhashdata __P((iphtable_t *, int)); -extern struct iphtent_s *printhashnode __P((struct iphtable_s *, +extern int addicmp(char ***, struct frentry *, int); +extern int addipopt(char *, struct ipopt_names *, int, char *); +extern int addkeep(char ***, struct frentry *, int); +extern alist_t *alist_new(int, char *); +extern void alist_free(alist_t *); +extern void assigndefined(char *); +extern void binprint(void *, size_t); +extern u_32_t buildopts(char *, char *, int); +extern int checkrev(char *); +extern int connecttcp(char *, int); +extern int count6bits(u_32_t *); +extern int count4bits(u_32_t); +extern char *fac_toname(int); +extern int fac_findname(char *); +extern const char *familyname(const int); +extern void fill6bits(int, u_int *); +extern wordtab_t *findword(wordtab_t *, char *); +extern int ftov(int); +extern char *ipf_geterror(int, ioctlfunc_t *); +extern int genmask(int, char *, i6addr_t *); +extern int gethost(int, char *, i6addr_t *); +extern int geticmptype(int, char *); +extern int getport(struct frentry *, char *, u_short *, char *); +extern int getportproto(char *, int); +extern int getproto(char *); +extern char *getnattype(struct nat *); +extern char *getsumd(u_32_t); +extern u_32_t getoptbyname(char *); +extern u_32_t getoptbyvalue(int); +extern u_32_t getv6optbyname(char *); +extern u_32_t getv6optbyvalue(int); +extern char *icmptypename(int, int); +extern void initparse(void); +extern void ipf_dotuning(int, char *, ioctlfunc_t); +extern int ipf_addrule(int, ioctlfunc_t, void *); +extern void ipf_mutex_clean(void); +extern int ipf_parsefile(int, addfunc_t, ioctlfunc_t *, char *); +extern int ipf_parsesome(int, addfunc_t, ioctlfunc_t *, FILE *); +extern void ipf_perror(int, char *); +extern int ipf_perror_fd( int, ioctlfunc_t, char *); +extern void ipf_rwlock_clean(void); +extern char *ipf_strerror(int); +extern void ipferror(int, char *); +extern int ipmon_parsefile(char *); +extern int ipmon_parsesome(FILE *); +extern int ipnat_addrule(int, ioctlfunc_t, void *); +extern int ipnat_parsefile(int, addfunc_t, ioctlfunc_t, char *); +extern int ipnat_parsesome(int, addfunc_t, ioctlfunc_t, FILE *); +extern int ippool_parsefile(int, char *, ioctlfunc_t); +extern int ippool_parsesome(int, FILE *, ioctlfunc_t); +extern int kmemcpywrap(void *, void *, size_t); +extern char *kvatoname(ipfunc_t, ioctlfunc_t); +extern int load_dstlist(struct ippool_dst *, ioctlfunc_t, + ipf_dstnode_t *); +extern int load_dstlistnode(int, char *, struct ipf_dstnode *, + ioctlfunc_t); +extern alist_t *load_file(char *); +extern int load_hash(struct iphtable_s *, struct iphtent_s *, + ioctlfunc_t); +extern int load_hashnode(int, char *, struct iphtent_s *, int, + ioctlfunc_t); +extern alist_t *load_http(char *); +extern int load_pool(struct ip_pool_s *list, ioctlfunc_t); +extern int load_poolnode(int, char *, ip_pool_node_t *, int, ioctlfunc_t); +extern alist_t *load_url(char *); +extern alist_t *make_range(int, struct in_addr, struct in_addr); +extern void mb_hexdump(mb_t *, FILE *); +extern ipfunc_t nametokva(char *, ioctlfunc_t); +extern void nat_setgroupmap(struct ipnat *); +extern int ntomask(int, int, u_32_t *); +extern u_32_t optname(char ***, u_short *, int); +extern wordtab_t *parsefields(wordtab_t *, char *); +extern int *parseipfexpr(char *, char **); +extern int parsewhoisline(char *, addrfamily_t *, addrfamily_t *); +extern void pool_close(void); +extern int pool_fd(void); +extern int pool_ioctl(ioctlfunc_t, ioctlcmd_t, void *); +extern int pool_open(void); +extern char *portname(int, int); +extern int pri_findname(char *); +extern char *pri_toname(int); +extern void print_toif(int, char *, char *, struct frdest *); +extern void printaps(ap_session_t *, int, int); +extern void printaddr(int, int, char *, int, u_32_t *, u_32_t *); +extern void printbuf(char *, int, int); +extern void printfieldhdr(wordtab_t *, wordtab_t *); +extern void printfr(struct frentry *, ioctlfunc_t); +extern struct iphtable_s *printhash(struct iphtable_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct iphtable_s *printhash_live(iphtable_t *, int, char *, + int, wordtab_t *); +extern ippool_dst_t *printdstl_live(ippool_dst_t *, int, char *, + int, wordtab_t *); +extern void printhashdata(iphtable_t *, int); +extern struct iphtent_s *printhashnode(struct iphtable_s *, struct iphtent_s *, - copyfunc_t, int, wordtab_t *)); -extern void printhost __P((int, u_32_t *)); -extern void printhostmask __P((int, u_32_t *, u_32_t *)); -extern void printip __P((int, u_32_t *)); -extern void printlog __P((struct frentry *)); -extern void printlookup __P((char *, i6addr_t *addr, i6addr_t *mask)); -extern void printmask __P((int, u_32_t *)); -extern void printnataddr __P((int, char *, nat_addr_t *, int)); -extern void printnatfield __P((nat_t *, int)); -extern void printnatside __P((char *, nat_stat_side_t *)); -extern void printpacket __P((int, mb_t *)); -extern void printpacket6 __P((int, mb_t *)); -extern struct ippool_dst *printdstlist __P((struct ippool_dst *, copyfunc_t, + copyfunc_t, int, wordtab_t *); +extern void printhost(int, u_32_t *); +extern void printhostmask(int, u_32_t *, u_32_t *); +extern void printip(int, u_32_t *); +extern void printlog(struct frentry *); +extern void printlookup(char *, i6addr_t *addr, i6addr_t *mask); +extern void printmask(int, u_32_t *); +extern void printnataddr(int, char *, nat_addr_t *, int); +extern void printnatfield(nat_t *, int); +extern void printnatside(char *, nat_stat_side_t *); +extern void printpacket(int, mb_t *); +extern void printpacket6(int, mb_t *); +extern struct ippool_dst *printdstlist(struct ippool_dst *, copyfunc_t, char *, int, ipf_dstnode_t *, - wordtab_t *)); -extern void printdstlistdata __P((ippool_dst_t *, int)); -extern ipf_dstnode_t *printdstlistnode __P((ipf_dstnode_t *, copyfunc_t, - int, wordtab_t *)); -extern void printdstlistpolicy __P((ippool_policy_t)); -extern struct ip_pool_s *printpool __P((struct ip_pool_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct ip_pool_s *printpool_live __P((struct ip_pool_s *, int, - char *, int, wordtab_t *)); -extern void printpooldata __P((ip_pool_t *, int)); -extern void printpoolfield __P((void *, int, int)); -extern struct ip_pool_node *printpoolnode __P((struct ip_pool_node *, - int, wordtab_t *)); -extern void printproto __P((struct protoent *, int, struct ipnat *)); -extern void printportcmp __P((int, struct frpcmp *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printtqtable __P((ipftq_t *)); -extern void printtunable __P((ipftune_t *)); -extern void printunit __P((int)); -extern void optprint __P((u_short *, u_long, u_long)); + wordtab_t *); +extern void printdstlistdata(ippool_dst_t *, int); +extern ipf_dstnode_t *printdstlistnode(ipf_dstnode_t *, copyfunc_t, + int, wordtab_t *); +extern void printdstlistpolicy(ippool_policy_t); +extern struct ip_pool_s *printpool(struct ip_pool_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct ip_pool_s *printpool_live(struct ip_pool_s *, int, + char *, int, wordtab_t *); +extern void printpooldata(ip_pool_t *, int); +extern void printpoolfield(void *, int, int); +extern struct ip_pool_node *printpoolnode(struct ip_pool_node *, + int, wordtab_t *); +extern void printproto(struct protoent *, int, struct ipnat *); +extern void printportcmp(int, struct frpcmp *); +extern void printstatefield(ipstate_t *, int); +extern void printtqtable(ipftq_t *); +extern void printtunable(ipftune_t *); +extern void printunit(int); +extern void optprint(u_short *, u_long, u_long); #ifdef USE_INET6 -extern void optprintv6 __P((u_short *, u_long, u_long)); +extern void optprintv6(u_short *, u_long, u_long); #endif -extern int remove_hash __P((struct iphtable_s *, ioctlfunc_t)); -extern int remove_hashnode __P((int, char *, struct iphtent_s *, ioctlfunc_t)); -extern int remove_pool __P((ip_pool_t *, ioctlfunc_t)); -extern int remove_poolnode __P((int, char *, ip_pool_node_t *, ioctlfunc_t)); -extern u_char tcpflags __P((char *)); -extern void printc __P((struct frentry *)); -extern void printC __P((int)); -extern void emit __P((int, int, void *, struct frentry *)); -extern u_char secbit __P((int)); -extern u_char seclevel __P((char *)); -extern void printfraginfo __P((char *, struct ipfr *)); -extern void printifname __P((char *, char *, void *)); -extern char *hostname __P((int, void *)); -extern struct ipstate *printstate __P((struct ipstate *, int, u_long)); -extern void printsbuf __P((char *)); -extern void printnat __P((struct ipnat *, int)); -extern void printactiveaddress __P((int, char *, i6addr_t *, char *)); -extern void printactivenat __P((struct nat *, int, u_long)); -extern void printhostmap __P((struct hostmap *, u_int)); -extern void printtcpflags __P((u_32_t, u_32_t)); -extern void printipfexpr __P((int *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printstatefieldhdr __P((int)); -extern int sendtrap_v1_0 __P((int, char *, char *, int, time_t)); -extern int sendtrap_v2_0 __P((int, char *, char *, int)); -extern int vtof __P((int)); - -extern void set_variable __P((char *, char *)); -extern char *get_variable __P((char *, char **, int)); -extern void resetlexer __P((void)); - -extern void debug __P((int, char *, ...)); -extern void verbose __P((int, char *, ...)); -extern void ipfkdebug __P((char *, ...)); -extern void ipfkverbose __P((char *, ...)); +extern int remove_hash(struct iphtable_s *, ioctlfunc_t); +extern int remove_hashnode(int, char *, struct iphtent_s *, ioctlfunc_t); +extern int remove_pool(ip_pool_t *, ioctlfunc_t); +extern int remove_poolnode(int, char *, ip_pool_node_t *, ioctlfunc_t); +extern u_char tcpflags(char *); +extern void printc(struct frentry *); +extern void printC(int); +extern void emit(int, int, void *, struct frentry *); +extern u_char secbit(int); +extern u_char seclevel(char *); +extern void printfraginfo(char *, struct ipfr *); +extern void printifname(char *, char *, void *); +extern char *hostname(int, void *); +extern struct ipstate *printstate(struct ipstate *, int, u_long); +extern void printsbuf(char *); +extern void printnat(struct ipnat *, int); +extern void printactiveaddress(int, char *, i6addr_t *, char *); +extern void printactivenat(struct nat *, int, u_long); +extern void printhostmap(struct hostmap *, u_int); +extern void printtcpflags(u_32_t, u_32_t); +extern void printipfexpr(int *); +extern void printstatefield(ipstate_t *, int); +extern void printstatefieldhdr(int); +extern int sendtrap_v1_0(int, char *, char *, int, time_t); +extern int sendtrap_v2_0(int, char *, char *, int); +extern int vtof(int); + +extern void set_variable(char *, char *); +extern char *get_variable(char *, char **, int); +extern void resetlexer(void); + +extern void debug(int, char *, ...); +extern void verbose(int, char *, ...); +extern void ipfkdebug(char *, ...); +extern void ipfkverbose(char *, ...); #if SOLARIS -extern int gethostname __P((char *, int )); -extern void sync __P((void)); +extern int gethostname(char *, int ); +extern void sync(void); #endif #endif /* __IPF_H__ */ diff --git a/contrib/ipfilter/iplang/iplang.h b/contrib/ipfilter/iplang/iplang.h index 63cc078322a3..f38ef9671701 100644 --- a/contrib/ipfilter/iplang/iplang.h +++ b/contrib/ipfilter/iplang/iplang.h @@ -50,5 +50,5 @@ typedef struct aniphdr { #define ah_udp ah_un.ahu_udp #define ah_icmp ah_un.ahu_icmp -extern int get_arpipv4 __P((char *, char *)); +extern int get_arpipv4(char *, char *); diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index e66867e2a455..f8b1b82d4707 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -29,14 +29,14 @@ extern int opts; int lineNum = 0, ipproto = 0, oldipproto = 0, next = -1, laststate = 0; int *prstack = NULL, numpr = 0, state = 0, token = 0; -void yyerror __P((char *)); -void push_proto __P((void)); -void pop_proto __P((void)); -int next_state __P((int, int)); -int next_item __P((int)); -int save_token __P((void)); -void swallow __P((void)); -int yylex __P((void)); +void yyerror(char *); +void push_proto(void); +void pop_proto(void); +int next_state(int, int); +int next_item(int); +int save_token(void); +void swallow(void); +int yylex(void); struct lwordtab { char *word; diff --git a/contrib/ipfilter/iplang/iplang_y.y b/contrib/ipfilter/iplang/iplang_y.y index b4570d390530..f3335636cee1 100644 --- a/contrib/ipfilter/iplang/iplang_y.y +++ b/contrib/ipfilter/iplang/iplang_y.y @@ -59,8 +59,8 @@ arp_t *arplist = NULL, **arptail = &arplist, *carp = NULL; struct in_addr defrouter; send_t sending; char *sclass = NULL; -u_short c_chksum __P((u_short *, u_int, u_long)); -u_long p_chksum __P((u_short *, u_int)); +u_short c_chksum(u_short *, u_int, u_long); +u_long p_chksum(u_short *, u_int); u_long ipbuffer[67584/sizeof(u_long)]; /* 66K */ aniphdr_t *aniphead = NULL, *canip = NULL, **aniptail = &aniphead; @@ -74,85 +74,85 @@ struct statetoopt { int sto_op; }; -struct in_addr getipv4addr __P((char *arg)); -u_short getportnum __P((char *, char *)); -struct ether_addr *geteaddr __P((char *, struct ether_addr *)); -void *new_header __P((int)); -void free_aniplist __P((void)); -void inc_anipheaders __P((int)); -void new_data __P((void)); -void set_datalen __P((char **)); -void set_datafile __P((char **)); -void set_data __P((char **)); -void new_packet __P((void)); -void set_ipv4proto __P((char **)); -void set_ipv4src __P((char **)); -void set_ipv4dst __P((char **)); -void set_ipv4off __P((char **)); -void set_ipv4v __P((char **)); -void set_ipv4hl __P((char **)); -void set_ipv4ttl __P((char **)); -void set_ipv4tos __P((char **)); -void set_ipv4id __P((char **)); -void set_ipv4sum __P((char **)); -void set_ipv4len __P((char **)); -void new_tcpheader __P((void)); -void set_tcpsport __P((char **)); -void set_tcpdport __P((char **)); -void set_tcpseq __P((char **)); -void set_tcpack __P((char **)); -void set_tcpoff __P((char **)); -void set_tcpurp __P((char **)); -void set_tcpwin __P((char **)); -void set_tcpsum __P((char **)); -void set_tcpflags __P((char **)); -void set_tcpopt __P((int, char **)); -void end_tcpopt __P((void)); -void new_udpheader __P((void)); -void set_udplen __P((char **)); -void set_udpsum __P((char **)); -void prep_packet __P((void)); -void packet_done __P((void)); -void new_interface __P((void)); -void check_interface __P((void)); -void set_ifname __P((char **)); -void set_ifmtu __P((int)); -void set_ifv4addr __P((char **)); -void set_ifeaddr __P((char **)); -void new_arp __P((void)); -void set_arpeaddr __P((char **)); -void set_arpv4addr __P((char **)); -void reset_send __P((void)); -void set_sendif __P((char **)); -void set_sendvia __P((char **)); -void set_defaultrouter __P((char **)); -void new_icmpheader __P((void)); -void set_icmpcode __P((int)); -void set_icmptype __P((int)); -void set_icmpcodetok __P((char **)); -void set_icmptypetok __P((char **)); -void set_icmpid __P((int)); -void set_icmpseq __P((int)); -void set_icmpotime __P((int)); -void set_icmprtime __P((int)); -void set_icmpttime __P((int)); -void set_icmpmtu __P((int)); -void set_redir __P((int, char **)); -void new_ipv4opt __P((void)); -void set_icmppprob __P((int)); -void add_ipopt __P((int, void *)); -void end_ipopt __P((void)); -void set_secclass __P((char **)); -void free_anipheader __P((void)); -void end_ipv4 __P((void)); -void end_icmp __P((void)); -void end_udp __P((void)); -void end_tcp __P((void)); -void end_data __P((void)); -void yyerror __P((char *)); -void iplang __P((FILE *)); -int arp_getipv4 __P((char *, char *)); -int yyparse __P((void)); +struct in_addr getipv4addr(char *arg); +u_short getportnum(char *, char *); +struct ether_addr *geteaddr(char *, struct ether_addr *); +void *new_header(int); +void free_aniplist(void); +void inc_anipheaders(int); +void new_data(void); +void set_datalen(char **); +void set_datafile(char **); +void set_data(char **); +void new_packet(void); +void set_ipv4proto(char **); +void set_ipv4src(char **); +void set_ipv4dst(char **); +void set_ipv4off(char **); +void set_ipv4v(char **); +void set_ipv4hl(char **); +void set_ipv4ttl(char **); +void set_ipv4tos(char **); +void set_ipv4id(char **); +void set_ipv4sum(char **); +void set_ipv4len(char **); +void new_tcpheader(void); +void set_tcpsport(char **); +void set_tcpdport(char **); +void set_tcpseq(char **); +void set_tcpack(char **); +void set_tcpoff(char **); +void set_tcpurp(char **); +void set_tcpwin(char **); +void set_tcpsum(char **); +void set_tcpflags(char **); +void set_tcpopt(int, char **); +void end_tcpopt(void); +void new_udpheader(void); +void set_udplen(char **); +void set_udpsum(char **); +void prep_packet(void); +void packet_done(void); +void new_interface(void); +void check_interface(void); +void set_ifname(char **); +void set_ifmtu(int); +void set_ifv4addr(char **); +void set_ifeaddr(char **); +void new_arp(void); +void set_arpeaddr(char **); +void set_arpv4addr(char **); +void reset_send(void); +void set_sendif(char **); +void set_sendvia(char **); +void set_defaultrouter(char **); +void new_icmpheader(void); +void set_icmpcode(int); +void set_icmptype(int); +void set_icmpcodetok(char **); +void set_icmptypetok(char **); +void set_icmpid(int); +void set_icmpseq(int); +void set_icmpotime(int); +void set_icmprtime(int); +void set_icmpttime(int); +void set_icmpmtu(int); +void set_redir(int, char **); +void new_ipv4opt(void); +void set_icmppprob(int); +void add_ipopt(int, void *); +void end_ipopt(void); +void set_secclass(char **); *** 4114 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Feb 2 01:19:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 856AA4F8D45; Tue, 2 Feb 2021 01:19:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV6RF3PHBz3ng7; Tue, 2 Feb 2021 01:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 6743525276; Tue, 2 Feb 2021 01:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1121JL6V079541; Tue, 2 Feb 2021 01:19:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121JL4e079540; Tue, 2 Feb 2021 01:19:21 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:19:21 GMT Message-Id: <202102020119.1121JL4e079540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 7071734fae60 - main - Indentation cleanup resulting from the cleanup of #ifdefs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7071734fae6019d1e3e44daf7deb4478582081cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 01:19:21 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7071734fae6019d1e3e44daf7deb4478582081cc commit 7071734fae6019d1e3e44daf7deb4478582081cc Author: Cy Schubert AuthorDate: 2021-01-27 15:25:00 +0000 Commit: Cy Schubert CommitDate: 2021-02-02 01:19:15 +0000 Indentation cleanup resulting from the cleanup of #ifdefs. The conscious decision was made not to perform any indentation or whitespace cleanup while cleaning out old redunant #ifdefs. The reason for this was to avoid confusing future readers of history and diffs with cosmetic changes, making bisection of any possible bugs introduced more difficult. This commit cleans up the whitespace detritus left behind from the previous #ifdef cleanup commits. MFC after: 1 week --- sys/contrib/ipfilter/netinet/fil.c | 12 +- sys/contrib/ipfilter/netinet/ip_auth.c | 18 +- sys/contrib/ipfilter/netinet/ip_compat.h | 282 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_dstlist.c | 2 +- sys/contrib/ipfilter/netinet/ip_fil.h | 94 ++++----- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 21 +- sys/contrib/ipfilter/netinet/ip_pool.c | 2 +- 7 files changed, 215 insertions(+), 216 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 7402437d98c7..a79d441284bf 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -48,7 +48,7 @@ #if !defined(__SVR4) # include #else -# include +# include # if (SOLARIS2 < 5) && defined(sun) # include # endif @@ -4117,11 +4117,11 @@ ipf_sync(softc, ifp) { int i; -# if !SOLARIS +#if !SOLARIS ipf_nat_sync(softc, ifp); ipf_state_sync(softc, ifp); ipf_lookup_sync(softc, ifp); -# endif +#endif WRITE_ENTER(&softc->ipf_mutex); (void) ipf_synclist(softc, softc->ipf_acct[0][softc->ipf_active], ifp); @@ -4168,13 +4168,13 @@ copyinptr(softc, src, dst, size) caddr_t ca; int error; -# if SOLARIS +#if SOLARIS error = COPYIN(src, &ca, sizeof(ca)); if (error != 0) return error; -# else +#else bcopy(src, (caddr_t)&ca, sizeof(ca)); -# endif +#endif error = COPYIN(ca, dst, size); if (error != 0) { IPFERROR(3); diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 18b8f3a65641..4864a8128494 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -81,13 +81,13 @@ # undef KERNEL #endif #include -# if defined(__FreeBSD_version) -# include -# define IF_QFULL _IF_QFULL -# define IF_DROP _IF_DROP -# endif -# include -# include +#if defined(__FreeBSD_version) +# include +# define IF_QFULL _IF_QFULL +# define IF_DROP _IF_DROP +#endif +#include +#include #include #include #include "netinet/ip_compat.h" @@ -298,9 +298,9 @@ ipf_auth_soft_destroy(softc, arg) { ipf_auth_softc_t *softa = arg; -# if SOLARIS && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) cv_destroy(&softa->ipf_auth_wait); -# endif +#endif MUTEX_DESTROY(&softa->ipf_auth_mx); RW_DESTROY(&softa->ipf_authlk); diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 4394b732e10c..756731480836 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -56,16 +56,16 @@ /* * This is a workaround for troubles on FreeBSD and OpenBSD. */ -# ifndef _KERNEL -# define ADD_KERNEL -# define _KERNEL -# define KERNEL -# endif -# include -# ifdef ADD_KERNEL -# undef _KERNEL -# undef KERNEL -# endif +#ifndef _KERNEL +# define ADD_KERNEL +# define _KERNEL +# define KERNEL +#endif +#include +#ifdef ADD_KERNEL +# undef _KERNEL +# undef KERNEL +#endif #define NETBSD_GE_REV(x) (defined(__NetBSD_Version__) && \ (__NetBSD_Version__ >= (x))) @@ -78,108 +78,108 @@ /* ----------------------------------------------------------------------- */ /* F R E E B S D */ /* ----------------------------------------------------------------------- */ -# define HAS_SYS_MD5_H 1 -# if defined(_KERNEL) -# include "opt_bpf.h" -# include "opt_inet6.h" -# if defined(INET6) && !defined(USE_INET6) -# define USE_INET6 -# endif -# else -# if !defined(USE_INET6) && !defined(NOINET6) -# define USE_INET6 -# endif +#define HAS_SYS_MD5_H 1 +#if defined(_KERNEL) +# include "opt_bpf.h" +# include "opt_inet6.h" +# if defined(INET6) && !defined(USE_INET6) +# define USE_INET6 # endif +#else +# if !defined(USE_INET6) && !defined(NOINET6) +# define USE_INET6 +# endif +#endif -# if defined(_KERNEL) -# include -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#if defined(_KERNEL) +# include +# define p_cred td_ucred +# define p_uid td_ucred->cr_ruid /* * When #define'd, the 5.2.1 kernel panics when used with the ftp proxy. * There may be other, safe, kernels but this is not extensively tested yet. */ -# define HAVE_M_PULLDOWN -# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) -# include "opt_ipfilter.h" -# endif -# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) -# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) +# define HAVE_M_PULLDOWN +# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) +# include "opt_ipfilter.h" +# endif +# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) +# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# else -# include -# endif /* _KERNEL */ +#else +# include +#endif /* _KERNEL */ -# include -# include -# include -# include -# define KRWLOCK_FILL_SZ 56 -# define KMUTEX_FILL_SZ 56 -# include -# define KMUTEX_T struct mtx -# define KRWLOCK_T struct rwlock +#include +#include +#include +#include +#define KRWLOCK_FILL_SZ 56 +#define KMUTEX_FILL_SZ 56 +#include +#define KMUTEX_T struct mtx +#define KRWLOCK_T struct rwlock #ifdef _KERNEL -# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) -# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) -# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) -# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) -# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) -# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) -# define RWLOCK_EXIT(x) do { \ +# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) +# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) +# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) +# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) +# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) +# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) +# define RWLOCK_EXIT(x) do { \ if (rw_wowned(&(x)->ipf_lk)) \ rw_wunlock(&(x)->ipf_lk); \ else \ rw_runlock(&(x)->ipf_lk); \ } while (0) -# include -# define GETKTIME(x) microtime((struct timeval *)x) -# define if_addrlist if_addrhead - -# include -# include -# include - -# define USE_MUTEXES -# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) -# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) -# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ +# include +# define GETKTIME(x) microtime((struct timeval *)x) +# define if_addrlist if_addrhead + +# include +# include +# include + +# define USE_MUTEXES +# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) +# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) +# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ MTX_DEF) -# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) -# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) +# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) +# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) /* * Whilst the sx(9) locks on FreeBSD have the right semantics and interface * for what we want to use them for, despite testing showing they work - * with a WITNESS kernel, it generates LOR messages. */ -# include -# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ +# include +# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ +# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) -# define ATOMIC_INC64(x) ATOMIC_INC(x) -# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) -# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) -# define ATOMIC_DEC64(x) ATOMIC_DEC(x) -# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) -# define SPL_X(x) ; -# define SPL_NET(x) ; -# define SPL_IMP(x) ; -# define SPL_SCHED(x) ; -# define GET_MINOR dev2unit -# define MSGDSIZE(m) mbufchainlen(m) -# define M_LEN(m) (m)->m_len -# define M_ADJ(m,x) m_adj(m, x) -# define M_COPY(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) -# define M_DUP(m) m_dup(m, M_NOWAIT) -# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } +# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) +# define ATOMIC_INC64(x) ATOMIC_INC(x) +# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) +# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) +# define ATOMIC_DEC64(x) ATOMIC_DEC(x) +# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) +# define SPL_X(x) ; +# define SPL_NET(x) ; +# define SPL_IMP(x) ; +# define SPL_SCHED(x) ; +# define GET_MINOR dev2unit +# define MSGDSIZE(m) mbufchainlen(m) +# define M_LEN(m) (m)->m_len +# define M_ADJ(m,x) m_adj(m, x) +# define M_COPY(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) +# define M_DUP(m) m_dup(m, M_NOWAIT) +# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } typedef struct mbuf mb_t; #else /* !_KERNEL */ -#ifndef _NET_IF_VAR_H_ +# ifndef _NET_IF_VAR_H_ /* * Userland emulation of struct ifnet. */ @@ -191,14 +191,14 @@ struct ifnet { int (*if_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); }; -#endif /* _NET_IF_VAR_H_ */ +# endif /* _NET_IF_VAR_H_ */ #endif /* _KERNEL */ -# define IFNAME(x) ((struct ifnet *)x)->if_xname -# define COPYIFNAME(v, x, b) \ - (void) strncpy(b, \ - ((struct ifnet *)x)->if_xname, \ - LIFNAMSIZ) +#define IFNAME(x) ((struct ifnet *)x)->if_xname +#define COPYIFNAME(v, x, b) \ + (void) strncpy(b, \ + ((struct ifnet *)x)->if_xname, \ + LIFNAMSIZ) typedef u_long ioctlcmd_t; typedef struct uio uio_t; @@ -226,12 +226,12 @@ typedef u_int32_t u_32_t; * Userland locking primitives */ #ifndef _KERNEL -#if !defined(KMUTEX_FILL_SZ) -# define KMUTEX_FILL_SZ 1 -#endif -#if !defined(KRWLOCK_FILL_SZ) -# define KRWLOCK_FILL_SZ 1 -#endif +# if !defined(KMUTEX_FILL_SZ) +# define KMUTEX_FILL_SZ 1 +# endif +# if !defined(KRWLOCK_FILL_SZ) +# define KRWLOCK_FILL_SZ 1 +# endif #endif typedef struct { @@ -455,54 +455,54 @@ typedef struct ip6_hdr ip6_t; # define COPYDATA m_copydata # define COPYBACK m_copyback # endif -# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ - defined(__FreeBSD__) -# include -# endif -# if NETBSD_GE_REV(105180000) -# include -# else -# include +# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ + defined(__FreeBSD__) +# include +# endif +# if NETBSD_GE_REV(105180000) +# include +# else +# include extern vm_map_t kmem_map; -# endif -# include +# endif +# include -# ifdef IPFILTER_M_IPFILTER -# include +# ifdef IPFILTER_M_IPFILTER +# include MALLOC_DECLARE(M_IPFILTER); +# define _M_IPF M_IPFILTER +# else /* IPFILTER_M_IPFILTER */ +# ifdef M_PFIL +# define _M_IPF M_PFIL +# else +# ifdef M_IPFILTER # define _M_IPF M_IPFILTER -# else /* IPFILTER_M_IPFILTER */ -# ifdef M_PFIL -# define _M_IPF M_PFIL # else -# ifdef M_IPFILTER -# define _M_IPF M_IPFILTER -# else -# define _M_IPF M_TEMP -# endif /* M_IPFILTER */ -# endif /* M_PFIL */ -# endif /* IPFILTER_M_IPFILTER */ -# if !defined(KMALLOC) -# define KMALLOC(a, b) (a) = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT) -# endif -# if !defined(KMALLOCS) -# define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT) -# endif -# if !defined(KFREE) -# define KFREE(x) free((x), _M_IPF) -# endif -# if !defined(KFREES) +# define _M_IPF M_TEMP +# endif /* M_IPFILTER */ +# endif /* M_PFIL */ +# endif /* IPFILTER_M_IPFILTER */ +# if !defined(KMALLOC) +# define KMALLOC(a, b) (a) = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT) +# endif +# if !defined(KMALLOCS) +# define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT) +# endif +# if !defined(KFREE) +# define KFREE(x) free((x), _M_IPF) +# endif +# if !defined(KFREES) # define KFREES(x,s) free((x), _M_IPF) -# endif -# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) -# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) -# define WAKEUP(id,x) wakeup(id+x) -# if !defined(POLLWAKEUP) -# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) -# endif -# define GETIFP(n, v) ifunit(n) -# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu -# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu +# endif +# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) +# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) +# define WAKEUP(id,x) wakeup(id+x) +# if !defined(POLLWAKEUP) +# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) +# endif +# define GETIFP(n, v) ifunit(n) +# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu +# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu # if !defined(USE_MUTEXES) && !defined(SPL_NET) # define SPL_IMP(x) x = splimp() @@ -804,8 +804,8 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -# define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB -# define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB #ifndef IPVERSION # define IPVERSION 4 diff --git a/sys/contrib/ipfilter/netinet/ip_dstlist.c b/sys/contrib/ipfilter/netinet/ip_dstlist.c index 0c65e4cd6896..11e1a1846d89 100644 --- a/sys/contrib/ipfilter/netinet/ip_dstlist.c +++ b/sys/contrib/ipfilter/netinet/ip_dstlist.c @@ -27,7 +27,7 @@ # endif #endif #include -# include +#include #include #if defined(_KERNEL) && !defined(__SVR4) # include diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 3121e94f1488..0b5fc7285f93 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -11,7 +11,7 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ -# include +#include #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" @@ -19,7 +19,7 @@ # include #endif #if defined(BSD) && defined(_KERNEL) -# include +# include #endif #ifndef SOLARIS @@ -31,48 +31,48 @@ #endif #ifndef __P -# define __P(x) x +# define __P(x) x #endif -# define SIOCADAFR _IOW('r', 60, struct ipfobj) -# define SIOCRMAFR _IOW('r', 61, struct ipfobj) -# define SIOCSETFF _IOW('r', 62, u_int) -# define SIOCGETFF _IOR('r', 63, u_int) -# define SIOCGETFS _IOWR('r', 64, struct ipfobj) -# define SIOCIPFFL _IOWR('r', 65, int) -# define SIOCIPFFB _IOR('r', 66, int) -# define SIOCADIFR _IOW('r', 67, struct ipfobj) -# define SIOCRMIFR _IOW('r', 68, struct ipfobj) -# define SIOCSWAPA _IOR('r', 69, u_int) -# define SIOCINAFR _IOW('r', 70, struct ipfobj) -# define SIOCINIFR _IOW('r', 71, struct ipfobj) -# define SIOCFRENB _IOW('r', 72, u_int) -# define SIOCFRSYN _IOW('r', 73, u_int) -# define SIOCFRZST _IOWR('r', 74, struct ipfobj) -# define SIOCZRLST _IOWR('r', 75, struct ipfobj) -# define SIOCAUTHW _IOWR('r', 76, struct ipfobj) -# define SIOCAUTHR _IOWR('r', 77, struct ipfobj) -# define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) -# define SIOCSTLCK _IOWR('r', 79, u_int) -# define SIOCSTPUT _IOWR('r', 80, struct ipfobj) -# define SIOCSTGET _IOWR('r', 81, struct ipfobj) -# define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) -# define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) -# define SIOCSETLG _IOWR('r', 84, int) -# define SIOCGETLG _IOWR('r', 85, int) -# define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) -# define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) -# define SIOCIPFGET _IOWR('r', 88, struct ipfobj) -# define SIOCIPFSET _IOWR('r', 89, struct ipfobj) -# define SIOCIPFL6 _IOWR('r', 90, int) -# define SIOCIPFITER _IOWR('r', 91, struct ipfobj) -# define SIOCGENITER _IOWR('r', 92, struct ipfobj) -# define SIOCGTABL _IOWR('r', 93, struct ipfobj) -# define SIOCIPFDELTOK _IOWR('r', 94, int) -# define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) -# define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) -# define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) -# define SIOCIPFINTERROR _IOR('r', 98, int) +#define SIOCADAFR _IOW('r', 60, struct ipfobj) +#define SIOCRMAFR _IOW('r', 61, struct ipfobj) +#define SIOCSETFF _IOW('r', 62, u_int) +#define SIOCGETFF _IOR('r', 63, u_int) +#define SIOCGETFS _IOWR('r', 64, struct ipfobj) +#define SIOCIPFFL _IOWR('r', 65, int) +#define SIOCIPFFB _IOR('r', 66, int) +#define SIOCADIFR _IOW('r', 67, struct ipfobj) +#define SIOCRMIFR _IOW('r', 68, struct ipfobj) +#define SIOCSWAPA _IOR('r', 69, u_int) +#define SIOCINAFR _IOW('r', 70, struct ipfobj) +#define SIOCINIFR _IOW('r', 71, struct ipfobj) +#define SIOCFRENB _IOW('r', 72, u_int) +#define SIOCFRSYN _IOW('r', 73, u_int) +#define SIOCFRZST _IOWR('r', 74, struct ipfobj) +#define SIOCZRLST _IOWR('r', 75, struct ipfobj) +#define SIOCAUTHW _IOWR('r', 76, struct ipfobj) +#define SIOCAUTHR _IOWR('r', 77, struct ipfobj) +#define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) +#define SIOCSTLCK _IOWR('r', 79, u_int) +#define SIOCSTPUT _IOWR('r', 80, struct ipfobj) +#define SIOCSTGET _IOWR('r', 81, struct ipfobj) +#define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) +#define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) +#define SIOCSETLG _IOWR('r', 84, int) +#define SIOCGETLG _IOWR('r', 85, int) +#define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) +#define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) +#define SIOCIPFGET _IOWR('r', 88, struct ipfobj) +#define SIOCIPFSET _IOWR('r', 89, struct ipfobj) +#define SIOCIPFL6 _IOWR('r', 90, int) +#define SIOCIPFITER _IOWR('r', 91, struct ipfobj) +#define SIOCGENITER _IOWR('r', 92, struct ipfobj) +#define SIOCGTABL _IOWR('r', 93, struct ipfobj) +#define SIOCIPFDELTOK _IOWR('r', 94, int) +#define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) +#define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) +#define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) +#define SIOCIPFINTERROR _IOR('r', 98, int) #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR @@ -1640,14 +1640,14 @@ extern int ipf_qout(queue_t *, mblk_t *); extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **); extern int (*fr_checkp)(ip_t *, int, void *, int, mb_t **); extern size_t mbufchainlen(mb_t *); -# ifdef IPFILTER_LKM +# ifdef IPFILTER_LKM extern int ipf_identify(char *); -# endif -# if defined(__FreeBSD_version) +# endif +# if defined(__FreeBSD_version) extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *); -# elif defined(__NetBSD__) +# elif defined(__NetBSD__) extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *); -# endif +# endif # endif /* MENTAT */ # if defined(__FreeBSD_version) diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 7fc64cefb4c2..338c4e24c03a 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -34,9 +34,9 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -# include +#include #if defined(__FreeBSD_version) -#include +# include #endif #include #include @@ -44,7 +44,6 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include - #include #include #include @@ -75,19 +74,19 @@ static const char rcsid[] = "@(#)$Id$"; #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #ifdef IPFILTER_SCAN -#include "netinet/ip_scan.h" +# include "netinet/ip_scan.h" #endif #include "netinet/ip_pool.h" #include #include #ifdef CSUM_DATA_VALID -#include +# include #endif extern int ip_optcopy(struct ip *, struct ip *); -# ifdef IPFILTER_M_IPFILTER +#ifdef IPFILTER_M_IPFILTER MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures"); -# endif +#endif static int ipf_send_ip(fr_info_t *, mb_t *); @@ -98,8 +97,8 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { }; #define V_ipfmain VNET(ipfmain) -# include -# include +#include +#include VNET_DEFINE_STATIC(eventhandler_tag, ipf_arrivetag); VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); @@ -278,8 +277,8 @@ ipfdetach(softc) int ipfioctl(dev, cmd, data, mode, p) struct thread *p; -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#define p_cred td_ucred +#define p_uid td_ucred->cr_ruid struct cdev *dev; ioctlcmd_t cmd; caddr_t data; diff --git a/sys/contrib/ipfilter/netinet/ip_pool.c b/sys/contrib/ipfilter/netinet/ip_pool.c index fc2e78bfe27b..51d810baa310 100644 --- a/sys/contrib/ipfilter/netinet/ip_pool.c +++ b/sys/contrib/ipfilter/netinet/ip_pool.c @@ -732,7 +732,7 @@ ipf_pool_select_add_ref(arg, unit, name) /* */ /* Searches for an exact match of an entry in the pool. */ /* ------------------------------------------------------------------------ */ -extern void printhostmask(int, u_32_t *, u_32_t *)); +extern void printhostmask(int, u_32_t *, u_32_t *); static ip_pool_node_t * ipf_pool_findeq(softp, ipo, addr, mask) ipf_pool_softc_t *softp; From owner-dev-commits-src-main@freebsd.org Tue Feb 2 01:19:23 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B98C84F8E24; Tue, 2 Feb 2021 01:19:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV6RG5Z6Sz3njd; Tue, 2 Feb 2021 01:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 92498252E8; Tue, 2 Feb 2021 01:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1121JMNm079564; Tue, 2 Feb 2021 01:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121JMsF079563; Tue, 2 Feb 2021 01:19:22 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:19:22 GMT Message-Id: <202102020119.1121JMsF079563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0f34c80f3763 - main - Replace the redundant MENTAT macro with SOLARIS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f34c80f376345b98a972940dd4757e58d7beb06 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 01:19:24 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0f34c80f376345b98a972940dd4757e58d7beb06 commit 0f34c80f376345b98a972940dd4757e58d7beb06 Author: Cy Schubert AuthorDate: 2021-01-28 05:50:04 +0000 Commit: Cy Schubert CommitDate: 2021-02-02 01:19:15 +0000 Replace the redundant MENTAT macro with SOLARIS. MENTAT and SOLARIS are synonymous. Remove the extraneous duplicate macro. MFC after: 1 week --- contrib/ipfilter/ip_fil_compat.c | 50 +++++++++++++++---------------- contrib/ipfilter/tools/ipmon.c | 4 +-- sys/contrib/ipfilter/netinet/fil.c | 24 +++++++-------- sys/contrib/ipfilter/netinet/ip_auth.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_auth.h | 2 +- sys/contrib/ipfilter/netinet/ip_compat.h | 2 +- sys/contrib/ipfilter/netinet/ip_fil.h | 10 +++---- sys/contrib/ipfilter/netinet/ip_irc_pxy.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_log.c | 4 +-- sys/contrib/ipfilter/netinet/ip_nat.c | 18 +++++------ sys/contrib/ipfilter/netinet/ip_nat6.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_proxy.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_state.c | 2 +- 13 files changed, 69 insertions(+), 71 deletions(-) diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c index fbcfc8a0088f..6184502e0f58 100644 --- a/contrib/ipfilter/ip_fil_compat.c +++ b/contrib/ipfilter/ip_fil_compat.c @@ -333,7 +333,7 @@ typedef struct fr_info_4_1_32 { ip_t *ofin_ip; mb_t **fin_mp; /* pointer to pointer to mbuf */ mb_t *fin_m; /* pointer to mbuf */ -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; /* pointer to mblk where pkt starts */ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -371,7 +371,7 @@ typedef struct fr_info_4_1_24 { ip_t *ofin_ip; mb_t **fin_mp; mb_t *fin_m; -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -408,7 +408,7 @@ typedef struct fr_info_4_1_23 { ip_t *ofin_ip; mb_t **fin_mp; mb_t *fin_m; -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -444,7 +444,7 @@ typedef struct fr_info_4_1_11 { ip_t *ofin_ip; mb_t **fin_mp; mb_t *fin_m; -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -933,7 +933,7 @@ typedef struct frauth_4_1_32 { fr_info_4_1_32_t fra_info; char *fra_buf; u_32_t fra_flx; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -947,7 +947,7 @@ typedef struct frauth_4_1_29 { fr_info_4_1_24_t fra_info; char *fra_buf; u_32_t fra_flx; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -960,7 +960,7 @@ typedef struct frauth_4_1_24 { u_32_t fra_pass; fr_info_4_1_24_t fra_info; char *fra_buf; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -973,7 +973,7 @@ typedef struct frauth_4_1_23 { u_32_t fra_pass; fr_info_4_1_23_t fra_info; char *fra_buf; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -986,7 +986,7 @@ typedef struct frauth_4_1_11 { u_32_t fra_pass; fr_info_4_1_11_t fra_info; char *fra_buf; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -2533,7 +2533,7 @@ frauth_4_1_32_to_current(old, current) fr_info_4_1_32_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; fra->fra_flx = old->fra_flx; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2554,7 +2554,7 @@ frauth_4_1_29_to_current(old, current) fr_info_4_1_24_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; fra->fra_flx = old->fra_flx; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2574,7 +2574,7 @@ frauth_4_1_24_to_current(old, current) fra->fra_pass = old->fra_pass; fr_info_4_1_24_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2594,7 +2594,7 @@ frauth_4_1_23_to_current(old, current) fra->fra_pass = old->fra_pass; fr_info_4_1_23_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2614,7 +2614,7 @@ frauth_4_1_11_to_current(old, current) fra->fra_pass = old->fra_pass; fr_info_4_1_11_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2652,7 +2652,7 @@ fr_info_4_1_32_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -2690,7 +2690,7 @@ fr_info_4_1_24_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -2727,7 +2727,7 @@ fr_info_4_1_23_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -2764,7 +2764,7 @@ fr_info_4_1_11_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -4039,7 +4039,7 @@ fr_info_current_to_4_1_24(current, old) old->ofin_ip = fin->fin_ip; old->fin_mp = fin->fin_mp; old->fin_m = fin->fin_m; -#ifdef MENTAT +#if SOLARIS old->fin_qfm = fin->fin_qfm; old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; @@ -4079,7 +4079,7 @@ fr_info_current_to_4_1_23(current, old) old->ofin_ip = fin->fin_ip; old->fin_mp = fin->fin_mp; old->fin_m = fin->fin_m; -#ifdef MENTAT +#if SOLARIS old->fin_qfm = fin->fin_qfm; old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; @@ -4119,7 +4119,7 @@ fr_info_current_to_4_1_11(current, old) old->ofin_ip = fin->fin_ip; old->fin_mp = fin->fin_mp; old->fin_m = fin->fin_m; -#ifdef MENTAT +#if SOLARIS old->fin_qfm = fin->fin_qfm; old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; @@ -4141,7 +4141,7 @@ frauth_current_to_4_1_29(current, old) fr_info_current_to_4_1_24(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; old->fra_flx = fra->fra_flx; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif @@ -4161,7 +4161,7 @@ frauth_current_to_4_1_24(current, old) old->fra_pass = fra->fra_pass; fr_info_current_to_4_1_24(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif @@ -4181,7 +4181,7 @@ frauth_current_to_4_1_23(current, old) old->fra_pass = fra->fra_pass; fr_info_current_to_4_1_23(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif @@ -4201,7 +4201,7 @@ frauth_current_to_4_1_11(current, old) old->fra_pass = fra->fra_pass; fr_info_current_to_4_1_11(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif diff --git a/contrib/ipfilter/tools/ipmon.c b/contrib/ipfilter/tools/ipmon.c index 005cd316f91a..f14cef832722 100644 --- a/contrib/ipfilter/tools/ipmon.c +++ b/contrib/ipfilter/tools/ipmon.c @@ -108,7 +108,7 @@ char *reasons[] = { "natv6_in-fail", }; -#ifdef MENTAT +#if SOLARIS static char *pidfile = "/etc/opt/ipf/ipmon.pid"; #else static char *pidfile = "/var/run/ipmon.pid"; @@ -1108,7 +1108,7 @@ static void print_ipflog(conf, buf, blen) ifname[sizeof(ipf->fl_ifname)] = '\0'; sprintf(t, "%s", ifname); t += strlen(t); -# if defined(MENTAT) +# if SOLARIS if (ISALPHA(*(t - 1))) { sprintf(t, "%d", ipf->fl_unit); t += strlen(t); diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index a79d441284bf..2dca1e754b9e 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -2805,7 +2805,7 @@ ipf_firewall(fin, passp) /* ------------------------------------------------------------------------ */ int ipf_check(ctx, ip, hlen, ifp, out -#if defined(_KERNEL) && defined(MENTAT) +#if defined(_KERNEL) && SOLARIS , qif, mp) void *qif; #else @@ -2837,7 +2837,7 @@ ipf_check(ctx, ip, hlen, ifp, out * to hold all the required packet headers. */ #ifdef _KERNEL -# ifdef MENTAT +# if SOLARIS qpktinfo_t *qpi = qif; # ifdef __sparc @@ -2854,7 +2854,7 @@ ipf_check(ctx, ip, hlen, ifp, out bzero((char *)fin, sizeof(*fin)); -# ifdef MENTAT +# if SOLARIS if (qpi->qpi_flags & QF_BROADCAST) fin->fin_flx |= FI_MBCAST|FI_BROADCAST; if (qpi->qpi_flags & QF_MULTICAST) @@ -2862,7 +2862,7 @@ ipf_check(ctx, ip, hlen, ifp, out m = qpi->qpi_m; fin->fin_qfm = m; fin->fin_qpi = qpi; -# else /* MENTAT */ +# else /* SOLARIS */ m = *mp; @@ -2895,7 +2895,7 @@ ipf_check(ctx, ip, hlen, ifp, out m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } # endif /* CSUM_DELAY_DATA */ -# endif /* MENTAT */ +# endif /* SOLARIS */ #else bzero((char *)fin, sizeof(*fin)); m = *mp; @@ -6156,7 +6156,7 @@ ipf_getifname(ifp, buffer) char *buffer; { static char namebuf[LIFNAMSIZ]; -# if defined(MENTAT) || defined(__FreeBSD__) +# if SOLARIS || defined(__FreeBSD__) int unit, space; char temp[20]; char *s; @@ -6166,7 +6166,7 @@ ipf_getifname(ifp, buffer) buffer = namebuf; (void) strncpy(buffer, ifp->if_name, LIFNAMSIZ); buffer[LIFNAMSIZ - 1] = '\0'; -# if defined(MENTAT) || defined(__FreeBSD__) +# if SOLARIS || defined(__FreeBSD__) for (s = buffer; *s; s++) ; unit = ifp->if_unit; @@ -6916,7 +6916,7 @@ ipf_coalesce(fin) DT1(frb_coalesce, fr_info_t *, fin); LBUMP(ipf_stats[fin->fin_out].fr_badcoalesces); -# ifdef MENTAT +# if SOLARIS FREE_MB_T(*fin->fin_mp); # endif fin->fin_reason = FRB_COALESCE; @@ -8397,7 +8397,7 @@ ipf_ipf_ioctl(softc, data, cmd, mode, uid, ctx) error = EPERM; } else { WRITE_ENTER(&softc->ipf_global); -#if (defined(MENTAT) && defined(_KERNEL)) && !defined(INSTANCES) +#if (SOLARIS && defined(_KERNEL)) && !defined(INSTANCES) error = ipfsync(); #else ipf_sync(softc, NULL); @@ -8570,7 +8570,7 @@ ipf_decaps(fin, pass, l5proto) fino = fin; fin = &fin2; elen = hlen; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += elen; #else m->m_data += elen; @@ -8609,7 +8609,7 @@ ipf_decaps(fin, pass, l5proto) if (ipf_makefrip(hlen, ip, fin) == -1) { cantdecaps2: if (m != NULL) { -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr -= elen; #else m->m_data -= elen; @@ -8642,7 +8642,7 @@ cantdecaps: fino->fin_m = fin->fin_m; m = fin->fin_m; if (m != NULL) { -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr -= elen; #else m->m_data -= elen; diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 4864a8128494..c40bb1b435f2 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -94,7 +94,7 @@ #include #include "netinet/ip_fil.h" #include "netinet/ip_auth.h" -#if !defined(MENTAT) +#if !SOLARIS # include # ifdef __FreeBSD__ # include @@ -466,7 +466,7 @@ ipf_auth_new(m, fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_auth_softc_t *softa = softc->ipf_auth_soft; -#if defined(_KERNEL) && defined(MENTAT) +#if defined(_KERNEL) && SOLARIS qpktinfo_t *qpi = fin->fin_qpi; #endif frauth_t *fra; @@ -508,7 +508,7 @@ ipf_auth_new(m, fin) * them. */ ip = fin->fin_ip; -# if defined(MENTAT) && defined(_KERNEL) +# if SOLARIS && defined(_KERNEL) if ((ip == (ip_t *)m->b_rptr) && (fin->fin_v == 4)) # endif { diff --git a/sys/contrib/ipfilter/netinet/ip_auth.h b/sys/contrib/ipfilter/netinet/ip_auth.h index e914dacacdf0..17df74c31de6 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.h +++ b/sys/contrib/ipfilter/netinet/ip_auth.h @@ -22,7 +22,7 @@ typedef struct frauth { fr_info_t fra_info; char *fra_buf; u_32_t fra_flx; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 756731480836..490e939f7f37 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -448,7 +448,7 @@ typedef struct ip6_hdr ip6_t; #endif #if defined(_KERNEL) -# if defined(MENTAT) && !defined(INSTANCES) +# if SOLARIS && !defined(INSTANCES) # define COPYDATA mb_copydata # define COPYBACK mb_copyback # else diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 0b5fc7285f93..72def439b3e8 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -402,7 +402,7 @@ typedef struct fr_info { } fin_ipu; mb_t **fin_mp; /* pointer to pointer to mbuf */ mb_t *fin_m; /* pointer to mbuf */ -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; /* pointer to mblk where pkt starts */ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -1626,8 +1626,7 @@ extern void ipfilterattach(int); # endif extern int ipl_enable(void); extern int ipl_disable(void); -# ifdef MENTAT -/* XXX MENTAT is always defined for Solaris */ +# if SOLARIS extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, void *, mblk_t **); # if SOLARIS @@ -1635,8 +1634,7 @@ extern void ipf_prependmbt(fr_info_t *, mblk_t *); extern int ipfioctl(dev_t, int, intptr_t, int, cred_t *, int *); # endif extern int ipf_qout(queue_t *, mblk_t *); -# else /* MENTAT */ -/* XXX MENTAT is never defined for FreeBSD & NetBSD */ +# else /* SOLARIS */ extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **); extern int (*fr_checkp)(ip_t *, int, void *, int, mb_t **); extern size_t mbufchainlen(mb_t *); @@ -1648,7 +1646,7 @@ extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *); # elif defined(__NetBSD__) extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *); # endif -# endif /* MENTAT */ +# endif /* SOLARIS */ # if defined(__FreeBSD_version) extern int ipf_pfil_hook(void); diff --git a/sys/contrib/ipfilter/netinet/ip_irc_pxy.c b/sys/contrib/ipfilter/netinet/ip_irc_pxy.c index 304fe0c35351..4446b2100645 100644 --- a/sys/contrib/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_irc_pxy.c @@ -267,7 +267,7 @@ ipf_p_irc_send(fin, nat) u_int a1; ip_t *ip; mb_t *m; -#ifdef MENTAT +#if SOLARIS mb_t *m1; #endif softc = fin->fin_main_soft; @@ -322,7 +322,7 @@ ipf_p_irc_send(fin, nat) if ((inc + fin->fin_plen) > 65535) return 0; -#ifdef MENTAT +#if SOLARIS for (m1 = m; m1->b_cont; m1 = m1->b_cont) ; if ((inc > 0) && (m1->b_datap->db_lim - m1->b_wptr < inc)) { @@ -357,7 +357,7 @@ ipf_p_irc_send(fin, nat) fin->fin_flx |= FI_DOCKSUM; if (inc != 0) { -#if defined(MENTAT) +#if SOLARIS register u_32_t sum1, sum2; sum1 = fin->fin_plen; diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c index 76d2e3def1fa..e5bf6a78bf1b 100644 --- a/sys/contrib/ipfilter/netinet/ip_log.c +++ b/sys/contrib/ipfilter/netinet/ip_log.c @@ -488,7 +488,7 @@ ipf_log_pkt(fin, flags) ptrs[0] = (void *)&ipfl; sizes[0] = sizeof(ipfl); types[0] = 0; -# if defined(MENTAT) && defined(_KERNEL) +# if SOLARIS && defined(_KERNEL) /* * Are we copied from the mblk or an aligned array ? */ @@ -505,7 +505,7 @@ ipf_log_pkt(fin, flags) ptrs[1] = m; sizes[1] = hlen + mlen; types[1] = 1; -# endif /* MENTAT */ +# endif /* SOLARIS */ return ipf_log_items(softc, IPL_LOGIPF, fin, ptrs, sizes, types, 2); } diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index bc0883ac7382..17c1133e145d 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -3661,7 +3661,7 @@ ipf_nat_icmperrorlookup(fin, dir) mb_t *m; m = fin->fin_m; -# if defined(MENTAT) +# if SOLARIS if ((char *)oip + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)m->b_wptr) { ATOMIC_INCL(nside->ns_icmp_mbuf); @@ -5116,7 +5116,7 @@ ipf_nat_out(fin, nat, natadd, nflags) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, msumd, 0); } -#if !defined(_KERNEL) || defined(MENTAT) || \ +#if !defined(_KERNEL) || SOLARIS || \ defined(BRIDGE_IPF) || defined(__FreeBSD__) else { /* @@ -5179,7 +5179,7 @@ ipf_nat_out(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; @@ -5228,7 +5228,7 @@ ipf_nat_out(fin, nat, natadd, nflags) uh = (udphdr_t *)(ip + 1); uh->uh_ulen += fin->fin_plen; uh->uh_ulen = htons(uh->uh_ulen); -#if !defined(_KERNEL) || defined(MENTAT) || \ +#if !defined(_KERNEL) || SOLARIS || \ defined(BRIDGE_IPF) || defined(__FreeBSD__) ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif @@ -5631,7 +5631,7 @@ ipf_nat_in(fin, nat, natadd, nflags) } fin->fin_ip->ip_dst = nat->nat_ndstip; fin->fin_daddr = nat->nat_ndstaddr; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, ipsumd, 0); #endif break; @@ -5648,7 +5648,7 @@ ipf_nat_in(fin, nat, natadd, nflags) } fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_incksum(0, &fin->fin_ip->ip_sum, ipsumd, 0); #endif break; @@ -5680,7 +5680,7 @@ ipf_nat_in(fin, nat, natadd, nflags) sum2 += ntohs(ip->ip_off) & IP_DF; CALC_SUMD(sum1, sum2, sumd); -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif PREP_MB_T(fin, m); @@ -5706,7 +5706,7 @@ ipf_nat_in(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; @@ -7429,7 +7429,7 @@ ipf_nat_decap(fin, nat) CALC_SUMD(sum1, sum2, sumd); fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, sumd, 0); #endif } diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c index 388ee9a67e73..b2713aec812a 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat6.c +++ b/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -1434,7 +1434,7 @@ ipf_nat6_icmperrorlookup(fin, dir) mb_t *m; m = fin->fin_m; -# if defined(MENTAT) +# if SOLARIS if ((char *)oip6 + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)m->b_wptr) { ATOMIC_INCL(nside->ns_icmp_mbuf); @@ -2858,7 +2858,7 @@ ipf_nat6_out(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; @@ -3321,7 +3321,7 @@ ipf_nat6_in(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 227ca817f6e4..2c6b4eb6369d 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -914,7 +914,7 @@ ipf_proxy_check(fin, nat) ip_t *ip; short rv; int err; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS u_32_t s1, s2, sd; #endif @@ -942,7 +942,7 @@ ipf_proxy_check(fin, nat) * If there is data in this packet to be proxied then try and * get it all into the one buffer, else drop it. */ -#if defined(MENTAT) || defined(HAVE_M_PULLDOWN) +#if SOLARIS || defined(HAVE_M_PULLDOWN) if ((fin->fin_dlen > 0) && !(fin->fin_flx & FI_COALESCE)) if (ipf_coalesce(fin) == -1) { if (softp->ips_proxy_debug & 0x08) @@ -1006,7 +1006,7 @@ ipf_proxy_check(fin, nat) * packet. */ adjlen = APR_INC(err); -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS s1 = LONG_SUM(fin->fin_plen - adjlen); s2 = LONG_SUM(fin->fin_plen); CALC_SUMD(s1, s2, sd); diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index 45a641fd86a2..a050a2d324d2 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -2739,7 +2739,7 @@ ipf_checkicmpmatchingstate(fin) mb_t *m; m = fin->fin_m; -# if defined(MENTAT) +# if SOLARIS if ((char *)oip + len > (char *)m->b_wptr) { SBUMPDX(ipf_state_stats, iss_icmp_short, iss_icmp_short_2); return NULL; From owner-dev-commits-src-main@freebsd.org Tue Feb 2 08:49:00 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AEC6752A71E; Tue, 2 Feb 2021 08:49:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVJQ44RSBz4fRy; Tue, 2 Feb 2021 08:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 86E993397; Tue, 2 Feb 2021 08:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1128n0eI065969; Tue, 2 Feb 2021 08:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1128n05V065968; Tue, 2 Feb 2021 08:49:00 GMT (envelope-from git) Date: Tue, 2 Feb 2021 08:49:00 GMT Message-Id: <202102020849.1128n05V065968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: 49429cf9be7f - main - bhyve/vioapic: remove an extra pin masked check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49429cf9be7f43c37723175f90c56b29e29d1680 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 08:49:00 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=49429cf9be7f43c37723175f90c56b29e29d1680 commit 49429cf9be7f43c37723175f90c56b29e29d1680 Author: Roger Pau Monné AuthorDate: 2021-01-19 11:52:44 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-02 08:44:20 +0000 bhyve/vioapic: remove an extra pin masked check vioapic_send_intr does already check whether the pin is masked before injecting the interrupt, there's no need to do it in vioapic_write also. No functional change intended. Reviewed by: grehan Differential revision: https://reviews.freebsd.org/D28236 --- sys/amd64/vmm/io/vioapic.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index a8117da4b879..682e862da63e 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -363,12 +363,10 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) /* * Generate an interrupt if the following conditions are met: - * - pin is not masked * - previous interrupt has been EOIed * - pin level is asserted */ - if ((vioapic->rtbl[pin].reg & IOART_INTMASK) == IOART_INTMCLR && - (vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && + if ((vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && (vioapic->rtbl[pin].acnt > 0)) { VIOAPIC_CTR2(vioapic, "ioapic pin%d: asserted at rtbl " "write, acnt %d", pin, vioapic->rtbl[pin].acnt); From owner-dev-commits-src-main@freebsd.org Tue Feb 2 08:49:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B947F52A8C3; Tue, 2 Feb 2021 08:49:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVJQ54xCNz4fV0; Tue, 2 Feb 2021 08:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9CC7A3596; Tue, 2 Feb 2021 08:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1128n1ww065991; Tue, 2 Feb 2021 08:49:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1128n1hu065990; Tue, 2 Feb 2021 08:49:01 GMT (envelope-from git) Date: Tue, 2 Feb 2021 08:49:01 GMT Message-Id: <202102020849.1128n1hu065990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: d7d067698a38 - main - bhyve/ioapic: only account for asserted line in level mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7d067698a38a3464a58eb34f68f63e529c45136 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 08:49:01 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=d7d067698a38a3464a58eb34f68f63e529c45136 commit d7d067698a38a3464a58eb34f68f63e529c45136 Author: Roger Pau Monné AuthorDate: 2021-01-19 12:41:03 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-02 08:45:45 +0000 bhyve/ioapic: only account for asserted line in level mode After modifying a redirection entry only try to inject an interrupt if the pin is in level mode, pins in edge mode shouldn't take into account the line assert status as they are triggered by edge changes, not the line status itself. Reviewed by: grehan Differential revision: https://reviews.freebsd.org/D28237 --- sys/amd64/vmm/io/vioapic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index 682e862da63e..941f7c7364bc 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -364,9 +364,11 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) /* * Generate an interrupt if the following conditions are met: * - previous interrupt has been EOIed + * - pin trigger mode is level * - pin level is asserted */ if ((vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && + (vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGRLVL && (vioapic->rtbl[pin].acnt > 0)) { VIOAPIC_CTR2(vioapic, "ioapic pin%d: asserted at rtbl " "write, acnt %d", pin, vioapic->rtbl[pin].acnt); From owner-dev-commits-src-main@freebsd.org Tue Feb 2 08:49:03 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6436C52A34B; Tue, 2 Feb 2021 08:49:03 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVJQ70kZmz4fVD; Tue, 2 Feb 2021 08:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BDF9D3278; Tue, 2 Feb 2021 08:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1128n2BI066010; Tue, 2 Feb 2021 08:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1128n2DU066009; Tue, 2 Feb 2021 08:49:02 GMT (envelope-from git) Date: Tue, 2 Feb 2021 08:49:02 GMT Message-Id: <202102020849.1128n2DU066009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: 5ea878684f6c - main - bhyve/ioapic: improve the tracking of IRR bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ea878684f6cfff4ad05186346ff3a4828d980ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 08:49:03 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea878684f6cfff4ad05186346ff3a4828d980ca commit 5ea878684f6cfff4ad05186346ff3a4828d980ca Author: Roger Pau Monné AuthorDate: 2021-01-19 11:52:28 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-02 08:47:00 +0000 bhyve/ioapic: improve the tracking of IRR bit One common method of EOI'ing an interrupt at the IO-APIC level is to switch the pin to edge triggering mode and then back into level mode. That would cause the IRR bit to be cleared and thus further interrupts to be injected. FreeBSD does indeed use that method if the IO-APIC EOI register is not supported. The bhyve IO-APIC emulation code didn't clear the IRR bit when doing that switch, and was also missing acknowledging the IRR state when trying to inject an interrupt in vioapic_send_intr. Reviewed by: grehan Differential revision: https://reviews.freebsd.org/D28238 --- sys/amd64/vmm/io/vioapic.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index 941f7c7364bc..639c1b07eb08 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -122,8 +122,14 @@ vioapic_send_intr(struct vioapic *vioapic, int pin) phys = ((low & IOART_DESTMOD) == IOART_DESTPHY); delmode = low & IOART_DELMOD; level = low & IOART_TRGRLVL ? true : false; - if (level) + if (level) { + if ((low & IOART_REM_IRR) != 0) { + VIOAPIC_CTR1(vioapic, "ioapic pin%d: irr pending", + pin); + return; + } vioapic->rtbl[pin].reg |= IOART_REM_IRR; + } vector = low & IOART_INTVEC; dest = high >> APIC_ID_SHIFT; @@ -342,6 +348,16 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) vioapic->rtbl[pin].reg &= ~mask64 | RTBL_RO_BITS; vioapic->rtbl[pin].reg |= data64 & ~RTBL_RO_BITS; + /* + * Switching from level to edge triggering will clear the IRR + * bit. This is what FreeBSD will do in order to EOI an + * interrupt when the IO-APIC doesn't support targeted EOI (see + * _ioapic_eoi_source). + */ + if ((vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGREDG && + (vioapic->rtbl[pin].reg & IOART_REM_IRR) != 0) + vioapic->rtbl[pin].reg &= ~IOART_REM_IRR; + VIOAPIC_CTR2(vioapic, "ioapic pin%d: redir table entry %#lx", pin, vioapic->rtbl[pin].reg); @@ -363,12 +379,10 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) /* * Generate an interrupt if the following conditions are met: - * - previous interrupt has been EOIed * - pin trigger mode is level * - pin level is asserted */ - if ((vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && - (vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGRLVL && + if ((vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGRLVL && (vioapic->rtbl[pin].acnt > 0)) { VIOAPIC_CTR2(vioapic, "ioapic pin%d: asserted at rtbl " "write, acnt %d", pin, vioapic->rtbl[pin].acnt); From owner-dev-commits-src-main@freebsd.org Tue Feb 2 09:09:36 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D5D4A52B1FC; Tue, 2 Feb 2021 09:09:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVJsr5lxnz4jFG; Tue, 2 Feb 2021 09:09:36 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B43A3382A; Tue, 2 Feb 2021 09:09:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11299aFi092321; Tue, 2 Feb 2021 09:09:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11299a3I092320; Tue, 2 Feb 2021 09:09:36 GMT (envelope-from git) Date: Tue, 2 Feb 2021 09:09:36 GMT Message-Id: <202102020909.11299a3I092320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: c69047ca7526 - main - Revert "diff: eliminate a useless lseek" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c69047ca7526090cc2aa92c57d9f21a77a82fc2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 09:09:36 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c69047ca7526090cc2aa92c57d9f21a77a82fc2e commit c69047ca7526090cc2aa92c57d9f21a77a82fc2e Author: Baptiste Daroussin AuthorDate: 2021-02-02 09:07:57 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-02 09:08:25 +0000 Revert "diff: eliminate a useless lseek" This changes breaks when one of the files is stdin This reverts commit fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1. Reported by: olivier --- usr.bin/diff/diffreg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 4c9211510459..1b28281024c6 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -490,6 +490,7 @@ opentemp(const char *f) } } close(ifd); + lseek(ofd, (off_t)0, SEEK_SET); return (fdopen(ofd, "r")); } From owner-dev-commits-src-main@freebsd.org Tue Feb 2 10:08:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C1AAB52C157; Tue, 2 Feb 2021 10:08: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVL9l54Qbz4lx7; Tue, 2 Feb 2021 10:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A0DC5445E; Tue, 2 Feb 2021 10:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112A8RFA069893; Tue, 2 Feb 2021 10:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112A8RkU069892; Tue, 2 Feb 2021 10:08:27 GMT (envelope-from git) Date: Tue, 2 Feb 2021 10:08:27 GMT Message-Id: <202102021008.112A8RkU069892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 83c20b8a2da0 - main - tests/sys/kern/crc32: Check for SSE4.2 before using it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83c20b8a2da04937cf4af127366b3dc92c855784 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 10:08:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=83c20b8a2da04937cf4af127366b3dc92c855784 commit 83c20b8a2da04937cf4af127366b3dc92c855784 Author: Alex Richardson AuthorDate: 2021-02-02 09:52:52 +0000 Commit: Alex Richardson CommitDate: 2021-02-02 09:53:39 +0000 tests/sys/kern/crc32: Check for SSE4.2 before using it This avoids a SIGILL when running these tests on QEMU (which defaults to a basic amd64 CPU without SSE4.2). This commit also tests the table-based implementations in addition to testing the hw-accelerated crc32 versions. Reviewed By: cem, kib, markj Differential Revision: https://reviews.freebsd.org/D28395 --- sys/libkern/gsb_crc32.c | 16 ++++++--- sys/sys/gsb_crc32.h | 7 +++- tests/sys/kern/Makefile | 14 ++++---- tests/sys/kern/libkern_crc32.c | 73 ++++++++++++++++++++++++------------------ 4 files changed, 65 insertions(+), 45 deletions(-) diff --git a/sys/libkern/gsb_crc32.c b/sys/libkern/gsb_crc32.c index b2f7421c20eb..170ceb3aa710 100644 --- a/sys/libkern/gsb_crc32.c +++ b/sys/libkern/gsb_crc32.c @@ -46,11 +46,11 @@ __FBSDID("$FreeBSD$"); #include +#include #ifdef _KERNEL #include #include -#include #if defined(__amd64__) || defined(__i386__) #include @@ -216,7 +216,10 @@ static const uint32_t crc32Table[256] = { 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L }; -static uint32_t +#ifndef TESTING +static +#endif +uint32_t singletable_crc32c(uint32_t crc, const void *buf, size_t size) { const uint8_t *p = buf; @@ -730,10 +733,13 @@ crc32c_sb8_64_bit(uint32_t crc, return crc; } -static uint32_t +#ifndef TESTING +static +#endif +uint32_t multitable_crc32c(uint32_t crc32c, - const unsigned char *buffer, - unsigned int length) + const void *buffer, + size_t length) { uint32_t to_even_word; diff --git a/sys/sys/gsb_crc32.h b/sys/sys/gsb_crc32.h index c5a42d3d3152..dc126a5258fb 100644 --- a/sys/sys/gsb_crc32.h +++ b/sys/sys/gsb_crc32.h @@ -32,10 +32,10 @@ crc32(const void *buf, size_t size) crc = crc32_raw(buf, size, ~0U); return (crc ^ ~0U); } +#endif uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length); -#endif #if defined(__amd64__) || defined(__i386__) uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); @@ -44,4 +44,9 @@ uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); uint32_t armv8_crc32c(uint32_t, const unsigned char *, unsigned int); #endif +#ifdef TESTING +uint32_t singletable_crc32c(uint32_t, const void *, size_t); +uint32_t multitable_crc32c(uint32_t, const void *, size_t); +#endif + #endif /* !_SYS_GSB_CRC32_H_ */ diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 1806d7ce8597..f350b740b7ea 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt -.if ${MACHINE_ARCH} == "amd64" || \ - ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "aarch64" ATF_TESTS_C+= libkern_crc32 +SRCS.libkern_crc32+= libkern_crc32.c +.PATH: ${SRCTOP}/sys/libkern +SRCS.libkern_crc32+= gsb_crc32.c +CFLAGS.libkern_crc32+= -DTESTING .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c -.else -LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S -.endif +SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c +.elif ${MACHINE_CPUARCH} == "aarch64" +SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S .endif # subr_unit.c contains functions whose prototypes lie in headers that cannot be diff --git a/tests/sys/kern/libkern_crc32.c b/tests/sys/kern/libkern_crc32.c index 39cb8ca5aeeb..dd9508e1ebd6 100644 --- a/tests/sys/kern/libkern_crc32.c +++ b/tests/sys/kern/libkern_crc32.c @@ -33,10 +33,46 @@ #include -#if !defined(__amd64__) && !defined(__i386__) && !defined(__aarch64__) -#error These tests are not supported on this platform +#if defined(__amd64__) || defined(__i386__) +#include +#include + +static bool +have_sse42(void) +{ + u_int cpu_registers[4]; + + do_cpuid(1, cpu_registers); + + return ((cpu_registers[2] & CPUID2_SSE42) != 0); +} #endif +static void +check_crc32c(uint32_t expected, uint32_t crc32c, const void *buffer, + size_t length) +{ + uint32_t act; + +#if defined(__amd64__) || defined(__i386__) + if (have_sse42()) { + act = sse42_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "sse42_crc32c expected 0x%08x, got 0x%08x", expected, act); + } +#elif defined(__aarch64__) + act = armv8_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "armv8_crc32c expected 0x%08x, got 0x%08x", expected, act); +#endif + act = singletable_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "singletable_crc32c expected 0x%08x, got 0x%08x", expected, act); + act = multitable_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "multitable_crc32c expected 0x%08x, got 0x%08x", expected, act); +} + ATF_TC_WITHOUT_HEAD(crc32c_basic_correctness); ATF_TC_BODY(crc32c_basic_correctness, tc) { @@ -77,21 +113,11 @@ ATF_TC_BODY(crc32c_basic_correctness, tc) 0xfd562dc3, }; size_t i; - uint32_t act; ATF_REQUIRE(nitems(inputs) == nitems(results)); for (i = 0; i < nitems(inputs); i++) { -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, (const void *)&inputs[i], - sizeof(inputs[0])); -#else - act = armv8_crc32c(~0, (const void *)&inputs[i], - sizeof(inputs[0])); -#endif - ATF_REQUIRE_MSG(act == results[i], - "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)inputs[i], - results[i], act); + check_crc32c(results[i], ~0u, &inputs[i], sizeof(inputs[0])); } } @@ -102,20 +128,10 @@ ATF_TC_BODY(crc32c_alignment, tc) const uint32_t result = 0x2ce33ede; unsigned char buf[15]; size_t i; - uint32_t act; - for (i = 1; i < 8; i++) { memcpy(&buf[i], &input, sizeof(input)); - -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, (const void *)&buf[i], sizeof(input)); -#else - act = armv8_crc32c(~0, (const void *)&buf[i], sizeof(input)); -#endif - ATF_REQUIRE_MSG(act == result, - "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)input, - result, act); + check_crc32c(result, ~0u, &buf[i], sizeof(input)); } } @@ -127,15 +143,8 @@ ATF_TC_BODY(crc32c_trailing_bytes, tc) 0xd4, 0x4, 0x5e, 0xa9, 0xb3 }; const uint32_t result = 0xec638d62; - uint32_t act; -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, input, sizeof(input)); -#else - act = armv8_crc32c(~0, input, sizeof(input)); -#endif - ATF_REQUIRE_MSG(act == result, "expected 0x%08x, got 0x%08x", result, - act); + check_crc32c(result, ~0u, input, sizeof(input)); } ATF_TP_ADD_TCS(tp) From owner-dev-commits-src-main@freebsd.org Tue Feb 2 10:08:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D8C9252C374; Tue, 2 Feb 2021 10:08:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVL9m5nW2z4m0N; Tue, 2 Feb 2021 10:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BA080445F; Tue, 2 Feb 2021 10:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112A8SIa069913; Tue, 2 Feb 2021 10:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112A8Skf069912; Tue, 2 Feb 2021 10:08:28 GMT (envelope-from git) Date: Tue, 2 Feb 2021 10:08:28 GMT Message-Id: <202102021008.112A8Skf069912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 40407d3998d1 - main - tests/sys/audit: Skip extattr tests if extattrs are not supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40407d3998d1a12cbe929721f4dbe72b4be478a6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 10:08:28 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=40407d3998d1a12cbe929721f4dbe72b4be478a6 commit 40407d3998d1a12cbe929721f4dbe72b4be478a6 Author: Alex Richardson AuthorDate: 2021-02-02 09:55:18 +0000 Commit: Alex Richardson CommitDate: 2021-02-02 09:55:19 +0000 tests/sys/audit: Skip extattr tests if extattrs are not supported In the CheriBSD CI, we run the testsuite with /tmp as tmpfs. This causes the extattr audit tests to fail since tmpfs does not (yet) support extattrs. Skip those tests if the target path is on a file system that does not support extended file attributes. While touching these two files also convert the ATF_REQUIRE_EQ(-1, ...) checks to use ATF_REQURIE_ERRNO(). Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D28392 --- tests/sys/audit/file-attribute-access.c | 129 ++++++++++++++++++-------------- tests/sys/audit/file-attribute-modify.c | 106 +++++++++++++++----------- tests/sys/audit/utils.c | 18 +++++ tests/sys/audit/utils.h | 21 ++++++ 4 files changed, 173 insertions(+), 101 deletions(-) diff --git a/tests/sys/audit/file-attribute-access.c b/tests/sys/audit/file-attribute-access.c index 016d5772b933..9f4514bc3fde 100644 --- a/tests/sys/audit/file-attribute-access.c +++ b/tests/sys/audit/file-attribute-access.c @@ -27,13 +27,15 @@ #include #include -#include #include #include #include +#include #include +#include #include +#include #include #include "utils.h" @@ -89,7 +91,7 @@ ATF_TC_BODY(stat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, stat(errpath, &statbuff)); + ATF_REQUIRE_ERRNO(ENOENT, stat(errpath, &statbuff) == -1); check_audit(fds, failurereg, pipefd); } @@ -132,7 +134,7 @@ ATF_TC_BODY(lstat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lstat(errpath, &statbuff)); + ATF_REQUIRE_ERRNO(ENOENT, lstat(errpath, &statbuff) == -1); check_audit(fds, failurereg, pipefd); } @@ -180,7 +182,7 @@ ATF_TC_BODY(fstat_failure, tc) FILE *pipefd = setup(fds, auclass); const char *regex = "fstat.*return,failure : Bad file descriptor"; /* Failure reason: bad file descriptor */ - ATF_REQUIRE_EQ(-1, fstat(-1, &statbuff)); + ATF_REQUIRE_ERRNO(EBADF, fstat(-1, &statbuff) == -1); check_audit(fds, regex, pipefd); } @@ -224,8 +226,8 @@ ATF_TC_BODY(fstatat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, fstatat(AT_FDCWD, path, &statbuff, - AT_SYMLINK_NOFOLLOW)); + ATF_REQUIRE_ERRNO(ENOENT, + fstatat(AT_FDCWD, path, &statbuff, AT_SYMLINK_NOFOLLOW) == -1); check_audit(fds, failurereg, pipefd); } @@ -269,7 +271,7 @@ ATF_TC_BODY(statfs_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, statfs(errpath, &statfsbuff)); + ATF_REQUIRE_ERRNO(ENOENT, statfs(errpath, &statfsbuff) == -1); check_audit(fds, failurereg, pipefd); } @@ -319,7 +321,7 @@ ATF_TC_BODY(fstatfs_failure, tc) FILE *pipefd = setup(fds, auclass); const char *regex = "fstatfs.*return,failure : Bad file descriptor"; /* Failure reason: bad file descriptor */ - ATF_REQUIRE_EQ(-1, fstatfs(-1, &statfsbuff)); + ATF_REQUIRE_ERRNO(EBADF, fstatfs(-1, &statfsbuff) == -1); check_audit(fds, regex, pipefd); } @@ -364,7 +366,7 @@ ATF_TC_BODY(getfsstat_failure, tc) const char *regex = "getfsstat.*return,failure : Invalid argument"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid value for mode */ - ATF_REQUIRE_EQ(-1, getfsstat(NULL, 0, -1)); + ATF_REQUIRE_ERRNO(EINVAL, getfsstat(NULL, 0, -1) == -1); check_audit(fds, regex, pipefd); } @@ -409,7 +411,7 @@ ATF_TC_BODY(lgetfh_failure, tc) const char *regex = "lgetfh.*return,failure"; FILE *pipefd = setup(fds, "fa"); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lgetfh(errpath, &fht)); + ATF_REQUIRE_ERRNO(ENOENT, lgetfh(errpath, &fht) == -1); check_audit(fds, regex, pipefd); } @@ -465,7 +467,7 @@ ATF_TC_BODY(fhopen_failure, tc) * Failure reason: NULL does not represent any file handle * and O_CREAT is not allowed as the flag for fhopen(2) */ - ATF_REQUIRE_EQ(-1, fhopen(NULL, O_CREAT)); + ATF_REQUIRE_ERRNO(EINVAL, fhopen(NULL, O_CREAT) == -1); check_audit(fds, regex, pipefd); } @@ -516,7 +518,7 @@ ATF_TC_BODY(fhstat_failure, tc) const char *regex = "fhstat.*return,failure : Bad address"; FILE *pipefd = setup(fds, auclass); /* Failure reason: NULL does not represent any file handle */ - ATF_REQUIRE_EQ(-1, fhstat(NULL, NULL)); + ATF_REQUIRE_ERRNO(EFAULT, fhstat(NULL, NULL) == -1); check_audit(fds, regex, pipefd); } @@ -567,7 +569,7 @@ ATF_TC_BODY(fhstatfs_failure, tc) const char *regex = "fhstatfs.*return,failure : Bad address"; FILE *pipefd = setup(fds, auclass); /* Failure reason: NULL does not represent any file handle */ - ATF_REQUIRE_EQ(-1, fhstatfs(NULL, NULL)); + ATF_REQUIRE_ERRNO(EFAULT, fhstatfs(NULL, NULL) == -1); check_audit(fds, regex, pipefd); } @@ -611,7 +613,7 @@ ATF_TC_BODY(access_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, access(errpath, F_OK)); + ATF_REQUIRE_ERRNO(ENOENT, access(errpath, F_OK) == -1); check_audit(fds, failurereg, pipefd); } @@ -655,7 +657,7 @@ ATF_TC_BODY(eaccess_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, eaccess(errpath, F_OK)); + ATF_REQUIRE_ERRNO(ENOENT, eaccess(errpath, F_OK) == -1); check_audit(fds, failurereg, pipefd); } @@ -699,7 +701,8 @@ ATF_TC_BODY(faccessat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, faccessat(AT_FDCWD, errpath, F_OK, AT_EACCESS)); + ATF_REQUIRE_ERRNO(ENOENT, + faccessat(AT_FDCWD, errpath, F_OK, AT_EACCESS) == -1); check_audit(fds, failurereg, pipefd); } @@ -744,7 +747,7 @@ ATF_TC_BODY(pathconf_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, pathconf(errpath, _PC_NAME_MAX)); + ATF_REQUIRE_ERRNO(ENOENT, pathconf(errpath, _PC_NAME_MAX) == -1); check_audit(fds, failurereg, pipefd); } @@ -788,7 +791,7 @@ ATF_TC_BODY(lpathconf_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lpathconf(errpath, _PC_SYMLINK_MAX)); + ATF_REQUIRE_ERRNO(ENOENT, lpathconf(errpath, _PC_SYMLINK_MAX) == -1); check_audit(fds, failurereg, pipefd); } @@ -837,7 +840,7 @@ ATF_TC_BODY(fpathconf_failure, tc) FILE *pipefd = setup(fds, auclass); const char *regex = "fpathconf.*return,failure : Bad file descriptor"; /* Failure reason: Bad file descriptor */ - ATF_REQUIRE_EQ(-1, fpathconf(-1, _PC_NAME_MAX)); + ATF_REQUIRE_ERRNO(EBADF, fpathconf(-1, _PC_NAME_MAX) == -1); check_audit(fds, regex, pipefd); } @@ -858,17 +861,20 @@ ATF_TC_BODY(extattr_get_file_success, tc) { /* File needs to exist to call extattr_get_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); + /* Set an extended attribute to be retrieved later on */ - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, - EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, + sizeof(buff))); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_get_file.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_get_file(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_get_file(path, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); close(filedesc); } @@ -894,8 +900,9 @@ ATF_TC_BODY(extattr_get_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_get_file(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_get_file(path, EXTATTR_NAMESPACE_USER, name, NULL, 0) == + -1); check_audit(fds, extregex, pipefd); } @@ -916,17 +923,20 @@ ATF_TC_BODY(extattr_get_fd_success, tc) { /* File needs to exist to call extattr_get_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); + /* Set an extended attribute to be retrieved later on */ - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, - EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, + sizeof(buff))); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_get_fd.*%s.*return,success", name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_get_fd(filedesc, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_get_fd(filedesc, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); close(filedesc); } @@ -952,8 +962,8 @@ ATF_TC_BODY(extattr_get_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, extattr_get_fd(-1, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_get_fd(-1, EXTATTR_NAMESPACE_USER, name, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -974,17 +984,20 @@ ATF_TC_BODY(extattr_get_link_success, tc) { /* Symbolic link needs to exist to call extattr_get_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); + skip_if_extattr_not_supported("."); + /* Set an extended attribute to be retrieved later on */ - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, - EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, buff, + sizeof(buff))); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_get_link.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_get_link(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_get_link(path, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); } @@ -1008,8 +1021,8 @@ ATF_TC_BODY(extattr_get_link_failure, tc) "extattr_get_link.*%s.*%s.*failure", path, name); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_get_link(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_get_link(path, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); } @@ -1028,16 +1041,17 @@ ATF_TC_HEAD(extattr_list_file_success, tc) ATF_TC_BODY(extattr_list_file_success, tc) { - int readbuff; + ssize_t readbuff; /* File needs to exist to call extattr_list_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((readbuff = extattr_list_file(path, - EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + readbuff = REQUIRE_EXTATTR_SUCCESS( + extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), - "extattr_list_file.*%s.*return,success,%d", path, readbuff); + "extattr_list_file.*%s.*return,success,%zd", path, readbuff); check_audit(fds, extregex, pipefd); } @@ -1062,8 +1076,8 @@ ATF_TC_BODY(extattr_list_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_list_file(path, - EXTATTR_NAMESPACE_USER, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0)); check_audit(fds, extregex, pipefd); } @@ -1082,16 +1096,17 @@ ATF_TC_HEAD(extattr_list_fd_success, tc) ATF_TC_BODY(extattr_list_fd_success, tc) { - int readbuff; + ssize_t readbuff; /* File needs to exist to call extattr_list_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((readbuff = extattr_list_fd(filedesc, - EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + readbuff = REQUIRE_EXTATTR_SUCCESS( + extattr_list_fd(filedesc, EXTATTR_NAMESPACE_USER, NULL, 0)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), - "extattr_list_fd.*return,success,%d", readbuff); + "extattr_list_fd.*return,success,%zd", readbuff); check_audit(fds, extregex, pipefd); close(filedesc); } @@ -1117,8 +1132,8 @@ ATF_TC_BODY(extattr_list_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, - extattr_list_fd(-1, EXTATTR_NAMESPACE_USER, NULL, 0)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_list_fd(-1, EXTATTR_NAMESPACE_USER, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -1137,16 +1152,17 @@ ATF_TC_HEAD(extattr_list_link_success, tc) ATF_TC_BODY(extattr_list_link_success, tc) { - int readbuff; + ssize_t readbuff; /* Symbolic link needs to exist to call extattr_list_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); - FILE *pipefd = setup(fds, auclass); + skip_if_extattr_not_supported("."); - ATF_REQUIRE((readbuff = extattr_list_link(path, - EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + FILE *pipefd = setup(fds, auclass); + readbuff = REQUIRE_EXTATTR_SUCCESS( + extattr_list_link(path, EXTATTR_NAMESPACE_USER, NULL, 0)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), - "extattr_list_link.*%s.*return,success,%d", path, readbuff); + "extattr_list_link.*%s.*return,success,%zd", path, readbuff); check_audit(fds, extregex, pipefd); } @@ -1170,8 +1186,8 @@ ATF_TC_BODY(extattr_list_link_failure, tc) "extattr_list_link.*%s.*failure", path); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_list_link(path, - EXTATTR_NAMESPACE_USER, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_list_link(path, EXTATTR_NAMESPACE_USER, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -1236,6 +1252,5 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, extattr_list_fd_failure); ATF_TP_ADD_TC(tp, extattr_list_link_success); ATF_TP_ADD_TC(tp, extattr_list_link_failure); - return (atf_no_error()); } diff --git a/tests/sys/audit/file-attribute-modify.c b/tests/sys/audit/file-attribute-modify.c index 8df1d6d2d95f..689d7a0b8d61 100644 --- a/tests/sys/audit/file-attribute-modify.c +++ b/tests/sys/audit/file-attribute-modify.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -92,7 +93,7 @@ ATF_TC_BODY(flock_failure, tc) { const char *regex = "flock.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(-1, flock(-1, LOCK_SH)); + ATF_REQUIRE_ERRNO(EBADF, flock(-1, LOCK_SH) == -1); check_audit(fds, regex, pipefd); } @@ -141,7 +142,7 @@ ATF_TC_BODY(fcntl_failure, tc) { const char *regex = "fcntl.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(-1, fcntl(-1, F_GETFL, 0)); + ATF_REQUIRE_ERRNO(EBADF, fcntl(-1, F_GETFL, 0) == -1); check_audit(fds, regex, pipefd); } @@ -189,7 +190,7 @@ ATF_TC_BODY(fsync_failure, tc) const char *regex = "fsync.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fsync(-1)); + ATF_REQUIRE_ERRNO(EBADF, fsync(-1) == -1); check_audit(fds, regex, pipefd); } @@ -233,7 +234,7 @@ ATF_TC_BODY(chmod_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chmod(errpath, mode)); + ATF_REQUIRE_ERRNO(ENOENT, chmod(errpath, mode) == -1); check_audit(fds, failurereg, pipefd); } @@ -281,7 +282,7 @@ ATF_TC_BODY(fchmod_failure, tc) const char *regex = "fchmod.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fchmod(-1, mode)); + ATF_REQUIRE_ERRNO(EBADF, fchmod(-1, mode) == -1); check_audit(fds, regex, pipefd); } @@ -324,7 +325,7 @@ ATF_TC_BODY(lchmod_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, lchmod(errpath, mode)); + ATF_REQUIRE_ERRNO(ENOENT, lchmod(errpath, mode) == -1); check_audit(fds, failurereg, pipefd); } @@ -368,7 +369,7 @@ ATF_TC_BODY(fchmodat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, fchmodat(AT_FDCWD, errpath, mode, 0)); + ATF_REQUIRE_ERRNO(ENOENT, fchmodat(AT_FDCWD, errpath, mode, 0) == -1); check_audit(fds, failurereg, pipefd); } @@ -412,7 +413,7 @@ ATF_TC_BODY(chown_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chown(errpath, uid, gid)); + ATF_REQUIRE_ERRNO(ENOENT, chown(errpath, uid, gid) == -1); check_audit(fds, failurereg, pipefd); } @@ -460,7 +461,7 @@ ATF_TC_BODY(fchown_failure, tc) const char *regex = "fchown.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fchown(-1, uid, gid)); + ATF_REQUIRE_ERRNO(EBADF, fchown(-1, uid, gid) == -1); check_audit(fds, regex, pipefd); } @@ -503,7 +504,7 @@ ATF_TC_BODY(lchown_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: Symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lchown(errpath, uid, gid)); + ATF_REQUIRE_ERRNO(ENOENT, lchown(errpath, uid, gid) == -1); check_audit(fds, failurereg, pipefd); } @@ -547,7 +548,8 @@ ATF_TC_BODY(fchownat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, fchownat(AT_FDCWD, errpath, uid, gid, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + fchownat(AT_FDCWD, errpath, uid, gid, 0) == -1); check_audit(fds, failurereg, pipefd); } @@ -591,7 +593,7 @@ ATF_TC_BODY(chflags_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chflags(errpath, UF_OFFLINE)); + ATF_REQUIRE_ERRNO(ENOENT, chflags(errpath, UF_OFFLINE) == -1); check_audit(fds, failurereg, pipefd); } @@ -639,7 +641,7 @@ ATF_TC_BODY(fchflags_failure, tc) const char *regex = "fchflags.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fchflags(-1, UF_OFFLINE)); + ATF_REQUIRE_ERRNO(EBADF, fchflags(-1, UF_OFFLINE) == -1); check_audit(fds, regex, pipefd); } @@ -682,7 +684,7 @@ ATF_TC_BODY(lchflags_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: Symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lchflags(errpath, UF_OFFLINE)); + ATF_REQUIRE_ERRNO(ENOENT, lchflags(errpath, UF_OFFLINE) == -1); check_audit(fds, failurereg, pipefd); } @@ -726,7 +728,8 @@ ATF_TC_BODY(chflagsat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, UF_OFFLINE, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + chflagsat(AT_FDCWD, errpath, UF_OFFLINE, 0) == -1); check_audit(fds, failurereg, pipefd); } @@ -770,7 +773,7 @@ ATF_TC_BODY(utimes_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, utimes(errpath, NULL)); + ATF_REQUIRE_ERRNO(ENOENT, utimes(errpath, NULL) == -1); check_audit(fds, failurereg, pipefd); } @@ -818,7 +821,7 @@ ATF_TC_BODY(futimes_failure, tc) const char *regex = "futimes.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, futimes(-1, NULL)); + ATF_REQUIRE_ERRNO(EBADF, futimes(-1, NULL) == -1); check_audit(fds, regex, pipefd); } @@ -861,7 +864,7 @@ ATF_TC_BODY(lutimes_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lutimes(errpath, NULL)); + ATF_REQUIRE_ERRNO(ENOENT, lutimes(errpath, NULL) == -1); check_audit(fds, failurereg, pipefd); } @@ -905,7 +908,7 @@ ATF_TC_BODY(futimesat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, futimesat(AT_FDCWD, errpath, NULL)); + ATF_REQUIRE_ERRNO(ENOENT, futimesat(AT_FDCWD, errpath, NULL) == -1); check_audit(fds, failurereg, pipefd); } @@ -949,7 +952,8 @@ ATF_TC_BODY(mprotect_failure, tc) { const char *regex = "mprotect.*return,failure : Invalid argument"; FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(-1, mprotect((void *)SIZE_MAX, -1, PROT_NONE)); + ATF_REQUIRE_ERRNO(EINVAL, + mprotect((void *)SIZE_MAX, -1, PROT_NONE) == -1); check_audit(fds, regex, pipefd); } @@ -977,7 +981,7 @@ ATF_TC_BODY(undelete_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: File does not exist */ - ATF_REQUIRE_EQ(-1, undelete(errpath)); + ATF_REQUIRE_ERRNO(ENOENT, undelete(errpath) == -1); check_audit(fds, extregex, pipefd); } @@ -998,12 +1002,14 @@ ATF_TC_BODY(extattr_set_file_success, tc) { /* File needs to exist to call extattr_set_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); + /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_set_file.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); check_audit(fds, extregex, pipefd); close(filedesc); @@ -1030,8 +1036,9 @@ ATF_TC_BODY(extattr_set_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_set_file(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, NULL, 0) == + -1); check_audit(fds, extregex, pipefd); } @@ -1052,13 +1059,14 @@ ATF_TC_BODY(extattr_set_fd_success, tc) { /* File needs to exist to call extattr_set_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_set_fd.*%s.*return,success", name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_fd(filedesc, + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_fd(filedesc, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); check_audit(fds, extregex, pipefd); close(filedesc); @@ -1085,8 +1093,8 @@ ATF_TC_BODY(extattr_set_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, extattr_set_fd(-1, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_set_fd(-1, EXTATTR_NAMESPACE_USER, name, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -1107,12 +1115,14 @@ ATF_TC_BODY(extattr_set_link_success, tc) { /* Symbolic link needs to exist to call extattr_set_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); + skip_if_extattr_not_supported("."); + /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_set_link.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); check_audit(fds, extregex, pipefd); @@ -1138,8 +1148,9 @@ ATF_TC_BODY(extattr_set_link_failure, tc) "extattr_set_link.*%s.*%s.*failure", path, name); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_set_link(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, NULL, 0) == + -1); check_audit(fds, extregex, pipefd); } @@ -1160,12 +1171,14 @@ ATF_TC_BODY(extattr_delete_file_success, tc) { /* File needs to exist to call extattr_delete_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + skip_if_extattr_not_supported(path); + + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((retval = extattr_delete_file(path, - EXTATTR_NAMESPACE_USER, name)) != -1); + retval = REQUIRE_EXTATTR_SUCCESS( + extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_delete_file.*%s.*return,success,%d", path, retval); @@ -1194,8 +1207,8 @@ ATF_TC_BODY(extattr_delete_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_delete_file(path, - EXTATTR_NAMESPACE_USER, name)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name) == -1); check_audit(fds, extregex, pipefd); } @@ -1216,12 +1229,14 @@ ATF_TC_BODY(extattr_delete_fd_success, tc) { /* File needs to exist to call extattr_delete_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + skip_if_extattr_not_supported(path); + + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((retval = extattr_delete_fd(filedesc, - EXTATTR_NAMESPACE_USER, name)) != -1); + retval = REQUIRE_EXTATTR_SUCCESS(extattr_delete_fd(filedesc, + EXTATTR_NAMESPACE_USER, name)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_delete_fd.*return,success,%d", retval); @@ -1250,7 +1265,8 @@ ATF_TC_BODY(extattr_delete_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, extattr_delete_fd(-1, EXTATTR_NAMESPACE_USER, name)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_delete_fd(-1, EXTATTR_NAMESPACE_USER, name) == -1); check_audit(fds, extregex, pipefd); } @@ -1271,12 +1287,14 @@ ATF_TC_BODY(extattr_delete_link_success, tc) { /* Symbolic link needs to exist to call extattr_delete_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, + skip_if_extattr_not_supported("."); + + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((retval = extattr_delete_link(path, - EXTATTR_NAMESPACE_USER, name)) != -1); + retval = REQUIRE_EXTATTR_SUCCESS(extattr_delete_link(path, + EXTATTR_NAMESPACE_USER, name)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_delete_link.*%s.*return,success,%d", path, retval); @@ -1303,8 +1321,8 @@ ATF_TC_BODY(extattr_delete_link_failure, tc) "extattr_delete_link.*%s.*failure", path); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_delete_link(path, - EXTATTR_NAMESPACE_USER, name)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_delete_link(path, EXTATTR_NAMESPACE_USER, name) == -1); check_audit(fds, extregex, pipefd); } diff --git a/tests/sys/audit/utils.c b/tests/sys/audit/utils.c index d7a1e6792b1c..be31f4138412 100644 --- a/tests/sys/audit/utils.c +++ b/tests/sys/audit/utils.c @@ -25,6 +25,8 @@ * $FreeBSD$ */ +#include +#include #include #include @@ -204,6 +206,22 @@ check_audit(struct pollfd fd[], const char *auditrgx, FILE *pipestream) { ATF_REQUIRE_EQ(0, fclose(pipestream)); } +void +skip_if_extattr_not_supported(const char *path) +{ + ssize_t result; + + /* + * Some file systems (e.g. tmpfs) do not support extattr, so we need + * skip tests that use extattrs. To detect this we can check whether + * the extattr_list_file returns EOPNOTSUPP. + */ + result = extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0); + if (result == -1 && errno == EOPNOTSUPP) { + atf_tc_skip("File system does not support extattrs."); + } +} + FILE *setup(struct pollfd fd[], const char *name) { diff --git a/tests/sys/audit/utils.h b/tests/sys/audit/utils.h index 51001148c269..2f7a9e5cebb2 100644 --- a/tests/sys/audit/utils.h +++ b/tests/sys/audit/utils.h @@ -37,5 +37,26 @@ void check_audit(struct pollfd [], const char *, FILE *); FILE *setup(struct pollfd [], const char *); void cleanup(void); +void skip_if_extattr_not_supported(const char *); + +#define REQUIRE_EXTATTR_SUCCESS(call) \ + ({ \ + errno = 0; /* Reset errno before call */ \ + ssize_t result = (call); \ + if (result == -1) { \ + atf_tc_fail_requirement(__FILE__, __LINE__, \ + "%s failed with errno %d (%s)", #call, errno, \ + strerror(errno)); \ + } \ + result; \ + }) + +#define REQUIRE_EXTATTR_RESULT(_expected, expr) \ + do { \ + ssize_t expected = (_expected); \ + ssize_t _result = REQUIRE_EXTATTR_SUCCESS(expr); \ + ATF_REQUIRE_EQ_MSG(expected, _result, "%s: %zd != %zd", #expr, \ + expected, _result); \ + } while (0) #endif /* _SETUP_H_ */ From owner-dev-commits-src-main@freebsd.org Tue Feb 2 12:02:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4327B52FCA9; Tue, 2 Feb 2021 12:02:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVNjj1jLxz4tZn; Tue, 2 Feb 2021 12:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 681655E25; Tue, 2 Feb 2021 12:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112C2ile025203; Tue, 2 Feb 2021 12:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C2iB3025202; Tue, 2 Feb 2021 12:02:44 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:44 GMT Message-Id: <202102021202.112C2iB3025202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: d21ce74dcce6 - main - Register the bad read before bailing on terminal errors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d21ce74dcce6f8b69451b3b2dd291d35cbb70609 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 12:02:50 -0000 The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=d21ce74dcce6f8b69451b3b2dd291d35cbb70609 commit d21ce74dcce6f8b69451b3b2dd291d35cbb70609 Author: Poul-Henning Kamp AuthorDate: 2021-02-02 12:01:38 +0000 Commit: Poul-Henning Kamp CommitDate: 2021-02-02 12:01:38 +0000 Register the bad read before bailing on terminal errors. This way running recoverdisk in a loop will not get stuck on a bad block which causes the disk or SD card detach. --- sbin/recoverdisk/recoverdisk.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sbin/recoverdisk/recoverdisk.c b/sbin/recoverdisk/recoverdisk.c index 8c4aabebc76f..35d7adc7a5c3 100644 --- a/sbin/recoverdisk/recoverdisk.c +++ b/sbin/recoverdisk/recoverdisk.c @@ -149,12 +149,10 @@ static void set_verbose(void) { struct winsize wsz; - time_t t0; if (!isatty(STDIN_FILENO) || ioctl(STDIN_FILENO, TIOCGWINSZ, &wsz)) return; verbose = 1; - t0 = time(NULL); } static void @@ -587,6 +585,13 @@ if (!(random() & 0xf)) { lp->start, sz, lp->state, strerror(error)); if (verbose) report(lp, sz); + if (fdw >= 0 && strlen(unreadable_pattern)) { + fill_buf(buf, sz, unreadable_pattern); + write_buf(fdw, buf, sz, lp->start); + } + new_lump(lp->start, sz, lp->state + 1); + lp->start += sz; + lp->len -= sz; if (error == EINVAL) { printf("Try with -b 131072 or lower ?\n"); aborting = 1; @@ -597,13 +602,6 @@ if (!(random() & 0xf)) { aborting = 1; break; } - if (fdw >= 0 && strlen(unreadable_pattern)) { - fill_buf(buf, sz, unreadable_pattern); - write_buf(fdw, buf, sz, lp->start); - } - new_lump(lp->start, sz, lp->state + 1); - lp->start += sz; - lp->len -= sz; } if (aborting) save_worklist(); From owner-dev-commits-src-main@freebsd.org Tue Feb 2 14:15:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8DD53533C82; Tue, 2 Feb 2021 14:15:32 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVRfr3bvwz3LDH; Tue, 2 Feb 2021 14:15:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 6E6B37751; Tue, 2 Feb 2021 14:15:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112EFWSk095476; Tue, 2 Feb 2021 14:15:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112EFWbc095475; Tue, 2 Feb 2021 14:15:32 GMT (envelope-from git) Date: Tue, 2 Feb 2021 14:15:32 GMT Message-Id: <202102021415.112EFWbc095475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 43d44842aef3 - main - rtld: Fix null-pointer dereference MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43d44842aef3972cc86ce673e84e31f372257b15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 14:15:32 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43d44842aef3972cc86ce673e84e31f372257b15 commit 43d44842aef3972cc86ce673e84e31f372257b15 Author: David Chisnall AuthorDate: 2021-02-02 14:06:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-02 14:14:16 +0000 rtld: Fix null-pointer dereference When a library is opened via fdlopen, it has a null pointer for its path and so _rtld_bind can crash as a result of passing the null pointer to basename() (which passes it to strrchr(), which doesn't do a null check). PR: 253081 Submitted by: theraven MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28442 --- libexec/rtld-elf/rtld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7b8bfba84d7d..b186bebbfefc 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -894,8 +894,10 @@ _rtld_bind(Obj_Entry *obj, Elf_Size reloff) target = (Elf_Addr)(defobj->relocbase + def->st_value); dbg("\"%s\" in \"%s\" ==> %p in \"%s\"", - defobj->strtab + def->st_name, basename(obj->path), - (void *)target, basename(defobj->path)); + defobj->strtab + def->st_name, + obj->path == NULL ? NULL : basename(obj->path), + (void *)target, + defobj->path == NULL ? NULL : basename(defobj->path)); /* * Write the new contents for the jmpslot. Note that depending on From owner-dev-commits-src-main@freebsd.org Tue Feb 2 14:46:36 2021 Return-Path: Delivered-To: dev-commits-src-main@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 74F1D534821; Tue, 2 Feb 2021 14:46:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVSLh2ryLz3Nnh; Tue, 2 Feb 2021 14:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 50B1B7A7A; Tue, 2 Feb 2021 14:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112Eka9P036053; Tue, 2 Feb 2021 14:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112Ekapl036052; Tue, 2 Feb 2021 14:46:36 GMT (envelope-from git) Date: Tue, 2 Feb 2021 14:46:36 GMT Message-Id: <202102021446.112Ekapl036052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: e40787f900f3 - main - Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linux MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e40787f900f3c262d5134d342e5a16757dd2193c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 14:46:36 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=e40787f900f3c262d5134d342e5a16757dd2193c commit e40787f900f3c262d5134d342e5a16757dd2193c Author: Edward Tomasz Napierala AuthorDate: 2021-02-02 14:40:38 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-02 14:40:58 +0000 Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linux In /etc/rc.d/linux the mounting paths of procfs, sysfs and devfs are hardcoded to "/compat/linux". Switching to the content of compat.linux.emul_path sysctl would allow to switch linuxulator to different place. Submitted by: freebsdnewbie_freenet.de Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27807 --- libexec/rc/rc.d/linux | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index 4fe9cee6e751..4381b62cc660 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -18,6 +18,7 @@ stop_cmd=":" linux_start() { local _emul_path _tmpdir + _emul_path="$(sysctl -n compat.linux.emul_path)" load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in @@ -25,11 +26,11 @@ linux_start() load_kld -e 'linux64elf' linux64 ;; esac - if [ -x /compat/linux/sbin/ldconfigDisabled ]; then + if [ -x ${_emul_path}/sbin/ldconfigDisabled ]; then _tmpdir=`mktemp -d -t linux-ldconfig` - /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache - if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then - cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache + ${_emul_path}/sbin/ldconfig -C ${_tmpdir}/ld.so.cache + if ! cmp -s ${_tmpdir}/ld.so.cache ${_emul_path}/etc/ld.so.cache; then + cat ${_tmpdir}/ld.so.cache > ${_emul_path}/etc/ld.so.cache fi rm -rf ${_tmpdir} fi @@ -47,7 +48,6 @@ linux_start() fi if checkyesno linux_mounts_enable; then - _emul_path="/compat/linux" mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc" mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys" mount -o nocover -t devfs devfs "${_emul_path}/dev" From owner-dev-commits-src-main@freebsd.org Tue Feb 2 16:45:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1D1E8536DC3; Tue, 2 Feb 2021 16:45:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVVzr0FNnz3lZy; Tue, 2 Feb 2021 16:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 EF9D111879; Tue, 2 Feb 2021 16:45:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112GjRQ6092322; Tue, 2 Feb 2021 16:45:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112GjR8N092321; Tue, 2 Feb 2021 16:45:27 GMT (envelope-from git) Date: Tue, 2 Feb 2021 16:45:27 GMT Message-Id: <202102021645.112GjR8N092321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ff975f15d860 - main - WITH_OFED build option: fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff975f15d86001d5b948ab538de1e4aca852d2f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 16:45:28 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff975f15d86001d5b948ab538de1e4aca852d2f5 commit ff975f15d86001d5b948ab538de1e4aca852d2f5 Author: Konstantin Belousov AuthorDate: 2021-02-02 13:01:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-02 16:44:52 +0000 WITH_OFED build option: fix Userspace has OFED build enabled for quite some time, but kernel modules were not. This is useless config because any userspace IB code requires kernel support. So enable modules build by default. Move WITH_OFED to WITHOUT_OFED since defaults are now enabled. Reviewed by: emaste, hselasky, kevans MFC after: 3 days Sponsored by: NVidia Networking / Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D28460 --- sys/conf/kern.opts.mk | 2 +- tools/build/options/WITHOUT_OFED | 4 ++++ tools/build/options/WITH_OFED | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 5a66849b36da..7361cdd70076 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -41,6 +41,7 @@ __DEFAULT_YES_OPTIONS = \ ISCSI \ KERNEL_SYMBOLS \ NETGRAPH \ + OFED \ PF \ SCTP_SUPPORT \ SOURCELESS_HOST \ @@ -55,7 +56,6 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_PATTERN \ INIT_ALL_ZERO \ KERNEL_RETPOLINE \ - OFED \ RATELIMIT \ REPRODUCIBLE_BUILD diff --git a/tools/build/options/WITHOUT_OFED b/tools/build/options/WITHOUT_OFED new file mode 100644 index 000000000000..18a6943b3580 --- /dev/null +++ b/tools/build/options/WITHOUT_OFED @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to disable the build of the +.Dq "OpenFabrics Enterprise Distribution" +Infiniband software stack, including kernel modules and userspace libraries. diff --git a/tools/build/options/WITH_OFED b/tools/build/options/WITH_OFED deleted file mode 100644 index a995fb8cdab8..000000000000 --- a/tools/build/options/WITH_OFED +++ /dev/null @@ -1,4 +0,0 @@ -.\" $FreeBSD$ -Set to build the -.Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. From owner-dev-commits-src-main@freebsd.org Tue Feb 2 16:48:51 2021 Return-Path: Delivered-To: dev-commits-src-main@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 525C1536DF5; Tue, 2 Feb 2021 16:48:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVW3l1sKTz3lkk; Tue, 2 Feb 2021 16:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 32B0711C70; Tue, 2 Feb 2021 16:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112GmpZl092949; Tue, 2 Feb 2021 16:48:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112GmpUK092948; Tue, 2 Feb 2021 16:48:51 GMT (envelope-from git) Date: Tue, 2 Feb 2021 16:48:51 GMT Message-Id: <202102021648.112GmpUK092948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d0ca28d7c9c7 - main - src.conf.5: regenerate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0ca28d7c9c7da80a62e4307fe37b923e32ca1bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 16:48:51 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d0ca28d7c9c7da80a62e4307fe37b923e32ca1bb commit d0ca28d7c9c7da80a62e4307fe37b923e32ca1bb Author: Konstantin Belousov AuthorDate: 2021-02-02 16:48:08 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-02 16:48:34 +0000 src.conf.5: regenerate --- share/man/man5/src.conf.5 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 3b57c443353d..ea94bac4d2dc 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 1, 2021 +.Dd February 2, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1245,10 +1245,19 @@ Set to build nvme related tools and kernel modules. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. -.It Va WITH_OFED -Set to build the +.It Va WITHOUT_OFED +Set to disable the build of the .Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. +Infiniband software stack, including kernel modules and userspace libraries. +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_OFED_EXTRA +.El .It Va WITH_OFED_EXTRA Set to build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" From owner-dev-commits-src-main@freebsd.org Tue Feb 2 17:19:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5B3BF5381AB; Tue, 2 Feb 2021 17:19:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVWlS2DJMz3qB3; Tue, 2 Feb 2021 17:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3F82211F64; Tue, 2 Feb 2021 17:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112HJmXL032322; Tue, 2 Feb 2021 17:19:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112HJmSP032320; Tue, 2 Feb 2021 17:19:48 GMT (envelope-from git) Date: Tue, 2 Feb 2021 17:19:48 GMT Message-Id: <202102021719.112HJmSP032320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: 70dfc101b632 - main - release: update workaround during transition to git MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70dfc101b6324b25ba353465f0d6c610399741fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 17:19:48 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=70dfc101b6324b25ba353465f0d6c610399741fc commit 70dfc101b6324b25ba353465f0d6c610399741fc Author: Glen Barber AuthorDate: 2021-02-02 17:19:36 +0000 Commit: Glen Barber CommitDate: 2021-02-02 17:19:36 +0000 release: update workaround during transition to git PR: 253181 Submitted by: Yasuhiro Kimura MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/release.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index fbd64bb8234d..372f69177f7e 100755 --- a/release/release.sh +++ b/release/release.sh @@ -246,8 +246,11 @@ chroot_setup() { fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then - git -C ${CHROOTDIR}/usr/ports pull -q + # if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then + # git -C ${CHROOTDIR}/usr/ports pull -q + # XXX: Workaround for the overlap in the Git conversion timeframe. + if [ -d "${CHROOTDIR}/usr/ports/.svn" ]; then + ${SVNCMD} update ${CHROOTDIR}/usr/ports else #${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports # XXX: Workaround for the overlap in the Git From owner-dev-commits-src-main@freebsd.org Tue Feb 2 18:14:52 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CC4C3539A07; Tue, 2 Feb 2021 18:14:52 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVXz05Pn7z3tSy; Tue, 2 Feb 2021 18:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 AC509129ED; Tue, 2 Feb 2021 18:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112IEqiJ009597; Tue, 2 Feb 2021 18:14:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112IEqLa009596; Tue, 2 Feb 2021 18:14:52 GMT (envelope-from git) Date: Tue, 2 Feb 2021 18:14:52 GMT Message-Id: <202102021814.112IEqLa009596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 45456abc4ce7 - main - cache: fix trailing slash support in face of permission problems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45456abc4ce71053d07cf03ca63bd1ce459fec55 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 18:14:52 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=45456abc4ce71053d07cf03ca63bd1ce459fec55 commit 45456abc4ce71053d07cf03ca63bd1ce459fec55 Author: Mateusz Guzik AuthorDate: 2021-02-02 18:06:56 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-02 18:13:51 +0000 cache: fix trailing slash support in face of permission problems Reported by: Johan Hendriks Tested by: kevans --- sys/kern/vfs_cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 7f0e59f1a1ee..db482ea4eba3 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5521,6 +5521,16 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; + /* + * TODO: Due to ignoring slashes lookup will perform a permission check + * on the last dir when it should not have. If it fails, we get here. + * It is possible possible to fix it up fully without resorting to + * regular lookup, but for now just abort. + */ + if (cache_fpl_istrailingslash(fpl)) { + return (cache_fpl_aborted(fpl)); + } + /* * Hack: delayed degenerate path checking. */ From owner-dev-commits-src-main@freebsd.org Tue Feb 2 18:41:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 93E0B539E2D; Tue, 2 Feb 2021 18:41:58 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVYZG3nHrz3vsZ; Tue, 2 Feb 2021 18:41:58 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 74BF61322B; Tue, 2 Feb 2021 18:41:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112IfwBu048565; Tue, 2 Feb 2021 18:41:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112IfwrK048564; Tue, 2 Feb 2021 18:41:58 GMT (envelope-from git) Date: Tue, 2 Feb 2021 18:41:58 GMT Message-Id: <202102021841.112IfwrK048564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9d0f1092cf90 - main - git hooks: add "Tested by" to commit message template MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d0f1092cf90c8bf161cb946584f703a9998f8cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 18:41:58 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9d0f1092cf90c8bf161cb946584f703a9998f8cd commit 9d0f1092cf90c8bf161cb946584f703a9998f8cd Author: Ed Maste AuthorDate: 2021-02-02 18:36:45 +0000 Commit: Ed Maste CommitDate: 2021-02-02 18:41:08 +0000 git hooks: add "Tested by" to commit message template Reported by: mjg Reviewed by: imp Sponsored by: The FreeBSD Foundation --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 0ebec48fd9a5..6a8db33649f0 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -45,6 +45,7 @@ $(awk '1;/^#$/{exit}' $1) # PR: # Reported by: # Reviewed by: +# Tested by: # Approved by: # Obtained from: # MFC after: From owner-dev-commits-src-main@freebsd.org Tue Feb 2 18:56:53 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E3C78539F7E; Tue, 2 Feb 2021 18:56:53 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVYvT66GFz3wNV; Tue, 2 Feb 2021 18:56:53 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B8EC413781; Tue, 2 Feb 2021 18:56:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112IurVJ063380; Tue, 2 Feb 2021 18:56:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112IurK4063379; Tue, 2 Feb 2021 18:56:53 GMT (envelope-from git) Date: Tue, 2 Feb 2021 18:56:53 GMT Message-Id: <202102021856.112IurK4063379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 3dd2a7a5ea2f - main - Make DataSN counter of solicited Data-Out local. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dd2a7a5ea2f1641c7525f692eed416fa02c28e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 18:56:54 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3dd2a7a5ea2f1641c7525f692eed416fa02c28e6 commit 3dd2a7a5ea2f1641c7525f692eed416fa02c28e6 Author: Alexander Motin AuthorDate: 2021-02-02 18:37:13 +0000 Commit: Alexander Motin CommitDate: 2021-02-02 18:56:47 +0000 Make DataSN counter of solicited Data-Out local. DataSN for solicited Data-Out is per-R2T. Since we handle whole R2T in one go, we don't need to store it anywhere, especially in global per-command structure. This may allow us to handle multiple R2T per command at once, if we decide, or may be relax locking. Rename the second use of that field to io_referenced_task_tag. MFC after: 1 month --- sys/dev/iscsi/iscsi.c | 9 ++++----- sys/dev/iscsi/iscsi.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 5e6c80255bff..c4123d9f4aa7 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1018,7 +1018,7 @@ iscsi_pdu_handle_task_response(struct icl_pdu *response) ISCSI_SESSION_WARN(is, "task response 0x%x", bhstmr->bhstmr_response); } else { - aio = iscsi_outstanding_find(is, io->io_datasn); + aio = iscsi_outstanding_find(is, io->io_referenced_task_tag); if (aio != NULL && aio->io_ccb != NULL) iscsi_session_terminate_task(is, aio, CAM_REQ_ABORTED); } @@ -1157,6 +1157,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) struct ccb_scsiio *csio; size_t off, len, total_len; int error; + uint32_t datasn = 0; is = PDU_SESSION(response); @@ -1183,8 +1184,6 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) * XXX: Verify R2TSN. */ - io->io_datasn = 0; - off = ntohl(bhsr2t->bhsr2t_buffer_offset); if (off > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "target requested invalid offset " @@ -1234,7 +1233,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) bhsr2t->bhsr2t_initiator_task_tag; bhsdo->bhsdo_target_transfer_tag = bhsr2t->bhsr2t_target_transfer_tag; - bhsdo->bhsdo_datasn = htonl(io->io_datasn++); + bhsdo->bhsdo_datasn = htonl(datasn++); bhsdo->bhsdo_buffer_offset = htonl(off); error = icl_pdu_append_data(request, csio->data_ptr + off, len, M_NOWAIT); @@ -2204,7 +2203,7 @@ iscsi_action_abort(struct iscsi_session *is, union ccb *ccb) xpt_done(ccb); return; } - io->io_datasn = aio->io_initiator_task_tag; + io->io_referenced_task_tag = aio->io_initiator_task_tag; bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST; diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h index ddd88ffc5289..80ac9d877107 100644 --- a/sys/dev/iscsi/iscsi.h +++ b/sys/dev/iscsi/iscsi.h @@ -45,7 +45,7 @@ struct iscsi_outstanding { union ccb *io_ccb; size_t io_received; uint32_t io_initiator_task_tag; - uint32_t io_datasn; + uint32_t io_referenced_task_tag; void *io_icl_prv; }; From owner-dev-commits-src-main@freebsd.org Tue Feb 2 19:14:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 56FCA53A949; Tue, 2 Feb 2021 19:14:14 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVZHV1wWPz4RQs; Tue, 2 Feb 2021 19:14:14 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3426F136FE; Tue, 2 Feb 2021 19:14:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112JEETS088769; Tue, 2 Feb 2021 19:14:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112JEEqM088768; Tue, 2 Feb 2021 19:14:14 GMT (envelope-from git) Date: Tue, 2 Feb 2021 19:14:14 GMT Message-Id: <202102021914.112JEEqM088768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: e59d9cb41284 - main - Add a wg(4) manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e59d9cb412846cb5d2bc4c641d3cc44d243cd52d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 19:14:14 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e59d9cb412846cb5d2bc4c641d3cc44d243cd52d commit e59d9cb412846cb5d2bc4c641d3cc44d243cd52d Author: Gordon Bergling AuthorDate: 2021-02-02 19:13:53 +0000 Commit: Gordon Bergling CommitDate: 2021-02-02 19:13:53 +0000 Add a wg(4) manual page Reviewed by: brueffer, donner, debdrup, ygy MFC after: 2 days --- share/man/man4/Makefile | 1 + share/man/man4/wg.4 | 244 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 9b6ec7998fc3..4929ec9fd3f6 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -584,6 +584,7 @@ MAN= aac.4 \ vtnet.4 \ watchdog.4 \ ${_wbwd.4} \ + wg.4 \ witness.4 \ wlan.4 \ wlan_acl.4 \ diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 new file mode 100644 index 000000000000..e343dceaa0d6 --- /dev/null +++ b/share/man/man4/wg.4 @@ -0,0 +1,244 @@ +.\" Copyright (c) 2020 Gordon Bergling +.\" 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 AUTHOR 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. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd February 2, 2021 > +.Dt WG 4 > +.Os > +.Sh NAME > +.Nm wg > +.Nd "WireGuard - pseudo-device" > +.Sh SYNOPSIS > +To load the driver as a module at boot time, place the following line in > +.Xr loader.conf 5 : > +.Bd -literal -offset indent > +if_wg_load="YES" > +.Ed > +.Sh DESCRIPTION > +The > +.Nm > +driver provides Virtual Private Network (VPN) interfaces for the secure > +exchange of layer 3 traffic with other WireGuard peers using the WireGuard > +protocol. > +.Pp > +A > +.Nm > +interface recognises one or more peers, establishes a secure tunnel with > +each on demand, and tracks each peer's UDP endpoint for exchanging encrypted > +traffic with. > +.Pp > +The interfaces can be created at runtime using the > +.Ic ifconfig Cm wg Ns Ar N Cm create > +command. > +The interface itself can be configured with > +.Xr ifconfig 8 . > +.Pp > +The following parameters are available: > +.Bl -tag -width indent > +.It Cm listen-port > +The listing port of the > +.Nm > +interface. > +.It Cm public-key > +The public key of the > +.Nm > +interface. > +.It Cm private-key > +The private key of the > +.Nm > +interface. > +.It Cm pre-shared-key > +Defines a pre-shared key for the > +.Nm > +interface. > +.It Cm allowed-ips > +A list of allowed IP addresses. > +.It Cm endpoint > +The IP address of the WiredGuard to connect to. > +.It Cm peer-list > +A list of peering IP addresses to connect to. > +.El > +.Pp > +The > +.Nm > +interfaces support the following > +.Xr ioctl 2 Ns s : > +.Bl -tag -width Ds -offset indent > +.It Dv SIOCSWG Fa "struct wg_device_io *" > +Set the device configuration. > +.It Dv SIOCGWG Fa "struct wg_device_io *" > +Get the device configuration. > +.El > +.Pp > +The following glossary provides a brief overview of WireGuard > +terminology: > +.Bl -tag -width indent -offset 3n > +.It Peer > +Peers exchange IPv4 or IPv6 traffic over secure tunnels. > +Each > +.Nm > +interface may be configured to recognise one or more peers. > +.It Key > +Each peer uses its private key and corresponding public key to > +identify itself to others. > +A peer configures a > +.Nm > +interface with its own private key and with the public keys of its peers. > +.It Pre-shared key > +In addition to the public keys, each peer pair may be configured with a > +unique pre-shared symmetric key. > +This is used in their handshake to guard against future compromise of the > +peers' encrypted tunnel if a quantum-computational attack on their > +Diffie-Hellman exchange becomes feasible. > +It is optional, but recommended. > +.It Allowed IPs > +A single > +.Nm > +interface may maintain concurrent tunnels connecting diverse networks. > +The interface therefore implements rudimentary routing and reverse-path > +filtering functions for its tunneled traffic. > +These functions reference a set of allowed IP ranges configured against > +each peer. > +.Pp > +The interface will route outbound tunneled traffic to the peer configured > +with the most specific matching allowed IP address range, or drop it > +if no such match exists. > +.Pp > +The interface will accept tunneled traffic only from the peer > +configured with the most specific matching allowed IP address range > +for the incoming traffic, or drop it if no such match exists. > +That is, tunneled traffic routed to a given peer cannot return through > +another peer of the same > +.Nm > +interface. > +This ensures that peers cannot spoof another's traffic. > +.It Handshake > +Two peers handshake to mutually authenticate each other and to > +establish a shared series of secret ephemeral encryption keys. > +Any peer may initiate a handshake. > +Handshakes occur only when there is traffic to send, and recur every > +two minutes during transfers. > +.It Connectionless > +Due to the handshake behavior, there is no connected or disconnected > +state. > +.El > +.Ss Keys > +Private keys for WireGuard can be generated from any sufficiently > +secure random source. > +The Curve25519 keys and the pre-shared keys are both 32 bytes > +long and are commonly encoded in base64 for ease of use. > +.Pp > +Keys can be generated with > +.Xr openssl 1 > +as follows: > +.Pp > +.Dl $ openssl rand -base64 32 > +.Pp > +Although a valid Curve25519 key must have 5 bits set to > +specific values, this is done by the interface and so it > +will accept any random 32-byte base64 string. > +.Pp > +When an interface has a private key set with > +.Nm public-key , > +the corresponding > +public key is shown in the status output of the interface: > +.Bd -literal -offset indent > +# ifconfig wg0 | grep public-key > + public-key: 7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw= > +.Ed > +.Sh EXAMPLES > +Create a > +.Nm > +interface and set random private key. > +.Bd -literal -offset indent > +# ifconfig wg0 create listen-port 54321 private-key `openssl rand -base64 32` > +.Ed > +.Pp > +Retrieve the associated public key from a > +.Nm > +interface. > +.Bd -literal -offset indent > +$ ifconfig wg0 | awk '/public-key/ { print $2 }'` > +.Ed > +.Pp > +Connect to a specific endpoint using its public-key and set the allowed IP address > +.Bd -literal -offset indent > +# ifconfig wg0 peer '7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=' endpoint 10.0.1.100 allowed-ips 192.168.2.100/32 > +.Ed > +.Sh DIAGNOSTICS > +The > +.Nm > +interface supports runtime debugging, which can be enabled with: > +.Pp > +.D1 Ic ifconfig Cm wg Ns Ar N Cm debug > +.Pp > +Some common error messages include: > +.Bl -diag > +.It "Handshake for peer X did not complete after 5 seconds, retrying" > +Peer X did not reply to our initiation packet, for example because: > +.Bl -bullet > +.It > +The peer does not have the local interface configured as a peer. > +Peers must be able to mutually authenticate each other. > +.It > +The peer endpoint IP address is incorrectly configured. > +.It > +There are firewall rules preventing communication between hosts. > +.El > +.It "Invalid handshake initiation" > +The incoming handshake packet could not be processed. > +This is likely due to the local interface not containing > +the correct public key for the peer. > +.It "Invalid initiation MAC" > +The incoming handshake initiation packet had an invalid MAC. > +This is likely because the initiation sender has the wrong public key > +for the handshake receiver. > +.It "Packet has unallowed src IP from peer X" > +After decryption, an incoming data packet has a source IP address that > +is not assigned to the allowed IPs of Peer X. > +.El > +.Sh SEE ALSO > +.Xr inet 4 , > +.Xr ip 4 , > +.Xr netintro 4 , > +.Xr ipf 5 , > +.Xr pf.conf 5 , > +.Xr ifconfig 8 , > +.Xr ipfw 8 > +.Rs > +.%T WireGuard whitepaper > +.%U https://www.wireguard.com/papers/wireguard.pdf > +.Re > +.Sh HISTORY > +The > +.Nm > +device driver first appeared in > +.Fx 13.0 . > +.Sh AUTHORS > +This manual page was written by > +.An Gordon Bergling Aq Mt gbe@FreeBSD.org > +and is based on the > +.Ox > +counterpart written by > +.An David Gwynne Aq Mt dlg@openbsd.org . > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" -- From owner-dev-commits-src-main@freebsd.org Tue Feb 2 21:25:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6435053E1FE; Tue, 2 Feb 2021 21:25:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVdCJ2Pfgz4bTR; Tue, 2 Feb 2021 21:25:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 454EF1561C; Tue, 2 Feb 2021 21:25:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112LPmaP058818; Tue, 2 Feb 2021 21:25:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112LPmxr058817; Tue, 2 Feb 2021 21:25:48 GMT (envelope-from git) Date: Tue, 2 Feb 2021 21:25:48 GMT Message-Id: <202102022125.112LPmxr058817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: a08cdb6cfb1c - main - Allow setting alias port ranges in libalias and ipfw. This will allow a system to be a true RFC 6598 NAT444 setup, where each network segment (e.g. user, subnet) can have their own dedicated port aliasing ranges. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a08cdb6cfb1c84b80b5337d46c574b55d0e15c63 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 21:25:48 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a08cdb6cfb1c84b80b5337d46c574b55d0e15c63 commit a08cdb6cfb1c84b80b5337d46c574b55d0e15c63 Author: Neel Chauhan AuthorDate: 2021-02-02 21:24:17 +0000 Commit: Neel Chauhan CommitDate: 2021-02-02 21:24:17 +0000 Allow setting alias port ranges in libalias and ipfw. This will allow a system to be a true RFC 6598 NAT444 setup, where each network segment (e.g. user, subnet) can have their own dedicated port aliasing ranges. Reviewed by: donner, kp Approved by: 0mp (mentor), donner, kp Differential Revision: https://reviews.freebsd.org/D23450 --- sbin/ipfw/ipfw.8 | 3 ++ sbin/ipfw/ipfw2.h | 1 + sbin/ipfw/main.c | 3 +- sbin/ipfw/nat.c | 41 ++++++++++++++++ sys/netinet/ip_fw.h | 2 + sys/netinet/libalias/alias.h | 1 + sys/netinet/libalias/alias_db.c | 30 ++++++++++-- sys/netinet/libalias/alias_local.h | 4 ++ sys/netpfil/ipfw/ip_fw_nat.c | 7 +++ tests/sys/netpfil/common/nat.sh | 99 +++++++++++++++++++++++++++++++++++++- 10 files changed, 186 insertions(+), 5 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index e77930355094..d2c4885bc119 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -3271,6 +3271,9 @@ Reverse the way libalias handles aliasing. Obey transparent proxy rules only, packet aliasing is not performed. .It Cm skip_global Skip instance in case of global state lookup (see below). +.It Cm port_range Ar lower-upper +Set the aliasing ports between the ranges given. Upper port has to be greater +than lower. .El .Pp Some specials value can be supplied instead of diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 764e5176e8ef..42e4f4777792 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -285,6 +285,7 @@ enum tokens { TOK_STATES_CHUNKS, TOK_JMAXLEN, TOK_PORT_RANGE, + TOK_PORT_ALIAS, TOK_HOST_DEL_AGE, TOK_PG_DEL_AGE, TOK_TCP_SYN_AGE, diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c index dc55d0bfa416..89f21062811c 100644 --- a/sbin/ipfw/main.c +++ b/sbin/ipfw/main.c @@ -45,7 +45,8 @@ help(void) "[pipe|queue] {zero|delete|show} [N{,N}]\n" "nat N config {ip IPADDR|if IFNAME|log|deny_in|same_ports|unreg_only|unreg_cgn|\n" " reset|reverse|proxy_only|redirect_addr linkspec|\n" -" redirect_port linkspec|redirect_proto linkspec}\n" +" redirect_port linkspec|redirect_proto linkspec|\n" +" port_range lower-upper}\n" "set [disable N... enable N...] | move [rule] X to Y | swap X Y | show\n" "set N {show|list|zero|resetlog|delete} [N{,N}] | flush\n" "table N {add ip[/bits] [value] | delete ip[/bits] | flush | list}\n" diff --git a/sbin/ipfw/nat.c b/sbin/ipfw/nat.c index bbf5be666ea0..1076e1038b8a 100644 --- a/sbin/ipfw/nat.c +++ b/sbin/ipfw/nat.c @@ -65,6 +65,7 @@ static struct _s_x nat_params[] = { { "reset", TOK_RESET_ADDR }, { "reverse", TOK_ALIAS_REV }, { "proxy_only", TOK_PROXY_ONLY }, + { "port_range", TOK_PORT_ALIAS }, { "redirect_addr", TOK_REDIR_ADDR }, { "redirect_port", TOK_REDIR_PORT }, { "redirect_proto", TOK_REDIR_PROTO }, @@ -753,12 +754,35 @@ nat_show_cfg(struct nat44_cfg_nat *n, void *arg __unused) printf("\n"); } +static int +nat_port_alias_parse(char *str, u_short *lpout, u_short *hpout) { + long lp, hp; + char *ptr; + /* Lower port parsing */ + lp = (long) strtol(str, &ptr, 10); + if (lp < 1024 || lp > 65535) + return 0; + if (!ptr || *ptr != '-') + return 0; + /* Upper port parsing */ + hp = (long) strtol(ptr, &ptr, 10); + if (hp < 1024 || hp > 65535) + return 0; + if (ptr) + return 0; + + *lpout = (u_short) lp; + *hpout = (u_short) hp; + return 1; +} + void ipfw_config_nat(int ac, char **av) { ipfw_obj_header *oh; struct nat44_cfg_nat *n; /* Nat instance configuration. */ int i, off, tok, ac1; + u_short lp, hp; char *id, *buf, **av1, *end; size_t len; @@ -786,6 +810,7 @@ ipfw_config_nat(int ac, char **av) switch (tok) { case TOK_IP: case TOK_IF: + case TOK_PORT_ALIAS: ac1--; av1++; break; @@ -925,8 +950,24 @@ ipfw_config_nat(int ac, char **av) n->redir_cnt++; off += i; break; + case TOK_PORT_ALIAS: + if (ac == 0) + errx(EX_DATAERR, "missing option"); + if (!nat_port_alias_parse(av[0], &lp, &hp)) + errx(EX_DATAERR, + "You need a range of port(s) from 1024 <= x < 65536"); + if (lp >= hp) + errx(EX_DATAERR, + "Upper port has to be greater than lower port"); + n->alias_port_lo = lp; + n->alias_port_hi = hp; + ac--; + av++; + break; } } + if (n->mode & PKT_ALIAS_SAME_PORTS && n->alias_port_lo) + errx(EX_DATAERR, "same_ports and port_range cannot both be selected"); i = do_set3(IP_FW_NAT44_XCONFIG, &oh->opheader, len); if (i != 0) diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index f0531a67132d..4d3099a781a0 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -549,6 +549,8 @@ struct nat44_cfg_nat { struct in_addr ip; /* nat IPv4 address */ uint32_t mode; /* aliasing mode */ uint32_t redir_cnt; /* number of entry in spool chain */ + u_short alias_port_lo; /* low range for port aliasing */ + u_short alias_port_hi; /* high range for port aliasing */ }; /* Nat command. */ diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h index 671241212799..91351a9eb8b9 100644 --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -86,6 +86,7 @@ struct alias_link; /* Initialization and control functions. */ struct libalias *LibAliasInit(struct libalias *); void LibAliasSetAddress(struct libalias *, struct in_addr _addr); +void LibAliasSetAliasPortRange(struct libalias *la, u_short port_low, u_short port_hi); void LibAliasSetFWBase(struct libalias *, unsigned int _base, unsigned int _num); void LibAliasSetSkinnyPort(struct libalias *, unsigned int _port); unsigned int diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 8da9a7fe683a..1f85a606b2d5 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -595,6 +595,11 @@ GetNewPort(struct libalias *la, struct alias_link *lnk, int alias_port_param) */ port_net = lnk->src_port; port_sys = ntohs(port_net); + } else if (la->aliasPortLower) { + /* First trial is a random port in the aliasing range. */ + port_sys = la->aliasPortLower + + (arc4random() % la->aliasPortLength); + port_net = htons(port_sys); } else { /* First trial and all subsequent are random. */ port_sys = arc4random() & ALIAS_PORT_MASK; @@ -647,9 +652,15 @@ GetNewPort(struct libalias *la, struct alias_link *lnk, int alias_port_param) } #endif } - port_sys = arc4random() & ALIAS_PORT_MASK; - port_sys += ALIAS_PORT_BASE; - port_net = htons(port_sys); + if (la->aliasPortLower) { + port_sys = la->aliasPortLower + + (arc4random() % la->aliasPortLength); + port_net = htons(port_sys); + } else { + port_sys = arc4random() & ALIAS_PORT_MASK; + port_sys += ALIAS_PORT_BASE; + port_net = htons(port_sys); + } } #ifdef LIBALIAS_DEBUG @@ -2381,6 +2392,19 @@ LibAliasSetAddress(struct libalias *la, struct in_addr addr) LIBALIAS_UNLOCK(la); } + +void +LibAliasSetAliasPortRange(struct libalias *la, u_short port_low, + u_short port_high) +{ + + LIBALIAS_LOCK(la); + la->aliasPortLower = port_low; + /* Add 1 to the aliasPortLength as modulo has range of 1 to n-1 */ + la->aliasPortLength = port_high - port_low + 1; + LIBALIAS_UNLOCK(la); +} + void LibAliasSetTarget(struct libalias *la, struct in_addr target_addr) { diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h index 5919851a4019..ba128638c1fe 100644 --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -163,6 +163,10 @@ struct libalias { struct in_addr true_addr; /* in network byte order. */ u_short true_port; /* in host byte order. */ + /* Port ranges for aliasing. */ + u_short aliasPortLower; + u_short aliasPortLength; + /* * sctp code support */ diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index 81229b2707e9..bcda3cff011c 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -93,6 +93,8 @@ struct cfg_nat { /* chain of redir instances */ LIST_HEAD(redir_chain, cfg_redir) redir_chain; char if_name[IF_NAMESIZE]; /* interface name */ + u_short alias_port_lo; /* low range for port aliasing */ + u_short alias_port_hi; /* high range for port aliasing */ }; static eventhandler_tag ifaddr_event_tag; @@ -528,9 +530,12 @@ nat44_config(struct ip_fw_chain *chain, struct nat44_cfg_nat *ucfg) ptr->ip = ucfg->ip; ptr->redir_cnt = ucfg->redir_cnt; ptr->mode = ucfg->mode; + ptr->alias_port_lo = ucfg->alias_port_lo; + ptr->alias_port_hi = ucfg->alias_port_hi; strlcpy(ptr->if_name, ucfg->if_name, sizeof(ptr->if_name)); LibAliasSetMode(ptr->lib, ptr->mode, ~0); LibAliasSetAddress(ptr->lib, ptr->ip); + LibAliasSetAliasPortRange(ptr->lib, ptr->alias_port_lo, ptr->alias_port_hi); /* * Redir and LSNAT configuration. @@ -658,6 +663,8 @@ export_nat_cfg(struct cfg_nat *ptr, struct nat44_cfg_nat *ucfg) ucfg->ip = ptr->ip; ucfg->redir_cnt = ptr->redir_cnt; ucfg->mode = ptr->mode; + ucfg->alias_port_lo = ptr->alias_port_lo; + ucfg->alias_port_hi = ptr->alias_port_hi; strlcpy(ucfg->if_name, ptr->if_name, sizeof(ucfg->if_name)); } diff --git a/tests/sys/netpfil/common/nat.sh b/tests/sys/netpfil/common/nat.sh index f74467dce062..9aa06de51337 100644 --- a/tests/sys/netpfil/common/nat.sh +++ b/tests/sys/netpfil/common/nat.sh @@ -147,10 +147,107 @@ userspace_nat_cleanup() firewall_cleanup $firewall } +common_cgn() { + firewall=$1 + portalias=$2 + firewall_init $firewall + nat_init $firewall + + epair_host_nat=$(vnet_mkepair) + epair_client1_nat=$(vnet_mkepair) + epair_client2_nat=$(vnet_mkepair) + + vnet_mkjail nat ${epair_host_nat}b ${epair_client1_nat}a ${epair_client2_nat}a + vnet_mkjail client1 ${epair_client1_nat}b + vnet_mkjail client2 ${epair_client2_nat}b + + ifconfig ${epair_host_nat}a 198.51.100.2/24 up + jexec nat ifconfig ${epair_host_nat}b 198.51.100.1/24 up + + jexec nat ifconfig ${epair_client1_nat}a 100.64.0.1/24 up + jexec client1 ifconfig ${epair_client1_nat}b 100.64.0.2/24 up + + jexec nat ifconfig ${epair_client2_nat}a 100.64.1.1/24 up + jexec client2 ifconfig ${epair_client2_nat}b 100.64.1.2/24 up + + jexec nat sysctl net.inet.ip.forwarding=1 + + jexec client1 route add -net 198.51.100.0/24 100.64.0.1 + jexec client2 route add -net 198.51.100.0/24 100.64.1.1 + + # ping fails without NAT configuration + atf_check -s exit:2 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:2 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 + + if [[ $portalias ]]; then + firewall_config nat $firewall \ + "ipfw" \ + "ipfw -q nat 123 config if ${epair_host_nat}b unreg_cgn port_alias 2000-2999" \ + "ipfw -q nat 456 config if ${epair_host_nat}b unreg_cgn port_alias 3000-3999" \ + "ipfw -q add 1000 nat 123 all from any to 198.51.100.2 2000-2999 in via ${epair_host_nat}b" \ + "ipfw -q add 2000 nat 456 all from any to 198.51.100.2 3000-3999 in via ${epair_host_nat}b" \ + "ipfw -q add 3000 nat 123 all from 100.64.0.2 to any out via ${epair_host_nat}b" \ + "ipfw -q add 4000 nat 456 all from 100.64.1.2 to any out via ${epair_host_nat}b" + else + firewall_config nat $firewall \ + "ipfw" \ + "ipfw -q nat 123 config if ${epair_host_nat}b unreg_cgn" \ + "ipfw -q add 1000 nat 123 all from any to any" + fi + + # ping is successful now + atf_check -s exit:0 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 + + # if portalias, test a tcp server/client with nc + if [[ $portalias ]]; then + for inst in 1 2; do + daemon nc -p 198.51.100.2 7 + atf_check -s exit:0 -o ignore jexec client$inst sh -c "echo | nc -N 198.51.100.2 7" + done + fi +} + +cgn_head() +{ + atf_set descr 'IPv4 CGN (RFC 6598) test' + atf_set require.user root +} + +cgn_body() +{ + common_cgn $1 false +} + +cgn_cleanup() +{ + firewall_cleanup ipfw +} + +portalias_head() +{ + atf_set descr 'IPv4 CGN (RFC 6598) port aliasing test' + atf_set require.user root +} + +portalias_body() +{ + common_cgn $1 true +} + +portalias_cleanup() +{ + firewall_cleanup ipfw +} + setup_tests \ basic \ pf \ ipfw \ ipfnat \ userspace_nat \ - ipfw \ No newline at end of file + ipfw \ + cgn \ + ipfw \ + portalias \ + ipfw From owner-dev-commits-src-main@freebsd.org Tue Feb 2 21:54:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 BEEE053F039 for ; Tue, 2 Feb 2021 21:54:28 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-20.consmr.mail.gq1.yahoo.com (sonic313-20.consmr.mail.gq1.yahoo.com [98.137.65.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVdrM3nFHz4cwD for ; Tue, 2 Feb 2021 21:54:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1612302865; bh=xyKlfDaYlG0bCBCgJPbA/qFFbKVbPb0UETp593PjlGA=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=QJJ/Wy8+Lr2UWqtbF2xNPbn+M9Imnl1oRved95ZHKTq6fuZgH1Vme8fIG1mAugyaQ10pwmAAw1KbWDuzcQTMqjp8LH2j70Et+U1zi2fdwaSDnp4c/t1w/SC56aGvvuKDPHyGGzefr2Jl2h2ke0/4Iy2KtVfPruQsh7+uPDVUwyqjFl7e9lIldS3i+o+D/JAkmzE8/vsDUWvocjpiTRWcfuF4rOoFAqsajbE94Fm+gQisqBGOksj2oXtR6QeiaPAp/icKUT9U5ihmyl3VcMt0Mi05QAVznncP2V1+mITUCJ8vo1SM8k3mB30fCHbUdkmKlRSt4SqjW80YVb8FjCCr/w== X-YMail-OSG: 2sLKH4cVM1nUjBvEQbaVQkYL3DTLGRzQOir2xPy6mDCAUtoy5eVf58lWYQlDmqi NgEmzlgSUPvb4.67PwK6KYR7FxAjaNBX0JPgqO5a8lvZ6Abkfjcs207Bma2KtNXMaa9P8ZfVacNA ZiOJAuakCjKv5DqkeQMTqBtw4zsiAA6esReft_14oImxvt0.Fwv7PW3W11q1STFWl5O2WnAVFqhM D2UabaxjgyGBNt_tYRW6Sj30PO9uBDN.hlvbPF.fPfhCbNOH3iU98Z.KFIlGAy_8mKDe914oxmSI 1oQhb8uBTzUMz7x3l._dHo8AFSntonvNz6Ne3v2tTcysl1kqiWE1iLmpCHW.S2_dPdR8KmpxZvUh Fo7StNM5Qe.OTHpdp2RRM7s3TmymlyED0Y71Q8HrMwXPVqqfYdgJ8tLE3e6gY36GcM6vOBHfh4I2 yMhfpJjHnZ3lt3IXGzaaMQ5zd4zSBtNP4Afurvv1WjxWDB97VmOdn1bpqKXpIPbv6gSJD9xVR.Fn N.wELpaFiYB9d_JOdn7w_iO3LuYmK9njHdKlhGJPyW_xr9pPOg4X2EjdQYX7CoG2qekCkC7kovPd iffCepf_4HIZaSNec9VSU4f_TcvY87_XvnU9G1huohpLiULFZQPV6AKlg5.QmdGhWJHWKo4fdR8w RuaMPzTMQ8HHjIMv9kolWAVYa8.qjz0p3YZ162uWf_8NncfjdEyFYKnNjxb1YyvTk4Th5BWqxWso BNRFTZpYooHh_GObbBD7TiduGeNZaGLm36EwwuOIZLy0o9GWuxjgQy.iP.D6knYzA5xEJyURINDt TxkICP65EXSgvZQyXWiWJZSNGNSNh0loQi8Bh76idHrEW7_.VULx2Pp.Z0k7OPXvvLmLQoH1rEsm mFvr8KxYwmlSxSZBHaaA61mEeYVc03lmOxioNsLXyZwur8MZ__sfctYkc5nWv4B8qFI6WDnCQ7JY LmmWnTxJ.jLErwEvSCQ4D2ghpPbT5.gUp57QUChIV0P9mPPltPmTARdqz9VWU_gjGGSl2v1vRHQW ZTEZPN8cNdiTdBHVxfj1olXyU9TUfakhz53oARcj4Nt90jmBEZ6F4sQZTndvu8vuGiktmSf7eTrD nyNfVCOciVm6JthbUrxE2jioGbbXs__uu7Ie5_FGtQXxxETDUu8pnmHkI99xVjizUYLBgYc4Gwkg 5.OmMBiM5IMXdplMF0TOMxuRE8WYKhZyqIsUl.75DU.aKFFOXpvmhj1pvYRMzBQOd1KytXGtVKVc TO7s8U5OsCH5FK.7_lA1vfPY3J.v5EpF4am.gqmYkDpk315J7BCn239DejirniMD4RI6dF_EzMHm hnrLO0Tcbz_hjfGawU68r888QMXtIweWg0gQV_bQT.8wNvu1MpKxj8fvzlGOGoOj23Pglql1Gq4M hR2JMHXx.wHMGZt2FmTzZyeeWOUSUjyFDHmLJ.dZ6M_rAkh7j_Pazgurd1D0y5DM5NtKX6Q5eNRO SfFEY0M2gQkiBLuRRev.j.j7nDjS9hptRVUEA3Tr9BM7N3rbloQzAGeoTW06P8RUzEo3K1yOwEkg Ai4s8H4LoAAQWh_n4KOFO2LkOFR3336suXojZUlbrilkjtwOnExr5gwYWL5PIoqyq3hBGBlMmIgW mZdbP9jPUALMMuylC2uQxwLPsKUY2tVWf5OW97dAGldEQ1_HudfchiqMReJ5GwstOiepvtLKRH64 5inJ4Jm54WLIWycVAJSWENDi2OrcW4xijuzpKTYuKDWPJ3sV45rmGlf5vfUtteVhEnjcucMFPqHu cL4Wx_ZJu_uPF2FnP2I5yKmwKV9BBSzbILkfyscXfWw0fJjHs.nX56kIPkgYF5bcOf4.Rz2ew6xi MO0JfhnKvuGUZls22X5_nz.Mt3w57DPyLk5FZw.fP76dhbJBmyH6XIaOEvm16vhAqL8wgyi1WtmF DhZozVsTFA8GGRL0bGBkzdp5w0AEK7yy2d6b3OD9ZHOxFtplHnU0_KOFGeXHD_dQoTXsLVnJrMRJ ZvB8OsXoBIe3Ao5xk5EXyJzcHPmaX5TosLCukhK0isrPJxaY3MgnkECS8vVOtJJ_mJzITLtx4kUB V5as7WgJqh32a5_oyQFcF7E41RYjXAdzyaqT7dAwLGB7VmzNpBic44TBAc3ql0nNpCDZ_MHHMx49 rubR6koMwuyQbOzckV_WAUL0_Jq9dqfHf2avdO_f_VoEPQbBzI5xJq3BzyGQ7s4AIWU3nyQDCEms cEUWuLN2YMsfbJaOtd8Ts_5o12shcowSPWytAosncWBirM7wzTXvESFENubEksphJ2Z1uUecGnDc _Pz0.SUmB_wccxNbNm10qb55..HzCM.me2tIgAXsy3nJdvykgw1ydHvncDOHCWTX0O4rHL34obVK xvG8CxTcinBvX311Hx3lMhm5wTCo87q4I7iOHwHhNfnuLFthZ9TG9VHTHDHKLzy2ighsf9muVsGH AR1wP5SCuBDpnMhTN9LUem5KNeZtgFXjCnGTQhut7PaPq6EwE5rvAz7wVBAAtA8TkmJihe.0gcnK dVnfC16i.clgkOxpTi.r2GHKRJNFidsI80Pi6l4xiapEoJR6xkzTH.FVoAy1vXzPaQDSYilv37rl laKOBZBCaCpVwv2ak X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Tue, 2 Feb 2021 21:54:25 +0000 Received: by smtp424.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID a8ee1c19c7bad4675bb5cf5bd2bed207; Tue, 02 Feb 2021 21:54:21 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: git: 054ce2b03710 - main - atomic: add stub atomic_load_consume_ptr Message-Id: <007C2A0C-9197-4744-85BE-151873EC7203@yahoo.com> Date: Tue, 2 Feb 2021 13:54:18 -0800 Cc: "mjg@freebsd.org" To: rtc27@reebsd.org, dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3654.40.0.2.32) References: <007C2A0C-9197-4744-85BE-151873EC7203.ref@yahoo.com> X-Rspamd-Queue-Id: 4DVdrM3nFHz4cwD X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.65.83:from]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.65.83:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.83:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.83:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 21:54:28 -0000 Jessica Clarke jrtc27 at freebsd.org wrote on Mon Jan 25 23:56:41 UTC 2021 : > On 25 Jan 2021, at 22:42, Mateusz Guzik wrote: > >=20 > > The branch main has been updated by mjg: > >=20 > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D054ce2b0371042c0dbc4b3ab1d7e7795= ad75d51e > >=20 > > commit 054ce2b0371042c0dbc4b3ab1d7e7795ad75d51e > > Author: Mateusz Guzik > > AuthorDate: 2021-01-25 20:09:41 +0000 > > Commit: Mateusz Guzik > > CommitDate: 2021-01-25 22:40:15 +0000 > >=20 > > atomic: add stub atomic_load_consume_ptr >=20 > Consume semantics is a waste of time, it's basically impossible to > implement in an optimising compiler as, in order to not emit the same > fences as an acquire, you need the source dependencies to be mapped to > data dependencies in the output assembly, but all manner of > transformations can cause that to break. And that's before you get to > hand-written atomic implementations where it is impossible for you to > ensure that, as you're not even telling the compiler what you're = doing. > For example: >=20 > int x =3D atomic_load_consume_int(p); > int y =3D q[x - x]; >=20 > This looks like stupid code, but the `x - x` cannot be constant-folded > without inserting a barrier, as currently there is data dependence at > the source level. If you use language-level atomics then it "works" by > virtue of compilers just turning consumes into acquires so the later > constant folding is safe. But if your atomic_load_consume_int is > hand-rolled magic assembly then the compiler has no clue and will > blindly go and constant fold that subtraction for you, completely > breaking your synchronisation. >=20 > Providing consume loads just doesn't make sense for FreeBSD's atomics > except for documenting the exact requirements of the code being = written; > they can never be implemented as anything other than acquire loads > unless we migrate to using actual C11 atomics, but even then you won't > get any code generation difference and likely never will. My understanding that the language standards defined the consume semantics, relative to release sequences and such, such that too much could be inferred, for example on armv8, in absence of extra code that consume was intended to avoid. For example, armv8 can do speculative consume loads across conditional branches and the dependent load can return a stale value. So the release sequence implications are being backed-off and happens-before splits into simple-happens-before (allows=20 consume to be involved) and strong-happens-before (that does not allow consume to be involved) and possibly more. This suggests to me that great care is needed in deciding to use a consume operation (not just via a specific language or language family's formal notation), probably to the point of requiring explicitly well-commenting on the guarantees in the context that allow consume to be safe and on what needs to be maintained to avoid having future changes implicit break the consume behavior. Or, may be, FreeBSD needs to more globally document just what only-minimal types inferences are to be allowed to be put to use for any FreeBSD consume use, possibly less than what the adjusted language standards are attempting. That might make such code less easy to accidentally break. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-main@freebsd.org Tue Feb 2 22:01:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C257A53EFF4; Tue, 2 Feb 2021 22:01:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVdzx582Fz4dRl; Tue, 2 Feb 2021 22:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A36FD15D84; Tue, 2 Feb 2021 22:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 112M11mp005601; Tue, 2 Feb 2021 22:01:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112M11hg005600; Tue, 2 Feb 2021 22:01:01 GMT (envelope-from git) Date: Tue, 2 Feb 2021 22:01:01 GMT Message-Id: <202102022201.112M11hg005600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: edc374e7c41d - main - Correct description for kern.proc.proc_td MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: edc374e7c41d3d9e28e0b3a76bc9ed021d7db571 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 22:01:01 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=edc374e7c41d3d9e28e0b3a76bc9ed021d7db571 commit edc374e7c41d3d9e28e0b3a76bc9ed021d7db571 Author: Ed Maste AuthorDate: 2021-02-02 21:55:51 +0000 Commit: Ed Maste CommitDate: 2021-02-02 22:00:05 +0000 Correct description for kern.proc.proc_td kern.proc.proc_td returns the process table with an entry for each thread. Previously the description included "no threads", presumably a cut-and-pasteo in 2648efa621748. Description suggested by PauAmma. PR: 253146 MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/kern/kern_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index ae80ba9ed5ed..305bc7e8a2ef 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3186,7 +3186,7 @@ static SYSCTL_NODE(_kern_proc, (KERN_PROC_PID | KERN_PROC_INC_THREAD), pid_td, static SYSCTL_NODE(_kern_proc, (KERN_PROC_PROC | KERN_PROC_INC_THREAD), proc_td, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, - "Return process table, no threads"); + "Return process table, including threads"); #ifdef COMPAT_FREEBSD7 static SYSCTL_NODE(_kern_proc, KERN_PROC_OVMMAP, ovmmap, CTLFLAG_RD | From owner-dev-commits-src-main@freebsd.org Wed Feb 3 00:04:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 97F2E4FA4BE; Wed, 3 Feb 2021 00:04:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVhkj3y7Wz4l55; Wed, 3 Feb 2021 00:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7A6111779A; Wed, 3 Feb 2021 00:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11304jgT066686; Wed, 3 Feb 2021 00:04:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11304jNI066685; Wed, 3 Feb 2021 00:04:45 GMT (envelope-from git) Date: Wed, 3 Feb 2021 00:04:45 GMT Message-Id: <202102030004.11304jNI066685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: 805e2876ec20 - main - release.sh: Skip installing textproc/docproj when NODOC is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 805e2876ec20f89e45f0f9f4164f31b6711ff0ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 00:04:45 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=805e2876ec20f89e45f0f9f4164f31b6711ff0ea commit 805e2876ec20f89e45f0f9f4164f31b6711ff0ea Author: Glen Barber AuthorDate: 2021-02-03 00:04:11 +0000 Commit: Glen Barber CommitDate: 2021-02-03 00:04:11 +0000 release.sh: Skip installing textproc/docproj when NODOC is set PR: 253192 Submitted by: Yasuhiro Kimura MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 372f69177f7e..4020c27feaa0 100755 --- a/release/release.sh +++ b/release/release.sh @@ -320,7 +320,7 @@ extra_chroot_setup() { pkg clean -y fi fi - if [ -d ${CHROOTDIR}/usr/ports ]; then + if [ -z "${NODOC}" ] && [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) From owner-dev-commits-src-main@freebsd.org Wed Feb 3 00:47:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D56834FB816; Wed, 3 Feb 2021 00:47:22 +0000 (UTC) (envelope-from jhb@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVjgt5jBFz4nL9; Wed, 3 Feb 2021 00:47:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:a03e:f824:f6c:d0c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 319F32EB63; Wed, 3 Feb 2021 00:47:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: aa906e2a4957 - main - OpenSSL: Support for kernel TLS offload (KTLS) To: Guido Falsi , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101281825.10SIPTGJ021104@gitrepo.freebsd.org> <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> Cc: Benjamin Kaduk From: John Baldwin Message-ID: <1675730b-f559-a732-be49-d89c97a376f8@FreeBSD.org> Date: Tue, 2 Feb 2021 16:47:20 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 00:47:22 -0000 On 1/31/21 10:41 AM, Guido Falsi wrote: > On 28/01/21 19:25, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> >> commit aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> Author: John Baldwin >> AuthorDate: 2021-01-16 00:17:31 +0000 >> Commit: John Baldwin >> CommitDate: 2021-01-28 18:24:13 +0000 >> >> OpenSSL: Support for kernel TLS offload (KTLS) >> >> This merges upstream patches from OpenSSL's master branch to add >> KTLS infrastructure for TLS 1.0-1.3 including both RX and TX >> offload and SSL_sendfile support on both Linux and FreeBSD. >> >> Note that TLS 1.3 only supports TX offload. >> >> A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with >> KTLS support. It defaults to enabled on amd64 and disabled on all >> other architectures. >> >> Reviewed by: jkim (earlier version) >> Approved by: secteam >> Obtained from: OpenSSL (patches from master) >> MFC after: 1 week >> Relnotes: yes >> Sponsored by: Netflix >> Differential Revision: https://reviews.freebsd.org/D28273 >> --- > > This commit causes a strange interaction/regression with subverison > client when using https protocol. > > I filed a bug report about this: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253135 > > Workarounds: > > - Compiling system defining WITHOUT_OPENSSL_KTLS > - using the svn:// scheme I'm still waiting for a build to finish so I can test it, but I believe this is a bug in serf. This is the patch I'm going to test: diff --git a/contrib/serf/buckets/ssl_buckets.c b/contrib/serf/buckets/ssl_buckets.c index b01e5359db08..3c8b7e2a685f 100644 --- a/contrib/serf/buckets/ssl_buckets.c +++ b/contrib/serf/buckets/ssl_buckets.c @@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio) static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) { - long ret = 1; + long ret = 0; switch (cmd) { default: @@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) break; case BIO_CTRL_FLUSH: /* At this point we can't force a flush. */ + ret = 1; break; case BIO_CTRL_PUSH: case BIO_CTRL_POP: serf defines its own custom OpenSSL BIO classes, and the BIO_ctrl(3) manpage documents that the control methods of custom BIOs are supposed to return 0 for unknown or unsupported requests: Source/sink BIOs return an 0 if they do not recognize the BIO_ctrl() operation. However, the custom BIOs in serf broke this rule and returned 1 for unknown operations instead. OpenSSL uses BIO_ctrl methods to determine if a given BIO for a read or write side of an SSL connection is using KTLS. Because of the serf bug, this caused OpenSSL to believe that these BIOs were using KTLS when they in fact were not. serf will also probably break with OpenSSL 3.0 even without KTLS due to the recently added control for determining if a BIO has hit EOF which also returns 1 to indicate it has hit EOF. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Feb 3 08:24:05 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4560852F827; Wed, 3 Feb 2021 08:24:05 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "vtr.rulingia.com", Issuer "R3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVvpr5NhJz3mZZ; Wed, 3 Feb 2021 08:24:04 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.16.1/8.15.2) with ESMTPS id 1138Nmdb002718 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Feb 2021 19:23:53 +1100 (AEDT) (envelope-from peter@rulingia.com) DKIM-Filter: OpenDKIM Filter v2.10.3 vtr.rulingia.com 1138Nmdb002718 X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.16.1/8.16.1) with ESMTPS id 1138Ngia029445 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Feb 2021 19:23:42 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.16.1/8.16.1/Submit) id 1138NglL029444; Wed, 3 Feb 2021 19:23:42 +1100 (AEDT) (envelope-from peter) Date: Wed, 3 Feb 2021 19:23:42 +1100 From: Peter Jeremy To: Alex Richardson Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 83c20b8a2da0 - main - tests/sys/kern/crc32: Check for SSE4.2 before using it Message-ID: References: <202102021008.112A8RkU069892@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9d7QdlvvMF1rOrGM" Content-Disposition: inline In-Reply-To: <202102021008.112A8RkU069892@gitrepo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp X-Rspamd-Queue-Id: 4DVvpr5NhJz3mZZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 08:24:05 -0000 --9d7QdlvvMF1rOrGM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-Feb-02 10:08:27 +0000, Alex Richardson wr= ote: >The branch main has been updated by arichardson: > >URL: https://cgit.FreeBSD.org/src/commit/?id=3D83c20b8a2da04937cf4af127366= b3dc92c855784 =2E.. > Differential Revision: https://reviews.freebsd.org/D28395 >--- =2E.. >diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile >index 1806d7ce8597..f350b740b7ea 100644 >--- a/tests/sys/kern/Makefile >+++ b/tests/sys/kern/Makefile >@@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+=3D sysv_test > CFLAGS.mqueue_test+=3D -I${SRCTOP}/tests > LIBADD.mqueue_test+=3D rt >=20 >-.if ${MACHINE_ARCH} =3D=3D "amd64" || \ >- ${MACHINE_ARCH} =3D=3D "i386" || \ >- ${MACHINE_CPUARCH} =3D=3D "aarch64" > ATF_TESTS_C+=3D libkern_crc32 >+SRCS.libkern_crc32+=3D libkern_crc32.c >+.PATH: ${SRCTOP}/sys/libkern >+SRCS.libkern_crc32+=3D gsb_crc32.c >+CFLAGS.libkern_crc32+=3D -DTESTING > .if ${MACHINE_ARCH} =3D=3D "amd64" || ${MACHINE_ARCH} =3D=3D "i386" >-LDADD.libkern_crc32+=3D ${SRCTOP}/sys/libkern/x86/crc32_sse42.c >-.else >-LDADD.libkern_crc32+=3D ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S >-.endif >+SRCS.libkern_crc32+=3D ${SRCTOP}/sys/libkern/x86/crc32_sse42.c >+.elif ${MACHINE_CPUARCH} =3D=3D "aarch64" >+SRCS.libkern_crc32+=3D ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S > .endif >=20 > # subr_unit.c contains functions whose prototypes lie in headers that can= not be This breaks buildworld with a RO /usr/src for me: =2E.. =3D=3D=3D> tests/sys/kern (all) =2E.. Building /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/pdeathsig (cd /usr/src/tests/sys/kern && DEPENDFILE=3D.depend.libkern_crc32 NO_SUBD= IR=3D1 make -f /usr/src/tests/sys/kern/Makefile _RECURSING_PROGS=3Dt PROG= =3Dlibkern_crc32 ) Building /usr/src/sys/libkern/arm64/crc32c_armv8.o clang -cc1as: error: unable to open output file '/usr/src/sys/libkern/arm64= /crc32c_armv8.o': 'Read-only file system' *** Error code 1 I do have an (empty) /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/usr/src/sys/libkern/arm64 --=20 Peter Jeremy --9d7QdlvvMF1rOrGM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmAaXYZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQfXw//bIZtk9dOl7Mq4sUZ6qbcnkAowDfLQyr8qU4M6Y3lbivV+ZE3uJNLJt7s O7SWXPstmJeu5QN9OCnsWtMg2x/iJvMEmjCRNlxcgeQgkBcorx2oIpoNFlmM5jPP 3v7ymUMxK1/pDa5rMFA3zYOXm0UAqVawHi7qTmnM/ndGu+NOKij1xmHZvFpiTrgD tYLiJoS+/WR0Ql/7PF/3MOtJdqxcQut/uw4ftWxnbimnMGnPnl0sd0EZMpNj/Y40 4nhCVUVBDAPa4nQukytH0wGDjuw9svV5htxOSgdO5ZyuG10XnzxIn1iKzBByVS4d o5xJFt9ksPpdipsLM3lEQBXT+xcEA9r5tRLq8A1sC9B1QR6gi1SiNaa/UjWHDCp/ E/B9ulDneeWFnsdb8IEA/E7+yiI57K9K5CqpczgG9stOEJVbjhwE+sljWYI+MguM bRyjv299uiR6kA7vyAB6YsJucX52q26H9+2YjRDj+BkBSxSPqyRDnqQ18O9h/8+v MXe5vcM4Rkf2WK5nOvcpsYJ9Dxv7sT5Hz0LLpb3osqXu/I3jzVXTIEjvx3UN0bQl V+dpvQvbazbprm9IH4u4wn20yHyfHb4fpfyS7EIEHqVs3KveYxpeCgLuEt4z31hY y/maCXB1Ec8R40K3K+6fM9j/DqLHbaWK8jAyZmxQJe2nbVldYeI= =CNUM -----END PGP SIGNATURE----- --9d7QdlvvMF1rOrGM-- From owner-dev-commits-src-main@freebsd.org Wed Feb 3 08:51:16 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B9F1D530418; Wed, 3 Feb 2021 08:51:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVwQD4Sjgz3nw3; Wed, 3 Feb 2021 08:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8C0741E1A0; Wed, 3 Feb 2021 08:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1138pGQ0055805; Wed, 3 Feb 2021 08:51:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1138pGCS055804; Wed, 3 Feb 2021 08:51:16 GMT (envelope-from git) Date: Wed, 3 Feb 2021 08:51:16 GMT Message-Id: <202102030851.1138pGCS055804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: eb0b1b33d5af - main - Enable multipath routing by default. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb0b1b33d5af4e81ee77732dffc77634e57a5879 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 08:51:16 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=eb0b1b33d5af4e81ee77732dffc77634e57a5879 commit eb0b1b33d5af4e81ee77732dffc77634e57a5879 Author: Alexander V. Chernikov AuthorDate: 2021-02-03 08:49:46 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-03 08:49:58 +0000 Enable multipath routing by default. ROUTE_MPATH was added to the GENERIC kernel in r368648. According to the plan in D27428, it was enabled with `net.route.multipath` sysctl set to 0. Given enough time has passed, this change enables route multipath by default. The goal is to ship FreeBSD 13 with multipath turned on. Reviewed By: donner, olivier MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28423 --- sys/net/route/route_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index c46d0430a164..6b0869196d12 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -101,7 +101,7 @@ SYSCTL_DECL(_net_route); #else #define _MP_FLAGS CTLFLAG_RD #endif -VNET_DEFINE(u_int, rib_route_multipath) = 0; +VNET_DEFINE(u_int, rib_route_multipath) = 1; SYSCTL_UINT(_net_route, OID_AUTO, multipath, _MP_FLAGS | CTLFLAG_VNET, &VNET_NAME(rib_route_multipath), 0, "Enable route multipath"); #undef _MP_FLAGS From owner-dev-commits-src-main@freebsd.org Wed Feb 3 09:25:05 2021 Return-Path: Delivered-To: dev-commits-src-main@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 ADFA553146A; Wed, 3 Feb 2021 09:25:05 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVx9F09xrz3rTh; Wed, 3 Feb 2021 09:25:04 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f49.google.com with SMTP id f14so10255964ejc.8; Wed, 03 Feb 2021 01:25:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FsYh2nSYLSPLoFU54SITZmykM6OZ9mnKgp7tnX86VIk=; b=k+MUtQTMZ/VxwyQTr0WPSlrGeE1I/9YE+/epu2kSlb9pfo6I73og+29mCGvNL3DKaY sXSWsWsnxlNtiBsSIhG8IGNGvDkMyfI5/T+wop99Tj220Gqiy72GCKQZdyBSh+WpxfVC oCvQ9Q8aLrg/I1VCpTSkbPz4ZuGreMhXpKYoLyhM6ym8x+PcM8gymSeIgvpD5omrSBW1 luF3o9AzrR8gqPj9rTrek4Jjo5OX1zAqjS5w3FsZSqWyb7fbvmBkkcZrbiD7l5KBl1C2 hnYrukrSrm4l4P45GDx69i6PqlCtEMgFHJVdFmRc1ojCZavry8fOlvmUjTMfnV320Uez Vr9w== X-Gm-Message-State: AOAM530xE1KwebRvX/Jm/p9qkuV77SXOqo8+g3kVKvN9OYfpve23U9mS 7Hy5JU6O/0UG75dGlCfgLFeUH52c4AJZGw== X-Google-Smtp-Source: ABdhPJxWke3gL6vj41fyOgR/0GSx9HSmy/Z2Gn2JqizSpt8pEOw0Vc7p0A+d4ypxWDtXY3WCSVOrIQ== X-Received: by 2002:a17:906:a48:: with SMTP id x8mr2257407ejf.444.1612344303581; Wed, 03 Feb 2021 01:25:03 -0800 (PST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id ov9sm726209ejb.53.2021.02.03.01.25.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Feb 2021 01:25:03 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id d16so23284645wro.11; Wed, 03 Feb 2021 01:25:03 -0800 (PST) X-Received: by 2002:a5d:4443:: with SMTP id x3mr2470061wrr.409.1612344303049; Wed, 03 Feb 2021 01:25:03 -0800 (PST) MIME-Version: 1.0 References: <202102021008.112A8RkU069892@gitrepo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Wed, 3 Feb 2021 09:24:52 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 83c20b8a2da0 - main - tests/sys/kern/crc32: Check for SSE4.2 before using it To: Peter Jeremy Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DVx9F09xrz3rTh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of arichardsonkde@gmail.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.49:from]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.218.49:from]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.218.49:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.49:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 09:25:05 -0000 On Wed, 3 Feb 2021, 08:24 Peter Jeremy, wrote: > On 2021-Feb-02 10:08:27 +0000, Alex Richardson > wrote: > >The branch main has been updated by arichardson: > > > >URL: > https://cgit.FreeBSD.org/src/commit/?id=83c20b8a2da04937cf4af127366b3dc92c855784 > ... > > Differential Revision: https://reviews.freebsd.org/D28395 > >--- > ... > >diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile > >index 1806d7ce8597..f350b740b7ea 100644 > >--- a/tests/sys/kern/Makefile > >+++ b/tests/sys/kern/Makefile > >@@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+= sysv_test > > CFLAGS.mqueue_test+= -I${SRCTOP}/tests > > LIBADD.mqueue_test+= rt > > > >-.if ${MACHINE_ARCH} == "amd64" || \ > >- ${MACHINE_ARCH} == "i386" || \ > >- ${MACHINE_CPUARCH} == "aarch64" > > ATF_TESTS_C+= libkern_crc32 > >+SRCS.libkern_crc32+= libkern_crc32.c > >+.PATH: ${SRCTOP}/sys/libkern > >+SRCS.libkern_crc32+= gsb_crc32.c > >+CFLAGS.libkern_crc32+= -DTESTING > > .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" > >-LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c > >-.else > >-LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S > >-.endif > >+SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c > >+.elif ${MACHINE_CPUARCH} == "aarch64" > >+SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S > > .endif > > > > # subr_unit.c contains functions whose prototypes lie in headers that > cannot be > > This breaks buildworld with a RO /usr/src for me: > ... > ===> tests/sys/kern (all) > ... > Building /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/pdeathsig > (cd /usr/src/tests/sys/kern && DEPENDFILE=.depend.libkern_crc32 > NO_SUBDIR=1 make -f /usr/src/tests/sys/kern/Makefile _RECURSING_PROGS=t > PROG=libkern_crc32 ) > Building /usr/src/sys/libkern/arm64/crc32c_armv8.o > clang -cc1as: error: unable to open output file > '/usr/src/sys/libkern/arm64/crc32c_armv8.o': 'Read-only file system' > *** Error code 1 > > I do have an (empty) > /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/usr/src/sys/libkern/arm64 > Hi, I have a fix that I'm currently testing and will commit shortly. It seems the problem is that I changed it from (ab)using LDADD to using SRCS which defaults to creating the .o file in the same directory as the source. Alex From owner-dev-commits-src-main@freebsd.org Wed Feb 3 09:38:38 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4560B53190E; Wed, 3 Feb 2021 09:38:38 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVxSt1SbPz3sGw; Wed, 3 Feb 2021 09:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 24FDD1ECA8; Wed, 3 Feb 2021 09:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1139ccBN009815; Wed, 3 Feb 2021 09:38:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1139ccPq009814; Wed, 3 Feb 2021 09:38:38 GMT (envelope-from git) Date: Wed, 3 Feb 2021 09:38:38 GMT Message-Id: <202102030938.1139ccPq009814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 8b820df156e0 - main - Fix build with read-only source dir after 83c20b8a2da0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b820df156e065f48857dca89a89462074659e14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 09:38:38 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8b820df156e065f48857dca89a89462074659e14 commit 8b820df156e065f48857dca89a89462074659e14 Author: Alex Richardson AuthorDate: 2021-02-03 09:29:08 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 09:30:53 +0000 Fix build with read-only source dir after 83c20b8a2da0 I changed the Makefile to use SRCS instead of LDADD, but since there is still and absolute path to the source the .o file was created inside the source directory instead of the build directory. It would be nice if this was an error/warning by default, but for now just fix this issue by using .PATH and the base name of the file. Reported by: cy, peterj --- tests/sys/kern/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index f350b740b7ea..6746812d9b4a 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -62,9 +62,11 @@ SRCS.libkern_crc32+= libkern_crc32.c SRCS.libkern_crc32+= gsb_crc32.c CFLAGS.libkern_crc32+= -DTESTING .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c +.PATH: ${SRCTOP}/sys/libkern/x86 +SRCS.libkern_crc32+= crc32_sse42.c .elif ${MACHINE_CPUARCH} == "aarch64" -SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S +.PATH: ${SRCTOP}/sys/libkern/arm64 +SRCS.libkern_crc32+= crc32c_armv8.S .endif # subr_unit.c contains functions whose prototypes lie in headers that cannot be From owner-dev-commits-src-main@freebsd.org Wed Feb 3 09:38:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5A2E05318ED; Wed, 3 Feb 2021 09:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVxSv28Vhz3sST; Wed, 3 Feb 2021 09:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3BF9A1EBA9; Wed, 3 Feb 2021 09:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1139cdNT009838; Wed, 3 Feb 2021 09:38:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1139cdrG009837; Wed, 3 Feb 2021 09:38:39 GMT (envelope-from git) Date: Wed, 3 Feb 2021 09:38:39 GMT Message-Id: <202102030938.1139cdrG009837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: d6f4e1a8973d - main - sbin/bectl: Skip tests if sparse files are not supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6f4e1a8973daff2ffe4480b66c973562982ffc7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 09:38:39 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d6f4e1a8973daff2ffe4480b66c973562982ffc7 commit d6f4e1a8973daff2ffe4480b66c973562982ffc7 Author: Alex Richardson AuthorDate: 2021-02-03 09:31:32 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 09:31:32 +0000 sbin/bectl: Skip tests if sparse files are not supported The tests create a 1GB test file and this causes the tests to fail in the CheriBSD CI setup where we run tests with a tmpfs mount on /tmp. Tmpfs does not support sparse files and it appears that tmpfs default to creating a 1GB mount, so there is not enough space to run these tests. Instead of checking for at least 1GB of free space, this commit skips the tests on file systems that do not support sparse files. Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28463 --- sbin/bectl/tests/bectl_test.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 36c92235b6d8..221fe21e29ed 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -49,6 +49,13 @@ bectl_create_setup() atf_check test -n "$zpool" kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ + "probably not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -R ${mnt} ${zpool} ${disk} From owner-dev-commits-src-main@freebsd.org Wed Feb 3 09:38:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7EC6B531742; Wed, 3 Feb 2021 09:38:41 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVxSw4m2Cz3sY6; Wed, 3 Feb 2021 09:38:40 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7A1C81E4ED; Wed, 3 Feb 2021 09:38:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1139ceVD009858; Wed, 3 Feb 2021 09:38:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1139ceOk009857; Wed, 3 Feb 2021 09:38:40 GMT (envelope-from git) Date: Wed, 3 Feb 2021 09:38:40 GMT Message-Id: <202102030938.1139ceOk009857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 9b131f1e51a0 - main - atf: Fix ATF_BUILD_* values when not using the bootstrap compiler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b131f1e51a00c8bbbda32672fb5db88010400f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 09:38:41 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9b131f1e51a00c8bbbda32672fb5db88010400f6 commit 9b131f1e51a00c8bbbda32672fb5db88010400f6 Author: Alex Richardson AuthorDate: 2021-02-03 09:32:16 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 09:32:16 +0000 atf: Fix ATF_BUILD_* values when not using the bootstrap compiler Currently, we encode the full path and compile flags for the build compiler in libatf. However, these values are not correct when cross-compiling: For example, when I build on macOS, CC is set to the host path /usr/local/Cellar/llvm/11.0.0_1/bin/clang-11. This path will not exist on the target system. Simplify this logic and use cc/cpp/c++ since those binaries will exist on the target system unless the compiler was explicitly disabled. I'm not convinced ATF needs to encode these values, but this is a minimal fix for these tests when using a non-bootstrapped compiler. Reviewed By: ngie, brooks Differential Revision: https://reviews.freebsd.org/D28414 --- lib/atf/libatf-c/Makefile | 23 +---------------------- lib/atf/libatf-c/Makefile.inc | 7 +++++++ lib/atf/libatf-c/tests/Makefile | 1 + 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile index 78b821b3c64d..7c9807c24ded 100644 --- a/lib/atf/libatf-c/Makefile +++ b/lib/atf/libatf-c/Makefile @@ -28,22 +28,6 @@ .include .include -# Store the toolchain executable in ATF_BUILD_{CC,CPP,CXX} to ensure other -# values -- like -target, -B ..., etc -- don't get leaked into the tests. -# -# Be sure to omit ${CCACHE_BIN} (if specified) from the variable as it gets -# automatically appended to the variables in bsd.compiler.mk when -# ${MK_CCACHE_BUILD} != no. -ATF_BUILD_CC:= ${CC:N${CCACHE_BIN}:[1]} -ATF_BUILD_CPP:= ${CPP:N${CCACHE_BIN}:[1]} -ATF_BUILD_CXX:= ${CXX:N${CCACHE_BIN}:[1]} - -# Only capture defines, includes, linker flags, optimization levels, warnings -# and preprocessor flags when building ATF_BUILD_{C,CPP,CXX}FLAGS. -ATF_BUILD_CFLAGS:= ${CFLAGS:M-[DILOWf]*} -ATF_BUILD_CPPFLAGS:= ${CPPFLAGS:M-[DILOWf]*} -ATF_BUILD_CXXFLAGS:= ${CXXFLAGS:M-[DILOWf]*} - PACKAGE= tests LIB= atf-c PRIVATELIB= true @@ -54,12 +38,6 @@ ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/atf-c .PATH: ${ATF}/atf-c/detail -CFLAGS+= -DATF_BUILD_CC='"${ATF_BUILD_CC}"' -CFLAGS+= -DATF_BUILD_CFLAGS='"${ATF_BUILD_CFLAGS}"' -CFLAGS+= -DATF_BUILD_CPP='"${ATF_BUILD_CPP}"' -CFLAGS+= -DATF_BUILD_CPPFLAGS='"${ATF_BUILD_CPPFLAGS}"' -CFLAGS+= -DATF_BUILD_CXX='"${ATF_BUILD_CXX}"' -CFLAGS+= -DATF_BUILD_CXXFLAGS='"${ATF_BUILD_CXXFLAGS}"' CFLAGS+= -I${ATF} CFLAGS+= -I${.CURDIR} CFLAGS+= -I. @@ -160,5 +138,6 @@ MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility. HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.include "Makefile.inc" .include "../common.mk" .include diff --git a/lib/atf/libatf-c/Makefile.inc b/lib/atf/libatf-c/Makefile.inc index 265f86d1ed55..f668e36b2d6a 100644 --- a/lib/atf/libatf-c/Makefile.inc +++ b/lib/atf/libatf-c/Makefile.inc @@ -1,3 +1,10 @@ # $FreeBSD$ .include "../Makefile.inc" + +CFLAGS+= -DATF_BUILD_CC='"cc"' +CFLAGS+= -DATF_BUILD_CFLAGS='"-Wall"' +CFLAGS+= -DATF_BUILD_CPP='"cpp"' +CFLAGS+= -DATF_BUILD_CPPFLAGS='""' +CFLAGS+= -DATF_BUILD_CXX='"c++"' +CFLAGS+= -DATF_BUILD_CXXFLAGS='"-Wall"' diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile index c99b2d115967..3bcdfc8f7071 100644 --- a/lib/atf/libatf-c/tests/Makefile +++ b/lib/atf/libatf-c/tests/Makefile @@ -35,4 +35,5 @@ SRCS.${_T}= ${_T}.c test_helpers.c TEST_METADATA.${_T}+= required_programs="cc" .endfor +.include "Makefile.inc" .include From owner-dev-commits-src-main@freebsd.org Wed Feb 3 11:05:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 075B2533503; Wed, 3 Feb 2021 11:05:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVzPQ6rnvz4RWp; Wed, 3 Feb 2021 11:05:46 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 DDD2D2008D; Wed, 3 Feb 2021 11:05:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113B5kb9026781; Wed, 3 Feb 2021 11:05:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113B5kLY026780; Wed, 3 Feb 2021 11:05:46 GMT (envelope-from git) Date: Wed, 3 Feb 2021 11:05:46 GMT Message-Id: <202102031105.113B5kLY026780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Grehan Subject: git: 5aaea4b99e5c - main - Always clamp curve25519 keys prior to use. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5aaea4b99e5cc724e97e24a68876e8768d3d8012 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 11:05:47 -0000 The branch main has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=5aaea4b99e5cc724e97e24a68876e8768d3d8012 commit 5aaea4b99e5cc724e97e24a68876e8768d3d8012 Author: Peter Grehan AuthorDate: 2021-02-03 09:05:09 +0000 Commit: Peter Grehan CommitDate: 2021-02-03 09:05:09 +0000 Always clamp curve25519 keys prior to use. This fixes an issue where a private key contained bits that should have been cleared by the clamping process, but were passed through to the scalar multiplication routine and resulted in an invalid public key. Issue diagnosed (and an initial fix proposed) by shamaz.mazum in PR 252894. This fix suggested by Jason Donenfeld. PR: 252894 Reported by: shamaz.mazum Reviewed by: dch MFC after: 3 days --- sys/dev/if_wg/module/curve25519.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/if_wg/module/curve25519.c b/sys/dev/if_wg/module/curve25519.c index e21d00bd2818..16f0b0337eb6 100644 --- a/sys/dev/if_wg/module/curve25519.c +++ b/sys/dev/if_wg/module/curve25519.c @@ -767,6 +767,7 @@ void curve25519_generic(u8 out[CURVE25519_KEY_SIZE], u8 e[32]; memcpy(e, scalar, 32); + curve25519_clamp_secret(e); /* The following implementation was transcribed to Coq and proven to * correspond to unary scalar multiplication in affine coordinates given From owner-dev-commits-src-main@freebsd.org Wed Feb 3 15:07:02 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DAA2A53988A; Wed, 3 Feb 2021 15:07:02 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW4lp5vcjz4jb1; Wed, 3 Feb 2021 15:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BDA7A2319F; Wed, 3 Feb 2021 15:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113F720n041057; Wed, 3 Feb 2021 15:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113F72J3041056; Wed, 3 Feb 2021 15:07:02 GMT (envelope-from git) Date: Wed, 3 Feb 2021 15:07:02 GMT Message-Id: <202102031507.113F72J3041056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: c1b1354789bb - main - wg(4): Add authors of the wg(4) driver to the manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1b1354789bb15713944f9e6941266de4cb47772 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 15:07:02 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c1b1354789bb15713944f9e6941266de4cb47772 commit c1b1354789bb15713944f9e6941266de4cb47772 Author: Gordon Bergling AuthorDate: 2021-02-03 15:01:32 +0000 Commit: Gordon Bergling CommitDate: 2021-02-03 15:01:32 +0000 wg(4): Add authors of the wg(4) driver to the manual page Glen (@gjb) noticed that I am haven't mentioned the authors of the WireGuard device driver in the manual page. This is commit addressed this commit. Reviewed by: gjb, brueffer Differential Revision: https://reviews.freebsd.org/D28464 X-MFC-with: e59d9cb412846cb5d2bc4c641d3cc44d243cd52d --- share/man/man4/wg.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 index 096aee50148a..2a13b98f45e9 100644 --- a/share/man/man4/wg.4 +++ b/share/man/man4/wg.4 @@ -236,9 +236,20 @@ The device driver first appeared in .Fx 13.0 . .Sh AUTHORS +The +.Nm +device driver was originally written for +.Ox +by +.An Matt Dunwoodie Aq Mt ncon@nconroy.net +and ported to +.Fx +by +.An Matt Macy Aq Mt mmacy@FreeBSD.org . +.Pp This manual page was written by .An Gordon Bergling Aq Mt gbe@FreeBSD.org and is based on the .Ox -counterpart written by +manual page written by .An David Gwynne Aq Mt dlg@openbsd.org . From owner-dev-commits-src-main@freebsd.org Wed Feb 3 15:27:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AE5E953A206; Wed, 3 Feb 2021 15:27:42 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW5Cd4q3sz4kyq; Wed, 3 Feb 2021 15:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 77AF822FE5; Wed, 3 Feb 2021 15:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113FRf71067435; Wed, 3 Feb 2021 15:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113FRfnj067433; Wed, 3 Feb 2021 15:27:41 GMT (envelope-from git) Date: Wed, 3 Feb 2021 15:27:41 GMT Message-Id: <202102031527.113FRfnj067433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: 65618fdda0f2 - main - arm64: Initialize VFP control register. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65618fdda0f272a823e6701966421bdca0efa301 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 15:27:43 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=65618fdda0f272a823e6701966421bdca0efa301 commit 65618fdda0f272a823e6701966421bdca0efa301 Author: Michal Meloun AuthorDate: 2021-01-23 20:19:07 +0000 Commit: Michal Meloun CommitDate: 2021-02-03 15:27:30 +0000 arm64: Initialize VFP control register. The RW fields in this register reset to architecturally unknown values, so initialize these to the proper rounding and denormal mode. MFC after: 1 week --- sys/arm64/arm64/vfp.c | 4 ++++ sys/arm64/arm64/vm_machdep.c | 3 +++ sys/arm64/include/md_var.h | 2 ++ sys/arm64/include/vfp.h | 23 +++++++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 51fba7a8a300..62244ddc80e8 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -238,6 +239,9 @@ vfp_init(void) /* Disable to be enabled when it's used */ vfp_disable(); + + if (PCPU_GET(cpuid) == 0) + thread0.td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; } SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, vfp_init, NULL); diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 90d628a7d6ee..9e9b588c7db1 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #endif +uint32_t initial_fpcr = VFPCR_DN | VFPCR_FZ; + #include /* @@ -106,6 +108,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; td2->td_pcb->pcb_fpusaved = &td2->td_pcb->pcb_fpustate; td2->td_pcb->pcb_vfpcpu = UINT_MAX; + td2->td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index 0132ab0dd8fd..73cf642148b5 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -54,4 +54,6 @@ void generic_bs_poke_2(void) __asm(__STRING(generic_bs_poke_2)); void generic_bs_poke_4(void) __asm(__STRING(generic_bs_poke_4)); void generic_bs_poke_8(void) __asm(__STRING(generic_bs_poke_8)); +extern uint32_t initial_fpcr; + #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index b4b9bb524d30..b0ba01a2a319 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -32,6 +32,29 @@ #ifndef _MACHINE_VFP_H_ #define _MACHINE_VFP_H_ +/* VFPCR */ +#define VFPCR_AHP (0x04000000) /* alt. half-precision: */ +#define VFPCR_DN (0x02000000) /* default NaN enable */ +#define VFPCR_FZ (0x01000000) /* flush to zero enabled */ + +#define VFPCR_RMODE_OFF 22 /* rounding mode offset */ +#define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask */ +#define VFPCR_RMODE_RN (0x00000000) /* round nearest */ +#define VFPCR_RMODE_RPI (0x00400000) /* round to plus infinity */ +#define VFPCR_RMODE_RNI (0x00800000) /* round to neg infinity */ +#define VFPCR_RMODE_RM (0x00c00000) /* round to zero */ + +#define VFPCR_STRIDE_OFF 20 /* vector stride -1 */ +#define VFPCR_STRIDE_MASK (0x00300000) +#define VFPCR_LEN_OFF 16 /* vector length -1 */ +#define VFPCR_LEN_MASK (0x00070000) +#define VFPCR_IDE (0x00008000) /* input subnormal exc enable */ +#define VFPCR_IXE (0x00001000) /* inexact exception enable */ +#define VFPCR_UFE (0x00000800) /* underflow exception enable */ +#define VFPCR_OFE (0x00000400) /* overflow exception enable */ +#define VFPCR_DZE (0x00000200) /* div by zero exception en */ +#define VFPCR_IOE (0x00000100) /* invalid op exec enable */ + #ifndef LOCORE struct vfpstate { __uint128_t vfp_regs[32]; From owner-dev-commits-src-main@freebsd.org Wed Feb 3 15:54:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1D5EB53AB53; Wed, 3 Feb 2021 15:54:04 +0000 (UTC) (envelope-from madpilot@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW5p40HKwz4nGM; Wed, 3 Feb 2021 15:54:04 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from marvin.madpilot.net (host-79-12-130-69.retail.telecomitalia.it [79.12.130.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 42DDA354EC; Wed, 3 Feb 2021 15:54:03 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: git: aa906e2a4957 - main - OpenSSL: Support for kernel TLS offload (KTLS) To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Benjamin Kaduk References: <202101281825.10SIPTGJ021104@gitrepo.freebsd.org> <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> <1675730b-f559-a732-be49-d89c97a376f8@FreeBSD.org> From: Guido Falsi Message-ID: <20cd3a96-0666-55f7-b389-5e9a7b2fa933@FreeBSD.org> Date: Wed, 3 Feb 2021 16:54:00 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <1675730b-f559-a732-be49-d89c97a376f8@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 15:54:04 -0000 On 03/02/21 01:47, John Baldwin wrote: > On 1/31/21 10:41 AM, Guido Falsi wrote: >> On 28/01/21 19:25, John Baldwin wrote: >>> The branch main has been updated by jhb: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=aa906e2a4957db700d9e6cc60857e1afe1aecc85 >>> >>> >>> commit aa906e2a4957db700d9e6cc60857e1afe1aecc85 >>> Author:     John Baldwin >>> AuthorDate: 2021-01-16 00:17:31 +0000 >>> Commit:     John Baldwin >>> CommitDate: 2021-01-28 18:24:13 +0000 >>> >>>       OpenSSL: Support for kernel TLS offload (KTLS) >>>       This merges upstream patches from OpenSSL's master branch to add >>>       KTLS infrastructure for TLS 1.0-1.3 including both RX and TX >>>       offload and SSL_sendfile support on both Linux and FreeBSD. >>>       Note that TLS 1.3 only supports TX offload. >>>       A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built >>> with >>>       KTLS support.  It defaults to enabled on amd64 and disabled on all >>>       other architectures. >>>       Reviewed by:    jkim (earlier version) >>>       Approved by:    secteam >>>       Obtained from:  OpenSSL (patches from master) >>>       MFC after:      1 week >>>       Relnotes:       yes >>>       Sponsored by:   Netflix >>>       Differential Revision:  https://reviews.freebsd.org/D28273 >>> --- >> >> This commit causes a strange interaction/regression with subverison >> client when using https protocol. >> >> I filed a bug report about this: >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253135 >> >> Workarounds: >> >> - Compiling system defining WITHOUT_OPENSSL_KTLS >> - using the svn:// scheme > > I'm still waiting for a build to finish so I can test it, but I believe > this is a bug in serf.  This is the patch I'm going to test: > > diff --git a/contrib/serf/buckets/ssl_buckets.c > b/contrib/serf/buckets/ssl_buckets.c > index b01e5359db08..3c8b7e2a685f 100644 > --- a/contrib/serf/buckets/ssl_buckets.c > +++ b/contrib/serf/buckets/ssl_buckets.c > @@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio) > >  static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) >  { > -    long ret = 1; > +    long ret = 0; > >      switch (cmd) { >      default: > @@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long > num, void *ptr) >          break; >      case BIO_CTRL_FLUSH: >          /* At this point we can't force a flush. */ > +        ret = 1; >          break; >      case BIO_CTRL_PUSH: >      case BIO_CTRL_POP: > > serf defines its own custom OpenSSL BIO classes, and the BIO_ctrl(3) > manpage documents that the control methods of custom BIOs are supposed > to return 0 for unknown or unsupported requests: > >        Source/sink BIOs return an 0 if they do not recognize the > BIO_ctrl() >        operation. > > However, the custom BIOs in serf broke this rule and returned 1 for > unknown operations instead.  OpenSSL uses BIO_ctrl methods to determine > if a given BIO for a read or write side of an SSL connection is using > KTLS.  Because of the serf bug, this caused OpenSSL to believe that > these BIOs were using KTLS when they in fact were not.  serf will also > probably break with OpenSSL 3.0 even without KTLS due to the recently > added control for determining if a BIO has hit EOF which also returns > 1 to indicate it has hit EOF. > Thanks for the feedback. I have tested this patch. After reinstalling the system, from newly compiled sources. svnlite from base works fine now. svn from the package and also rebuilt from port fails. I guess ports provided serf library also has this bug, so we should fix it there too. -- Guido Falsi From owner-dev-commits-src-main@freebsd.org Wed Feb 3 16:04:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A78A753B426; Wed, 3 Feb 2021 16:04:26 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW6224JR2z4pBy; Wed, 3 Feb 2021 16:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7F20923BAD; Wed, 3 Feb 2021 16:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113G4QPH018997; Wed, 3 Feb 2021 16:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113G4QDm018996; Wed, 3 Feb 2021 16:04:26 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:04:26 GMT Message-Id: <202102031604.113G4QDm018996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 2a39919364b5 - main - readelf: Fix printing NT_FREEBSD_ARCH_TAG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a39919364b5368e026f656ff41861a3fdd56110 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 16:04:26 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2a39919364b5368e026f656ff41861a3fdd56110 commit 2a39919364b5368e026f656ff41861a3fdd56110 Author: Alex Richardson AuthorDate: 2021-02-03 15:24:28 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 15:44:39 +0000 readelf: Fix printing NT_FREEBSD_ARCH_TAG Looking at lib/csu/arm/crt1_s.S, this should be a string and therefore the restriction to 4 characters seems wrong. Found whle updating https://reviews.llvm.org/D74393. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28470 --- contrib/elftoolchain/readelf/readelf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 88d87f96bb72..0964f3529d1b 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -3741,9 +3741,7 @@ dump_notes_data(struct readelf *re, const char *name, uint32_t type, return; /* NT_FREEBSD_NOINIT_TAG carries no data, treat as unknown. */ case NT_FREEBSD_ARCH_TAG: - if (sz != 4) - goto unknown; - printf(" Arch tag: %x\n", ubuf[0]); + printf(" Arch tag: %s\n", buf); return; case NT_FREEBSD_FEATURE_CTL: if (sz != 4) From owner-dev-commits-src-main@freebsd.org Wed Feb 3 16:04:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AA4A553B069; Wed, 3 Feb 2021 16:04: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW6234Rb3z4pFX; Wed, 3 Feb 2021 16:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8B64923E85; Wed, 3 Feb 2021 16:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113G4RqL019019; Wed, 3 Feb 2021 16:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113G4Rs1019018; Wed, 3 Feb 2021 16:04:27 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:04:27 GMT Message-Id: <202102031604.113G4Rs1019018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 7791ecf04b48 - main - usr.sbin/praudit: Fix tests after 5619d49e07 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7791ecf04b48a0c365b003447f479ec890115dfc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 16:04:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=7791ecf04b48a0c365b003447f479ec890115dfc commit 7791ecf04b48a0c365b003447f479ec890115dfc Author: Alex Richardson AuthorDate: 2021-02-03 15:26:19 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 16:02:46 +0000 usr.sbin/praudit: Fix tests after 5619d49e07 Commit 5619d49e07 made the getgrgid() call inside bsm work as intended so we now print "wheel" instead of a numeric 0 in the rgid field. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D28462 --- usr.sbin/praudit/tests/input/del_comma | 2 +- usr.sbin/praudit/tests/input/del_underscore | 2 +- usr.sbin/praudit/tests/input/no_args | 2 +- usr.sbin/praudit/tests/input/numeric_form | 2 +- usr.sbin/praudit/tests/input/same_line | 2 +- usr.sbin/praudit/tests/input/short_form | 2 +- usr.sbin/praudit/tests/input/xml_form | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/praudit/tests/input/del_comma b/usr.sbin/praudit/tests/input/del_comma index 3dbec7bd2c5d..09f089450ac3 100644 --- a/usr.sbin/praudit/tests/input/del_comma +++ b/usr.sbin/praudit/tests/input/del_comma @@ -2,6 +2,6 @@ header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/del_underscore b/usr.sbin/praudit/tests/input/del_underscore index ca515ed49ef3..cfc7d4a932f0 100644 --- a/usr.sbin/praudit/tests/input/del_underscore +++ b/usr.sbin/praudit/tests/input/del_underscore @@ -2,6 +2,6 @@ header_113_11_socket(2)_0_Mon Jun 11 10:18:45 2018_ + 380 msec argument_1_0x1c_domain argument_2_0x2_type argument_3_0x0_protocol -subject_root_root_wheel_root_0_7053_4724_37636_10.0.2.2 +subject_root_root_wheel_root_wheel_7053_4724_37636_10.0.2.2 return_success_3 trailer_113 diff --git a/usr.sbin/praudit/tests/input/no_args b/usr.sbin/praudit/tests/input/no_args index 3dbec7bd2c5d..09f089450ac3 100644 --- a/usr.sbin/praudit/tests/input/no_args +++ b/usr.sbin/praudit/tests/input/no_args @@ -2,6 +2,6 @@ header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/numeric_form b/usr.sbin/praudit/tests/input/numeric_form index 3dbec7bd2c5d..09f089450ac3 100644 --- a/usr.sbin/praudit/tests/input/numeric_form +++ b/usr.sbin/praudit/tests/input/numeric_form @@ -2,6 +2,6 @@ header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/same_line b/usr.sbin/praudit/tests/input/same_line index 7662c3c6ed37..5a8f19d8901f 100644 --- a/usr.sbin/praudit/tests/input/same_line +++ b/usr.sbin/praudit/tests/input/same_line @@ -1 +1 @@ -header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec,argument,1,0x1c,domain,argument,2,0x2,type,argument,3,0x0,protocol,subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2,return,success,3,trailer,113, +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec,argument,1,0x1c,domain,argument,2,0x2,type,argument,3,0x0,protocol,subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2,return,success,3,trailer,113, diff --git a/usr.sbin/praudit/tests/input/short_form b/usr.sbin/praudit/tests/input/short_form index cc1a705940bb..8e5751fd9efe 100644 --- a/usr.sbin/praudit/tests/input/short_form +++ b/usr.sbin/praudit/tests/input/short_form @@ -2,6 +2,6 @@ header,113,11,AUE_SOCKET,0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/xml_form b/usr.sbin/praudit/tests/input/xml_form index e49b00c028da..d19adeed2b3f 100644 --- a/usr.sbin/praudit/tests/input/xml_form +++ b/usr.sbin/praudit/tests/input/xml_form @@ -4,7 +4,7 @@ - + From owner-dev-commits-src-main@freebsd.org Wed Feb 3 16:04:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 570CF53B353; Wed, 3 Feb 2021 16:04:29 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW6245jNsz4nwN; Wed, 3 Feb 2021 16:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A5A5D23E86; Wed, 3 Feb 2021 16:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113G4SYR019038; Wed, 3 Feb 2021 16:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113G4SQq019037; Wed, 3 Feb 2021 16:04:28 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:04:28 GMT Message-Id: <202102031604.113G4SQq019037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 8fa6abb6f4f6 - main - Expose clang's alignment builtins and use them for roundup2/rounddown2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fa6abb6f4f64f4f23e2920e2aea7996566851a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 16:04:32 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8fa6abb6f4f64f4f23e2920e2aea7996566851a4 commit 8fa6abb6f4f64f4f23e2920e2aea7996566851a4 Author: Alex Richardson AuthorDate: 2021-02-03 15:27:17 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 16:02:54 +0000 Expose clang's alignment builtins and use them for roundup2/rounddown2 This makes roundup2/rounddown2 type- and const-preserving and allows using it on pointer types without casting to uintptr_t first. Not performing pointer-to-integer conversions also helps the compiler's optimization passes and can therefore result in better code generation. When using it with integer values there should be no change other than the compiler checking that the alignment value is a valid power-of-two. I originally implemented these builtins for CHERI a few years ago and they have been very useful for CheriBSD. However, they are also useful for non-CHERI code so I was able to upstream them for Clang 10.0. Rationale from the clang documentation: Clang provides builtins to support checking and adjusting alignment of pointers and integers. These builtins can be used to avoid relying on implementation-defined behavior of arithmetic on integers derived from pointers. Additionally, these builtins retain type information and, unlike bitwise arithmetic, they can perform semantic checking on the alignment value. There is also a feature request for GCC, so GCC may also support it in the future: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 Reviewed By: brooks, jhb, imp Differential Revision: https://reviews.freebsd.org/D28332 --- sys/sys/cdefs.h | 19 +++++++++++++++++++ sys/sys/param.h | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 75bedd4b8128..72ef942084f2 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -884,4 +884,23 @@ #define __guarded_by(x) __lock_annotate(guarded_by(x)) #define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x)) +/* Alignment builtins for better type checking and improved code generation. */ +/* Provide fallback versions for other compilers (GCC/Clang < 10): */ +#if !__has_builtin(__builtin_is_aligned) +#define __builtin_is_aligned(x, align) \ + (((__uintptr_t)x & ((align) - 1)) == 0) +#endif +#if !__has_builtin(__builtin_align_up) +#define __builtin_align_up(x, align) \ + ((__typeof__(x))(((__uintptr_t)(x)+((align)-1))&(~((align)-1)))) +#endif +#if !__has_builtin(__builtin_align_down) +#define __builtin_align_down(x, align) \ + ((__typeof__(x))((x)&(~((align)-1)))) +#endif + +#define __align_up(x, y) __builtin_align_up(x, y) +#define __align_down(x, y) __builtin_align_down(x, y) +#define __is_aligned(x, y) __builtin_is_aligned(x, y) + #endif /* !_SYS_CDEFS_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 079357a19d47..d6f1eb21dcd2 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -305,9 +305,9 @@ #endif #define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) -#define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */ +#define rounddown2(x, y) __align_down(x, y) /* if y is power of two */ #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ -#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ +#define roundup2(x, y) __align_up(x, y) /* if y is powers of two */ #define powerof2(x) ((((x)-1)&(x))==0) /* Macros for min/max. */ From owner-dev-commits-src-main@freebsd.org Wed Feb 3 16:23:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0DE5653BC54; Wed, 3 Feb 2021 16:23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW6SB6zzxz4qNh; Wed, 3 Feb 2021 16:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E2C9C24203; Wed, 3 Feb 2021 16:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113GNcvU044702; Wed, 3 Feb 2021 16:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113GNckF044701; Wed, 3 Feb 2021 16:23:38 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:23:38 GMT Message-Id: <202102031623.113GNckF044701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: b67df8d7c203 - main - diff: Use unprivileged_user with report_identical test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b67df8d7c203a139b5afbe72e1947fbb8c32dc73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 16:23:39 -0000 The branch main has been updated by olivier (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b67df8d7c203a139b5afbe72e1947fbb8c32dc73 commit b67df8d7c203a139b5afbe72e1947fbb8c32dc73 Author: Olivier Cochard AuthorDate: 2021-02-03 16:18:59 +0000 Commit: Olivier Cochard CommitDate: 2021-02-03 16:18:59 +0000 diff: Use unprivileged_user with report_identical test Approved by: bapt Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28466 --- usr.bin/diff/tests/diff_test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 60b56f0d9067..b9d1698d982e 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -228,13 +228,18 @@ label_body() -s exit:1 diff --label hello --label world `which diff` `which ls` } +report_identical_head() +{ + atf_set "require.config" unprivileged_user +} report_identical_body() { + UNPRIVILEGED_USER=$(atf_config_get unprivileged_user) printf "\tA\n" > A printf "\tB\n" > B chmod -r B atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \ - -o empty diff -s A B + -o empty su -m "$UNPRIVILEGED_USER" -c 'diff -s A B' } non_regular_file_body() From owner-dev-commits-src-main@freebsd.org Wed Feb 3 17:06:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4D33553CF76; Wed, 3 Feb 2021 17:06:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW7Px1Tcwz4vJb; Wed, 3 Feb 2021 17:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 259ED24A99; Wed, 3 Feb 2021 17:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113H6iEI097360; Wed, 3 Feb 2021 17:06:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113H6i4A097359; Wed, 3 Feb 2021 17:06:44 GMT (envelope-from git) Date: Wed, 3 Feb 2021 17:06:44 GMT Message-Id: <202102031706.113H6i4A097359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 39a1f858ad73 - main - du_test: Skip three tests if sparse files are not supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39a1f858ad735ef816a9b1fb7eeade2c6802eb98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 17:06:45 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=39a1f858ad735ef816a9b1fb7eeade2c6802eb98 commit 39a1f858ad735ef816a9b1fb7eeade2c6802eb98 Author: Alex Richardson AuthorDate: 2021-02-03 16:07:05 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 17:06:07 +0000 du_test: Skip three tests if sparse files are not supported This fixes running the du tests with /tmp as tmpfs (which is what we do in the CheriBSD CI). Obtained from: CheriBSD Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28398 --- usr.bin/du/tests/du_test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 1c283b58fef4..5106307ad66a 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -24,6 +24,17 @@ # # $FreeBSD$ +require_sparse_file_support() +{ + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ + "probably not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi +} + atf_test_case A_flag A_flag_head() { @@ -31,6 +42,7 @@ A_flag_head() } A_flag_body() { + require_sparse_file_support # XXX: compressed volumes? atf_check truncate -s 10g sparse.file atf_check -o inline:'1\tsparse.file\n' du -g sparse.file @@ -103,6 +115,7 @@ g_flag_head() } g_flag_body() { + require_sparse_file_support atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C @@ -117,6 +130,7 @@ h_flag_head() } h_flag_body() { + require_sparse_file_support atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C From owner-dev-commits-src-main@freebsd.org Wed Feb 3 17:06:46 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4F74F53D1A5; Wed, 3 Feb 2021 17:06:46 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DW7Py1rXyz4vJc; Wed, 3 Feb 2021 17:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 30E9C24845; Wed, 3 Feb 2021 17:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113H6kM6097379; Wed, 3 Feb 2021 17:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113H6kT7097378; Wed, 3 Feb 2021 17:06:46 GMT (envelope-from git) Date: Wed, 3 Feb 2021 17:06:46 GMT Message-Id: <202102031706.113H6kT7097378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 43e083be8103 - main - tools/build/make.py: -DNO_CLEAN -> -DWITHOUT_CLEAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43e083be8103685e65582e002d33e861f7d5c794 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 17:06:46 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=43e083be8103685e65582e002d33e861f7d5c794 commit 43e083be8103685e65582e002d33e861f7d5c794 Author: Alex Richardson AuthorDate: 2021-02-03 15:56:03 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 17:06:07 +0000 tools/build/make.py: -DNO_CLEAN -> -DWITHOUT_CLEAN --- tools/build/make.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/build/make.py b/tools/build/make.py index 146d4a7b6d47..e692fef11e05 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -154,10 +154,10 @@ if __name__ == "__main__": help="Print information on inferred env vars") parser.add_argument("--clean", action="store_true", help="Do a clean rebuild instead of building with " - "-DNO_CLEAN") + "-DWITHOUT_CLEAN") parser.add_argument("--no-clean", action="store_false", dest="clean", help="Do a clean rebuild instead of building with " - "-DNO_CLEAN") + "-DWITHOUT_CLEAN") try: import argcomplete # bash completion: @@ -250,10 +250,10 @@ if __name__ == "__main__": and not is_make_var_set("WITHOUT_CLEAN")): # Avoid accidentally deleting all of the build tree and wasting lots of # time cleaning directories instead of just doing a rm -rf ${.OBJDIR} - want_clean = input("You did not set -DNO_CLEAN/--clean/--no-clean." - " Did you really mean to do a clean build? y/[N] ") + want_clean = input("You did not set -DWITHOUT_CLEAN/--clean/--no-clean." + " Did you really mean to do a clean build? y/[N] ") if not want_clean.lower().startswith("y"): - bmake_args.append("-DNO_CLEAN") + bmake_args.append("-DWITHOUT_CLEAN") env_cmd_str = " ".join( shlex.quote(k + "=" + v) for k, v in new_env_vars.items()) From owner-dev-commits-src-main@freebsd.org Wed Feb 3 19:08:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 24D9F52806D; Wed, 3 Feb 2021 19:08:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWB6l0Xkgz3LLX; Wed, 3 Feb 2021 19:08:47 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 05622261BA; Wed, 3 Feb 2021 19:08:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113J8kYs053715; Wed, 3 Feb 2021 19:08:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113J8kG1053714; Wed, 3 Feb 2021 19:08:46 GMT (envelope-from git) Date: Wed, 3 Feb 2021 19:08:46 GMT Message-Id: <202102031908.113J8kG1053714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: ae71b794cbed - main - linux: make timerfd_settime(2) set expirations count to zero MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae71b794cbed19e5e25effc3438720ad452ab87c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 19:08:47 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=ae71b794cbed19e5e25effc3438720ad452ab87c commit ae71b794cbed19e5e25effc3438720ad452ab87c Author: shu AuthorDate: 2021-02-03 16:51:45 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-03 19:08:40 +0000 linux: make timerfd_settime(2) set expirations count to zero On Linux, read(2) from a timerfd file descriptor returns an unsigned 8-byte integer (uint64_t) containing the number of expirations that have occurred, if the timer has already expired one or more times since its settings were last modified using timerfd_settime(), or since the last successful read(2). That's to say, once we do a read or call timerfd_settime(), timer fd's expiration count should be zero. Some Linux applications create timerfd and add it to epoll with LT mode, when event comes, they do timerfd_settime instead of read to stop event source from trigger. On FreeBSD, timerfd_settime(2) didn't set the count to zero, which caused high CPU utilization. Submitted by: ankohuu_outlook.com (Shunchao Hu) Differential Revision: https://reviews.freebsd.org/D28231 --- sys/compat/linux/linux_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index dfb4588392cc..54f6b083adf3 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -981,6 +981,7 @@ linux_timerfd_settime(struct thread *td, struct linux_timerfd_settime_args *args linux_timerfd_curval(tfd, &ots); tfd->tfd_time = nts; + tfd->tfd_count = 0; if (timespecisset(&nts.it_value)) { linux_timerfd_clocktime(tfd, &cts); ts = nts.it_value; From owner-dev-commits-src-main@freebsd.org Wed Feb 3 19:39:17 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B024052912B; Wed, 3 Feb 2021 19:39:17 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWBnx4chlz3N7s; Wed, 3 Feb 2021 19:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 91CB8262F0; Wed, 3 Feb 2021 19:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113JdHkL093083; Wed, 3 Feb 2021 19:39:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113JdHI8093082; Wed, 3 Feb 2021 19:39:17 GMT (envelope-from git) Date: Wed, 3 Feb 2021 19:39:17 GMT Message-Id: <202102031939.113JdHI8093082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 33f0540b13d9 - main - Revert "Reimplement strlen" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33f0540b13d949c7cc226a79927ddc2062ff98bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 19:39:17 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=33f0540b13d949c7cc226a79927ddc2062ff98bf commit 33f0540b13d949c7cc226a79927ddc2062ff98bf Author: Mateusz Guzik AuthorDate: 2021-02-03 19:38:10 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-03 19:38:10 +0000 Revert "Reimplement strlen" This reverts commit 710e45c4b8539d028877769f1a4ec088c48fb5f1. It breaks for some corner cases on big endian ppc64. Given the stage of the release process it is best to revert for now. Reported by: jhibbits --- lib/libc/string/strlen.c | 82 +++++++++++++++++++++++++++++++----------------- sys/libkern/strlen.c | 79 +++++++++++++++++++++++++++++++--------------- 2 files changed, 108 insertions(+), 53 deletions(-) diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index 0bdc81d7bb9a..a862ffc245ca 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -42,13 +46,18 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. - * - * Note: this leaves performance on the table and each architecture - * would be best served with a tailor made routine instead. */ +/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -61,45 +70,62 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -#if BYTE_ORDER == LITTLE_ENDIAN -#define FINDZERO __builtin_ctzl -#else -#define FINDZERO __builtin_clzl -#endif +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t strlen(const char *str) { + const char *p; const unsigned long *lp; - unsigned long mask; long va, vb; - long val; - lp = (unsigned long *) (uintptr_t) str; - if ((uintptr_t)lp & LONGPTR_MASK) { - lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); -#if BYTE_ORDER == LITTLE_ENDIAN - mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); -#else - mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); -#endif - val = *lp | mask; - va = (val - mask01); - vb = ((~val) & mask80); - if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); - } - lp++; - } + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif } } - __builtin_unreachable(); + /* NOTREACHED */ return (0); } diff --git a/sys/libkern/strlen.c b/sys/libkern/strlen.c index 8fa5f3927ea9..a8c7964f69a3 100644 --- a/sys/libkern/strlen.c +++ b/sys/libkern/strlen.c @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -41,10 +45,18 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. */ +/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -57,45 +69,62 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -#if BYTE_ORDER == LITTLE_ENDIAN -#define FINDZERO __builtin_ctzl -#else -#define FINDZERO __builtin_clzl -#endif +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t (strlen)(const char *str) { + const char *p; const unsigned long *lp; - unsigned long mask; long va, vb; - long val; - lp = (unsigned long *) (uintptr_t) str; - if ((uintptr_t)lp & LONGPTR_MASK) { - lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); -#if BYTE_ORDER == LITTLE_ENDIAN - mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); -#else - mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); -#endif - val = *lp | mask; - va = (val - mask01); - vb = ((~val) & mask80); - if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); - } - lp++; - } + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif } } - __builtin_unreachable(); + /* NOTREACHED */ return (0); } From owner-dev-commits-src-main@freebsd.org Wed Feb 3 19:47:51 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5F949529D24; Wed, 3 Feb 2021 19:47:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWBzp1JZrz3QZd; Wed, 3 Feb 2021 19:47:50 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3972F266EB; Wed, 3 Feb 2021 19:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113Jllhq005992; Wed, 3 Feb 2021 19:47:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113Jllbm005991; Wed, 3 Feb 2021 19:47:47 GMT (envelope-from git) Date: Wed, 3 Feb 2021 19:47:47 GMT Message-Id: <202102031947.113Jllbm005991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 14c40d2c292d - main - linux: remove locks around callout_drain in timerfd_close() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14c40d2c292deff44be5591add7fdad5f9b371aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 19:47:51 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=14c40d2c292deff44be5591add7fdad5f9b371aa commit 14c40d2c292deff44be5591add7fdad5f9b371aa Author: shu AuthorDate: 2021-02-03 19:10:58 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-03 19:47:38 +0000 linux: remove locks around callout_drain in timerfd_close() The lock around callout_drain() is unnecessary and may cause deadlock when one closes a timer descriptor during timer execution. Reviewed By: delphij Submitted By: ankohuu_outlook.com (Shunchao Hu) Differential Revision: https://reviews.freebsd.org/D28148 --- sys/compat/linux/linux_event.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 54f6b083adf3..f6cd9304f5cd 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -736,9 +736,7 @@ timerfd_close(struct file *fp, struct thread *td) timespecclear(&tfd->tfd_time.it_value); timespecclear(&tfd->tfd_time.it_interval); - mtx_lock(&tfd->tfd_lock); callout_drain(&tfd->tfd_callout); - mtx_unlock(&tfd->tfd_lock); seldrain(&tfd->tfd_sel); knlist_destroy(&tfd->tfd_sel.si_note); From owner-dev-commits-src-main@freebsd.org Wed Feb 3 20:32:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 216DE52B74A; Wed, 3 Feb 2021 20:32:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWCzT0BMGz3nBn; Wed, 3 Feb 2021 20:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 ED55A27755; Wed, 3 Feb 2021 20:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113KWa0A070619; Wed, 3 Feb 2021 20:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113KWa0D070618; Wed, 3 Feb 2021 20:32:36 GMT (envelope-from git) Date: Wed, 3 Feb 2021 20:32:36 GMT Message-Id: <202102032032.113KWa0D070618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: 8727c174b0fe - main - dwmmc: Multiple busdma fixes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8727c174b0fe44766bb7ea765dac6d5f82818103 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 20:32:37 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=8727c174b0fe44766bb7ea765dac6d5f82818103 commit 8727c174b0fe44766bb7ea765dac6d5f82818103 Author: Michal Meloun AuthorDate: 2021-01-21 14:06:19 +0000 Commit: Michal Meloun CommitDate: 2021-02-03 20:15:11 +0000 dwmmc: Multiple busdma fixes. - limit maximum segment size to 2048 bytes. Although dwmmc supports a buffer fragment with a maximum length of 4095 bytes, use the nearest lower power of two as the maximum fragment size. Otherwise, busdma create excessive buffer fragments. - fix off by one error in computation of the maximum data transfer length. - in addition, reserve two DMA descriptors that can be used by busdma bouncing. The beginning or end of the buffer can be misaligned. - Don’t ignore errors passed to bus_dmamap_load() callback function. - In theory, a DMA engine may be running at time when next dma descriptor is constructed. Create a full DMA descriptor before OWN bit is set. MFC after: 2 weeks --- sys/dev/mmc/host/dwmmc.c | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 11521257ee0a..b31bb0d4e68b 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -107,8 +107,7 @@ __FBSDID("$FreeBSD$"); #define CARD_INIT_DONE 0x04 #define DWMMC_DATA_ERR_FLAGS (SDMMC_INTMASK_DRT | SDMMC_INTMASK_DCRC \ - |SDMMC_INTMASK_HTO | SDMMC_INTMASK_SBE \ - |SDMMC_INTMASK_EBE) + |SDMMC_INTMASK_SBE | SDMMC_INTMASK_EBE) #define DWMMC_CMD_ERR_FLAGS (SDMMC_INTMASK_RTO | SDMMC_INTMASK_RCRC \ |SDMMC_INTMASK_RE) #define DWMMC_ERR_FLAGS (DWMMC_DATA_ERR_FLAGS | DWMMC_CMD_ERR_FLAGS \ @@ -134,7 +133,16 @@ struct idmac_desc { #define IDMAC_DESC_SEGS (PAGE_SIZE / (sizeof(struct idmac_desc))) #define IDMAC_DESC_SIZE (sizeof(struct idmac_desc) * IDMAC_DESC_SEGS) #define DEF_MSIZE 0x2 /* Burst size of multiple transaction */ -#define IDMAC_MAX_SIZE 4096 +/* + * Size field in DMA descriptor is 13 bits long (up to 4095 bytes), + * but must be a multiple of the data bus size.Additionally, we must ensure + * that bus_dmamap_load() doesn't additionally fragments buffer (because it + * is processed with page size granularity). Thus limit fragment size to half + * of page. + * XXX switch descriptor format to array and use second buffer pointer for + * second half of page + */ +#define IDMAC_MAX_SIZE 2048 static void dwmmc_next_operation(struct dwmmc_softc *); static int dwmmc_setup_bus(struct dwmmc_softc *, int); @@ -165,8 +173,11 @@ static void dwmmc_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { + if (nsegs != 1) + panic("%s: nsegs != 1 (%d)\n", __func__, nsegs); if (error != 0) - return; + panic("%s: error != 0 (%d)\n", __func__, error); + *(bus_addr_t *)arg = segs[0].ds_addr; } @@ -176,15 +187,13 @@ dwmmc_ring_setup(void *arg, bus_dma_segment_t *segs, int nsegs, int error) struct dwmmc_softc *sc; int idx; - if (error != 0) - return; - sc = arg; - dprintf("nsegs %d seg0len %lu\n", nsegs, segs[0].ds_len); + if (error != 0) + panic("%s: error != 0 (%d)\n", __func__, error); for (idx = 0; idx < nsegs; idx++) { - sc->desc_ring[idx].des0 = (DES0_OWN | DES0_DIC | DES0_CH); + sc->desc_ring[idx].des0 = DES0_DIC | DES0_CH; sc->desc_ring[idx].des1 = segs[idx].ds_len & DES1_BS1_MASK; sc->desc_ring[idx].des2 = segs[idx].ds_addr; @@ -195,6 +204,8 @@ dwmmc_ring_setup(void *arg, bus_dma_segment_t *segs, int nsegs, int error) sc->desc_ring[idx].des0 &= ~(DES0_DIC | DES0_CH); sc->desc_ring[idx].des0 |= DES0_LD; } + wmb(); + sc->desc_ring[idx].des0 |= DES0_OWN; } } @@ -277,7 +288,7 @@ dma_setup(struct dwmmc_softc *sc) error = bus_dma_tag_create( bus_get_dma_tag(sc->dev), /* Parent tag. */ - CACHE_LINE_SIZE, 0, /* alignment, boundary */ + 8, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ @@ -786,7 +797,7 @@ dwmmc_attach(device_t dev) fail: mtx_unlock(&sc->sim_mtx); #endif - /* + /* * Schedule a card detection as we won't get an interrupt * if the card is inserted when we attach */ @@ -900,8 +911,8 @@ dwmmc_update_ios(device_t brdev, device_t reqdev) sc = device_get_softc(brdev); ios = &sc->host.ios; - dprintf("Setting up clk %u bus_width %d\n", - ios->clock, ios->bus_width); + dprintf("Setting up clk %u bus_width %d, timming: %d\n", + ios->clock, ios->bus_width, ios->timing); if (ios->bus_width == bus_width_8) WRITE4(sc, SDMMC_CTYPE, SDMMC_CTYPE_8BIT); @@ -985,7 +996,7 @@ dma_prepare(struct dwmmc_softc *sc, struct mmc_command *cmd) reg = READ4(sc, SDMMC_INTMASK); reg &= ~(SDMMC_INTMASK_TXDR | SDMMC_INTMASK_RXDR); WRITE4(sc, SDMMC_INTMASK, reg); - + dprintf("%s: bus_dmamap_load size: %zu\n", __func__, data->len); err = bus_dmamap_load(sc->buf_tag, sc->buf_map, data->data, data->len, dwmmc_ring_setup, sc, BUS_DMA_NOWAIT); @@ -1358,7 +1369,13 @@ dwmmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE; + /* + * Busdma may bounce buffers, so we must reserve 2 descriptors + * (on start and on end) for bounced fragments. + * + */ + *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / + MMC_SECTOR_SIZE - 3; break; case MMCBR_IVAR_TIMING: *(int *)result = sc->host.ios.timing; From owner-dev-commits-src-main@freebsd.org Wed Feb 3 21:18:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EC4EC52C469; Wed, 3 Feb 2021 21:18:10 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWF026Q0Vz3qPQ; Wed, 3 Feb 2021 21:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 CF29427E8D; Wed, 3 Feb 2021 21:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113LIA6R023751; Wed, 3 Feb 2021 21:18:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113LIAqO023750; Wed, 3 Feb 2021 21:18:10 GMT (envelope-from git) Date: Wed, 3 Feb 2021 21:18:10 GMT Message-Id: <202102032118.113LIAqO023750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Stone Subject: git: 660344ca44c6 - main - Add a VM flag to prevent reclaim on a failed contig allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rstone X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 660344ca44c63bfe4a16c3e57d0f6dbcbb5e083e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 21:18:11 -0000 The branch main has been updated by rstone: URL: https://cgit.FreeBSD.org/src/commit/?id=660344ca44c63bfe4a16c3e57d0f6dbcbb5e083e commit 660344ca44c63bfe4a16c3e57d0f6dbcbb5e083e Author: Ryan Stone AuthorDate: 2021-01-29 21:13:57 +0000 Commit: Ryan Stone CommitDate: 2021-02-03 21:16:51 +0000 Add a VM flag to prevent reclaim on a failed contig allocation If a M_WAITOK contig alloc fails, the VM subsystem will try to reclaim contiguous memory twice before actually failing the request. On a system with 64GB of RAM I've observed this take 400-500ms before it finally gives up, and I believe that this will only be worse on systems with even more memory. In certain contexts this delay is extremely harmful, so add a flag that will skip reclaim for allocation requests to allow those paths to opt-out of doing an expensive reclaim. Sponsored by: Dell Inc Differential Revision: https://reviews.freebsd.org/D28422 Reviewed by: markj, kib --- sys/sys/malloc.h | 1 + sys/vm/vm_kern.c | 9 +++++++-- sys/vm/vm_page.h | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index a11dd767efc5..54a05e94a3a2 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -54,6 +54,7 @@ */ #define M_NOWAIT 0x0001 /* do not block */ #define M_WAITOK 0x0002 /* ok to block */ +#define M_NORECLAIM 0x0080 /* do not reclaim after failure */ #define M_ZERO 0x0100 /* bzero the allocation */ #define M_NOVM 0x0200 /* don't ask VM for pages */ #define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index f1704f834157..e8e24c3ca8a3 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -177,17 +177,22 @@ kmem_alloc_contig_pages(vm_object_t object, vm_pindex_t pindex, int domain, { vm_page_t m; int tries; - bool wait; + bool wait, reclaim; VM_OBJECT_ASSERT_WLOCKED(object); + /* Disallow an invalid combination of flags. */ + MPASS((pflags & (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)) != + (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)); + wait = (pflags & VM_ALLOC_WAITOK) != 0; + reclaim = (pflags & VM_ALLOC_NORECLAIM) == 0; pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); pflags |= VM_ALLOC_NOWAIT; for (tries = wait ? 3 : 1;; tries--) { m = vm_page_alloc_contig_domain(object, pindex, domain, pflags, npages, low, high, alignment, boundary, memattr); - if (m != NULL || tries == 0) + if (m != NULL || tries == 0 || !reclaim) break; VM_OBJECT_WUNLOCK(object); diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index b05a3d1be861..ed372cae2a3b 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -541,6 +541,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */ #define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */ #define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ +#define VM_ALLOC_NORECLAIM 0x0080 /* (c) Do not reclaim after failure */ #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ #define VM_ALLOC_NOCREAT 0x0400 /* (gp) Don't create a page */ @@ -570,6 +571,8 @@ malloc2vm_flags(int malloc_flags) pflags |= VM_ALLOC_NOWAIT; if ((malloc_flags & M_WAITOK)) pflags |= VM_ALLOC_WAITOK; + if ((malloc_flags & M_NORECLAIM)) + pflags |= VM_ALLOC_NORECLAIM; return (pflags); } #endif From owner-dev-commits-src-main@freebsd.org Wed Feb 3 21:18:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 14B3452C8B3; Wed, 3 Feb 2021 21:18:41 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWF0d01W4z3qbY; Wed, 3 Feb 2021 21:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E7A3427E8E; Wed, 3 Feb 2021 21:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113LIeT0023966; Wed, 3 Feb 2021 21:18:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113LIeVF023965; Wed, 3 Feb 2021 21:18:40 GMT (envelope-from git) Date: Wed, 3 Feb 2021 21:18:40 GMT Message-Id: <202102032118.113LIeVF023965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e79b51e2b2e3 - main - readelf: decode LA48 and ASG_DISABLE feature flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e79b51e2b2e35d6256a1ef5311ce02ec4032d21f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 21:18:41 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e79b51e2b2e35d6256a1ef5311ce02ec4032d21f commit e79b51e2b2e35d6256a1ef5311ce02ec4032d21f Author: Ed Maste AuthorDate: 2021-02-03 21:16:45 +0000 Commit: Ed Maste CommitDate: 2021-02-03 21:17:56 +0000 readelf: decode LA48 and ASG_DISABLE feature flags MFC after: 1 week Sponsored by: The FreeBSD Foundation --- contrib/elftoolchain/readelf/readelf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 0964f3529d1b..479f4a5ba28f 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -3680,6 +3680,8 @@ static struct flag_desc note_feature_ctl_flags[] = { { NT_FREEBSD_FCTL_PROTMAX_DISABLE, "PROTMAX_DISABLE" }, { NT_FREEBSD_FCTL_STKGAP_DISABLE, "STKGAP_DISABLE" }, { NT_FREEBSD_FCTL_WXNEEDED, "WXNEEDED" }, + { NT_FREEBSD_FCTL_LA48, "LA48" }, + { NT_FREEBSD_FCTL_ASG_DISABLE, "ASG_DISABLE" }, { 0, NULL } }; From owner-dev-commits-src-main@freebsd.org Wed Feb 3 21:25:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F3C3E52CE24; Wed, 3 Feb 2021 21:25:10 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWF866fZRz3qvF; Wed, 3 Feb 2021 21:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D750A2809F; Wed, 3 Feb 2021 21:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113LPARx036990; Wed, 3 Feb 2021 21:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113LPACL036989; Wed, 3 Feb 2021 21:25:10 GMT (envelope-from git) Date: Wed, 3 Feb 2021 21:25:10 GMT Message-Id: <202102032125.113LPACL036989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 847dfd2803f6 - main - readelf: do not trucate section name with -W MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 847dfd2803f6c8b077e3ebc68e35adff2c79a65f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 21:25:11 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=847dfd2803f6c8b077e3ebc68e35adff2c79a65f commit 847dfd2803f6c8b077e3ebc68e35adff2c79a65f Author: Ed Maste AuthorDate: 2021-02-02 14:35:04 +0000 Commit: Ed Maste CommitDate: 2021-02-03 21:24:22 +0000 readelf: do not trucate section name with -W PR: 246015 Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28461 --- contrib/elftoolchain/readelf/readelf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 479f4a5ba28f..022c9e9066ab 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -2632,16 +2632,21 @@ dump_shdr(struct readelf *re) " %6.6jx %6.6jx %2.2jx %2u %3u %2ju\n" " %s\n", ST_CT); else - printf(" [%2d] %-17.17s %-15.15s %8.8jx" - " %6.6jx %6.6jx %2.2jx %3s %2u %3u %2ju\n", - S_CT); + if (re->options & RE_WW) + printf(" [%2d] %-17s %-15.15s " + "%8.8jx %6.6jx %6.6jx %2.2jx %3s " + "%2u %3u %2ju\n", S_CT); + else + printf(" [%2d] %-17.17s %-15.15s " + "%8.8jx %6.6jx %6.6jx %2.2jx %3s " + "%2u %3u %2ju\n", S_CT); } else if (re->options & RE_WW) { if (re->options & RE_T) printf(" [%2d] %s\n %-15.15s %16.16jx" " %6.6jx %6.6jx %2.2jx %2u %3u %2ju\n" " %s\n", ST_CT); else - printf(" [%2d] %-17.17s %-15.15s %16.16jx" + printf(" [%2d] %-17s %-15.15s %16.16jx" " %6.6jx %6.6jx %2.2jx %3s %2u %3u %2ju\n", S_CT); } else { From owner-dev-commits-src-main@freebsd.org Wed Feb 3 22:08:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 84B5352DF80; Wed, 3 Feb 2021 22:08:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWG6B3PY4z3tLq; Wed, 3 Feb 2021 22:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 67DE4288B5; Wed, 3 Feb 2021 22:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113M8YMC089659; Wed, 3 Feb 2021 22:08:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113M8Yc0089658; Wed, 3 Feb 2021 22:08:34 GMT (envelope-from git) Date: Wed, 3 Feb 2021 22:08:34 GMT Message-Id: <202102032208.113M8Yc0089658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 9fac05ba79a4 - main - [POWERPC64BE] add mrsas driver to GENERIC64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fac05ba79a4ea11c7a1ea45fb928da178e2fe95 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 22:08:34 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=9fac05ba79a4ea11c7a1ea45fb928da178e2fe95 commit 9fac05ba79a4ea11c7a1ea45fb928da178e2fe95 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 01:02:28 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-04 01:06:29 +0000 [POWERPC64BE] add mrsas driver to GENERIC64 Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, kadesai (on email) Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26531 --- sys/powerpc/conf/GENERIC64 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 16a33160aa34..e19052379c4a 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -144,6 +144,7 @@ device ahc # AHA2940 and onboard AIC7xxx devices options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters +device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D From owner-dev-commits-src-main@freebsd.org Wed Feb 3 22:08:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 665B052D77E; Wed, 3 Feb 2021 22:08:33 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWG692S0Lz3t7Y; Wed, 3 Feb 2021 22:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 46CC428A82; Wed, 3 Feb 2021 22:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113M8Xhp089637; Wed, 3 Feb 2021 22:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113M8Xib089636; Wed, 3 Feb 2021 22:08:33 GMT (envelope-from git) Date: Wed, 3 Feb 2021 22:08:33 GMT Message-Id: <202102032208.113M8Xib089636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: e34a057ca6eb - main - [POWERPC64BE] mrsas: add big-endian support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 22:08:33 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a commit e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 00:52:19 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-04 01:06:21 +0000 [POWERPC64BE] mrsas: add big-endian support Add endiannes conversions in order to support big-endian platforms Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, kadesai (on email) Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26531 --- sys/dev/mrsas/mrsas.c | 198 ++++++++++++++++--------------- sys/dev/mrsas/mrsas.h | 289 +++++++++++++++++++++++++++++++++++++++++++++- sys/dev/mrsas/mrsas_cam.c | 54 ++++----- sys/dev/mrsas/mrsas_fp.c | 170 ++++++++++++++------------- 4 files changed, 510 insertions(+), 201 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index 32d85c803938..f4c34e237fc4 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * Function prototypes @@ -619,13 +620,13 @@ mrsas_get_seq_num(struct mrsas_softc *sc, dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0x0; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_evt_log_info); - dcmd->opcode = MR_DCMD_CTRL_EVENT_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = sc->el_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_log_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_log_info)); + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(sc->el_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_log_info)); retcode = mrsas_issue_blocked_cmd(sc, cmd); if (retcode == ETIMEDOUT) @@ -681,7 +682,7 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, curr_aen.word = class_locale_word; if (sc->aen_cmd) { - prev_aen.word = sc->aen_cmd->frame->dcmd.mbox.w[1]; + prev_aen.word = le32toh(sc->aen_cmd->frame->dcmd.mbox.w[1]); /* * A class whose enum value is smaller is inclusive of all @@ -732,16 +733,16 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0x0; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_evt_detail); - dcmd->opcode = MR_DCMD_CTRL_EVENT_WAIT; - dcmd->mbox.w[0] = seq_num; + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_detail)); + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_WAIT); + dcmd->mbox.w[0] = htole32(seq_num); sc->last_seq_num = seq_num; - dcmd->mbox.w[1] = curr_aen.word; - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->evt_detail_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_detail); + dcmd->mbox.w[1] = htole32(curr_aen.word); + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->evt_detail_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_detail)); if (sc->aen_cmd != NULL) { mrsas_release_mfi_cmd(cmd); @@ -907,9 +908,6 @@ mrsas_attach(device_t dev) * Set up PCI and registers */ cmd = pci_read_config(dev, PCIR_COMMAND, 2); - if ((cmd & PCIM_CMD_PORTEN) == 0) { - return (ENXIO); - } /* Force the busmaster enable bit on. */ cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); @@ -1704,7 +1702,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) /* Find our reply descriptor for the command and process */ while ((desc_val.u.low != 0xFFFFFFFF) && (desc_val.u.high != 0xFFFFFFFF)) { - smid = reply_desc->SMID; + smid = le16toh(reply_desc->SMID); cmd_mpt = sc->mpt_cmd_list[smid - 1]; scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; @@ -1736,7 +1734,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, - extStatus, data_length, sense); + extStatus, le32toh(data_length), sense); mrsas_cmd_done(sc, cmd_mpt); mrsas_atomic_dec(&sc->fw_outstanding); } else { @@ -1764,7 +1762,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) mrsas_release_mpt_cmd(r1_cmd); mrsas_atomic_dec(&sc->fw_outstanding); mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, - extStatus, data_length, sense); + extStatus, le32toh(data_length), sense); mrsas_cmd_done(sc, cmd_mpt); mrsas_atomic_dec(&sc->fw_outstanding); } @@ -1778,7 +1776,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) * And also make sure that the issue_polled call should only be * used if INTERRUPT IS DISABLED. */ - if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + if (cmd_mfi->frame->hdr.flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) mrsas_release_mfi_cmd(cmd_mfi); else mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); @@ -2593,6 +2591,13 @@ mrsas_init_adapter(struct mrsas_softc *sc) (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); + + mrsas_dprint(sc, MRSAS_TRACE, "%s: sc->reply_q_depth 0x%x," + "sc->request_alloc_sz 0x%x, sc->reply_alloc_sz 0x%x," + "sc->io_frames_alloc_sz 0x%x\n", __func__, + sc->reply_q_depth, sc->request_alloc_sz, + sc->reply_alloc_sz, sc->io_frames_alloc_sz); + /* * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, * Firmware support extended IO chain frame which is 4 time more @@ -2617,8 +2622,10 @@ mrsas_init_adapter(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_INFO, "max sge: 0x%x, max chain frame size: 0x%x, " - "max fw cmd: 0x%x\n", sc->max_num_sge, - sc->max_chain_frame_sz, sc->max_fw_cmds); + "max fw cmd: 0x%x sc->chain_frames_alloc_sz: 0x%x\n", + sc->max_num_sge, + sc->max_chain_frame_sz, sc->max_fw_cmds, + sc->chain_frames_alloc_sz); /* Used for pass thru MFI frame (DCMD) */ sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; @@ -2738,19 +2745,19 @@ mrsas_ioc_init(struct mrsas_softc *sc) IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; - IOCInitMsg->MsgVersion = MPI2_VERSION; - IOCInitMsg->HeaderVersion = MPI2_HEADER_VERSION; - IOCInitMsg->SystemRequestFrameSize = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4; - IOCInitMsg->ReplyDescriptorPostQueueDepth = sc->reply_q_depth; - IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; - IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; + IOCInitMsg->MsgVersion = htole16(MPI2_VERSION); + IOCInitMsg->HeaderVersion = htole16(MPI2_HEADER_VERSION); + IOCInitMsg->SystemRequestFrameSize = htole16(MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4); + IOCInitMsg->ReplyDescriptorPostQueueDepth = htole16(sc->reply_q_depth); + IOCInitMsg->ReplyDescriptorPostQueueAddress = htole64(sc->reply_desc_phys_addr); + IOCInitMsg->SystemRequestFrameBaseAddress = htole64(sc->io_request_phys_addr); IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; init_frame->cmd = MFI_CMD_INIT; init_frame->cmd_status = 0xFF; - init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + init_frame->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); /* driver support Extended MSIX */ if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { @@ -2768,11 +2775,16 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; if (sc->max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN) init_frame->driver_operations.mfi_capabilities.support_ext_io_size = 1; + + init_frame->driver_operations.reg = htole32(init_frame->driver_operations.reg); + phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; - init_frame->queue_info_new_phys_addr_lo = phys_addr; - init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); + init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); + init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); + + req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); + req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); - req_desc.addr.Words = (bus_addr_t)sc->ioc_init_phys_mem; req_desc.MFAIo.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); @@ -2923,9 +2935,9 @@ mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, { mtx_lock(&sc->pci_lock); mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_low_queue_port), - req_desc_lo); + le32toh(req_desc_lo)); mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_high_queue_port), - req_desc_hi); + le32toh(req_desc_hi)); mtx_unlock(&sc->pci_lock); } @@ -2944,7 +2956,7 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, { if (sc->atomic_desc_support) mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), - req_desc_lo); + le32toh(req_desc_lo)); else mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); } @@ -3103,7 +3115,6 @@ mrsas_ocr_thread(void *arg) sc = (struct mrsas_softc *)arg; mrsas_dprint(sc, MRSAS_TRACE, "%s\n", __func__); - sc->ocr_thread_active = 1; mtx_lock(&sc->sim_lock); for (;;) { @@ -3642,10 +3653,10 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_ctrl_info); - dcmd->opcode = MR_DCMD_CTRL_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_ctrl_info)); + dcmd->opcode = htole32(MR_DCMD_CTRL_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(sc->ctlr_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_ctrl_info)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -3654,8 +3665,13 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) if (retcode == ETIMEDOUT) goto dcmd_timeout; - else + else { memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + le32_to_cpus(&sc->ctrl_info->properties.OnOffProperties); + le32_to_cpus(&sc->ctrl_info->adapterOperations2); + le32_to_cpus(&sc->ctrl_info->adapterOperations3); + le16_to_cpus(&sc->ctrl_info->adapterOperations4); + } do_ocr = 0; mrsas_update_ext_vd_details(sc); @@ -3813,7 +3829,7 @@ mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) int i, retcode = SUCCESS; frame_hdr->cmd_status = 0xFF; - frame_hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + frame_hdr->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); /* Issue the frame using inbound queue port */ if (mrsas_issue_dcmd(sc, cmd)) { @@ -3892,7 +3908,7 @@ mrsas_build_mpt_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) req_desc->addr.Words = 0; req_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - req_desc->SCSIIO.SMID = index; + req_desc->SCSIIO.SMID = htole16(index); return (req_desc); } @@ -3927,7 +3943,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm * mrsas_complete_cmd. */ - if (frame_hdr->flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + if (frame_hdr->flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) mpt_cmd->flags = MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; io_req = mpt_cmd->io_request; @@ -3944,12 +3960,12 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm io_req->SGLOffset0 = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 4; io_req->ChainOffset = sc->chain_offset_mfi_pthru; - mpi25_ieee_chain->Address = mfi_cmd->frame_phys_addr; + mpi25_ieee_chain->Address = htole64(mfi_cmd->frame_phys_addr); mpi25_ieee_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; - mpi25_ieee_chain->Length = sc->max_chain_frame_sz; + mpi25_ieee_chain->Length = htole32(sc->max_chain_frame_sz); return (0); } @@ -4100,7 +4116,7 @@ mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd break; } /* See if got an event notification */ - if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_EVENT_WAIT) + if (le32toh(cmd->frame->dcmd.opcode) == MR_DCMD_CTRL_EVENT_WAIT) mrsas_complete_aen(sc, cmd); else mrsas_wakeup(sc, cmd); @@ -4264,14 +4280,14 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) dcmd->sge_count = 1; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = (pd_seq_map_sz); - dcmd->opcode = (MR_DCMD_SYSTEM_PD_MAP_GET_INFO); - dcmd->sgl.sge32[0].phys_addr = (pd_seq_h); - dcmd->sgl.sge32[0].length = (pd_seq_map_sz); + dcmd->data_xfer_len = htole32(pd_seq_map_sz); + dcmd->opcode = htole32(MR_DCMD_SYSTEM_PD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(pd_seq_h & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(pd_seq_map_sz); if (pend) { dcmd->mbox.b[0] = MRSAS_DCMD_MBOX_PEND_FLAG; - dcmd->flags = (MFI_FRAME_DIR_WRITE); + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); sc->jbod_seq_cmd = cmd; if (mrsas_issue_dcmd(sc, cmd)) { device_printf(sc->mrsas_dev, @@ -4280,13 +4296,13 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) } else return 0; } else - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) goto dcmd_timeout; - if (pd_sync->count > MAX_PHYSICAL_DEVICES) { + if (le32toh(pd_sync->count) > MAX_PHYSICAL_DEVICES) { device_printf(sc->mrsas_dev, "driver supports max %d JBOD, but FW reports %d\n", MAX_PHYSICAL_DEVICES, pd_sync->count); @@ -4364,13 +4380,13 @@ mrsas_get_ld_map_info(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sc->current_map_sz; - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; - dcmd->sgl.sge32[0].length = sc->current_map_sz; + dcmd->data_xfer_len = htole32(sc->current_map_sz); + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) @@ -4427,15 +4443,15 @@ mrsas_sync_map_info(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_WRITE; + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sc->current_map_sz; + dcmd->data_xfer_len = htole32(sc->current_map_sz); dcmd->mbox.b[0] = num_lds; dcmd->mbox.b[1] = MRSAS_DCMD_MBOX_PEND_FLAG; - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; - dcmd->sgl.sge32[0].length = sc->current_map_sz; + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); sc->map_update_cmd = cmd; if (mrsas_issue_dcmd(sc, cmd)) { @@ -4472,17 +4488,17 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); - dcmd->mbox.s[0] = device_id; + dcmd->mbox.s[0] = htole16(device_id); dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); - dcmd->opcode = MR_DCMD_PD_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_pd_info)); + dcmd->opcode = htole32(MR_DCMD_PD_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->pd_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_pd_info)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -4493,7 +4509,7 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) goto dcmd_timeout; sc->target_list[device_id].interface_type = - sc->pd_info_mem->state.ddf.pdType.intf; + le16toh(sc->pd_info_mem->state.ddf.pdType.intf); do_ocr = 0; @@ -4572,6 +4588,7 @@ mrsas_get_pd_list(struct mrsas_softc *sc) struct MR_PD_ADDRESS *pd_addr; bus_addr_t pd_list_phys_addr = 0; struct mrsas_tmp_dcmd *tcmd; + u_int16_t dev_id; cmd = mrsas_get_mfi_cmd(sc); if (!cmd) { @@ -4601,13 +4618,13 @@ mrsas_get_pd_list(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); - dcmd->opcode = MR_DCMD_PD_LIST_QUERY; - dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; - dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); + dcmd->data_xfer_len = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); + dcmd->opcode = htole32(MR_DCMD_PD_LIST_QUERY); + dcmd->sgl.sge32[0].phys_addr = htole32(pd_list_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -4620,17 +4637,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) /* Get the instance PD list */ pd_count = MRSAS_MAX_PD; pd_addr = pd_list_mem->addr; - if (pd_list_mem->count < pd_count) { + if (le32toh(pd_list_mem->count) < pd_count) { memset(sc->local_pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); - for (pd_index = 0; pd_index < pd_list_mem->count; pd_index++) { - sc->local_pd_list[pd_addr->deviceId].tid = pd_addr->deviceId; - sc->local_pd_list[pd_addr->deviceId].driveType = - pd_addr->scsiDevType; - sc->local_pd_list[pd_addr->deviceId].driveState = + for (pd_index = 0; pd_index < le32toh(pd_list_mem->count); pd_index++) { + dev_id = le16toh(pd_addr->deviceId); + sc->local_pd_list[dev_id].tid = dev_id; + sc->local_pd_list[dev_id].driveType = + le16toh(pd_addr->scsiDevType); + sc->local_pd_list[dev_id].driveState = MR_PD_STATE_SYSTEM; - if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) - mrsas_add_target(sc, pd_addr->deviceId); + if (sc->target_list[dev_id].target_id == 0xffff) + mrsas_add_target(sc, dev_id); pd_addr++; } for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { @@ -4711,10 +4729,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) dcmd->sge_count = 1; dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; - dcmd->data_xfer_len = sizeof(struct MR_LD_LIST); - dcmd->opcode = MR_DCMD_LD_GET_LIST; - dcmd->sgl.sge32[0].phys_addr = ld_list_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); + dcmd->data_xfer_len = htole32(sizeof(struct MR_LD_LIST)); + dcmd->opcode = htole32(MR_DCMD_LD_GET_LIST); + dcmd->sgl.sge32[0].phys_addr = htole32(ld_list_phys_addr); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct MR_LD_LIST)); dcmd->pad_0 = 0; if (!sc->mask_interrupts) @@ -4730,10 +4748,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) #endif /* Get the instance LD list */ - if (ld_list_mem->ldCount <= sc->fw_supported_vd_count) { - sc->CurLdCount = ld_list_mem->ldCount; + if (le32toh(ld_list_mem->ldCount) <= sc->fw_supported_vd_count) { + sc->CurLdCount = le32toh(ld_list_mem->ldCount); memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); - for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { + for (ld_index = 0; ld_index < le32toh(ld_list_mem->ldCount); ld_index++) { ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; drv_tgt_id = ids + MRSAS_MAX_PD; if (ld_list_mem->ldList[ld_index].state != 0) { diff --git a/sys/dev/mrsas/mrsas.h b/sys/dev/mrsas/mrsas.h index fbb08215b7b1..069db02fadff 100644 --- a/sys/dev/mrsas/mrsas.h +++ b/sys/dev/mrsas/mrsas.h @@ -165,14 +165,22 @@ do { \ device_printf(sc->mrsas_dev, msg, ##args); \ } while (0) +#define le32_to_cpus(x) do { *((u_int32_t *)(x)) = le32toh((*(u_int32_t *)x)); } while (0) +#define le16_to_cpus(x) do { *((u_int16_t *)(x)) = le16toh((*(u_int16_t *)x)); } while (0) + /**************************************************************************** * Raid Context structure which describes MegaRAID specific IO Paramenters * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames ****************************************************************************/ typedef struct _RAID_CONTEXT { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int8_t Type:4; u_int8_t nseg:4; +#else + u_int8_t nseg:4; + u_int8_t Type:4; +#endif u_int8_t resvd0; u_int16_t timeoutValue; u_int8_t regLockFlags; @@ -197,12 +205,19 @@ typedef struct _RAID_CONTEXT { * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames */ typedef struct _RAID_CONTEXT_G35 { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t Type:4; u_int16_t nseg:4; u_int16_t resvd0:8; +#else + u_int16_t resvd0:8; + u_int16_t nseg:4; + u_int16_t Type:4; +#endif u_int16_t timeoutValue; union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t reserved:1; u_int16_t sld:1; u_int16_t c2f:1; @@ -213,6 +228,18 @@ typedef struct _RAID_CONTEXT_G35 { u_int16_t log:1; u_int16_t cpuSel:4; u_int16_t setDivert:4; +#else + u_int16_t setDivert:4; + u_int16_t cpuSel:4; + u_int16_t log:1; + u_int16_t rw:1; + u_int16_t sbs:1; + u_int16_t sqn:1; + u_int16_t fwn:1; + u_int16_t c2f:1; + u_int16_t sld:1; + u_int16_t reserved:1; +#endif } bits; u_int16_t s; } routingFlags; @@ -228,9 +255,15 @@ typedef struct _RAID_CONTEXT_G35 { u_int8_t RAIDFlags; u_int8_t spanArm; u_int16_t configSeqNum; +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t numSGE:12; u_int16_t reserved:3; u_int16_t streamDetected:1; +#else + u_int16_t streamDetected:1; + u_int16_t reserved:3; + u_int16_t numSGE:12; +#endif u_int8_t resvd2[2]; } RAID_CONTEXT_G35; @@ -433,9 +466,15 @@ typedef struct _MR_TASK_MANAGE_REQUEST { MR_TM_REQUEST TmRequest; union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t isTMForLD:1; u_int32_t isTMForPD:1; u_int32_t reserved1:30; +#else + u_int32_t reserved1:30; + u_int32_t isTMForPD:1; + u_int32_t isTMForLD:1; +#endif u_int32_t reserved2; } tmReqFlags; MR_TM_REPLY TMReply; @@ -808,6 +847,7 @@ typedef struct _MR_SPAN_BLOCK_INFO { typedef struct _MR_LD_RAID { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t fpCapable:1; u_int32_t raCapable:1; u_int32_t reserved5:2; @@ -822,6 +862,22 @@ typedef struct _MR_LD_RAID { u_int32_t tmCapable:1; u_int32_t fpCacheBypassCapable:1; u_int32_t reserved4:5; +#else + u_int32_t reserved4:5; + u_int32_t fpCacheBypassCapable:1; + u_int32_t tmCapable:1; + u_int32_t fpNonRWCapable:1; + u_int32_t fpReadAcrossStripe:1; + u_int32_t fpWriteAcrossStripe:1; + u_int32_t fpReadCapable:1; + u_int32_t fpWriteCapable:1; + u_int32_t encryptionType:8; + u_int32_t pdPiMode:4; + u_int32_t ldPiMode:4; + u_int32_t reserved5:2; + u_int32_t raCapable:1; + u_int32_t fpCapable:1; +#endif } capability; u_int32_t reserved6; u_int64_t size; @@ -844,9 +900,15 @@ typedef struct _MR_LD_RAID { u_int16_t seqNum; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + u_int32_t reserved:30; + u_int32_t regTypeReqOnReadLsValid:1; + u_int32_t ldSyncRequired:1; +#else u_int32_t ldSyncRequired:1; u_int32_t regTypeReqOnReadLsValid:1; u_int32_t reserved:30; +#endif } flags; u_int8_t LUN[8]; @@ -854,9 +916,15 @@ typedef struct _MR_LD_RAID { u_int8_t reserved2[3]; u_int32_t logicalBlockLength; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + u_int32_t reserved1:24; + u_int32_t LdLogicalBlockExp:4; + u_int32_t LdPiExp:4; +#else u_int32_t LdPiExp:4; u_int32_t LdLogicalBlockExp:4; u_int32_t reserved1:24; +#endif } exponent; u_int8_t reserved3[0x80 - 0x38]; } MR_LD_RAID; @@ -1039,8 +1107,13 @@ struct MR_PD_CFG_SEQ { u_int16_t seqNum; u_int16_t devHandle; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int8_t tmCapable:1; u_int8_t reserved:7; +#else + u_int8_t reserved:7; + u_int8_t tmCapable:1; +#endif } capability; u_int8_t reserved; u_int16_t pdTargetId; @@ -1868,6 +1941,7 @@ struct mrsas_ctrl_prop { * structure. */ struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t copyBackDisabled:1; u_int32_t SMARTerEnabled:1; u_int32_t prCorrectUnconfiguredAreas:1; @@ -1899,6 +1973,39 @@ struct mrsas_ctrl_prop { u_int32_t enableSwZone:1; u_int32_t limitMaxRateSATA3G:1; u_int32_t reserved:2; +#else + u_int32_t reserved:2; + u_int32_t limitMaxRateSATA3G:1; + u_int32_t enableSwZone:1; + u_int32_t ignore64ldRestriction:1; + u_int32_t disableT10RebuildAssist:1; + u_int32_t disableImmediateIO:1; + u_int32_t enableAutoLockRecovery:1; + u_int32_t enableVirtualCache:1; + u_int32_t enableConfigAutoBalance:1; + u_int32_t forceSGPIOForQuadOnly:1; + u_int32_t useEmergencySparesforSMARTer:1; + u_int32_t useUnconfGoodForEmergency:1; + u_int32_t useGlobalSparesForEmergency:1; + u_int32_t preventPIImport:1; + u_int32_t enablePI:1; + u_int32_t useDiskActivityForLocate:1; + u_int32_t disableCacheBypass:1; + u_int32_t enableJBOD:1; + u_int32_t disableSpinDownHS:1; + u_int32_t allowBootWithPinnedCache:1; + u_int32_t disableOnlineCtrlReset:1; + u_int32_t enableSecretKeyControl:1; + u_int32_t autoEnhancedImport:1; + u_int32_t enableSpinDownUnconfigured:1; + u_int32_t SSDPatrolReadEnabled:1; + u_int32_t SSDSMARTerEnabled:1; + u_int32_t disableNCQ:1; + u_int32_t useFdeOnly:1; + u_int32_t prCorrectUnconfiguredAreas:1; + u_int32_t SMARTerEnabled:1; + u_int32_t copyBackDisabled:1; +#endif } OnOffProperties; u_int8_t autoSnapVDSpace; u_int8_t viewSpace; @@ -2170,6 +2277,7 @@ struct mrsas_ctrl_info { u_int16_t cacheMemorySize; /* 0x7A2 */ struct { /* 0x7A4 */ +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t supportPIcontroller:1; u_int32_t supportLdPIType1:1; u_int32_t supportLdPIType2:1; @@ -2194,6 +2302,30 @@ struct mrsas_ctrl_info { u_int32_t supportUnevenSpans:1; u_int32_t reserved:11; +#else + u_int32_t reserved:11; + u_int32_t supportUnevenSpans:1; + u_int32_t dedicatedHotSparesLimited:1; + u_int32_t headlessMode:1; + u_int32_t supportEmulatedDrives:1; + u_int32_t supportResetNow:1; + u_int32_t realTimeScheduler:1; + u_int32_t supportSSDPatrolRead:1; + u_int32_t supportPerfTuning:1; + u_int32_t disableOnlinePFKChange:1; + u_int32_t supportJBOD:1; + u_int32_t supportBootTimePFKChange:1; + u_int32_t supportSetLinkSpeed:1; + u_int32_t supportEmergencySpares:1; + u_int32_t supportSuspendResumeBGops:1; + u_int32_t blockSSDWriteCacheChange:1; + u_int32_t supportShieldState:1; + u_int32_t supportLdBBMInfo:1; + u_int32_t supportLdPIType3:1; + u_int32_t supportLdPIType2:1; + u_int32_t supportLdPIType1:1; + u_int32_t supportPIcontroller:1; +#endif } adapterOperations2; u_int8_t driverVersion[32]; /* 0x7A8 */ @@ -2206,6 +2338,7 @@ struct mrsas_ctrl_info { u_int8_t reserved5[2]; /* 0x7CD reserved */ struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t peerIsPresent:1; u_int32_t peerIsIncompatible:1; @@ -2214,6 +2347,15 @@ struct mrsas_ctrl_info { u_int32_t ctrlPropIncompatible:1; u_int32_t premiumFeatureMismatch:1; u_int32_t reserved:26; +#else + u_int32_t reserved:26; + u_int32_t premiumFeatureMismatch:1; + u_int32_t ctrlPropIncompatible:1; + u_int32_t fwVersionMismatch:1; + u_int32_t hwIncompatible:1; + u_int32_t peerIsIncompatible:1; + u_int32_t peerIsPresent:1; +#endif } cluster; char clusterId[16]; /* 0x7D4 */ @@ -2221,6 +2363,7 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t supportPersonalityChange:2; u_int32_t supportThermalPollInterval:1; u_int32_t supportDisableImmediateIO:1; @@ -2246,11 +2389,39 @@ struct mrsas_ctrl_info { u_int32_t supportExtendedSSCSize:1; u_int32_t useSeqNumJbodFP:1; u_int32_t reserved:7; +#else + u_int32_t reserved:7; + u_int32_t useSeqNumJbodFP:1; + u_int32_t supportExtendedSSCSize:1; + u_int32_t supportDiskCacheSettingForSysPDs:1; + u_int32_t supportCPLDUpdate:1; + u_int32_t supportTTYLogCompression:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportForceFlash:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportSwZone:1; + u_int32_t supportCrashDump:1; + u_int32_t supportMaxExtLDs:1; + u_int32_t supportT10RebuildAssist:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportPersonalityChange:2; +#endif } adapterOperations3; u_int8_t pad_cpld[16]; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t ctrlInfoExtSupported:1; u_int16_t supportIbuttonLess:1; u_int16_t supportedEncAlgo:1; @@ -2260,6 +2431,17 @@ struct mrsas_ctrl_info { u_int16_t supportPdMapTargetId:1; u_int16_t FWSwapsBBUVPDInfo:1; u_int16_t reserved:8; +#else + u_int16_t reserved:8; + u_int16_t FWSwapsBBUVPDInfo:1; + u_int16_t supportPdMapTargetId:1; + u_int16_t supportSESCtrlInMultipathCfg:1; + u_int16_t imageUploadSupported:1; + u_int16_t supportEncryptedMfc:1; + u_int16_t supportedEncAlgo:1; + u_int16_t supportIbuttonLess:1; + u_int16_t ctrlInfoExtSupported:1; +#endif } adapterOperations4; u_int8_t pad[0x800 - 0x7FE]; /* 0x7FE */ @@ -2332,6 +2514,7 @@ struct mrsas_ctrl_info { typedef union _MFI_CAPABILITIES { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t support_fp_remote_lun:1; u_int32_t support_additional_msix:1; u_int32_t support_fastpath_wb:1; @@ -2342,6 +2525,18 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_ext_queue_depth:1; u_int32_t support_ext_io_size:1; u_int32_t reserved:23; +#else + u_int32_t reserved:23; + u_int32_t support_ext_io_size:1; + u_int32_t support_ext_queue_depth:1; + u_int32_t security_protocol_cmds_fw:1; + u_int32_t support_core_affinity:1; + u_int32_t support_ndrive_r1_lb:1; + u_int32_t support_max_255lds:1; + u_int32_t support_fastpath_wb:1; + u_int32_t support_additional_msix:1; + u_int32_t support_fp_remote_lun:1; +#endif } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2602,9 +2797,15 @@ union mrsas_frame { #pragma pack(1) union mrsas_evt_class_locale { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t locale; u_int8_t reserved; int8_t class; +#else + int8_t class; + u_int8_t reserved; + u_int16_t locale; +#endif } __packed members; u_int32_t word; @@ -2890,6 +3091,7 @@ typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t linkSpeed:4; u_int32_t linkWidth:6; u_int32_t aspmSupport:2; @@ -2897,6 +3099,15 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { u_int32_t l1ExitLatency:3; u_int32_t rsvdp:6; u_int32_t portNumber:8; +#else + u_int32_t portNumber:8; + u_int32_t rsvdp:6; + u_int32_t l1ExitLatency:3; + u_int32_t losExitLatency:3; + u_int32_t aspmSupport:2; + u_int32_t linkWidth:6; + u_int32_t linkSpeed:4; +#endif } bits; u_int32_t asUlong; @@ -2908,12 +3119,21 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t linkSpeed:4; u_int16_t negotiatedLinkWidth:6; u_int16_t linkTrainingError:1; u_int16_t linkTraning:1; u_int16_t slotClockConfig:1; u_int16_t rsvdZ:3; +#else + u_int16_t rsvdZ:3; + u_int16_t slotClockConfig:1; + u_int16_t linkTraning:1; + u_int16_t linkTrainingError:1; + u_int16_t negotiatedLinkWidth:6; + u_int16_t linkSpeed:4; +#endif } bits; u_int16_t asUshort; @@ -2967,6 +3187,7 @@ union MR_PD_DDF_TYPE { struct { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t forcedPDGUID:1; u_int16_t inVD:1; u_int16_t isGlobalSpare:1; @@ -2974,6 +3195,15 @@ union MR_PD_DDF_TYPE { u_int16_t isForeign:1; u_int16_t reserved:7; u_int16_t intf:4; +#else + u_int16_t intf:4; + u_int16_t reserved:7; + u_int16_t isForeign:1; + u_int16_t isSpare:1; + u_int16_t isGlobalSpare:1; + u_int16_t inVD:1; + u_int16_t forcedPDGUID:1; +#endif } pdType; u_int16_t type; }; @@ -3004,6 +3234,7 @@ union MR_PROGRESS { */ struct MR_PD_PROGRESS { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t rbld:1; u_int32_t patrol:1; u_int32_t clear:1; @@ -3011,6 +3242,15 @@ struct MR_PD_PROGRESS { u_int32_t erase:1; u_int32_t locate:1; u_int32_t reserved:26; *** 783 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Feb 3 23:00:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A5EC752EFF2; Wed, 3 Feb 2021 23:00:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWHFw4LCfz4RMm; Wed, 3 Feb 2021 23:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 880F62923F; Wed, 3 Feb 2021 23:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113N0KKa061685; Wed, 3 Feb 2021 23:00:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113N0KoV061681; Wed, 3 Feb 2021 23:00:20 GMT (envelope-from git) Date: Wed, 3 Feb 2021 23:00:20 GMT Message-Id: <202102032300.113N0KoV061681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: cb7cc72c546e - main - serf: Fix the default return value of the BIO control method. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb7cc72c546e0f87598961c3860e17391f42866c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 23:00:20 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cb7cc72c546e0f87598961c3860e17391f42866c commit cb7cc72c546e0f87598961c3860e17391f42866c Author: John Baldwin AuthorDate: 2021-02-03 22:59:32 +0000 Commit: John Baldwin CommitDate: 2021-02-03 22:59:32 +0000 serf: Fix the default return value of the BIO control method. OpenSSL BIO classes provide an abstraction for dealing with I/O. OpenSSL provides BIO classes for commonly used I/O primitives backed by file descriptors, sockets, etc. as well as permitting consumers of OpenSSL to define custom BIO classes. One of the methods BIO classes implement is a control method invoked by BIO_ctrl() for various ancilliary tasks somewhat analgous to fcntl() and ioctl() on file descriptors. According to the BIO_ctrl(3) manual page, control methods should return 0 for unknown control requests. KTLS support in OpenSSL adds new control requests. Two of those new requests are queries to determine if KTLS is enabled for either reading or writing. These control reuquest return 1 if KTLS is enabled and 0 if it is not. serf includes two custom BIO classes for wrapping I/O requests from files and from a buffer in memory. These BIO classes both use a custom control method. However, this custom control method was returning 1 for unknown or unsupported control requests instead of 0. As a result, OpenSSL with KTLS believed that these BIOs were using KTLS and were thus adding headers and doing encryption/decryption in the BIO. Correcting the return value removes this confusion. PR: 253135 Reported by: Guido Falsi Reviewed by: emaste MFC after: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28472 --- contrib/serf/buckets/ssl_buckets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/serf/buckets/ssl_buckets.c b/contrib/serf/buckets/ssl_buckets.c index b01e5359db08..3c8b7e2a685f 100644 --- a/contrib/serf/buckets/ssl_buckets.c +++ b/contrib/serf/buckets/ssl_buckets.c @@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio) static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) { - long ret = 1; + long ret = 0; switch (cmd) { default: @@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) break; case BIO_CTRL_FLUSH: /* At this point we can't force a flush. */ + ret = 1; break; case BIO_CTRL_PUSH: case BIO_CTRL_POP: From owner-dev-commits-src-main@freebsd.org Thu Feb 4 09:04:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 896E453D78D; Thu, 4 Feb 2021 09:04:34 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWXg630jZz3KHs; Thu, 4 Feb 2021 09:04:34 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-ej1-x629.google.com with SMTP id hs11so4090288ejc.1; Thu, 04 Feb 2021 01:04:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=L4RFJO28usLbqBwQWpVB0AXaN/sNwYLmFUcskdI/Gfg=; b=ijNKzOCvxd3HHKsU5Y2m+aRwiwKQkLbMZRBk8pS5JFSmXMqvp3BjlsaZE4R7KawKrk bNFPi8gA6mAELtaZn/i7WPYXfssw2wBnYVuypflzlB+o0MxlLaHWQT02etgJjuLpsdHU KE+I0hLlk8tyb1vf33UqhbGxl0AmZo8SisgSzW3mIi3u0rXVrMZxZZKm335gVQvNbTFK Y1LryeKMXWq2PG66AN1578GL//PIUq8AjQDn8Dq20w2jSaqOeg4HJGTEHJ/v3JveuQQo ekKDUfq2mrCRkdJ4s+SnisPu3YSAjd+AfT/phbTvooHe3BMAZDVFTjUC7rKGkMz3YZYG iZSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=L4RFJO28usLbqBwQWpVB0AXaN/sNwYLmFUcskdI/Gfg=; b=s+zo/hu3/KgSR+XfxsY/xbqlvAKX1xmXN3coDOODT6X3GaMom2vouEgsrajz1GHQJ6 3fwKyCLykylpp88zxPtWqDmSBiMWiIlMhJddGQL4ex536mfH8qnHaPEdLDbWczcGghsU CxVvybpQ3TplM7H1nUqEeHDXajgDwZPz8drcZ7fKf9oCr+OLy4QTErt8yfKdcGM2ni2F NRlFx/IuwoSmC9BxAyuDU40d7wVKUFl2iIpuZftIADA6WRVUjjLsWLh2LfrEQ0Eb6Ylr yC45JOtRZCR19haMUDdzaIJjzc9iTyqaYqT1ChIFKRuvtdEUHzdHjIzKdBSscbuKuWip RnhA== X-Gm-Message-State: AOAM530gZ42tFJMSerp0VAsmRXA730LCvGdEswSMRM3oPYPxn3rJhp0T ERa7Yb/ACL7AUu9GsjaY11SgGWK630Y= X-Google-Smtp-Source: ABdhPJzJoEHgK+WN4iHhY0aPG+7oqt2MKIGAqlAa9m2AFyZsSWBiKAQDD7UaEeF6+BO8ic4v9/NIYA== X-Received: by 2002:a17:906:fa18:: with SMTP id lo24mr6954231ejb.221.1612429472199; Thu, 04 Feb 2021 01:04:32 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id n5sm2144294edw.7.2021.02.04.01.04.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Feb 2021 01:04:31 -0800 (PST) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: git: e34a057ca6eb - main - [POWERPC64BE] mrsas: add big-endian support To: Alfredo Dal'Ava Junior , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102032208.113M8Xib089636@gitrepo.freebsd.org> From: Michal Meloun Message-ID: <39e1f260-b470-6ab5-5511-12e29e395399@gmail.com> Date: Thu, 4 Feb 2021 10:04:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <202102032208.113M8Xib089636@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DWXg630jZz3KHs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 09:04:34 -0000 On 03.02.2021 23:08, Alfredo Dal'Ava Junior wrote: > The branch main has been updated by alfredo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a > > commit e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a > Author: Alfredo Dal'Ava Junior > AuthorDate: 2021-02-04 00:52:19 +0000 > Commit: Alfredo Dal'Ava Junior > CommitDate: 2021-02-04 01:06:21 +0000 > > [POWERPC64BE] mrsas: add big-endian support > > Add endiannes conversions in order to support big-endian platforms > > Submitted by: Andre Fernando da Silva > Reviewed by: luporl, alfredo, kadesai (on email) > Sponsored by: Eldorado Research Institute (eldorado.org.br) > Differential Revision: https://reviews.freebsd.org/D26531 This caused the following warnings on 32-bit systems(armv7). IMHO, the address should be casted to uint64_t (not bus_addr_t) before the shift. /usr2/Meloun/git/tegra/sys/dev/mrsas/mrsas.c:2786:67: error: shift count >= width of type [-Werror,-Wshift-count-overflow] req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); ^ ~~ /usr2/Meloun/git/tegra/sys/sys/endian.h:74:32: note: expanded from macro 'htole32' #define htole32(x) ((uint32_t)(x)) > --- > sys/dev/mrsas/mrsas.c | 198 ++++++++++++++++--------------- > sys/dev/mrsas/mrsas.h | 289 +++++++++++++++++++++++++++++++++++++++++++++- > sys/dev/mrsas/mrsas_cam.c | 54 ++++----- > sys/dev/mrsas/mrsas_fp.c | 170 ++++++++++++++------------- > 4 files changed, 510 insertions(+), 201 deletions(-) > > diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c > index 32d85c803938..f4c34e237fc4 100644 > --- a/sys/dev/mrsas/mrsas.c > +++ b/sys/dev/mrsas/mrsas.c > @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > /* > * Function prototypes > @@ -619,13 +620,13 @@ mrsas_get_seq_num(struct mrsas_softc *sc, > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0x0; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_evt_log_info); > - dcmd->opcode = MR_DCMD_CTRL_EVENT_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = sc->el_info_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_log_info); > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_log_info)); > + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(sc->el_info_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_log_info)); > > retcode = mrsas_issue_blocked_cmd(sc, cmd); > if (retcode == ETIMEDOUT) > @@ -681,7 +682,7 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, > curr_aen.word = class_locale_word; > > if (sc->aen_cmd) { > - prev_aen.word = sc->aen_cmd->frame->dcmd.mbox.w[1]; > + prev_aen.word = le32toh(sc->aen_cmd->frame->dcmd.mbox.w[1]); > > /* > * A class whose enum value is smaller is inclusive of all > @@ -732,16 +733,16 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0x0; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_evt_detail); > - dcmd->opcode = MR_DCMD_CTRL_EVENT_WAIT; > - dcmd->mbox.w[0] = seq_num; > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_detail)); > + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_WAIT); > + dcmd->mbox.w[0] = htole32(seq_num); > sc->last_seq_num = seq_num; > - dcmd->mbox.w[1] = curr_aen.word; > - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->evt_detail_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_detail); > + dcmd->mbox.w[1] = htole32(curr_aen.word); > + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->evt_detail_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_detail)); > > if (sc->aen_cmd != NULL) { > mrsas_release_mfi_cmd(cmd); > @@ -907,9 +908,6 @@ mrsas_attach(device_t dev) > * Set up PCI and registers > */ > cmd = pci_read_config(dev, PCIR_COMMAND, 2); > - if ((cmd & PCIM_CMD_PORTEN) == 0) { > - return (ENXIO); > - } > /* Force the busmaster enable bit on. */ > cmd |= PCIM_CMD_BUSMASTEREN; > pci_write_config(dev, PCIR_COMMAND, cmd, 2); > @@ -1704,7 +1702,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > > /* Find our reply descriptor for the command and process */ > while ((desc_val.u.low != 0xFFFFFFFF) && (desc_val.u.high != 0xFFFFFFFF)) { > - smid = reply_desc->SMID; > + smid = le16toh(reply_desc->SMID); > cmd_mpt = sc->mpt_cmd_list[smid - 1]; > scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; > > @@ -1736,7 +1734,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: > if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { > mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, > - extStatus, data_length, sense); > + extStatus, le32toh(data_length), sense); > mrsas_cmd_done(sc, cmd_mpt); > mrsas_atomic_dec(&sc->fw_outstanding); > } else { > @@ -1764,7 +1762,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > mrsas_release_mpt_cmd(r1_cmd); > mrsas_atomic_dec(&sc->fw_outstanding); > mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, > - extStatus, data_length, sense); > + extStatus, le32toh(data_length), sense); > mrsas_cmd_done(sc, cmd_mpt); > mrsas_atomic_dec(&sc->fw_outstanding); > } > @@ -1778,7 +1776,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > * And also make sure that the issue_polled call should only be > * used if INTERRUPT IS DISABLED. > */ > - if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) > + if (cmd_mfi->frame->hdr.flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) > mrsas_release_mfi_cmd(cmd_mfi); > else > mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); > @@ -2593,6 +2591,13 @@ mrsas_init_adapter(struct mrsas_softc *sc) > (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); > scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, > outbound_scratch_pad_2)); > + > + mrsas_dprint(sc, MRSAS_TRACE, "%s: sc->reply_q_depth 0x%x," > + "sc->request_alloc_sz 0x%x, sc->reply_alloc_sz 0x%x," > + "sc->io_frames_alloc_sz 0x%x\n", __func__, > + sc->reply_q_depth, sc->request_alloc_sz, > + sc->reply_alloc_sz, sc->io_frames_alloc_sz); > + > /* > * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, > * Firmware support extended IO chain frame which is 4 time more > @@ -2617,8 +2622,10 @@ mrsas_init_adapter(struct mrsas_softc *sc) > > mrsas_dprint(sc, MRSAS_INFO, > "max sge: 0x%x, max chain frame size: 0x%x, " > - "max fw cmd: 0x%x\n", sc->max_num_sge, > - sc->max_chain_frame_sz, sc->max_fw_cmds); > + "max fw cmd: 0x%x sc->chain_frames_alloc_sz: 0x%x\n", > + sc->max_num_sge, > + sc->max_chain_frame_sz, sc->max_fw_cmds, > + sc->chain_frames_alloc_sz); > > /* Used for pass thru MFI frame (DCMD) */ > sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; > @@ -2738,19 +2745,19 @@ mrsas_ioc_init(struct mrsas_softc *sc) > IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); > IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; > IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; > - IOCInitMsg->MsgVersion = MPI2_VERSION; > - IOCInitMsg->HeaderVersion = MPI2_HEADER_VERSION; > - IOCInitMsg->SystemRequestFrameSize = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4; > - IOCInitMsg->ReplyDescriptorPostQueueDepth = sc->reply_q_depth; > - IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; > - IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; > + IOCInitMsg->MsgVersion = htole16(MPI2_VERSION); > + IOCInitMsg->HeaderVersion = htole16(MPI2_HEADER_VERSION); > + IOCInitMsg->SystemRequestFrameSize = htole16(MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4); > + IOCInitMsg->ReplyDescriptorPostQueueDepth = htole16(sc->reply_q_depth); > + IOCInitMsg->ReplyDescriptorPostQueueAddress = htole64(sc->reply_desc_phys_addr); > + IOCInitMsg->SystemRequestFrameBaseAddress = htole64(sc->io_request_phys_addr); > IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); > IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; > > init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; > init_frame->cmd = MFI_CMD_INIT; > init_frame->cmd_status = 0xFF; > - init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; > + init_frame->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); > > /* driver support Extended MSIX */ > if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { > @@ -2768,11 +2775,16 @@ mrsas_ioc_init(struct mrsas_softc *sc) > init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; > if (sc->max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN) > init_frame->driver_operations.mfi_capabilities.support_ext_io_size = 1; > + > + init_frame->driver_operations.reg = htole32(init_frame->driver_operations.reg); > + > phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; > - init_frame->queue_info_new_phys_addr_lo = phys_addr; > - init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); > + init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); > + init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); > + > + req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); > + req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); > > - req_desc.addr.Words = (bus_addr_t)sc->ioc_init_phys_mem; > req_desc.MFAIo.RequestFlags = > (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); > > @@ -2923,9 +2935,9 @@ mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, > { > mtx_lock(&sc->pci_lock); > mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_low_queue_port), > - req_desc_lo); > + le32toh(req_desc_lo)); > mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_high_queue_port), > - req_desc_hi); > + le32toh(req_desc_hi)); > mtx_unlock(&sc->pci_lock); > } > > @@ -2944,7 +2956,7 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, > { > if (sc->atomic_desc_support) > mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), > - req_desc_lo); > + le32toh(req_desc_lo)); > else > mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); > } > @@ -3103,7 +3115,6 @@ mrsas_ocr_thread(void *arg) > sc = (struct mrsas_softc *)arg; > > mrsas_dprint(sc, MRSAS_TRACE, "%s\n", __func__); > - > sc->ocr_thread_active = 1; > mtx_lock(&sc->sim_lock); > for (;;) { > @@ -3642,10 +3653,10 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) > dcmd->flags = MFI_FRAME_DIR_READ; > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_ctrl_info); > - dcmd->opcode = MR_DCMD_CTRL_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_ctrl_info)); > + dcmd->opcode = htole32(MR_DCMD_CTRL_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(sc->ctlr_info_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_ctrl_info)); > > if (!sc->mask_interrupts) > retcode = mrsas_issue_blocked_cmd(sc, cmd); > @@ -3654,8 +3665,13 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) > > if (retcode == ETIMEDOUT) > goto dcmd_timeout; > - else > + else { > memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); > + le32_to_cpus(&sc->ctrl_info->properties.OnOffProperties); > + le32_to_cpus(&sc->ctrl_info->adapterOperations2); > + le32_to_cpus(&sc->ctrl_info->adapterOperations3); > + le16_to_cpus(&sc->ctrl_info->adapterOperations4); > + } > > do_ocr = 0; > mrsas_update_ext_vd_details(sc); > @@ -3813,7 +3829,7 @@ mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) > int i, retcode = SUCCESS; > > frame_hdr->cmd_status = 0xFF; > - frame_hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; > + frame_hdr->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); > > /* Issue the frame using inbound queue port */ > if (mrsas_issue_dcmd(sc, cmd)) { > @@ -3892,7 +3908,7 @@ mrsas_build_mpt_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) > req_desc->addr.Words = 0; > req_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); > > - req_desc->SCSIIO.SMID = index; > + req_desc->SCSIIO.SMID = htole16(index); > > return (req_desc); > } > @@ -3927,7 +3943,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm > * mrsas_complete_cmd. > */ > > - if (frame_hdr->flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) > + if (frame_hdr->flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) > mpt_cmd->flags = MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; > > io_req = mpt_cmd->io_request; > @@ -3944,12 +3960,12 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm > io_req->SGLOffset0 = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 4; > io_req->ChainOffset = sc->chain_offset_mfi_pthru; > > - mpi25_ieee_chain->Address = mfi_cmd->frame_phys_addr; > + mpi25_ieee_chain->Address = htole64(mfi_cmd->frame_phys_addr); > > mpi25_ieee_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | > MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; > > - mpi25_ieee_chain->Length = sc->max_chain_frame_sz; > + mpi25_ieee_chain->Length = htole32(sc->max_chain_frame_sz); > > return (0); > } > @@ -4100,7 +4116,7 @@ mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd > break; > } > /* See if got an event notification */ > - if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_EVENT_WAIT) > + if (le32toh(cmd->frame->dcmd.opcode) == MR_DCMD_CTRL_EVENT_WAIT) > mrsas_complete_aen(sc, cmd); > else > mrsas_wakeup(sc, cmd); > @@ -4264,14 +4280,14 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) > dcmd->sge_count = 1; > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = (pd_seq_map_sz); > - dcmd->opcode = (MR_DCMD_SYSTEM_PD_MAP_GET_INFO); > - dcmd->sgl.sge32[0].phys_addr = (pd_seq_h); > - dcmd->sgl.sge32[0].length = (pd_seq_map_sz); > + dcmd->data_xfer_len = htole32(pd_seq_map_sz); > + dcmd->opcode = htole32(MR_DCMD_SYSTEM_PD_MAP_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(pd_seq_h & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(pd_seq_map_sz); > > if (pend) { > dcmd->mbox.b[0] = MRSAS_DCMD_MBOX_PEND_FLAG; > - dcmd->flags = (MFI_FRAME_DIR_WRITE); > + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); > sc->jbod_seq_cmd = cmd; > if (mrsas_issue_dcmd(sc, cmd)) { > device_printf(sc->mrsas_dev, > @@ -4280,13 +4296,13 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) > } else > return 0; > } else > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > > retcode = mrsas_issue_polled(sc, cmd); > if (retcode == ETIMEDOUT) > goto dcmd_timeout; > > - if (pd_sync->count > MAX_PHYSICAL_DEVICES) { > + if (le32toh(pd_sync->count) > MAX_PHYSICAL_DEVICES) { > device_printf(sc->mrsas_dev, > "driver supports max %d JBOD, but FW reports %d\n", > MAX_PHYSICAL_DEVICES, pd_sync->count); > @@ -4364,13 +4380,13 @@ mrsas_get_ld_map_info(struct mrsas_softc *sc) > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sc->current_map_sz; > - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; > - dcmd->sgl.sge32[0].length = sc->current_map_sz; > + dcmd->data_xfer_len = htole32(sc->current_map_sz); > + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); > > retcode = mrsas_issue_polled(sc, cmd); > if (retcode == ETIMEDOUT) > @@ -4427,15 +4443,15 @@ mrsas_sync_map_info(struct mrsas_softc *sc) > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_WRITE; > + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sc->current_map_sz; > + dcmd->data_xfer_len = htole32(sc->current_map_sz); > dcmd->mbox.b[0] = num_lds; > dcmd->mbox.b[1] = MRSAS_DCMD_MBOX_PEND_FLAG; > - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; > - dcmd->sgl.sge32[0].length = sc->current_map_sz; > + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); > > sc->map_update_cmd = cmd; > if (mrsas_issue_dcmd(sc, cmd)) { > @@ -4472,17 +4488,17 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) > memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); > memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); > > - dcmd->mbox.s[0] = device_id; > + dcmd->mbox.s[0] = htole16(device_id); > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > dcmd->flags = MFI_FRAME_DIR_READ; > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); > - dcmd->opcode = MR_DCMD_PD_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_pd_info)); > + dcmd->opcode = htole32(MR_DCMD_PD_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->pd_info_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_pd_info)); > > if (!sc->mask_interrupts) > retcode = mrsas_issue_blocked_cmd(sc, cmd); > @@ -4493,7 +4509,7 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) > goto dcmd_timeout; > > sc->target_list[device_id].interface_type = > - sc->pd_info_mem->state.ddf.pdType.intf; > + le16toh(sc->pd_info_mem->state.ddf.pdType.intf); > > do_ocr = 0; > > @@ -4572,6 +4588,7 @@ mrsas_get_pd_list(struct mrsas_softc *sc) > struct MR_PD_ADDRESS *pd_addr; > bus_addr_t pd_list_phys_addr = 0; > struct mrsas_tmp_dcmd *tcmd; > + u_int16_t dev_id; > > cmd = mrsas_get_mfi_cmd(sc); > if (!cmd) { > @@ -4601,13 +4618,13 @@ mrsas_get_pd_list(struct mrsas_softc *sc) > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); > - dcmd->opcode = MR_DCMD_PD_LIST_QUERY; > - dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; > - dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); > + dcmd->data_xfer_len = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); > + dcmd->opcode = htole32(MR_DCMD_PD_LIST_QUERY); > + dcmd->sgl.sge32[0].phys_addr = htole32(pd_list_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); > > if (!sc->mask_interrupts) > retcode = mrsas_issue_blocked_cmd(sc, cmd); > @@ -4620,17 +4637,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) > /* Get the instance PD list */ > pd_count = MRSAS_MAX_PD; > pd_addr = pd_list_mem->addr; > - if (pd_list_mem->count < pd_count) { > + if (le32toh(pd_list_mem->count) < pd_count) { > memset(sc->local_pd_list, 0, > MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); > - for (pd_index = 0; pd_index < pd_list_mem->count; pd_index++) { > - sc->local_pd_list[pd_addr->deviceId].tid = pd_addr->deviceId; > - sc->local_pd_list[pd_addr->deviceId].driveType = > - pd_addr->scsiDevType; > - sc->local_pd_list[pd_addr->deviceId].driveState = > + for (pd_index = 0; pd_index < le32toh(pd_list_mem->count); pd_index++) { > + dev_id = le16toh(pd_addr->deviceId); > + sc->local_pd_list[dev_id].tid = dev_id; > + sc->local_pd_list[dev_id].driveType = > + le16toh(pd_addr->scsiDevType); > + sc->local_pd_list[dev_id].driveState = > MR_PD_STATE_SYSTEM; > - if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) > - mrsas_add_target(sc, pd_addr->deviceId); > + if (sc->target_list[dev_id].target_id == 0xffff) > + mrsas_add_target(sc, dev_id); > pd_addr++; > } > for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { > @@ -4711,10 +4729,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) > dcmd->sge_count = 1; > dcmd->flags = MFI_FRAME_DIR_READ; > dcmd->timeout = 0; > - dcmd->data_xfer_len = sizeof(struct MR_LD_LIST); > - dcmd->opcode = MR_DCMD_LD_GET_LIST; > - dcmd->sgl.sge32[0].phys_addr = ld_list_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); > + dcmd->data_xfer_len = htole32(sizeof(struct MR_LD_LIST)); > + dcmd->opcode = htole32(MR_DCMD_LD_GET_LIST); > + dcmd->sgl.sge32[0].phys_addr = htole32(ld_list_phys_addr); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct MR_LD_LIST)); > dcmd->pad_0 = 0; > > if (!sc->mask_interrupts) > @@ -4730,10 +4748,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) > #endif > > /* Get the instance LD list */ > - if (ld_list_mem->ldCount <= sc->fw_supported_vd_count) { > - sc->CurLdCount = ld_list_mem->ldCount; > + if (le32toh(ld_list_mem->ldCount) <= sc->fw_supported_vd_count) { > + sc->CurLdCount = le32toh(ld_list_mem->ldCount); > memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); > - for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { > + for (ld_index = 0; ld_index < le32toh(ld_list_mem->ldCount); ld_index++) { > ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; > drv_tgt_id = ids + MRSAS_MAX_PD; > if (ld_list_mem->ldList[ld_index].state != 0) { > diff --git a/sys/dev/mrsas/mrsas.h b/sys/dev/mrsas/mrsas.h > index fbb08215b7b1..069db02fadff 100644 > --- a/sys/dev/mrsas/mrsas.h > +++ b/sys/dev/mrsas/mrsas.h > @@ -165,14 +165,22 @@ do { \ > device_printf(sc->mrsas_dev, msg, ##args); \ > } while (0) > > +#define le32_to_cpus(x) do { *((u_int32_t *)(x)) = le32toh((*(u_int32_t *)x)); } while (0) > +#define le16_to_cpus(x) do { *((u_int16_t *)(x)) = le16toh((*(u_int16_t *)x)); } while (0) > + > /**************************************************************************** > * Raid Context structure which describes MegaRAID specific IO Paramenters > * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames > ****************************************************************************/ > > typedef struct _RAID_CONTEXT { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int8_t Type:4; > u_int8_t nseg:4; > +#else > + u_int8_t nseg:4; > + u_int8_t Type:4; > +#endif > u_int8_t resvd0; > u_int16_t timeoutValue; > u_int8_t regLockFlags; > @@ -197,12 +205,19 @@ typedef struct _RAID_CONTEXT { > * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames > */ > typedef struct _RAID_CONTEXT_G35 { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t Type:4; > u_int16_t nseg:4; > u_int16_t resvd0:8; > +#else > + u_int16_t resvd0:8; > + u_int16_t nseg:4; > + u_int16_t Type:4; > +#endif > u_int16_t timeoutValue; > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t reserved:1; > u_int16_t sld:1; > u_int16_t c2f:1; > @@ -213,6 +228,18 @@ typedef struct _RAID_CONTEXT_G35 { > u_int16_t log:1; > u_int16_t cpuSel:4; > u_int16_t setDivert:4; > +#else > + u_int16_t setDivert:4; > + u_int16_t cpuSel:4; > + u_int16_t log:1; > + u_int16_t rw:1; > + u_int16_t sbs:1; > + u_int16_t sqn:1; > + u_int16_t fwn:1; > + u_int16_t c2f:1; > + u_int16_t sld:1; > + u_int16_t reserved:1; > +#endif > } bits; > u_int16_t s; > } routingFlags; > @@ -228,9 +255,15 @@ typedef struct _RAID_CONTEXT_G35 { > u_int8_t RAIDFlags; > u_int8_t spanArm; > u_int16_t configSeqNum; > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t numSGE:12; > u_int16_t reserved:3; > u_int16_t streamDetected:1; > +#else > + u_int16_t streamDetected:1; > + u_int16_t reserved:3; > + u_int16_t numSGE:12; > +#endif > u_int8_t resvd2[2]; > } RAID_CONTEXT_G35; > > @@ -433,9 +466,15 @@ typedef struct _MR_TASK_MANAGE_REQUEST { > MR_TM_REQUEST TmRequest; > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t isTMForLD:1; > u_int32_t isTMForPD:1; > u_int32_t reserved1:30; > +#else > + u_int32_t reserved1:30; > + u_int32_t isTMForPD:1; > + u_int32_t isTMForLD:1; > +#endif > u_int32_t reserved2; > } tmReqFlags; > MR_TM_REPLY TMReply; > @@ -808,6 +847,7 @@ typedef struct _MR_SPAN_BLOCK_INFO { > > typedef struct _MR_LD_RAID { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t fpCapable:1; > u_int32_t raCapable:1; > u_int32_t reserved5:2; > @@ -822,6 +862,22 @@ typedef struct _MR_LD_RAID { > u_int32_t tmCapable:1; > u_int32_t fpCacheBypassCapable:1; > u_int32_t reserved4:5; > +#else > + u_int32_t reserved4:5; > + u_int32_t fpCacheBypassCapable:1; > + u_int32_t tmCapable:1; > + u_int32_t fpNonRWCapable:1; > + u_int32_t fpReadAcrossStripe:1; > + u_int32_t fpWriteAcrossStripe:1; > + u_int32_t fpReadCapable:1; > + u_int32_t fpWriteCapable:1; > + u_int32_t encryptionType:8; > + u_int32_t pdPiMode:4; > + u_int32_t ldPiMode:4; > + u_int32_t reserved5:2; > + u_int32_t raCapable:1; > + u_int32_t fpCapable:1; > +#endif > } capability; > u_int32_t reserved6; > u_int64_t size; > @@ -844,9 +900,15 @@ typedef struct _MR_LD_RAID { > u_int16_t seqNum; > > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > + u_int32_t reserved:30; > + u_int32_t regTypeReqOnReadLsValid:1; > + u_int32_t ldSyncRequired:1; > +#else > u_int32_t ldSyncRequired:1; > u_int32_t regTypeReqOnReadLsValid:1; > u_int32_t reserved:30; > +#endif > } flags; > > u_int8_t LUN[8]; > @@ -854,9 +916,15 @@ typedef struct _MR_LD_RAID { > u_int8_t reserved2[3]; > u_int32_t logicalBlockLength; > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > + u_int32_t reserved1:24; > + u_int32_t LdLogicalBlockExp:4; > + u_int32_t LdPiExp:4; > +#else > u_int32_t LdPiExp:4; > u_int32_t LdLogicalBlockExp:4; > u_int32_t reserved1:24; > +#endif > } exponent; > u_int8_t reserved3[0x80 - 0x38]; > } MR_LD_RAID; > @@ -1039,8 +1107,13 @@ struct MR_PD_CFG_SEQ { > u_int16_t seqNum; > u_int16_t devHandle; > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int8_t tmCapable:1; > u_int8_t reserved:7; > +#else > + u_int8_t reserved:7; > + u_int8_t tmCapable:1; > +#endif > } capability; > u_int8_t reserved; > u_int16_t pdTargetId; > @@ -1868,6 +1941,7 @@ struct mrsas_ctrl_prop { > * structure. > */ > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t copyBackDisabled:1; > u_int32_t SMARTerEnabled:1; > u_int32_t prCorrectUnconfiguredAreas:1; > @@ -1899,6 +1973,39 @@ struct mrsas_ctrl_prop { > u_int32_t enableSwZone:1; > u_int32_t limitMaxRateSATA3G:1; > u_int32_t reserved:2; > +#else > + u_int32_t reserved:2; > + u_int32_t limitMaxRateSATA3G:1; > + u_int32_t enableSwZone:1; > + u_int32_t ignore64ldRestriction:1; > + u_int32_t disableT10RebuildAssist:1; > + u_int32_t disableImmediateIO:1; > + u_int32_t enableAutoLockRecovery:1; > + u_int32_t enableVirtualCache:1; > + u_int32_t enableConfigAutoBalance:1; > + u_int32_t forceSGPIOForQuadOnly:1; > + u_int32_t useEmergencySparesforSMARTer:1; > + u_int32_t useUnconfGoodForEmergency:1; > + u_int32_t useGlobalSparesForEmergency:1; > + u_int32_t preventPIImport:1; > + u_int32_t enablePI:1; > + u_int32_t useDiskActivityForLocate:1; > + u_int32_t disableCacheBypass:1; > + u_int32_t enableJBOD:1; > + u_int32_t disableSpinDownHS:1; > + u_int32_t allowBootWithPinnedCache:1; > + u_int32_t disableOnlineCtrlReset:1; > + u_int32_t enableSecretKeyControl:1; > + u_int32_t autoEnhancedImport:1; > + u_int32_t enableSpinDownUnconfigured:1; > + u_int32_t SSDPatrolReadEnabled:1; > + u_int32_t SSDSMARTerEnabled:1; > + u_int32_t disableNCQ:1; > + u_int32_t useFdeOnly:1; > + u_int32_t prCorrectUnconfiguredAreas:1; > + u_int32_t SMARTerEnabled:1; > + u_int32_t copyBackDisabled:1; > +#endif > } OnOffProperties; > u_int8_t autoSnapVDSpace; > u_int8_t viewSpace; > @@ -2170,6 +2277,7 @@ struct mrsas_ctrl_info { > u_int16_t cacheMemorySize; /* 0x7A2 */ > > struct { /* 0x7A4 */ > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t supportPIcontroller:1; > u_int32_t supportLdPIType1:1; > u_int32_t supportLdPIType2:1; > @@ -2194,6 +2302,30 @@ struct mrsas_ctrl_info { > > u_int32_t supportUnevenSpans:1; > u_int32_t reserved:11; > +#else > + u_int32_t reserved:11; > + u_int32_t supportUnevenSpans:1; > + u_int32_t dedicatedHotSparesLimited:1; > + u_int32_t headlessMode:1; > + u_int32_t supportEmulatedDrives:1; > + u_int32_t supportResetNow:1; > + u_int32_t realTimeScheduler:1; > + u_int32_t supportSSDPatrolRead:1; > + u_int32_t supportPerfTuning:1; > + u_int32_t disableOnlinePFKChange:1; > + u_int32_t supportJBOD:1; > + u_int32_t supportBootTimePFKChange:1; > + u_int32_t supportSetLinkSpeed:1; > + u_int32_t supportEmergencySpares:1; > + u_int32_t supportSuspendResumeBGops:1; > + u_int32_t blockSSDWriteCacheChange:1; > + u_int32_t supportShieldState:1; > + u_int32_t supportLdBBMInfo:1; > + u_int32_t supportLdPIType3:1; > + u_int32_t supportLdPIType2:1; > + u_int32_t supportLdPIType1:1; > + u_int32_t supportPIcontroller:1; > +#endif > } adapterOperations2; > > u_int8_t driverVersion[32]; /* 0x7A8 */ > @@ -2206,6 +2338,7 @@ struct mrsas_ctrl_info { > u_int8_t reserved5[2]; /* 0x7CD reserved */ > > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t peerIsPresent:1; > u_int32_t peerIsIncompatible:1; > > @@ -2214,6 +2347,15 @@ struct mrsas_ctrl_info { > u_int32_t ctrlPropIncompatible:1; > u_int32_t premiumFeatureMismatch:1; > u_int32_t reserved:26; > +#else > + u_int32_t reserved:26; > + u_int32_t premiumFeatureMismatch:1; > + u_int32_t ctrlPropIncompatible:1; > + u_int32_t fwVersionMismatch:1; > + u_int32_t hwIncompatible:1; > + u_int32_t peerIsIncompatible:1; > + u_int32_t peerIsPresent:1; > +#endif > } cluster; > > char clusterId[16]; /* 0x7D4 */ > @@ -2221,6 +2363,7 @@ struct mrsas_ctrl_info { > char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ > > struct { /* 0x7E8 */ > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t supportPersonalityChange:2; > u_int32_t supportThermalPollInterval:1; > u_int32_t supportDisableImmediateIO:1; > @@ -2246,11 +2389,39 @@ struct mrsas_ctrl_info { > u_int32_t supportExtendedSSCSize:1; > u_int32_t useSeqNumJbodFP:1; > u_int32_t reserved:7; > +#else > + u_int32_t reserved:7; > + u_int32_t useSeqNumJbodFP:1; > + u_int32_t supportExtendedSSCSize:1; > + u_int32_t supportDiskCacheSettingForSysPDs:1; > + u_int32_t supportCPLDUpdate:1; > + u_int32_t supportTTYLogCompression:1; > + u_int32_t discardCacheDuringLDDelete:1; > + u_int32_t supportSecurityonJBOD:1; > + u_int32_t supportCacheBypassModes:1; > + u_int32_t supportDisableSESMonitoring:1; > + u_int32_t supportForceFlash:1; > + u_int32_t supportNVDRAM:1; > + u_int32_t supportDrvActivityLEDSetting:1; > + u_int32_t supportAllowedOpsforDrvRemoval:1; > + u_int32_t supportHOQRebuild:1; > + u_int32_t supportForceTo512e:1; > + u_int32_t supportNVCacheErase:1; > + u_int32_t supportDebugQueue:1; > + u_int32_t supportSwZone:1; > + u_int32_t supportCrashDump:1; > + u_int32_t supportMaxExtLDs:1; > + u_int32_t supportT10RebuildAssist:1; > + u_int32_t supportDisableImmediateIO:1; > + u_int32_t supportThermalPollInterval:1; > + u_int32_t supportPersonalityChange:2; > +#endif > } adapterOperations3; > > u_int8_t pad_cpld[16]; > > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t ctrlInfoExtSupported:1; > u_int16_t supportIbuttonLess:1; > u_int16_t supportedEncAlgo:1; > @@ -2260,6 +2431,17 @@ struct mrsas_ctrl_info { > u_int16_t supportPdMapTargetId:1; > u_int16_t FWSwapsBBUVPDInfo:1; > u_int16_t reserved:8; > +#else > + u_int16_t reserved:8; > + u_int16_t FWSwapsBBUVPDInfo:1; > + u_int16_t supportPdMapTargetId:1; > + u_int16_t supportSESCtrlInMultipathCfg:1; > + u_int16_t imageUploadSupported:1; > + u_int16_t supportEncryptedMfc:1; > + u_int16_t supportedEncAlgo:1; > + u_int16_t supportIbuttonLess:1; > + u_int16_t ctrlInfoExtSupported:1; > +#endif > } adapterOperations4; > > u_int8_t pad[0x800 - 0x7FE]; /* 0x7FE */ > @@ -2332,6 +2514,7 @@ struct mrsas_ctrl_info { > > typedef union _MFI_CAPABILITIES { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t support_fp_remote_lun:1; > u_int32_t support_additional_msix:1; > u_int32_t support_fastpath_wb:1; > @@ -2342,6 +2525,18 @@ typedef union _MFI_CAPABILITIES { > u_int32_t support_ext_queue_depth:1; > u_int32_t support_ext_io_size:1; > u_int32_t reserved:23; > +#else > + u_int32_t reserved:23; > + u_int32_t support_ext_io_size:1; > + u_int32_t support_ext_queue_depth:1; > + u_int32_t security_protocol_cmds_fw:1; > + u_int32_t support_core_affinity:1; > + u_int32_t support_ndrive_r1_lb:1; > + u_int32_t support_max_255lds:1; > + u_int32_t support_fastpath_wb:1; > + u_int32_t support_additional_msix:1; > + u_int32_t support_fp_remote_lun:1; > +#endif > } mfi_capabilities; > u_int32_t reg; > } MFI_CAPABILITIES; > @@ -2602,9 +2797,15 @@ union mrsas_frame { > #pragma pack(1) > union mrsas_evt_class_locale { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t locale; > u_int8_t reserved; > int8_t class; > +#else > + int8_t class; > + u_int8_t reserved; > + u_int16_t locale; > +#endif > } __packed members; > > u_int32_t word; > @@ -2890,6 +3091,7 @@ typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { > typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t linkSpeed:4; > u_int32_t linkWidth:6; > u_int32_t aspmSupport:2; > @@ -2897,6 +3099,15 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { > u_int32_t l1ExitLatency:3; > u_int32_t rsvdp:6; > u_int32_t portNumber:8; > +#else > + u_int32_t portNumber:8; > + u_int32_t rsvdp:6; > + u_int32_t l1ExitLatency:3; > + u_int32_t losExitLatency:3; > + u_int32_t aspmSupport:2; > + u_int32_t linkWidth:6; > + u_int32_t linkSpeed:4; > +#endif > } bits; > > u_int32_t asUlong; > @@ -2908,12 +3119,21 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { > typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t linkSpeed:4; > u_int16_t negotiatedLinkWidth:6; > u_int16_t linkTrainingError:1; > u_int16_t linkTraning:1; > u_int16_t slotClockConfig:1; > u_int16_t rsvdZ:3; > +#else > + u_int16_t rsvdZ:3; > + u_int16_t slotClockConfig:1; > + u_int16_t linkTraning:1; > + u_int16_t linkTrainingError:1; > + u_int16_t negotiatedLinkWidth:6; > + u_int16_t linkSpeed:4; > +#endif > } bits; > > u_int16_t asUshort; > @@ -2967,6 +3187,7 @@ union MR_PD_DDF_TYPE { > struct { > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t forcedPDGUID:1; > u_int16_t inVD:1; > u_int16_t isGlobalSpare:1; > @@ -2974,6 +3195,15 @@ union MR_PD_DDF_TYPE { > u_int16_t isForeign:1; > u_int16_t reserved:7; > u_int16_t intf:4; > +#else > + u_int16_t intf:4; > + u_int16_t reserved:7; > + u_int16_t isForeign:1; > + u_int16_t isSpare:1; > + u_int16_t isGlobalSpare:1; > + u_int16_t inVD:1; > + u_int16_t forcedPDGUID:1; > +#endif > } pdType; > u_int16_t type; > }; > @@ -3004,6 +3234,7 @@ union MR_PROGRESS { > */ > struct MR_PD_PROGRESS { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t rbld:1; > u_int32_t patrol:1; > u_int32_t clear:1; > @@ -3011,6 +3242,15 @@ struct MR_PD_PROGRESS { > u_int32_t erase:1; > u_int32_t locate:1; > u_int32_t reserved:26; > *** 783 LINES SKIPPED *** > From owner-dev-commits-src-main@freebsd.org Thu Feb 4 15:10:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D3D92546226; Thu, 4 Feb 2021 15:10:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWhnd5bNWz4TYH; Thu, 4 Feb 2021 15:10:45 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B2BD65A74; Thu, 4 Feb 2021 15:10:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114FAjO8027601; Thu, 4 Feb 2021 15:10:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114FAjrx027600; Thu, 4 Feb 2021 15:10:45 GMT (envelope-from git) Date: Thu, 4 Feb 2021 15:10:45 GMT Message-Id: <202102041510.114FAjrx027600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: c203bd70b595 - main - Import atf 0.22 snapshot ca73d08c3fc1ecffc1f1c97458c31ab82c12bb01 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c203bd70b5957f85616424b6fa374479372d06e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 15:10:45 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c203bd70b5957f85616424b6fa374479372d06e3 commit c203bd70b5957f85616424b6fa374479372d06e3 Merge: cb7cc72c546e a3330ae73660 Author: Alex Richardson AuthorDate: 2021-02-04 14:48:10 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 15:03:05 +0000 Import atf 0.22 snapshot ca73d08c3fc1ecffc1f1c97458c31ab82c12bb01 This includes improvements to the atf-sh helper functions that significantly reduce the number of spawned processes for each test and therefore speeds up running the testsuite noticeably. contrib/atf/.cirrus.yml | 26 ++++++ contrib/atf/.gitignore | 25 ++++++ contrib/atf/.travis.yml | 25 ++++++ contrib/atf/NEWS | 18 ++++ contrib/atf/README.md | 47 ++++++++++ contrib/atf/atf-c++/atf-c++.3 | 4 +- contrib/atf/atf-c++/detail/test_helpers.hpp | 5 ++ contrib/atf/atf-c++/tests.hpp | 2 +- contrib/atf/atf-c++/utils.cpp | 7 ++ contrib/atf/atf-c++/utils.hpp | 1 + contrib/atf/atf-c++/utils_test.cpp | 1 + contrib/atf/atf-c/.gitignore | 1 + contrib/atf/atf-c/check.c | 3 +- contrib/atf/atf-c/detail/fs_test.c | 9 +- contrib/atf/atf-c/detail/list.c | 2 +- contrib/atf/atf-c/detail/process.c | 3 +- contrib/atf/atf-c/detail/test_helpers.h | 7 ++ contrib/atf/atf-c/tc.c | 116 +++++++++++++++++++------ contrib/atf/atf-c/utils.c | 10 +++ contrib/atf/atf-c/utils.h | 1 + contrib/atf/atf-c/utils_test.c | 1 + contrib/atf/atf-sh/.gitignore | 2 + contrib/atf/atf-sh/atf-check.1 | 15 +++- contrib/atf/atf-sh/atf-check.cpp | 128 +++++++++++++++++++++++++--- contrib/atf/atf-sh/atf-sh.3 | 11 ++- contrib/atf/atf-sh/atf_check_test.sh | 24 ++++++ contrib/atf/atf-sh/libatf-sh.subr | 32 ++++++- contrib/atf/atf-sh/misc_helpers.sh | 48 +++++++++++ contrib/atf/doc/.gitignore | 1 + contrib/atf/doc/atf-test-case.4 | 17 ++-- lib/atf/libatf-c++/tests/Makefile | 2 + 31 files changed, 541 insertions(+), 53 deletions(-) diff --cc contrib/atf/.cirrus.yml index 000000000000,000000000000..fd9b6e4a47df new file mode 100644 --- /dev/null +++ b/contrib/atf/.cirrus.yml @@@ -1,0 -1,0 +1,26 @@@ ++env: ++ CIRRUS_CLONE_DEPTH: 1 ++ ARCH: amd64 ++ ++task: ++ matrix: ++ - name: 13.0-CURRENT ++ freebsd_instance: ++ image_family: freebsd-13-0-snap ++ - name: 12.2-STABLE ++ freebsd_instance: ++ image_family: freebsd-12-2-snap ++ - name: 12.1-RELEASE ++ freebsd_instance: ++ image_family: freebsd-12-1 ++ install_script: ++ - sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf ++ - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ++ - pkg install -y autoconf automake libtool kyua ++ script: ++ - env JUNIT_OUTPUT=$(pwd)/test-results.xml ./admin/travis-build.sh ++ always: ++ junit_artifacts: ++ path: "test-results.xml" ++ type: text/xml ++ format: junit diff --cc contrib/atf/.gitignore index 000000000000,000000000000..396785ce2052 new file mode 100644 --- /dev/null +++ b/contrib/atf/.gitignore @@@ -1,0 -1,0 +1,25 @@@ ++*.la ++*.lo ++*.o ++*.pc ++*_helper ++*_helpers ++*_test ++.deps ++.dirstamp ++.libs ++ ++Makefile ++Makefile.in ++aclocal.m4 ++autom4te.cache ++config.h ++config.h.in ++config.h.in~ ++config.log ++config.status ++configure ++installcheck.log ++libtool ++stamp-h1 ++testsuite.log diff --cc contrib/atf/.travis.yml index 000000000000,1949aae54468..1949aae54468 mode 000000,100644..100644 --- a/contrib/atf/.travis.yml +++ b/contrib/atf/.travis.yml diff --cc contrib/atf/NEWS index f1764e0d9dda,000000000000..671ee81ff6ff mode 100644,000000..100644 --- a/contrib/atf/NEWS +++ b/contrib/atf/NEWS @@@ -1,726 -1,0 +1,744 @@@ +Major changes between releases Automated Testing Framework +=========================================================================== + ++Changes in version 0.22 ++*********************** ++ ++STILL UNDER DEVELOPMENT; NOT RELEASED YET. ++DON'T FORGET TO BUMP THE -version-info PRE-RELEASE IF NECESSARY! ++ ++* Issue #23: Fix double-free triggered by atf_map_insert in low memory ++ scenarios, caused by an overlook in the atf_list code. ++ ++* Issue #29: Fixed various typos and formatting errors in manual pages. ++ ++* Issue #31: Added require.progs metadata properties to the tests that ++ need a compiler to run. ++ ++* Added the atf_check_not_equal function to atf-sh to check for ++ unequal values. ++ ++ +Changes in version 0.21 +*********************** + +Released on October 23rd, 2014. + +* Restored the atf(7) manual page to serve as a reference to all the other + manual pages shipped by ATF. + +* Added the -s flag to atf-sh to support specifying the shell interpreter + to be used. + +* Removed ATF_WORKDIR. The only remaining consumers have been converted to + use the standard TMPDIR environment variable. As a benefit, and because + Kyua forces the TMPDIR to live within the test case's work directory, + any stale files left behind by ATF will be automatically cleaned up. + +* Documented the environment variables recognized by each component in the + relevant manual pages. This information was lost with the atf-config(1) + removal. + +* Added a new "require.diskspace" metadata property to test cases so that + they can specify the minimum amount of disk space required for the test + to run. + +* Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for + discoverability purposes. Symbolic links are provided for the time + being to still make the old names visible. + +* Issue #5: Recommend the (expected, actual) idiom for calls to the test + macros in the manual pages. + +* Issue #7: Stopped catching unhandled exceptions in atf-c++ tests. This + propagates the crash to the caller, which in turn allows it to obtain + proper debugging information. In particular, Kyua should now be able to + extract a stacktrace pinpointing the problem. + +* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang + that ships with FreeBSD 11.0-CURRENT. + +* Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better + explaining how they relate to each other. + +* Issue #14: Stopped setting 'set -e' in atf-sh. This setting was + initially added as a way to enable a "strict" mode in the library and to + make test cases fail fast when they run unprotected commands. However, + doing so in the library is surprising as the responsibility of enabling + 'set -e' should be on the user's code. Also, 'set -e' introduces + inconsistent behavior on subshells and users do not expect that. + +* Issue #15: Fixed atf_utils_{fork,wait} to support nested calls. + +* Issue #16: Fixed test failures (by removing a long-standing hack) on + systems that lack \e support in printf(1). + +* Issue #19: Removed stale references to atf-config and atf-run. + + +Changes in version 0.20 +*********************** + +Experimental version released on February 7th, 2014. + +This is the first release without the code for the deprecated tools. If +you require such code, please fetch a copy of the 0.19 release and extract +the 'tools' directory for your own consumption. + +* Removed the deprecated tools. This includes atf-config, atf-report, + atf-run and atf-version. + +* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang + that ships with FreeBSD 11.0-CURRENT. + + +Changes in version 0.19 +*********************** + +Experimental version released on February 7th, 2014. + +This is the last release to bundle the code for the deprecated tools. +The next release will drop their code and will stop worrying about +backwards compatibility between the ATF libraries and what the old tools +may or may not support. + +If you still require the old tools for some reason, grab a copy of the +'tools' directory now. The code in this directory is standalone and +does not depend on any internal details of atf-c++ any longer. + +* Various fixes and improvements to support running as part of the FreeBSD + test suite. + +* Project hosting moved from Google Code (as a subproject of Kyua) to + GitHub (as a first-class project). The main reason for the change is + the suppression of binary downloads in Google Code on Jan 15th, 2014. + See https://github.com/jmmv/atf/ + +* Removed builtin help from atf-sh(1) and atf-check(1) for simplicity + reasons. In other words, their -h option is gone. + +* Moved the code of the deprecated tools into a 'tools' directory and + completely decoupled their code from the internals of atf-c++. The + reason for this is to painlessly allow a third-party to maintain a + copy of these tools after we delete them because upcoming changes to + atf-c++ would break the stale tools. + + +Changes in version 0.18 +*********************** + +Experimental version released on November 16th, 2013. + +* Issue 45: Added require.memory support in atf-run for FreeBSD. + +* Fixed an issue with the handling of cin with libc++. + +* Issue 64: Fixed various mandoc formatting warnings. + +* NetBSD PR bin/48284: Made atf-check flush its progress message to + stdout so that an interrupted test case always shows the last message + being executed. + +* NetBSD PR bin/48285: Fixed atf_check examples in atf-sh-api(3). + + +Changes in version 0.17 +*********************** + +Experimental version released on February 14th, 2013. + +* Added the atf_utils_cat_file, atf_utils_compare_file, + atf_utils_copy_file, atf_utils_create_file, atf_utils_file_exists, + atf_utils_fork, atf_utils_grep_file, atf_utils_grep_string, + atf_utils_readline, atf_utils_redirect and atf_utils_wait utility + functions to atf-c-api. Documented the already-public + atf_utils_free_charpp function. + +* Added the cat_file, compare_file, copy_file, create_file, file_exists, + fork, grep_collection, grep_file, grep_string, redirect and wait + functions to the atf::utils namespace of atf-c++-api. These are + wrappers around the same functions added to the atf-c-api library. + +* Added the ATF_CHECK_MATCH, ATF_CHECK_MATCH_MSG, ATF_REQUIRE_MATCH and + ATF_REQUIRE_MATCH_MSG macros to atf-c to simplify the validation of a + string against a regular expression. + +* Miscellaneous fixes for manpage typos and compilation problems with + clang. + +* Added caching of the results of those configure tests that rely on + executing a test program. This should help crossbuild systems by + providing a mechanism to pre-specify what the results should be. + +* PR bin/45690: Make atf-report convert any non-printable characters to + a plain-text representation (matching their corresponding hexadecimal + entities) in XML output files. This is to prevent the output of test + cases from breaking xsltproc later. + + +Changes in version 0.16 +*********************** + +Experimental version released on July 10th, 2012. + +* Added a --enable-tools flag to configure to request the build of the + deprecated ATF tools, whose build is now disabled by default. In order + to continue running tests, you should migrate to Kyua instead of enabling + the build of the deprecated tools. The kyua-atf-compat package provides + transitional compatibility versions of atf-run and atf-report built on + top of Kyua. + +* Tweaked the ATF_TEST_CASE macro of atf-c++ so that the compiler can + detect defined but unused test cases. + +* PR bin/45859: Fixed some XSLT bugs that resulted in the tc-time and + tp-time XML tags leaking into the generated HTML file. Also improved + the CSS file slightly to correct alignment and color issues with the + timestamps column. + +* Optimized atf-c++/macros.hpp so that GNU G++ consumes less memory during + compilation with GNU G++. + +* Flipped the default to building shared libraries for atf-c and atf-c++, + and started versioning them. As a side-effect, this removes the + --enable-unstable-shared flag from configure that appears to not work any + more (under NetBSD). Additionally, some distributions require the use of + shared libraries for proper dependency tracking (e.g. Fedora), so it is + better if we do the right versioning upstream. + +* Project hosting moved from an adhoc solution (custom web site and + Monotone repository) to Google Code (standard wiki and Git). ATF now + lives in a subcomponent of the Kyua project. + + +Changes in version 0.15 +*********************** + +Experimental version released on January 16th, 2012. + +* Respect stdin in atf-check. The previous release silenced stdin for any + processes spawned by atf, not only test programs, which caused breakage + in tests that pipe data through atf-check. + +* Performance improvements to atf-sh. + +* Enabled detection of unused parameters and variables in the code and + fixed all warnings. + +* Changed the behavior of "developer mode". Compiler warnings are now + enabled unconditionally regardless of whether we are in developer mode or + not; developer mode is now only used to perform strict warning checks and + to enable assertions. Additionally, developer mode is now only + automatically enabled when building from the repository, not for formal + releases. + +* Added new Autoconf M4 macros (ATF_ARG_WITH, ATF_CHECK_C and + ATF_CHECK_CXX) to provide a consistent way of defining a --with-arg flag + in configure scripts and detecting the presence of any of the ATF + bindings. Note that ATF_CHECK_SH was already introduced in 0.14, but it + has now been modified to also honor --with-atf if instantiated. + +* Added timing support to atf-run / atf-report. + +* Added support for a 'require.memory' property, to specify the minimum + amount of physical memory needed by the test case to yield valid results. + +* PR bin/45690: Force an ISO-8859-1 encoding in the XML files generated by + atf-report so that invalid data in the output of test cases does not + mangle our report. + + +Changes in version 0.14 +*********************** + +Experimental version released on June 14th, 2011. + +* Added a pkg-config file for atf-sh and an aclocal file to ease the + detection of atf-sh from autoconf scripts. + +* Made the default test case body defined by atf_sh fail. This is to + ensure that test cases are properly defined in test programs and helps + in catching typos in the names of the body functions. + +* PR bin/44882: Made atf-run connect the stdin of test cases to /dev/zero. + This provides more consistent results with "normal" execution (in + particular, when tests are executed detached from a terminal). + +* Made atf-run hardcode TZ=UTC for test cases. It used to undefine TZ, but + that does not take into account that libc determines the current timezone + from a configuration file. + +* All test programs will now print a warning when they are not run through + atf-run(1) stating that this is unsupported and may deliver incorrect + results. + +* Added support for the 'require.files' test-case property. This allows + test cases to specify installed files that must be present for the test + case to run. + + +Changes in version 0.13 +*********************** + +Experimental version released on March 31st, 2011. + +This is the first release after the creation of the Kyua project, a more +modular and reliable replacement for ATF. From now on, ATF will change to +accomodate the transition to this new codebase, but ATF will still continue +to see development in the short/medium term. Check out the project page at +http://code.google.com/p/kyua/ for more details. + +The changes in this release are: + +* Added support to run the tests with the Kyua runtime engine (kyua-cli), a + new package that aims to replace atf-run and atf-report. The ATF tests + can be run with the new system by issuing a 'make installcheck-kyua' from + the top-level directory of the project (assuming the 'kyua' binary is + available during the configuration stage of ATF). + +* atf-run and atf-report are now in maintenance mode (but *not* deprecated + yet!). Kyua already implements a new, much more reliable runtime engine + that provides similar features to these tools. That said, it is not + complete yet so all development efforts should go towards it. + +* If GDB is installed, atf-run dumps the stack trace of crashing test + programs in an attempt to aid debugging. Contributed by Antti Kantee. + +* Reverted default timeout change in previous release and reset its value + to 5 minutes. This was causing several issues, specially when running + the existing NetBSD test suite in qemu. + +* Fixed the 'match' output checker in atf-check to properly validate the + last line of a file even if it does not have a newline. + +* Added the ATF_REQUIRE_IN and ATF_REQUIRE_NOT_IN macros to atf-c++ to + check for the presence (or lack thereof) of an element in a collection. + +* PR bin/44176: Fixed a race condition in atf-run that would crash atf-run + when the cleanup of a test case triggered asynchronous modifications to + its work directory (e.g. killing a daemon process that cleans up a pid + file in the work directory). + +* PR bin/44301: Fixed the sample XSLT file to report bogus test programs + instead of just listing them as having 0 test cases. + + +Changes in version 0.12 +*********************** + +Experimental version released on November 7th, 2010. + +* Added the ATF_REQUIRE_THROW_RE to atf-c++, which is the same as + ATF_REQUIRE_THROW but allows checking for the validity of the exception's + error message by means of a regular expression. + +* Added the ATF_REQUIRE_MATCH to atf-c++, which allows checking for a + regular expression match in a string. + +* Changed the default timeout for test cases from 5 minutes to 30 seconds. + 30 seconds is long enough for virtually all tests to complete, and 5 + minutes is a way too long pause in a test suite where a single test case + stalls. + +* Deprecated the use.fs property. While this seemed like a good idea in + the first place to impose more control on what test cases can do, it + turns out to be bad. First, use.fs=false prevents bogus test cases + from dumping core so after-the-fact debugging is harder. Second, + supporting use.fs adds a lot of unnecessary complexity. atf-run will + now ignore any value provided to use.fs and will allow test cases to + freely access the file system if they wish to. + +* Added the atf_tc_get_config_var_as_{bool,long}{,_wd} functions to the atf-c + library. The 'text' module became private in 0.11 but was being used + externally to simplify the parsing of configuration variables. + +* Made atf-run recognize the 'unprivileged-user' configuration variable + and automatically drop root privileges when a test case sets + require.user=unprivileged. Note that this is, by no means, done for + security purposes; this is just for user convenience; tests should, in + general, not be blindly run as root in the first place. + + +Changes in version 0.11 +*********************** + +Experimental version released on October 20th, 2010. + +* The ATF_CHECK* macros in atf-c++ were renamed to ATF_REQUIRE* to match + their counterparts in atf-c. + +* Clearly separated the modules in atf-c that are supposed to be public + from those that are implementation details. The header files for the + internal modules are not installed any more. + +* Made the atf-check tool private. It is only required by atf-sh and being + public has the danger of causing confusion. Also, making it private + simplifies the public API of atf. + +* Changed atf-sh to enable per-command error checking (set -e) by default. + This catches many cases in which a test case is broken but it is not + reported as such because execution continues. + +* Fixed the XSTL and CSS stylesheets to support expected failures. + + +Changes in version 0.10 +*********************** + +Experimental version released on July 2nd, 2010. + +Miscellaneous features + +* Added expected failures support to test cases and atf-run. These + include, for example, expected clean exits, expected reception of fatal + signals, expected timeouts and expected errors in condition checks. + These statuses can be used to denote test cases that are known to fail + due to a bug in the code they are testing. atf-report reports these + tests separately but they do not count towards the failed test cases + amount. + +* Added the ATF_CHECK_ERRNO and ATF_REQUIRE_ERRNO to the C library to + allow easy checking of call failures that update errno. + +* Added the has.cleanup meta-data property to test caes that specifies + whether the test case has a cleanup routine or not; its value is + automatically set. This property is read by atf-run to know if it has to + run the cleanup routine; skipping this run for every test case + significantly speeds up the run time of test suites. + +* Reversed the order of the ATF_CHECK_THROW macro in the C++ binding to + take the expected exception as the first argument and the statement to + execute as the second argument. + +Changes in atf-check + +* Changed atf-check to support negating the status and output checks by + prefixing them with not- and added support to specify multiple checkers + for stdout and stderr, not only one. + +* Added the match output checker to atf-check to look for regular + expressions in the stdout and stderr of commands. + +* Modified the exit checks in atf-check to support checking for the + reception of signals. + +Code simplifications and cleanups + +* Removed usage messages from test programs to simplify the + implementation of every binding by a significant amount. They just now + refer the user to the appropriate manual page and do not attempt to wrap + lines on terminal boundaries. Test programs are not supposed to be run + by users directly so this minor interface regression is not important. + +* Removed the atf-format internal utility, which is unused after the + change documented above. + +* Removed the atf-cleanup internal utility. It has been unused since the + test case isolation was moved to atf-run in 0.8 + +* Splitted the Makefile.am into smaller files for easier maintenance and + dropped the use of M4. Only affects users building from the repository + sources. + +* Intermixed tests with the source files in the source tree to provide + them more visibility and easier access. The tests directory is gone from + the source tree and tests are now suffixed by _test, not prefixed by t_. + +* Simplifications to the atf-c library: removed the io, tcr and ui + modules as they had become unnecessary after all simplifications + introduced since the 0.8 release. + +* Removed the application/X-atf-tcr format introduced in 0.8 release. + Tests now print a much simplified format that is easy to parse and nicer + to read by end users. As a side effect, the default for test cases is + now to print their results to stdout unless otherwise stated by providing + the -r flag. + +* Removed XML distribution documents and replaced them with plain-text + documents. They provided little value and introduced a lot of complexity + to the build system. + +* Simplified the output of atf-version by not attempting to print a + revision number when building form a distfile. Makes the build system + easier to maintain. + + +Changes in version 0.9 +********************** + +Experimental version released on June 3rd, 2010. + +* Added atf-sh, an interpreter to process test programs written using + the shell API. This is not really a shell interpreter by itself though: + it is just a wrapper around the system shell that eases the loading of + the necessary ATF libraries. + +* Removed atf-compile in favour of atf-sh. + +* Added the use.fs metadata property to test case, which is used to + specify which test cases require file system access. This is to + highlight dependencies on external resources more clearly and to speed up + the execution of test suites by skipping the creation of many unnecessary + work directories. + +* Fixed test programs to get a sane default value for their source + directory. This means that it should not be necessary any more to pass + -s when running test programs that do not live in the current directory. + +* Defining test case headers became optional. This is trivial to achieve + in shell-based tests but a bit ugly in C and C++. In C, use the new + ATF_TC_WITHOUT_HEAD macro to define the test case, and in C++ use + ATF_TEST_CASE_WITHOUT_HEAD. + + +Changes in version 0.8 +********************** + +Experimental version released on May 7th, 2010. + +* Test programs no longer run several test cases in a row. The execution + of a test program now requires a test case name, and that single test + case is executed. To execute several test cases, use the atf-run utility + as usual. + +* Test programs no longer fork a subprocess to isolate the execution of + test cases. They run the test case code in-process, and a crash of the + test case will result in a crash of the test program. This is to ease + debugging of faulty test cases. + +* Test programs no longer isolate their test cases. This means that they + will not create temporary directories nor sanitize the environment any + more. Yes: running a test case that depends on system state by hand will + most likely yield different results depending on where (machine, + directory, user environment, etc.) it is run. Isolation has been moved + to atf-run. + +* Test programs no longer print a cryptic format (application/X-atf-tcs) + on a special file channel. They can now print whatever they want on the + screen. Because test programs can now only run one test case every time, + providing controlled output is not necessary any more. + +* Test programs no longer write their status into a special file + descriptor. Instead, they create a file with the results, which is later + parsed by atf-run. This changes the semantics of the -r flag. + +* atf-run has been adjusted to perform the test case isolation. As a + result, there is now a single canonical place that implements the + isolation of test caes. In previous releases, the three language + bindings (C, C++ and shell) had to be kept in sync with each other (read: + not a nice thing to do at all). As a side effect of this change, writing + bindings for other languages will be much, much easier from now on. + +* atf-run forks test programs on a test case basis, instead of on a test + program basis as it did before. This is to provide the test case + isolation that was before implemented by the test programs themselves. + +* Removed the atf-exec tool. This was used to implement test case + isolation in atf-sh, but it is now unnecessary. + +* It is now optional to define the descr meta-data property. It has been + proven to be mostly useless, because test cases often carry a descriptive + name of their own. + + +Changes in version 0.7 +********************** + +Experimental version released on December 22nd, 2009. + +* Added build-time checks to atf-c and atf-c++. A binding for atf-sh + will come later. + +* Migrated all build-time checks for header files to proper ATF tests. + This demonstrates the use of the new feature described above. + +* Added an internal API for child process management. + +* Converted all plain-text distribution documents to a Docbook canonical + version, and include pre-generated plain text and HTML copies in the + distribution file. + +* Simplified the contents of the Makefile.am by regenerating it from a + canonical Makefile.am.m4 source. As a side-effect, some dependency + specifications were fixed. + +* Migrated all checks from the check target to installcheck, as these + require ATF to be installed. + +* Fixed sign comparison mismatches triggered by the now-enabled + -Wsign-compare. + +* Fixed many memory and object leaks. + + +Changes in version 0.6 +********************** + +Experimental version released on January 18th, 2009. + +* Make atf-exec be able to kill its child process after a certain period + of time; this is controlled through the new -t option. + +* Change atf-sh to use atf-exec's -t option to control the test case's + timeouts, instead of doing it internally. Same behavior as before, but + noticeably faster. + +* atf-exec's -g option and atf-killpg are gone due to the previous + change. + +* Added the atf-check(1) tool, a program that executes a given command + and checks its exit code against a known value and allows the management + of stdout and stderr in multiple ways. This replaces the previous + atf_check function in the atf-sh library and exposes this functionality + to both atf-c and atf-c++. + +* Added the ATF_REQUIRE family of macros to the C interface. These help + in checking for fatal test conditions. The old ATF_CHECK macros now + perform non-fatal checks only. I.e. by using ATF_CHECK, the test case + can now continue its execution and the failures will not be reported + until the end of the whole run. + +* Extended the amount of ATF_CHECK_* C macros with new ones to provide + more features to the developer. These also have their corresponding + counterparts in the ATF_REQUIRE_* family. The new macros (listing the + suffixes only) are: _EQ (replaces _EQUAL), _EQ_MSG, _STREQ and + _STREQ_MSG. + + +Changes in version 0.5 +********************** + +Experimental version released on May 1st, 2008. + +* Clauses 3 and 4 of the BSD license used by the project were dropped. + All the code is now under a 2-clause BSD license compatible with the GNU + General Public License (GPL). + +* Added a C-only binding so that binary test programs do not need to be + tied to C++ at all. This binding is now known as the atf-c library. + +* Renamed the C++ binding to atf-c++ for consistency with the new atf-c. + +* Renamed the POSIX shell binding to atf-sh for consistency with the new + atf-c and atf-c++. + +* Added a -w flag to test programs through which it is possible to + specify the work directory to be used. This was possible in prior + releases by defining the workdir configuration variable (-v workdir=...), + but was a conceptually incorrect mechanism. + +* Test programs now preserve the execution order of test cases when they + are given in the command line. Even those mentioned more than once are + executed multiple times to comply with the user's requests. + + +Changes in version 0.4 +********************** + +Experimental version released on February 4th, 2008. + +* Added two new manual pages, atf-c++-api and atf-sh-api, describing the + C++ and POSIX shell interfaces used to write test programs. + +* Added a pkg-config file, useful to get the flags to build against the + C++ library or to easily detect the presence of ATF. + +* Added a way for test cases to require a specific architecture and/or + machine type through the new 'require.arch' and 'require.machine' + meta-data properties, respectively. + +* Added the 'timeout' property to test cases, useful to set an + upper-bound limit for the test's run time and thus prevent global test + program stalls due to the test case's misbehavior. + +* Added the atf-exec(1) internal utility, used to execute a command + after changing the process group it belongs to. + +* Added the atf-killpg(1) internal utility, used to kill process groups. + +* Multiple portability fixes. Of special interest, full support for + SunOS (Solaris Express Developer Edition 2007/09) using the Sun Studio 12 + C++ compiler. + +* Fixed a serious bug that prevented atf-run(1) from working at all + under Fedora 8 x86_64. Due to the nature of the bug, other platforms + were likely affected too. + + +Changes in version 0.3 +********************** + +Experimental version released on November 11th, 2007. + +* Added XML output support to atf-report. This is accompanied by a DTD + for the format's structure and sample XSLT/CSS files to post-process this + output and convert it to a plain HTML report. + +* Changed atf-run to add system information to the report it generates. + This is currently used by atf-report's XML output only, and is later + printed in the HTML reports in a nice and useful summary table. The user + and system administrator are allowed to tune this feature by means of + hooks. + +* Removed the test cases' 'isolated' property. This was intended to + avoid touching the file system at all when running the related test case, + but this has not been true for a long while: some control files are + unconditionally required for several purposes, and we cannot easily get + rid of them. This way we remove several critical and delicate pieces of + code. + +* Improved atf-report's CSV output format to include information about + test programs too. + +* Fixed the tests that used atf-compile to not require this tool as a + helper. Avoids systems without build-time utilities to skip many tests + that could otherwise be run. (E.g. NetBSD without the comp.tgz set + installed.) + +* Many general cleanups: Fixed many pieces of code marked as ugly and/or + incomplete. + + +Changes in version 0.2 +********************** + +Experimental version released on September 20th, 2007. + +* Test cases now get a known umask on entry. + +* atf-run now detects many unexpected failures caused by test programs and + reports them as bogus tests. atf-report is able to handle these new + errors and nicely reports them to the user. + +* All the data formats read and written by the tools have been + documented and cleaned up. These include those grammars that define how + the different components communicate with each other as well as the + format of files written by the developers and users: the Atffiles and the + configuration files. + +* Added the atf-version tool, a utility that displays information about + the currently installed version of ATF. + +* Test cases can now define an optional cleanup routine to undo their + actions regardless of their exit status. + +* atf-report now summarizes the list of failed (bogus) test programs + when using the ticker output format. + +* Test programs now capture some termination signals and clean up any + temporary files before exiting the program. + +* Multiple bug fixes and improvements all around. + + +Changes in version 0.1 +********************** + +Experimental version released on August 20th, 2007. + +* First public version. This was released coinciding with the end of the + Google Summer of Code 2007 program. + + +=========================================================================== +vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2 diff --cc contrib/atf/README.md index 000000000000,000000000000..d245552f35c9 new file mode 100644 --- /dev/null +++ b/contrib/atf/README.md @@@ -1,0 -1,0 +1,47 @@@ ++# Welcome to the ATF project! ++ ++ATF, or Automated Testing Framework, is a **collection of libraries** to ++write test programs in **C, C++ and POSIX shell**. ++ ++The ATF libraries offer a simple API. The API is orthogonal through the ++various bindings, allowing developers to quickly learn how to write test ++programs in different languages. ++ ++ATF-based test programs offer a **consistent end-user command-line ++interface** to allow both humans and automation to run the tests. ++ ++ATF-based test programs **rely on an execution engine** to be run and ++this execution engine is *not* shipped with ATF. ++**[Kyua](https://github.com/jmmv/kyua/) is the engine of choice.** ++ ++## Download ++ ++Formal releases for source files are available for download from GitHub: ++ ++* [atf 0.20](../../releases/tag/atf-0.20), released on February 7th, 2014. ++ ++## Installation ++ ++You are encouraged to install binary packages for your operating system ++wherever available: ++ ++* Fedora 20 and above: install the `atf` package with `yum install atf`. ++ ++* FreeBSD 10.0 and above: install the `atf` package with `pkg install atf`. ++ ++* NetBSD with pkgsrc: install the `pkgsrc/devel/atf` package. ++ ++* OpenBSD: install the `devel/atf` package with `pkg_add atf`. ++ ++Should you want to build and install ATF from the source tree provided ++here, follow the instructions in the [INSTALL file](INSTALL). ++ ++## Support ++ ++Please use the ++[atf-discuss mailing list](https://groups.google.com/forum/#!forum/atf-discuss) ++for any support inquiries related to `atf-c`, `atf-c++` or `atf-sh`. ++ ++If you have any questions on Kyua proper, please use the ++[kyua-discuss mailing list](https://groups.google.com/forum/#!forum/kyua-discuss) ++instead. diff --cc contrib/atf/atf-c++/atf-c++.3 index 601efaf6fd5b,000000000000..fead776755af mode 100644,000000..100644 --- a/contrib/atf/atf-c++/atf-c++.3 +++ b/contrib/atf/atf-c++/atf-c++.3 @@@ -1,649 -1,0 +1,649 @@@ +.\" Copyright (c) 2008 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +.Dd March 6, 2017 +.Dt ATF-C++ 3 +.Os +.Sh NAME +.Nm atf-c++ , +.Nm ATF_ADD_TEST_CASE , +.Nm ATF_CHECK_ERRNO , +.Nm ATF_FAIL , +.Nm ATF_INIT_TEST_CASES , +.Nm ATF_PASS , +.Nm ATF_REQUIRE , +.Nm ATF_REQUIRE_EQ , +.Nm ATF_REQUIRE_ERRNO , +.Nm ATF_REQUIRE_IN , +.Nm ATF_REQUIRE_MATCH , +.Nm ATF_REQUIRE_NOT_IN , +.Nm ATF_REQUIRE_THROW , +.Nm ATF_REQUIRE_THROW_RE , +.Nm ATF_SKIP , +.Nm ATF_TEST_CASE , +.Nm ATF_TEST_CASE_BODY , +.Nm ATF_TEST_CASE_CLEANUP , +.Nm ATF_TEST_CASE_HEAD , +.Nm ATF_TEST_CASE_NAME , +.Nm ATF_TEST_CASE_USE , +.Nm ATF_TEST_CASE_WITH_CLEANUP , +.Nm ATF_TEST_CASE_WITHOUT_HEAD , +.Nm atf::utils::cat_file , +.Nm atf::utils::compare_file , +.Nm atf::utils::copy_file , +.Nm atf::utils::create_file , +.Nm atf::utils::file_exists , +.Nm atf::utils::fork , +.Nm atf::utils::grep_collection , +.Nm atf::utils::grep_file , +.Nm atf::utils::grep_string , *** 2340 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Feb 4 17:58:12 2021 Return-Path: Delivered-To: dev-commits-src-main@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 39B2052A41E; Thu, 4 Feb 2021 17:58:12 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWmVr0w7Nz4ggP; Thu, 4 Feb 2021 17:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 125A710330; Thu, 4 Feb 2021 17:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114HwC8c042229; Thu, 4 Feb 2021 17:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HwChc042228; Thu, 4 Feb 2021 17:58:12 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:58:12 GMT Message-Id: <202102041758.114HwChc042228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 58de61b9967b - main - sbin/pfctl: fix tests after recent output changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58de61b9967b36f5fbd34e8b51ece7b4b772f104 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 17:58:12 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=58de61b9967b36f5fbd34e8b51ece7b4b772f104 commit 58de61b9967b36f5fbd34e8b51ece7b4b772f104 Author: Alex Richardson AuthorDate: 2021-02-04 17:56:26 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 17:56:26 +0000 sbin/pfctl: fix tests after recent output changes The output now contains http-alt instead of 8080 and personal-agent instead of 5555. This was probably caused by 228e2087a32847fa51168f3f0c58f931cb2cb0f8. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28481 --- sbin/pfctl/tests/files/pf0089.ok | 2 +- sbin/pfctl/tests/files/pf0096.ok | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/tests/files/pf0089.ok b/sbin/pfctl/tests/files/pf0089.ok index 1f80e22b92b8..c2403e775da1 100644 --- a/sbin/pfctl/tests/files/pf0089.ok +++ b/sbin/pfctl/tests/files/pf0089.ok @@ -8,4 +8,4 @@ pass in on lo1000001 inet proto tcp from any to 10.0.0.1 port = ssh flags S/SA k pass in on lo1000001 inet proto tcp from any to 10.0.0.2 port = ssh flags S/SA keep state (source-track rule, max-src-conn 10) pass in on lo1000001 inet proto tcp from any to 10.0.0.3 port = ssh flags S/SA keep state (source-track rule, max-src-conn-rate 3/99, src.track 99) pass in on lo1000000 inet proto tcp from any to 10.0.0.1 port = http flags S/SA modulate state (source-track rule, max-src-conn 100, max-src-conn-rate 10/5, overload flush, src.track 5) -pass in on lo1000000 inet proto tcp from any to 10.0.0.1 port = 8080 flags S/SA synproxy state (source-track rule, max-src-conn 1000, max-src-conn-rate 1000/5, overload flush global, src.track 5) +pass in on lo1000000 inet proto tcp from any to 10.0.0.1 port = http-alt flags S/SA synproxy state (source-track rule, max-src-conn 1000, max-src-conn-rate 1000/5, overload flush global, src.track 5) diff --git a/sbin/pfctl/tests/files/pf0096.ok b/sbin/pfctl/tests/files/pf0096.ok index e1d9efe31f93..df7af0a3a157 100644 --- a/sbin/pfctl/tests/files/pf0096.ok +++ b/sbin/pfctl/tests/files/pf0096.ok @@ -1,5 +1,5 @@ myports = "5555 6666" moreports = "5555 6666 7777" -pass in proto tcp from any to any port = 5555 flags S/SA keep state +pass in proto tcp from any to any port = personal-agent flags S/SA keep state pass in proto tcp from any to any port = 6666 flags S/SA keep state pass in proto tcp from any to any port = 7777 flags S/SA keep state From owner-dev-commits-src-main@freebsd.org Thu Feb 4 17:58:13 2021 Return-Path: Delivered-To: dev-commits-src-main@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 762F152A1CE; Thu, 4 Feb 2021 17:58:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWmVs1mR6z4ggQ; Thu, 4 Feb 2021 17:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2D9287EE2; Thu, 4 Feb 2021 17:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114HwDjH042248; Thu, 4 Feb 2021 17:58:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HwDFw042247; Thu, 4 Feb 2021 17:58:13 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:58:13 GMT Message-Id: <202102041758.114HwDFw042247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 72692dfdfe7b - main - usr.bin/jail: Fix tests when using kyua -v parallelism=N MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72692dfdfe7b4ffd894afd67959651ca1b01a105 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 17:58:13 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=72692dfdfe7b4ffd894afd67959651ca1b01a105 commit 72692dfdfe7b4ffd894afd67959651ca1b01a105 Author: Alex Richardson AuthorDate: 2021-02-04 17:56:54 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 17:56:55 +0000 usr.bin/jail: Fix tests when using kyua -v parallelism=N These tests create jails with the same name, so they cannot be run in parallel. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28482 --- usr.sbin/jail/tests/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/jail/tests/Makefile b/usr.sbin/jail/tests/Makefile index 24c0c6c05194..216a5a581980 100644 --- a/usr.sbin/jail/tests/Makefile +++ b/usr.sbin/jail/tests/Makefile @@ -5,5 +5,7 @@ PACKAGE= tests ATF_TESTS_SH+= jail_basic_test ${PACKAGE}FILES+= commands.jail.conf +# The different test cases create jails with the same name. +TEST_METADATA+= is_exclusive="true" .include From owner-dev-commits-src-main@freebsd.org Thu Feb 4 17:58:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 BCA7C52A499; Thu, 4 Feb 2021 17:58:14 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWmVt3D0yz4gWm; Thu, 4 Feb 2021 17:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 51C6A10434; Thu, 4 Feb 2021 17:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114HwEvH042270; Thu, 4 Feb 2021 17:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HwEte042269; Thu, 4 Feb 2021 17:58:14 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:58:14 GMT Message-Id: <202102041758.114HwEte042269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 1eec5861d52e - main - tests/sys/vfs/lookup_cap_dotdot: No longer aborts after ATF update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1eec5861d52e074bc20d08aef051af59cc70040e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 17:58:14 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1eec5861d52e074bc20d08aef051af59cc70040e commit 1eec5861d52e074bc20d08aef051af59cc70040e Author: Alex Richardson AuthorDate: 2021-02-04 17:48:29 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 17:57:27 +0000 tests/sys/vfs/lookup_cap_dotdot: No longer aborts after ATF update It appears this test no longer fails after c203bd70b5957f85616424b6fa374479372d06e3. PR: 215690 --- tests/sys/vfs/lookup_cap_dotdot.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/sys/vfs/lookup_cap_dotdot.c b/tests/sys/vfs/lookup_cap_dotdot.c index 6363471d55ff..dee1e0b11780 100644 --- a/tests/sys/vfs/lookup_cap_dotdot.c +++ b/tests/sys/vfs/lookup_cap_dotdot.c @@ -80,6 +80,7 @@ check_capsicum(void) { ATF_REQUIRE_FEATURE("security_capabilities"); ATF_REQUIRE_FEATURE("security_capability_mode"); + ATF_REQUIRE_SYSCTL_INT("kern.trap_enotcap", 0); } /* @@ -124,8 +125,6 @@ ATF_TC_BODY(lookup_cap_dotdot__basic, tc) cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - ATF_REQUIRE(cap_enter() >= 0); ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s", @@ -146,8 +145,6 @@ ATF_TC_BODY(lookup_cap_dotdot__advanced, tc) check_capsicum(); prepare_dotdot_tests(); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); @@ -191,8 +188,6 @@ ATF_TC_BODY(capmode__negative, tc) check_capsicum(); prepare_dotdot_tests(); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - ATF_REQUIRE(cap_enter() == 0); /* open() not permitted in capability mode */ @@ -231,8 +226,6 @@ ATF_TC_BODY(lookup_cap_dotdot__negative, tc) cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - ATF_REQUIRE(cap_enter() >= 0); ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0); From owner-dev-commits-src-main@freebsd.org Thu Feb 4 18:55:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A949452BE1D; Thu, 4 Feb 2021 18:55:44 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWnnD3W58z4mHn; Thu, 4 Feb 2021 18:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 6B0F610F3F; Thu, 4 Feb 2021 18:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114Iti7T020378; Thu, 4 Feb 2021 18:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114Itiod020377; Thu, 4 Feb 2021 18:55:44 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:55:44 GMT Message-Id: <202102041855.114Itiod020377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Stone Subject: git: b58cf1cb35ab - main - Fix race condition in linuxkpi workqueue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rstone X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b58cf1cb35abc095d7fb9773630794b38bbc6b1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 18:55:44 -0000 The branch main has been updated by rstone: URL: https://cgit.FreeBSD.org/src/commit/?id=b58cf1cb35abc095d7fb9773630794b38bbc6b1d commit b58cf1cb35abc095d7fb9773630794b38bbc6b1d Author: Ryan Stone AuthorDate: 2021-01-07 17:25:56 +0000 Commit: Ryan Stone CommitDate: 2021-02-04 18:54:53 +0000 Fix race condition in linuxkpi workqueue Consider the following scenario: 1. A delayed_work struct in the WORK_ST_TIMER state. 2. Thread A calls mod_delayed_work() 3. Thread B (a callout thread) simultaneously calls linux_delayed_work_timer_fn() The following sequence of events is possible: A: Call linux_cancel_delayed_work() A: Change state from TIMER TO CANCEL B: Change state from CANCEL to TASK B: taskqueue_enqueue() the task A: taskqueue_cancel() the task A: Call linux_queue_delayed_work_on(). This is a no-op because the state is WORK_ST_TASK. As a result, the delayed_work struct will never be invoked. This is causing address resolution in ib_addr.c to stop permanently, as it never tries to reschedule a task that it thinks is already scheduled. Fix this by introducing locking into the cancel path (which corresponds with the lock held while the callout runs). This will prevent the callout from changing the state of the task until the cancel is complete, preventing the race. Differential Revision: https://reviews.freebsd.org/D28420 Reviewed by: hselasky MFC after: 2 months --- sys/compat/linuxkpi/common/src/linux_work.c | 49 ++++++++++++++++------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_work.c b/sys/compat/linuxkpi/common/src/linux_work.c index 45025378baa9..f9cf62928760 100644 --- a/sys/compat/linuxkpi/common/src/linux_work.c +++ b/sys/compat/linuxkpi/common/src/linux_work.c @@ -435,13 +435,17 @@ linux_cancel_delayed_work(struct delayed_work *dwork) [WORK_ST_CANCEL] = WORK_ST_CANCEL, /* NOP */ }; struct taskqueue *tq; + bool cancelled; + mtx_lock(&dwork->timer.mtx); switch (linux_update_state(&dwork->work.state, states)) { case WORK_ST_TIMER: case WORK_ST_CANCEL: - if (linux_cancel_timer(dwork, 0)) { + cancelled = (callout_stop(&dwork->timer.callout) == 1); + if (cancelled) { atomic_cmpxchg(&dwork->work.state, WORK_ST_CANCEL, WORK_ST_IDLE); + mtx_unlock(&dwork->timer.mtx); return (true); } /* FALLTHROUGH */ @@ -450,10 +454,12 @@ linux_cancel_delayed_work(struct delayed_work *dwork) if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) == 0) { atomic_cmpxchg(&dwork->work.state, WORK_ST_CANCEL, WORK_ST_IDLE); + mtx_unlock(&dwork->timer.mtx); return (true); } /* FALLTHROUGH */ default: + mtx_unlock(&dwork->timer.mtx); return (false); } } @@ -475,37 +481,36 @@ linux_cancel_delayed_work_sync(struct delayed_work *dwork) }; struct taskqueue *tq; bool retval = false; + int ret, state; + bool cancelled; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_cancel_delayed_work_sync() might sleep"); -retry: - switch (linux_update_state(&dwork->work.state, states)) { + mtx_lock(&dwork->timer.mtx); + + state = linux_update_state(&dwork->work.state, states); + switch (state) { case WORK_ST_IDLE: + mtx_unlock(&dwork->timer.mtx); return (retval); - case WORK_ST_EXEC: - tq = dwork->work.work_queue->taskqueue; - if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) != 0) - taskqueue_drain(tq, &dwork->work.work_task); - goto retry; /* work may have restarted itself */ case WORK_ST_TIMER: case WORK_ST_CANCEL: - if (linux_cancel_timer(dwork, 1)) { - /* - * Make sure taskqueue is also drained before - * returning: - */ - tq = dwork->work.work_queue->taskqueue; - taskqueue_drain(tq, &dwork->work.work_task); - retval = true; - goto retry; - } - /* FALLTHROUGH */ + cancelled = (callout_stop(&dwork->timer.callout) == 1); + + tq = dwork->work.work_queue->taskqueue; + ret = taskqueue_cancel(tq, &dwork->work.work_task, NULL); + mtx_unlock(&dwork->timer.mtx); + + callout_drain(&dwork->timer.callout); + taskqueue_drain(tq, &dwork->work.work_task); + return (cancelled || (ret != 0)); default: tq = dwork->work.work_queue->taskqueue; - if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) != 0) + ret = taskqueue_cancel(tq, &dwork->work.work_task, NULL); + mtx_unlock(&dwork->timer.mtx); + if (ret != 0) taskqueue_drain(tq, &dwork->work.work_task); - retval = true; - goto retry; + return (ret != 0); } } From owner-dev-commits-src-main@freebsd.org Thu Feb 4 18:58:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2525B52C122; Thu, 4 Feb 2021 18:58:31 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWnrR0Xczz4mRm; Thu, 4 Feb 2021 18:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 054801123B; Thu, 4 Feb 2021 18:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114IwURA020892; Thu, 4 Feb 2021 18:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114IwUHP020891; Thu, 4 Feb 2021 18:58:30 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:58:30 GMT Message-Id: <202102041858.114IwUHP020891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Stone Subject: git: 8a06ca2f734c - main - Fix mismerge in OFED update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rstone X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a06ca2f734c726799688d65a7dad67284275438 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 18:58:31 -0000 The branch main has been updated by rstone: URL: https://cgit.FreeBSD.org/src/commit/?id=8a06ca2f734c726799688d65a7dad67284275438 commit 8a06ca2f734c726799688d65a7dad67284275438 Author: Ryan Stone AuthorDate: 2021-01-29 20:48:50 +0000 Commit: Ryan Stone CommitDate: 2021-02-04 18:58:24 +0000 Fix mismerge in OFED update When OFED was upgraded to Linux v4.9, a bunch of Linux-specific netlink changes were dropped. Unfortunately, there was a mismerge in this process and as a result ib_sa_cancel_query() would fail to cancel an outstanding MAD. This was causing rdma_destroy_id() to hang indefinitely waiting for the MAD to complete and release the final reference. Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D28421 Reviewed by: hselasky, kib MFC after: 2 months --- sys/ofed/drivers/infiniband/core/ib_sa_query.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/ofed/drivers/infiniband/core/ib_sa_query.c b/sys/ofed/drivers/infiniband/core/ib_sa_query.c index cd3ffe667716..2b19e42020d2 100644 --- a/sys/ofed/drivers/infiniband/core/ib_sa_query.c +++ b/sys/ofed/drivers/infiniband/core/ib_sa_query.c @@ -622,6 +622,8 @@ void ib_sa_cancel_query(int id, struct ib_sa_query *query) agent = query->port->agent; mad_buf = query->mad_buf; spin_unlock_irqrestore(&idr_lock, flags); + + ib_cancel_mad(agent, mad_buf); } EXPORT_SYMBOL(ib_sa_cancel_query); From owner-dev-commits-src-main@freebsd.org Thu Feb 4 21:08:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F413D52F3CE; Thu, 4 Feb 2021 21:08:33 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWrkT6VS7z4vMN; Thu, 4 Feb 2021 21:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D011F12B8F; Thu, 4 Feb 2021 21:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114L8XmD090492; Thu, 4 Feb 2021 21:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114L8Xri090491; Thu, 4 Feb 2021 21:08:33 GMT (envelope-from git) Date: Thu, 4 Feb 2021 21:08:33 GMT Message-Id: <202102042108.114L8Xri090491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: aa77662373e3 - main - Add a comment notifying that "device axp" requires miibus for build. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa77662373e378c05dfe9ce328be60bd792b5354 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 21:08:34 -0000 The branch main has been updated by bofh (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=aa77662373e378c05dfe9ce328be60bd792b5354 commit aa77662373e378c05dfe9ce328be60bd792b5354 Author: Muhammad Moinur Rahman AuthorDate: 2021-02-04 21:05:47 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2021-02-04 21:05:47 +0000 Add a comment notifying that "device axp" requires miibus for build. Although if RJ-45 interface is not being used the miibus is not required but miibus is a build time dependency. Reviewed by: imp, manu, rajesh1.kumar@amd.com Approved by: imp, manu, rajesh1.kumar@amd.com Differential Revision: https://reviews.freebsd.org/D28465 --- sys/amd64/conf/GENERIC | 2 +- sys/amd64/conf/NOTES | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 9f55a935f8a5..387128f7cba8 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -251,7 +251,7 @@ device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function device ice # Intel 800 Series Physical Function device vmx # VMware VMXNET3 Ethernet -device axp # AMD EPYC integrated NIC +device axp # AMD EPYC integrated NIC (requires miibus) # PCI Ethernet NICs. device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index a1691f66a4cb..60d171721cf1 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -309,6 +309,8 @@ device cpufreq # vmx: VMware VMXNET3 Ethernet (BSD open source) # wpi: Intel 3945ABG Wireless LAN controller # Requires the wpi firmware module +# axp: AMD EPYC integrated NIC +# Requires the miibus module device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE options ED_3C503 From owner-dev-commits-src-main@freebsd.org Thu Feb 4 21:30:06 2021 Return-Path: Delivered-To: dev-commits-src-main@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 ED20C52F76A; Thu, 4 Feb 2021 21:30:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWsCL6LJhz3C43; Thu, 4 Feb 2021 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 CCA6C1320A; Thu, 4 Feb 2021 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114LU6gU018594; Thu, 4 Feb 2021 21:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114LU6Vk018591; Thu, 4 Feb 2021 21:30:06 GMT (envelope-from git) Date: Thu, 4 Feb 2021 21:30:06 GMT Message-Id: <202102042130.114LU6Vk018591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 2bd4ff2d8911 - main - loader.efi: There are systems without ConOut, also use ConOutDev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bd4ff2d8911009283e4e615ca4aad35a845f48b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 21:30:07 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=2bd4ff2d8911009283e4e615ca4aad35a845f48b commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b Author: Toomas Soome AuthorDate: 2021-02-04 20:49:02 +0000 Commit: Toomas Soome CommitDate: 2021-02-04 21:29:38 +0000 loader.efi: There are systems without ConOut, also use ConOutDev Conout does contian the default output device name. ConOutDev does contain all possible output device names, so we can use it as fallback, when there is no ConOut. PR: 253253 --- stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index ca41cd4a2610..32b278950745 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -735,6 +735,8 @@ parse_uefi_con_out(void) how = 0; sz = sizeof(buf); rv = efi_global_getenv("ConOut", buf, &sz); + if (rv != EFI_SUCCESS) + rv = efi_global_getenv("ConOutDev", buf, &sz); if (rv != EFI_SUCCESS) { /* If we don't have any ConOut default to serial */ how = RB_SERIAL; From owner-dev-commits-src-main@freebsd.org Thu Feb 4 23:33:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9E01D5334AA; Thu, 4 Feb 2021 23:33:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWvy63l1Tz3N2m; Thu, 4 Feb 2021 23:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 1FB6B14966; Thu, 4 Feb 2021 23:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 114NXoh8086994; Thu, 4 Feb 2021 23:33:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114NXowE086993; Thu, 4 Feb 2021 23:33:50 GMT (envelope-from git) Date: Thu, 4 Feb 2021 23:33:50 GMT Message-Id: <202102042333.114NXowE086993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 7d4dceec1030 - main - ixl(4): Fix VLAN HW filtering MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d4dceec103039e2b2fa90793ceeb71a8d6684aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2021 23:33:50 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d4dceec103039e2b2fa90793ceeb71a8d6684aa commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa Author: Krzysztof Galazka AuthorDate: 2021-02-03 23:22:55 +0000 Commit: Eric Joyner CommitDate: 2021-02-04 23:33:42 +0000 ixl(4): Fix VLAN HW filtering X700 family of controllers has limited number of available VLAN HW filters. Driver did not handle properly a case when user assigned more VLANs to the interface which had all filters already in use. Fix that by disabling HW filtering when it is impossible to create filters for all requested VLANs. Keep track of registered VLANs using bitstring to be able to re-enable HW filtering when number of requested VLANs drops below the limit. Also switch all allocations to use M_IXL malloc type to ease detecting memory leaks in the driver. Reviewed by: erj Tested by: gowtham.kumar.ks@intel.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28137 --- sys/dev/ixl/i40e_osdep.c | 4 +- sys/dev/ixl/iavf.h | 7 + sys/dev/ixl/iavf_vc.c | 20 +- sys/dev/ixl/if_iavf.c | 20 +- sys/dev/ixl/if_ixl.c | 81 ++++--- sys/dev/ixl/ixl.h | 49 ++-- sys/dev/ixl/ixl_iw.c | 8 +- sys/dev/ixl/ixl_pf.h | 19 +- sys/dev/ixl/ixl_pf_iflib.c | 37 +-- sys/dev/ixl/ixl_pf_iov.c | 4 +- sys/dev/ixl/ixl_pf_main.c | 551 ++++++++++++++++++++++++++++++--------------- 11 files changed, 487 insertions(+), 313 deletions(-) diff --git a/sys/dev/ixl/i40e_osdep.c b/sys/dev/ixl/i40e_osdep.c index df6848dff3f2..20eb02c85d67 100644 --- a/sys/dev/ixl/i40e_osdep.c +++ b/sys/dev/ixl/i40e_osdep.c @@ -51,14 +51,14 @@ i40e_dmamap_cb(void *arg, bus_dma_segment_t * segs, int nseg, int error) i40e_status i40e_allocate_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size) { - mem->va = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); + mem->va = malloc(size, M_IXL, M_NOWAIT | M_ZERO); return (mem->va == NULL); } i40e_status i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem) { - free(mem->va, M_DEVBUF); + free(mem->va, M_IXL); mem->va = NULL; return (I40E_SUCCESS); diff --git a/sys/dev/ixl/iavf.h b/sys/dev/ixl/iavf.h index e2a546f450d4..9a7716c5e5a2 100644 --- a/sys/dev/ixl/iavf.h +++ b/sys/dev/ixl/iavf.h @@ -43,6 +43,13 @@ #define IAVF_MAX_QUEUES 16 #define IAVF_AQ_TIMEOUT (1 * hz) +/* MacVlan Flags */ +#define IAVF_FILTER_USED (u16)(1 << 0) +#define IAVF_FILTER_VLAN (u16)(1 << 1) +#define IAVF_FILTER_ADD (u16)(1 << 2) +#define IAVF_FILTER_DEL (u16)(1 << 3) +#define IAVF_FILTER_MC (u16)(1 << 4) + #define IAVF_FLAG_AQ_ENABLE_QUEUES (u32)(1 << 0) #define IAVF_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) #define IAVF_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) diff --git a/sys/dev/ixl/iavf_vc.c b/sys/dev/ixl/iavf_vc.c index 2a77f390faaa..ed9cc8432438 100644 --- a/sys/dev/ixl/iavf_vc.c +++ b/sys/dev/ixl/iavf_vc.c @@ -456,7 +456,7 @@ iavf_add_vlans(struct iavf_sc *sc) /* Get count of VLAN filters to add */ SLIST_FOREACH(f, sc->vlan_filters, next) { - if (f->flags & IXL_FILTER_ADD) + if (f->flags & IAVF_FILTER_ADD) cnt++; } @@ -484,9 +484,9 @@ iavf_add_vlans(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH_SAFE(f, sc->vlan_filters, next, ftmp) { - if (f->flags & IXL_FILTER_ADD) { + if (f->flags & IAVF_FILTER_ADD) { bcopy(&f->vlan, &v->vlan_id[i], sizeof(u16)); - f->flags = IXL_FILTER_USED; + f->flags = IAVF_FILTER_USED; i++; } if (i == cnt) @@ -514,7 +514,7 @@ iavf_del_vlans(struct iavf_sc *sc) /* Get count of VLAN filters to delete */ SLIST_FOREACH(f, sc->vlan_filters, next) { - if (f->flags & IXL_FILTER_DEL) + if (f->flags & IAVF_FILTER_DEL) cnt++; } @@ -542,7 +542,7 @@ iavf_del_vlans(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH_SAFE(f, sc->vlan_filters, next, ftmp) { - if (f->flags & IXL_FILTER_DEL) { + if (f->flags & IAVF_FILTER_DEL) { bcopy(&f->vlan, &v->vlan_id[i], sizeof(u16)); i++; SLIST_REMOVE(sc->vlan_filters, f, iavf_vlan_filter, next); @@ -575,7 +575,7 @@ iavf_add_ether_filters(struct iavf_sc *sc) /* Get count of MAC addresses to add */ SLIST_FOREACH(f, sc->mac_filters, next) { - if (f->flags & IXL_FILTER_ADD) + if (f->flags & IAVF_FILTER_ADD) cnt++; } if (cnt == 0) { /* Should not happen... */ @@ -597,9 +597,9 @@ iavf_add_ether_filters(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH(f, sc->mac_filters, next) { - if (f->flags & IXL_FILTER_ADD) { + if (f->flags & IAVF_FILTER_ADD) { bcopy(f->macaddr, a->list[j].addr, ETHER_ADDR_LEN); - f->flags &= ~IXL_FILTER_ADD; + f->flags &= ~IAVF_FILTER_ADD; j++; iavf_dbg_vc(sc, "ADD: " MAC_FORMAT "\n", @@ -633,7 +633,7 @@ iavf_del_ether_filters(struct iavf_sc *sc) /* Get count of MAC addresses to delete */ SLIST_FOREACH(f, sc->mac_filters, next) { - if (f->flags & IXL_FILTER_DEL) + if (f->flags & IAVF_FILTER_DEL) cnt++; } if (cnt == 0) { @@ -655,7 +655,7 @@ iavf_del_ether_filters(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH_SAFE(f, sc->mac_filters, next, f_temp) { - if (f->flags & IXL_FILTER_DEL) { + if (f->flags & IAVF_FILTER_DEL) { bcopy(f->macaddr, d->list[j].addr, ETHER_ADDR_LEN); iavf_dbg_vc(sc, "DEL: " MAC_FORMAT "\n", MAC_FORMAT_ARGS(f->macaddr)); diff --git a/sys/dev/ixl/if_iavf.c b/sys/dev/ixl/if_iavf.c index 2079e2d7306b..394656d27a2f 100644 --- a/sys/dev/ixl/if_iavf.c +++ b/sys/dev/ixl/if_iavf.c @@ -663,7 +663,7 @@ iavf_if_init(if_ctx_t ctx) iavf_send_vc_msg(sc, IAVF_FLAG_AQ_DISABLE_QUEUES); bcopy(IF_LLADDR(ifp), tmpaddr, ETHER_ADDR_LEN); - if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && + if (!ixl_ether_is_equal(hw->mac.addr, tmpaddr) && (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { error = iavf_del_mac_filter(sc, hw->mac.addr); if (error == 0) @@ -1233,7 +1233,7 @@ iavf_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) struct iavf_sc *sc = arg; int error; - error = iavf_add_mac_filter(sc, (u8*)LLADDR(sdl), IXL_FILTER_MC); + error = iavf_add_mac_filter(sc, (u8*)LLADDR(sdl), IAVF_FILTER_MC); return (!error); } @@ -1404,7 +1404,7 @@ iavf_if_vlan_register(if_ctx_t ctx, u16 vtag) v = malloc(sizeof(struct iavf_vlan_filter), M_IAVF, M_WAITOK | M_ZERO); SLIST_INSERT_HEAD(sc->vlan_filters, v, next); v->vlan = vtag; - v->flags = IXL_FILTER_ADD; + v->flags = IAVF_FILTER_ADD; iavf_send_vc_msg(sc, IAVF_FLAG_AQ_ADD_VLAN_FILTER); } @@ -1422,7 +1422,7 @@ iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag) SLIST_FOREACH(v, sc->vlan_filters, next) { if (v->vlan == vtag) { - v->flags = IXL_FILTER_DEL; + v->flags = IAVF_FILTER_DEL; ++i; --vsi->num_vlans; } @@ -1624,7 +1624,7 @@ iavf_find_mac_filter(struct iavf_sc *sc, u8 *macaddr) bool match = FALSE; SLIST_FOREACH(f, sc->mac_filters, next) { - if (cmp_etheraddr(f->macaddr, macaddr)) { + if (ixl_ether_is_equal(f->macaddr, macaddr)) { match = TRUE; break; } @@ -1828,9 +1828,9 @@ iavf_init_multi(struct iavf_sc *sc) /* First clear any multicast filters */ SLIST_FOREACH(f, sc->mac_filters, next) { - if ((f->flags & IXL_FILTER_USED) - && (f->flags & IXL_FILTER_MC)) { - f->flags |= IXL_FILTER_DEL; + if ((f->flags & IAVF_FILTER_USED) + && (f->flags & IAVF_FILTER_MC)) { + f->flags |= IAVF_FILTER_DEL; mcnt++; } } @@ -2034,7 +2034,7 @@ iavf_add_mac_filter(struct iavf_sc *sc, u8 *macaddr, u16 flags) MAC_FORMAT_ARGS(macaddr)); bcopy(macaddr, f->macaddr, ETHER_ADDR_LEN); - f->flags |= (IXL_FILTER_ADD | IXL_FILTER_USED); + f->flags |= (IAVF_FILTER_ADD | IAVF_FILTER_USED); f->flags |= flags; return (0); } @@ -2051,7 +2051,7 @@ iavf_del_mac_filter(struct iavf_sc *sc, u8 *macaddr) if (f == NULL) return (ENOENT); - f->flags |= IXL_FILTER_DEL; + f->flags |= IAVF_FILTER_DEL; return (0); } diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 097d4b480891..340565d66bc8 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -127,7 +127,6 @@ static void ixl_if_vflr_handle(if_ctx_t ctx); #endif /*** Other ***/ -static u_int ixl_mc_filter_apply(void *, struct sockaddr_dl *, u_int); static void ixl_save_pf_tunables(struct ixl_pf *); static int ixl_allocate_pci_resources(struct ixl_pf *); static void ixl_setup_ssctx(struct ixl_pf *pf); @@ -862,7 +861,7 @@ ixl_if_detach(if_ctx_t ctx) ixl_pf_qmgr_destroy(&pf->qmgr); ixl_free_pci_resources(pf); - ixl_free_mac_filters(vsi); + ixl_free_filters(&vsi->ftl); INIT_DBG_DEV(dev, "end"); return (0); } @@ -937,9 +936,9 @@ ixl_if_init(if_ctx_t ctx) /* Get the latest mac address... User might use a LAA */ bcopy(IF_LLADDR(vsi->ifp), tmpaddr, ETH_ALEN); - if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && + if (!ixl_ether_is_equal(hw->mac.addr, tmpaddr) && (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { - ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + ixl_del_all_vlan_filters(vsi, hw->mac.addr); bcopy(tmpaddr, hw->mac.addr, ETH_ALEN); ret = i40e_aq_mac_address_write(hw, I40E_AQC_WRITE_TYPE_LAA_ONLY, @@ -948,7 +947,10 @@ ixl_if_init(if_ctx_t ctx) device_printf(dev, "LLA address change failed!!\n"); return; } - ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + /* + * New filters are configured by ixl_reconfigure_filters + * at the end of ixl_init_locked. + */ } iflib_set_mac(ctx, hw->mac.addr); @@ -1385,7 +1387,7 @@ ixl_if_update_admin_status(if_ctx_t ctx) struct i40e_hw *hw = &pf->hw; u16 pending; - if (pf->state & IXL_PF_STATE_ADAPTER_RESETTING) + if (IXL_PF_IS_RESETTING(pf)) ixl_handle_empr_reset(pf); /* @@ -1418,32 +1420,22 @@ ixl_if_multi_set(if_ctx_t ctx) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; - int mcnt, flags; - int del_mcnt; + int mcnt; IOCTL_DEBUGOUT("ixl_if_multi_set: begin"); - mcnt = min(if_llmaddr_count(iflib_get_ifp(ctx)), MAX_MULTICAST_ADDR); /* Delete filters for removed multicast addresses */ - del_mcnt = ixl_del_multi(vsi); - vsi->num_macs -= del_mcnt; + ixl_del_multi(vsi, false); + mcnt = min(if_llmaddr_count(iflib_get_ifp(ctx)), MAX_MULTICAST_ADDR); if (__predict_false(mcnt == MAX_MULTICAST_ADDR)) { i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, TRUE, NULL); + ixl_del_multi(vsi, true); return; } - /* (re-)install filters for all mcast addresses */ - /* XXX: This bypasses filter count tracking code! */ - mcnt = if_foreach_llmaddr(iflib_get_ifp(ctx), ixl_mc_filter_apply, vsi); - if (mcnt > 0) { - vsi->num_macs += mcnt; - flags = (IXL_FILTER_ADD | IXL_FILTER_USED | IXL_FILTER_MC); - ixl_add_hw_filters(vsi, flags, mcnt); - } - ixl_dbg_filter(pf, "%s: filter mac total: %d\n", - __func__, vsi->num_macs); + ixl_add_multi(vsi); IOCTL_DEBUGOUT("ixl_if_multi_set: end"); } @@ -1661,12 +1653,35 @@ ixl_if_vlan_register(if_ctx_t ctx, u16 vtag) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; + if_t ifp = iflib_get_ifp(ctx); if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; + /* + * Keep track of registered VLANS to know what + * filters have to be configured when VLAN_HWFILTER + * capability is enabled. + */ ++vsi->num_vlans; - ixl_add_filter(vsi, hw->mac.addr, vtag); + bit_set(vsi->vlans_map, vtag); + + if ((if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) == 0) + return; + + if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS) + ixl_add_filter(vsi, hw->mac.addr, vtag); + else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS) { + /* + * There is not enough HW resources to add filters + * for all registered VLANs. Re-configure filtering + * to allow reception of all expected traffic. + */ + device_printf(vsi->dev, + "Not enough HW filters for all VLANs. VLAN HW filtering disabled"); + ixl_del_all_vlan_filters(vsi, hw->mac.addr); + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + } } static void @@ -1675,12 +1690,23 @@ ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; + if_t ifp = iflib_get_ifp(ctx); if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; --vsi->num_vlans; - ixl_del_filter(vsi, hw->mac.addr, vtag); + bit_clear(vsi->vlans_map, vtag); + + if ((if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) == 0) + return; + + if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS) + ixl_del_filter(vsi, hw->mac.addr, vtag); + else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS) { + ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + ixl_add_vlan_filters(vsi, hw->mac.addr); + } } static uint64_t @@ -1798,15 +1824,6 @@ ixl_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) } } -static u_int -ixl_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) -{ - struct ixl_vsi *vsi = arg; - - ixl_add_mc_filter(vsi, (u8*)LLADDR(sdl)); - return (1); -} - /* * Sanity check and save off tunable values. */ diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 65e92c470a6c..3eb0fa4f6b5a 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -187,15 +188,15 @@ #define IXL_BULK_LATENCY 2 /* MacVlan Flags */ -#define IXL_FILTER_USED (u16)(1 << 0) -#define IXL_FILTER_VLAN (u16)(1 << 1) -#define IXL_FILTER_ADD (u16)(1 << 2) -#define IXL_FILTER_DEL (u16)(1 << 3) -#define IXL_FILTER_MC (u16)(1 << 4) +#define IXL_FILTER_VLAN (u16)(1 << 0) +#define IXL_FILTER_MC (u16)(1 << 1) /* used in the vlan field of the filter when not a vlan */ #define IXL_VLAN_ANY -1 +/* Maximum number of MAC/VLAN filters supported by HW */ +#define IXL_MAX_VLAN_FILTERS 256 + #define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) #define CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6) #define CSUM_OFFLOAD (CSUM_OFFLOAD_IPV4|CSUM_OFFLOAD_IPV6|CSUM_TSO) @@ -303,16 +304,18 @@ /* For stats sysctl naming */ #define IXL_QUEUE_NAME_LEN 32 +MALLOC_DECLARE(M_IXL); + #define IXL_DEV_ERR(_dev, _format, ...) \ device_printf(_dev, "%s: " _format " (%s:%d)\n", __func__, ##__VA_ARGS__, __FILE__, __LINE__) /* ***************************************************************************** * vendor_info_array - * + * * This array contains the list of Subvendor/Subdevice IDs on which the driver * should load. - * + * ***************************************************************************** */ typedef struct _ixl_vendor_info_t { @@ -328,7 +331,7 @@ typedef struct _ixl_vendor_info_t { ** addresses, vlans, and mac filters all use it. */ struct ixl_mac_filter { - SLIST_ENTRY(ixl_mac_filter) next; + LIST_ENTRY(ixl_mac_filter) ftle; u8 macaddr[ETHER_ADDR_LEN]; s16 vlan; u16 flags; @@ -414,7 +417,7 @@ struct ixl_rx_queue { /* ** Virtual Station Interface */ -SLIST_HEAD(ixl_ftl_head, ixl_mac_filter); +LIST_HEAD(ixl_ftl_head, ixl_mac_filter); struct ixl_vsi { if_ctx_t ctx; if_softc_ctx_t shared; @@ -452,6 +455,8 @@ struct ixl_vsi { /* Contains readylist & stat counter id */ struct i40e_aqc_vsi_properties_data info; +#define IXL_VLANS_MAP_LEN EVL_VLID_MASK + 1 + bitstr_t bit_decl(vlans_map, IXL_VLANS_MAP_LEN); u16 num_vlans; /* Per-VSI stats from hardware */ @@ -478,32 +483,16 @@ struct ixl_vsi { struct sysctl_ctx_list sysctl_ctx; }; -/* -** Creates new filter with given MAC address and VLAN ID -*/ -static inline struct ixl_mac_filter * -ixl_new_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) -{ - struct ixl_mac_filter *f; - - /* create a new empty filter */ - f = malloc(sizeof(struct ixl_mac_filter), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (f) { - SLIST_INSERT_HEAD(&vsi->ftl, f, next); - bcopy(macaddr, f->macaddr, ETHER_ADDR_LEN); - f->vlan = vlan; - f->flags |= (IXL_FILTER_ADD | IXL_FILTER_USED); - } - - return (f); -} +struct ixl_add_maddr_arg { + struct ixl_ftl_head to_add; + struct ixl_vsi *vsi; +}; /* ** Compare two ethernet addresses */ static inline bool -cmp_etheraddr(const u8 *ea1, const u8 *ea2) +ixl_ether_is_equal(const u8 *ea1, const u8 *ea2) { return (bcmp(ea1, ea2, ETHER_ADDR_LEN) == 0); } diff --git a/sys/dev/ixl/ixl_iw.c b/sys/dev/ixl/ixl_iw.c index 6557e9dca4b3..5e2d7cfcb30b 100644 --- a/sys/dev/ixl/ixl_iw.c +++ b/sys/dev/ixl/ixl_iw.c @@ -238,7 +238,7 @@ ixl_iw_pf_attach(struct ixl_pf *pf) } pf_entry = malloc(sizeof(struct ixl_iw_pf_entry), - M_DEVBUF, M_NOWAIT | M_ZERO); + M_IXL, M_NOWAIT | M_ZERO); if (pf_entry == NULL) { device_printf(pf->dev, "%s: failed to allocate memory to attach new PF\n", @@ -289,7 +289,7 @@ ixl_iw_pf_detach(struct ixl_pf *pf) goto out; } LIST_REMOVE(pf_entry, node); - free(pf_entry, M_DEVBUF); + free(pf_entry, M_IXL); ixl_iw_ref_cnt--; out: @@ -414,7 +414,7 @@ ixl_iw_register(struct ixl_iw_ops *ops) taskqueue_start_threads(&ixl_iw.tq, 1, PI_NET, "ixl iw"); ixl_iw.ops = malloc(sizeof(struct ixl_iw_ops), - M_DEVBUF, M_NOWAIT | M_ZERO); + M_IXL, M_NOWAIT | M_ZERO); if (ixl_iw.ops == NULL) { printf("%s: failed to allocate memory\n", __func__); taskqueue_free(ixl_iw.tq); @@ -481,7 +481,7 @@ ixl_iw_unregister(void) taskqueue_drain(ixl_iw.tq, &pf_entry->iw_task); taskqueue_free(ixl_iw.tq); ixl_iw.tq = NULL; - free(ixl_iw.ops, M_DEVBUF); + free(ixl_iw.ops, M_IXL); ixl_iw.ops = NULL; return (0); diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 0521ae5a4bc5..c3fbdc91d358 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -78,7 +78,7 @@ enum ixl_i2c_access_method_t { /* Used in struct ixl_pf's state field */ enum ixl_pf_state { IXL_PF_STATE_RECOVERY_MODE = (1 << 0), - IXL_PF_STATE_ADAPTER_RESETTING = (1 << 1), + IXL_PF_STATE_RESETTING = (1 << 1), IXL_PF_STATE_MDD_PENDING = (1 << 2), IXL_PF_STATE_PF_RESET_REQ = (1 << 3), IXL_PF_STATE_VF_RESET_REQ = (1 << 4), @@ -93,6 +93,8 @@ enum ixl_pf_state { #define IXL_PF_IN_RECOVERY_MODE(pf) \ ((atomic_load_acq_32(&pf->state) & IXL_PF_STATE_RECOVERY_MODE) != 0) +#define IXL_PF_IS_RESETTING(pf) \ + ((atomic_load_acq_32(&pf->state) & IXL_PF_STATE_RESETTING) != 0) struct ixl_vf { struct ixl_vsi vsi; @@ -258,8 +260,6 @@ struct ixl_pf { "\t1 - Enable (VEB)\n" \ "Enabling this will allow VFs in separate VMs to communicate over the hardware bridge." -MALLOC_DECLARE(M_IXL); - /*** Functions / Macros ***/ /* Adjust the level here to 10 or over to print stats messages */ #define I40E_VC_DEBUG(p, level, ...) \ @@ -367,6 +367,8 @@ void ixl_set_queue_tx_itr(struct ixl_tx_queue *); void ixl_add_filter(struct ixl_vsi *, const u8 *, s16 vlan); void ixl_del_filter(struct ixl_vsi *, const u8 *, s16 vlan); +void ixl_add_vlan_filters(struct ixl_vsi *, const u8 *); +void ixl_del_all_vlan_filters(struct ixl_vsi *, const u8 *); void ixl_reconfigure_filters(struct ixl_vsi *vsi); int ixl_disable_rings(struct ixl_pf *, struct ixl_vsi *, struct ixl_pf_qtag *); @@ -391,16 +393,15 @@ void ixl_enable_intr(struct ixl_vsi *); void ixl_disable_rings_intr(struct ixl_vsi *); void ixl_set_promisc(struct ixl_vsi *); void ixl_add_multi(struct ixl_vsi *); -int ixl_del_multi(struct ixl_vsi *); +void ixl_del_multi(struct ixl_vsi *, bool); void ixl_setup_vlan_filters(struct ixl_vsi *); void ixl_init_filters(struct ixl_vsi *); -void ixl_add_hw_filters(struct ixl_vsi *, int, int); -void ixl_del_hw_filters(struct ixl_vsi *, int); +void ixl_free_filters(struct ixl_ftl_head *); +void ixl_add_hw_filters(struct ixl_vsi *, struct ixl_ftl_head *, int); +void ixl_del_hw_filters(struct ixl_vsi *, struct ixl_ftl_head *, int); void ixl_del_default_hw_filters(struct ixl_vsi *); struct ixl_mac_filter * - ixl_find_filter(struct ixl_vsi *, const u8 *, s16); -void ixl_add_mc_filter(struct ixl_vsi *, u8 *); -void ixl_free_mac_filters(struct ixl_vsi *vsi); + ixl_find_filter(struct ixl_ftl_head *, const u8 *, s16); void ixl_update_vsi_stats(struct ixl_vsi *); void ixl_vsi_reset_stats(struct ixl_vsi *); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 4351f65ee5ab..2b3d035fbcfe 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -185,7 +185,7 @@ ixl_msix_adminq(void *arg) } device_printf(dev, "Reset Requested! (%s)\n", reset_type); /* overload admin queue task to check reset progress */ - atomic_set_int(&pf->state, IXL_PF_STATE_ADAPTER_RESETTING); + atomic_set_int(&pf->state, IXL_PF_STATE_RESETTING); do_task = TRUE; } @@ -866,41 +866,6 @@ ixl_set_rss_hlut(struct ixl_pf *pf) } } -/* -** This routine updates vlan filters, called by init -** it scans the filter table and then updates the hw -** after a soft reset. -*/ -void -ixl_setup_vlan_filters(struct ixl_vsi *vsi) -{ - struct ixl_mac_filter *f; - int cnt = 0, flags; - - if (vsi->num_vlans == 0) - return; - /* - ** Scan the filter list for vlan entries, - ** mark them for addition and then call - ** for the AQ update. - */ - SLIST_FOREACH(f, &vsi->ftl, next) { - if (f->flags & IXL_FILTER_VLAN) { - f->flags |= - (IXL_FILTER_ADD | - IXL_FILTER_USED); - cnt++; - } - } - if (cnt == 0) { - printf("setup vlan: no filters found!\n"); - return; - } - flags = IXL_FILTER_VLAN; - flags |= (IXL_FILTER_ADD | IXL_FILTER_USED); - ixl_add_hw_filters(vsi, flags, cnt); -} - /* For PF VSI only */ int ixl_enable_rings(struct ixl_vsi *vsi) diff --git a/sys/dev/ixl/ixl_pf_iov.c b/sys/dev/ixl/ixl_pf_iov.c index 92e434eab9fc..c3cf90d1c4b5 100644 --- a/sys/dev/ixl/ixl_pf_iov.c +++ b/sys/dev/ixl/ixl_pf_iov.c @@ -1025,7 +1025,7 @@ ixl_vf_mac_valid(struct ixl_vf *vf, const uint8_t *addr) * is not its assigned MAC. */ if (!(vf->vf_flags & VF_FLAG_SET_MAC_CAP) && - !(ETHER_IS_MULTICAST(addr) || cmp_etheraddr(addr, vf->mac))) + !(ETHER_IS_MULTICAST(addr) || !ixl_ether_is_equal(addr, vf->mac))) return (EPERM); return (0); @@ -1717,7 +1717,7 @@ ixl_if_iov_uninit(if_ctx_t ctx) if (pf->vfs[i].vsi.seid != 0) i40e_aq_delete_element(hw, pf->vfs[i].vsi.seid, NULL); ixl_pf_qmgr_release(&pf->qmgr, &pf->vfs[i].qtag); - ixl_free_mac_filters(&pf->vfs[i].vsi); + ixl_free_filters(&pf->vfs[i].vsi.ftl); ixl_dbg_iov(pf, "VF %d: %d released\n", i, pf->vfs[i].qtag.num_allocated); ixl_dbg_iov(pf, "Unallocated total: %d\n", ixl_pf_qmgr_get_num_free(&pf->qmgr)); diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index eddd4dfaab0d..2714b1a0e6d8 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -326,7 +326,7 @@ ixl_get_hw_capabilities(struct ixl_pf *pf) len = 40 * sizeof(struct i40e_aqc_list_capabilities_element_resp); retry: if (!(buf = (struct i40e_aqc_list_capabilities_element_resp *) - malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO))) { + malloc(len, M_IXL, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate cap memory\n"); return (ENOMEM); } @@ -334,7 +334,7 @@ retry: /* This populates the hw struct */ status = i40e_aq_discover_capabilities(hw, buf, len, &needed, i40e_aqc_opc_list_func_capabilities, NULL); - free(buf, M_DEVBUF); + free(buf, M_IXL); if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) && (again == TRUE)) { /* retry once with a larger buffer */ @@ -452,12 +452,67 @@ err_out: return (status); } +/* +** Creates new filter with given MAC address and VLAN ID +*/ +static struct ixl_mac_filter * +ixl_new_filter(struct ixl_ftl_head *headp, const u8 *macaddr, s16 vlan) +{ + struct ixl_mac_filter *f; + + /* create a new empty filter */ + f = malloc(sizeof(struct ixl_mac_filter), + M_IXL, M_NOWAIT | M_ZERO); + if (f) { + LIST_INSERT_HEAD(headp, f, ftle); + bcopy(macaddr, f->macaddr, ETHER_ADDR_LEN); + f->vlan = vlan; + } + + return (f); +} + +/** + * ixl_free_filters - Free all filters in given list + * headp - pointer to list head + * + * Frees memory used by each entry in the list. + * Does not remove filters from HW. + */ +void +ixl_free_filters(struct ixl_ftl_head *headp) +{ + struct ixl_mac_filter *f, *nf; + + f = LIST_FIRST(headp); + while (f != NULL) { + nf = LIST_NEXT(f, ftle); + free(f, M_IXL); + f = nf; + } + + LIST_INIT(headp); +} + static u_int ixl_add_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) { - struct ixl_vsi *vsi = arg; + struct ixl_add_maddr_arg *ama = arg; + struct ixl_vsi *vsi = ama->vsi; + const u8 *macaddr = (u8*)LLADDR(sdl); + struct ixl_mac_filter *f; - ixl_add_mc_filter(vsi, (u8*)LLADDR(sdl)); + /* Does one already exist */ + f = ixl_find_filter(&vsi->ftl, macaddr, IXL_VLAN_ANY); + if (f != NULL) + return (0); + + f = ixl_new_filter(&ama->to_add, macaddr, IXL_VLAN_ANY); + if (f == NULL) { + device_printf(vsi->dev, "WARNING: no filter available!!\n"); + return (0); + } + f->flags |= IXL_FILTER_MC; return (1); } @@ -473,28 +528,26 @@ ixl_add_multi(struct ixl_vsi *vsi) { struct ifnet *ifp = vsi->ifp; struct i40e_hw *hw = vsi->hw; - int mcnt = 0, flags; + int mcnt = 0; + struct ixl_add_maddr_arg cb_arg; IOCTL_DEBUGOUT("ixl_add_multi: begin"); - /* - ** First just get a count, to decide if we - ** we simply use multicast promiscuous. - */ mcnt = if_llmaddr_count(ifp); if (__predict_false(mcnt >= MAX_MULTICAST_ADDR)) { - /* delete existing MC filters */ - ixl_del_hw_filters(vsi, mcnt); i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, TRUE, NULL); + /* delete all existing MC filters */ + ixl_del_multi(vsi, true); return; } - mcnt = if_foreach_llmaddr(ifp, ixl_add_maddr, vsi); - if (mcnt > 0) { - flags = (IXL_FILTER_ADD | IXL_FILTER_USED | IXL_FILTER_MC); - ixl_add_hw_filters(vsi, flags, mcnt); - } + cb_arg.vsi = vsi; + LIST_INIT(&cb_arg.to_add); + + mcnt = if_foreach_llmaddr(ifp, ixl_add_maddr, &cb_arg); + if (mcnt > 0) + ixl_add_hw_filters(vsi, &cb_arg.to_add, mcnt); IOCTL_DEBUGOUT("ixl_add_multi: end"); } @@ -504,34 +557,36 @@ ixl_match_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) { struct ixl_mac_filter *f = arg; - if (cmp_etheraddr(f->macaddr, (u8 *)LLADDR(sdl))) + if (ixl_ether_is_equal(f->macaddr, (u8 *)LLADDR(sdl))) return (1); else return (0); } -int -ixl_del_multi(struct ixl_vsi *vsi) +void +ixl_del_multi(struct ixl_vsi *vsi, bool all) { + struct ixl_ftl_head to_del; struct ifnet *ifp = vsi->ifp; - struct ixl_mac_filter *f; + struct ixl_mac_filter *f, *fn; int mcnt = 0; IOCTL_DEBUGOUT("ixl_del_multi: begin"); + LIST_INIT(&to_del); /* Search for removed multicast addresses */ - SLIST_FOREACH(f, &vsi->ftl, next) - if ((f->flags & IXL_FILTER_USED) && - (f->flags & IXL_FILTER_MC) && - (if_foreach_llmaddr(ifp, ixl_match_maddr, f) == 0)) { - f->flags |= IXL_FILTER_DEL; - mcnt++; - } + LIST_FOREACH_SAFE(f, &vsi->ftl, ftle, fn) { + if ((f->flags & IXL_FILTER_MC) == 0 || + (!all && (if_foreach_llmaddr(ifp, ixl_match_maddr, f) == 0))) + continue; - if (mcnt > 0) - ixl_del_hw_filters(vsi, mcnt); + LIST_REMOVE(f, ftle); + LIST_INSERT_HEAD(&to_del, f, ftle); + mcnt++; + } - return (mcnt); + if (mcnt > 0) + ixl_del_hw_filters(vsi, &to_del, mcnt); } void @@ -738,20 +793,6 @@ ixl_switch_config(struct ixl_pf *pf) return (ret); } -void -ixl_free_mac_filters(struct ixl_vsi *vsi) -{ - struct ixl_mac_filter *f; - - while (!SLIST_EMPTY(&vsi->ftl)) { - f = SLIST_FIRST(&vsi->ftl); - SLIST_REMOVE_HEAD(&vsi->ftl, next); - free(f, M_DEVBUF); - } - - vsi->num_hw_filters = 0; -} - void ixl_vsi_add_sysctls(struct ixl_vsi * vsi, const char * sysctl_name, bool queues_sysctls) { @@ -1019,7 +1060,7 @@ ixl_init_filters(struct ixl_vsi *vsi) ixl_dbg_filter(pf, "%s: start\n", __func__); /* Initialize mac filter list for VSI */ - SLIST_INIT(&vsi->ftl); + LIST_INIT(&vsi->ftl); vsi->num_hw_filters = 0; /* Receive broadcast Ethernet frames */ @@ -1045,30 +1086,35 @@ ixl_init_filters(struct ixl_vsi *vsi) #endif } -/* -** This routine adds mulicast filters -*/ void -ixl_add_mc_filter(struct ixl_vsi *vsi, u8 *macaddr) +ixl_reconfigure_filters(struct ixl_vsi *vsi) { - struct ixl_mac_filter *f; + struct i40e_hw *hw = vsi->hw; + struct ixl_ftl_head tmp; + int cnt; - /* Does one already exist */ - f = ixl_find_filter(vsi, macaddr, IXL_VLAN_ANY); - if (f != NULL) - return; + /* + * The ixl_add_hw_filters function adds filters configured + * in HW to a list in VSI. Move all filters to a temporary + * list to avoid corrupting it by concatenating to itself. + */ + LIST_INIT(&tmp); + LIST_CONCAT(&tmp, &vsi->ftl, ixl_mac_filter, ftle); + cnt = vsi->num_hw_filters; + vsi->num_hw_filters = 0; - f = ixl_new_filter(vsi, macaddr, IXL_VLAN_ANY); - if (f != NULL) - f->flags |= IXL_FILTER_MC; - else - printf("WARNING: no filter available!!\n"); -} + ixl_add_hw_filters(vsi, &tmp, cnt); -void -ixl_reconfigure_filters(struct ixl_vsi *vsi) -{ - ixl_add_hw_filters(vsi, IXL_FILTER_USED, vsi->num_macs); + /* Filter could be removed if MAC address was changed */ + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + + if ((if_getcapenable(vsi->ifp) & IFCAP_VLAN_HWFILTER) == 0) + return; + /* + * VLAN HW filtering is enabled, make sure that filters + * for all registered VLAN tags are configured + */ + ixl_add_vlan_filters(vsi, hw->mac.addr); } /* @@ -1082,82 +1128,205 @@ ixl_add_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) struct ixl_mac_filter *f, *tmp; struct ixl_pf *pf; device_t dev; + struct ixl_ftl_head to_add; + int to_add_cnt; pf = vsi->back; dev = pf->dev; *** 549 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Feb 5 00:22:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E806C5356C6; Fri, 5 Feb 2021 00:22:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWx2668zdz3hb6; Fri, 5 Feb 2021 00:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C64741549F; Fri, 5 Feb 2021 00:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1150MMkQ052578; Fri, 5 Feb 2021 00:22:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1150MMJf052577; Fri, 5 Feb 2021 00:22:22 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:22:22 GMT Message-Id: <202102050022.1150MMJf052577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 375d797b8191 - main - Enable pvscsi and vmx in arm64 GENERIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 375d797b81916eb3d16927c9dac8c42975784252 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 00:22:23 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=375d797b81916eb3d16927c9dac8c42975784252 commit 375d797b81916eb3d16927c9dac8c42975784252 Author: Ed Maste AuthorDate: 2021-02-05 00:14:12 +0000 Commit: Ed Maste CommitDate: 2021-02-05 00:21:38 +0000 Enable pvscsi and vmx in arm64 GENERIC FreeBSD pvscsi and vmx work with VMware ESXi Arm "Fling"; provide these in GENERIC for a convenient out-of-the-box experience. PR: 253202 Reported by: Vincent Milum Jr MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/arm64/conf/GENERIC | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index 59f89555dd88..5eb0a270f006 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -159,6 +159,7 @@ options PCI_IOV # PCI SR-IOV support device ahci device scbus device da +device pvscsi # VMware PVSCSI # ATA/SCSI peripherals device cd # CD @@ -272,6 +273,7 @@ device pl011 device iflib device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel 10Gb Ethernet Family +device vmx # VMware VMXNET3 Ethernet # Ethernet NICs device mdio From owner-dev-commits-src-main@freebsd.org Fri Feb 5 01:22:46 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D0D32537F7E; Fri, 5 Feb 2021 01:22:46 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWyMp5GVNz3mvf; Fri, 5 Feb 2021 01:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A7CBE16296; Fri, 5 Feb 2021 01:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1151MkCG031621; Fri, 5 Feb 2021 01:22:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1151MkMR031620; Fri, 5 Feb 2021 01:22:46 GMT (envelope-from git) Date: Fri, 5 Feb 2021 01:22:46 GMT Message-Id: <202102050122.1151MkMR031620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5832a3e39864 - main - amd64 GENERIC: compile in mlx5en(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5832a3e398642f721381dc2bdc8e954ae43c17a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 01:22:46 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5832a3e398642f721381dc2bdc8e954ae43c17a7 commit 5832a3e398642f721381dc2bdc8e954ae43c17a7 Author: Konstantin Belousov AuthorDate: 2021-02-03 12:19:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-05 01:22:26 +0000 amd64 GENERIC: compile in mlx5en(4) Reviewed by: hselasky, manu Sponsored by: NVidia Networking/Mellanox Technologies MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28469 --- sys/amd64/conf/GENERIC | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 387128f7cba8..cdee2a91554b 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -134,6 +134,8 @@ device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support +options COMPAT_LINUXKPI + # Floppy drives device fdc @@ -258,6 +260,12 @@ device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet +# Nvidia/Mellanox Connect-X 4 and later, Ethernet only +# mlx5ib requires ibcore infra and is not included by default +device mlx5 # Base driver +device mlxfw # Firmware update +device mlx5en # Ethernet driver + # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support @@ -326,6 +334,7 @@ device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! From owner-dev-commits-src-main@freebsd.org Fri Feb 5 01:22:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DAE8C537F7F; Fri, 5 Feb 2021 01:22:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWyMq5tyrz3mxq; Fri, 5 Feb 2021 01:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BD39315D5C; Fri, 5 Feb 2021 01:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1151MlCl031644; Fri, 5 Feb 2021 01:22:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1151Ml6Z031643; Fri, 5 Feb 2021 01:22:47 GMT (envelope-from git) Date: Fri, 5 Feb 2021 01:22:47 GMT Message-Id: <202102050122.1151Ml6Z031643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 856789c123d6 - main - cpucontrol(8): Fix display. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 856789c123d69de86684c5aa1ad8a53427dd47fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 01:22:47 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=856789c123d69de86684c5aa1ad8a53427dd47fc commit 856789c123d69de86684c5aa1ad8a53427dd47fc Author: Konstantin Belousov AuthorDate: 2021-02-05 01:00:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-05 01:22:26 +0000 cpucontrol(8): Fix display. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- usr.sbin/cpucontrol/cpucontrol.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/cpucontrol/cpucontrol.8 b/usr.sbin/cpucontrol/cpucontrol.8 index 4e54bb51bafc..e347d5e49bfe 100644 --- a/usr.sbin/cpucontrol/cpucontrol.8 +++ b/usr.sbin/cpucontrol/cpucontrol.8 @@ -33,8 +33,8 @@ .Xr cpuctl 4 device .Sh SYNOPSIS -.Nm .Bk +.Nm .Op Fl v .Fl m Ar msr .Ar device From owner-dev-commits-src-main@freebsd.org Fri Feb 5 02:59:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C59FC53A27C; Fri, 5 Feb 2021 02:59:58 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DX0Wy57qdz3tGC; Fri, 5 Feb 2021 02:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9F7D2175A7; Fri, 5 Feb 2021 02:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1152xwag051463; Fri, 5 Feb 2021 02:59:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1152xw7F051462; Fri, 5 Feb 2021 02:59:58 GMT (envelope-from git) Date: Fri, 5 Feb 2021 02:59:58 GMT Message-Id: <202102050259.1152xw7F051462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f823c6dc730b - main - grep: fix null pattern and empty pattern file behavior MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f823c6dc730b0dd08b54a53be1d8fd587eee7021 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 02:59:58 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f823c6dc730b0dd08b54a53be1d8fd587eee7021 commit f823c6dc730b0dd08b54a53be1d8fd587eee7021 Author: Kyle Evans AuthorDate: 2021-02-04 21:26:45 +0000 Commit: Kyle Evans CommitDate: 2021-02-05 02:59:42 +0000 grep: fix null pattern and empty pattern file behavior The null pattern semantics were terrible because I tried to match gnugrep, but I got it wrong. Let's unwind that: - The null pattern should match every line if neither -w nor -x. - The null pattern should match empty lines if -x. - The null pattern should not match any lines if -w. The first two will stop processing (shortcut) even if additional patterns are specified. In any other case, we will continue processing other patterns. If no other patterns are specified beside a null pattern, then we match if neither -w nor -x or set and do not match if either of those are specified. The justification for -w is that it should match on a whole word, but the null pattern deos not have a whole word to match on. Empty pattern files should never match anything, and more importantly, -v should cause everything to be written. PR: 253209 MFC-after: 4 days --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 22 +++++++++++++++--- usr.bin/grep/grep.c | 11 --------- usr.bin/grep/util.c | 35 +++++++++++++---------------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index e094b15c6d67..ef3f0617465e 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -489,11 +489,11 @@ wflag_emptypat_body() atf_check -s exit:1 -o empty grep -w -e "" test1 - atf_check -o file:test2 grep -w -e "" test2 + atf_check -o file:test2 grep -vw -e "" test2 atf_check -s exit:1 -o empty grep -w -e "" test3 - atf_check -o file:test4 grep -w -e "" test4 + atf_check -o file:test4 grep -vw -e "" test4 } atf_test_case xflag_emptypat @@ -504,7 +504,6 @@ xflag_emptypat_body() printf "qaz" > test3 printf " qaz\n" > test4 - # -x is whole-line, more strict than -w. atf_check -s exit:1 -o empty grep -x -e "" test1 atf_check -o file:test2 grep -x -e "" test2 @@ -550,6 +549,22 @@ xflag_emptypat_plus_body() atf_check -o file:spacelines grep -Fxvf patlist1 target_spacelines } +atf_test_case emptyfile +emptyfile_descr() +{ + atf_set "descr" "Check for proper handling of empty pattern files (PR 253209)" +} +emptyfile_body() +{ + :> epatfile + echo "blubb" > subj + + # From PR 253209, bsdgrep was short-circuiting completely on an empty + # file, but we should have still been processing lines. + atf_check -s exit:1 -o empty fgrep -f epatfile subj + atf_check -o file:subj fgrep -vf epatfile subj +} + atf_test_case excessive_matches excessive_matches_head() { @@ -946,6 +961,7 @@ atf_init_test_cases() atf_add_test_case wflag_emptypat atf_add_test_case xflag_emptypat atf_add_test_case xflag_emptypat_plus + atf_add_test_case emptyfile atf_add_test_case excessive_matches atf_add_test_case wv_combo_break atf_add_test_case fgrep_sanity diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 307a91353b66..33541e4fe734 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -69,13 +69,6 @@ const char *errstr[] = { int cflags = REG_NOSUB | REG_NEWLINE; int eflags = REG_STARTEND; -/* XXX TODO: Get rid of this flag. - * matchall is a gross hack that means that an empty pattern was passed to us. - * It is a necessary evil at the moment because our regex(3) implementation - * does not allow for empty patterns, as supported by POSIX's definition of - * grammar for BREs/EREs. When libregex becomes available, it would be wise - * to remove this and let regex(3) handle the dirty details of empty patterns. - */ bool matchall; /* Searching patterns */ @@ -637,10 +630,6 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; - /* Empty pattern file matches nothing */ - if (!needpattern && (patterns == 0) && !matchall) - exit(1); - /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index e517e4eaee6d..f22b7abd79ef 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -471,31 +471,28 @@ procline(struct parsec *pc) matchidx = pc->matchidx; - /* - * With matchall (empty pattern), we can try to take some shortcuts. - * Emtpy patterns trivially match every line except in the -w and -x - * cases. For -w (whole-word) cases, we only match if the first - * character isn't a word-character. For -x (whole-line) cases, we only - * match if the line is empty. - */ + /* Null pattern shortcuts. */ if (matchall) { - if (pc->ln.len == 0) + if (xflag && pc->ln.len == 0) { + /* Matches empty lines (-x). */ return (true); - if (wflag) { - wend = L' '; - if (sscanf(&pc->ln.dat[0], "%lc", &wend) == 1 && - !iswword(wend)) - return (true); - } else if (!xflag) + } else if (!wflag && !xflag) { + /* Matches every line (no -w or -x). */ return (true); + } /* - * If we don't have any other patterns, we really don't match. - * If we do have other patterns, we must fall through and check - * them. + * If we only have the NULL pattern, whether we match or not + * depends on if we got here with -w or -x. If either is set, + * the answer is no. If we have other patterns, we'll defer + * to them. */ - if (patterns == 0) - return (false); + if (patterns == 0) { + return (!(wflag || xflag)); + } + } else if (patterns == 0) { + /* Pattern file with no patterns. */ + return (false); } matched = false; From owner-dev-commits-src-main@freebsd.org Fri Feb 5 02:59:59 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D607253A4F2; Fri, 5 Feb 2021 02:59:59 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DX0Wz5kRVz3tGD; Fri, 5 Feb 2021 02:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B77DA16CFF; Fri, 5 Feb 2021 02:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1152xxRI051486; Fri, 5 Feb 2021 02:59:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1152xxBw051485; Fri, 5 Feb 2021 02:59:59 GMT (envelope-from git) Date: Fri, 5 Feb 2021 02:59:59 GMT Message-Id: <202102050259.1152xxBw051485@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 2373acbbb77d - main - grep: turn off -w if -x is specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2373acbbb77d694b997d90f3251810c6edf5d6d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 02:59:59 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2373acbbb77d694b997d90f3251810c6edf5d6d8 commit 2373acbbb77d694b997d90f3251810c6edf5d6d8 Author: Kyle Evans AuthorDate: 2021-02-04 21:35:58 +0000 Commit: Kyle Evans CommitDate: 2021-02-05 02:59:43 +0000 grep: turn off -w if -x is specified -x overcomes -w in gnugrep, and it should here as well. Flip it off as needed to avoid confusing other parts of grep. --- usr.bin/grep/grep.1 | 5 ++++- usr.bin/grep/grep.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index d3b30828c821..338af7e6d454 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd November 19, 2020 +.Dd February 4, 2021 .Dt GREP 1 .Os .Sh NAME @@ -405,6 +405,9 @@ and .Sq [[:>:]] ; see .Xr re_format 7 ) . +This option has no effect if +.Fl x +is also specified. .It Fl x , Fl Fl line-regexp Only input lines selected against an entire fixed string or regular expression are considered to be matching lines. diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 33541e4fe734..166d3451774a 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -630,6 +630,10 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; + /* xflag takes precedence, don't confuse the matching bits. */ + if (wflag && xflag) + wflag = false; + /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); From owner-dev-commits-src-main@freebsd.org Fri Feb 5 14:04:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9E80854893F; Fri, 5 Feb 2021 14:04: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXHGv454wz3JW1; Fri, 5 Feb 2021 14:04:39 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 74A2B1FC67; Fri, 5 Feb 2021 14:04:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115E4dqe028011; Fri, 5 Feb 2021 14:04:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115E4d1W028010; Fri, 5 Feb 2021 14:04:39 GMT (envelope-from git) Date: Fri, 5 Feb 2021 14:04:39 GMT Message-Id: <202102051404.115E4d1W028010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 13ec5a6da04b - main - Add support for arm64 nGnRE device memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13ec5a6da04b14c4d40d3b37335dfaef7469aeb5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 14:04:39 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=13ec5a6da04b14c4d40d3b37335dfaef7469aeb5 commit 13ec5a6da04b14c4d40d3b37335dfaef7469aeb5 Author: Andrew Turner AuthorDate: 2021-02-05 10:50:29 +0000 Commit: Andrew Turner CommitDate: 2021-02-05 12:25:56 +0000 Add support for arm64 nGnRE device memory On arm64 we can select how strongly we order device memory. Currently we use the strongest type of non-Gathering, non-Reordering, no Early write acknowledgement. This is equivalent to VM_MEMATTR_SO in the 32-bit arm code. Create a new memory type to remove the no Early write acknowledgement option to create a memory attribute that is equivalent to the arm VM_MEMATTR_DEVICE. Keep the the old nGnRnE memory as what we provide for VM_MEMATTR_DEVICE until we can test nGnRE on more hardware. A method for dynamically switching back may be needed as at least one vendor is known to have broken nGnRE memory. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 5 +++-- sys/arm64/include/armreg.h | 1 + sys/arm64/include/vm.h | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index c62a2a5bd626..b340041eb163 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -733,10 +733,11 @@ LENTRY(start_mmu) .align 3 mair: - .quad MAIR_ATTR(MAIR_DEVICE_nGnRnE, VM_MEMATTR_DEVICE) | \ + .quad MAIR_ATTR(MAIR_DEVICE_nGnRnE, VM_MEMATTR_DEVICE_nGnRnE) | \ MAIR_ATTR(MAIR_NORMAL_NC, VM_MEMATTR_UNCACHEABLE) | \ MAIR_ATTR(MAIR_NORMAL_WB, VM_MEMATTR_WRITE_BACK) | \ - MAIR_ATTR(MAIR_NORMAL_WT, VM_MEMATTR_WRITE_THROUGH) + MAIR_ATTR(MAIR_NORMAL_WT, VM_MEMATTR_WRITE_THROUGH) | \ + MAIR_ATTR(MAIR_DEVICE_nGnRE, VM_MEMATTR_DEVICE_nGnRE) tcr: .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_TG1_4K | \ TCR_CACHE_ATTRS | TCR_SMP_ATTRS) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 201d7559320b..f5d25a572466 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -734,6 +734,7 @@ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) #define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8)) #define MAIR_DEVICE_nGnRnE 0x00 +#define MAIR_DEVICE_nGnRE 0x04 #define MAIR_NORMAL_NC 0x44 #define MAIR_NORMAL_WT 0xbb #define MAIR_NORMAL_WB 0xff diff --git a/sys/arm64/include/vm.h b/sys/arm64/include/vm.h index dac13980060e..3df3af24c010 100644 --- a/sys/arm64/include/vm.h +++ b/sys/arm64/include/vm.h @@ -30,10 +30,13 @@ #define _MACHINE_VM_H_ /* Memory attribute configuration. */ -#define VM_MEMATTR_DEVICE 0 +#define VM_MEMATTR_DEVICE_nGnRnE 0 #define VM_MEMATTR_UNCACHEABLE 1 #define VM_MEMATTR_WRITE_BACK 2 #define VM_MEMATTR_WRITE_THROUGH 3 +#define VM_MEMATTR_DEVICE_nGnRE 4 + +#define VM_MEMATTR_DEVICE VM_MEMATTR_DEVICE_nGnRnE #ifdef _KERNEL /* If defined vmstat will try to use both of these in a switch statement */ From owner-dev-commits-src-main@freebsd.org Fri Feb 5 14:47:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9DF54549BBF; Fri, 5 Feb 2021 14:47:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXJD74738z3M6C; Fri, 5 Feb 2021 14:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 806E120793; Fri, 5 Feb 2021 14:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115ElJRt080327; Fri, 5 Feb 2021 14:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115ElJGV080326; Fri, 5 Feb 2021 14:47:19 GMT (envelope-from git) Date: Fri, 5 Feb 2021 14:47:19 GMT Message-Id: <202102051447.115ElJGV080326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3279329b2dca - main - tools/git: Add git-arc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3279329b2dca12b6f882db7a295b9e790c82f968 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 14:47:19 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3279329b2dca12b6f882db7a295b9e790c82f968 commit 3279329b2dca12b6f882db7a295b9e790c82f968 Author: Mark Johnston AuthorDate: 2021-02-05 14:44:47 +0000 Commit: Mark Johnston CommitDate: 2021-02-05 14:47:05 +0000 tools/git: Add git-arc This is a handy script for creating and updating Differential revisions from git commits. It tries to avoid forcing the user to manage their git tree in any particular way, but makes two major assumptions: - there is a one-to-one mapping between git commits and Differential revisions, - the title of a Differential revision is the same as the summary line of the corresponding commit. A verbose description of the script's functionality is provided in its usage message, which should probably be converted to a man page. A description of workflows using git-arc is here: https://lists.freebsd.org/pipermail/freebsd-hackers/2021-January/056979.html There are some loose ends but this is functional enough to be useful. Discussed with: jhb Differential Revision: https://reviews.freebsd.org/D28334 --- tools/tools/git/Makefile | 4 + tools/tools/git/git-arc.sh | 596 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 600 insertions(+) diff --git a/tools/tools/git/Makefile b/tools/tools/git/Makefile new file mode 100644 index 000000000000..228a41d65275 --- /dev/null +++ b/tools/tools/git/Makefile @@ -0,0 +1,4 @@ +SCRIPTS= git-arc.sh +BINDIR?= /usr/local/bin + +.include diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh new file mode 100644 index 000000000000..3b85d851319f --- /dev/null +++ b/tools/tools/git/git-arc.sh @@ -0,0 +1,596 @@ +#!/bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019-2021 Mark Johnston +# Copyright (c) 2021 John Baldwin +# +# 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 AUTHOR 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 AUTHOR 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. +# + +# TODO: +# - roll back after errors or SIGINT +# - current checkout +# - created revs +# - main (for git arc stage) + +warn() +{ + echo "$(basename $0): $1" >&2 +} + +err() +{ + warn "$1" + exit 1 +} + +err_usage() +{ + cat >&2 <<__EOF__ +Usage: git arc [-vy] + +Commands: + create [-l] [-r [,...]] [-s subscriber[,...]] [|] + list | + patch [ ...] + stage [-b branch] [|] + update + +Description: + Create or manage FreeBSD Phabricator reviews based on git commits. There + is a one-to one relationship between git commits and Differential revisions, + and the Differential revision title must match the summary line of the + corresponding commit. In particular, commit summaries must be unique across + all open Differential revisions authored by you. + + The first parameter must be a verb. The available verbs are: + + create -- Create new Differential revisions from the specified commits. + list -- Print the associated Differential revisions for the specified + commits. + patch -- Try to apply a patch from a Differential revision to the + currently checked out tree. + stage -- Prepare a series of commits to be pushed to the upstream FreeBSD + repository. The commits are cherry-picked to a branch (main by + default), review tags are added to the commit log message, and + the log message is opened in an editor for any last-minute + updates. The commits need not have associated Differential + revisions. + update -- Synchronize the Differential revisions associated with the + specified commits. Currently only the diff is updated; the + review description and other metadata is not synchronized. + + The typical end-to-end usage looks something like this: + + $ git commit -m "kern: Rewrite in Rust" + $ git arc create HEAD + + $ git commit --amend + $ git arc update HEAD + + $ git arc stage HEAD + $ git push freebsd HEAD:main + +Config Variables: + These are manipulated by git-config(1). + + arc.assume_yes [bool] + -- Assume a "yes" answer to all prompts instead of + prompting the user. Equivalent to the -y flag. + + arc.browse [bool] -- Try to open newly created reviews in a browser tab. + Defaults to false. + + arc.list [bool] -- Always use "list mode" (-l) with create. In this + mode, the list of git revisions to create reviews for + is listed with a single prompt before creating + reviews. The diffs for individual commits are not + shown. + + arc.verbose [bool] -- Verbose output. Equivalent to the -v flag. + +Examples: + Create a Phabricator review using the contents of the most recent commit in + your git checkout. The commit title is used as the review title, the commit + log message is used as the review description, markj@FreeBSD.org is added as + a reviewer. + + $ git arc create -r markj HEAD + + Create a series of Phabricator reviews for each of HEAD~2, HEAD~ and HEAD. + Pairs of consecutive commits are linked into a patch stack. Note that the + first commit in the specified range is excluded. + + $ git arc create HEAD~3..HEAD + + Update the review corresponding to commit b409afcfedcdda. The title of the + commit must be the same as it was when the review was created. The review + description is not automatically updated. + + $ git arc update b409afcfedcdda + + Apply the patch in review D12345 to the currently checked-out tree, and stage + it. + + $ git arc patch D12345 + + List the status of reviews for all the commits in the branch "feature": + + $ git arc list main..feature + +__EOF__ + + exit 1 +} + +diff2phid() +{ + local diff + + diff=$1 + if ! expr "$diff" : 'D[1-9][0-9]*$' >/dev/null; then + err "invalid diff ID $diff" + fi + + echo '{"names":["'$diff'"]}' | + arc call-conduit -- phid.lookup | + jq -r "select(.response != []) | .response.${diff}.phid" +} + +diff2status() +{ + local diff tmp status summary + + diff=$1 + if ! expr "$diff" : 'D[1-9][0-9]*$' >/dev/null; then + err "invalid diff ID $diff" + fi + + tmp=$(mktemp) + echo '{"names":["'$diff'"]}' | + arc call-conduit -- phid.lookup > $tmp + status=$(jq -r "select(.response != []) | .response.${diff}.status" < $tmp) + summary=$(jq -r "select(.response != []) | + .response.${diff}.fullName" < $tmp) + printf "%-14s %s\n" "${status}" "${summary}" +} + +log2diff() +{ + local diff + + diff=$(git show -s --format=%B $commit | + sed -nE '/^Differential Revision:[[:space:]]+(https:\/\/reviews.freebsd.org\/)?(D[0-9]+)$/{s//\2/;p;}') + if [ -n "$diff" ] && [ $(echo "$diff" | wc -l) -eq 1 ]; then + echo $diff + else + echo + fi +} + +commit2diff() +{ + local commit diff title + + commit=$1 + + # First, look for a valid differential reference in the commit + # log. + diff=$(log2diff $commit) + if [ -n "$diff" ]; then + echo $diff + return + fi + + # Second, search the open reviews returned by 'arc list' looking + # for a subject match. + title=$(git show -s --format=%s $commit) + diff=$(arc list | fgrep "$title" | egrep -o 'D[1-9][0-9]*:' | tr -d ':') + if [ -z "$diff" ]; then + err "could not find review for '${title}'" + elif [ $(echo "$diff" | wc -l) -ne 1 ]; then + err "found multiple reviews with the same title" + fi + + echo $diff +} + +create_one_review() +{ + local childphid commit dir doprompt msg parent parentphid reviewers + local subscribers + + commit=$1 + reviewers=$2 + subscribers=$3 + parent=$4 + doprompt=$5 + + if [ "$doprompt" ] && ! show_and_prompt $commit; then + return 1 + fi + + git checkout -q $commit + + dir=$(git rev-parse --git-dir)/arc + mkdir -p "$dir" + + msg=${dir}/create-message + git show -s --format='%B' $commit > $msg + printf "\nTest Plan:\n" >> $msg + printf "\nReviewers:\n" >> $msg + printf "${reviewers}\n" >> $msg + printf "\nSubscribers:\n" >> $msg + printf "${subscribers}\n" >> $msg + + yes | env EDITOR=true \ + arc diff --never-apply-patches --create --allow-untracked $BROWSE HEAD~ + [ $? -eq 0 ] || err "could not create Phabricator diff" + + if [ -n "$parent" ]; then + diff=$(commit2diff $commit) + [ -n "$diff" ] || err "failed to look up review ID for $commit" + + childphid=$(diff2phid $diff) + parentphid=$(diff2phid $parent) + echo '{ + "objectIdentifier": "'${childphid}'", + "transactions": [ + { + "type": "parents.add", + "value": ["'${parentphid}'"] + } + ]}' | + arc call-conduit -- differential.revision.edit >&3 + fi + return 0 +} + +# Get a list of reviewers who accepted the specified diff. +diff2reviewers() +{ + local diff phid reviewid userids + + diff=$1 + reviewid=$(diff2phid $diff) + userids=$( \ + echo '{ + "constraints": {"phids": ["'$reviewid'"]}, + "attachments": {"reviewers": true} + }' | + arc call-conduit -- differential.revision.search | + jq '.response.data[0].attachments.reviewers.reviewers[] | select(.status == "accepted").reviewerPHID') + if [ -n "$userids" ]; then + echo '{ + "constraints": {"phids": ['$(echo -n $userids | tr '[:space:]' ',')']} + }' | + arc call-conduit -- user.search | + jq -r '.response.data[].fields.username' + fi +} + +prompt() +{ + local resp + + if [ "$ASSUME_YES" ]; then + return 1 + fi + + printf "\nDoes this look OK? [y/N] " + read resp + + case $resp in + [Yy]) + return 0 + ;; + *) + return 1 + ;; + esac +} + +show_and_prompt() +{ + local commit + + commit=$1 + + git show $commit + prompt +} + +save_head() +{ + local commit orig + + if ! orig=$(git symbolic-ref --short -q HEAD); then + orig=$(git show -s --pretty=%H HEAD) + fi + echo $orig +} + +restore_head() +{ + local orig + + orig=$1 + git checkout -q $orig +} + +build_commit_list() +{ + local chash _commits commits + + for chash in $@; do + _commits=$(git rev-parse "${chash}") + if ! git cat-file -e "${chash}"'^{commit}' >/dev/null 2>&1; then + _commits=$(git rev-list $_commits | tail -r) + fi + [ -n "$_commits" ] || err "invalid commit ID ${chash}" + commits="$commits $_commits" + done + echo $commits +} + +gitarc::create() +{ + local commit commits doprompt list o orig prev reviewers + local subscribers + + list= + if eval $(git config --bool --default false --get arc.list); then + list=1 + fi + doprompt=1 + while getopts lr:s: o; do + case "$o" in + l) + list=1 + ;; + r) + reviewers="$OPTARG" + ;; + s) + subscribers="$OPTARG" + ;; + *) + err_usage + ;; + esac + done + shift $((OPTIND-1)) + + commits=$(build_commit_list $@) + + if [ "$list" ]; then + for commit in ${commits}; do + git --no-pager show --oneline --no-patch $commit + done | git_pager + if ! prompt; then + return + fi + doprompt= + fi + + orig=$(save_head) + prev="" + for commit in ${commits}; do + if create_one_review "$commit" "$reviewers" "$subscribers" "$prev" \ + "$doprompt"; then + prev=$(commit2diff "$commit") + else + prev="" + fi + done + restore_head $orig +} + +gitarc::list() +{ + local chash commit commits diff title + + commits=$(build_commit_list $@) + + for commit in $commits; do + chash=$(git show -s --format='%C(auto)%h' $commit) + echo -n "${chash} " + + diff=$(log2diff $commit) + if [ -n "$diff" ]; then + diff2status $diff + continue + fi + + # This does not use commit2diff as it needs to handle errors + # differently and keep the entire status. The extra 'cat' + # after 'fgrep' avoids erroring due to -e. + title=$(git show -s --format=%s $commit) + diff=$(arc list | fgrep "$title" | cat) + if [ -z "$diff" ]; then + echo "No Review : $title" + elif [ $(echo "$diff" | wc -l) -ne 1 ]; then + echo -n "Ambiguous Reviews: " + echo "$diff" | egrep -o 'D[1-9][0-9]*:' | tr -d ':' \ + | paste -sd ',' - | sed 's/,/, /g' + else + echo "$diff" | sed -e 's/^[^ ]* *//' + fi + done +} + +gitarc::patch() +{ + local rev + + if [ $# -eq 0 ]; then + err_usage + fi + + for rev in $@; do + arc patch --skip-dependencies --nocommit --nobranch --force $rev + echo "Applying ${rev}..." + [ $? -eq 0 ] || break + done +} + +gitarc::stage() +{ + local branch commit commits diff reviewers tmp + + branch=main + while getopts b: o; do + case "$o" in + b) + branch="$OPTARG" + ;; + *) + err_usage + ;; + esac + done + shift $((OPTIND-1)) + + commits=$(build_commit_list $@) + + if [ "$branch" = "main" ]; then + git checkout -q main + else + git checkout -q -b ${branch} main + fi + + tmp=$(mktemp) + for commit in $commits; do + git show -s --format=%B $commit > $tmp + diff=$(arc list | fgrep "$(git show -s --format=%s $commit)" | + egrep -o 'D[1-9][0-9]*:' | tr -d ':') + if [ -n "$diff" ]; then + # XXX this leaves an extra newline in some cases. + reviewers=$(diff2reviewers $diff | sed '/^$/d' | paste -sd ',' - | sed 's/,/, /g') + if [ -n "$reviewers" ]; then + printf "Reviewed by:\t${reviewers}\n" >> $tmp + fi + printf "Differential Revision:\thttps://reviews.freebsd.org/${diff}" >> $tmp + fi + if ! git cherry-pick --no-commit ${commit}; then + warn "Failed to apply $(git rev-parse --short ${commit}). Are you staging patches in the wrong order?" + git checkout -f + break + fi + git commit --edit --file $tmp + done +} + +gitarc::update() +{ + local commit diff orig + + commit=$1 + diff=$(commit2diff $commit) + + if ! show_and_prompt $commit; then + return + fi + + orig=$(save_head) + git checkout -q $commit + + # The linter is stupid and applies patches to the working copy. + # This would be tolerable if it didn't try to correct "misspelled" variable + # names. + arc diff --allow-untracked --never-apply-patches --update $diff HEAD~ + + restore_head $orig +} + +set -e + +ASSUME_YES= +if eval $(git config --bool --default false --get arc.assume-yes); then + ASSUME_YES=1 +fi + +VERBOSE= +while getopts vy o; do + case "$o" in + v) + VERBOSE=1 + ;; + y) + ASSUME_YES=1 + ;; + *) + err_usage + ;; + esac +done +shift $((OPTIND-1)) + +[ $# -ge 1 ] || err_usage + +which arc >/dev/null 2>&1 || err "arc is required, install devel/arcanist" +which jq >/dev/null 2>&1 || err "jq is required, install textproc/jq" + +if [ "$VERBOSE" ]; then + exec 3>&1 +else + exec 3> /dev/null +fi + +case "$1" in +create|list|patch|stage|update) + ;; +*) + err_usage + ;; +esac +verb=$1 +shift + +# All subcommands require at least one parameter. +if [ $# -eq 0 ]; then + err_usage +fi + +# Pull in some git helper functions. +git_sh_setup=$(git --exec-path)/git-sh-setup +[ -f "$git_sh_setup" ] || err "cannot find git-sh-setup" +SUBDIRECTORY_OK=y +USAGE= +. "$git_sh_setup" + +# Bail if the working tree is unclean, except for "list" and "patch" +# operations. +case $verb in +list|patch) + ;; +*) + require_clean_work_tree $verb + ;; +esac + +if eval $(git config --bool --default false --get arc.browse); then + BROWSE=--browse +fi + +gitarc::${verb} $@ From owner-dev-commits-src-main@freebsd.org Fri Feb 5 15:08:40 2021 Return-Path: Delivered-To: dev-commits-src-main@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 70D7554A0CB; Fri, 5 Feb 2021 15:08:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXJhm2mRDz3NBg; Fri, 5 Feb 2021 15:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 51E1B20A2D; Fri, 5 Feb 2021 15:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115F8e7x006986; Fri, 5 Feb 2021 15:08:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115F8e8k006985; Fri, 5 Feb 2021 15:08:40 GMT (envelope-from git) Date: Fri, 5 Feb 2021 15:08:40 GMT Message-Id: <202102051508.115F8e8k006985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 35e39fd95fda - main - Improve ACPI_NFIT_CONTROL_REGION formatting. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35e39fd95fda64699b638192f3bab955d0f1cf0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 15:08:40 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=35e39fd95fda64699b638192f3bab955d0f1cf0c commit 35e39fd95fda64699b638192f3bab955d0f1cf0c Author: Alexander Motin AuthorDate: 2021-02-05 15:07:37 +0000 Commit: Alexander Motin CommitDate: 2021-02-05 15:08:34 +0000 Improve ACPI_NFIT_CONTROL_REGION formatting. MFC after: 1 week --- usr.sbin/acpi/acpidump/acpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index c573c02b7f92..2753fb26bdd9 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1659,20 +1659,20 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tRegionIndex=%u\n", (u_int)ctlreg->RegionIndex); printf("\tVendorId=0x%04x\n", (u_int)ctlreg->VendorId); printf("\tDeviceId=0x%04x\n", (u_int)ctlreg->DeviceId); - printf("\tRevisionId=%u\n", (u_int)ctlreg->RevisionId); + printf("\tRevisionId=0x%02x\n", (u_int)ctlreg->RevisionId); printf("\tSubsystemVendorId=0x%04x\n", (u_int)ctlreg->SubsystemVendorId); printf("\tSubsystemDeviceId=0x%04x\n", (u_int)ctlreg->SubsystemDeviceId); - printf("\tSubsystemRevisionId=%u\n", + printf("\tSubsystemRevisionId=0x%02x\n", (u_int)ctlreg->SubsystemRevisionId); printf("\tValidFields=0x%02x\n", (u_int)ctlreg->ValidFields); - printf("\tManufacturingLocation=%u\n", + printf("\tManufacturingLocation=0x%02x\n", (u_int)ctlreg->ManufacturingLocation); - printf("\tManufacturingDate=%u\n", - (u_int)ctlreg->ManufacturingDate); - printf("\tSerialNumber=%u\n", - (u_int)ctlreg->SerialNumber); + printf("\tManufacturingDate=%04x\n", + (u_int)be16toh(ctlreg->ManufacturingDate)); + printf("\tSerialNumber=%08X\n", + (u_int)be32toh(ctlreg->SerialNumber)); printf("\tCode=0x%04x\n", (u_int)ctlreg->Code); printf("\tWindows=%u\n", (u_int)ctlreg->Windows); printf("\tWindowSize=0x%016jx\n", From owner-dev-commits-src-main@freebsd.org Fri Feb 5 15:55:40 2021 Return-Path: Delivered-To: dev-commits-src-main@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 853C354B2A1; Fri, 5 Feb 2021 15:55:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXKl03KMSz3QrF; Fri, 5 Feb 2021 15:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 603F4215C1; Fri, 5 Feb 2021 15:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115FteAg071309; Fri, 5 Feb 2021 15:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115FteFo071308; Fri, 5 Feb 2021 15:55:40 GMT (envelope-from git) Date: Fri, 5 Feb 2021 15:55:40 GMT Message-Id: <202102051555.115FteFo071308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 59fffbcf46ba - main - mrsas: unbreak i386 build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59fffbcf46ba6369420e655ff9173571410c643d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 15:55:40 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=59fffbcf46ba6369420e655ff9173571410c643d commit 59fffbcf46ba6369420e655ff9173571410c643d Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-05 18:43:48 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 18:43:48 +0000 mrsas: unbreak i386 build Fix build regression introduced by e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D28494 --- sys/dev/mrsas/mrsas.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index f4c34e237fc4..01173387c8d4 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -2782,9 +2782,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); - req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); - req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); - + req_desc.addr.Words = htole64((bus_addr_t)sc->ioc_init_phys_mem); req_desc.MFAIo.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); From owner-dev-commits-src-main@freebsd.org Fri Feb 5 16:29:07 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F2AB454B67E; Fri, 5 Feb 2021 16:29:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXLTZ6Ww1z3jMk; Fri, 5 Feb 2021 16:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D347D21BF4; Fri, 5 Feb 2021 16:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115GT6tk011083; Fri, 5 Feb 2021 16:29:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115GT6sD011082; Fri, 5 Feb 2021 16:29:06 GMT (envelope-from git) Date: Fri, 5 Feb 2021 16:29:06 GMT Message-Id: <202102051629.115GT6sD011082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 90da2c797bfa - main - truss: Decode sendfile(2) arguments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90da2c797bfa7639005ed46ab9173feb8bd85ecd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 16:29:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=90da2c797bfa7639005ed46ab9173feb8bd85ecd commit 90da2c797bfa7639005ed46ab9173feb8bd85ecd Author: Mark Johnston AuthorDate: 2021-02-05 16:28:09 +0000 Commit: Mark Johnston CommitDate: 2021-02-05 16:28:29 +0000 truss: Decode sendfile(2) arguments MFC after: 2 weeks --- usr.bin/truss/syscall.h | 2 ++ usr.bin/truss/syscalls.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index 5f8babf4c407..af918fed4f1b 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -117,6 +117,8 @@ enum Argtype { Procctl, Priowhich, Ptraceop, + Sendfileflags, + Sendfilehdtr, Quotactlcmd, Reboothowto, Resource, diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 319f3d8b0793..f52a82ed97c0 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -478,6 +478,10 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 }, { Sockaddr | IN, 3 }, { Socklent, 4 }, { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } }, + { .name = "sendfile", .ret_type = 1, .nargs = 7, + .args = { { Int, 0 }, { Int, 1 }, { QuadHex, 2 }, { Sizet, 3 }, + { Sendfilehdtr, 4 }, { QuadHex | OUT, 5 }, + { Sendfileflags, 6 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, @@ -2670,6 +2674,24 @@ print_arg(struct syscall_args *sc, unsigned long *args, register_t *retval, print_integer_arg(sysdecode_ptrace_request, fp, args[sc->offset]); break; + case Sendfileflags: + print_mask_arg(sysdecode_sendfile_flags, fp, args[sc->offset]); + break; + case Sendfilehdtr: { + struct sf_hdtr hdtr; + + if (get_struct(pid, args[sc->offset], &hdtr, sizeof(hdtr)) != + -1) { + fprintf(fp, "{"); + print_iovec(fp, trussinfo, (uintptr_t)hdtr.headers, + hdtr.hdr_cnt); + print_iovec(fp, trussinfo, (uintptr_t)hdtr.trailers, + hdtr.trl_cnt); + fprintf(fp, "}"); + } else + print_pointer(fp, args[sc->offset]); + break; + } case Quotactlcmd: if (!sysdecode_quotactl_cmd(fp, args[sc->offset])) fprintf(fp, "%#x", (int)args[sc->offset]); From owner-dev-commits-src-main@freebsd.org Fri Feb 5 16:47:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9F5FA54BDF8; Fri, 5 Feb 2021 16:47:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXLtd46KPz3l4c; Fri, 5 Feb 2021 16:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8023421E32; Fri, 5 Feb 2021 16:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115GlLZ3036912; Fri, 5 Feb 2021 16:47:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115GlLMa036911; Fri, 5 Feb 2021 16:47:21 GMT (envelope-from git) Date: Fri, 5 Feb 2021 16:47:21 GMT Message-Id: <202102051647.115GlLMa036911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: 7b1d1a1658ff - main - release: disable the 'reldoc' target after the ASCIIDoctor switch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 16:47:21 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b1d1a1658ffb69eff93afc713f9e88ed8b20eac commit 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac Author: Glen Barber AuthorDate: 2021-02-05 16:46:49 +0000 Commit: Glen Barber CommitDate: 2021-02-05 16:47:15 +0000 release: disable the 'reldoc' target after the ASCIIDoctor switch The 'reldoc' target includes release-related documentation on installation medium. Since the switch from XML to ASCIIDoctor, the file locations have moved, and it will take some time to sort out how this target should work now. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/release/Makefile b/release/Makefile index 3df1e461d64e..77df7762e412 100644 --- a/release/Makefile +++ b/release/Makefile @@ -88,9 +88,9 @@ EXTRA_PACKAGES+= ports.txz .if !defined(NOSRC) EXTRA_PACKAGES+= src.txz .endif -.if !defined(NODOC) -EXTRA_PACKAGES+= reldoc -.endif +#.if !defined(NODOC) +#EXTRA_PACKAGES+= reldoc +#.endif RELEASE_TARGETS= ftp IMAGES= @@ -119,9 +119,9 @@ CLEANFILES+= ${I}.xz CLEANFILES+= pkg-stage .endif CLEANDIRS= dist ftp disc1 bootonly dvd -.if !defined(NODOC) -CLEANDIRS+= reldoc rdoc -.endif +#.if !defined(NODOC) +#CLEANDIRS+= reldoc rdoc +#.endif beforeclean: chflags -R noschg . .include @@ -161,22 +161,22 @@ ports.txz: --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \ ${XZ_CMD} > ${.OBJDIR}/ports.txz -reldoc: - cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ - env MAN4DIR=${WORLDDIR}/share/man/man4 \ - _BRANCH=${BRANCH} \ - ${MAKE} all install clean "FORMATS=html txt" \ - INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ - WEBDIR=${DOCDIR} DESTDIR=${.OBJDIR}/rdoc - mkdir -p reldoc -.for i in hardware readme relnotes errata - ln -f ${.OBJDIR}/rdoc/${i:tl}.txt \ - reldoc/${i:tu}.TXT - ln -f ${.OBJDIR}/rdoc/${i:tl}.html \ - reldoc/${i:tu}.HTML -.endfor - cp ${.OBJDIR}/rdoc/docbook.css \ - reldoc/ +#reldoc: +# cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ +# env MAN4DIR=${WORLDDIR}/share/man/man4 \ +# _BRANCH=${BRANCH} \ +# ${MAKE} all install clean "FORMATS=html txt" \ +# INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ +# WEBDIR=${DOCDIR} DESTDIR=${.OBJDIR}/rdoc +# mkdir -p reldoc +#.for i in hardware readme relnotes errata +# ln -f ${.OBJDIR}/rdoc/${i:tl}.txt \ +# reldoc/${i:tu}.TXT +# ln -f ${.OBJDIR}/rdoc/${i:tl}.html \ +# reldoc/${i:tu}.HTML +#.endfor +# cp ${.OBJDIR}/rdoc/docbook.css \ +# reldoc/ disc1: packagesystem # Install system @@ -194,9 +194,9 @@ disc1: packagesystem do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf @@ -222,9 +222,9 @@ bootonly: packagesystem mkdir -p ${.TARGET}/usr/freebsd-dist cp MANIFEST ${.TARGET}/usr/freebsd-dist # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf @@ -247,9 +247,9 @@ dvd: packagesystem do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf From owner-dev-commits-src-main@freebsd.org Fri Feb 5 19:50:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CC99252881D; Fri, 5 Feb 2021 19:50:41 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXQy95WWyz4SB0; Fri, 5 Feb 2021 19:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B060E246B6; Fri, 5 Feb 2021 19:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115JofiX079902; Fri, 5 Feb 2021 19:50:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115Jof5Q079901; Fri, 5 Feb 2021 19:50:41 GMT (envelope-from git) Date: Fri, 5 Feb 2021 19:50:41 GMT Message-Id: <202102051950.115Jof5Q079901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 20e1817f9a68 - main - mrsas: update man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20e1817f9a68abd9a232367e04d2afeaf4a3c2f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 19:50:41 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=20e1817f9a68abd9a232367e04d2afeaf4a3c2f8 commit 20e1817f9a68abd9a232367e04d2afeaf4a3c2f8 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 06:13:13 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 22:47:45 +0000 mrsas: update man page update mrsas(4) since big-endian is supported since e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Reviewed by: bdragon, gbe Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28475 --- share/man/man4/mrsas.4 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/share/man/man4/mrsas.4 b/share/man/man4/mrsas.4 index fb2288d91f80..0528ee2fa1bd 100644 --- a/share/man/man4/mrsas.4 +++ b/share/man/man4/mrsas.4 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2019 +.Dd February 4, 2021 .Dt MRSAS 4 .Os .Sh NAME @@ -385,8 +385,6 @@ The driver and this manual page were written by .An Kashyap Desai Aq Mt Kashyap.Desai@lsi.com . .Sh TODO -The driver does not support big-endian architectures at this time. -.Pp The driver does not support alias for device name (it is required when the user switches between two drivers and does not want to edit .Pa /etc/fstab From owner-dev-commits-src-main@freebsd.org Fri Feb 5 19:50:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EF78652867A; Fri, 5 Feb 2021 19:50:42 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXQyB6S3Kz4S3X; Fri, 5 Feb 2021 19:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D0BE924781; Fri, 5 Feb 2021 19:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115JogIt079922; Fri, 5 Feb 2021 19:50:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115JogR2079921; Fri, 5 Feb 2021 19:50:42 GMT (envelope-from git) Date: Fri, 5 Feb 2021 19:50:42 GMT Message-Id: <202102051950.115JogR2079921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: eaffd270d872 - main - [POWERPC64LE] add mrsas to GENERIC64LE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eaffd270d8729c4d79f6ce268275ef4c0e6f7b04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 19:50:43 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=eaffd270d8729c4d79f6ce268275ef4c0e6f7b04 commit eaffd270d8729c4d79f6ce268275ef4c0e6f7b04 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 06:12:38 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 22:47:57 +0000 [POWERPC64LE] add mrsas to GENERIC64LE Reviewed by: bdragon Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28475 --- sys/powerpc/conf/GENERIC64LE | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 06bdb4c43124..2e16ff5d5edb 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -134,6 +134,7 @@ device ahc # AHA2940 and onboard AIC7xxx devices options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters +device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D From owner-dev-commits-src-main@freebsd.org Fri Feb 5 21:15:59 2021 Return-Path: Delivered-To: dev-commits-src-main@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 29F5352A69B; Fri, 5 Feb 2021 21:15:59 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXSrY2qNPz4Z3C; Fri, 5 Feb 2021 21:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2E447259A2; Fri, 5 Feb 2021 21:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115LFvdv089403; Fri, 5 Feb 2021 21:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115LFvRT089402; Fri, 5 Feb 2021 21:15:57 GMT (envelope-from git) Date: Fri, 5 Feb 2021 21:15:57 GMT Message-Id: <202102052115.115LFvRT089402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 92d0d6bb14d2 - main - Print DeviceHandle and PhysicalId in hex. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92d0d6bb14d24abea0786edf546af316ff4a2afe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 21:15:59 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=92d0d6bb14d24abea0786edf546af316ff4a2afe commit 92d0d6bb14d24abea0786edf546af316ff4a2afe Author: Alexander Motin AuthorDate: 2021-02-05 21:13:55 +0000 Commit: Alexander Motin CommitDate: 2021-02-05 21:15:53 +0000 Print DeviceHandle and PhysicalId in hex. The first is actually a bitfield. The second is printed in hex by dmidecode, so uniformidy should be good. MFC after: 1 week --- usr.sbin/acpi/acpidump/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 2753fb26bdd9..adb5b968f441 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1615,8 +1615,8 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) break; case ACPI_NFIT_TYPE_MEMORY_MAP: mmap = (ACPI_NFIT_MEMORY_MAP *)nfit; - printf("\tDeviceHandle=%u\n", (u_int)mmap->DeviceHandle); - printf("\tPhysicalId=%u\n", (u_int)mmap->PhysicalId); + printf("\tDeviceHandle=0x%x\n", (u_int)mmap->DeviceHandle); + printf("\tPhysicalId=0x%04x\n", (u_int)mmap->PhysicalId); printf("\tRegionId=%u\n", (u_int)mmap->RegionId); printf("\tRangeIndex=%u\n", (u_int)mmap->RangeIndex); printf("\tRegionIndex=%u\n", (u_int)mmap->RegionIndex); From owner-dev-commits-src-main@freebsd.org Fri Feb 5 23:40:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1323552D275; Fri, 5 Feb 2021 23:40:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXX3800G8z4hxb; Fri, 5 Feb 2021 23:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E299F2717A; Fri, 5 Feb 2021 23:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115NeJt0078358; Fri, 5 Feb 2021 23:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeJmE078351; Fri, 5 Feb 2021 23:40:19 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:19 GMT Message-Id: <202102052340.115NeJmE078351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: b54ed778fe45 - main - cache: comment on FNV MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b54ed778fe45d482bd1e2009df802fda26f94495 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 23:40:20 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b54ed778fe45d482bd1e2009df802fda26f94495 commit b54ed778fe45d482bd1e2009df802fda26f94495 Author: Mateusz Guzik AuthorDate: 2021-02-03 20:44:54 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:13:57 +0000 cache: comment on FNV --- sys/kern/vfs_cache.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index db482ea4eba3..47abe0feb152 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -704,9 +704,31 @@ out: SDT_PROBE1(vfs, namecache, purge, batch, i); } +/* + * Hashing. + * + * The code was made to use FNV in 2001 and this choice needs to be revisited. + * + * Short summary of the difficulty: + * The longest name which can be inserted is NAME_MAX characters in length (or + * 255 at the time of writing this comment), while majority of names used in + * practice are significantly shorter (mostly below 10). More importantly + * majority of lookups performed find names are even shorter than that. + * + * This poses a problem where hashes which do better than FNV past word size + * (or so) tend to come with additional overhead when finalizing the result, + * making them noticeably slower for the most commonly used range. + * + * Consider a path like: /usr/obj/usr/src/sys/amd64/GENERIC/vnode_if.c + * + * When looking it up the most time consuming part by a large margin (at least + * on amd64) is hashing. Replacing FNV with something which pessimizes short + * input would make the slowest part stand out even more. + */ + /* * TODO: With the value stored we can do better than computing the hash based - * on the address. The choice of FNV should also be revisited. + * on the address. */ static void cache_prehash(struct vnode *vp) From owner-dev-commits-src-main@freebsd.org Fri Feb 5 23:40:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1D09E52D58A; Fri, 5 Feb 2021 23:40:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXX390BLBz4hxd; Fri, 5 Feb 2021 23:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 EDD1B26E76; Fri, 5 Feb 2021 23:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115NeK30078815; Fri, 5 Feb 2021 23:40:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeKSg078812; Fri, 5 Feb 2021 23:40:20 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:20 GMT Message-Id: <202102052340.115NeKSg078812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 2e96132a7d8b - main - cache: drop spurious arg from panic in cache_validate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e96132a7d8bbb2347a3b4776806324f984aa49f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 23:40:21 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2e96132a7d8bbb2347a3b4776806324f984aa49f commit 2e96132a7d8bbb2347a3b4776806324f984aa49f Author: Mateusz Guzik AuthorDate: 2021-02-05 22:49:59 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:28:39 +0000 cache: drop spurious arg from panic in cache_validate vp is already reported when noting mismatch --- sys/kern/vfs_cache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 47abe0feb152..5cfc23779c42 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2824,9 +2824,8 @@ cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) { if (ncp->nc_vp != vp) - panic("%s: mismatch (%p != %p); ncp %p [%s] dvp %p vp %p\n", - __func__, vp, ncp->nc_vp, ncp, ncp->nc_name, ncp->nc_dvp, - ncp->nc_vp); + panic("%s: mismatch (%p != %p); ncp %p [%s] dvp %p\n", + __func__, vp, ncp->nc_vp, ncp, ncp->nc_name, ncp->nc_dvp); } } mtx_unlock(blp); From owner-dev-commits-src-main@freebsd.org Fri Feb 5 23:40:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 969C552D604; Fri, 5 Feb 2021 23:40:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXX3B300Nz4j5g; Fri, 5 Feb 2021 23:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 22E3827688; Fri, 5 Feb 2021 23:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115NeMaq079145; Fri, 5 Feb 2021 23:40:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeM4I079144; Fri, 5 Feb 2021 23:40:22 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:22 GMT Message-Id: <202102052340.115NeM4I079144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 0e1594e60e5e - main - cache: fix vfs:namecache:lookup:miss probe call sites MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e1594e60e5e0b1fddc33225171f1d1c6a421ed4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 23:40:22 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0e1594e60e5e0b1fddc33225171f1d1c6a421ed4 commit 0e1594e60e5e0b1fddc33225171f1d1c6a421ed4 Author: Mateusz Guzik AuthorDate: 2021-02-05 22:58:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:28:40 +0000 cache: fix vfs:namecache:lookup:miss probe call sites --- sys/kern/vfs_cache.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 5cfc23779c42..50ec6face6ac 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1767,7 +1767,7 @@ retry: mtx_lock(dvlp); ncp = dvp->v_cache_dd; if (ncp == NULL) { - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, "..", NULL); + SDT_PROBE2(vfs, namecache, lookup, miss, dvp, ".."); mtx_unlock(dvlp); return (0); } @@ -1894,8 +1894,7 @@ retry: if (__predict_false(ncp == NULL)) { mtx_unlock(blp); - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, - NULL); + SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr); counter_u64_add(nummiss, 1); return (0); } @@ -1990,8 +1989,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, if (__predict_false(ncp == NULL)) { vfs_smr_exit(); - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, - NULL); + SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr); counter_u64_add(nummiss, 1); return (0); } From owner-dev-commits-src-main@freebsd.org Fri Feb 5 23:40:23 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E9A3252D526; Fri, 5 Feb 2021 23:40:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXX3C4HC8z4hxv; Fri, 5 Feb 2021 23:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 49F8B27608; Fri, 5 Feb 2021 23:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115NeNDu079167; Fri, 5 Feb 2021 23:40:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeNTi079166; Fri, 5 Feb 2021 23:40:23 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:23 GMT Message-Id: <202102052340.115NeNTi079166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 2f8a84463531 - main - cache: remove the largely obsolete general description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f8a844635312b0f25028a87459fdd2d2a1cbfd6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 23:40:24 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2f8a844635312b0f25028a87459fdd2d2a1cbfd6 commit 2f8a844635312b0f25028a87459fdd2d2a1cbfd6 Author: Mateusz Guzik AuthorDate: 2021-02-05 23:16:55 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:28:40 +0000 cache: remove the largely obsolete general description Examples of inconsistencies with the current state: - references LRU of all entries, removed years ago - references a non-existent lock (neglist) - claims negative entries have a NULL target It will be replaced with a more accurate and more informative description. In the meantime take it out so it stops misleading. --- sys/kern/vfs_cache.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 50ec6face6ac..21eb436681fc 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -276,52 +276,6 @@ cache_ncp_invalidate(struct namecache *ncp) __predict_true((_nc_flag & (NCF_INVALID | NCF_WIP | NCF_WHITE)) == 0); \ }) -/* - * Name caching works as follows: - * - * Names found by directory scans are retained in a cache - * for future reference. It is managed LRU, so frequently - * used names will hang around. Cache is indexed by hash value - * obtained from (dvp, name) where dvp refers to the directory - * containing name. - * - * If it is a "negative" entry, (i.e. for a name that is known NOT to - * exist) the vnode pointer will be NULL. - * - * Upon reaching the last segment of a path, if the reference - * is for DELETE, or NOCACHE is set (rewrite), and the - * name is located in the cache, it will be dropped. - * - * These locks are used (in the order in which they can be taken): - * NAME TYPE ROLE - * vnodelock mtx vnode lists and v_cache_dd field protection - * bucketlock mtx for access to given set of hash buckets - * neglist mtx negative entry LRU management - * - * It is legal to take multiple vnodelock and bucketlock locks. The locking - * order is lower address first. Both are recursive. - * - * "." lookups are lockless. - * - * ".." and vnode -> name lookups require vnodelock. - * - * name -> vnode lookup requires the relevant bucketlock to be held for reading. - * - * Insertions and removals of entries require involved vnodes and bucketlocks - * to be locked to provide safe operation against other threads modifying the - * cache. - * - * Some lookups result in removal of the found entry (e.g. getting rid of a - * negative entry with the intent to create a positive one), which poses a - * problem when multiple threads reach the state. Similarly, two different - * threads can purge two different vnodes and try to remove the same name. - * - * If the already held vnode lock is lower than the second required lock, we - * can just take the other lock. However, in the opposite case, this could - * deadlock. As such, this is resolved by trylocking and if that fails unlocking - * the first node, locking everything in order and revalidating the state. - */ - VFS_SMR_DECLARE; static SYSCTL_NODE(_vfs_cache, OID_AUTO, param, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, From owner-dev-commits-src-main@freebsd.org Sat Feb 6 02:27:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 BB0A0530CAF; Sat, 6 Feb 2021 02:27:14 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXblk4t2qz4trk; Sat, 6 Feb 2021 02:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 95FEA1360; Sat, 6 Feb 2021 02:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1162REmR093199; Sat, 6 Feb 2021 02:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162REuL093198; Sat, 6 Feb 2021 02:27:14 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:27:14 GMT Message-Id: <202102060227.1162REuL093198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 8b804ee616b4 - main - powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b804ee616b4c8810015b69e37e31ef0c4161511 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 02:27:14 -0000 The branch main has been updated by pkubaj (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8b804ee616b4c8810015b69e37e31ef0c4161511 commit 8b804ee616b4c8810015b69e37e31ef0c4161511 Author: Piotr Kubaj AuthorDate: 2021-02-06 02:21:55 +0000 Commit: Piotr Kubaj CommitDate: 2021-02-06 02:21:55 +0000 powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12 lang/rust needs COMPAT_FREEBSD11 to build, even though powerpc64le itself is supported only since 13.0. I also corrected a comment, because if we ever have lib32 for powerpc64le, it will be for powerpcle. Reviewed by: bdragon (on IRC) --- sys/powerpc/conf/GENERIC64LE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 2e16ff5d5edb..fc4fc4ceac7c 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -65,7 +65,9 @@ options TMPFS #Efficient memory filesystem options GEOM_PART_APM #Apple Partition Maps. options GEOM_PART_GPT #GUID Partition Tables. options GEOM_LABEL #Provides labelization -#options COMPAT_FREEBSD32 #Compatible with FreeBSD/powerpc binaries +#options COMPAT_FREEBSD32 #Compatible with FreeBSD/powerpcle binaries +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support From owner-dev-commits-src-main@freebsd.org Sat Feb 6 02:40:16 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DF38453148D; Sat, 6 Feb 2021 02:40:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXc2m62hJz4vjr; Sat, 6 Feb 2021 02:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C1CE31A87; Sat, 6 Feb 2021 02:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1162eGQc012156; Sat, 6 Feb 2021 02:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162eGuu012146; Sat, 6 Feb 2021 02:40:16 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:40:16 GMT Message-Id: <202102060240.1162eGuu012146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: e673debe7db8 - main - Simplify BSD macro tests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e673debe7db8ba95e4ee3b549d2570e71d19b596 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 02:40:16 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e673debe7db8ba95e4ee3b549d2570e71d19b596 commit e673debe7db8ba95e4ee3b549d2570e71d19b596 Author: Cy Schubert AuthorDate: 2021-02-03 03:18:48 +0000 Commit: Cy Schubert CommitDate: 2021-02-06 02:39:38 +0000 Simplify BSD macro tests. All FreeBSD and NetBSD are BSD >= 199306 and have been for a long time. MFC after: 1 week --- contrib/ipfilter/ipsend/sbpf.c | 3 --- contrib/ipfilter/ipsend/sock.c | 4 ---- contrib/ipfilter/man/ipf.4 | 4 ++-- contrib/ipfilter/tools/ipfsyncd.c | 2 +- contrib/ipfilter/tools/ipmon.c | 2 +- sys/contrib/ipfilter/netinet/ip_compat.h | 4 ++-- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 4 ---- sys/contrib/ipfilter/netinet/ip_log.c | 2 +- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 8 -------- 9 files changed, 7 insertions(+), 26 deletions(-) diff --git a/contrib/ipfilter/ipsend/sbpf.c b/contrib/ipfilter/ipsend/sbpf.c index fcb66bc9ca2f..97559650f3b4 100644 --- a/contrib/ipfilter/ipsend/sbpf.c +++ b/contrib/ipfilter/ipsend/sbpf.c @@ -12,9 +12,6 @@ #include #include #include -#if BSD < 199103 -#include -#endif #if (__FreeBSD_version >= 300000) # include #else diff --git a/contrib/ipfilter/ipsend/sock.c b/contrib/ipfilter/ipsend/sock.c index a39f9de16345..ddb59eb029f8 100644 --- a/contrib/ipfilter/ipsend/sock.c +++ b/contrib/ipfilter/ipsend/sock.c @@ -95,11 +95,7 @@ struct proc *proc; #endif -#if BSD < 199103 -static struct proc *getproc(void); -#else static struct kinfo_proc *getproc(void); -#endif int kmemcpy(buf, pos, n) diff --git a/contrib/ipfilter/man/ipf.4 b/contrib/ipfilter/man/ipf.4 index 9b82e01bfc76..73a17a0cc8d3 100644 --- a/contrib/ipfilter/man/ipf.4 +++ b/contrib/ipfilter/man/ipf.4 @@ -60,7 +60,7 @@ typedef struct frentry { struct frentry *fr_grp; int fr_ref; /* reference count - for grouping */ void *fr_ifa; -#if BSD >= 199306 +#ifdef BSD void *fr_oifa; #endif /* @@ -93,7 +93,7 @@ typedef struct frentry { int (*fr_func)(int, ip_t *, fr_info_t *)); char fr_icode; /* return ICMP code */ char fr_ifname[IFNAMSIZ]; -#if BSD > 199306 +#ifdef BSD char fr_oifname[IFNAMSIZ]; #endif struct frdest fr_tif; /* "to" interface */ diff --git a/contrib/ipfilter/tools/ipfsyncd.c b/contrib/ipfilter/tools/ipfsyncd.c index 0ccc15542f6b..a75075059763 100644 --- a/contrib/ipfilter/tools/ipfsyncd.c +++ b/contrib/ipfilter/tools/ipfsyncd.c @@ -131,7 +131,7 @@ main(argc, argv) if (!debuglevel) { -#if BSD >= 199306 +#ifdef BSD daemon(0, 0); #else int fd = open("/dev/null", O_RDWR); diff --git a/contrib/ipfilter/tools/ipmon.c b/contrib/ipfilter/tools/ipmon.c index f14cef832722..9022f12b6149 100644 --- a/contrib/ipfilter/tools/ipmon.c +++ b/contrib/ipfilter/tools/ipmon.c @@ -1702,7 +1702,7 @@ int main(argc, argv) if (make_daemon && ((config.log != stdout) || (ipmonopts & IPMON_SYSLOG))) { -#if BSD >= 199306 +#ifdef BSD daemon(0, !(ipmonopts & IPMON_SYSLOG)); #else int pid; diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 490e939f7f37..3de517b4559d 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -424,12 +424,12 @@ extern mb_t *allocmbt(size_t); # define USE_QUAD_T # define U_QUAD_T unsigned long long # define QUAD_T long long -#else /* BSD > 199306 */ +#else /* BSD */ # if !defined(U_QUAD_T) # define U_QUAD_T u_long # define QUAD_T long # endif -#endif /* BSD > 199306 */ +#endif /* BSD */ #ifdef USE_INET6 diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 338c4e24c03a..39fe0933f417 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -288,14 +288,12 @@ ipfioctl(dev, cmd, data, mode, p) SPL_INT(s); CURVNET_SET(TD_TO_VNET(p)); -#if (BSD >= 199306) if (securelevel_ge(p->p_cred, 3) && (mode & FWRITE)) { V_ipfmain.ipf_interror = 130001; CURVNET_RESTORE(); return EPERM; } -#endif unit = GET_MINOR(dev); if ((IPL_LOGMAX < unit) || (unit < 0)) { @@ -382,11 +380,9 @@ ipf_send_reset(fin) } m->m_len = sizeof(*tcp2) + hlen; -#if (BSD >= 199103) m->m_data += max_linkhdr; m->m_pkthdr.len = m->m_len; m->m_pkthdr.rcvif = (struct ifnet *)0; -#endif ip = mtod(m, struct ip *); bzero((char *)ip, hlen); #ifdef USE_INET6 diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c index e5bf6a78bf1b..d7acaf1ebf4e 100644 --- a/sys/contrib/ipfilter/netinet/ip_log.c +++ b/sys/contrib/ipfilter/netinet/ip_log.c @@ -734,7 +734,7 @@ ipf_log_read(softc, unit, uio) return EIO; } -# if (defined(BSD) && (BSD >= 199101)) || defined(__FreeBSD__) +# if defined(BSD) uio->uio_rw = UIO_READ; # endif diff --git a/sys/contrib/ipfilter/netinet/mlfk_ipl.c b/sys/contrib/ipfilter/netinet/mlfk_ipl.c index 0b9fdb76263e..1f4daf28824d 100644 --- a/sys/contrib/ipfilter/netinet/mlfk_ipl.c +++ b/sys/contrib/ipfilter/netinet/mlfk_ipl.c @@ -536,12 +536,8 @@ static int ipfclose(dev, flags * called during packet processing and cause an inconsistancy to appear in * the filter lists. */ -#if (BSD >= 199306) static int ipfread(dev, uio, ioflag) int ioflag; -#else -static int ipfread(dev, uio) -#endif #ifdef __FreeBSD_version struct cdev *dev; #else @@ -583,12 +579,8 @@ static int ipfread(dev, uio) * called during packet processing and cause an inconsistancy to appear in * the filter lists. */ -#if (BSD >= 199306) static int ipfwrite(dev, uio, ioflag) int ioflag; -#else -static int ipfwrite(dev, uio) -#endif #ifdef __FreeBSD_version struct cdev *dev; #else From owner-dev-commits-src-main@freebsd.org Sat Feb 6 02:40:17 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EB59D5310F1; Sat, 6 Feb 2021 02:40:17 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXc2n6K9nz4vh9; Sat, 6 Feb 2021 02:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 CB5A61A88; Sat, 6 Feb 2021 02:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1162eHAZ012659; Sat, 6 Feb 2021 02:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162eHYJ012657; Sat, 6 Feb 2021 02:40:17 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:40:17 GMT Message-Id: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 10990cb46027 - main - Simplify FreeBSD check. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10990cb46027b4cc4339540b1217117863b2cd15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 02:40:18 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=10990cb46027b4cc4339540b1217117863b2cd15 commit 10990cb46027b4cc4339540b1217117863b2cd15 Author: Cy Schubert AuthorDate: 2021-02-03 03:24:05 +0000 Commit: Cy Schubert CommitDate: 2021-02-06 02:39:38 +0000 Simplify FreeBSD check. MFC after: 1 week --- contrib/ipfilter/ipsend/sbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ipfilter/ipsend/sbpf.c b/contrib/ipfilter/ipsend/sbpf.c index 97559650f3b4..9b4f20c3fea9 100644 --- a/contrib/ipfilter/ipsend/sbpf.c +++ b/contrib/ipfilter/ipsend/sbpf.c @@ -12,7 +12,7 @@ #include #include #include -#if (__FreeBSD_version >= 300000) +#ifdef __FreeBSD_version # include #else # include From owner-dev-commits-src-main@freebsd.org Sat Feb 6 02:40:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B598D531499; Sat, 6 Feb 2021 02:40:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXc2q0pfPz4vhD; Sat, 6 Feb 2021 02:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 013EF191A; Sat, 6 Feb 2021 02:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1162eIlH013185; Sat, 6 Feb 2021 02:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162eIcl013179; Sat, 6 Feb 2021 02:40:18 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:40:18 GMT Message-Id: <202102060240.1162eIcl013179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 344f1083e128 - main - ipfilter: Use the softn (NAT softc) host map size in ip_nat6 calculation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 344f1083e128d8d41ca31853dac513ca3efd9d1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 02:40:19 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=344f1083e128d8d41ca31853dac513ca3efd9d1f commit 344f1083e128d8d41ca31853dac513ca3efd9d1f Author: Cy Schubert AuthorDate: 2021-02-05 14:26:04 +0000 Commit: Cy Schubert CommitDate: 2021-02-06 02:39:38 +0000 ipfilter: Use the softn (NAT softc) host map size in ip_nat6 calculation. The ipfilter NAT table host map size is a tunable that defaults to a macro value defined at build time. HOSTMAP_SIZE is saved in softn (the ipnat softc) at initialization. It can be tuned (changed) at runtime using the ipf -T command. If the hostmap_size tunable is adjusted the calculation to determine where to put new entries in the table was incorrect. Use the tunable in the NAT softc instead of the static build time value. MFC after: 1 week --- sys/contrib/ipfilter/netinet/ip_nat6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c index b2713aec812a..13fa6fb6bc30 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat6.c +++ b/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -390,7 +390,7 @@ ipf_nat6_hostmap(softn, np, src, dst, map, port) hv += dst->i6[2]; hv += dst->i6[1]; hv += dst->i6[0]; - hv %= HOSTMAP_SIZE; + hv %= softn->ipf_nat_hostmap_sz; for (hm = softn->ipf_hm_maptable[hv]; hm; hm = hm->hm_next) if (IP6_EQ(&hm->hm_osrc6, src) && IP6_EQ(&hm->hm_odst6, dst) && From owner-dev-commits-src-main@freebsd.org Sat Feb 6 10:11:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DDF315434CD; Sat, 6 Feb 2021 10:11:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXp3p5vD4z3v0c; Sat, 6 Feb 2021 10:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BD58F7A9E; Sat, 6 Feb 2021 10:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 116ABoQf005519; Sat, 6 Feb 2021 10:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116ABoRN005518; Sat, 6 Feb 2021 10:11:50 GMT (envelope-from git) Date: Sat, 6 Feb 2021 10:11:50 GMT Message-Id: <202102061011.116ABoRN005518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: f961caf2184c - main - netgraph/ng_bridge: Introduce "uplink" ports without MAC learning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f961caf2184c94d6f59c8d522207156b3533d977 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 10:11:50 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=f961caf2184c94d6f59c8d522207156b3533d977 commit f961caf2184c94d6f59c8d522207156b3533d977 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:08:24 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 10:09:26 +0000 netgraph/ng_bridge: Introduce "uplink" ports without MAC learning The ng_bridge(4) node is designed to work in moderately small environments. Connecting such a node to a larger network rapidly fills the MAC table for no reason. It even become complicated to obtain data from the gettable message, because the result is too large to transmit. This patch introduces, two new functionality bits on the hooks: - Allow or disallow MAC address learning for incoming patckets. - Allow or disallow sending unknown MACs through this hook. Uplinks are characterized by denied learing while sending out unknowns. Normal links are charaterized by allowed learning and sending out unknowns. Reviewed by: kp Approved by: kp (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23963 --- share/man/man4/ng_bridge.4 | 30 +++++++++++++-- sys/netgraph/ng_bridge.c | 95 +++++++++++++++++++++++++++++----------------- sys/netgraph/ng_bridge.h | 2 + 3 files changed, 89 insertions(+), 38 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 85c2d8871c7c..b5937375e87a 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2019 +.Dd February 6, 2021 .Dt NG_BRIDGE 4 .Os .Sh NAME @@ -92,6 +92,23 @@ To connect the host machine to a bridged network, simply connect the hook of an .Xr ng_ether 4 node to the bridge node. +.Pp +Instead of naming a hook +.Dv linkX +the hook might be also named +.Dv uplinkX . +The node does not learn MAC addresses on uplink hooks, which keeps +the internal address table small. +This way it is desirable to connect the +.Dv lower +hook of an +.Xr ng_ether 4 +node to an +.Dv uplink +hook of the bridge, and ignore the complexity of the outside world. +Frames with unknown MACs are always sent out to +.Dv uplink +hooks, so no functionality is lost. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: @@ -141,8 +158,9 @@ The node configuration is not changed. This command takes a four byte link number as an argument and returns a .Dv "struct ng_bridge_link_stats" -containing statistics for the corresponding link, which must be -currently connected: +containing statistics for the corresponding +.Dv link , +which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ struct ng_bridge_link_stats { @@ -162,6 +180,12 @@ struct ng_bridge_link_stats { uint64_t memoryFailures; /* times couldn't get mem or mbuf */ }; .Ed +.Pp +Negative numbers refer to the +.Dv uplink +hooks. +So querying for -7 will get the statistics for hook +.Dv uplink7 . .It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats This command takes a four byte link number as an argument and clears the statistics for that link. diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 1521b1cee901..a21da545e210 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -91,6 +91,8 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ + unsigned int learnMac : 1, /* autolearn macs */ + sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_stats stats; /* link stats */ }; @@ -334,38 +336,49 @@ static int ng_bridge_newhook(node_p node, hook_p hook, const char *name) { const priv_p priv = NG_NODE_PRIVATE(node); + char linkName[NG_HOOKSIZ]; + u_int32_t linkNum; + link_p link; + const char *prefix = NG_BRIDGE_HOOK_LINK_PREFIX; + bool isUplink; /* Check for a link hook */ - if (strlen(name) > strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) { - char linkName[NG_HOOKSIZ]; - u_int32_t linkNum; - link_p link; - - /* primitive parsing */ - linkNum = strtoul(name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); - /* validation by comparing against the reconstucted name */ - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - linkNum); - if (strcmp(linkName, name) != 0) - return (EINVAL); - - if(NG_PEER_NODE(hook) == node) - return (ELOOP); - - link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, - M_WAITOK|M_ZERO); - if (link == NULL) - return (ENOMEM); - link->hook = hook; - NG_HOOK_SET_PRIVATE(hook, link); - priv->numLinks++; - return (0); + if (strlen(name) <= strlen(prefix)) + return (EINVAL); /* Unknown hook name */ + + isUplink = (name[0] == 'u'); + if (isUplink) + prefix = NG_BRIDGE_HOOK_UPLINK_PREFIX; + + /* primitive parsing */ + linkNum = strtoul(name + strlen(prefix), NULL, 10); + /* validation by comparing against the reconstucted name */ + snprintf(linkName, sizeof(linkName), "%s%u", prefix, linkNum); + if (strcmp(linkName, name) != 0) + return (EINVAL); + + if (linkNum == 0 && isUplink) + return (EINVAL); + + if(NG_PEER_NODE(hook) == node) + return (ELOOP); + + link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_ZERO); + if (link == NULL) + return (ENOMEM); + + link->hook = hook; + if (isUplink) { + link->learnMac = 0; + link->sendUnknown = 1; + } else { + link->learnMac = 1; + link->sendUnknown = 1; } - /* Unknown hook name */ - return (EINVAL); + NG_HOOK_SET_PRIVATE(hook, link); + priv->numLinks++; + return (0); } /* @@ -438,6 +451,11 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) i = 0; for (bucket = 0; bucket < priv->numBuckets; bucket++) { SLIST_FOREACH(hent, &priv->tab[bucket], next) { + const char *name = NG_HOOK_NAME(hent->host.link->hook); + const char *prefix = name[0] == 'u' ? + NG_BRIDGE_HOOK_UPLINK_PREFIX : + NG_BRIDGE_HOOK_LINK_PREFIX; + memcpy(ary->hosts[i].addr, hent->host.addr, sizeof(ary->hosts[i].addr)); @@ -445,9 +463,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary->hosts[i].staleness = hent->host.staleness; ary->hosts[i].linkNum = strtol( - NG_HOOK_NAME(hent->host.link->hook) + - strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); + name + strlen(prefix), NULL, 10); i++; } } @@ -506,15 +522,20 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; link_p link; char linkName[NG_HOOKSIZ]; + int linkNum; /* Get link number */ if (msg->header.arglen != sizeof(u_int32_t)) { error = EINVAL; break; } - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - *((u_int32_t *)msg->data)); + linkNum = *((int32_t *)msg->data); + if (linkNum < 0) + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_UPLINK_PREFIX, -linkNum); + else + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, linkNum); if ((hook = ng_findhook(node, linkName)) == NULL) { error = ENOTCONN; @@ -609,6 +630,10 @@ ng_bridge_send_ctx(hook_p dst, void *arg) return (1); } + /* Skip sending unknowns to undesired links */ + if (!ctx->manycast && !destLink->sendUnknown) + return (1); + if (ctx->foundFirst == NULL) { /* * This is the first usable link we have found. @@ -750,7 +775,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) host->link = ctx.incoming; host->age = 0; } - } else { + } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index e4b74efbfc5e..2aecf7f9f9cb 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -64,6 +64,8 @@ /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ +#define NG_BRIDGE_HOOK_UPLINK_PREFIX "uplink" /* append decimal integer */ +#define NG_BRIDGE_HOOK_UPLINK_FMT "uplink%d" /* for use with printf(3) */ /* Node configuration structure */ struct ng_bridge_config { From owner-dev-commits-src-main@freebsd.org Sat Feb 6 10:36:54 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4C175544156; Sat, 6 Feb 2021 10:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXpck1hVsz3wTM; Sat, 6 Feb 2021 10:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2CB09102EF; Sat, 6 Feb 2021 10:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 116AasIU035909; Sat, 6 Feb 2021 10:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116Aas53035908; Sat, 6 Feb 2021 10:36:54 GMT (envelope-from git) Date: Sat, 6 Feb 2021 10:36:54 GMT Message-Id: <202102061036.116Aas53035908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 689561d40322 - main - ng_bridge.4: Use more suitable mandoc macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 689561d4032233bc171cff30d6756c3cf3b22720 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 10:36:54 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=689561d4032233bc171cff30d6756c3cf3b22720 commit 689561d4032233bc171cff30d6756c3cf3b22720 Author: Lutz Donnerhacke AuthorDate: 2021-02-05 21:24:06 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 10:36:11 +0000 ng_bridge.4: Use more suitable mandoc macros yuripv@ suggested to replace inapprobriate macros by better ones. Reviewed by: philip Approved by: philip (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28510 --- share/man/man4/ng_bridge.4 | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index b5937375e87a..1f3831e3fb75 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -79,44 +79,44 @@ mechanism on a per-link basis is not yet implemented. This node type supports an unlimited number of hooks. Each connected hook represents a bridged link. The hooks are named -.Dv link0 , -.Dv link1 , +.Ar link0 , +.Ar link1 , etc. Typically these hooks are connected to the -.Dv lower +.Ar lower hooks of one or more .Xr ng_ether 4 nodes. To connect the host machine to a bridged network, simply connect the -.Dv upper +.Ar upper hook of an .Xr ng_ether 4 node to the bridge node. .Pp Instead of naming a hook -.Dv linkX +.Ar linkX the hook might be also named -.Dv uplinkX . +.Ar uplinkX . The node does not learn MAC addresses on uplink hooks, which keeps the internal address table small. This way it is desirable to connect the -.Dv lower +.Ar lower hook of an .Xr ng_ether 4 node to an -.Dv uplink +.Ar uplink hook of the bridge, and ignore the complexity of the outside world. Frames with unknown MACs are always sent out to -.Dv uplink +.Ar uplink hooks, so no functionality is lost. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo -.It Dv NGM_BRIDGE_SET_CONFIG Pq Ic setconfig +.It Dv NGM_BRIDGE_SET_CONFIG Pq Ar setconfig Set the node configuration. This command takes a -.Dv "struct ng_bridge_config" +.Vt "struct ng_bridge_config" as an argument: .Bd -literal -offset 0n /* Node configuration structure */ @@ -129,37 +129,37 @@ struct ng_bridge_config { .Ed .Pp The -.Dv debugLevel +.Va debugLevel field sets the debug level on the node. At level of 2 or greater, detected loops are logged. The default level is 1. .Pp The -.Dv loopTimeout +.Va loopTimeout determines how long (in seconds) a looped link is muted. The default is 60 seconds. The -.Dv maxStaleness +.Va maxStaleness parameter determines how long a period of inactivity before a host's entry is forgotten. The default is 15 minutes. The -.Dv minStableAge +.Va minStableAge determines how quickly a host must jump from one link to another before we declare a loopback condition. The default is one second. -.It Dv NGM_BRIDGE_GET_CONFIG Pq Ic getconfig +.It Dv NGM_BRIDGE_GET_CONFIG Pq Ar getconfig Returns the current configuration as a -.Dv "struct ng_bridge_config" . -.It Dv NGM_BRIDGE_RESET Pq Ic reset +.Vt "struct ng_bridge_config" . +.It Dv NGM_BRIDGE_RESET Pq Ar reset Causes the node to forget all hosts and unmute all links. The node configuration is not changed. -.It Dv NGM_BRIDGE_GET_STATS Pq Ic getstats +.It Dv NGM_BRIDGE_GET_STATS Pq Ar getstats This command takes a four byte link number as an argument and returns a -.Dv "struct ng_bridge_link_stats" +.Vt "struct ng_bridge_link_stats" containing statistics for the corresponding -.Dv link , +.Ar link , which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ @@ -182,21 +182,21 @@ struct ng_bridge_link_stats { .Ed .Pp Negative numbers refer to the -.Dv uplink +.Ar uplink hooks. So querying for -7 will get the statistics for hook -.Dv uplink7 . -.It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats +.Ar uplink7 . +.It Dv NGM_BRIDGE_CLR_STATS Pq Ar clrstats This command takes a four byte link number as an argument and clears the statistics for that link. -.It Dv NGM_BRIDGE_GETCLR_STATS Pq Ic getclrstats +.It Dv NGM_BRIDGE_GETCLR_STATS Pq Ar getclrstats Same as .Dv NGM_BRIDGE_GET_STATS , but also atomically clears the statistics as well. -.It Dv NGM_BRIDGE_GET_TABLE Pq Ic gettable +.It Dv NGM_BRIDGE_GET_TABLE Pq Ar gettable Returns the current host mapping table used to direct packets, in a -.Dv "struct ng_bridge_host_ary" . -.It Dv NGM_BRIDGE_SET_PERSISTENT Pq Ic setpersistent +.Vt "struct ng_bridge_host_ary" . +.It Dv NGM_BRIDGE_SET_PERSISTENT Pq Ar setpersistent This command sets the persistent flag on the node, and takes no arguments. .El .Sh SHUTDOWN From owner-dev-commits-src-main@freebsd.org Sat Feb 6 14:03:40 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3BD9452A52D; Sat, 6 Feb 2021 14:03:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXvCJ1D3Vz4dn8; Sat, 6 Feb 2021 14:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 1CB7112ACB; Sat, 6 Feb 2021 14:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 116E3eUm008532; Sat, 6 Feb 2021 14:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116E3edf008531; Sat, 6 Feb 2021 14:03:40 GMT (envelope-from git) Date: Sat, 6 Feb 2021 14:03:40 GMT Message-Id: <202102061403.116E3edf008531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: c869d905baa4 - main - netgraph/ng_bridge: Derive forwarding mode from first attached hook MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c869d905baa4e329dfd6793e7487b5985248ddb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 14:03:40 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=c869d905baa4e329dfd6793e7487b5985248ddb6 commit c869d905baa4e329dfd6793e7487b5985248ddb6 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:25:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 14:01:15 +0000 netgraph/ng_bridge: Derive forwarding mode from first attached hook Handling of unknown MACs on an bridge with incomplete learning capabilites (aka uplink ports) can be defined in different ways. The classical approach is to broadcast unicast frames send to an unknown MAC, because the unknown devices can be everywhere. This mode is default for ng_bridge(4). In the case of dedicated uplink ports, which prohibit learning of MAC addresses in order to save memory and CPU cycles, the broadcast approach is dangerous. All traffic to the uplink port is broadcasted to every downlink port, too. In this case, it's better to restrict the distribution of frames to unknown MAC to the uplink ports only. In order to keep the chance small and the handling as natural as possible, the first attached link is used to determine the behaviour of the bridge: If it is an "uplink" port, then the bridge switch from classical mode to restricted mode. Reviewed By: kp Approved by: kp (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28487 --- share/man/man4/ng_bridge.4 | 16 ++++++++++++++++ sys/netgraph/ng_bridge.c | 8 ++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 1f3831e3fb75..be128d62c938 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -109,6 +109,22 @@ hook of the bridge, and ignore the complexity of the outside world. Frames with unknown MACs are always sent out to .Ar uplink hooks, so no functionality is lost. +.Pp +Frames with unknown destination MAC addresses are replicated to any +available hook, unless the first connected hook is an +.Ar uplink +hook. +In this case the node assumes, that all unknown MAC addresses are +located soley on the +.Ar uplink +hooks and only those hooks will be used to send out frames with +unknown destination MACs. +If the first connected hook is an +.Ar link +hook, the node will replicate such frames to all types of hooks, +even if +.Ar uplink +hooks are connected later. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index a21da545e210..ed08020ead70 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -105,7 +105,8 @@ struct ng_bridge_private { u_int numBuckets; /* num buckets in table */ u_int hashMask; /* numBuckets - 1 */ int numLinks; /* num connected links */ - int persistent; /* can exist w/o hooks */ + unsigned int persistent : 1, /* can exist w/o hooks */ + sendUnknown : 1;/* links receive unknowns by default */ struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; @@ -309,6 +310,7 @@ ng_bridge_constructor(node_p node) priv->conf.loopTimeout = DEFAULT_LOOP_TIMEOUT; priv->conf.maxStaleness = DEFAULT_MAX_STALENESS; priv->conf.minStableAge = DEFAULT_MIN_STABLE_AGE; + priv->sendUnknown = 1; /* classic bridge */ /* * This node has all kinds of stuff that could be screwed by SMP. @@ -371,9 +373,11 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (isUplink) { link->learnMac = 0; link->sendUnknown = 1; + if (priv->numLinks == 0) /* if the first link is an uplink */ + priv->sendUnknown = 0; /* switch to restrictive mode */ } else { link->learnMac = 1; - link->sendUnknown = 1; + link->sendUnknown = priv->sendUnknown; } NG_HOOK_SET_PRIVATE(hook, link); From owner-dev-commits-src-main@freebsd.org Sat Feb 6 15:25:59 2021 Return-Path: Delivered-To: dev-commits-src-main@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 97DC352C524; Sat, 6 Feb 2021 15:25:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXx2H3rNRz4kfJ; Sat, 6 Feb 2021 15:25:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f180.google.com with SMTP id p15so8675401ilq.8; Sat, 06 Feb 2021 07:25:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vy4GTvvNAFT3z5DkrqecsrjGsm/rLFeMlcpdqJQaZ+k=; b=aGxSJQNar/K20th/Azj3Yfs8jxjSEim35ysBUwOy2o+dhoDQWQwiCegeo6uvTFvGFl 7+BsWo+I017ThmcX0QDgHskpEdjLbeoJTrC+87MpKQIGtg+3ZFI/x36sD9Eb6LdL+wiI RBk0nP5FpBiR11Gzfo6v2w5rIVk345eRMyZMPNquoyGNLpCFvPHLuho1Z3sOuqCOy/NI 1IDlZgwNYAo96pc71V1xl9nBEamwCZBVY1ciYNtt9NfhNRgcaguE+SWb8xy0Y8j/Jx85 +F8tW+MRLmT8PdJU5oK80RJHNco4vafrQI0OBn5KFCpHotNvkg2uU8fLQ9w4t5s1DxzE D5xQ== X-Gm-Message-State: AOAM532tcgJ7B1FZuxSLWjBigCekSrsC8FReHT/rFuBQSw0s4Wx90Tcm EHQf261gRze1FXUK4HWlV0KWIBnU4H3LUkj252nPNJpDbZE= X-Google-Smtp-Source: ABdhPJykZ1jPl8DqSKSdBE2d/wZPJLritQrNehRiRCbubuDEDH36ngzG6HRa1ePZpoaqpFPemGnfTXfDulnPNhOgfjk= X-Received: by 2002:a92:ab10:: with SMTP id v16mr8910786ilh.100.1612625157626; Sat, 06 Feb 2021 07:25:57 -0800 (PST) MIME-Version: 1.0 References: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> In-Reply-To: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> From: Ed Maste Date: Sat, 6 Feb 2021 10:24:58 -0500 Message-ID: Subject: Re: git: 10990cb46027 - main - Simplify FreeBSD check. To: Cy Schubert Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DXx2H3rNRz4kfJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 15:25:59 -0000 On Fri, 5 Feb 2021 at 21:40, Cy Schubert wrote: > > -#if (__FreeBSD_version >= 300000) > +#ifdef __FreeBSD_version FWIW I think #ifdef __FreeBSD__ is the typical spelling of this test, and it is built in to the compiler. From owner-dev-commits-src-main@freebsd.org Sat Feb 6 15:30:46 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B100F52C9A9; Sat, 6 Feb 2021 15:30:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXx7p1b9nz4l0S; Sat, 6 Feb 2021 15:30:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id 8PXmlcFy6HmS38PXnlqgv3; Sat, 06 Feb 2021 08:30:44 -0700 X-Authority-Analysis: v=2.4 cv=MaypB7zf c=1 sm=1 tr=0 ts=601eb624 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=kj8YTp4bdCVK2V1MK6wA:9 a=CjuIK1q_8ugA:10 a=vRcdKC0ogzYA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id E714882A; Sat, 6 Feb 2021 07:30:41 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 116FUfla008751; Sat, 6 Feb 2021 07:30:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102061530.116FUfla008751@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: Cy Schubert , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 10990cb46027 - main - Simplify FreeBSD check. In-reply-to: References: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> Comments: In-reply-to Ed Maste message dated "Sat, 06 Feb 2021 10:24:58 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 06 Feb 2021 07:30:41 -0800 X-CMAE-Envelope: MS4xfIuiOSJjMnxGLnP869ALHUMosbDzNucAPrpkC7B3be5bc63jAUqLdYBt6Fr6MWh0q7aMdUnXi35aliQFceo0GRm/NjunXrBM8/zgUYC87blNZAtrfSWs zXop4EG1nybvaW2Row+/3jOA+Zfd/fzdtjTqf3sVLUPQZ6lkTi2VmPyFh0bCeim2xUOUrZQp5H3MQoSSiVxLzEL3aoVJDuH7ZhARzAAwiW/cgwGvfzEGLhgZ 2qHG+UoO9bXtVdNBqpC9QyDbaY/ccVxzFnt1P02DHzZEggFL8ke+JLjHKU2q2aGt8pfzGI2m9TzWuRCuU7c2pi7kM0588sHBJ3qe8RJk5otIX+IhrQfMrjS+ fk8i7Q1P X-Rspamd-Queue-Id: 4DXx7p1b9nz4l0S X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 15:30:46 -0000 In message , Ed Maste writes: > On Fri, 5 Feb 2021 at 21:40, Cy Schubert wrote: > > > > -#if (__FreeBSD_version >= 300000) > > +#ifdef __FreeBSD_version > > FWIW I think #ifdef __FreeBSD__ is the typical spelling of this test, > and it is built in to the compiler. Thanks. I'll change that. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Sat Feb 6 17:17:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6E6FD52F35C; Sat, 6 Feb 2021 17:17:44 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXzWD2dJZz4rWB; Sat, 6 Feb 2021 17:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 4CDB0155F3; Sat, 6 Feb 2021 17:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 116HHic6057018; Sat, 6 Feb 2021 17:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116HHirV057017; Sat, 6 Feb 2021 17:17:44 GMT (envelope-from git) Date: Sat, 6 Feb 2021 17:17:44 GMT Message-Id: <202102061717.116HHirV057017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 66c72859f66d - main - netgraph/ng_bridge: switch stats to counter framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66c72859f66dc6c852234589f3508ce5d36d0336 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 17:17:44 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=66c72859f66dc6c852234589f3508ce5d36d0336 commit 66c72859f66dc6c852234589f3508ce5d36d0336 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 06:16:34 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 17:14:23 +0000 netgraph/ng_bridge: switch stats to counter framework This is the first patch of a series of necessary steps to make ng_bridge(4) multithreaded. Reviewed by: melifaro (network), afedorov MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D28125 --- sys/netgraph/ng_bridge.c | 133 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index ed08020ead70..49d8aae87ccf 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -65,6 +65,8 @@ #include #include #include +#include +#include #include #include @@ -87,13 +89,31 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", #define M_NETGRAPH_BRIDGE M_NETGRAPH #endif +/* Counter based stats */ +struct ng_bridge_link_kernel_stats { + counter_u64_t recvOctets; /* total octets rec'd on link */ + counter_u64_t recvPackets; /* total pkts rec'd on link */ + counter_u64_t recvMulticasts; /* multicast pkts rec'd on link */ + counter_u64_t recvBroadcasts; /* broadcast pkts rec'd on link */ + counter_u64_t recvUnknown; /* pkts rec'd with unknown dest addr */ + counter_u64_t recvRunts; /* pkts rec'd less than 14 bytes */ + counter_u64_t recvInvalid; /* pkts rec'd with bogus source addr */ + counter_u64_t xmitOctets; /* total octets xmit'd on link */ + counter_u64_t xmitPackets; /* total pkts xmit'd on link */ + counter_u64_t xmitMulticasts; /* multicast pkts xmit'd on link */ + counter_u64_t xmitBroadcasts; /* broadcast pkts xmit'd on link */ + counter_u64_t loopDrops; /* pkts dropped due to loopback */ + counter_u64_t loopDetects; /* number of loop detections */ + counter_u64_t memoryFailures; /* times couldn't get mem or mbuf */ +}; + /* Per-link private data */ struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ unsigned int learnMac : 1, /* autolearn macs */ sendUnknown : 1;/* send unknown macs out */ - struct ng_bridge_link_stats stats; /* link stats */ + struct ng_bridge_link_kernel_stats stats; /* link stats */ }; /* Per-node private data */ @@ -369,6 +389,21 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (link == NULL) return (ENOMEM); + link->stats.recvOctets = counter_u64_alloc(M_WAITOK); + link->stats.recvPackets = counter_u64_alloc(M_WAITOK); + link->stats.recvMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.recvBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.recvUnknown = counter_u64_alloc(M_WAITOK); + link->stats.recvRunts = counter_u64_alloc(M_WAITOK); + link->stats.recvInvalid = counter_u64_alloc(M_WAITOK); + link->stats.xmitOctets = counter_u64_alloc(M_WAITOK); + link->stats.xmitPackets = counter_u64_alloc(M_WAITOK); + link->stats.xmitMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.xmitBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.loopDrops = counter_u64_alloc(M_WAITOK); + link->stats.loopDetects = counter_u64_alloc(M_WAITOK); + link->stats.memoryFailures = counter_u64_alloc(M_WAITOK); + link->hook = hook; if (isUplink) { link->learnMac = 0; @@ -388,14 +423,31 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) /* * Receive a control message */ +static void ng_bridge_clear_link_stats(struct ng_bridge_link_kernel_stats * p) +{ + counter_u64_zero(p->recvOctets); + counter_u64_zero(p->recvPackets); + counter_u64_zero(p->recvMulticasts); + counter_u64_zero(p->recvBroadcasts); + counter_u64_zero(p->recvUnknown); + counter_u64_zero(p->recvRunts); + counter_u64_zero(p->recvInvalid); + counter_u64_zero(p->xmitOctets); + counter_u64_zero(p->xmitPackets); + counter_u64_zero(p->xmitMulticasts); + counter_u64_zero(p->xmitBroadcasts); + counter_u64_zero(p->loopDrops); + counter_u64_zero(p->loopDetects); + counter_u64_zero(p->memoryFailures); +}; + static int ng_bridge_reset_link(hook_p hook, void *arg __unused) { link_p priv = NG_HOOK_PRIVATE(hook); priv->loopCount = 0; - bzero(&priv->stats, sizeof(priv->stats)); - + ng_bridge_clear_link_stats(&priv->stats); return (1); } @@ -549,17 +601,34 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) /* Get/clear stats */ if (msg->header.cmd != NGM_BRIDGE_CLR_STATS) { + struct ng_bridge_link_stats *rs; + NG_MKRESPONSE(resp, msg, sizeof(link->stats), M_NOWAIT); if (resp == NULL) { error = ENOMEM; break; } - bcopy(&link->stats, - resp->data, sizeof(link->stats)); + rs = (struct ng_bridge_link_stats *)resp->data; +#define FETCH(x) rs->x = counter_u64_fetch(link->stats.x) + FETCH(recvOctets); + FETCH(recvPackets); + FETCH(recvMulticasts); + FETCH(recvBroadcasts); + FETCH(recvUnknown); + FETCH(recvRunts); + FETCH(recvInvalid); + FETCH(xmitOctets); + FETCH(xmitPackets); + FETCH(xmitMulticasts); + FETCH(xmitBroadcasts); + FETCH(loopDrops); + FETCH(loopDetects); + FETCH(memoryFailures); +#undef FETCH } if (msg->header.cmd != NGM_BRIDGE_GET_STATS) - bzero(&link->stats, sizeof(link->stats)); + ng_bridge_clear_link_stats(&link->stats); break; } case NGM_BRIDGE_GET_TABLE: @@ -654,22 +723,22 @@ ng_bridge_send_ctx(hook_p dst, void *arg) */ m2 = m_dup(ctx->m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { - ctx->incoming->stats.memoryFailures++; + counter_u64_add(ctx->incoming->stats.memoryFailures, 1); ctx->error = ENOBUFS; return (0); /* abort loop */ } /* Update stats */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m2->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, m2->m_pkthdr.len); switch (ctx->manycast) { default: /* unknown unicast */ break; case 1: /* multicast */ - destLink->stats.xmitMulticasts++; + counter_u64_add(destLink->stats.xmitMulticasts, 1); break; case 2: /* broadcast */ - destLink->stats.xmitBroadcasts++; + counter_u64_add(destLink->stats.xmitBroadcasts, 1); break; } @@ -695,19 +764,19 @@ ng_bridge_rcvdata(hook_p hook, item_p item) ctx.incoming = NG_HOOK_PRIVATE(hook); /* Sanity check packet and pull up header */ if (ctx.m->m_pkthdr.len < ETHER_HDR_LEN) { - ctx.incoming->stats.recvRunts++; + counter_u64_add(ctx.incoming->stats.recvRunts, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); } if (ctx.m->m_len < ETHER_HDR_LEN && !(ctx.m = m_pullup(ctx.m, ETHER_HDR_LEN))) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); return (ENOBUFS); } eh = mtod(ctx.m, struct ether_header *); if ((eh->ether_shost[0] & 1) != 0) { - ctx.incoming->stats.recvInvalid++; + counter_u64_add(ctx.incoming->stats.recvInvalid, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); @@ -715,21 +784,21 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Is link disabled due to a loopback condition? */ if (ctx.incoming->loopCount != 0) { - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX is this an appropriate error? */ } /* Update stats */ - ctx.incoming->stats.recvPackets++; - ctx.incoming->stats.recvOctets += ctx.m->m_pkthdr.len; + counter_u64_add(ctx.incoming->stats.recvPackets, 1); + counter_u64_add(ctx.incoming->stats.recvOctets, ctx.m->m_pkthdr.len); if ((ctx.manycast = (eh->ether_dhost[0] & 1)) != 0) { if (ETHER_EQUAL(eh->ether_dhost, ng_bridge_bcast_addr)) { - ctx.incoming->stats.recvBroadcasts++; + counter_u64_add(ctx.incoming->stats.recvBroadcasts, 1); ctx.manycast = 2; } else - ctx.incoming->stats.recvMulticasts++; + counter_u64_add(ctx.incoming->stats.recvMulticasts, 1); } /* Look up packet's source Ethernet address in hashtable */ @@ -763,13 +832,13 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Mark link as linka non grata */ ctx.incoming->loopCount = priv->conf.loopTimeout; - ctx.incoming->stats.loopDetects++; + counter_u64_add(ctx.incoming->stats.loopDetects, 1); /* Forget all hosts on this link */ ng_bridge_remove_hosts(priv, ctx.incoming); /* Drop packet */ - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX appropriate? */ @@ -781,7 +850,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ENOMEM); @@ -812,14 +881,14 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Deliver packet out the destination link */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += ctx.m->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, ctx.m->m_pkthdr.len); NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); return (ctx.error); } /* Destination host is not known */ - ctx.incoming->stats.recvUnknown++; + counter_u64_add(ctx.incoming->stats.recvUnknown, 1); } /* Distribute unknown, multicast, broadcast pkts to all other links */ @@ -879,6 +948,20 @@ ng_bridge_disconnect(hook_p hook) ng_bridge_remove_hosts(priv, link); /* Free associated link information */ + counter_u64_free(link->stats.recvOctets); + counter_u64_free(link->stats.recvPackets); + counter_u64_free(link->stats.recvMulticasts); + counter_u64_free(link->stats.recvBroadcasts); + counter_u64_free(link->stats.recvUnknown); + counter_u64_free(link->stats.recvRunts); + counter_u64_free(link->stats.recvInvalid); + counter_u64_free(link->stats.xmitOctets); + counter_u64_free(link->stats.xmitPackets); + counter_u64_free(link->stats.xmitMulticasts); + counter_u64_free(link->stats.xmitBroadcasts); + counter_u64_free(link->stats.loopDrops); + counter_u64_free(link->stats.loopDetects); + counter_u64_free(link->stats.memoryFailures); free(link, M_NETGRAPH_BRIDGE); priv->numLinks--; From owner-dev-commits-src-main@freebsd.org Sat Feb 6 17:22:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5328252F67C; Sat, 6 Feb 2021 17:22:29 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXzcj0Sshz4rsf; Sat, 6 Feb 2021 17:22:28 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 116HMHiO027736 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 6 Feb 2021 18:22:17 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 116HMHS9002374; Sat, 6 Feb 2021 18:22:17 +0100 Date: Sat, 6 Feb 2021 18:22:17 +0100 From: Lutz Donnerhacke To: Lutz Donnerhacke Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 66c72859f66d - main - netgraph/ng_bridge: switch stats to counter framework Message-ID: <20210206172217.GA2212@belenus.iks-jena.de> References: <202102061717.116HHirV057017@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102061717.116HHirV057017@gitrepo.freebsd.org> X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DXzcj0Sshz4rsf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 17:22:29 -0000 On Sat, Feb 06, 2021 at 05:17:44PM +0000, Lutz Donnerhacke wrote: > commit 66c72859f66dc6c852234589f3508ce5d36d0336 > Author: Lutz Donnerhacke > AuthorDate: 2021-01-13 06:16:34 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-06 17:14:23 +0000 There are still some "pre-committer" branches in the local tree. My fault. From owner-dev-commits-src-main@freebsd.org Sat Feb 6 18:30:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4F5495311EF; Sat, 6 Feb 2021 18:30:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DY17K1ncQz3CKC; Sat, 6 Feb 2021 18:30:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 2B2851107; Sat, 6 Feb 2021 18:30:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f180.google.com with SMTP id h8so157481qkk.6; Sat, 06 Feb 2021 10:30:37 -0800 (PST) X-Gm-Message-State: AOAM531/vl1dGhbSRF9lgk7AqE9++r/jdddj+KQNxtd5O7tlQLzbEO9b L4Sd+do9wJlBI2o+vsbSJxBF+FUjbrMUit0yD+I= X-Google-Smtp-Source: ABdhPJzr0jmPVy+PgJElcFTHy+pLiB8G4YZu20aOLLLa1qdxsBnrrcC4j9E8jNWtAT2Z+zYhcvwmDbGihige2zWsujc= X-Received: by 2002:ae9:e80e:: with SMTP id a14mr390928qkg.103.1612636236740; Sat, 06 Feb 2021 10:30:36 -0800 (PST) MIME-Version: 1.0 References: <202102042333.114NXowE086993@gitrepo.freebsd.org> In-Reply-To: <202102042333.114NXowE086993@gitrepo.freebsd.org> From: Kyle Evans Date: Sat, 6 Feb 2021 12:30:19 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 7d4dceec1030 - main - ixl(4): Fix VLAN HW filtering To: Eric Joyner , Krzysztof Galazka Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 18:30:37 -0000 On Thu, Feb 4, 2021 at 5:34 PM Eric Joyner wrote: > > The branch main has been updated by erj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa > Author: Krzysztof Galazka > AuthorDate: 2021-02-03 23:22:55 +0000 > Commit: Eric Joyner > CommitDate: 2021-02-04 23:33:42 +0000 > > ixl(4): Fix VLAN HW filtering > > X700 family of controllers has limited number of available VLAN > HW filters. Driver did not handle properly a case when user > assigned more VLANs to the interface which had all filters > already in use. Fix that by disabling HW filtering when > it is impossible to create filters for all requested VLANs. > Keep track of registered VLANs using bitstring to be able > to re-enable HW filtering when number of requested VLANs > drops below the limit. > > Also switch all allocations to use M_IXL malloc type > to ease detecting memory leaks in the driver. > Hi, This adds a dependency on `device ixl` for `device iavf` since M_IXL is defined in ixl_pf_main.c, but I think that particular part should be partially reverted anyways. There's an M_IAVF already that's more appropriate for i40e_osdep.c -- proposed patch here: https://people.freebsd.org/~kevans/0001-ixl-switch-i40e_osdep.c-allocations-to-M_IAVF.patch Thanks, Kyle Evans From owner-dev-commits-src-main@freebsd.org Sat Feb 6 18:32:54 2021 Return-Path: Delivered-To: dev-commits-src-main@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 597225315AC for ; Sat, 6 Feb 2021 18:32:54 +0000 (UTC) (envelope-from kevans@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DY19y22RRz3Cpg for ; Sat, 6 Feb 2021 18:32:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3065A110D for ; Sat, 6 Feb 2021 18:32:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id a19so10439485qka.2 for ; Sat, 06 Feb 2021 10:32:54 -0800 (PST) X-Gm-Message-State: AOAM5336TEhK6f8vUIF0QqMmU6oj1/L9Wh6N0eGmSudPO3gs3UvFItih hF1idI5of2ozF7hhOt/ax9IQPtPXGgmjGVqV+Ko= X-Received: by 2002:a37:591:: with SMTP id 139mt10758335qkf.493.1612636373868; Sat, 06 Feb 2021 10:32:53 -0800 (PST) MIME-Version: 1.0 References: <202102042333.114NXowE086993@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Sat, 6 Feb 2021 12:32:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 7d4dceec1030 - main - ixl(4): Fix VLAN HW filtering Cc: Eric Joyner , Krzysztof Galazka , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 18:32:54 -0000 On Sat, Feb 6, 2021 at 12:30 PM Kyle Evans wrote: > > On Thu, Feb 4, 2021 at 5:34 PM Eric Joyner wrote: > > > > The branch main has been updated by erj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > > > commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > Author: Krzysztof Galazka > > AuthorDate: 2021-02-03 23:22:55 +0000 > > Commit: Eric Joyner > > CommitDate: 2021-02-04 23:33:42 +0000 > > > > ixl(4): Fix VLAN HW filtering > > > > X700 family of controllers has limited number of available VLAN > > HW filters. Driver did not handle properly a case when user > > assigned more VLANs to the interface which had all filters > > already in use. Fix that by disabling HW filtering when > > it is impossible to create filters for all requested VLANs. > > Keep track of registered VLANs using bitstring to be able > > to re-enable HW filtering when number of requested VLANs > > drops below the limit. > > > > Also switch all allocations to use M_IXL malloc type > > to ease detecting memory leaks in the driver. > > > > Hi, > > This adds a dependency on `device ixl` for `device iavf` since M_IXL > is defined in ixl_pf_main.c, but I think that particular part should > be partially reverted anyways. There's an M_IAVF already that's more > appropriate for i40e_osdep.c -- proposed patch here: > https://people.freebsd.org/~kevans/0001-ixl-switch-i40e_osdep.c-allocations-to-M_IAVF.patch > Ah crud, nope. I missed that i40e_osdep is pulled in for ixl as well. :-( From owner-dev-commits-src-main@freebsd.org Sat Feb 6 19:42:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E3279533220; Sat, 6 Feb 2021 19:42:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DY2k568SYz3HmR; Sat, 6 Feb 2021 19:42:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C61F6171E8; Sat, 6 Feb 2021 19:42:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 116JgLxm050773; Sat, 6 Feb 2021 19:42:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116JgLMC050772; Sat, 6 Feb 2021 19:42:21 GMT (envelope-from git) Date: Sat, 6 Feb 2021 19:42:21 GMT Message-Id: <202102061942.116JgLMC050772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 8af54bdfcaec - main - lastcomm(1): Only install if MK_ACCT is on MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8af54bdfcaecf922f936a14d1d9efcf84076029f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 19:42:21 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=8af54bdfcaecf922f936a14d1d9efcf84076029f commit 8af54bdfcaecf922f936a14d1d9efcf84076029f Author: Emmanuel Vadot AuthorDate: 2021-02-06 19:41:39 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-06 19:41:39 +0000 lastcomm(1): Only install if MK_ACCT is on MFC after: 3 days --- usr.bin/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/Makefile b/usr.bin/Makefile index c557d85b535c..fcc406d2efc5 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -67,7 +67,6 @@ SUBDIR= alias \ ktrace \ ktrdump \ lam \ - lastcomm \ ldd \ leave \ less \ @@ -192,6 +191,7 @@ SUBDIR= alias \ # NB: keep these sorted by MK_* knobs +SUBDIR.${MK_ACCT}+= lastcomm SUBDIR.${MK_AT}+= at SUBDIR.${MK_ATM}+= atm SUBDIR.${MK_BLUETOOTH}+= bluetooth From owner-dev-commits-src-main@freebsd.org Sat Feb 6 23:46:56 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E1AE353EBAC; Sat, 6 Feb 2021 23:46:56 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DY88J62Lwz4r9L; Sat, 6 Feb 2021 23:46:56 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C1F801A3B1; Sat, 6 Feb 2021 23:46:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 116NkuCl063765; Sat, 6 Feb 2021 23:46:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116Nkuam063764; Sat, 6 Feb 2021 23:46:56 GMT (envelope-from git) Date: Sat, 6 Feb 2021 23:46:56 GMT Message-Id: <202102062346.116Nkuam063764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: f6e8256a965d - main - linux: fix handling of flags for 32 bit send(2) syscall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6e8256a965d5b7a7d43034ea31b2430a3b51066 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 23:46:56 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f6e8256a965d5b7a7d43034ea31b2430a3b51066 commit f6e8256a965d5b7a7d43034ea31b2430a3b51066 Author: Edward Tomasz Napierala AuthorDate: 2021-02-05 17:24:23 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-06 23:21:27 +0000 linux: fix handling of flags for 32 bit send(2) syscall Previously the flags were passed as-is, which could resulted in spurious EAGAIN returned for non-blocking sockets, which broke some Steam games. PR: 248065 Reported By: Alex S Tested By: Alex S Reviewed By: emaste MFC After: 3 days Sponsored By: The FreeBSD Foundation --- sys/compat/linux/linux_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 5bfcdbb8fd21..c723af9dfba0 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1178,7 +1178,7 @@ linux_send(struct thread *td, struct linux_send_args *args) bsd_args.s = args->s; bsd_args.buf = (caddr_t)PTRIN(args->msg); bsd_args.len = args->len; - bsd_args.flags = args->flags; + bsd_args.flags = linux_to_bsd_msg_flags(args->flags); bsd_args.to = NULL; bsd_args.tolen = 0; error = sys_sendto(td, &bsd_args); From owner-dev-commits-src-main@freebsd.org Sun Feb 7 13:49:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7F4F652D1BA; Sun, 7 Feb 2021 13:49:26 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYVrQ326Zz4db7; Sun, 7 Feb 2021 13:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 568EC24FC8; Sun, 7 Feb 2021 13:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117DnQWw060234; Sun, 7 Feb 2021 13:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117DnQ7c060233; Sun, 7 Feb 2021 13:49:26 GMT (envelope-from git) Date: Sun, 7 Feb 2021 13:49:26 GMT Message-Id: <202102071349.117DnQ7c060233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nuno Eduardo Simões Leal Teixeira Subject: git: 7b51ac027529 - main - Update Mentor and Mentee Information (eduardo) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eduardo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b51ac027529b698a1fc07f31963a8754b7117c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 13:49:26 -0000 The branch main has been updated by eduardo (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7b51ac027529b698a1fc07f31963a8754b7117c4 commit 7b51ac027529b698a1fc07f31963a8754b7117c4 Author: Nuno Eduardo Simões Leal Teixeira AuthorDate: 2021-02-07 13:46:13 +0000 Commit: Nuno Eduardo Simões Leal Teixeira CommitDate: 2021-02-07 13:46:13 +0000 Update Mentor and Mentee Information (eduardo) --- share/misc/committers-ports.dot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index d23bcff6e8c6..eda6c33fc82f 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -102,6 +102,7 @@ dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] dvl [label="Dan Langille\ndvl@FreeBSD.org\n2014/08/10"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/08/17"] +eduardo [label="Nuno Teixeira\neduardo@FreeBSD.org\n2021/01/27"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"] egypcio [label="Vinícius Zavam\negypcio@FreeBSD.org\n2018/10/04"] ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"] @@ -396,6 +397,8 @@ culot -> wg db -> tj db -> shurd +dbaio -> eduardo + decke -> sperber delphij -> junovitch @@ -466,6 +469,7 @@ gabor -> scheidell garga -> acm garga -> alepulver garga -> dbaio +garga -> eduardo garga -> mandree garga -> mm garga -> rnoland From owner-dev-commits-src-main@freebsd.org Sun Feb 7 14:29:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5563B52E225; Sun, 7 Feb 2021 14:29:49 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYWl11zvgz4h0l; Sun, 7 Feb 2021 14:29:49 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from t480.local (unknown [187.59.152.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: dbaio/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 22C82ABBD; Sun, 7 Feb 2021 14:29:47 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Date: Sun, 7 Feb 2021 11:29:44 -0300 From: "Danilo G. Baio" To: Nuno Eduardo =?utf-8?Q?Sim=C3=B5es?= Leal Teixeira Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, garga@FreeBSD.org Subject: Re: git: 7b51ac027529 - main - Update Mentor and Mentee Information (eduardo) Message-ID: <20210207142944.bbsf7o5c5faalvph@t480.local> References: <202102071349.117DnQ7c060233@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3hnvjfzcd6ndna7c" Content-Disposition: inline In-Reply-To: <202102071349.117DnQ7c060233@gitrepo.freebsd.org> X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 14:29:49 -0000 --3hnvjfzcd6ndna7c Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 07, 2021 at 01:49:26PM +0000, Nuno Eduardo Sim=F5es Leal Teixei= ra wrote: > The branch main has been updated by eduardo (ports committer): >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7b51ac027529b698a1fc07f319= 63a8754b7117c4 >=20 > commit 7b51ac027529b698a1fc07f31963a8754b7117c4 > Author: Nuno Eduardo Sim=F5es Leal Teixeira > AuthorDate: 2021-02-07 13:46:13 +0000 > Commit: Nuno Eduardo Sim=F5es Leal Teixeira > CommitDate: 2021-02-07 13:46:13 +0000 >=20 > Update Mentor and Mentee Information (eduardo) Approved by: garga (mentor), dbaio (mentor) Differential Revision: https://reviews.freebsd.org/D28477 Next commits will have all info. Regards. --=20 Danilo G. Baio (dbaio) --3hnvjfzcd6ndna7c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEORj0UTsjzCy+enIkmpN7LfMuiNcFAmAf+VVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDM5 MThGNDUxM0IyM0NDMkNCRTdBNzIyNDlBOTM3QjJERjMyRTg4RDcACgkQmpN7LfMu iNcT0RAAwVbiVgqdh8ANU08i0zwMkSW7wWsKFHM/3AWvESmjduVifgqajR5ccLoX Yv+VsHkoPgK4B1/E3vvLqv3v8D9orms7gg0NR+HjS2pP7Jw4oaYkp6R10PAUkwJN I9NxV18JcQAzREPk3P+OlGVdou9tzmuyo9x2LGNHh7ji2zXPePGJdgMShTbsfKY1 H8uiepdmcONyZz+paMUPapeZWPVBXz02RZiPMDTn34RLRYsCyks4xKSSivlaRafK Hk1tci3siF7cMFHep1qtOjbXN1V7wIE0U1KON5jLCdHvxsOPreGYoybGjCGjpNHA vnjRR3lqfy8vHDB0Rqyl427pBM7fET3jzOjgZbwSWvZOciJzDREV1PV609Lcdmbp CiT6sdOF3t98m0got5lvJ/q1n44CA9BBp1im9eKV6Q5cbPN+CFRiGr6wAqopwdr1 uzPcTkb2J9gO+z37hcV/AkQQYfCb8K5BCHqDB1x/e+FVcRSROxPQBpNaM9Kf9PcO V/5GV5x65YAE3hPoSJz1kPr4NLpmgWIiUlYz01xyTVH33rcspRcVnnlXKR3qA8fi V88ekzCjl3q6QRIb/WQYhHsH48H0CHmgvyT4oTIRwnKMl94aycrpaYprO4LECSqN s9p7DzlcNBqCFoFNxiVnW7j3D05imlGkCk7gCVwgqbWth4eTgfY= =XXOz -----END PGP SIGNATURE----- --3hnvjfzcd6ndna7c-- From owner-dev-commits-src-main@freebsd.org Sun Feb 7 14:32:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 22EFD52E47C; Sun, 7 Feb 2021 14:32:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYWpR0QT2z4hR9; Sun, 7 Feb 2021 14:32:47 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 0118325D94; Sun, 7 Feb 2021 14:32:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117EWktV024535; Sun, 7 Feb 2021 14:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117EWk0Z024534; Sun, 7 Feb 2021 14:32:46 GMT (envelope-from git) Date: Sun, 7 Feb 2021 14:32:46 GMT Message-Id: <202102071432.117EWk0Z024534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: ed0a1527507e - main - netgraph/ng_bridge: Remove old table ABI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed0a1527507e916c78e6937bcc4061bb81fd9da8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 14:32:47 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=ed0a1527507e916c78e6937bcc4061bb81fd9da8 commit ed0a1527507e916c78e6937bcc4061bb81fd9da8 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 22:09:52 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 14:29:07 +0000 netgraph/ng_bridge: Remove old table ABI This was announced to happen after the 12 relases. Remove a depeciated ABI. The complete removal is for HEAD only. I'll remove the #define in stable/13 as MFC, so the code will still exist in 13.x, but will not included by default. Earlier versions will not be affected. Reviewed by: kp MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D28518 --- sys/netgraph/ng_bridge.c | 69 ------------------------------------------------ sys/netgraph/ng_bridge.h | 43 ------------------------------ 2 files changed, 112 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 49d8aae87ccf..4898a55f1463 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -461,75 +461,6 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) NGI_GET_MSG(item, msg); switch (msg->header.typecookie) { -#ifdef NGM_BRIDGE_TABLE_ABI - case NGM_BRIDGE_COOKIE_TBL: - switch (msg->header.cmd) { - case NGM_BRIDGE_GET_CONFIG: - { - struct ng_bridge_config_tbl *conf; - - NG_MKRESPONSE(resp, msg, sizeof(*conf), - M_NOWAIT|M_ZERO); - if (resp == NULL) { - error = ENOMEM; - break; - } - conf = (struct ng_bridge_config_tbl *)resp->data; - conf->cfg = priv->conf; - break; - } - case NGM_BRIDGE_SET_CONFIG: - { - struct ng_bridge_config_tbl *conf; - - if (msg->header.arglen != sizeof(*conf)) { - error = EINVAL; - break; - } - conf = (struct ng_bridge_config_tbl *)msg->data; - priv->conf = conf->cfg; - break; - } - case NGM_BRIDGE_GET_TABLE: - { - struct ng_bridge_host_tbl_ary *ary; - struct ng_bridge_hent *hent; - int i, bucket; - - NG_MKRESPONSE(resp, msg, sizeof(*ary) + - (priv->numHosts * sizeof(*ary->hosts)), M_NOWAIT); - if (resp == NULL) { - error = ENOMEM; - break; - } - ary = (struct ng_bridge_host_tbl_ary *)resp->data; - ary->numHosts = priv->numHosts; - i = 0; - for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - const char *name = NG_HOOK_NAME(hent->host.link->hook); - const char *prefix = name[0] == 'u' ? - NG_BRIDGE_HOOK_UPLINK_PREFIX : - NG_BRIDGE_HOOK_LINK_PREFIX; - - memcpy(ary->hosts[i].addr, - hent->host.addr, - sizeof(ary->hosts[i].addr)); - ary->hosts[i].age = hent->host.age; - ary->hosts[i].staleness = - hent->host.staleness; - ary->hosts[i].linkNum = strtol( - name + strlen(prefix), NULL, 10); - i++; - } - } - break; - } - } - /* If already handled break, otherwise use new ABI. */ - if (resp != NULL || error != 0) - break; -#endif /* NGM_BRIDGE_TABLE_ABI */ case NGM_BRIDGE_COOKIE: switch (msg->header.cmd) { case NGM_BRIDGE_GET_CONFIG: diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index 2aecf7f9f9cb..f4771cc401d4 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -43,24 +43,10 @@ #ifndef _NETGRAPH_NG_BRIDGE_H_ #define _NETGRAPH_NG_BRIDGE_H_ -/* - * Support the older ABI based on fixed size tables. - * ABI is deprecated, to be removed in releases > 12 - * Please note: There is no API support! - * You canno create new messages using the old API but messages conforming the - * old ABI are understood. - */ -#define NGM_BRIDGE_TABLE_ABI - /* Node type name and magic cookie */ #define NG_BRIDGE_NODE_TYPE "bridge" #define NGM_BRIDGE_COOKIE 1569321993 -#ifdef NGM_BRIDGE_TABLE_ABI -#define NGM_BRIDGE_COOKIE_TBL 967239368 -#define NG_BRIDGE_MAX_LINKS 32 -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ @@ -75,13 +61,6 @@ struct ng_bridge_config { u_int32_t minStableAge; /* min time for a stable host */ }; -#ifdef NGM_BRIDGE_TABLE_ABI -struct ng_bridge_config_tbl { - u_char ipfw[NG_BRIDGE_MAX_LINKS]; - struct ng_bridge_config cfg; -}; -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* Keep this in sync with the above structure definition */ #define NG_BRIDGE_CONFIG_TYPE_INFO { \ { "debugLevel", &ng_parse_uint8_type }, \ @@ -138,15 +117,6 @@ struct ng_bridge_host { u_int16_t staleness; /* seconds ago host last heard from */ }; -#ifdef NGM_BRIDGE_TABLE_ABI -struct ng_bridge_host_tbl { - u_char addr[6]; /* ethernet address */ - u_int16_t linkNum; /* link where addr can be found */ - u_int16_t age; /* seconds ago entry was created */ - u_int16_t staleness; /* seconds ago host last heard from */ -}; -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* external representation of the host */ struct ng_bridge_hostent { u_char addr[6]; /* ethernet address */ @@ -177,19 +147,6 @@ struct ng_bridge_host_ary { { NULL } \ } -#ifdef NGM_BRIDGE_TABLE_ABI -struct ng_bridge_hostent_tbl { - u_char addr[6]; /* ethernet address */ - u_int16_t linkNum; /* link where addr can be found */ - u_int16_t age; /* seconds ago entry was created */ - u_int16_t staleness; /* seconds ago host last heard from */ -}; -struct ng_bridge_host_tbl_ary { - u_int32_t numHosts; - struct ng_bridge_hostent_tbl hosts[]; -}; -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* Netgraph control messages */ enum { NGM_BRIDGE_SET_CONFIG = 1, /* set node configuration */ From owner-dev-commits-src-main@freebsd.org Sun Feb 7 14:40:51 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E993652E363; Sun, 7 Feb 2021 14:40:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYWzl6MFrz4hZM; Sun, 7 Feb 2021 14:40:51 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 CD31D25A62; Sun, 7 Feb 2021 14:40:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117EepR1033224; Sun, 7 Feb 2021 14:40:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117Eep3U033223; Sun, 7 Feb 2021 14:40:51 GMT (envelope-from git) Date: Sun, 7 Feb 2021 14:40:51 GMT Message-Id: <202102071440.117Eep3U033223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb67e52db143b699bdac1830717930b26a7b5766 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 14:40:52 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=bb67e52db143b699bdac1830717930b26a7b5766 commit bb67e52db143b699bdac1830717930b26a7b5766 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 22:18:55 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 14:39:57 +0000 netgraph/ng_bridge: Make simple internal functions read-only The data path in netgraph is designed to work on an read only state of the whole netgraph network. Currently this is achived by convetion, there is no technical enforcment. This patch is part of a series to make ng_brigde multithreaded, which is done by rewrite the data path to const handling. Reviewed By: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28141 --- sys/netgraph/netgraph.h | 5 ++++- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 7535472dc631..5040471c5ce0 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -87,6 +87,9 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; +typedef struct ng_item const *item_cp; +typedef struct ng_node const *node_cp; +typedef struct ng_hook const *hook_cp; /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1139,7 +1142,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_p node); +ng_ID_t ng_node2ID(node_cp node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index dadf86eb8dde..6ab39421b255 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_p node) +ng_node2ID(node_cp node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 4898a55f1463..d5b3b520a497 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,6 +115,7 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; +typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -130,6 +131,7 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; +typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_p node); +static const char *ng_bridge_nodename(node_cp node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -920,7 +922,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_p priv, const u_char *addr) +ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1131,7 +1133,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_p node) +ng_bridge_nodename(node_cp node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-main@freebsd.org Sun Feb 7 15:27:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A782052F2CF; Sun, 7 Feb 2021 15:27:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYY1G3hNMz4kXH; Sun, 7 Feb 2021 15:27:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42d.google.com with SMTP id r7so4562567wrq.9; Sun, 07 Feb 2021 07:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0wSozjItnSq03tsCWQrJgEP0Gvy+ZSrQZcyyTaDk1+g=; b=lV+HQvYazG3aLbC+ZAY6ozK+tkWhxcMt+ahuTOCGJ32H8DV2PQHlRQKlHiS8yYKNTM B7AaJ410UcFPGm08ULlK4KS1pmSSOslcuBU8lKqmJnwrLBJwb1LwYH7v0d+ZxANe6zGV gvp3vdblg/bmjIWJ6PoiNVJvi3iDv7RCZ7vvS8BvEdzxG3p+w5Npx73osOWHPLeyCrh0 GhKtrYuBMOnuFG8rr8srA/w9m6BCq6FN5HPj/dWN1nX0LkapxQeXAtbP9rfM1hVzwqpG OTLDyjxTiDrOzYjlL1rnkJ790TS8FbUQzqwOC9JlEdqiLO0oJR5Rr2lrI3UpFDVnh0NZ YtDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0wSozjItnSq03tsCWQrJgEP0Gvy+ZSrQZcyyTaDk1+g=; b=g7XsKDcgfCY1W7lAjffmBOEQHsFdh4uVihM/P6IQsidGJo3NnH191OeiD4USkEsg+W C7f9/T2mu9qD1mrlSLvqrzB65EHCxVSLiSHTyMHNGqIfF8VFPZn2GJz18rp8+W2qpxA1 o80dO4YyLjsOl/KSt1Y40H842vrnNljQEXltdEGZKRFTgcXF0XSi+AS5g4YzOLdSEcAO yP5qzSyQRx40H6HJYkqwgt17R/EP2zygCd/I5FfRAkx+3AmXwdmgr+52Q0KbIr3l95c5 K8mfqqaIf+drrcHsV3o7vDhwJcsrXeaYrV47YQpGP68H5EUeoSrII2LS7a9ObhMFoGWK P82w== X-Gm-Message-State: AOAM533cDr+LG2npfe0bUqKHJS3y73pikiU/xf2z3Fjp1EBjV0FQaD4b he3Jr0PCC5/Kn1vIjtsH7VGSIPKuR7S5lJusfnrCkFRROPQ= X-Google-Smtp-Source: ABdhPJxapNvzX9SC9rjh6QGOZ1FfwipFnGjnpf2N5f1kizW3koZPMtuGKfg5DI9lQjZ5JYF5w6w40qG6vaL3sYSDLJc= X-Received: by 2002:a05:6000:186f:: with SMTP id d15mr15556831wri.237.1612711632989; Sun, 07 Feb 2021 07:27:12 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Sun, 7 Feb 2021 07:27:11 -0800 (PST) In-Reply-To: <202102071440.117Eep3U033223@gitrepo.freebsd.org> References: <202102071440.117Eep3U033223@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 7 Feb 2021 16:27:11 +0100 Message-ID: Subject: Re: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only To: Lutz Donnerhacke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DYY1G3hNMz4kXH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 15:27:14 -0000 One of your commits mass breaks LINT kernels: arm LINT kernel failed, check _.arm.LINT for details riscv LINT kernel failed, check _.riscv.LINT for details arm64 LINT kernel failed, check _.arm64.LINT for details i386 LINT-NOIP kernel failed, check _.i386.LINT-NOIP for details i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details i386 LINT kernel failed, check _.i386.LINT for details i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details powerpc LINT64 kernel failed, check _.powerpc.LINT64 for details powerpc LINT kernel failed, check _.powerpc.LINT for details amd64 LINT kernel failed, check _.amd64.LINT for details amd64 LINT-NOIP kernel failed, check _.amd64.LINT-NOIP for details amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details amd64 LINT-NOINET6 kernel failed, check _.amd64.LINT-NOINET6 for details /usr/src/sys/netgraph/ng_base.c:841:28: error: passing 'node_cp' (aka 'const struct ng_node *') to parameter of type 'node_p' (aka 'stru ct ng_node *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] return (node ? NG_NODE_ID(node) : 0); ^~~~ /usr/src/sys/netgraph/netgraph.h:580:39: note: expanded from macro 'NG_NODE_ID' #define NG_NODE_ID(node) _ng_node_id(node, _NN_) ^~~~ /usr/src/sys/netgraph/netgraph.h:485:20: note: passing argument to parameter 'node' here _ng_node_id(node_p node, char *file, int line) On 2/7/21, Lutz Donnerhacke wrote: > The branch main has been updated by donner: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=bb67e52db143b699bdac1830717930b26a7b5766 > > commit bb67e52db143b699bdac1830717930b26a7b5766 > Author: Lutz Donnerhacke > AuthorDate: 2021-01-13 22:18:55 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-07 14:39:57 +0000 > > netgraph/ng_bridge: Make simple internal functions read-only > > The data path in netgraph is designed to work on an read only state of > the whole netgraph network. Currently this is achived by convetion, > there is no technical enforcment. This patch is part of a series to > make ng_brigde multithreaded, which is done by rewrite the data path > to const handling. > > Reviewed By: kp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D28141 > --- > sys/netgraph/netgraph.h | 5 ++++- > sys/netgraph/ng_base.c | 2 +- > sys/netgraph/ng_bridge.c | 10 ++++++---- > 3 files changed, 11 insertions(+), 6 deletions(-) > > diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h > index 7535472dc631..5040471c5ce0 100644 > --- a/sys/netgraph/netgraph.h > +++ b/sys/netgraph/netgraph.h > @@ -87,6 +87,9 @@ struct ng_item ; > typedef struct ng_item *item_p; > typedef struct ng_node *node_p; > typedef struct ng_hook *hook_p; > +typedef struct ng_item const *item_cp; > +typedef struct ng_node const *node_cp; > +typedef struct ng_hook const *hook_cp; > > /* node method definitions */ > typedef int ng_constructor_t(node_p node); > @@ -1139,7 +1142,7 @@ int ng_make_node_common(struct ng_type *typep, node_p > *nodep); > int ng_name_node(node_p node, const char *name); > node_p ng_name2noderef(node_p node, const char *name); > int ng_newtype(struct ng_type *tp); > -ng_ID_t ng_node2ID(node_p node); > +ng_ID_t ng_node2ID(node_cp node); > item_p ng_package_data(struct mbuf *m, int flags); > item_p ng_package_msg(struct ng_mesg *msg, int flags); > item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); > diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c > index dadf86eb8dde..6ab39421b255 100644 > --- a/sys/netgraph/ng_base.c > +++ b/sys/netgraph/ng_base.c > @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) > } > > ng_ID_t > -ng_node2ID(node_p node) > +ng_node2ID(node_cp node) > { > return (node ? NG_NODE_ID(node) : 0); > } > diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c > index 4898a55f1463..d5b3b520a497 100644 > --- a/sys/netgraph/ng_bridge.c > +++ b/sys/netgraph/ng_bridge.c > @@ -115,6 +115,7 @@ struct ng_bridge_link { > sendUnknown : 1;/* send unknown macs out */ > struct ng_bridge_link_kernel_stats stats; /* link stats */ > }; > +typedef struct ng_bridge_link const *link_cp; /* read only access */ > > /* Per-node private data */ > struct ng_bridge_private { > @@ -130,6 +131,7 @@ struct ng_bridge_private { > struct callout timer; /* one second periodic timer */ > }; > typedef struct ng_bridge_private *priv_p; > +typedef struct ng_bridge_private const *priv_cp; /* read only access */ > > /* Information about a host, stored in a hash table entry */ > struct ng_bridge_hent { > @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; > static ng_disconnect_t ng_bridge_disconnect; > > /* Other internal functions */ > -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char > *addr); > +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char > *addr); > static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); > static void ng_bridge_rehash(priv_p priv); > static void ng_bridge_remove_hosts(priv_p priv, link_p link); > static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int > arg2); > -static const char *ng_bridge_nodename(node_p node); > +static const char *ng_bridge_nodename(node_cp node); > > /* Ethernet broadcast */ > static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = > @@ -920,7 +922,7 @@ ng_bridge_disconnect(hook_p hook) > * Find a host entry in the table. > */ > static struct ng_bridge_host * > -ng_bridge_get(priv_p priv, const u_char *addr) > +ng_bridge_get(priv_cp priv, const u_char *addr) > { > const int bucket = HASH(addr, priv->hashMask); > struct ng_bridge_hent *hent; > @@ -1131,7 +1133,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void > *arg1, int arg2) > * Return node's "name", even if it doesn't have one. > */ > static const char * > -ng_bridge_nodename(node_p node) > +ng_bridge_nodename(node_cp node) > { > static char name[NG_NODESIZ]; > > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Sun Feb 7 16:39:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2A55053162C; Sun, 7 Feb 2021 16:39:21 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYZcS69lxz4pVV; Sun, 7 Feb 2021 16:39:20 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 117Gd3RC003790 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 7 Feb 2021 17:39:03 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 117Gd3Df001397; Sun, 7 Feb 2021 17:39:03 +0100 Date: Sun, 7 Feb 2021 17:39:03 +0100 From: Lutz Donnerhacke To: Mateusz Guzik Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only Message-ID: <20210207163903.GA1311@belenus.iks-jena.de> References: <202102071440.117Eep3U033223@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DYZcS69lxz4pVV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 16:39:21 -0000 On Sun, Feb 07, 2021 at 04:27:11PM +0100, Mateusz Guzik wrote: > One of your commits mass breaks LINT kernels: That was not the plan. I did compile all the netgraph code after the üatch without any problems. Thank you for detecting this. I'll revert the patch and rework it. From owner-dev-commits-src-main@freebsd.org Sun Feb 7 16:40:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 392FE53146A; Sun, 7 Feb 2021 16:40:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYZf31BPbz4pYf; Sun, 7 Feb 2021 16:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 1C67E272BC; Sun, 7 Feb 2021 16:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117GehxH089689; Sun, 7 Feb 2021 16:40:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117GehC2089688; Sun, 7 Feb 2021 16:40:43 GMT (envelope-from git) Date: Sun, 7 Feb 2021 16:40:43 GMT Message-Id: <202102071640.117GehC2089688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: cef689f45b9d - main - Revert "netgraph/ng_bridge: Make simple internal functions read-only" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cef689f45b9d5785ede463bcd23fea51bc1143ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 16:40:43 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=cef689f45b9d5785ede463bcd23fea51bc1143ed commit cef689f45b9d5785ede463bcd23fea51bc1143ed Author: Lutz Donnerhacke AuthorDate: 2021-02-07 16:39:35 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 16:39:35 +0000 Revert "netgraph/ng_bridge: Make simple internal functions read-only" Patch mass breaks LINT kernels. This reverts commit bb67e52db143b699bdac1830717930b26a7b5766. --- sys/netgraph/netgraph.h | 5 +---- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 5040471c5ce0..7535472dc631 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -87,9 +87,6 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; -typedef struct ng_item const *item_cp; -typedef struct ng_node const *node_cp; -typedef struct ng_hook const *hook_cp; /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1142,7 +1139,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_cp node); +ng_ID_t ng_node2ID(node_p node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 6ab39421b255..dadf86eb8dde 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_cp node) +ng_node2ID(node_p node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index d5b3b520a497..4898a55f1463 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,7 +115,6 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; -typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -131,7 +130,6 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; -typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -151,12 +149,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_cp node); +static const char *ng_bridge_nodename(node_p node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -922,7 +920,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_cp priv, const u_char *addr) +ng_bridge_get(priv_p priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1133,7 +1131,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_cp node) +ng_bridge_nodename(node_p node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-main@freebsd.org Sun Feb 7 17:31:40 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3CD4D53242F; Sun, 7 Feb 2021 17:31:40 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYbmq6zl7z4rtS; Sun, 7 Feb 2021 17:31:39 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 117HVafW010297 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 7 Feb 2021 18:31:36 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 117HVZ4M002629; Sun, 7 Feb 2021 18:31:35 +0100 Date: Sun, 7 Feb 2021 18:31:35 +0100 From: Lutz Donnerhacke To: Mateusz Guzik Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only Message-ID: <20210207173135.GA2488@belenus.iks-jena.de> References: <202102071440.117Eep3U033223@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DYbmq6zl7z4rtS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 17:31:40 -0000 On Sun, Feb 07, 2021 at 04:27:11PM +0100, Mateusz Guzik wrote: > One of your commits mass breaks LINT kernels: Got the error trigger. LINT includes all configuration options, even NETGRAPH_DEBUG. This option includes a complete different set of code, which is amost never used (it annotate and logs all netgraph calls to the kernel console and never frees any allocated memory). This is done by replaceing macros by functions calls. And those calls are now checked. Thank you for pointing this out. From owner-dev-commits-src-main@freebsd.org Sun Feb 7 19:36:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8C586535042; Sun, 7 Feb 2021 19:36:32 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYfXw3GbSz3Glc; Sun, 7 Feb 2021 19:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 62AAD1A3F; Sun, 7 Feb 2021 19:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117JaWMj015459; Sun, 7 Feb 2021 19:36:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117JaW9B015458; Sun, 7 Feb 2021 19:36:32 GMT (envelope-from git) Date: Sun, 7 Feb 2021 19:36:32 GMT Message-Id: <202102071936.117JaW9B015458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 6117aa58fa4f - main - netgraph/ng_bridge: Make simple internal functions read-only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6117aa58fa4f5891badf58b13c759976983f4f04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 19:36:32 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=6117aa58fa4f5891badf58b13c759976983f4f04 commit 6117aa58fa4f5891badf58b13c759976983f4f04 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 22:18:55 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 19:31:33 +0000 netgraph/ng_bridge: Make simple internal functions read-only The data path in netgraph is designed to work on an read only state of the whole netgraph network. Currently this is achived by convention, there is no technical enforcment. In the case of NETGRAPH_DEBUG all nodes can be annotated for debugging purposes, so the strict enforcment needs to be lifted for this purpose. This patch is part of a series to make ng_bridge multithreaded, which is done by rewrite the data path to operate on const. Reviewed By: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28141 --- sys/netgraph/netgraph.h | 9 ++++++++- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 7535472dc631..9cc298b38236 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -87,6 +87,13 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; +typedef struct ng_item const *item_cp; +typedef struct ng_hook const *hook_cp; +#ifdef NETGRAPH_DEBUG +typedef struct ng_node *node_cp; /* annotated during debug */ +#else /* NETGRAPH_DEBUG */ +typedef struct ng_node const *node_cp; +#endif /* NETGRAPH_DEBUG */ /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1139,7 +1146,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_p node); +ng_ID_t ng_node2ID(node_cp node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index dadf86eb8dde..6ab39421b255 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_p node) +ng_node2ID(node_cp node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 4898a55f1463..d5b3b520a497 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,6 +115,7 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; +typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -130,6 +131,7 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; +typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_p node); +static const char *ng_bridge_nodename(node_cp node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -920,7 +922,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_p priv, const u_char *addr) +ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1131,7 +1133,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_p node) +ng_bridge_nodename(node_cp node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-main@freebsd.org Sun Feb 7 21:28:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 71232539A6D; Sun, 7 Feb 2021 21:28:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYj1y2kz9z3h6H; Sun, 7 Feb 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 50D563825; Sun, 7 Feb 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117LSM3p058860; Sun, 7 Feb 2021 21:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117LSM6k058859; Sun, 7 Feb 2021 21:28:22 GMT (envelope-from git) Date: Sun, 7 Feb 2021 21:28:22 GMT Message-Id: <202102072128.117LSM6k058859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: e44a78ce6f24 - main - linux: add support for SO_PEERSEC getsockopt MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e44a78ce6f249f1eb7df94cb6953698953ebd88b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 21:28:22 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=e44a78ce6f249f1eb7df94cb6953698953ebd88b commit e44a78ce6f249f1eb7df94cb6953698953ebd88b Author: Edward Tomasz Napierala AuthorDate: 2021-02-07 20:28:35 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-07 20:42:04 +0000 linux: add support for SO_PEERSEC getsockopt It returns "unconfined", like Linux without SELinux would. Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28164 --- sys/compat/linux/linux_socket.c | 26 ++++++++++++++++++++++++++ sys/compat/linux/linux_socket.h | 1 + 2 files changed, 27 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index c723af9dfba0..a4c5bf0b581e 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define SECURITY_CONTEXT_STRING "unconfined" + static int linux_sendmsg_common(struct thread *, l_int, struct l_msghdr *, l_uint); static int linux_recvmsg_common(struct thread *, l_int, struct l_msghdr *, @@ -1861,6 +1863,28 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) return (error); } +static int +linux_getsockopt_so_peersec(struct thread *td, + struct linux_getsockopt_args *args) +{ + socklen_t len; + int error; + + len = sizeof(SECURITY_CONTEXT_STRING); + if (args->optlen < len) { + error = copyout(&len, PTRIN(args->optlen), sizeof(len)); + if (error == 0) + error = ERANGE; + return (error); + } + + error = copyout(SECURITY_CONTEXT_STRING, + PTRIN(args->optval), sizeof(SECURITY_CONTEXT_STRING)); + if (error == 0) + error = copyout(&len, PTRIN(args->optlen), sizeof(len)); + return (error); +} + int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) { @@ -1875,6 +1899,8 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) level = linux_to_bsd_sockopt_level(args->level); switch (level) { case SOL_SOCKET: + if (args->optname == LINUX_SO_PEERSEC) + return (linux_getsockopt_so_peersec(td, args)); name = linux_to_bsd_so_sockopt(args->optname); switch (name) { case LOCAL_CREDS_PERSISTENT: diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index 5ebd6392264b..32a19a348312 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -195,6 +195,7 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #endif #define LINUX_SO_TIMESTAMP 29 #define LINUX_SO_ACCEPTCONN 30 +#define LINUX_SO_PEERSEC 31 #define LINUX_SO_SNDBUFFORCE 32 #define LINUX_SO_RCVBUFFORCE 33 #define LINUX_SO_PROTOCOL 38 From owner-dev-commits-src-main@freebsd.org Sun Feb 7 22:14:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F1ADB53B1F1; Sun, 7 Feb 2021 22:14:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYk3Y6V4Cz3lFt; Sun, 7 Feb 2021 22:14:49 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D1ACE42AA; Sun, 7 Feb 2021 22:14:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117MEnbI023825; Sun, 7 Feb 2021 22:14:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117MEnF7023824; Sun, 7 Feb 2021 22:14:49 GMT (envelope-from git) Date: Sun, 7 Feb 2021 22:14:49 GMT Message-Id: <202102072214.117MEnF7023824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: d26f2a50ff48 - main - powerpc64: Fix boot on virtual-mode OF (PowerMac G5) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d26f2a50ff48dacd38ba358d658882d51f7bdbc4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 22:14:50 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=d26f2a50ff48dacd38ba358d658882d51f7bdbc4 commit d26f2a50ff48dacd38ba358d658882d51f7bdbc4 Author: Brandon Bergren AuthorDate: 2021-02-07 22:05:41 +0000 Commit: Brandon Bergren CommitDate: 2021-02-07 22:13:55 +0000 powerpc64: Fix boot on virtual-mode OF (PowerMac G5) In 78599c32efed3247d165302a1fbe8d9203e38974, CFI endproc decoration was added to locore64.S. However, it missed the subtle detail that __restartkernel_virtual() falls through to __restartkernel(). This was causing boot failure on PowerMac G5, as it tried to execute the epilogue as code. Fix this by branching to __restartkernel() instead of intentionally running off the end of the function. While here, add some additional notes on how the virtual mode restart works. MFC after: 3 days --- sys/powerpc/aim/locore64.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S index 0bc0619620d9..f0a183c4b331 100644 --- a/sys/powerpc/aim/locore64.S +++ b/sys/powerpc/aim/locore64.S @@ -255,6 +255,16 @@ ASENTRY_NOPROF(__restartkernel_virtual) addi %r14, %r14, 1 cmpdi %r14, 16 blt 1b + + /* + * Now that we are set up with a temporary direct map, we can + * continue with __restartkernel. Translation will be switched + * back on at the rfid, at which point we will be executing from + * the temporary direct map we just installed, until the kernel + * takes over responsibility for the MMU. + */ + bl __restartkernel + nop ASEND(__restartkernel_virtual) ASENTRY_NOPROF(__restartkernel) From owner-dev-commits-src-main@freebsd.org Sun Feb 7 23:49:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A0F9A53D3EA; Sun, 7 Feb 2021 23:49:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYm9848hyz3rNK; Sun, 7 Feb 2021 23:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8147551DF; Sun, 7 Feb 2021 23:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 117Nnmwi041463; Sun, 7 Feb 2021 23:49:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117NnmB2041462; Sun, 7 Feb 2021 23:49:48 GMT (envelope-from git) Date: Sun, 7 Feb 2021 23:49:48 GMT Message-Id: <202102072349.117NnmB2041462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: b3c6fe663bb9 - main - epoll: Store epoll_event udata member in ext member of kevent. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3c6fe663bb90240f8bda6b5ba9c6a761f09f078 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 23:49:48 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b3c6fe663bb90240f8bda6b5ba9c6a761f09f078 commit b3c6fe663bb90240f8bda6b5ba9c6a761f09f078 Author: Vladimir Kondratyev AuthorDate: 2021-02-07 23:46:14 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-07 23:46:14 +0000 epoll: Store epoll_event udata member in ext member of kevent. Current epoll implementation stores udata fields of epoll_event structure in special dynamically-sized table rather than in udata field of backing kevent structure because of 2 reasons: 1. Kevent's udata size is smaller than epoll's on 32-bit archs. 2. Kevent's udata can be clobbered on execution EPOLL_CTL_ADD as kqueue modifies existing event while epoll returns error in this case. After r320043 has introduced four new 64bit user data members (ext[]), we can store epoll udata in one of them and drop aforementioned table. According to kqueue_register() source code ext members are not updated when existing kevent is modified that fixes p.2. As a side effect the patch fixes PR/252582. Reviewed by: trasz MFC after: 1 month Differential revision: https://reviews.freebsd.org/D28169 --- sys/compat/linux/linux_emul.c | 21 ---------- sys/compat/linux/linux_emul.h | 1 - sys/compat/linux/linux_event.c | 88 ++++++------------------------------------ 3 files changed, 11 insertions(+), 99 deletions(-) diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 1dfbe239ccc4..499bebe8926a 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -143,7 +143,6 @@ linux_proc_init(struct thread *td, struct thread *newtd, int flags) { struct linux_emuldata *em; struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct proc *p; if (newtd != NULL) { @@ -185,15 +184,9 @@ linux_proc_init(struct thread *td, struct thread *newtd, int flags) em->child_clear_tid = NULL; em->child_set_tid = NULL; - /* epoll should be destroyed in a case of exec. */ pem = pem_find(p); KASSERT(pem != NULL, ("proc_exit: proc emuldata not found.\n")); pem->persona = 0; - if (pem->epoll != NULL) { - emd = pem->epoll; - pem->epoll = NULL; - free(emd, M_EPOLL); - } } } @@ -202,7 +195,6 @@ void linux_on_exit(struct proc *p) { struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct thread *td = curthread; MPASS(SV_CURPROC_ABI() == SV_ABI_LINUX); @@ -217,12 +209,6 @@ linux_on_exit(struct proc *p) p->p_emuldata = NULL; - if (pem->epoll != NULL) { - emd = pem->epoll; - pem->epoll = NULL; - free(emd, M_EPOLL); - } - sx_destroy(&pem->pem_sx); free(pem, M_LINUX); } @@ -267,7 +253,6 @@ int linux_common_execve(struct thread *td, struct image_args *eargs) { struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct vmspace *oldvmspace; struct linux_emuldata *em; struct proc *p; @@ -299,12 +284,6 @@ linux_common_execve(struct thread *td, struct image_args *eargs) p->p_emuldata = NULL; PROC_UNLOCK(p); - if (pem->epoll != NULL) { - emd = pem->epoll; - pem->epoll = NULL; - free(emd, M_EPOLL); - } - free(em, M_TEMP); free(pem, M_LINUX); } diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h index 1bbc69ad98be..de66a7a4c82a 100644 --- a/sys/compat/linux/linux_emul.h +++ b/sys/compat/linux/linux_emul.h @@ -68,7 +68,6 @@ int linux_common_execve(struct thread *, struct image_args *); struct linux_pemuldata { uint32_t flags; /* process emuldata flags */ struct sx pem_sx; /* lock for this struct */ - void *epoll; /* epoll data */ uint32_t persona; /* process execution domain */ uint32_t ptrace_flags; /* used by ptrace(2) */ }; diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index f6cd9304f5cd..991af1b539e4 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -71,25 +71,8 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * epoll defines 'struct epoll_event' with the field 'data' as 64 bits - * on all architectures. But on 32 bit architectures BSD 'struct kevent' only - * has 32 bit opaque pointer as 'udata' field. So we can't pass epoll supplied - * data verbatuim. Therefore we allocate 64-bit memory block to pass - * user supplied data for every file descriptor. - */ - typedef uint64_t epoll_udata_t; -struct epoll_emuldata { - uint32_t fdc; /* epoll udata max index */ - epoll_udata_t udata[1]; /* epoll user data vector */ -}; - -#define EPOLL_DEF_SZ 16 -#define EPOLL_SIZE(fdn) \ - (sizeof(struct epoll_emuldata)+(fdn) * sizeof(epoll_udata_t)) - struct epoll_event { uint32_t events; epoll_udata_t data; @@ -101,7 +84,6 @@ __attribute__((packed)) #define LINUX_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event)) -static void epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata); static int epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event, struct kevent *kevent, int *nkevents); @@ -175,47 +157,11 @@ struct timerfd { static void linux_timerfd_expire(void *); static void linux_timerfd_curval(struct timerfd *, struct itimerspec *); -static void -epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata) -{ - struct linux_pemuldata *pem; - struct epoll_emuldata *emd; - struct proc *p; - - p = td->td_proc; - - pem = pem_find(p); - KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); - - LINUX_PEM_XLOCK(pem); - if (pem->epoll == NULL) { - emd = malloc(EPOLL_SIZE(fd), M_EPOLL, M_WAITOK); - emd->fdc = fd; - pem->epoll = emd; - } else { - emd = pem->epoll; - if (fd > emd->fdc) { - emd = realloc(emd, EPOLL_SIZE(fd), M_EPOLL, M_WAITOK); - emd->fdc = fd; - pem->epoll = emd; - } - } - emd->udata[fd] = udata; - LINUX_PEM_XUNLOCK(pem); -} - static int epoll_create_common(struct thread *td, int flags) { - int error; - - error = kern_kqueue(td, flags, NULL); - if (error != 0) - return (error); - - epoll_fd_install(td, EPOLL_DEF_SZ, 0); - return (0); + return (kern_kqueue(td, flags, NULL)); } #ifdef LINUX_LEGACY_SYSCALLS @@ -271,11 +217,15 @@ epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event, /* flags related to what event is registered */ if ((levents & LINUX_EPOLL_EVRD) != 0) { - EV_SET(kevent++, fd, EVFILT_READ, kev_flags, 0, 0, 0); + EV_SET(kevent, fd, EVFILT_READ, kev_flags, 0, 0, 0); + kevent->ext[0] = l_event->data; + ++kevent; ++(*nkevents); } if ((levents & LINUX_EPOLL_EVWR) != 0) { - EV_SET(kevent++, fd, EVFILT_WRITE, kev_flags, 0, 0, 0); + EV_SET(kevent, fd, EVFILT_WRITE, kev_flags, 0, 0, 0); + kevent->ext[0] = l_event->data; + ++kevent; ++(*nkevents); } /* zero event mask is legal */ @@ -289,7 +239,6 @@ epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event, pem = pem_find(p); KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); - KASSERT(pem->epoll != NULL, ("epoll proc epolldata not found.\n")); LINUX_PEM_XLOCK(pem); if ((pem->flags & LINUX_XUNSUP_EPOLL) == 0) { @@ -314,6 +263,8 @@ static void kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event) { + l_event->data = kevent->ext[0]; + if ((kevent->flags & EV_ERROR) != 0) { l_event->events = LINUX_EPOLLERR; return; @@ -342,30 +293,15 @@ static int epoll_kev_copyout(void *arg, struct kevent *kevp, int count) { struct epoll_copyout_args *args; - struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct epoll_event *eep; - int error, fd, i; + int error, i; args = (struct epoll_copyout_args*) arg; eep = malloc(sizeof(*eep) * count, M_EPOLL, M_WAITOK | M_ZERO); - pem = pem_find(args->p); - KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); - LINUX_PEM_SLOCK(pem); - emd = pem->epoll; - KASSERT(emd != NULL, ("epoll proc epolldata not found.\n")); - - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) kevent_to_epoll(&kevp[i], &eep[i]); - fd = kevp[i].ident; - KASSERT(fd <= emd->fdc, ("epoll user data vector" - " is too small.\n")); - eep[i].data = emd->udata[fd]; - } - LINUX_PEM_SUNLOCK(pem); - error = copyout(eep, args->leventlist, count * sizeof(*eep)); if (error == 0) { args->leventlist += count; @@ -473,8 +409,6 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ctl_args *args) goto leave0; } - epoll_fd_install(td, args->fd, le.data); - error = kern_kevent_fp(td, epfp, nchanges, 0, &k_ops, NULL); leave0: