From owner-dev-commits-src-main@freebsd.org Mon Jan 25 00:22: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 CA8F94E1421; Mon, 25 Jan 2021 00:22: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 4DP9YQ5Kr5z4pBW; Mon, 25 Jan 2021 00:22: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 A9FAA4F40; Mon, 25 Jan 2021 00:22: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 10P0MYBb080748; Mon, 25 Jan 2021 00:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10P0MYig080747; Mon, 25 Jan 2021 00:22:34 GMT (envelope-from git) Date: Mon, 25 Jan 2021 00:22:34 GMT Message-Id: <202101250022.10P0MYig080747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: 8c5bef2eb24c - main - contrib/tzdata: import tzdata 2021a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c5bef2eb24cb191c87712a56a9860d8c29415a0 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, 25 Jan 2021 00:22:34 -0000 The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=8c5bef2eb24cb191c87712a56a9860d8c29415a0 commit 8c5bef2eb24cb191c87712a56a9860d8c29415a0 Merge: bd01a69f4836 4cd7e1071de1 Author: Philip Paeps AuthorDate: 2021-01-25 00:18:14 +0000 Commit: Philip Paeps CommitDate: 2021-01-25 00:18:14 +0000 contrib/tzdata: import tzdata 2021a Merge commit '4cd7e1071de16a7392b0e466287f13e9e6f2081a' Changes: https://github.com/eggert/tz/blob/2021a/NEWS MFC after: 3 days contrib/tzdata/NEWS | 8 ++++++++ contrib/tzdata/africa | 8 +++++++- contrib/tzdata/leap-seconds.list | 8 ++++---- contrib/tzdata/leapseconds | 8 ++++---- contrib/tzdata/version | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) From owner-dev-commits-src-main@freebsd.org Mon Jan 25 10:15: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 1F9484DA8DA; Mon, 25 Jan 2021 10:15: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 4DPQjl749Jz3hTZ; Mon, 25 Jan 2021 10:15: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 E57FE14AE1; Mon, 25 Jan 2021 10:15: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 10PAFda9049999; Mon, 25 Jan 2021 10:15:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PAFdex049998; Mon, 25 Jan 2021 10:15:39 GMT (envelope-from git) Date: Mon, 25 Jan 2021 10:15:39 GMT Message-Id: <202101251015.10PAFdex049998@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: 46ca0b903cad - main - gic_v3: Use 64-bit writes to GICD_IROUTERn 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: 46ca0b903cad8955574a2c61bed41c2b92aa2273 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, 25 Jan 2021 10:15:40 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=46ca0b903cad8955574a2c61bed41c2b92aa2273 commit 46ca0b903cad8955574a2c61bed41c2b92aa2273 Author: Cyprien Laplace AuthorDate: 2020-11-26 01:17:04 +0000 Commit: Andrew Turner CommitDate: 2021-01-25 10:07:43 +0000 gic_v3: Use 64-bit writes to GICD_IROUTERn While 32-bit accesses to GICD_IROUTERn are allowed, this is a 64-bit register. Pull Request: https://github.com/freebsd/freebsd-src/pull/451 --- sys/arm64/arm64/gic_v3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index f230eb6bbd06..8630a27102e3 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -844,7 +844,7 @@ gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc) if (CPU_EMPTY(&isrc->isrc_cpu)) { gic_irq_cpu = intr_irq_next_cpu(gic_irq_cpu, &all_cpus); CPU_SETOF(gic_irq_cpu, &isrc->isrc_cpu); - gic_d_write(sc, 4, GICD_IROUTER(gi->gi_irq), + gic_d_write(sc, 8, GICD_IROUTER(gi->gi_irq), CPU_AFFINITY(gic_irq_cpu)); } else { /* @@ -852,7 +852,7 @@ gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc) * the first CPU found. */ cpu = CPU_FFS(&isrc->isrc_cpu) - 1; - gic_d_write(sc, 4, GICD_IROUTER(gi->gi_irq), CPU_AFFINITY(cpu)); + gic_d_write(sc, 8, GICD_IROUTER(gi->gi_irq), CPU_AFFINITY(cpu)); } return (0); @@ -1114,7 +1114,7 @@ gic_v3_dist_init(struct gic_v3_softc *sc) */ aff = CPU_AFFINITY(0); for (i = GIC_FIRST_SPI; i < sc->gic_nirqs; i++) - gic_d_write(sc, 4, GICD_IROUTER(i), aff); + gic_d_write(sc, 8, GICD_IROUTER(i), aff); return (0); } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 10:15: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 3CB394DAA44; Mon, 25 Jan 2021 10:15: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 4DPQjn0wf2z3hTc; Mon, 25 Jan 2021 10:15: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 128A91457A; Mon, 25 Jan 2021 10:15: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 10PAFfKM050022; Mon, 25 Jan 2021 10:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PAFfTa050021; Mon, 25 Jan 2021 10:15:41 GMT (envelope-from git) Date: Mon, 25 Jan 2021 10:15:41 GMT Message-Id: <202101251015.10PAFfTa050021@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: 35ebd8d33ad2 - main - gic_v3: add message based interrupts support 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: 35ebd8d33ad2f7c2038f6bf9aa02eab21252f689 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, 25 Jan 2021 10:15:41 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=35ebd8d33ad2f7c2038f6bf9aa02eab21252f689 commit 35ebd8d33ad2f7c2038f6bf9aa02eab21252f689 Author: Cyprien Laplace AuthorDate: 2020-12-05 15:47:33 +0000 Commit: Andrew Turner CommitDate: 2021-01-25 10:08:47 +0000 gic_v3: add message based interrupts support Pull Request: https://github.com/freebsd/freebsd-src/pull/451 --- sys/arm64/arm64/gic_v3.c | 204 ++++++++++++++++++++++++++++++++++++++++++- sys/arm64/arm64/gic_v3_fdt.c | 20 +++++ sys/arm64/arm64/gic_v3_var.h | 5 ++ 3 files changed, 226 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index 8630a27102e3..954ed3cd878a 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #endif #include "pic_if.h" +#include "msi_if.h" #include #include "gic_v3_reg.h" @@ -94,6 +95,12 @@ static pic_ipi_send_t gic_v3_ipi_send; static pic_ipi_setup_t gic_v3_ipi_setup; #endif +static msi_alloc_msi_t gic_v3_alloc_msi; +static msi_release_msi_t gic_v3_release_msi; +static msi_alloc_msix_t gic_v3_alloc_msix; +static msi_release_msix_t gic_v3_release_msix; +static msi_map_msi_t gic_v3_map_msi; + static u_int gic_irq_cpu; #ifdef SMP static u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; @@ -124,6 +131,13 @@ static device_method_t gic_v3_methods[] = { DEVMETHOD(pic_ipi_setup, gic_v3_ipi_setup), #endif + /* MSI/MSI-X */ + DEVMETHOD(msi_alloc_msi, gic_v3_alloc_msi), + DEVMETHOD(msi_release_msi, gic_v3_release_msi), + DEVMETHOD(msi_alloc_msix, gic_v3_alloc_msix), + DEVMETHOD(msi_release_msix, gic_v3_release_msix), + DEVMETHOD(msi_map_msi, gic_v3_map_msi), + /* End */ DEVMETHOD_END }; @@ -150,6 +164,11 @@ struct gic_v3_irqsrc { uint32_t gi_irq; enum intr_polarity gi_pol; enum intr_trigger gi_trig; +#define GI_FLAG_MSI (1 << 1) /* This interrupt source should only */ + /* be used for MSI/MSI-X interrupts */ +#define GI_FLAG_MSI_USED (1 << 2) /* This irq is already allocated */ + /* for a MSI/MSI-X interrupt */ + u_int gi_flags; }; /* Helper routines starting with gic_v3_ */ @@ -314,6 +333,22 @@ gic_v3_attach(device_t dev) } } + if (sc->gic_mbi_start > 0) { + /* Reserve these interrupts for MSI/MSI-X use */ + for (irq = sc->gic_mbi_start; irq <= sc->gic_mbi_end; irq++) { + sc->gic_irqs[irq].gi_pol = INTR_POLARITY_HIGH; + sc->gic_irqs[irq].gi_trig = INTR_TRIGGER_EDGE; + sc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI; + } + + mtx_init(&sc->gic_mbi_mtx, "GICv3 mbi lock", NULL, MTX_DEF); + + if (bootverbose) { + device_printf(dev, "using spi %u to %u\n", sc->gic_mbi_start, + sc->gic_mbi_end); + } + } + /* * Read the Peripheral ID2 register. This is an implementation * defined register, but seems to be implemented in all GICv3 @@ -692,8 +727,11 @@ gic_v3_setup_intr(device_t dev, struct intr_irqsrc *isrc, return (0); } - gi->gi_pol = pol; - gi->gi_trig = trig; + /* For MSI/MSI-X we should have already configured these */ + if ((gi->gi_flags & GI_FLAG_MSI) == 0) { + gi->gi_pol = pol; + gi->gi_trig = trig; + } /* * XXX - In case that per CPU interrupt is going to be enabled in time @@ -742,7 +780,7 @@ gic_v3_teardown_intr(device_t dev, struct intr_irqsrc *isrc, { struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; - if (isrc->isrc_handlers == 0) { + if (isrc->isrc_handlers == 0 && (gi->gi_flags & GI_FLAG_MSI) == 0) { gi->gi_pol = INTR_POLARITY_CONFORM; gi->gi_trig = INTR_TRIGGER_CONFORM; } @@ -1270,3 +1308,163 @@ gic_v3_redist_init(struct gic_v3_softc *sc) return (0); } + +/* + * SPI-mapped Message Based Interrupts -- a GICv3 MSI/MSI-X controller. + */ + +static int +gic_v3_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct gic_v3_softc *sc; + int i, irq, end_irq; + bool found; + + KASSERT(powerof2(count), ("%s: bad count", __func__)); + KASSERT(powerof2(maxcount), ("%s: bad maxcount", __func__)); + + sc = device_get_softc(dev); + + mtx_lock(&sc->gic_mbi_mtx); + + found = false; + for (irq = sc->gic_mbi_start; irq < sc->gic_mbi_end; irq++) { + /* Start on an aligned interrupt */ + if ((irq & (maxcount - 1)) != 0) + continue; + + /* Assume we found a valid range until shown otherwise */ + found = true; + + /* Check this range is valid */ + for (end_irq = irq; end_irq != irq + count; end_irq++) { + /* No free interrupts */ + if (end_irq == sc->gic_mbi_end) { + found = false; + break; + } + + KASSERT((sc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI)!= 0, + ("%s: Non-MSI interrupt found", __func__)); + + /* This is already used */ + if ((sc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI_USED) == + GI_FLAG_MSI_USED) { + found = false; + break; + } + } + if (found) + break; + } + + /* Not enough interrupts were found */ + if (!found || irq == sc->gic_mbi_end) { + mtx_unlock(&sc->gic_mbi_mtx); + return (ENXIO); + } + + for (i = 0; i < count; i++) { + /* Mark the interrupt as used */ + sc->gic_irqs[irq + i].gi_flags |= GI_FLAG_MSI_USED; + } + mtx_unlock(&sc->gic_mbi_mtx); + + for (i = 0; i < count; i++) + srcs[i] = (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; + *pic = dev; + + return (0); +} + +static int +gic_v3_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **isrc) +{ + struct gic_v3_softc *sc; + struct gic_v3_irqsrc *gi; + int i; + + sc = device_get_softc(dev); + + mtx_lock(&sc->gic_mbi_mtx); + for (i = 0; i < count; i++) { + gi = (struct gic_v3_irqsrc *)isrc[i]; + + KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED, + ("%s: Trying to release an unused MSI-X interrupt", + __func__)); + + gi->gi_flags &= ~GI_FLAG_MSI_USED; + } + mtx_unlock(&sc->gic_mbi_mtx); + + return (0); +} + +static int +gic_v3_alloc_msix(device_t dev, device_t child, device_t *pic, + struct intr_irqsrc **isrcp) +{ + struct gic_v3_softc *sc; + int irq; + + sc = device_get_softc(dev); + + mtx_lock(&sc->gic_mbi_mtx); + /* Find an unused interrupt */ + for (irq = sc->gic_mbi_start; irq < sc->gic_mbi_end; irq++) { + KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) != 0, + ("%s: Non-MSI interrupt found", __func__)); + if ((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == 0) + break; + } + /* No free interrupt was found */ + if (irq == sc->gic_mbi_end) { + mtx_unlock(&sc->gic_mbi_mtx); + return (ENXIO); + } + + /* Mark the interrupt as used */ + sc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI_USED; + mtx_unlock(&sc->gic_mbi_mtx); + + *isrcp = (struct intr_irqsrc *)&sc->gic_irqs[irq]; + *pic = dev; + + return (0); +} + +static int +gic_v3_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +{ + struct gic_v3_softc *sc; + struct gic_v3_irqsrc *gi; + + sc = device_get_softc(dev); + gi = (struct gic_v3_irqsrc *)isrc; + + KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED, + ("%s: Trying to release an unused MSI-X interrupt", __func__)); + + mtx_lock(&sc->gic_mbi_mtx); + gi->gi_flags &= ~GI_FLAG_MSI_USED; + mtx_unlock(&sc->gic_mbi_mtx); + + return (0); +} + +static int +gic_v3_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct gic_v3_softc *sc = device_get_softc(dev); + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + +#define GICD_SETSPI_NSR 0x40 + *addr = vtophys(rman_get_virtual(sc->gic_dist)) + GICD_SETSPI_NSR; + *data = gi->gi_irq; + + return (0); +} diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index c8a9615a8a5f..483d67ba6deb 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -121,6 +121,8 @@ gic_v3_fdt_attach(device_t dev) pcell_t redist_regions; intptr_t xref; int err; + uint32_t *mbi_ranges; + ssize_t ret; sc = device_get_softc(dev); sc->dev = dev; @@ -135,6 +137,21 @@ gic_v3_fdt_attach(device_t dev) else sc->gic_redists.nregions = redist_regions; + /* Add Message Based Interrupts using SPIs. */ + ret = OF_getencprop_alloc_multi(ofw_bus_get_node(dev), "mbi-ranges", + sizeof(*mbi_ranges), (void **)&mbi_ranges); + if (ret > 0) { + if (ret % 2 == 0) { + /* Limit to a single range for now. */ + sc->gic_mbi_start = mbi_ranges[0]; + sc->gic_mbi_end = mbi_ranges[0] + mbi_ranges[1] - 1; + } else { + if (bootverbose) + device_printf(dev, "Malformed mbi-ranges property\n"); + } + free(mbi_ranges, M_OFWPROP); + } + err = gic_v3_attach(dev); if (err != 0) goto error; @@ -147,6 +164,9 @@ gic_v3_fdt_attach(device_t dev) goto error; } + if (sc->gic_mbi_start > 0) + intr_msi_register(dev, xref); + /* Register xref */ OF_device_register_xref(xref, dev); diff --git a/sys/arm64/arm64/gic_v3_var.h b/sys/arm64/arm64/gic_v3_var.h index f855e425d66d..1645c417fd8d 100644 --- a/sys/arm64/arm64/gic_v3_var.h +++ b/sys/arm64/arm64/gic_v3_var.h @@ -68,6 +68,11 @@ struct gic_v3_softc { /* Re-Distributors */ struct gic_redists gic_redists; + /* Message Based Interrupts */ + u_int gic_mbi_start; + u_int gic_mbi_end; + struct mtx gic_mbi_mtx; + uint32_t gic_pidr2; u_int gic_bus; From owner-dev-commits-src-main@freebsd.org Mon Jan 25 10: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 A72324DB502; Mon, 25 Jan 2021 10: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 4DPR0z4KTsz3jhv; Mon, 25 Jan 2021 10: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 8728614E70; Mon, 25 Jan 2021 10: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 10PASpqP063553; Mon, 25 Jan 2021 10: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 10PASpvn063552; Mon, 25 Jan 2021 10:28:51 GMT (envelope-from git) Date: Mon, 25 Jan 2021 10:28:51 GMT Message-Id: <202101251028.10PASpvn063552@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: 064009e79462 - main - Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). 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: 064009e79462dea517aa7f1a857fb4d5393caa69 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, 25 Jan 2021 10:28:51 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=064009e79462dea517aa7f1a857fb4d5393caa69 commit 064009e79462dea517aa7f1a857fb4d5393caa69 Author: Hans Petter Selasky AuthorDate: 2021-01-25 10:22:55 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-25 10:28:05 +0000 Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 0d4028e240ca..023f519f7ced 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3413,6 +3413,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_capenable ^= IFCAP_TSO6; ifp->if_hwassist ^= CSUM_IP6_TSO; } + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (mask & IFCAP_VLAN_HWFILTER) { if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) mlx5e_disable_vlan_filter(priv); From owner-dev-commits-src-main@freebsd.org Mon Jan 25 15:11: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 B715D4E5D4D; Mon, 25 Jan 2021 15:11: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 4DPYGp4QvTz4YQ4; Mon, 25 Jan 2021 15:11: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 8168B18B13; Mon, 25 Jan 2021 15:11: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 10PFBE3g039503; Mon, 25 Jan 2021 15:11:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PFBEA6039502; Mon, 25 Jan 2021 15:11:14 GMT (envelope-from git) Date: Mon, 25 Jan 2021 15:11:14 GMT Message-Id: <202101251511.10PFBEA6039502@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: 3454fa118c41 - main - Don't include libarchive fuzz tests by default 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: 3454fa118c41a588e2dad20614325297c989c60b 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, 25 Jan 2021 15:11:14 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=3454fa118c41a588e2dad20614325297c989c60b commit 3454fa118c41a588e2dad20614325297c989c60b Author: Alex Richardson AuthorDate: 2021-01-25 14:03:17 +0000 Commit: Alex Richardson CommitDate: 2021-01-25 15:09:26 +0000 Don't include libarchive fuzz tests by default These tests are basic fuzz tests that permute input to trigger crashes rather than regression or unit tests. Additionally, some of them take a rather long time to run and should probably be run on a dedicated fuzzing job instead. Moreover, these simple tests use rand() instead of a real fuzzing tool that generates interesting inputs (e.g. LLVM libFuzzer) so are unlikely to find anything interesting when run in CI. This allows removing one BROKEN_TESTS case due to timeouts and speeds up running tests on emulated platforms such as QEMU. Reviewed By: lwhsu, mm Differential Revision: https://reviews.freebsd.org/D27153 --- lib/libarchive/tests/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile index fcb22af5021a..ae78eaf70826 100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@ -90,7 +90,6 @@ TESTS_SRCS= \ test_entry_strmode.c \ test_extattr_freebsd.c \ test_filter_count.c \ - test_fuzz.c \ test_gnutar_filename_encoding.c \ test_link_resolver.c \ test_open_fd.c \ @@ -303,9 +302,18 @@ TESTS_SRCS= \ # Fails with `test_read_disk_directory_traversals.c:1094: File at has atime 886622, 1443306049 seconds ago` BROKEN_TESTS+= test_read_disk_directory_traversals +.if 0 +# test_fuzz.c is not a real test, but rather a simple fuzz-test using random(). +# Since this is not a regression/unit test, we don't include it by default. +# If you would still like to include it, comment out the `.if 0`. +TEST_SCRCS+= test_fuzz.c +${PACKAGE}FILES+= test_fuzz.cab.uu +${PACKAGE}FILES+= test_fuzz.lzh.uu +${PACKAGE}FILES+= test_fuzz_1.iso.Z.uu # Non-deterministic failures: # (Times out?) [and] crashes BROKEN_TESTS+= test_fuzz_rar +.endif # https://bugs.freebsd.org/240683 BROKEN_TESTS+= test_write_filter_zstd @@ -383,9 +391,6 @@ ${PACKAGE}FILES+= test_compat_zip_7.xps.uu ${PACKAGE}FILES+= test_compat_zip_8.zip.uu ${PACKAGE}FILES+= test_compat_zstd_1.tar.zst.uu ${PACKAGE}FILES+= test_compat_zstd_2.tar.zst.uu -${PACKAGE}FILES+= test_fuzz.cab.uu -${PACKAGE}FILES+= test_fuzz.lzh.uu -${PACKAGE}FILES+= test_fuzz_1.iso.Z.uu ${PACKAGE}FILES+= test_pax_filename_encoding.tar.uu ${PACKAGE}FILES+= test_pax_xattr_header_all.tar.uu ${PACKAGE}FILES+= test_pax_xattr_header_libarchive.tar.uu From owner-dev-commits-src-main@freebsd.org Mon Jan 25 15:11: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 0EAE64E626C; Mon, 25 Jan 2021 15:11: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 4DPYGr6BXRz4YQ7; Mon, 25 Jan 2021 15:11: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 C1344186DC; Mon, 25 Jan 2021 15:11: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 10PFBGB2039547; Mon, 25 Jan 2021 15:11:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PFBGZJ039546; Mon, 25 Jan 2021 15:11:16 GMT (envelope-from git) Date: Mon, 25 Jan 2021 15:11:16 GMT Message-Id: <202101251511.10PFBGZJ039546@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: a8b20f4fabbc - main - Create symlinks to host tools on non-FreeBSD hosts 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: a8b20f4fabbca9bef377009429848d4f9cea18ae 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, 25 Jan 2021 15:11:17 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=a8b20f4fabbca9bef377009429848d4f9cea18ae commit a8b20f4fabbca9bef377009429848d4f9cea18ae Author: Alexander Richardson AuthorDate: 2021-01-25 14:18:16 +0000 Commit: Alex Richardson CommitDate: 2021-01-25 15:09:43 +0000 Create symlinks to host tools on non-FreeBSD hosts This is unnecessary when cross-building from Linux/macOS. Additionally, cp -p appears to be broken on macOS Big Sur (https://openradar.appspot.com/8957219). For some unknown reason this commit appears to fix freezes when building on macOS Big Sur. This also fixes building in docker with volume mounts with ACLs, since setting the ACL with cp -p fails otherwise. Obtained From: CheriBSD Tested By: gnn (macOS Big Sur), Nathaniel Wesley Filardo (docker) Reviewed By: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D28267 --- tools/build/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/build/Makefile b/tools/build/Makefile index c0c1786d4bfa..48e62e6561b7 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -272,7 +272,17 @@ _host_tools_to_symlink= basename bzip2 bunzip2 chmod chown cmp comm cp date dd \ _make_abs!= which "${MAKE}" _host_abs_tools_to_symlink= ${_make_abs}:make ${_make_abs}:bmake -.if ${.MAKE.OS} != "FreeBSD" +.if ${.MAKE.OS} == "FreeBSD" +# When building on FreeBSD we always copy the host tools instead of linking +# into WORLDTMP to avoid issues with incompatible libraries (see r364030). +# Note: we could create links if we don't intend to update the current machine. +_COPY_HOST_TOOL=cp -pf +.else +# However, this is not necessary on Linux/macOS. Additionally, copying the host +# tools to another directory with cp -p results in freezes on macOS Big Sur for +# some unknown reason. It can also break building inside docker containers if +# there are ACLs on shared volumes. +_COPY_HOST_TOOL=ln -sfn _make_abs!= which "${MAKE}" _host_abs_tools_to_symlink+= ${_make_abs}:make ${_make_abs}:bmake .if ${.MAKE.OS} == "Darwin" @@ -293,7 +303,7 @@ host-symlinks: echo "Cannot find host tool '${_tool}' in PATH ($$PATH)." >&2; false; \ fi; \ rm -f "${DESTDIR}/bin/${_tool}"; \ - cp -pf "$${source_path}" "${DESTDIR}/bin/${_tool}" + ${_COPY_HOST_TOOL} "$${source_path}" "${DESTDIR}/bin/${_tool}" .endfor .for _tool in ${_host_abs_tools_to_symlink} @source_path="${_tool:S/:/ /:[1]}"; \ @@ -302,11 +312,11 @@ host-symlinks: echo "Host tool '${src_path}' is missing"; false; \ fi; \ rm -f "$${target_path}"; \ - cp -pf "$${source_path}" "$${target_path}" + ${_COPY_HOST_TOOL} "$${source_path}" "$${target_path}" .endfor .if exists(/usr/libexec/flua) rm -f ${DESTDIR}/usr/libexec/flua - cp -pf /usr/libexec/flua ${DESTDIR}/usr/libexec/flua + ${_COPY_HOST_TOOL} /usr/libexec/flua ${DESTDIR}/usr/libexec/flua .endif # Create all the directories that are needed during the legacy, bootstrap-tools From owner-dev-commits-src-main@freebsd.org Mon Jan 25 15:11: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 033284E5EAE; Mon, 25 Jan 2021 15:11: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 4DPYGq63kmz4YXw; Mon, 25 Jan 2021 15:11: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 AFF8C186DB; Mon, 25 Jan 2021 15:11: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 10PFBFsd039528; Mon, 25 Jan 2021 15:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PFBFjO039527; Mon, 25 Jan 2021 15:11:15 GMT (envelope-from git) Date: Mon, 25 Jan 2021 15:11:15 GMT Message-Id: <202101251511.10PFBFjO039527@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: 8d55837dc133 - main - qeueue.h: Add {SLIST, STAILQ, LIST, TAILQ}_END() 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: 8d55837dc1331a5cdacad539b1788ab1070159b4 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, 25 Jan 2021 15:11:16 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8d55837dc1331a5cdacad539b1788ab1070159b4 commit 8d55837dc1331a5cdacad539b1788ab1070159b4 Author: Alex Richardson AuthorDate: 2021-01-25 14:11:45 +0000 Commit: Alex Richardson CommitDate: 2021-01-25 15:09:35 +0000 qeueue.h: Add {SLIST,STAILQ,LIST,TAILQ}_END() We provide these for compat with other queue.h headers since some software assumes it exists (e.g. the libevent contrib code), but we are not encouraging their use (NULL should be used instead). This fixes the following warning (which should arguable be an error since it results in a function call to an undefined function): .../contrib/libevent/buffer.c:495:16: warning: implicit declaration of function 'LIST_END' is invalid in C99 [-Wimplicit-function-declaration] cbent != LIST_END(&buffer->callbacks); ^ .../contrib/libevent/buffer.c:495:13: warning: comparison between pointer and integer ('struct evbuffer_cb_entry *' and 'int') [-Wpointer-integer-compare] cbent != LIST_END(&buffer->callbacks); ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27151 --- sys/fs/nfs/nfsport.h | 2 ++ sys/sys/queue.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 7d1c3b1c8cea..9f2789f57bec 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -880,9 +880,11 @@ int nfsmsleep(void *, void *, int, const char *, struct timespec *); /* * Some queue.h files don't have these dfined in them. */ +#ifndef LIST_END #define LIST_END(head) NULL #define SLIST_END(head) NULL #define TAILQ_END(head) NULL +#endif /* * This must be defined to be a global variable that increments once diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 14d55905dfc0..25091ec815f1 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -91,6 +91,7 @@ * _CLASS_ENTRY + + + + * _INIT + + + + * _EMPTY + + + + + * _END + + + + * _FIRST + + + + * _NEXT + + + + * _PREV - + - + @@ -305,6 +306,8 @@ struct { \ SLIST_FIRST(head2) = swap_first; \ } while (0) +#define SLIST_END(head) NULL + /* * Singly-linked Tail queue declarations. */ @@ -437,6 +440,9 @@ struct { \ (head2)->stqh_last = &STAILQ_FIRST(head2); \ } while (0) +#define STAILQ_END(head) NULL + + /* * List declarations. */ @@ -611,6 +617,8 @@ struct { \ swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ } while (0) +#define LIST_END(head) NULL + /* * Tail queue declarations. */ @@ -867,4 +875,6 @@ struct { \ (head2)->tqh_last = &(head2)->tqh_first; \ } while (0) +#define TAILQ_END(head) NULL + #endif /* !_SYS_QUEUE_H_ */ From owner-dev-commits-src-main@freebsd.org Mon Jan 25 15:11: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 80BDB4E5CF9; Mon, 25 Jan 2021 15:11: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 4DPYGt3KKJz4YVx; Mon, 25 Jan 2021 15:11:18 +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 0B8A4186DD; Mon, 25 Jan 2021 15:11:18 +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 10PFBHAR039568; Mon, 25 Jan 2021 15:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PFBHuq039567; Mon, 25 Jan 2021 15:11:17 GMT (envelope-from git) Date: Mon, 25 Jan 2021 15:11:17 GMT Message-Id: <202101251511.10PFBHuq039567@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: 94ac312a7168 - main - ifconfig: fix UBSan signed shift error 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: 94ac312a71683a3a1a928c6adfe927d6bb45044f 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, 25 Jan 2021 15:11:20 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=94ac312a71683a3a1a928c6adfe927d6bb45044f commit 94ac312a71683a3a1a928c6adfe927d6bb45044f Author: Alex Richardson AuthorDate: 2021-01-19 11:35:21 +0000 Commit: Alex Richardson CommitDate: 2021-01-25 15:09:50 +0000 ifconfig: fix UBSan signed shift error Use 1u since UBSan complains about 1 << 31. --- sbin/ifconfig/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e6e7908e18cd..90a84f2996bc 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1514,7 +1514,7 @@ printb(const char *s, unsigned v, const char *bits) bits++; putchar('<'); while ((i = *bits++) != '\0') { - if (v & (1 << (i-1))) { + if (v & (1u << (i-1))) { if (any) putchar(','); any = 1; From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:39: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 3A3854EE800; Mon, 25 Jan 2021 19:39: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 4DPgCp1FXhz4vgy; Mon, 25 Jan 2021 19:39: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 1DD291C095; Mon, 25 Jan 2021 19:39: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 10PJd2Gq079172; Mon, 25 Jan 2021 19:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJd2fG079171; Mon, 25 Jan 2021 19:39:02 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:39:02 GMT Message-Id: <202101251939.10PJd2fG079171@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: 13860e71eb50 - main - diff: add a test case for failed -s option 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: 13860e71eb501f498a2263f44ea9244f6830b61c 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, 25 Jan 2021 19:39:02 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=13860e71eb501f498a2263f44ea9244f6830b61c commit 13860e71eb501f498a2263f44ea9244f6830b61c Author: Baptiste Daroussin AuthorDate: 2021-01-25 17:40:12 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-25 19:37:58 +0000 diff: add a test case for failed -s option --- usr.bin/diff/tests/diff_test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 7ee88d1fe607..6da2bbaea34d 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -15,6 +15,7 @@ atf_test_case Nflag atf_test_case tabsize atf_test_case conflicting_format atf_test_case label +atf_test_case report_identical simple_body() { @@ -226,6 +227,15 @@ label_body() -s exit:1 diff --label hello --label world `which diff` `which ls` } +report_identical_body() +{ + 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 +} + atf_init_test_cases() { atf_add_test_case simple @@ -243,4 +253,5 @@ atf_init_test_cases() atf_add_test_case tabsize atf_add_test_case conflicting_format atf_add_test_case label + atf_add_test_case report_identical } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:39: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 5C82F4EE637; Mon, 25 Jan 2021 19:39: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 4DPgCq2F9Zz4vvc; Mon, 25 Jan 2021 19:39: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 3E6151C226; Mon, 25 Jan 2021 19:39: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 10PJd3mJ079193; Mon, 25 Jan 2021 19:39:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJd3Gm079192; Mon, 25 Jan 2021 19:39:03 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:39:03 GMT Message-Id: <202101251939.10PJd3Gm079192@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: fefb3c46a80f - main - diff: fix incorrectly displaying files as duplicates 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: fefb3c46a80fdde6f307e73a2b5b5aed806df1ce 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, 25 Jan 2021 19:39:03 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=fefb3c46a80fdde6f307e73a2b5b5aed806df1ce commit fefb3c46a80fdde6f307e73a2b5b5aed806df1ce Author: Jamie Landeg-Jones AuthorDate: 2021-01-25 17:42:26 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-25 19:38:18 +0000 diff: fix incorrectly displaying files as duplicates When diff hits certain access errors, function diffreg() shows the error message, and then returns to the calling function, which calls print_status() with the return value. However, in these cases, the return value isn't changed from the initial default value of D_SAME. Normally, print_status() with a value of D_SAME does nothing, so this works out ok, however, if the "-s" flag is set, a message is displayed showing identicality: case D_SAME: if (sflag) printf("Files %s%s and %s%s are identical\n", path1, entry, path2, entry); break; This then produces such results as: % diff -s /COPYRIGHT /var/run/rpcbind.sock diff: /var/run/rpcbind.sock: Operation not supported Files /COPYRIGHT and /var/run/rpcbind.sock are identical % diff -s /COPYRIGHT /etc/master.passwd diff: /etc/master.passwd: Permission denied Files /COPYRIGHT and /etc/master.passwd are identical Create a D_ERROR status which is returned in such cases, and print_status() then deals with that status seperately from D_SAME PR: 252614 MFC after: 1 week --- usr.bin/diff/diff.c | 2 ++ usr.bin/diff/diff.h | 1 + usr.bin/diff/diffreg.c | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 0e46b96f9667..1bad6226f49d 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -511,6 +511,8 @@ print_status(int val, char *path1, char *path2, const char *entry) printf("File %s%s is not a regular file or directory and was skipped\n", path2, entry); break; + case D_ERROR: + break; } } diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 30387610fc19..1974b5cc08d6 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -83,6 +83,7 @@ #define D_MISMATCH2 4 /* path1 was a file, path2 a dir */ #define D_SKIPPED1 5 /* path1 was a special file */ #define D_SKIPPED2 6 /* path2 was a special file */ +#define D_ERROR 7 /* A file access error occurred */ struct excludes { char *pattern; diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 7d2b20b43def..4e887ab27c7b 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -299,6 +299,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) if ((f1 = opentemp(file1)) == NULL || fstat(fileno(f1), &stb1) == -1) { warn("%s", file1); + rval = D_ERROR; status |= 2; goto closem; } @@ -309,6 +310,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) } if (f1 == NULL) { warn("%s", file1); + rval = D_ERROR; status |= 2; goto closem; } @@ -320,6 +322,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) if ((f2 = opentemp(file2)) == NULL || fstat(fileno(f2), &stb2) == -1) { warn("%s", file2); + rval = D_ERROR; status |= 2; goto closem; } @@ -330,6 +333,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) } if (f2 == NULL) { warn("%s", file2); + rval = D_ERROR; status |= 2; goto closem; } @@ -365,6 +369,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) break; default: /* error */ + rval = D_ERROR; status |= 2; goto closem; } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:45: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 306ED4EEED5; Mon, 25 Jan 2021 19:45: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 4DPgMV0p4dz3Cxf; Mon, 25 Jan 2021 19:45: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 0E2791C328; Mon, 25 Jan 2021 19:45: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 10PJjfaC092162; Mon, 25 Jan 2021 19:45:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJjfJH092161; Mon, 25 Jan 2021 19:45:41 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:45:41 GMT Message-Id: <202101251945.10PJjfJH092161@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: 1c7a65adb002 - main - cache: track calls to cache_symlink_alloc with unsupported size 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: 1c7a65adb002cf96bda1f72d9a26dd4237368263 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, 25 Jan 2021 19:45:42 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1c7a65adb002cf96bda1f72d9a26dd4237368263 commit 1c7a65adb002cf96bda1f72d9a26dd4237368263 Author: Mateusz Guzik AuthorDate: 2021-01-24 20:00:03 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 19:45:23 +0000 cache: track calls to cache_symlink_alloc with unsupported size While here assert on size passed to free. --- sys/kern/vfs_cache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 03bafc75acaa..9d3b935a3047 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -122,6 +122,7 @@ SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", "char *"); SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *", "char *"); +SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t"); SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata", "int", "bool"); SDT_PROBE_DECLARE(vfs, namei, lookup, entry); @@ -477,6 +478,7 @@ STATNODE_COUNTER(fullpathfail2, numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); STATNODE_COUNTER(fullpathfail4, numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); STATNODE_COUNTER(fullpathfound, numfullpathfound, "Number of successful fullpath calls"); +STATNODE_COUNTER(symlinktoobig, symlinktoobig, "Number of times symlink did not fit the cache"); /* * Debug or developer statistics. @@ -576,6 +578,8 @@ cache_symlink_alloc(size_t size, int flags) if (size < CACHE_ZONE_LARGE_SIZE) { return (uma_zalloc_smr(cache_zone_large, flags)); } + counter_u64_add(symlinktoobig, 1); + SDT_PROBE1(vfs, namecache, symlink, alloc__fail, size); return (NULL); } @@ -584,6 +588,8 @@ cache_symlink_free(char *string, size_t size) { MPASS(string != NULL); + KASSERT(size < CACHE_ZONE_LARGE_SIZE, + ("%s: size %zu too big", __func__, size)); if (size < CACHE_ZONE_SMALL_SIZE) { uma_zfree_smr(cache_zone_small, string); From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:45: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 5B3994EEF38; Mon, 25 Jan 2021 19:45: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 4DPgMW23C6z3D35; Mon, 25 Jan 2021 19:45: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 2F68E1C2C4; Mon, 25 Jan 2021 19:45: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 10PJjhtv092182; Mon, 25 Jan 2021 19:45:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJjhnS092181; Mon, 25 Jan 2021 19:45:43 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:45:43 GMT Message-Id: <202101251945.10PJjhnS092181@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: 868643e7229b - main - cache: assorted cleanups 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: 868643e7229b7959024880cda396fef87602b948 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, 25 Jan 2021 19:45:43 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=868643e7229b7959024880cda396fef87602b948 commit 868643e7229b7959024880cda396fef87602b948 Author: Mateusz Guzik AuthorDate: 2021-01-24 20:04:01 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 19:45:24 +0000 cache: assorted cleanups --- sys/kern/vfs_cache.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 9d3b935a3047..e3098ac7c5d5 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5079,54 +5079,54 @@ cache_fplookup_is_mp(struct cache_fpl *fpl) */ #ifdef INVARIANTS static void -cache_fpl_pathlen_dec(struct cache_fpl *fpl) +cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) { - cache_fpl_pathlen_sub(fpl, 1); + fpl->debug.ni_pathlen += n; + KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, + ("%s: pathlen overflow to %zd\n", __func__, fpl->debug.ni_pathlen)); } static void -cache_fpl_pathlen_inc(struct cache_fpl *fpl) +cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) { - cache_fpl_pathlen_add(fpl, 1); + fpl->debug.ni_pathlen -= n; + KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, + ("%s: pathlen underflow to %zd\n", __func__, fpl->debug.ni_pathlen)); } static void -cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_inc(struct cache_fpl *fpl) { - fpl->debug.ni_pathlen += n; - KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, - ("%s: pathlen overflow to %zd\n", __func__, fpl->debug.ni_pathlen)); + cache_fpl_pathlen_add(fpl, 1); } static void -cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_dec(struct cache_fpl *fpl) { - fpl->debug.ni_pathlen -= n; - KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, - ("%s: pathlen underflow to %zd\n", __func__, fpl->debug.ni_pathlen)); + cache_fpl_pathlen_sub(fpl, 1); } #else -static void __always_inline -cache_fpl_pathlen_dec(struct cache_fpl *fpl) +static void +cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) { } -static void __always_inline -cache_fpl_pathlen_inc(struct cache_fpl *fpl) +static void +cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) { } static void -cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_inc(struct cache_fpl *fpl) { } static void -cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_dec(struct cache_fpl *fpl) { } #endif @@ -5258,7 +5258,7 @@ cache_fplookup_parse_advance(struct cache_fpl *fpl) * * Lockless lookup tries to elide checking for spurious slashes and should they * be present is guaranteed to fail to find an entry. In this case the caller - * must check if the name starts with a slash and this call routine. It is + * must check if the name starts with a slash and call this routine. It is * going to fast forward across the spurious slashes and set the state up for * retry. */ @@ -5342,11 +5342,13 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) * Hack: handle O_SEARCH. * * Open Group Base Specifications Issue 7, 2018 edition states: + * * If the access mode of the open file description associated with the * file descriptor is not O_SEARCH, the function shall check whether * directory searches are permitted using the current permissions of * the directory underlying the file descriptor. If the access mode is * O_SEARCH, the function shall not perform the check. + * * * Regular lookup tests for the NOEXECCHECK flag for every path * component to decide whether to do the permission check. However, From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:57: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 6FD8E4EF86E; Mon, 25 Jan 2021 19:57: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 4DPgdH2mwCz3FNG; Mon, 25 Jan 2021 19:57: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 50DE81C589; Mon, 25 Jan 2021 19:57: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 10PJvdXL005670; Mon, 25 Jan 2021 19:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJvdTq005669; Mon, 25 Jan 2021 19:57:39 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:57:39 GMT Message-Id: <202101251957.10PJvdTq005669@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: 8564660237ae - main - newvers.sh: add newline at EOF in generated vers.c 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: 8564660237aec4c679e8b607dbbf861c90fafc4c 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, 25 Jan 2021 19:57:39 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8564660237aec4c679e8b607dbbf861c90fafc4c commit 8564660237aec4c679e8b607dbbf861c90fafc4c Author: Ed Maste AuthorDate: 2021-01-25 19:53:47 +0000 Commit: Ed Maste CommitDate: 2021-01-25 19:57:18 +0000 newvers.sh: add newline at EOF in generated vers.c Previously we omitted the newline, which did not cause a functional issue for the build but resulted in suboptimal output from e.g. `cat vers.c`. --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 605e61181dec..497ea44cdd64 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -311,7 +311,7 @@ EOF ) vers_content_old=$(cat vers.c 2>/dev/null || true) if [ "$vers_content_new" != "$vers_content_old" ]; then - printf "%s" "$vers_content_new" > vers.c + printf "%s\n" "$vers_content_new" > vers.c fi echo $((v + 1)) > version From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:59: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 E99D74EFC32; Mon, 25 Jan 2021 19:59: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 4DPgfs5sXRz3FPw; Mon, 25 Jan 2021 19:59: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 BC3381C58B; Mon, 25 Jan 2021 19:59: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 10PJx1Og005994; Mon, 25 Jan 2021 19:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJx1W8005993; Mon, 25 Jan 2021 19:59:01 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:59:01 GMT Message-Id: <202101251959.10PJx1W8005993@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: e111d79806fe - main - Add FEATURE sysctls for ALTQ disciplines 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: e111d79806fe3652bc85593ca77ee1b4ff85498d 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, 25 Jan 2021 19:59:02 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e111d79806fe3652bc85593ca77ee1b4ff85498d commit e111d79806fe3652bc85593ca77ee1b4ff85498d Author: Kristof Provost AuthorDate: 2021-01-23 09:36:33 +0000 Commit: Kristof Provost CommitDate: 2021-01-25 18:58:22 +0000 Add FEATURE sysctls for ALTQ disciplines This will allow userspace to more easily figure out if ALTQ is built into the kernel and what disciplines are supported. Reviewed by: donner@ Differential Revision: https://reviews.freebsd.org/D28302 --- sys/net/altq/altq_subr.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index 9d998c40485c..b35637820a47 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -114,6 +114,38 @@ static struct ip4_frag *ip4f_alloc(void); static void ip4f_free(struct ip4_frag *); #endif /* ALTQ3_CLFIER_COMPAT */ +#ifdef ALTQ +SYSCTL_NODE(_kern_features, OID_AUTO, altq, CTLFLAG_RD | CTLFLAG_CAPRD, 0, + "ALTQ packet queuing"); + +#define ALTQ_FEATURE(name, desc) \ + SYSCTL_INT_WITH_LABEL(_kern_features_altq, OID_AUTO, name, \ + CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, 1, \ + desc, "feature") + +#ifdef ALTQ_CBQ +ALTQ_FEATURE(cbq, "ATLQ Class Based Queuing discipline"); +#endif +#ifdef ALTQ_CODEL +ALTQ_FEATURE(codel, "ALTQ Controlled Delay discipline"); +#endif +#ifdef ALTQ_RED +ALTQ_FEATURE(red, "ALTQ Random Early Detection discipline"); +#endif +#ifdef ALTQ_RIO +ALTQ_FEATURE(rio, "ALTQ Random Early Drop discipline"); +#endif +#ifdef ALTQ_HFSC +ALTQ_FEATURE(hfsc, "ALTQ Hierarchical Packet Scheduler discipline"); +#endif +#ifdef ALTQ_PRIQ +ALTQ_FEATURE(priq, "ATLQ Priority Queuing discipline"); +#endif +#ifdef ALTQ_FAIRQ +ALTQ_FEATURE(fairq, "ALTQ Fair Queuing discipline"); +#endif +#endif + /* * alternate queueing support routines */ From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:59: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 109A54EFC34; Mon, 25 Jan 2021 19:59: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 4DPgfv02c2z3FXJ; Mon, 25 Jan 2021 19:59: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 DDE571BF77; Mon, 25 Jan 2021 19:59: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 10PJx23e006017; Mon, 25 Jan 2021 19:59:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJx2PL006016; Mon, 25 Jan 2021 19:59:02 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:59:02 GMT Message-Id: <202101251959.10PJx2PL006016@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: 16b3833344ad - main - altq tests: Basic ALTQ test 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: 16b3833344ad04194f10b567bc6fae829a52a850 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, 25 Jan 2021 19:59:03 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=16b3833344ad04194f10b567bc6fae829a52a850 commit 16b3833344ad04194f10b567bc6fae829a52a850 Author: Kristof Provost AuthorDate: 2021-01-23 09:37:03 +0000 Commit: Kristof Provost CommitDate: 2021-01-25 18:58:22 +0000 altq tests: Basic ALTQ test Activate ALTQ_HFSC, crudely check if it really limits bandwidth as we'd expect. Reviewed by: donner@ Differential Revision: https://reviews.freebsd.org/D28303 --- tests/sys/netpfil/pf/Makefile | 3 ++- tests/sys/netpfil/pf/altq.sh | 49 +++++++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/utils.subr | 24 ++++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 68f54c801297..99b22399231e 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -5,7 +5,8 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/pf TESTS_SUBDIRS+= ioctl -ATF_TESTS_SH+= anchor \ +ATF_TESTS_SH+= altq \ + anchor \ checksum \ forward \ fragmentation \ diff --git a/tests/sys/netpfil/pf/altq.sh b/tests/sys/netpfil/pf/altq.sh new file mode 100644 index 000000000000..89da4c0deb6f --- /dev/null +++ b/tests/sys/netpfil/pf/altq.sh @@ -0,0 +1,49 @@ +. $(atf_get_srcdir)/utils.subr + +atf_test_case "hfsc" "cleanup" +hfsc_head() +{ + atf_set descr 'Basic HFSC test' + atf_set require.user root +} + +hfsc_body() +{ + altq_init + is_altq_supported hfsc + + epair=$(vnet_mkepair) + vnet_mkjail altq_hfsc ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec altq_hfsc ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + + jexec altq_hfsc pfctl -e + pft_set_rules altq_hfsc \ + "altq on ${epair}b bandwidth 100b hfsc queue { default }" \ + "queue default hfsc(default linkshare 80b)" \ + "pass proto icmp " + + # single ping succeeds just fine + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + # "Saturate the link" + ping -i .1 -c 5 -s 1200 192.0.2.2 + + # We should now be hitting the limits and get this packet dropped. + atf_check -s exit:2 -o ignore ping -c 1 -s 1200 192.0.2.2 +} + +hfsc_cleanup() +{ + altq_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "hfsc" +} + diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index 62e85d5cc463..d7df2a6747da 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -79,3 +79,27 @@ pfsynct_cleanup() { pft_cleanup } + +is_altq_supported() +{ + sysctl -q kern.features.altq >/dev/null || \ + atf_skip "Test requires ALTQ" + + while [ -n "$1" ] + do + sysctl -q kern.features.altq.${1} >/dev/null || \ + atf_skip "Test required ALTQ_${1}" + shift + done +} + +altq_init() +{ + pft_init + is_altq_supported +} + +altq_cleanup() +{ + pft_cleanup +} From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:59: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 EE72F4EFBC6; Mon, 25 Jan 2021 19:59:09 +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 4DPgfy0s71z3FW4; Mon, 25 Jan 2021 19:59: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 706721C58C; Mon, 25 Jan 2021 19:59:05 +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 10PJx53m006057; Mon, 25 Jan 2021 19:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJx5At006056; Mon, 25 Jan 2021 19:59:05 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:59:05 GMT Message-Id: <202101251959.10PJx5At006056@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: dcd1e41f0cbc - main - pfctl: FreeBSD now supports DIOCGIFSPEED 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: dcd1e41f0cbcb8f7ec5f7a891a690be959bc1ea8 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, 25 Jan 2021 19:59:11 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dcd1e41f0cbcb8f7ec5f7a891a690be959bc1ea8 commit dcd1e41f0cbcb8f7ec5f7a891a690be959bc1ea8 Author: Kristof Provost AuthorDate: 2021-01-23 09:37:22 +0000 Commit: Kristof Provost CommitDate: 2021-01-25 18:58:22 +0000 pfctl: FreeBSD now supports DIOCGIFSPEED There's no need for a special case here to work around the lack of DIOCGIFSPEED. That was introduced in FreeBSD in c1aedfcbd9896401f637bc815ba4e51dca107f6f. Reported by: jmg@ Reviewed by: donner@ Differential Revision: https://reviews.freebsd.org/D28305 --- sbin/pfctl/pfctl_altq.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index f23fe057f703..6541c031c75e 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -98,11 +98,7 @@ static int gsc_add_seg(struct gen_sc *, double, double, double, double); static double sc_x2y(struct service_curve *, double); -#ifdef __FreeBSD__ -u_int64_t getifspeed(int, char *); -#else u_int32_t getifspeed(char *); -#endif u_long getifmtu(char *); int eval_queue_opts(struct pf_altq *, struct node_queue_opt *, u_int64_t); @@ -317,11 +313,7 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, if (bw->bw_absolute > 0) pa->ifbandwidth = bw->bw_absolute; else -#ifdef __FreeBSD__ - if ((rate = getifspeed(pf->dev, pa->ifname)) == 0) { -#else if ((rate = getifspeed(pa->ifname)) == 0) { -#endif fprintf(stderr, "interface %s does not know its bandwidth, " "please specify an absolute bandwidth\n", pa->ifname); @@ -1254,26 +1246,6 @@ rate2str(double rate) return (buf); } -#ifdef __FreeBSD__ -/* - * XXX - * FreeBSD does not have SIOCGIFDATA. - * To emulate this, DIOCGIFSPEED ioctl added to pf. - */ -u_int64_t -getifspeed(int pfdev, char *ifname) -{ - struct pf_ifspeed io; - - bzero(&io, sizeof io); - if (strlcpy(io.ifname, ifname, IFNAMSIZ) >= - sizeof(io.ifname)) - errx(1, "getifspeed: strlcpy"); - if (ioctl(pfdev, DIOCGIFSPEED, &io) == -1) - err(1, "DIOCGIFSPEED"); - return (io.baudrate); -} -#else u_int32_t getifspeed(char *ifname) { @@ -1291,7 +1263,6 @@ getifspeed(char *ifname) err(1, "SIOCGIFDATA"); return ((u_int32_t)ifrdat.ifi_baudrate); } -#endif u_long getifmtu(char *ifname) From owner-dev-commits-src-main@freebsd.org Mon Jan 25 19:59: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 439FD4EFA46; Mon, 25 Jan 2021 19:59: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 4DPgfw1DhJz3FdT; Mon, 25 Jan 2021 19:59:04 +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 1720C1C680; Mon, 25 Jan 2021 19:59:04 +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 10PJx39E006039; Mon, 25 Jan 2021 19:59:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PJx39s006038; Mon, 25 Jan 2021 19:59:03 GMT (envelope-from git) Date: Mon, 25 Jan 2021 19:59:03 GMT Message-Id: <202101251959.10PJx39s006038@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: 27b2aa49385d - main - altq: Remove unused arguments from altq_attach() 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: 27b2aa49385dc39959f772b76abec1601d4b9ab2 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, 25 Jan 2021 19:59:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27b2aa49385dc39959f772b76abec1601d4b9ab2 commit 27b2aa49385dc39959f772b76abec1601d4b9ab2 Author: Kristof Provost AuthorDate: 2021-01-23 09:37:13 +0000 Commit: Kristof Provost CommitDate: 2021-01-25 18:58:22 +0000 altq: Remove unused arguments from altq_attach() Minor cleanup, no functional change. Reviewed by: donner@ Differential Revision: https://reviews.freebsd.org/D28304 --- sys/net/altq/altq_cbq.c | 2 +- sys/net/altq/altq_codel.c | 2 +- sys/net/altq/altq_fairq.c | 2 +- sys/net/altq/altq_hfsc.c | 2 +- sys/net/altq/altq_priq.c | 2 +- sys/net/altq/altq_subr.c | 12 ++---------- sys/net/altq/if_altq.h | 11 ++--------- 7 files changed, 9 insertions(+), 24 deletions(-) diff --git a/sys/net/altq/altq_cbq.c b/sys/net/altq/altq_cbq.c index 6c6557725354..0e267fcb49e2 100644 --- a/sys/net/altq/altq_cbq.c +++ b/sys/net/altq/altq_cbq.c @@ -216,7 +216,7 @@ cbq_pfattach(struct pf_altq *a) return (EINVAL); s = splnet(); error = altq_attach(&ifp->if_snd, ALTQT_CBQ, a->altq_disc, - cbq_enqueue, cbq_dequeue, cbq_request, NULL, NULL); + cbq_enqueue, cbq_dequeue, cbq_request); splx(s); return (error); } diff --git a/sys/net/altq/altq_codel.c b/sys/net/altq/altq_codel.c index cca75a70b4c6..b9950ed94d2b 100644 --- a/sys/net/altq/altq_codel.c +++ b/sys/net/altq/altq_codel.c @@ -85,7 +85,7 @@ codel_pfattach(struct pf_altq *a) return (EINVAL); return (altq_attach(&ifp->if_snd, ALTQT_CODEL, a->altq_disc, - codel_enqueue, codel_dequeue, codel_request, NULL, NULL)); + codel_enqueue, codel_dequeue, codel_request)); } int diff --git a/sys/net/altq/altq_fairq.c b/sys/net/altq/altq_fairq.c index a8f96daeed36..b4eeb1ddf9b4 100644 --- a/sys/net/altq/altq_fairq.c +++ b/sys/net/altq/altq_fairq.c @@ -142,7 +142,7 @@ fairq_pfattach(struct pf_altq *a) return (EINVAL); error = altq_attach(&ifp->if_snd, ALTQT_FAIRQ, a->altq_disc, - fairq_enqueue, fairq_dequeue, fairq_request, NULL, NULL); + fairq_enqueue, fairq_dequeue, fairq_request); return (error); } diff --git a/sys/net/altq/altq_hfsc.c b/sys/net/altq/altq_hfsc.c index 2dbf571cdbb9..c3e84b345509 100644 --- a/sys/net/altq/altq_hfsc.c +++ b/sys/net/altq/altq_hfsc.c @@ -150,7 +150,7 @@ hfsc_pfattach(struct pf_altq *a) return (EINVAL); s = splnet(); error = altq_attach(&ifp->if_snd, ALTQT_HFSC, a->altq_disc, - hfsc_enqueue, hfsc_dequeue, hfsc_request, NULL, NULL); + hfsc_enqueue, hfsc_dequeue, hfsc_request); splx(s); return (error); } diff --git a/sys/net/altq/altq_priq.c b/sys/net/altq/altq_priq.c index e0c3e0f6ee80..f0627e2611a7 100644 --- a/sys/net/altq/altq_priq.c +++ b/sys/net/altq/altq_priq.c @@ -87,7 +87,7 @@ priq_pfattach(struct pf_altq *a) return (EINVAL); s = splnet(); error = altq_attach(&ifp->if_snd, ALTQT_PRIQ, a->altq_disc, - priq_enqueue, priq_dequeue, priq_request, NULL, NULL); + priq_enqueue, priq_dequeue, priq_request); splx(s); return (error); } diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index b35637820a47..dff589607ac8 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -168,15 +168,13 @@ altq_lookup(name, type) } int -altq_attach(ifq, type, discipline, enqueue, dequeue, request, clfier, classify) +altq_attach(ifq, type, discipline, enqueue, dequeue, request) struct ifaltq *ifq; int type; void *discipline; int (*enqueue)(struct ifaltq *, struct mbuf *, struct altq_pktattr *); struct mbuf *(*dequeue)(struct ifaltq *, int); int (*request)(struct ifaltq *, int, void *); - void *clfier; - void *(*classify)(void *, struct mbuf *, int); { IFQ_LOCK(ifq); if (!ALTQ_IS_READY(ifq)) { @@ -189,8 +187,6 @@ altq_attach(ifq, type, discipline, enqueue, dequeue, request, clfier, classify) ifq->altq_enqueue = enqueue; ifq->altq_dequeue = dequeue; ifq->altq_request = request; - ifq->altq_clfier = clfier; - ifq->altq_classify = classify; ifq->altq_flags &= (ALTQF_CANTCHANGE|ALTQF_ENABLED); IFQ_UNLOCK(ifq); return 0; @@ -220,8 +216,6 @@ altq_detach(ifq) ifq->altq_enqueue = NULL; ifq->altq_dequeue = NULL; ifq->altq_request = NULL; - ifq->altq_clfier = NULL; - ifq->altq_classify = NULL; ifq->altq_flags &= ALTQF_CANTCHANGE; IFQ_UNLOCK(ifq); @@ -250,8 +244,6 @@ altq_enable(ifq) ASSERT(ifq->ifq_len == 0); ifq->ifq_drv_maxlen = 0; /* disable bulk dequeue */ ifq->altq_flags |= ALTQF_ENABLED; - if (ifq->altq_clfier != NULL) - ifq->altq_flags |= ALTQF_CLASSIFY; splx(s); IFQ_UNLOCK(ifq); @@ -273,7 +265,7 @@ altq_disable(ifq) s = splnet(); IFQ_PURGE_NOLOCK(ifq); ASSERT(ifq->ifq_len == 0); - ifq->altq_flags &= ~(ALTQF_ENABLED|ALTQF_CLASSIFY); + ifq->altq_flags &= ~(ALTQF_ENABLED); splx(s); IFQ_UNLOCK(ifq); diff --git a/sys/net/altq/if_altq.h b/sys/net/altq/if_altq.h index 8d0463e09b3e..e0237ce77fda 100644 --- a/sys/net/altq/if_altq.h +++ b/sys/net/altq/if_altq.h @@ -63,10 +63,6 @@ struct ifaltq { struct mbuf *(*altq_dequeue)(struct ifaltq *, int); int (*altq_request)(struct ifaltq *, int, void *); - /* classifier fields */ - void *altq_clfier; /* classifier-specific use */ - void *(*altq_classify)(void *, struct mbuf *, int); - /* token bucket regulator */ struct tb_regulator *altq_tbr; @@ -127,7 +123,7 @@ struct tb_regulator { /* if_altqflags */ #define ALTQF_READY 0x01 /* driver supports alternate queueing */ #define ALTQF_ENABLED 0x02 /* altq is in use */ -#define ALTQF_CLASSIFY 0x04 /* classify packets */ +/* ALTQF_CLASSIFY 0x04 obsolete classify packets */ #define ALTQF_CNDTNING 0x08 /* altq traffic conditioning is enabled */ #define ALTQF_DRIVER1 0x40 /* driver specific */ @@ -147,7 +143,6 @@ struct tb_regulator { #else #define ALTQ_IS_ENABLED(ifq) 0 #endif -#define ALTQ_NEEDS_CLASSIFY(ifq) ((ifq)->altq_flags & ALTQF_CLASSIFY) #define ALTQ_IS_CNDTNING(ifq) ((ifq)->altq_flags & ALTQF_CNDTNING) #define ALTQ_SET_CNDTNING(ifq) ((ifq)->altq_flags |= ALTQF_CNDTNING) @@ -169,9 +164,7 @@ extern int altq_attach(struct ifaltq *, int, void *, int (*)(struct ifaltq *, struct mbuf *, struct altq_pktattr *), struct mbuf *(*)(struct ifaltq *, int), - int (*)(struct ifaltq *, int, void *), - void *, - void *(*)(void *, struct mbuf *, int)); + int (*)(struct ifaltq *, int, void *)); extern int altq_detach(struct ifaltq *); extern int altq_enable(struct ifaltq *); extern int altq_disable(struct ifaltq *); From owner-dev-commits-src-main@freebsd.org Mon Jan 25 21:08: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 DD0F34F1C48; Mon, 25 Jan 2021 21:08: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 4DPjC45rjpz3LvQ; Mon, 25 Jan 2021 21:08: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 A9C2A1D1D8; Mon, 25 Jan 2021 21:08: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 10PL8Wx3096794; Mon, 25 Jan 2021 21:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PL8Wl7096793; Mon, 25 Jan 2021 21:08:32 GMT (envelope-from git) Date: Mon, 25 Jan 2021 21:08:32 GMT Message-Id: <202101252108.10PL8Wl7096793@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: 1b109c69ed62 - main - Decode NFIT Platform Capabilities. 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: 1b109c69ed625ebf292c1d16f7a3efcab96722e5 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, 25 Jan 2021 21:08:33 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1b109c69ed625ebf292c1d16f7a3efcab96722e5 commit 1b109c69ed625ebf292c1d16f7a3efcab96722e5 Author: Alexander Motin AuthorDate: 2021-01-25 21:08:06 +0000 Commit: Alexander Motin CommitDate: 2021-01-25 21:08:06 +0000 Decode NFIT Platform Capabilities. MFC after: 1 week --- usr.sbin/acpi/acpidump/acpi.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 27fe1de0a219..c573c02b7f92 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1562,7 +1562,8 @@ static const char *nfit_types[] = { [ACPI_NFIT_TYPE_SMBIOS] = "SMBIOS", [ACPI_NFIT_TYPE_CONTROL_REGION] = "Control Region", [ACPI_NFIT_TYPE_DATA_REGION] = "Data Region", - [ACPI_NFIT_TYPE_FLUSH_ADDRESS] = "Flush Address" + [ACPI_NFIT_TYPE_FLUSH_ADDRESS] = "Flush Address", + [ACPI_NFIT_TYPE_CAPABILITIES] = "Platform Capabilities" }; @@ -1579,6 +1580,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) ACPI_NFIT_CONTROL_REGION *ctlreg; ACPI_NFIT_DATA_REGION *datareg; ACPI_NFIT_FLUSH_ADDRESS *fladdr; + ACPI_NFIT_CAPABILITIES *caps; if (nfit->Type < nitems(nfit_types)) printf("\tType=%s\n", nfit_types[nfit->Type]); @@ -1709,6 +1711,20 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tHintCount=%u\n", (u_int)fladdr->HintCount); /* XXX fladdr->HintAddress[i] output is not supported */ break; + case ACPI_NFIT_TYPE_CAPABILITIES: + caps = (ACPI_NFIT_CAPABILITIES *)nfit; + printf("\tHighestCapability=%u\n", (u_int)caps->HighestCapability); + +#define PRINTFLAG(var, flag) printflag((var), ACPI_NFIT_CAPABILITY_## flag, #flag) + + printf("\tCapabilities="); + PRINTFLAG(caps->Capabilities, CACHE_FLUSH); + PRINTFLAG(caps->Capabilities, MEM_FLUSH); + PRINTFLAG(caps->Capabilities, MEM_MIRRORING); + PRINTFLAG_END(); + +#undef PRINTFLAG + break; } } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 21:46: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 C16D14F2D1C; Mon, 25 Jan 2021 21:46:07 +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 4DPk2R4vzPz3PKl; Mon, 25 Jan 2021 21:46:07 +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 9B1081DD25; Mon, 25 Jan 2021 21:46:07 +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 10PLk7pS048526; Mon, 25 Jan 2021 21:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PLk70I048525; Mon, 25 Jan 2021 21:46:07 GMT (envelope-from git) Date: Mon, 25 Jan 2021 21:46:07 GMT Message-Id: <202101252146.10PLk70I048525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: bfc99943b04b - main - ndis(4): remove as previous announced MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfc99943b04b46a6c1c885ce7bcc6f235b7422aa 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, 25 Jan 2021 21:46:07 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=bfc99943b04b46a6c1c885ce7bcc6f235b7422aa commit bfc99943b04b46a6c1c885ce7bcc6f235b7422aa Author: Brooks Davis AuthorDate: 2021-01-25 21:45:03 +0000 Commit: Brooks Davis CommitDate: 2021-01-25 21:45:03 +0000 ndis(4): remove as previous announced nids(4) was a clever idea in the early 2000's when the market was flooded with 10/100 NICs with Windows-only drivers, but that hasn't been the case for ages and the driver has had no meaningful maintenance in ages. It only supports Windows-XP era drivers. Also remove: - ndis support from wpa_supplicant - ndiscvt(8) Reviewed By: emaste, bcr (manpages) Differential Revision: https://reviews.freebsd.org/D27609 --- ObsoleteFiles.inc | 9 + share/man/man4/Makefile | 4 - share/man/man4/ndis.4 | 155 - sys/compat/ndis/cfg_var.h | 49 - sys/compat/ndis/hal_var.h | 55 - sys/compat/ndis/kern_ndis.c | 1447 --------- sys/compat/ndis/kern_windrv.c | 1170 ------- sys/compat/ndis/ndis_var.h | 1763 ----------- sys/compat/ndis/ntoskrnl_var.h | 1517 --------- sys/compat/ndis/pe_var.h | 555 ---- sys/compat/ndis/resource_var.h | 201 -- sys/compat/ndis/subr_hal.c | 482 --- sys/compat/ndis/subr_ndis.c | 3372 -------------------- sys/compat/ndis/subr_ntoskrnl.c | 4446 --------------------------- sys/compat/ndis/subr_pe.c | 644 ---- sys/compat/ndis/subr_usbd.c | 1461 --------- sys/compat/ndis/usbd_var.h | 224 -- sys/compat/ndis/winx32_wrap.S | 385 --- sys/compat/ndis/winx64_wrap.S | 179 -- sys/conf/files.amd64 | 1 - sys/conf/files.i386 | 1 - sys/conf/files.x86 | 10 - sys/dev/if_ndis/if_ndis.c | 3423 --------------------- sys/dev/if_ndis/if_ndis_pci.c | 357 --- sys/dev/if_ndis/if_ndis_usb.c | 240 -- sys/dev/if_ndis/if_ndisvar.h | 263 -- sys/modules/Makefile | 4 - sys/modules/if_ndis/Makefile | 10 - targets/pseudo/userland/Makefile.depend | 3 - tools/build/mk/OptionalObsoleteFiles.inc | 8 - tools/kerneldoc/subsys/Doxyfile-dev_if_ndis | 21 - usr.sbin/Makefile.amd64 | 3 - usr.sbin/Makefile.i386 | 3 - usr.sbin/ndiscvt/Makefile | 27 - usr.sbin/ndiscvt/Makefile.depend | 19 - usr.sbin/ndiscvt/inf-parse.y | 112 - usr.sbin/ndiscvt/inf-token.l | 134 - usr.sbin/ndiscvt/inf.c | 920 ------ usr.sbin/ndiscvt/inf.h | 61 - usr.sbin/ndiscvt/ndiscvt.8 | 283 -- usr.sbin/ndiscvt/ndiscvt.c | 436 --- usr.sbin/ndiscvt/ndisgen.8 | 86 - usr.sbin/ndiscvt/ndisgen.sh | 556 ---- usr.sbin/ndiscvt/windrv_stub.c | 268 -- usr.sbin/wpa/Makefile | 1 - usr.sbin/wpa/ndis_events/Makefile | 8 - usr.sbin/wpa/ndis_events/Makefile.depend | 18 - usr.sbin/wpa/ndis_events/ndis_events.8 | 135 - usr.sbin/wpa/ndis_events/ndis_events.c | 353 --- usr.sbin/wpa/wpa_supplicant/Makefile | 6 +- usr.sbin/wpa/wpa_supplicant/Packet32.c | 415 --- usr.sbin/wpa/wpa_supplicant/Packet32.h | 69 - usr.sbin/wpa/wpa_supplicant/ntddndis.h | 31 - 53 files changed, 11 insertions(+), 26392 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1d0766ec894a..29cf25e152e6 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,15 @@ # xargs -n1 | sort | uniq -d; # done +# 20210125: ndis driver support removed +OLD_FILES+=usr/sbin/ndiscvt +OLD_FILES+=usr/sbin/ndisgen +OLD_FILES+=usr/share/man/man4/ndis.4.gz +OLD_FILES+=usr/share/man/man4/if_ndis.4.gz +OLD_FILES+=usr/share/man/man8/ndiscvt.8.gz +OLD_FILES+=usr/share/man/man8/ndisgen.8.gz +OLD_FILES+=usr/share/misc/windrv_stub.c + # 20210116: if_wl_wavelan.h removed .if ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/if_wl_wavelan.h diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 10034a72d608..65f8bc817db3 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -325,7 +325,6 @@ MAN= aac.4 \ mx25l.4 \ mxge.4 \ my.4 \ - ${_ndis.4} \ net80211.4 \ netdump.4 \ netfpga10g_nf10bmac.4 \ @@ -715,7 +714,6 @@ MLINKS+=msk.4 if_msk.4 MLINKS+=mwl.4 if_mwl.4 MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 -MLINKS+=${_ndis.4} ${_if_ndis.4} MLINKS+=netfpga10g_nf10bmac.4 if_nf10bmac.4 MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 @@ -815,7 +813,6 @@ _hwpstate_intel.4= hwpstate_intel.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 _if_bxe.4= if_bxe.4 -_if_ndis.4= if_ndis.4 _if_nfe.4= if_nfe.4 _if_urtw.4= if_urtw.4 _if_vmx.4= if_vmx.4 @@ -826,7 +823,6 @@ _io.4= io.4 _itwd.4= itwd.4 _linux.4= linux.4 _nda.4= nda.4 -_ndis.4= ndis.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _if_ntb.4= if_ntb.4 diff --git a/share/man/man4/ndis.4 b/share/man/man4/ndis.4 deleted file mode 100644 index 0a1ae39bff62..000000000000 --- a/share/man/man4/ndis.4 +++ /dev/null @@ -1,155 +0,0 @@ -.\" Copyright (c) 2003 -.\" Bill Paul . 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Bill Paul. -.\" 4. Neither the name of the author nor the names of any co-contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD -.\" 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 March 14, 2010 -.Dt NDIS 4 -.Os -.Sh NAME -.Nm ndis -.Nd NDIS miniport driver wrapper -.Sh SYNOPSIS -.Cd "options NDISAPI" -.Cd "device ndis" -.Cd "device wlan" -.Sh DESCRIPTION -The -.Nm -driver is a wrapper designed to allow binary -.Tn Windows\[rg] -NDIS miniport -network drivers to be used with -.Fx . -The -.Nm -driver is provided in source code form and must be combined with -the -.Tn Windows\[rg] -driver supplied with your network adapter. -The -.Nm -driver uses the -.Nm ndisapi -kernel subsystem to relocate and link the -.Tn Windows\[rg] -binary so -that it can be used in conjunction with native code. -The -.Nm ndisapi -subsystem provides an interface between the NDIS API and the -.Fx -networking infrastructure. -The -.Tn Windows\[rg] -driver is essentially -fooled into thinking it is running on -.Tn Windows\[rg] . -Note that this -means the -.Nm -driver is only useful on x86 machines. -.Pp -To build a functional driver, the user must have a copy of the -driver distribution media for his or her card. -From this distribution, -the user must extract two files: the -.Pa .SYS -file containing the driver -binary code, and its companion -.Pa .INF -file, which contains the -definitions for driver-specific registry keys and other installation -data such as device identifiers. -These two files can be converted -into a kernel module file using the -.Xr ndisgen 8 -utility. -This file contains a binary image of the driver plus -registry key data. -When the -.Nm -driver loads, it will create -.Xr sysctl 3 -nodes for each registry key extracted from the -.Pa .INF -file. -.Pp -The -.Nm -driver is designed to support mainly Ethernet and wireless -network devices with PCI and USB bus attachments. -(Cardbus devices are also supported as PCI.) -It can -support many different media types and speeds. -One limitation -however, is that there is no consistent way to learn if an -Ethernet device is operating in full or half duplex mode. -The NDIS API allows for a generic means for determining link -state and speed, but not the duplex setting. -There may be -driver-specific registry keys to control the media setting -which can be configured via the -.Xr sysctl 8 -command. -.Sh DEPRECATION NOTICE -This driver is scheduled for removal prior to the release of -.Fx 14.0 -.Sh DIAGNOSTICS -.Bl -diag -.It "ndis%d: watchdog timeout" -A packet was queued for transmission and a transmit command was -issued, however the device failed to acknowledge the transmission -before a timeout expired. -.El -.Sh SEE ALSO -.Xr altq 4 , -.Xr arp 4 , -.Xr netintro 4 , -.Xr ng_ether 4 , -.Xr ifconfig 8 , -.Xr ndis_events 8 , -.Xr ndiscvt 8 , -.Xr ndisgen 8 , -.Xr wpa_supplicant 8 -.Rs -.%T "NDIS 5.1 specification" -.%U http://www.microsoft.com -.Re -.Sh HISTORY -The -.Nm -device driver first appeared in -.Fx 5.3 . -.Sh AUTHORS -The -.Nm -driver was written by -.An Bill Paul Aq Mt wpaul@windriver.com . diff --git a/sys/compat/ndis/cfg_var.h b/sys/compat/ndis/cfg_var.h deleted file mode 100644 index ff40a85926be..000000000000 --- a/sys/compat/ndis/cfg_var.h +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 2003 - * Bill Paul . 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD - * 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$ - */ - -#ifndef _CFG_VAR_H_ -#define _CFG_VAR_H_ - -struct ndis_cfg { - char *nc_cfgkey; - char *nc_cfgdesc; - char nc_val[256]; - int nc_idx; -}; - -typedef struct ndis_cfg ndis_cfg; - -#endif /* _CFG_VAR_H_ */ diff --git a/sys/compat/ndis/hal_var.h b/sys/compat/ndis/hal_var.h deleted file mode 100644 index f8864e2e7071..000000000000 --- a/sys/compat/ndis/hal_var.h +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 2003 - * Bill Paul . 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD - * 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$ - */ - -#ifndef _HAL_VAR_H_ -#define _HAL_VAR_H_ - -#define NDIS_BUS_SPACE_IO X86_BUS_SPACE_IO -#define NDIS_BUS_SPACE_MEM X86_BUS_SPACE_MEM - -extern image_patch_table hal_functbl[]; - -__BEGIN_DECLS -extern int hal_libinit(void); -extern int hal_libfini(void); -extern uint8_t KfAcquireSpinLock(kspin_lock *); -extern void KfReleaseSpinLock(kspin_lock *, uint8_t); -extern uint8_t KfRaiseIrql(uint8_t); -extern void KfLowerIrql(uint8_t); -extern uint8_t KeGetCurrentIrql(void); -__END_DECLS - -#endif /* _HAL_VAR_H_ */ diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c deleted file mode 100644 index 153849fa1cf6..000000000000 --- a/sys/compat/ndis/kern_ndis.c +++ /dev/null @@ -1,1447 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 2003 - * Bill Paul . 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#define NDIS_DUMMY_PATH "\\\\some\\bogus\\path" -#define NDIS_FLAG_RDONLY 1 - -static void ndis_status_func(ndis_handle, ndis_status, void *, uint32_t); -static void ndis_statusdone_func(ndis_handle); -static void ndis_setdone_func(ndis_handle, ndis_status); -static void ndis_getdone_func(ndis_handle, ndis_status); -static void ndis_resetdone_func(ndis_handle, ndis_status, uint8_t); -static void ndis_sendrsrcavail_func(ndis_handle); -static void ndis_intrsetup(kdpc *, device_object *, - irp *, struct ndis_softc *); -static void ndis_return(device_object *, void *); - -static image_patch_table kernndis_functbl[] = { - IMPORT_SFUNC(ndis_status_func, 4), - IMPORT_SFUNC(ndis_statusdone_func, 1), - IMPORT_SFUNC(ndis_setdone_func, 2), - IMPORT_SFUNC(ndis_getdone_func, 2), - IMPORT_SFUNC(ndis_resetdone_func, 3), - IMPORT_SFUNC(ndis_sendrsrcavail_func, 1), - IMPORT_SFUNC(ndis_intrsetup, 4), - IMPORT_SFUNC(ndis_return, 1), - { NULL, NULL, NULL } -}; - -static struct nd_head ndis_devhead; - -/* - * This allows us to export our symbols to other modules. - * Note that we call ourselves 'ndisapi' to avoid a namespace - * collision with if_ndis.ko, which internally calls itself - * 'ndis.' - * - * Note: some of the subsystems depend on each other, so the - * order in which they're started is important. The order of - * importance is: - * - * HAL - spinlocks and IRQL manipulation - * ntoskrnl - DPC and workitem threads, object waiting - * windrv - driver/device registration - * - * The HAL should also be the last thing shut down, since - * the ntoskrnl subsystem will use spinlocks right up until - * the DPC and workitem threads are terminated. - */ - -static int -ndis_modevent(module_t mod, int cmd, void *arg) -{ - int error = 0; - image_patch_table *patch; - - switch (cmd) { - case MOD_LOAD: - /* Initialize subsystems */ - hal_libinit(); - ntoskrnl_libinit(); - windrv_libinit(); - ndis_libinit(); - usbd_libinit(); - - patch = kernndis_functbl; - while (patch->ipt_func != NULL) { - windrv_wrap((funcptr)patch->ipt_func, - (funcptr *)&patch->ipt_wrap, - patch->ipt_argcnt, patch->ipt_ftype); - patch++; - } - - TAILQ_INIT(&ndis_devhead); - break; - case MOD_SHUTDOWN: - if (TAILQ_FIRST(&ndis_devhead) == NULL) { - /* Shut down subsystems */ - ndis_libfini(); - usbd_libfini(); - windrv_libfini(); - ntoskrnl_libfini(); - hal_libfini(); - - patch = kernndis_functbl; - while (patch->ipt_func != NULL) { - windrv_unwrap(patch->ipt_wrap); - patch++; - } - } - break; - case MOD_UNLOAD: - /* Shut down subsystems */ - ndis_libfini(); - usbd_libfini(); - windrv_libfini(); - ntoskrnl_libfini(); - hal_libfini(); - - patch = kernndis_functbl; - while (patch->ipt_func != NULL) { - windrv_unwrap(patch->ipt_wrap); - patch++; - } - - break; - default: - error = EINVAL; - break; - } - - return (error); -} -DEV_MODULE(ndisapi, ndis_modevent, NULL); -MODULE_VERSION(ndisapi, 1); - -static void -ndis_sendrsrcavail_func(adapter) - ndis_handle adapter; -{ -} - -static void -ndis_status_func(adapter, status, sbuf, slen) - ndis_handle adapter; - ndis_status status; - void *sbuf; - uint32_t slen; -{ - ndis_miniport_block *block; - struct ndis_softc *sc; - struct ifnet *ifp; - - block = adapter; - sc = device_get_softc(block->nmb_physdeviceobj->do_devext); - ifp = NDISUSB_GET_IFNET(sc); - if ( ifp && ifp->if_flags & IFF_DEBUG) - device_printf(sc->ndis_dev, "status: %x\n", status); -} - -static void -ndis_statusdone_func(adapter) - ndis_handle adapter; -{ - ndis_miniport_block *block; - struct ndis_softc *sc; - struct ifnet *ifp; - - block = adapter; - sc = device_get_softc(block->nmb_physdeviceobj->do_devext); - ifp = NDISUSB_GET_IFNET(sc); - if (ifp && ifp->if_flags & IFF_DEBUG) - device_printf(sc->ndis_dev, "status complete\n"); -} - -static void -ndis_setdone_func(adapter, status) - ndis_handle adapter; - ndis_status status; -{ - ndis_miniport_block *block; - block = adapter; - - block->nmb_setstat = status; - KeSetEvent(&block->nmb_setevent, IO_NO_INCREMENT, FALSE); -} - -static void -ndis_getdone_func(adapter, status) - ndis_handle adapter; - ndis_status status; -{ - ndis_miniport_block *block; - block = adapter; - - block->nmb_getstat = status; - KeSetEvent(&block->nmb_getevent, IO_NO_INCREMENT, FALSE); -} - -static void -ndis_resetdone_func(ndis_handle adapter, ndis_status status, - uint8_t addressingreset) -{ - ndis_miniport_block *block; - struct ndis_softc *sc; - struct ifnet *ifp; - - block = adapter; - sc = device_get_softc(block->nmb_physdeviceobj->do_devext); - ifp = NDISUSB_GET_IFNET(sc); - - if (ifp && ifp->if_flags & IFF_DEBUG) - device_printf(sc->ndis_dev, "reset done...\n"); - KeSetEvent(&block->nmb_resetevent, IO_NO_INCREMENT, FALSE); -} - -int -ndis_create_sysctls(arg) - void *arg; -{ - struct ndis_softc *sc; - ndis_cfg *vals; - char buf[256]; - struct sysctl_oid *oidp; - struct sysctl_ctx_entry *e; - - if (arg == NULL) - return (EINVAL); - - sc = arg; - /* - device_printf(sc->ndis_dev, "ndis_create_sysctls() sc=%p\n", sc); - */ - vals = sc->ndis_regvals; - - TAILQ_INIT(&sc->ndis_cfglist_head); - - /* Add the driver-specific registry keys. */ - - while(1) { - if (vals->nc_cfgkey == NULL) - break; - - if (vals->nc_idx != sc->ndis_devidx) { - vals++; - continue; - } - - /* See if we already have a sysctl with this name */ - - oidp = NULL; - TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) { - oidp = e->entry; - if (strcasecmp(oidp->oid_name, vals->nc_cfgkey) == 0) - break; - oidp = NULL; - } - - if (oidp != NULL) { - vals++; - continue; - } - - ndis_add_sysctl(sc, vals->nc_cfgkey, vals->nc_cfgdesc, - vals->nc_val, CTLFLAG_RW); - vals++; - } - - /* Now add a couple of builtin keys. */ - - /* - * Environment can be either Windows (0) or WindowsNT (1). - * We qualify as the latter. - */ - ndis_add_sysctl(sc, "Environment", - "Windows environment", "1", NDIS_FLAG_RDONLY); - - /* NDIS version should be 5.1. */ - ndis_add_sysctl(sc, "NdisVersion", - "NDIS API Version", "0x00050001", NDIS_FLAG_RDONLY); - - /* - * Some miniport drivers rely on the existence of the SlotNumber, - * NetCfgInstanceId and DriverDesc keys. - */ - ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", NDIS_FLAG_RDONLY); - ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId", - "{12345678-1234-5678-CAFE0-123456789ABC}", NDIS_FLAG_RDONLY); - ndis_add_sysctl(sc, "DriverDesc", "Driver Description", - "NDIS Network Adapter", NDIS_FLAG_RDONLY); - - /* Bus type (PCI, PCMCIA, etc...) */ - sprintf(buf, "%d", (int)sc->ndis_iftype); - ndis_add_sysctl(sc, "BusType", "Bus Type", buf, NDIS_FLAG_RDONLY); - - if (sc->ndis_res_io != NULL) { - sprintf(buf, "0x%jx", rman_get_start(sc->ndis_res_io)); - ndis_add_sysctl(sc, "IOBaseAddress", - "Base I/O Address", buf, NDIS_FLAG_RDONLY); - } - - if (sc->ndis_irq != NULL) { - sprintf(buf, "%ju", rman_get_start(sc->ndis_irq)); - ndis_add_sysctl(sc, "InterruptNumber", - "Interrupt Number", buf, NDIS_FLAG_RDONLY); - } - - return (0); -} - -int -ndis_add_sysctl(arg, key, desc, val, flag_rdonly) - void *arg; - char *key; - char *desc; - char *val; - int flag_rdonly; -{ - struct ndis_softc *sc; - struct ndis_cfglist *cfg; - char descstr[256]; - - sc = arg; - - cfg = malloc(sizeof(struct ndis_cfglist), M_DEVBUF, M_NOWAIT|M_ZERO); - - if (cfg == NULL) { - printf("failed for %s\n", key); - return (ENOMEM); - } - - cfg->ndis_cfg.nc_cfgkey = strdup(key, M_DEVBUF); - if (desc == NULL) { - snprintf(descstr, sizeof(descstr), "%s (dynamic)", key); - cfg->ndis_cfg.nc_cfgdesc = strdup(descstr, M_DEVBUF); - } else - cfg->ndis_cfg.nc_cfgdesc = strdup(desc, M_DEVBUF); - strcpy(cfg->ndis_cfg.nc_val, val); - - TAILQ_INSERT_TAIL(&sc->ndis_cfglist_head, cfg, link); - - if (flag_rdonly != 0) { - cfg->ndis_oid = - SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), - OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RD, - cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), - cfg->ndis_cfg.nc_cfgdesc); - } else { - cfg->ndis_oid = - SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), - OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RW, - cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), - cfg->ndis_cfg.nc_cfgdesc); - } - return (0); -} - -/* - * Somewhere, somebody decided "hey, let's automatically create - * a sysctl tree for each device instance as it's created -- it'll - * make life so much easier!" Lies. Why must they turn the kernel - * into a house of lies? - */ - -int -ndis_flush_sysctls(arg) - void *arg; -{ - struct ndis_softc *sc; - struct ndis_cfglist *cfg; - struct sysctl_ctx_list *clist; - - sc = arg; - - clist = device_get_sysctl_ctx(sc->ndis_dev); - - while (!TAILQ_EMPTY(&sc->ndis_cfglist_head)) { - cfg = TAILQ_FIRST(&sc->ndis_cfglist_head); - TAILQ_REMOVE(&sc->ndis_cfglist_head, cfg, link); - sysctl_ctx_entry_del(clist, cfg->ndis_oid); - sysctl_remove_oid(cfg->ndis_oid, 1, 0); - free(cfg->ndis_cfg.nc_cfgkey, M_DEVBUF); - free(cfg->ndis_cfg.nc_cfgdesc, M_DEVBUF); - free(cfg, M_DEVBUF); - } - - return (0); -} - -void * -ndis_get_routine_address(functbl, name) - struct image_patch_table *functbl; - char *name; -{ - int i; - - for (i = 0; functbl[i].ipt_name != NULL; i++) - if (strcmp(name, functbl[i].ipt_name) == 0) - return (functbl[i].ipt_wrap); - return (NULL); -} - -static void -ndis_return(dobj, arg) - device_object *dobj; - void *arg; -{ - ndis_miniport_block *block; - ndis_miniport_characteristics *ch; - ndis_return_handler returnfunc; - ndis_handle adapter; - ndis_packet *p; - uint8_t irql; - list_entry *l; - - block = arg; - ch = IoGetDriverObjectExtension(dobj->do_drvobj, (void *)1); - - p = arg; - adapter = block->nmb_miniportadapterctx; - - if (adapter == NULL) - return; - - returnfunc = ch->nmc_return_packet_func; - - KeAcquireSpinLock(&block->nmb_returnlock, &irql); - while (!IsListEmpty(&block->nmb_returnlist)) { - l = RemoveHeadList((&block->nmb_returnlist)); - p = CONTAINING_RECORD(l, ndis_packet, np_list); - InitializeListHead((&p->np_list)); - KeReleaseSpinLock(&block->nmb_returnlock, irql); - MSCALL2(returnfunc, adapter, p); - KeAcquireSpinLock(&block->nmb_returnlock, &irql); - } - KeReleaseSpinLock(&block->nmb_returnlock, irql); -} - -static void -ndis_ext_free(struct mbuf *m) -{ - - return (ndis_return_packet(m->m_ext.ext_arg1)); -} - -void -ndis_return_packet(ndis_packet *p) -{ - ndis_miniport_block *block; - - if (p == NULL) - return; - - /* Decrement refcount. */ - p->np_refcnt--; - - /* Release packet when refcount hits zero, otherwise return. */ - if (p->np_refcnt) - return; - - block = ((struct ndis_softc *)p->np_softc)->ndis_block; - - KeAcquireSpinLockAtDpcLevel(&block->nmb_returnlock); - InitializeListHead((&p->np_list)); - InsertHeadList((&block->nmb_returnlist), (&p->np_list)); - KeReleaseSpinLockFromDpcLevel(&block->nmb_returnlock); - - IoQueueWorkItem(block->nmb_returnitem, - (io_workitem_func)kernndis_functbl[7].ipt_wrap, - WORKQUEUE_CRITICAL, block); -} - -void -ndis_free_bufs(b0) - ndis_buffer *b0; -{ - ndis_buffer *next; - - if (b0 == NULL) - return; - - while(b0 != NULL) { - next = b0->mdl_next; - IoFreeMdl(b0); - b0 = next; - } -} - -void -ndis_free_packet(p) - ndis_packet *p; -{ - if (p == NULL) - return; - - ndis_free_bufs(p->np_private.npp_head); - NdisFreePacket(p); -} - -int -ndis_convert_res(arg) - void *arg; -{ - struct ndis_softc *sc; - ndis_resource_list *rl = NULL; - cm_partial_resource_desc *prd = NULL; - ndis_miniport_block *block; - device_t dev; - struct resource_list *brl; *** 25949 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Jan 25 21:58: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 D201B4F3604; Mon, 25 Jan 2021 21:58: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 4DPkKC5btFz3Qw2; Mon, 25 Jan 2021 21:58: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 B311B1DFD9; Mon, 25 Jan 2021 21:58: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 10PLwth0062194; Mon, 25 Jan 2021 21:58:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PLwta2062193; Mon, 25 Jan 2021 21:58:55 GMT (envelope-from git) Date: Mon, 25 Jan 2021 21:58:55 GMT Message-Id: <202101252158.10PLwta2062193@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 7a1591c1b625 - main - Rename kern_mmap_req to kern_mmap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a1591c1b625ef47a9c9954f0143a6f0d78cc05c 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, 25 Jan 2021 21:58:55 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=7a1591c1b625ef47a9c9954f0143a6f0d78cc05c commit 7a1591c1b625ef47a9c9954f0143a6f0d78cc05c Author: Brooks Davis AuthorDate: 2021-01-23 00:08:59 +0000 Commit: Brooks Davis CommitDate: 2021-01-25 21:50:37 +0000 Rename kern_mmap_req to kern_mmap Replace all uses of kern_mmap with kern_mmap_req move the old kern_mmap. Reand rename kern_mmap_req to kern_mmap . The helper saved some code churn initially, but having multiple interfaces is sub-optimal. Obtained from: CheriBSD Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28292 --- sys/compat/cloudabi/cloudabi_mem.c | 10 +++++-- sys/compat/freebsd32/freebsd32_misc.c | 20 +++++++++++--- sys/compat/linux/linux_mmap.c | 4 +-- sys/sys/syscallsubr.h | 4 +-- sys/vm/vm_mmap.c | 49 ++++++++++++++++++----------------- 5 files changed, 52 insertions(+), 35 deletions(-) diff --git a/sys/compat/cloudabi/cloudabi_mem.c b/sys/compat/cloudabi/cloudabi_mem.c index a1ecf3623c02..426adb6ff43f 100644 --- a/sys/compat/cloudabi/cloudabi_mem.c +++ b/sys/compat/cloudabi/cloudabi_mem.c @@ -110,8 +110,14 @@ cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap) if (error != 0) return (error); - return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, - uap->fd, uap->off)); + return (kern_mmap(td, &(struct mmap_req){ + .mr_hint = (uintptr_t)uap->addr, + .mr_len = uap->len, + .mr_prot = prot, + .mr_flags = flags, + .mr_fd = uap->fd, + .mr_pos = uap->off, + })); } int diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index b7db1c4468d7..c2caa7c10544 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -502,8 +502,14 @@ freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap) prot |= PROT_EXEC; #endif - return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, - uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); + return (kern_mmap(td, &(struct mmap_req){ + .mr_hint = (uintptr_t)uap->addr, + .mr_len = uap->len, + .mr_prot = prot, + .mr_flags = uap->flags, + .mr_fd = uap->fd, + .mr_pos = PAIR32TO64(off_t, uap->pos), + })); } #ifdef COMPAT_FREEBSD6 @@ -519,8 +525,14 @@ freebsd6_freebsd32_mmap(struct thread *td, prot |= PROT_EXEC; #endif - return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, - uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); + return (kern_mmap(td, &(struct mmap_req){ + .mr_hint = (uintptr_t)uap->addr, + .mr_len = uap->len, + .mr_prot = prot, + .mr_flags = uap->flags, + .mr_fd = uap->fd, + .mr_pos = PAIR32TO64(off_t, uap->pos), + })); } #endif diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c index 1b4b0b78280c..d7f12b782e96 100644 --- a/sys/compat/linux/linux_mmap.c +++ b/sys/compat/linux/linux_mmap.c @@ -217,12 +217,12 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot, (bsd_flags & MAP_EXCL) == 0) { mr_fixed = mr; mr_fixed.mr_flags |= MAP_FIXED | MAP_EXCL; - error = kern_mmap_req(td, &mr_fixed); + error = kern_mmap(td, &mr_fixed); if (error == 0) goto out; } - error = kern_mmap_req(td, &mr); + error = kern_mmap(td, &mr); out: LINUX_CTR2(mmap2, "return: %d (%p)", error, td->td_retval[0]); diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 71e76f072693..9e889e9d5465 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -201,12 +201,10 @@ int kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, int mode, dev_t dev); int kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr, size_t len); -int kern_mmap(struct thread *td, uintptr_t addr, size_t len, int prot, - int flags, int fd, off_t pos); +int kern_mmap(struct thread *td, const struct mmap_req *mrp); int kern_mmap_racct_check(struct thread *td, struct vm_map *map, vm_size_t size); int kern_mmap_maxprot(struct proc *p, int prot); -int kern_mmap_req(struct thread *td, const struct mmap_req *mrp); int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot); int kern_msgctl(struct thread *, int, int, struct msqid_ds *); int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *); diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 30c485010ac8..ecdcc1272db1 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -179,8 +179,14 @@ int sys_mmap(struct thread *td, struct mmap_args *uap) { - return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot, - uap->flags, uap->fd, uap->pos)); + return (kern_mmap(td, &(struct mmap_req){ + .mr_hint = (uintptr_t)uap->addr, + .mr_len = uap->len, + .mr_prot = uap->prot, + .mr_flags = uap->flags, + .mr_fd = uap->fd, + .mr_pos = uap->pos, + })); } int @@ -197,23 +203,7 @@ kern_mmap_maxprot(struct proc *p, int prot) } int -kern_mmap(struct thread *td, uintptr_t addr0, size_t len, int prot, int flags, - int fd, off_t pos) -{ - struct mmap_req mr = { - .mr_hint = addr0, - .mr_len = len, - .mr_prot = prot, - .mr_flags = flags, - .mr_fd = fd, - .mr_pos = pos - }; - - return (kern_mmap_req(td, &mr)); -} - -int -kern_mmap_req(struct thread *td, const struct mmap_req *mrp) +kern_mmap(struct thread *td, const struct mmap_req *mrp) { struct vmspace *vms; struct file *fp; @@ -442,9 +432,14 @@ done: int freebsd6_mmap(struct thread *td, struct freebsd6_mmap_args *uap) { - - return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot, - uap->flags, uap->fd, uap->pos)); + return (kern_mmap(td, &(struct mmap_req){ + .mr_hint = (uintptr_t)uap->addr, + .mr_len = uap->len, + .mr_prot = uap->prot, + .mr_flags = uap->flags, + .mr_fd = uap->fd, + .mr_pos = uap->pos, + })); } #endif @@ -496,8 +491,14 @@ ommap(struct thread *td, struct ommap_args *uap) flags |= MAP_PRIVATE; if (uap->flags & OMAP_FIXED) flags |= MAP_FIXED; - return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, - uap->fd, uap->pos)); + return (kern_mmap(td, &(struct mmap_req){ + .mr_hint = (uintptr_t)uap->addr, + .mr_len = uap->len, + .mr_prot = prot, + .mr_flags = flags, + .mr_fd = uap->fd, + .mr_pos = uap->pos, + })); } #endif /* COMPAT_43 */ From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:01: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 CE5364F36CE; Mon, 25 Jan 2021 22:01:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 4DPkNN2x8dz3h8k; Mon, 25 Jan 2021 22:01:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id 49vUluez7eHr949vVl3i4a; Mon, 25 Jan 2021 15:01:38 -0700 X-Authority-Analysis: v=2.4 cv=Yq/K+6UX c=1 sm=1 tr=0 ts=600f3fc2 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=6I5d2MoRAAAA:8 a=y3olD_i8AAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=ZCLaOZfsNG_Z8zecfM0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=2GdgqtpztZvaxdPX1XqS: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 5F4BA184C; Mon, 25 Jan 2021 14:01:33 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 10PM1XsJ001783; Mon, 25 Jan 2021 14:01:33 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202101252201.10PM1XsJ001783@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: Brooks Davis cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: bfc99943b04b - main - ndis(4): remove as previous announced In-reply-to: <202101252146.10PLk70I048525@gitrepo.freebsd.org> References: <202101252146.10PLk70I048525@gitrepo.freebsd.org> Comments: In-reply-to Brooks Davis message dated "Mon, 25 Jan 2021 21:46:07 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 25 Jan 2021 14:01:33 -0800 X-CMAE-Envelope: MS4xfOORjMeAiRDKjYTCCAFSkfM20ylOgCFw1pR3A57EnKmkfx+Ul2NKg78Sce6tI7h7nuTEsD/yuX79re3BIO1HVUUoTMDLr/KvRapLqpPqLQlqWBD/SbcW I0MlU/XArTddjqhiFBIvv54hqqDDM/epMqXfFqL09pI7Qq7PBtxhmC2QhQkGqQnt7oEoVW5YRIPwKdZQWYf/LPRD183FeJmvZiZkZLXG4zJNpeK1Akkb8sYU xRXrx+7+TZEDkYNnG3afeVqnq6H5+OaShNFkuy5wqp7x1FdUfEpxrASNtFlgfktK04VV7xqZlsqzFD9/Oz/LHfbTNNtEkCXFoYZWjayTxk8= X-Rspamd-Queue-Id: 4DPkNN2x8dz3h8k 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, 25 Jan 2021 22:01:40 -0000 In message <202101252146.10PLk70I048525@gitrepo.freebsd.org>, Brooks Davis writ es: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bfc99943b04b46a6c1c885ce7bcc6f23 > 5b7422aa > > commit bfc99943b04b46a6c1c885ce7bcc6f235b7422aa > Author: Brooks Davis > AuthorDate: 2021-01-25 21:45:03 +0000 > Commit: Brooks Davis > CommitDate: 2021-01-25 21:45:03 +0000 > > ndis(4): remove as previous announced > > nids(4) was a clever idea in the early 2000's when the market was > flooded with 10/100 NICs with Windows-only drivers, but that hasn't been > the case for ages and the driver has had no meaningful maintenance in > ages. It only supports Windows-XP era drivers. > > Also remove: > - ndis support from wpa_supplicant This doesn't matter either way. It will be added back in the next time we import wpa from our upstream. > - ndiscvt(8) > > Reviewed By: emaste, bcr (manpages) > Differential Revision: https://reviews.freebsd.org/D27609 -- 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 Mon Jan 25 22:03: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 5D35B4F3771; Mon, 25 Jan 2021 22:03:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (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 4DPkQt1KQ3z3hH3; Mon, 25 Jan 2021 22:03:49 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id 49xalug5CeHr949xcl3inU; Mon, 25 Jan 2021 15:03:48 -0700 X-Authority-Analysis: v=2.4 cv=Yq/K+6UX c=1 sm=1 tr=0 ts=600f4044 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=y3olD_i8AAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=0JBhRB_akdYaTeQaSU4A:9 a=CjuIK1q_8ugA:10 a=MVIZgjNjt1QA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=2GdgqtpztZvaxdPX1XqS: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 B07BC1852; Mon, 25 Jan 2021 14:03:45 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 10PM3jql007261; Mon, 25 Jan 2021 14:03:45 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202101252203.10PM3jql007261@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: Cy Schubert cc: Brooks Davis , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: bfc99943b04b - main - ndis(4): remove as previous announced In-reply-to: <202101252201.10PM1XsJ001783@slippy.cwsent.com> References: <202101252146.10PLk70I048525@gitrepo.freebsd.org> <202101252201.10PM1XsJ001783@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Mon, 25 Jan 2021 14:01:33 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 25 Jan 2021 14:03:45 -0800 X-CMAE-Envelope: MS4xfHualp2K2GacDs9GrgtvJc9sD3AQDssa2COi7V0fDwe42VfoyxPR6YG6yfQtTGJPWQ1iDBUyJFwsyCznOT0wo3eUGhOsqvisEHLjijlRVqhnIxi6nXTj r98ieLKcuypc44CUiSwPVjHt4rvzbZO9Be87H44CifGXvByrOIzA1iF4CZSm+CLpVzF172MNupUcS8pOgtoPwtbCW7cAxDfUpZDUZ0EUrWsxcwqaWc/GWioT X5FCK/X9Bb4WnXtTGQNKwPTGJ1/ziLK6vUCV+/A8x6RyCSWAHjoRlFW2MGF+jm2mkCvwRA5ja51W+x2NDif+70bzi9otQ0FoHN+22B+tp+o= X-Rspamd-Queue-Id: 4DPkQt1KQ3z3hH3 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.70 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[64.59.134.13:from]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[64.59.134.13:from]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; R_DKIM_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.134.13:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; SPAMHAUS_ZRD(0.00)[64.59.134.13:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; 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, 25 Jan 2021 22:03:51 -0000 In message <202101252201.10PM1XsJ001783@slippy.cwsent.com>, Cy Schubert writes: > In message <202101252146.10PLk70I048525@gitrepo.freebsd.org>, Brooks Davis > writ > es: > > The branch main has been updated by brooks: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=bfc99943b04b46a6c1c885ce7bcc6f > 23 > > 5b7422aa > > > > commit bfc99943b04b46a6c1c885ce7bcc6f235b7422aa > > Author: Brooks Davis > > AuthorDate: 2021-01-25 21:45:03 +0000 > > Commit: Brooks Davis > > CommitDate: 2021-01-25 21:45:03 +0000 > > > > ndis(4): remove as previous announced > > > > nids(4) was a clever idea in the early 2000's when the market was > > flooded with 10/100 NICs with Windows-only drivers, but that hasn't bee > n > > the case for ages and the driver has had no meaningful maintenance in > > ages. It only supports Windows-XP era drivers. > > > > Also remove: > > - ndis support from wpa_supplicant > > This doesn't matter either way. It will be added back in the next time we > import wpa from our upstream. Never mind. Too much multitasking. I should have had a closer look before speaking. -- 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 Mon Jan 25 22:42: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 4C8774F498A; Mon, 25 Jan 2021 22:42: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 4DPlHZ1dxWz3kQt; Mon, 25 Jan 2021 22:42: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 2B5031EA2E; Mon, 25 Jan 2021 22:42: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 10PMgYaE026249; Mon, 25 Jan 2021 22:42:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgYfH026248; Mon, 25 Jan 2021 22:42:34 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:34 GMT Message-Id: <202101252242.10PMgYfH026248@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: f40d6217f20d - main - zfs: fix panics with invariant kernels from zfs_replay_setattr 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: f40d6217f20d69427b58d82ce4e29d88bf4dfbd6 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, 25 Jan 2021 22:42:34 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f40d6217f20d69427b58d82ce4e29d88bf4dfbd6 commit f40d6217f20d69427b58d82ce4e29d88bf4dfbd6 Author: Mateusz Guzik AuthorDate: 2021-01-25 21:28:05 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:40:14 +0000 zfs: fix panics with invariant kernels from zfs_replay_setattr --- sys/contrib/openzfs/module/zfs/zfs_replay.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/contrib/openzfs/module/zfs/zfs_replay.c b/sys/contrib/openzfs/module/zfs/zfs_replay.c index cba5e8c9cd0b..53c7dbd5df43 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_replay.c +++ b/sys/contrib/openzfs/module/zfs/zfs_replay.c @@ -859,7 +859,12 @@ zfs_replay_setattr(void *arg1, void *arg2, boolean_t byteswap) zfsvfs->z_fuid_replay = zfs_replay_fuid_domain(start, &start, lr->lr_uid, lr->lr_gid); + /* + * Satisfy assertions. + */ + vn_seqc_write_begin(ZTOV(zp)); error = zfs_setattr(zp, vap, 0, kcred); + vn_seqc_write_end(ZTOV(zp)); zfs_fuid_info_free(zfsvfs->z_fuid_replay); zfsvfs->z_fuid_replay = NULL; From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 7D0FE4F44A4; Mon, 25 Jan 2021 22:42: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 4DPlHb2dKSz3kQv; Mon, 25 Jan 2021 22:42: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 4D2111E746; Mon, 25 Jan 2021 22:42: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 10PMgZCc026272; Mon, 25 Jan 2021 22:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgZfO026271; Mon, 25 Jan 2021 22:42:35 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:35 GMT Message-Id: <202101252242.10PMgZfO026271@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: cc96f92a570e - main - atomic: make atomic_store_ptr type-aware 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: cc96f92a570e05636a20fdd15d4616b127bb9ecc 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, 25 Jan 2021 22:42:35 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=cc96f92a570e05636a20fdd15d4616b127bb9ecc commit cc96f92a570e05636a20fdd15d4616b127bb9ecc Author: Mateusz Guzik AuthorDate: 2021-01-25 19:39:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:40:15 +0000 atomic: make atomic_store_ptr type-aware --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c | 2 +- sys/fs/tmpfs/tmpfs_subr.c | 6 ++---- sys/sys/_cscan_atomic.h | 5 ++++- sys/sys/atomic_common.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c index f9a0820eda2d..d9f2635b0129 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c @@ -444,7 +444,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, zp->z_blksz = blksz; zp->z_seq = 0x7A4653; zp->z_sync_cnt = 0; - atomic_store_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); + atomic_store_ptr(&zp->z_cached_symlink, NULL); vp = ZTOV(zp); diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 07e7ea11ad6e..3b3581fc81f6 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -360,8 +360,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, * TODO: Since there is no load consume primitive provided * right now, the load is performed with an acquire fence. */ - atomic_store_ptr((uintptr_t *)&nnode->tn_link_target, - (uintptr_t)symlink); + atomic_store_ptr(&nnode->tn_link_target, symlink); atomic_store_char((char *)&nnode->tn_link_smr, symlink_smr); atomic_thread_fence_rel(); break; @@ -453,8 +452,7 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, case VLNK: symlink = node->tn_link_target; - atomic_store_ptr((uintptr_t *)&node->tn_link_target, - (uintptr_t)NULL); + atomic_store_ptr(&node->tn_link_target, NULL); if (atomic_load_char(&node->tn_link_smr)) { cache_symlink_free(symlink, node->tn_size + 1); } else { diff --git a/sys/sys/_cscan_atomic.h b/sys/sys/_cscan_atomic.h index 19c05b179940..3bd9455102b1 100644 --- a/sys/sys/_cscan_atomic.h +++ b/sys/sys/_cscan_atomic.h @@ -243,7 +243,10 @@ void kcsan_atomic_thread_fence_seq_cst(void); #define atomic_subtract_ptr kcsan_atomic_subtract_ptr #define atomic_subtract_acq_ptr kcsan_atomic_subtract_acq_ptr #define atomic_subtract_rel_ptr kcsan_atomic_subtract_rel_ptr -#define atomic_store_ptr kcsan_atomic_store_ptr +#define atomic_store_ptr(x, v) ({ \ + __typeof(*x) __value = (v); \ + kcsan_atomic_store_ptr((volatile uintptr_t *)(x), (uintptr_t)(__value));\ +}) #define atomic_store_rel_ptr kcsan_atomic_store_rel_ptr #define atomic_swap_ptr kcsan_atomic_swap_ptr #define atomic_testandclear_ptr kcsan_atomic_testandclear_ptr diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index a3548977b940..4c29d132c369 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -58,7 +58,7 @@ #define atomic_store_long(p, v) \ (*(volatile u_long *)(p) = (u_long)(v)) #define atomic_store_ptr(p, v) \ - (*(volatile uintptr_t *)(p) = (uintptr_t)(v)) + (*(volatile __typeof(*p) *)(p) = (v)) #define atomic_store_8(p, v) \ (*(volatile uint8_t *)(p) = (uint8_t)(v)) #define atomic_store_16(p, v) \ From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 E0FD04F44A5; Mon, 25 Jan 2021 22:42: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 4DPlHc4cv7z3kCM; Mon, 25 Jan 2021 22:42: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 7E8AB1E926; Mon, 25 Jan 2021 22:42: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 10PMgaPN026292; Mon, 25 Jan 2021 22:42:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgaWJ026291; Mon, 25 Jan 2021 22:42:36 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:36 GMT Message-Id: <202101252242.10PMgaWJ026291@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: 054ce2b03710 - main - atomic: add stub atomic_load_consume_ptr 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: 054ce2b0371042c0dbc4b3ab1d7e7795ad75d51e 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, 25 Jan 2021 22:42:37 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=054ce2b0371042c0dbc4b3ab1d7e7795ad75d51e commit 054ce2b0371042c0dbc4b3ab1d7e7795ad75d51e Author: Mateusz Guzik AuthorDate: 2021-01-25 20:09:41 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:40:15 +0000 atomic: add stub atomic_load_consume_ptr --- sys/sys/_cscan_atomic.h | 5 +++++ sys/sys/atomic_common.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/sys/sys/_cscan_atomic.h b/sys/sys/_cscan_atomic.h index 3bd9455102b1..aed96580e1e4 100644 --- a/sys/sys/_cscan_atomic.h +++ b/sys/sys/_cscan_atomic.h @@ -236,6 +236,11 @@ void kcsan_atomic_thread_fence_seq_cst(void); __retptr; \ }) #define atomic_load_acq_ptr kcsan_atomic_load_acq_ptr +#define atomic_load_consume_ptr(x) ({ \ + __typeof(*x) __retptr; \ + __retptr = (void *)kcsan_atomic_load_acq_ptr((volatile uintptr_t *)(x));\ + __retptr; \ +}) #define atomic_readandclear_ptr kcsan_atomic_readandclear_ptr #define atomic_set_ptr kcsan_atomic_set_ptr #define atomic_set_acq_ptr kcsan_atomic_set_acq_ptr diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index 4c29d132c369..48f0a8b8939c 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -70,4 +70,12 @@ (*(volatile uint64_t *)(p) = (uint64_t)(v)) #endif +/* + * Currently all architectures provide acquire and release fences on their own, + * but they don't provide consume. Kludge below allows relevant code to stop + * openly resorting to the stronger acquire fence, to be sorted out. + */ +#define atomic_load_consume_ptr(p) \ + ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) + #endif From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 4160E4F48CC; Mon, 25 Jan 2021 22:42: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 4DPlHf108fz3kdD; Mon, 25 Jan 2021 22:42: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 959141E927; Mon, 25 Jan 2021 22:42:37 +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 10PMgbPk026312; Mon, 25 Jan 2021 22:42:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgbPJ026311; Mon, 25 Jan 2021 22:42:37 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:37 GMT Message-Id: <202101252242.10PMgbPJ026311@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: 8d2a230e996c - main - vfs: use atomic_load_consume_ptr in vn_load_v_data_smr 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: 8d2a230e996c8aec2ec4883d45f7ac38070bd38f 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, 25 Jan 2021 22:42:39 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8d2a230e996c8aec2ec4883d45f7ac38070bd38f commit 8d2a230e996c8aec2ec4883d45f7ac38070bd38f Author: Mateusz Guzik AuthorDate: 2021-01-25 20:19:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:40:15 +0000 vfs: use atomic_load_consume_ptr in vn_load_v_data_smr --- sys/sys/vnode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index ffd0bdad940d..78fbec1bd0ba 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1112,7 +1112,7 @@ int vn_dir_check_exec(struct vnode *vp, struct componentname *cnp); struct vnode *_vp = (vp); \ \ VFS_SMR_ASSERT_ENTERED(); \ - atomic_load_ptr(&(_vp)->v_data); \ + atomic_load_consume_ptr(&(_vp)->v_data);\ }) #endif /* _KERNEL */ From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 D564B4F4539; Mon, 25 Jan 2021 22:42: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 4DPlHn1xxXz3kkN; Mon, 25 Jan 2021 22:42: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 3795C1E928; Mon, 25 Jan 2021 22:42: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 10PMgga7026396; Mon, 25 Jan 2021 22:42:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgg1q026395; Mon, 25 Jan 2021 22:42:42 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:42 GMT Message-Id: <202101252242.10PMgg1q026395@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: 6ef8fede86f3 - main - cache: make ->nc_flag accesses atomic-clean for lockless usage 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: 6ef8fede86f3feed7fb1e15b0e8a32ecfec33c6c 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, 25 Jan 2021 22:42:47 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6ef8fede86f3feed7fb1e15b0e8a32ecfec33c6c commit 6ef8fede86f3feed7fb1e15b0e8a32ecfec33c6c Author: Mateusz Guzik AuthorDate: 2021-01-25 20:58:59 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:41:13 +0000 cache: make ->nc_flag accesses atomic-clean for lockless usage --- sys/kern/vfs_cache.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 9d5b18aa4132..ba3856ffe0b4 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -398,7 +398,7 @@ static inline struct negstate * NCP2NEGSTATE(struct namecache *ncp) { - MPASS(ncp->nc_flag & NCF_NEGATIVE); + MPASS(atomic_load_char(&ncp->nc_flag) & NCF_NEGATIVE); return (&ncp->nc_neg); } @@ -1994,7 +1994,7 @@ negative_success: } cache_out_ts(ncp, tsp, ticksp); - whiteout = (ncp->nc_flag & NCF_WHITE); + whiteout = (atomic_load_char(&ncp->nc_flag) & NCF_WHITE); neg_promote = cache_neg_hit_prep(ncp); if (!cache_ncp_canuse(ncp)) { cache_neg_hit_abort(ncp); @@ -2149,6 +2149,7 @@ cache_enter_lock(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, { struct namecache *ncp; struct mtx *blps[2]; + u_char nc_flag; blps[0] = HASH2BUCKETLOCK(hash); for (;;) { @@ -2159,11 +2160,12 @@ cache_enter_lock(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, ncp = vp->v_cache_dd; if (ncp == NULL) break; - if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) == 0) break; MPASS(ncp->nc_dvp == vp); blps[1] = NCP2BUCKETLOCK(ncp); - if (ncp->nc_flag & NCF_NEGATIVE) + if ((nc_flag & NCF_NEGATIVE) != 0) break; if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp)) break; @@ -2190,6 +2192,7 @@ cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp { struct namecache *ncp; struct mtx *blps[2]; + u_char nc_flag; blps[0] = HASH2BUCKETLOCK(hash); for (;;) { @@ -2198,11 +2201,12 @@ cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp ncp = dvp->v_cache_dd; if (ncp == NULL) break; - if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) == 0) break; MPASS(ncp->nc_dvp == dvp); blps[1] = NCP2BUCKETLOCK(ncp); - if (ncp->nc_flag & NCF_NEGATIVE) + if ((nc_flag & NCF_NEGATIVE) != 0) break; if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp)) break; @@ -2436,7 +2440,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, vp); } else { if (cnp->cn_flags & ISWHITEOUT) - ncp->nc_flag |= NCF_WHITE; + atomic_store_char(&ncp->nc_flag, ncp->nc_flag | NCF_WHITE); cache_neg_insert(ncp); SDT_PROBE2(vfs, namecache, enter_negative, done, dvp, ncp->nc_name); From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 C99A64F48D2; Mon, 25 Jan 2021 22:42: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 4DPlHn20dBz3kCv; Mon, 25 Jan 2021 22:42: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 50FC61E5EC; Mon, 25 Jan 2021 22:42: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 10PMghG2026418; Mon, 25 Jan 2021 22:42:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMghl3026417; Mon, 25 Jan 2021 22:42:43 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:43 GMT Message-Id: <202101252242.10PMghl3026417@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: 6f0842764946 - main - cache: make ->v_cache_dd accesses atomic-clean for lockless usage 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: 6f0842764946ed57382293cc3361b86955308084 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, 25 Jan 2021 22:42:47 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6f0842764946ed57382293cc3361b86955308084 commit 6f0842764946ed57382293cc3361b86955308084 Author: Mateusz Guzik AuthorDate: 2021-01-25 20:29:54 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:41:13 +0000 cache: make ->v_cache_dd accesses atomic-clean for lockless usage --- sys/kern/vfs_cache.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ba3856ffe0b4..fad7ce91ef44 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1441,7 +1441,7 @@ cache_zap_locked(struct namecache *ncp) TAILQ_REMOVE(&vp->v_cache_dst, ncp, nc_dst); if (ncp == vp->v_cache_dd) { vn_seqc_write_begin_unheld(vp); - vp->v_cache_dd = NULL; + atomic_store_ptr(&vp->v_cache_dd, NULL); vn_seqc_write_end(vp); } } else { @@ -1451,7 +1451,7 @@ cache_zap_locked(struct namecache *ncp) if (ncp->nc_flag & NCF_ISDOTDOT) { if (ncp == dvp->v_cache_dd) { vn_seqc_write_begin_unheld(dvp); - dvp->v_cache_dd = NULL; + atomic_store_ptr(&dvp->v_cache_dd, NULL); vn_seqc_write_end(dvp); } } else { @@ -1628,7 +1628,7 @@ retry_dotdot: cache_free(ncp); } else { vn_seqc_write_begin(dvp); - dvp->v_cache_dd = NULL; + atomic_store_ptr(&dvp->v_cache_dd, NULL); vn_seqc_write_end(dvp); mtx_unlock(dvlp); if (dvlp2 != NULL) @@ -2157,7 +2157,7 @@ cache_enter_lock(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, cache_lock_vnodes_cel(cel, dvp, vp); if (vp == NULL || vp->v_type != VDIR) break; - ncp = vp->v_cache_dd; + ncp = atomic_load_consume_ptr(&vp->v_cache_dd); if (ncp == NULL) break; nc_flag = atomic_load_char(&ncp->nc_flag); @@ -2198,7 +2198,7 @@ cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp for (;;) { blps[1] = NULL; cache_lock_vnodes_cel(cel, dvp, vp); - ncp = dvp->v_cache_dd; + ncp = atomic_load_consume_ptr(&dvp->v_cache_dd); if (ncp == NULL) break; nc_flag = atomic_load_char(&ncp->nc_flag); @@ -2240,7 +2240,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, uint32_t hash; int len; - if (dvp->v_cache_dd == NULL) + if (atomic_load_ptr(&dvp->v_cache_dd) == NULL) return; len = cnp->cn_namelen; cache_celockstate_init(&cel); @@ -2254,7 +2254,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, } else { ncp = NULL; } - dvp->v_cache_dd = NULL; + atomic_store_ptr(&dvp->v_cache_dd, NULL); vn_seqc_write_end(dvp); cache_enter_unlock(&cel); if (ncp != NULL) @@ -2393,7 +2393,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); vn_seqc_write_begin(dvp); - dvp->v_cache_dd = ncp; + atomic_store_ptr(&dvp->v_cache_dd, ncp); vn_seqc_write_end(dvp); } @@ -2411,12 +2411,12 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, else ndd = NULL; } - vp->v_cache_dd = ncp; + atomic_store_ptr(&vp->v_cache_dd, ncp); vn_seqc_write_end(vp); } else if (vp->v_type != VDIR) { if (vp->v_cache_dd != NULL) { vn_seqc_write_begin(vp); - vp->v_cache_dd = NULL; + atomic_store_ptr(&vp->v_cache_dd, NULL); vn_seqc_write_end(vp); } } @@ -2658,7 +2658,7 @@ cache_has_entries(struct vnode *vp) { if (LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && - vp->v_cache_dd == NULL) + atomic_load_ptr(&vp->v_cache_dd) == NULL) return (false); return (true); } @@ -3291,7 +3291,7 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, vp_seqc = tvp_seqc; continue; } - ncp = atomic_load_ptr(&vp->v_cache_dd); + ncp = atomic_load_consume_ptr(&vp->v_cache_dd); if (ncp == NULL) { cache_rev_failed(&reason); goto out_abort; @@ -4705,7 +4705,7 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - ncp = atomic_load_ptr(&dvp->v_cache_dd); + ncp = atomic_load_consume_ptr(&dvp->v_cache_dd); if (ncp == NULL) { return (cache_fpl_aborted(fpl)); } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 4AB574F44BA; Mon, 25 Jan 2021 22:42: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 4DPlHh2rVKz3kjt; Mon, 25 Jan 2021 22:42: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 F10031E747; Mon, 25 Jan 2021 22:42: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 10PMgdF3026356; Mon, 25 Jan 2021 22:42:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgdrY026354; Mon, 25 Jan 2021 22:42:39 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:39 GMT Message-Id: <202101252242.10PMgdrY026354@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: c09f79927145 - main - tmpfs: drop acq fence now that vn_load_v_data_smr has consume semantics 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: c09f7992714559eaa874f13ea4a1d648f199cd08 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, 25 Jan 2021 22:42:45 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c09f7992714559eaa874f13ea4a1d648f199cd08 commit c09f7992714559eaa874f13ea4a1d648f199cd08 Author: Mateusz Guzik AuthorDate: 2021-01-25 20:17:48 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:40:15 +0000 tmpfs: drop acq fence now that vn_load_v_data_smr has consume semantics --- sys/fs/tmpfs/tmpfs_subr.c | 3 --- sys/fs/tmpfs/tmpfs_vnops.c | 1 - 2 files changed, 4 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 3b3581fc81f6..84473a439c43 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -356,9 +356,6 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, * pointer to also get the above content in a stable manner. * Worst case tn_link_smr flag may be set to true despite being stale, * while the target buffer is already cleared out. - * - * TODO: Since there is no load consume primitive provided - * right now, the load is performed with an acquire fence. */ atomic_store_ptr(&nnode->tn_link_target, symlink); atomic_store_char((char *)&nnode->tn_link_smr, symlink_smr); diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index c716b393efdd..7614287c642e 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1466,7 +1466,6 @@ tmpfs_fplookup_symlink(struct vop_fplookup_symlink_args *v) vp = v->a_vp; node = VP_TO_TMPFS_NODE_SMR(vp); - atomic_thread_fence_acq(); if (__predict_false(node == NULL)) return (EAGAIN); if (!atomic_load_char(&node->tn_link_smr)) From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 C806D4F499E; Mon, 25 Jan 2021 22:42: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 4DPlHl1xzwz3kmB; Mon, 25 Jan 2021 22:42: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 16F4B1E748; Mon, 25 Jan 2021 22:42: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 10PMgeIS026374; Mon, 25 Jan 2021 22:42:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgejX026373; Mon, 25 Jan 2021 22:42:40 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:40 GMT Message-Id: <202101252242.10PMgejX026373@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: ffcf8f97f8a8 - main - cache: store vnodes in local vars in cache_zap_locked 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: ffcf8f97f8a8fb92689793003acabc0a2fe97af4 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, 25 Jan 2021 22:42:47 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ffcf8f97f8a8fb92689793003acabc0a2fe97af4 commit ffcf8f97f8a8fb92689793003acabc0a2fe97af4 Author: Mateusz Guzik AuthorDate: 2021-01-23 19:41:40 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:41:13 +0000 cache: store vnodes in local vars in cache_zap_locked --- sys/kern/vfs_cache.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index e3098ac7c5d5..9d5b18aa4132 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1422,10 +1422,14 @@ static void cache_zap_locked(struct namecache *ncp) { struct nchashhead *ncpp; + struct vnode *dvp, *vp; + + dvp = ncp->nc_dvp; + vp = ncp->nc_vp; if (!(ncp->nc_flag & NCF_NEGATIVE)) - cache_assert_vnode_locked(ncp->nc_vp); - cache_assert_vnode_locked(ncp->nc_dvp); + cache_assert_vnode_locked(vp); + cache_assert_vnode_locked(dvp); cache_assert_bucket_locked(ncp); cache_ncp_invalidate(ncp); @@ -1433,28 +1437,26 @@ cache_zap_locked(struct namecache *ncp) ncpp = NCP2BUCKET(ncp); CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash); if (!(ncp->nc_flag & NCF_NEGATIVE)) { - SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_vp); - TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - if (ncp == ncp->nc_vp->v_cache_dd) { - vn_seqc_write_begin_unheld(ncp->nc_vp); - ncp->nc_vp->v_cache_dd = NULL; - vn_seqc_write_end(ncp->nc_vp); + SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp); + TAILQ_REMOVE(&vp->v_cache_dst, ncp, nc_dst); + if (ncp == vp->v_cache_dd) { + vn_seqc_write_begin_unheld(vp); + vp->v_cache_dd = NULL; + vn_seqc_write_end(vp); } } else { - SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name); + SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name); cache_neg_remove(ncp); } if (ncp->nc_flag & NCF_ISDOTDOT) { - if (ncp == ncp->nc_dvp->v_cache_dd) { - vn_seqc_write_begin_unheld(ncp->nc_dvp); - ncp->nc_dvp->v_cache_dd = NULL; - vn_seqc_write_end(ncp->nc_dvp); + if (ncp == dvp->v_cache_dd) { + vn_seqc_write_begin_unheld(dvp); + dvp->v_cache_dd = NULL; + vn_seqc_write_end(dvp); } } else { LIST_REMOVE(ncp, nc_src); - if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { + if (LIST_EMPTY(&dvp->v_cache_src)) { ncp->nc_flag |= NCF_DVDROP; } } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 F42394F4993; Mon, 25 Jan 2021 22:42: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 4DPlHg62HXz3kdM; Mon, 25 Jan 2021 22:42: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 C2AA91EA2F; Mon, 25 Jan 2021 22:42: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 10PMgc7i026334; Mon, 25 Jan 2021 22:42:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgcLi026333; Mon, 25 Jan 2021 22:42:38 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:38 GMT Message-Id: <202101252242.10PMgcLi026333@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: 7af02ef0b222 - main - zfs: use atomic_load_consume_ptr for z_cached_symlink 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: 7af02ef0b222eebad4827a264454e85134692e94 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, 25 Jan 2021 22:42:44 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7af02ef0b222eebad4827a264454e85134692e94 commit 7af02ef0b222eebad4827a264454e85134692e94 Author: Mateusz Guzik AuthorDate: 2021-01-25 20:15:19 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:40:15 +0000 zfs: use atomic_load_consume_ptr for z_cached_symlink --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 5 +---- 1 file changed, 1 insertion(+), 4 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 365c64a9479c..35e54a2e1560 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 @@ -4477,10 +4477,7 @@ zfs_freebsd_fplookup_symlink(struct vop_fplookup_symlink_args *v) return (EAGAIN); } - /* - * FIXME: Load consume would be sufficient but there is no primitive to do it. - */ - target = (char *)atomic_load_acq_ptr((uintptr_t *)&zp->z_cached_symlink); + target = atomic_load_consume_ptr(&zp->z_cached_symlink); if (target == NULL) { return (EAGAIN); } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:42: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 C61934F48D8; Mon, 25 Jan 2021 22:42: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 4DPlHr3qrtz3kpS; Mon, 25 Jan 2021 22:42: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 736D41EA83; Mon, 25 Jan 2021 22:42: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 10PMgiJ8026436; Mon, 25 Jan 2021 22:42:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMgiIv026435; Mon, 25 Jan 2021 22:42:44 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:42:44 GMT Message-Id: <202101252242.10PMgiIv026435@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: e7cf562a40fc - main - cache: change ->v_cache_dd synchronisation rules 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: e7cf562a40fc093df054bd7fa6f34746069a984a 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, 25 Jan 2021 22:42:49 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e7cf562a40fc093df054bd7fa6f34746069a984a commit e7cf562a40fc093df054bd7fa6f34746069a984a Author: Mateusz Guzik AuthorDate: 2021-01-25 20:49:09 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-25 22:41:13 +0000 cache: change ->v_cache_dd synchronisation rules Instead of resorting to seqc modification take advantage of immutability of entries and check if the entry still matches after everything got prepared. --- sys/kern/vfs_cache.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index fad7ce91ef44..a73e4843b5f3 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1440,9 +1440,7 @@ cache_zap_locked(struct namecache *ncp) SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp); TAILQ_REMOVE(&vp->v_cache_dst, ncp, nc_dst); if (ncp == vp->v_cache_dd) { - vn_seqc_write_begin_unheld(vp); atomic_store_ptr(&vp->v_cache_dd, NULL); - vn_seqc_write_end(vp); } } else { SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name); @@ -1450,9 +1448,7 @@ cache_zap_locked(struct namecache *ncp) } if (ncp->nc_flag & NCF_ISDOTDOT) { if (ncp == dvp->v_cache_dd) { - vn_seqc_write_begin_unheld(dvp); atomic_store_ptr(&dvp->v_cache_dd, NULL); - vn_seqc_write_end(dvp); } } else { LIST_REMOVE(ncp, nc_src); @@ -1627,9 +1623,7 @@ retry_dotdot: mtx_unlock(dvlp2); cache_free(ncp); } else { - vn_seqc_write_begin(dvp); atomic_store_ptr(&dvp->v_cache_dd, NULL); - vn_seqc_write_end(dvp); mtx_unlock(dvlp); if (dvlp2 != NULL) mtx_unlock(dvlp2); @@ -2246,7 +2240,6 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, cache_celockstate_init(&cel); hash = cache_get_hash(cnp->cn_nameptr, len, dvp); cache_enter_lock_dd(&cel, dvp, vp, hash); - vn_seqc_write_begin(dvp); ncp = dvp->v_cache_dd; if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT)) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); @@ -2255,7 +2248,6 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, ncp = NULL; } atomic_store_ptr(&dvp->v_cache_dd, NULL); - vn_seqc_write_end(dvp); cache_enter_unlock(&cel); if (ncp != NULL) cache_free(ncp); @@ -2392,9 +2384,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, goto out_unlock_free; KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); - vn_seqc_write_begin(dvp); + atomic_thread_fence_rel(); atomic_store_ptr(&dvp->v_cache_dd, ncp); - vn_seqc_write_end(dvp); } if (vp != NULL) { @@ -2404,20 +2395,17 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, * directory name in it and the name ".." for the * directory's parent. */ - vn_seqc_write_begin(vp); if ((ndd = vp->v_cache_dd) != NULL) { if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) cache_zap_locked(ndd); else ndd = NULL; } + atomic_thread_fence_rel(); atomic_store_ptr(&vp->v_cache_dd, ncp); - vn_seqc_write_end(vp); } else if (vp->v_type != VDIR) { if (vp->v_cache_dd != NULL) { - vn_seqc_write_begin(vp); atomic_store_ptr(&vp->v_cache_dd, NULL); - vn_seqc_write_end(vp); } } } @@ -3301,10 +3289,6 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, cache_rev_failed(&reason); goto out_abort; } - if (!cache_ncp_canuse(ncp)) { - cache_rev_failed(&reason); - goto out_abort; - } if (ncp->nc_nlen >= *buflen) { cache_rev_failed(&reason); error = ENOMEM; @@ -3324,6 +3308,17 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, cache_rev_failed(&reason); goto out_abort; } + /* + * Acquire fence provided by vn_seqc_read_any above. + */ + if (__predict_false(atomic_load_ptr(&vp->v_cache_dd) != ncp)) { + cache_rev_failed(&reason); + goto out_abort; + } + if (!cache_ncp_canuse(ncp)) { + cache_rev_failed(&reason); + goto out_abort; + } vp = tvp; vp_seqc = tvp_seqc; if (vp == rdir || vp == rootvnode) @@ -4719,15 +4714,22 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) fpl->tvp = ncp->nc_dvp; } - if (!cache_ncp_canuse(ncp)) { - return (cache_fpl_aborted(fpl)); - } - fpl->tvp_seqc = vn_seqc_read_any(fpl->tvp); if (seqc_in_modify(fpl->tvp_seqc)) { return (cache_fpl_partial(fpl)); } + /* + * Acquire fence provided by vn_seqc_read_any above. + */ + if (__predict_false(atomic_load_ptr(&dvp->v_cache_dd) != ncp)) { + return (cache_fpl_aborted(fpl)); + } + + if (!cache_ncp_canuse(ncp)) { + return (cache_fpl_aborted(fpl)); + } + counter_u64_add(dotdothits, 1); return (0); } From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:47: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 7FAA24F4FAC; Mon, 25 Jan 2021 22:47:11 +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 4DPlNv39D6z3lsf; Mon, 25 Jan 2021 22:47:11 +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 5F4231EB00; Mon, 25 Jan 2021 22:47:11 +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 10PMlBIT027259; Mon, 25 Jan 2021 22:47:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMlBd2027258; Mon, 25 Jan 2021 22:47:11 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:47:11 GMT Message-Id: <202101252247.10PMlBd2027258@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: 83edbc3cb54f - main - ipfilter: Retire pre-standard C support. 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: 83edbc3cb54fba6b37a68270c232df7b785bd222 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, 25 Jan 2021 22:47:11 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=83edbc3cb54fba6b37a68270c232df7b785bd222 commit 83edbc3cb54fba6b37a68270c232df7b785bd222 Author: Cy Schubert AuthorDate: 2021-01-15 04:32:16 +0000 Commit: Cy Schubert CommitDate: 2021-01-25 22:46:45 +0000 ipfilter: Retire pre-standard C support. All C compilers in 2021 support standard C and architectures that did not were retired long ago. Simplify by removing now redundant pre-standard C code. MFC after: 1 week --- contrib/ipfilter/bpf-ipf.h | 12 --------- contrib/ipfilter/ipf.h | 8 ------ contrib/ipfilter/iplang/iplang_l.l | 4 --- contrib/ipfilter/ipsend/ipsend.h | 4 --- contrib/ipfilter/ipsend/ipsopt.c | 4 --- contrib/ipfilter/kmem.h | 4 --- contrib/ipfilter/lib/debug.c | 23 +++------------- contrib/ipfilter/lib/facpri.h | 4 --- contrib/ipfilter/lib/inet_addr.c | 4 --- contrib/ipfilter/lib/kmem.c | 4 --- contrib/ipfilter/lib/kmem.h | 4 --- contrib/ipfilter/lib/verbose.c | 16 ----------- contrib/ipfilter/md5.c | 4 --- contrib/ipfilter/md5.h | 8 ------ contrib/ipfilter/opts.h | 4 --- sys/contrib/ipfilter/netinet/ip_compat.h | 12 --------- sys/contrib/ipfilter/netinet/ip_fil.h | 46 -------------------------------- sys/contrib/ipfilter/netinet/ip_lookup.h | 12 --------- sys/contrib/ipfilter/netinet/ip_nat.h | 8 ------ sys/contrib/ipfilter/netinet/ip_proxy.h | 4 --- sys/contrib/ipfilter/netinet/ip_scan.h | 6 ----- sys/contrib/ipfilter/netinet/ip_state.h | 4 --- 22 files changed, 4 insertions(+), 195 deletions(-) diff --git a/contrib/ipfilter/bpf-ipf.h b/contrib/ipfilter/bpf-ipf.h index dc2b660e2eee..a114949de6e0 100644 --- a/contrib/ipfilter/bpf-ipf.h +++ b/contrib/ipfilter/bpf-ipf.h @@ -420,25 +420,13 @@ struct bpf_insn { * Systems based on non-BSD kernels don't have ifnet's (or they don't mean * anything if it is in ) and won't work like this. */ -# if __STDC__ extern void bpf_tap(struct ifnet *, u_char *, u_int); extern void bpf_mtap(struct ifnet *, struct mbuf *); extern void bpfattach(struct ifnet *, u_int, u_int); extern void bpfilterattach(int); -# else -extern void bpf_tap(); -extern void bpf_mtap(); -extern void bpfattach(); -extern void bpfilterattach(); -# endif /* __STDC__ */ #endif /* BSD && (_KERNEL || KERNEL) */ -#if __STDC__ || defined(__cplusplus) extern int bpf_validate(struct bpf_insn *, int); extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); -#else -extern int bpf_validate(); -extern u_int bpf_filter(); -#endif /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 05dcfa4afd64..834ba83f51f0 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -73,15 +73,7 @@ #include "opts.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #ifndef U_32_T diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index 0002db151c81..e66867e2a455 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -21,11 +21,7 @@ #include "ipf.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int opts; diff --git a/contrib/ipfilter/ipsend/ipsend.h b/contrib/ipfilter/ipsend/ipsend.h index f409e89c656e..22f85ff07f14 100644 --- a/contrib/ipfilter/ipsend/ipsend.h +++ b/contrib/ipfilter/ipsend/ipsend.h @@ -16,11 +16,7 @@ * */ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #include diff --git a/contrib/ipfilter/ipsend/ipsopt.c b/contrib/ipfilter/ipsend/ipsopt.c index 7f9ab5e32d79..ce6616525ca1 100644 --- a/contrib/ipfilter/ipsend/ipsopt.c +++ b/contrib/ipfilter/ipsend/ipsopt.c @@ -27,11 +27,7 @@ static const char rcsid[] = "@(#)$Id$"; #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif diff --git a/contrib/ipfilter/kmem.h b/contrib/ipfilter/kmem.h index ce6ad56f52d9..ea21c052599f 100644 --- a/contrib/ipfilter/kmem.h +++ b/contrib/ipfilter/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/debug.c b/contrib/ipfilter/lib/debug.c index 02e5f5b48775..0e3276e21705 100644 --- a/contrib/ipfilter/lib/debug.c +++ b/contrib/ipfilter/lib/debug.c @@ -8,11 +8,7 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" @@ -21,14 +17,8 @@ int debuglevel = 0; -#ifdef __STDC__ -void debug(int level, char *fmt, ...) -#else -void debug(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif +void +debug(int level, char *fmt, ...) { va_list pvar; @@ -40,13 +30,8 @@ void debug(level, fmt, va_alist) } -#ifdef __STDC__ -void ipfkdebug(char *fmt, ...) -#else -void ipfkdebug(fmt, va_alist) - char *fmt; - va_dcl -#endif +void +ipfkdebug(char *fmt, ...) { va_list pvar; diff --git a/contrib/ipfilter/lib/facpri.h b/contrib/ipfilter/lib/facpri.h index 54ecabd6ce49..d3634e99d795 100644 --- a/contrib/ipfilter/lib/facpri.h +++ b/contrib/ipfilter/lib/facpri.h @@ -13,11 +13,7 @@ #ifndef __P # define P_DEF -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern char *fac_toname __P((int)); diff --git a/contrib/ipfilter/lib/inet_addr.c b/contrib/ipfilter/lib/inet_addr.c index 8667c2b33038..fcaefe0fc23e 100644 --- a/contrib/ipfilter/lib/inet_addr.c +++ b/contrib/ipfilter/lib/inet_addr.c @@ -66,11 +66,7 @@ static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 #include #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif int inet_aton __P((const char *, struct in_addr *)); diff --git a/contrib/ipfilter/lib/kmem.c b/contrib/ipfilter/lib/kmem.c index de97512cf5d3..26252a02f0bf 100644 --- a/contrib/ipfilter/lib/kmem.c +++ b/contrib/ipfilter/lib/kmem.c @@ -30,10 +30,6 @@ #include "kmem.h" -#ifndef __STDC__ -# define const -#endif - #if !defined(lint) static const char sccsid[] = "@(#)kmem.c 1.4 1/12/96 (C) 1992 Darren Reed"; static const char rcsid[] = "@(#)$Id$"; diff --git a/contrib/ipfilter/lib/kmem.h b/contrib/ipfilter/lib/kmem.h index 1abe31a3b7fb..31cd9725cc62 100644 --- a/contrib/ipfilter/lib/kmem.h +++ b/contrib/ipfilter/lib/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/verbose.c b/contrib/ipfilter/lib/verbose.c index 710daab443e3..47988c084516 100644 --- a/contrib/ipfilter/lib/verbose.c +++ b/contrib/ipfilter/lib/verbose.c @@ -8,24 +8,14 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" #include "opts.h" -#if defined(__STDC__) void verbose(int level, char *fmt, ...) -#else -void verbose(level, fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; @@ -37,13 +27,7 @@ void verbose(level, fmt, va_alist) } -#if defined(__STDC__) void ipfkverbose(char *fmt, ...) -#else -void ipfkverbose(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; diff --git a/contrib/ipfilter/md5.c b/contrib/ipfilter/md5.c index 6ac639935902..d2ed954576d3 100644 --- a/contrib/ipfilter/md5.c +++ b/contrib/ipfilter/md5.c @@ -100,11 +100,7 @@ static unsigned char PADDING[64] = { (a) += (b); \ } -#ifdef __STDC__ #define UL(x) x##U -#else -#define UL(x) x -#endif /* The routine MD5Init initializes the message-digest context mdContext. All fields are set to zero. diff --git a/contrib/ipfilter/md5.h b/contrib/ipfilter/md5.h index 914df74355a0..cc09b48e8547 100644 --- a/contrib/ipfilter/md5.h +++ b/contrib/ipfilter/md5.h @@ -42,15 +42,7 @@ #if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H) #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif /* typedef a 32-bit type */ diff --git a/contrib/ipfilter/opts.h b/contrib/ipfilter/opts.h index 6e973186756e..17844e89ecfc 100644 --- a/contrib/ipfilter/opts.h +++ b/contrib/ipfilter/opts.h @@ -54,11 +54,7 @@ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #if defined(sun) && !SOLARIS diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 29590298d79f..ac20b527ab34 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -12,15 +12,7 @@ #define __IP_COMPAT_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #if defined(_KERNEL) || defined(KERNEL) || defined(__KERNEL__) @@ -63,11 +55,7 @@ #endif -# ifdef __STDC__ # define IPL_EXTERN(ep) ipl##ep -# else -# define IPL_EXTERN(ep) ipl/**/ep -# endif /* * This is a workaround for troubles on FreeBSD and OpenBSD. diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 7d70f5135da8..0c7448492464 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -31,14 +31,9 @@ #endif #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif -#if defined(__STDC__) || defined(__GNUC__) # define SIOCADAFR _IOW('r', 60, struct ipfobj) # define SIOCRMAFR _IOW('r', 61, struct ipfobj) # define SIOCSETFF _IOW('r', 62, u_int) @@ -78,47 +73,6 @@ # define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) # define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) # define SIOCIPFINTERROR _IOR('r', 98, int) -#else -# 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) -#endif #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR diff --git a/sys/contrib/ipfilter/netinet/ip_lookup.h b/sys/contrib/ipfilter/netinet/ip_lookup.h index 181e1bc5d176..6b1642a91ec0 100644 --- a/sys/contrib/ipfilter/netinet/ip_lookup.h +++ b/sys/contrib/ipfilter/netinet/ip_lookup.h @@ -8,7 +8,6 @@ #ifndef __IP_LOOKUP_H__ #define __IP_LOOKUP_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCLOOKUPADDTABLE _IOWR('r', 60, struct iplookupop) # define SIOCLOOKUPDELTABLE _IOWR('r', 61, struct iplookupop) # define SIOCLOOKUPSTAT _IOWR('r', 64, struct iplookupop) @@ -18,17 +17,6 @@ # define SIOCLOOKUPADDNODEW _IOW('r', 67, struct iplookupop) # define SIOCLOOKUPDELNODE _IOWR('r', 68, struct iplookupop) # define SIOCLOOKUPDELNODEW _IOW('r', 68, struct iplookupop) -#else -# define SIOCLOOKUPADDTABLE _IOWR(r, 60, struct iplookupop) -# define SIOCLOOKUPDELTABLE _IOWR(r, 61, struct iplookupop) -# define SIOCLOOKUPSTAT _IOWR(r, 64, struct iplookupop) -# define SIOCLOOKUPSTATW _IOW(r, 64, struct iplookupop) -# define SIOCLOOKUPFLUSH _IOWR(r, 65, struct iplookupflush) -# define SIOCLOOKUPADDNODE _IOWR(r, 67, struct iplookupop) -# define SIOCLOOKUPADDNODEW _IOW(r, 67, struct iplookupop) -# define SIOCLOOKUPDELNODE _IOWR(r, 68, struct iplookupop) -# define SIOCLOOKUPDELNODEW _IOW(r, 68, struct iplookupop) -#endif #define LOOKUP_POOL_MAX (IPL_LOGSIZE) #define LOOKUP_POOL_SZ (IPL_LOGSIZE + 1) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.h b/sys/contrib/ipfilter/netinet/ip_nat.h index e65b1681a5f5..e726bc926937 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.h +++ b/sys/contrib/ipfilter/netinet/ip_nat.h @@ -21,19 +21,11 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) #define SIOCADNAT _IOW('r', 60, struct ipfobj) #define SIOCRMNAT _IOW('r', 61, struct ipfobj) #define SIOCGNATS _IOWR('r', 62, struct ipfobj) #define SIOCGNATL _IOWR('r', 63, struct ipfobj) #define SIOCPURGENAT _IOWR('r', 100, struct ipfobj) -#else -#define SIOCADNAT _IOW(r, 60, struct ipfobj) -#define SIOCRMNAT _IOW(r, 61, struct ipfobj) -#define SIOCGNATS _IOWR(r, 62, struct ipfobj) -#define SIOCGNATL _IOWR(r, 63, struct ipfobj) -#define SIOCPURGENAT _IOWR(r, 100, struct ipfobj) -#endif #undef LARGE_NAT /* define this if you're setting up a system to NAT * LARGE numbers of networks/hosts - i.e. in the diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.h b/sys/contrib/ipfilter/netinet/ip_proxy.h index c6a77ba4ebee..3f4fc2a8af6f 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.h +++ b/sys/contrib/ipfilter/netinet/ip_proxy.h @@ -20,11 +20,7 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) #define SIOCPROXY _IOWR('r', 64, struct ap_control) -#else -#define SIOCPROXY _IOWR(r, 64, struct ap_control) -#endif #ifndef APR_LABELLEN #define APR_LABELLEN 16 diff --git a/sys/contrib/ipfilter/netinet/ip_scan.h b/sys/contrib/ipfilter/netinet/ip_scan.h index 99032095ba05..f15aeb844ac2 100644 --- a/sys/contrib/ipfilter/netinet/ip_scan.h +++ b/sys/contrib/ipfilter/netinet/ip_scan.h @@ -25,15 +25,9 @@ struct ip; struct ipstate; -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCADSCA _IOWR('r', 60, struct ipscan *) # define SIOCRMSCA _IOWR('r', 61, struct ipscan *) # define SIOCGSCST _IOWR('r', 62, struct ipscan *) -#else -# define SIOCADSCA _IOWR(r, 60, struct ipscan *) -# define SIOCRMSCA _IOWR(r, 61, struct ipscan *) -# define SIOCGSCST _IOWR(r, 62, struct ipscan *) -#endif struct action { int act_val; /* what to do */ diff --git a/sys/contrib/ipfilter/netinet/ip_state.h b/sys/contrib/ipfilter/netinet/ip_state.h index e765ac771538..e541cff52183 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.h +++ b/sys/contrib/ipfilter/netinet/ip_state.h @@ -12,11 +12,7 @@ #ifndef __IP_STATE_H__ #define __IP_STATE_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCDELST _IOW('r', 61, struct ipfobj) -#else -# define SIOCDELST _IOW(r, 61, struct ipfobj) -#endif struct ipscan; From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:47: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 A21BA4F4E98; Mon, 25 Jan 2021 22:47: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 4DPlNw48jjz3lkQ; Mon, 25 Jan 2021 22:47: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 811821EB01; Mon, 25 Jan 2021 22:47: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 10PMlCsF027281; Mon, 25 Jan 2021 22:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMlCUh027280; Mon, 25 Jan 2021 22:47:12 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:47:12 GMT Message-Id: <202101252247.10PMlCUh027280@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: 1fc148624f50 - main - Fix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. 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: 1fc148624f50cbf93365f6d56c6587a7d268195b 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, 25 Jan 2021 22:47:12 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1fc148624f50cbf93365f6d56c6587a7d268195b commit 1fc148624f50cbf93365f6d56c6587a7d268195b Author: Cy Schubert AuthorDate: 2021-01-25 22:34:22 +0000 Commit: Cy Schubert CommitDate: 2021-01-25 22:46:45 +0000 Fix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. bfc99943b04b46a6c1c885ce7bcc6f235b7422aa removed ndis(4) support however wpa as delivered by the wpa upstream (w1.fi) enables NDIS by default. This commit disables NDIS suppport in the w1.fi delivered build config, circumventing the build failure. --- contrib/wpa/src/utils/build_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/wpa/src/utils/build_config.h b/contrib/wpa/src/utils/build_config.h index c6f4e4379ae6..7d032373c8d3 100644 --- a/contrib/wpa/src/utils/build_config.h +++ b/contrib/wpa/src/utils/build_config.h @@ -26,8 +26,8 @@ #define PCSC_FUNCS #define CONFIG_CTRL_IFACE #define CONFIG_CTRL_IFACE_NAMED_PIPE -#define CONFIG_DRIVER_NDIS -#define CONFIG_NDIS_EVENTS_INTEGRATED +#undef CONFIG_DRIVER_NDIS +#undef CONFIG_NDIS_EVENTS_INTEGRATED #define CONFIG_DEBUG_FILE #define EAP_MD5 #define EAP_TLS From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:49: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 EEF754F5400 for ; Mon, 25 Jan 2021 22:49:19 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 4DPlRM6LGmz3mgf for ; Mon, 25 Jan 2021 22:49:19 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f53.google.com with SMTP id c12so14610096wrc.7 for ; Mon, 25 Jan 2021 14:49:19 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4C1LYfG7rXZDSgjAil+36i4m9noVPXSvBDlCsk9o894=; b=NmfvSqcBYHmXsAuN/kgv4ffB8dILGhp1jgi1XpvBvMi2PjW0Ut9b10D5/R3afOP4JZ e6igYpf4kxF4EWL/ggOmuZgoA8v+UsdqenLQn5JBOcNFxY364iikA/Vd+DD3mOOxONIt claBwsYyMK2dvX3+oHRxC1I/6XHDxXOBvrV8xy8ZRsfqvd7i+UYd6kJGZ7Jr2+/XFSnN H8pXZUQy5GBrIAzAukTyGa4DIPl2VLpMUzS9OA8k1P4xLwlw2NtOvDgTMwp5ZMD6vB32 DurJ2Yh/nXr/ZRw2Wgjm1ARbJICKSQpOxr/ktesNrBHGl17d8yMRNOTfZMuPsCx4RsrU 6g/w== X-Gm-Message-State: AOAM533gxPaBnywwjx4i1kyBrf/km/+1h3StB4R4BBhkreTAs6Y5/Gg/ SU0QEjQs2EV+AWjjnLz/ulffQg== X-Google-Smtp-Source: ABdhPJy9k6njzC/Hws8fo+9tV/oxvnEXbn7TNOO3J5K5ssvj4z6IbpFKU47B6KHaZPrYAf+igZoLEw== X-Received: by 2002:adf:de92:: with SMTP id w18mr3217925wrl.264.1611614958402; Mon, 25 Jan 2021 14:49:18 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id u5sm818470wmg.9.2021.01.25.14.49.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2021 14:49:17 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 83edbc3cb54f - main - ipfilter: Retire pre-standard C support. From: Jessica Clarke In-Reply-To: <202101252247.10PMlBd2027258@gitrepo.freebsd.org> Date: Mon, 25 Jan 2021 22:49:16 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: References: <202101252247.10PMlBd2027258@gitrepo.freebsd.org> To: Cy Schubert X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DPlRM6LGmz3mgf 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, 25 Jan 2021 22:49:20 -0000 Hi, On 25 Jan 2021, at 22:47, Cy Schubert wrote: > > diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h > index 05dcfa4afd64..834ba83f51f0 100644 > --- a/contrib/ipfilter/ipf.h > +++ b/contrib/ipfilter/ipf.h > @@ -73,15 +73,7 @@ > #include "opts.h" > > #ifndef __P > -# ifdef __STDC__ > # define __P(x) x There are a few cases like this where the indentation should be reduced (or just removed if it's no longer so confusing). Jess From owner-dev-commits-src-main@freebsd.org Mon Jan 25 22:52: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 BEBE54F5510 for ; Mon, 25 Jan 2021 22:52:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 4DPlVv4wq3z3n0F for ; Mon, 25 Jan 2021 22:52:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f50.google.com with SMTP id b5so14586653wrr.10 for ; Mon, 25 Jan 2021 14:52:23 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+3DaJ9LbExuSCKXEcy132v5R4homHwkNuwZ2Mszn7OA=; b=C2YtRO4RMSWwRXLyyIBZsHohv1XOBm7+BeWajZxHOd8s2KvzwUhWrDBYSg05fK1QPb DVJwuSsJUfXa+D7gtqid/AX7fV7itYQAGpjmBln3N6Kr+Z2N/wElT54OTyvOZuy1E4Lz o9k0Xr4o/QcGxOG/Y2/o0R812yM4/qJra9AMX8M5XUdlIiqrBOi6UV+06THpDkg4R63c XWsH4/yuoCjn1NdO/t6/Z1olpERYzGaWX8OPWUwxQAMrVF93Ak7LEQ4CV3R1BHZIC1rq AnUlxUW0qNVYLIVDCjRTcdMSwPffspqJoSYFOa8xJLWZvTAO9lhi+hc2D1rDQyh6KaR2 zvQQ== X-Gm-Message-State: AOAM5318mzRLfL5tMzUkj+VOjdb59gH+EEUpduE9nW2Ea88iPJFBsOo7 XkUQec69Q38J3vL5dOInnTfbeg== X-Google-Smtp-Source: ABdhPJweCS9bJtTnEVXBO9tmG/yl0cUnGc2Di8691D1fZHMFfRoL19cZrmu+5XgkjJaSgH6niOv0uw== X-Received: by 2002:a5d:4a50:: with SMTP id v16mr3169401wrs.241.1611615142172; Mon, 25 Jan 2021 14:52:22 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id m82sm705862wmf.29.2021.01.25.14.52.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2021 14:52:21 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: cc96f92a570e - main - atomic: make atomic_store_ptr type-aware From: Jessica Clarke In-Reply-To: <202101252242.10PMgZfO026271@gitrepo.freebsd.org> Date: Mon, 25 Jan 2021 22:52:21 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: References: <202101252242.10PMgZfO026271@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DPlVv4wq3z3n0F 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, 25 Jan 2021 22:52:23 -0000 On 25 Jan 2021, at 22:42, Mateusz Guzik wrote: > index a3548977b940..4c29d132c369 100644 > --- a/sys/sys/atomic_common.h > +++ b/sys/sys/atomic_common.h > @@ -58,7 +58,7 @@ > #define atomic_store_long(p, v) \ > (*(volatile u_long *)(p) = (u_long)(v)) > #define atomic_store_ptr(p, v) \ > - (*(volatile uintptr_t *)(p) = (uintptr_t)(v)) > + (*(volatile __typeof(*p) *)(p) = (v)) This is in fact general enough to be any of the atomic_store_*, and won't give any errors if you use it for a uint16_t (where it will store a uint16_t). Jess From owner-dev-commits-src-main@freebsd.org Mon Jan 25 23:07:08 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 9FD6A4F5D40; Mon, 25 Jan 2021 23:07:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 4DPlqw3w84z3pGD; Mon, 25 Jan 2021 23:07:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x329.google.com with SMTP id c127so1035349wmf.5; Mon, 25 Jan 2021 15:07:08 -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=/Mi1WrFisRSQKDSCQfxMEBw7yY6sfLxsEi/qT3Nh/Yc=; b=Atf8zVxbd++BBPuU1QYqrc1TZMwny2nH3OJ+/C7n6IMHzrdIFrLZGIHJuiMnb/9LFF abuV30tqfpQkXtsLLqsSyYD/GX37eVGphPHR8qkLEl0FESlzC/RnMyHZVEenDC2uIiDY T/kLZvhfDFmTZHetk2BWihwe8dHfc9ek+hx5zMTd9Y9zuOIVhO3wFhxovf+nWpfJxA7s kx4v9NErduELSAqxpaPGetaAIXNPoYUtr3oIRY7kUq6U75HWdae66sxPoOunDPip/X8p 4+qEdjhcrq2F6g2NPDUBpebFeAHxSFJEHyl+JxtPS9zIwHmTbEtG5AJNno6mQ5WnfThN mlHg== 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=/Mi1WrFisRSQKDSCQfxMEBw7yY6sfLxsEi/qT3Nh/Yc=; b=h620v8V7kz64xY5LthBJFxYDSlkUOHOylwzllopr6WN9+dtN0kev6DS7AUH9aFHypr Oy6N9w3EvkMQ8rCk/XvfOl3BtraQdl3bz7SNf1SCmzKAC5V4z8cTbhbT0m+WfWHkm5c/ OPNaFHtmEsjw/DjJP81tO/66BJhhchHhkxyXQ94pKIjgw4ZBcpVMGp6B9dr66qh1hS3w TU91elXRrUhTvilWMWOwZ7qPUJN1OD6Gy8MHVSJLhR+avvS4eSJrcczlwoMVsAdgvaiq Z3X17v6XfVIcNL5Qj/M6G4L3ppnReiZQopZ85+xUX5IAyBesqf+vRftuqEE4NtfxTF3z HR9Q== X-Gm-Message-State: AOAM531FKxb5XhVQmKG+ZiC33/w9kWaZW6ixAcIBJZQFaFFwkQy85PM1 ZJu82aX03LW6btQ+PqMKvQVIbu94ufiMB08zfa8wwLDLu64= X-Google-Smtp-Source: ABdhPJxrTLGmdHkHRXzndarO990SFaFmuGb89VY2qaH/7kYe6y8ZiAQJKkXQSHdVt8KaPiqE0Q4VZ4xQBn/chwZF9d4= X-Received: by 2002:a1c:bbc6:: with SMTP id l189mr2072422wmf.187.1611616026269; Mon, 25 Jan 2021 15:07:06 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Mon, 25 Jan 2021 15:07:05 -0800 (PST) In-Reply-To: References: <202101252242.10PMgZfO026271@gitrepo.freebsd.org> From: Mateusz Guzik Date: Tue, 26 Jan 2021 00:07:05 +0100 Message-ID: Subject: Re: git: cc96f92a570e - main - atomic: make atomic_store_ptr type-aware To: Jessica Clarke 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: 4DPlqw3w84z3pGD 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, 25 Jan 2021 23:07:08 -0000 On 1/25/21, Jessica Clarke wrote: > On 25 Jan 2021, at 22:42, Mateusz Guzik wrote: >> index a3548977b940..4c29d132c369 100644 >> --- a/sys/sys/atomic_common.h >> +++ b/sys/sys/atomic_common.h >> @@ -58,7 +58,7 @@ >> #define atomic_store_long(p, v) \ >> (*(volatile u_long *)(p) = (u_long)(v)) >> #define atomic_store_ptr(p, v) \ >> - (*(volatile uintptr_t *)(p) = (uintptr_t)(v)) >> + (*(volatile __typeof(*p) *)(p) = (v)) > > This is in fact general enough to be any of the atomic_store_*, and > won't give any errors if you use it for a uint16_t (where it will store > a uint16_t). > Unclear if you are suggesting validating that the passed thing is a pointer or replacing the rest. The former is useful, the latter is significantly more work. -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Mon Jan 25 23:09: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 1D7B74F6001; Mon, 25 Jan 2021 23:09:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 4DPltY4bw0z3pPp; Mon, 25 Jan 2021 23:09:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id 4Az3lLa552SWT4Az5ll9bF; Mon, 25 Jan 2021 16:09:24 -0700 X-Authority-Analysis: v=2.4 cv=fdJod2cF c=1 sm=1 tr=0 ts=600f4fa4 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=EpL3m9P00jwEYAFR2YEA:9 a=CjuIK1q_8ugA: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 AA2901995; Mon, 25 Jan 2021 15:09:19 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 10PN9JcL022164; Mon, 25 Jan 2021 15:09:19 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202101252309.10PN9JcL022164@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: Jessica Clarke cc: Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 83edbc3cb54f - main - ipfilter: Retire pre-standard C support. In-reply-to: References: <202101252247.10PMlBd2027258@gitrepo.freebsd.org> Comments: In-reply-to Jessica Clarke message dated "Mon, 25 Jan 2021 22:49:16 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 25 Jan 2021 15:09:19 -0800 X-CMAE-Envelope: MS4xfIRFn5XYsgBYsc1dA+XipIA8BKi+rJ5tgaBxhk9Lsw9UrFMyu8lnKUD6I2VJDrK+wsaEtRAA8uC68lUj/w6vwBT3dijkKtjkdBpmnWlZaz9mqYpkSsMg A3JYHp3V78pnaPiXXsVq8wp3LeyC0ksIKED3xEpHOYFn+Crqnl8bCXL7Ew/YkJeTH3lYVz8N+NADyR8lu18dO2lpMnKiiGs6Qo9KrczHbqr6Xf35qOeUnqZR WDW7LChrCXDXTQVWQ4NZ6ZHS2koNtbe+S4OyRG8Hd90/s6lGRSuavSW+JDwotELOkUvCPf5JVcyai0fZuhV2tPyvGgdxvo2Zi9adHbf7hUVBDqVyjYJnIikY 0gnC3+oO X-Rspamd-Queue-Id: 4DPltY4bw0z3pPp 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, 25 Jan 2021 23:09:26 -0000 In message , Jessica Clarke w rites: > Hi, > > On 25 Jan 2021, at 22:47, Cy Schubert wrote: > > > > diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h > > index 05dcfa4afd64..834ba83f51f0 100644 > > --- a/contrib/ipfilter/ipf.h > > +++ b/contrib/ipfilter/ipf.h > > @@ -73,15 +73,7 @@ > > #include "opts.h" > > > > #ifndef __P > > -# ifdef __STDC__ > > # define __P(x) x > > There are a few cases like this where the indentation should be reduced > (or just removed if it's no longer so confusing). There are a number of those in ipfilter, currently. Rather than confuse the functional changes with aesthetic changes, which makes it difficult for people to bisect history, I'll push those prior to the next batch of functional changes. -- 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 Mon Jan 25 23:38: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 F02B84F6993; Mon, 25 Jan 2021 23:38:03 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 4DPmWb5kl6z3r8P; Mon, 25 Jan 2021 23:38:03 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id B8C613C0199; Mon, 25 Jan 2021 23:37:57 +0000 (UTC) Date: Mon, 25 Jan 2021 23:37:57 +0000 From: Brooks Davis To: Cy Schubert Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1fc148624f50 - main - Fix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. Message-ID: <20210125233757.GC73987@spindle.one-eyed-alien.net> References: <202101252247.10PMlCUh027280@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vGgW1X5XWziG23Ko" Content-Disposition: inline In-Reply-To: <202101252247.10PMlCUh027280@gitrepo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4DPmWb5kl6z3r8P 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, 25 Jan 2021 23:38:04 -0000 --vGgW1X5XWziG23Ko Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thanks. I'd done a clean build in CI where wpa supplicant built so I'm not sure how I missed this. -- Brooks On Mon, Jan 25, 2021 at 10:47:12PM +0000, Cy Schubert wrote: > The branch main has been updated by cy: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1fc148624f50cbf93365f6d56c= 6587a7d268195b >=20 > commit 1fc148624f50cbf93365f6d56c6587a7d268195b > Author: Cy Schubert > AuthorDate: 2021-01-25 22:34:22 +0000 > Commit: Cy Schubert > CommitDate: 2021-01-25 22:46:45 +0000 >=20 > Fix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. > =20 > bfc99943b04b46a6c1c885ce7bcc6f235b7422aa removed ndis(4) support howe= ver > wpa as delivered by the wpa upstream (w1.fi) enables NDIS by default. > This commit disables NDIS suppport in the w1.fi delivered build confi= g, > circumventing the build failure. > --- > contrib/wpa/src/utils/build_config.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/contrib/wpa/src/utils/build_config.h b/contrib/wpa/src/utils= /build_config.h > index c6f4e4379ae6..7d032373c8d3 100644 > --- a/contrib/wpa/src/utils/build_config.h > +++ b/contrib/wpa/src/utils/build_config.h > @@ -26,8 +26,8 @@ > #define PCSC_FUNCS > #define CONFIG_CTRL_IFACE > #define CONFIG_CTRL_IFACE_NAMED_PIPE > -#define CONFIG_DRIVER_NDIS > -#define CONFIG_NDIS_EVENTS_INTEGRATED > +#undef CONFIG_DRIVER_NDIS > +#undef CONFIG_NDIS_EVENTS_INTEGRATED > #define CONFIG_DEBUG_FILE > #define EAP_MD5 > #define EAP_TLS >=20 --vGgW1X5XWziG23Ko Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJgD1ZUAAoJEKzQXbSebgfAzyYIAJ7Pn5ZOMmxjGtwEUQNzPSrl 1WK01FkyYri7iPbH6nntnI+9lIfAGgP1QH6/p+5jlxlfF2Z184y9xVzACrPgGl1Y GvSEHkrkNxwHqsoDW0p+UWzF109kHQGEQXOoW8DiHPYcUgsxjVNHDjHJVrLKV+87 +3UwBZiUzWvMHytDoG0cfn8DvpRq1zbdy7/PiD6Ez7qJ6tZkDowD+wHiKsRkbv18 ARPy/OAbRe/Mt8/WgwqkLjDblsPSONqLR8gHR5FW9EXYkTYtTg7s3o8fp72XhRX1 55lFocg7HD1RktKMVqfzGeOAvnFtVLBRSZiEyng3Hj0GBvw/K/vHUKU3EnOMiOw= =9ZMK -----END PGP SIGNATURE----- --vGgW1X5XWziG23Ko-- From owner-dev-commits-src-main@freebsd.org Mon Jan 25 23:56: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 080934F6E43 for ; Mon, 25 Jan 2021 23:56:41 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 4DPmx46RdRz3shv for ; Mon, 25 Jan 2021 23:56:40 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f54.google.com with SMTP id v15so14686766wrx.4 for ; Mon, 25 Jan 2021 15:56:40 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=M3ccVsV+TNwJD6X6QEo37EI1ysum4HezmNgQqKM9QDg=; b=Kb96g4glmi28Sl/ZkxghnGIVn0lDLCwatr4PQLJsB/joHrehS/eE7748gOhRq8wVdc 3hGW8LGNWmRizEVlH34qZXV5NREoUDlDvAJgOufrrBw7vEZaQVAoA/WrSMMWHfj9AWEF Equm6p3lFy5o7lShkDAjR1X7k+TuEYdUaEIUMUjFQrBddBLKAbM+BWf1gFAtjk7uE412 oiXuz98Fk5fm+wFxPVqqLhMGSPMEKsZXT8FSKnlY3iVqSNQtkmfER5TU+SUaxoSC9Hbm WX5S4pEvcf9dG0CoIEtVyBWvMAmkbJOkGMlnIrqrRkeddoTKZvjsU3I4Xp7PG1mYimrA tZZQ== X-Gm-Message-State: AOAM532O/E20rHE0v4I+0G9002AwDAEHLvSiNjC0kokMdPOWg1gyv+L/ M0UkGjVrE2EoDRB2GODVMpKVOIDmegXYOKhG X-Google-Smtp-Source: ABdhPJxhWQ9Oi/Ny7VchO1bLekajwVXyYeXYP8nLS1f+I234lT1rHxCzpkCUYXzOzYvXTirl/i2JIQ== X-Received: by 2002:adf:9cc4:: with SMTP id h4mr2181776wre.403.1611618999573; Mon, 25 Jan 2021 15:56:39 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id e12sm9584190wrs.67.2021.01.25.15.56.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2021 15:56:38 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 054ce2b03710 - main - atomic: add stub atomic_load_consume_ptr From: Jessica Clarke In-Reply-To: <202101252242.10PMgaWJ026291@gitrepo.freebsd.org> Date: Mon, 25 Jan 2021 23:56:37 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <18A79D6D-BCBE-4B6B-88F0-47931508C476@freebsd.org> References: <202101252242.10PMgaWJ026291@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DPmx46RdRz3shv 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, 25 Jan 2021 23:56:41 -0000 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 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: int x =3D atomic_load_consume_int(p); int y =3D q[x - x]; 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. 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. Jess From owner-dev-commits-src-main@freebsd.org Tue Jan 26 00:01: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 94B1F4F71D5; Tue, 26 Jan 2021 00:01:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (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 4DPn2y0rGGz3sRr; Tue, 26 Jan 2021 00:01:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id 4BnilLwzs2SWT4BnkllJsj; Mon, 25 Jan 2021 17:01:44 -0700 X-Authority-Analysis: v=2.4 cv=fdJod2cF c=1 sm=1 tr=0 ts=600f5be8 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=y3olD_i8AAAA:8 a=BYXJYoKzEvhoFlLBWowA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=2GdgqtpztZvaxdPX1XqS:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 864031A6E; Mon, 25 Jan 2021 16:01:41 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 10Q01ffs007336; Mon, 25 Jan 2021 16:01:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202101260001.10Q01ffs007336@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: Brooks Davis cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1fc148624f50 - main - Fix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. In-reply-to: <20210125233757.GC73987@spindle.one-eyed-alien.net> References: <202101252247.10PMlCUh027280@gitrepo.freebsd.org> <20210125233757.GC73987@spindle.one-eyed-alien.net> Comments: In-reply-to Brooks Davis message dated "Mon, 25 Jan 2021 23:37:57 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 25 Jan 2021 16:01:41 -0800 X-CMAE-Envelope: MS4xfPPB4HOi6c9zyklivDRN9AySzOl+6RS5gNyEM1Pnver/4PtEXBz2bbbafNYjbp2KmMUHsuJ4+uqP4q4YRzJz1etPFoXlBYHg9sWr5r/IKXsZ0wihHQ3P c9LU+8cx6au+5YzAHVmyprMauYIc9KL7CJ/cVnQcdcyHecK+tEVHKPIUMrVtwzmf1mcvS+OEtRct5W3P4iICKBG9ZknJdryNX3tIUw+4YRuWQoI49Z8FFzxz 3JHyJiMjvEp0ALRvMntANo9UjuSIOot/b07YFT6K/R0qyt7bXgXYkJoyf+jsqIqENMJEXiwJotesIybbyrv5YEkaX1LDHxiNUXwnJ91FhM3beNC5qsvQDAzx 1HCQEuhO X-Rspamd-Queue-Id: 4DPn2y0rGGz3sRr 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: Tue, 26 Jan 2021 00:01:46 -0000 No worries. I've committed an options change to the wpa_supplicant port as well and will push (git svn dcommit) it next time I get a chance. I'll need to think about moving build_config.h from contrib to usr.sbin/wpa to avoid confusing people when merging updates from the vendor. Simpler is better. -- 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. In message <20210125233757.GC73987@spindle.one-eyed-alien.net>, Brooks Davis wr ites: > > Thanks. I'd done a clean build in CI where wpa supplicant built so I'm > not sure how I missed this. > > -- Brooks > > On Mon, Jan 25, 2021 at 10:47:12PM +0000, Cy Schubert wrote: > > The branch main has been updated by cy: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1fc148624f50cbf93365f6d56c= > 6587a7d268195b > >=20 > > commit 1fc148624f50cbf93365f6d56c6587a7d268195b > > Author: Cy Schubert > > AuthorDate: 2021-01-25 22:34:22 +0000 > > Commit: Cy Schubert > > CommitDate: 2021-01-25 22:46:45 +0000 > >=20 > > Fix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. > > =20 > > bfc99943b04b46a6c1c885ce7bcc6f235b7422aa removed ndis(4) support howe= > ver > > wpa as delivered by the wpa upstream (w1.fi) enables NDIS by default. > > This commit disables NDIS suppport in the w1.fi delivered build confi= > g, > > circumventing the build failure. > > --- > > contrib/wpa/src/utils/build_config.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/contrib/wpa/src/utils/build_config.h b/contrib/wpa/src/utils= > /build_config.h > > index c6f4e4379ae6..7d032373c8d3 100644 > > --- a/contrib/wpa/src/utils/build_config.h > > +++ b/contrib/wpa/src/utils/build_config.h > > @@ -26,8 +26,8 @@ > > #define PCSC_FUNCS > > #define CONFIG_CTRL_IFACE > > #define CONFIG_CTRL_IFACE_NAMED_PIPE > > -#define CONFIG_DRIVER_NDIS > > -#define CONFIG_NDIS_EVENTS_INTEGRATED > > +#undef CONFIG_DRIVER_NDIS > > +#undef CONFIG_NDIS_EVENTS_INTEGRATED > > #define CONFIG_DEBUG_FILE > > #define EAP_MD5 > > #define EAP_TLS > >=20 From owner-dev-commits-src-main@freebsd.org Tue Jan 26 00:05: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 B3E904F78A0; Tue, 26 Jan 2021 00:05: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 4DPn7N4k9rz3tTn; Tue, 26 Jan 2021 00:05: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 90BF91F8C1; Tue, 26 Jan 2021 00:05: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 10Q05ast031057; Tue, 26 Jan 2021 00:05:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10Q05aQH031056; Tue, 26 Jan 2021 00:05:36 GMT (envelope-from git) Date: Tue, 26 Jan 2021 00:05:36 GMT Message-Id: <202101260005.10Q05aQH031056@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: b42a2ea5589f - main - Remove ndis(4) remnants from kernel configs 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: b42a2ea5589f86911643b3ce1ebeace5d1e2c1eb 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, 26 Jan 2021 00:05:36 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b42a2ea5589f86911643b3ce1ebeace5d1e2c1eb commit b42a2ea5589f86911643b3ce1ebeace5d1e2c1eb Author: Mateusz Guzik AuthorDate: 2021-01-26 00:04:13 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-26 00:04:13 +0000 Remove ndis(4) remnants from kernel configs Unbreaks LINT kernels. --- sys/amd64/conf/NOTES | 5 ----- sys/conf/options.amd64 | 1 - sys/conf/options.i386 | 1 - sys/i386/conf/NOTES | 4 ---- 4 files changed, 11 deletions(-) diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index 1b949fc24c8e..a1691f66a4cb 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -684,11 +684,6 @@ options VM_KMEM_SIZE options VM_KMEM_SIZE_MAX options VM_KMEM_SIZE_SCALE -# Enable NDIS binary driver support -options NDISAPI -device ndis - - # GCOV (code coverage) support options LINDEBUGFS diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64 index cd90747ba732..05b295647b6b 100644 --- a/sys/conf/options.amd64 +++ b/sys/conf/options.amd64 @@ -21,7 +21,6 @@ COMPAT_FREEBSD32 opt_global.h COMPAT_LINUX32 opt_compat.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h -NDISAPI opt_dontuse.h TIMER_FREQ opt_clock.h diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 73957449413f..011d787ec68c 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -25,7 +25,6 @@ COMPAT_AOUT opt_dontuse.h COMPAT_LINUX opt_dontuse.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h -NDISAPI opt_dontuse.h # Change KVM size. Changes things all over the kernel. KVA_PAGES opt_global.h diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 47626787cab9..12d607be5598 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -887,10 +887,6 @@ options LINPROCFS # and PSEUDOFS) options LINSYSFS -# Enable NDIS binary driver support -options NDISAPI -device ndis - ##################################################################### # VM OPTIONS From owner-dev-commits-src-main@freebsd.org Tue Jan 26 01:52: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 9A9404FB01E; Tue, 26 Jan 2021 01:52:22 +0000 (UTC) (envelope-from philip@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 4DPqVZ3vmqz4WFc; Tue, 26 Jan 2021 01:52:22 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [46.235.227.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 647154BA8; Tue, 26 Jan 2021 01:52:22 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [IPv6:2a01:4f9:2a:1715::1:1]) (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 "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 4DPqVY3MnVz1y8w; Tue, 26 Jan 2021 01:52:21 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 4DPqVX6lsGz6G7P; Tue, 26 Jan 2021 01:52:20 +0000 (UTC) Date: Tue, 26 Jan 2021 09:52:20 +0800 From: Philip Paeps To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 83edbc3cb54f - main - ipfilter: Retire pre-standard C support. Message-ID: Mail-Followup-To: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101252247.10PMlBd2027258@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <202101252247.10PMlBd2027258@gitrepo.freebsd.org> X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Sweetmorn, the 26th day of Chaos in the YOLD 3187 X-Phase-of-Moon: The Moon is Waxing Gibbous (92% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized 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, 26 Jan 2021 01:52:22 -0000 On 2021-01-25 22:47:11 (+0000), Cy Schubert wrote: > ipfilter: Retire pre-standard C support. > > All C compilers in 2021 support standard C and architectures that did > not were retired long ago. Simplify by removing now redundant > pre-standard C code. [...] > #ifndef __P >-# ifdef __STDC__ > # define __P(x) x >-# else >-# define __P(x) () >-# endif >-#endif You could simplify even further by getting rid of the __P() convention altogether. All our compilers support prototypes in 2021. :) Philip -- Philip Paeps Senior Reality Engineer Alternative Enterprises From owner-dev-commits-src-main@freebsd.org Tue Jan 26 03:32: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 BBBE04FD8BF; Tue, 26 Jan 2021 03:32:25 +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 4DPsk04YDzz4f28; Tue, 26 Jan 2021 03:32:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id 4F5YlgANfnRGt4F5aljwi6; Mon, 25 Jan 2021 20:32:22 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=600f8d46 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=kIYH8ehIrI99oz5jYvoA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 23458517; Mon, 25 Jan 2021 19:32:20 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 10Q3WKuW003844; Mon, 25 Jan 2021 19:32:20 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202101260332.10Q3WKuW003844@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: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 83edbc3cb54f - main - ipfilter: Retire pre-standard C support. In-reply-to: References: <202101252247.10PMlBd2027258@gitrepo.freebsd.org> Comments: In-reply-to Philip Paeps message dated "Tue, 26 Jan 2021 09:52:20 +0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 25 Jan 2021 19:32:20 -0800 X-CMAE-Envelope: MS4xfM6KRjvlZYwCvB1iKRmX8nLufmikc//0urbfTDk7JbED9o9e38GysfTFs2gu4WU+Yn3A45VLls0qhL8G8jaK9kxtJW4KwE628gJYIg3FNqsU+PyUqpp/ A5muwvPKvLMY/H17VN41xlikAIUh/BxHgW0ndFv3YzggTFDQwForihm4C7nk4ohL5gcNCgYiJaMDuHKQGwWJoPGubX/vVhGl7vvk0XBcqhoJQDRBskypOtuS cO/iDVEHFr1evmAQ93lKuQuP6zHkavGiK8fmMIPfB9MnWELnB5O+HRmlEx/lP07nd7AinKB7I/rdKhCdoUSBXILFA30kxA8zu0XlpppXr78= X-Rspamd-Queue-Id: 4DPsk04YDzz4f28 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.138) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.70 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.229.168:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.136.138:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_VERYGOOD(0.00)[64.59.136.138:from]; 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: Tue, 26 Jan 2021 03:32:25 -0000 In message , Philip Paeps writes: > On 2021-01-25 22:47:11 (+0000), Cy Schubert wrote: > > ipfilter: Retire pre-standard C support. > > > > All C compilers in 2021 support standard C and architectures that did > > not were retired long ago. Simplify by removing now redundant > > pre-standard C code. > > [...] > > > > #ifndef __P > >-# ifdef __STDC__ > > # define __P(x) x > >-# else > >-# define __P(x) () > >-# endif > >-#endif > > You could simplify even further by getting rid of the __P() convention > altogether. All our compilers support prototypes in 2021. :) Yes, it's in my queue. ANSI function definitions is in another branch. The last cleanup being style(9). -- 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 Tue Jan 26 04:34: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 899614FEE10; Tue, 26 Jan 2021 04:34: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 4DPv5p3N2qz4hvw; Tue, 26 Jan 2021 04:34: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 6685A2312E; Tue, 26 Jan 2021 04:34: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 10Q4Ycdj083243; Tue, 26 Jan 2021 04:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10Q4Yc4P083242; Tue, 26 Jan 2021 04:34:38 GMT (envelope-from git) Date: Tue, 26 Jan 2021 04:34:38 GMT Message-Id: <202101260434.10Q4Yc4P083242@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: 25cdacf79b06 - main - Import sqlite 3.34.1 (3340100). 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: 25cdacf79b06356c929e59d5074d26c9dac41bdf 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, 26 Jan 2021 04:34:38 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=25cdacf79b06356c929e59d5074d26c9dac41bdf commit 25cdacf79b06356c929e59d5074d26c9dac41bdf Author: Cy Schubert AuthorDate: 2021-01-25 17:45:04 +0000 Commit: Cy Schubert CommitDate: 2021-01-26 04:24:44 +0000 Import sqlite 3.34.1 (3340100). --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/ltmain.sh | 0 contrib/sqlite3/shell.c | 700 ++++++++- contrib/sqlite3/sqlite3.c | 2683 +++++++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 81 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- contrib/sqlite3/tea/win/makefile.vc | 2 +- 11 files changed, 2685 insertions(+), 829 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 9aed16a74091..0eedad3467dd 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.33.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.34.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.33.0' -PACKAGE_STRING='sqlite 3.33.0' +PACKAGE_VERSION='3.34.1' +PACKAGE_STRING='sqlite 3.34.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.33.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.34.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.33.0:";; + short | recursive ) echo "Configuration of sqlite 3.34.1:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.33.0 +sqlite configure 3.34.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.33.0, which was +It was created by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.33.0' + VERSION='3.34.1' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.33.0, which was +This file was extended by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.33.0 +sqlite config.status 3.34.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index a83dac3ac142..72472467d5b7 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.33.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.34.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/ltmain.sh b/contrib/sqlite3/ltmain.sh old mode 100755 new mode 100644 diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index a1a77e49fa5f..6f4fee80dc1c 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -571,8 +571,6 @@ static void utf8_width_print(FILE *pOut, int w, const char *zUtf){ int i; int n; int aw = w<0 ? -w : w; - char zBuf[1000]; - if( aw>(int)sizeof(zBuf)/3 ) aw = (int)sizeof(zBuf)/3; for(i=n=0; zUtf[i]; i++){ if( (zUtf[i]&0xc0)!=0x80 ){ n++; @@ -2016,9 +2014,11 @@ static void sha3QueryFunc( } nCol = sqlite3_column_count(pStmt); z = sqlite3_sql(pStmt); - n = (int)strlen(z); - hash_step_vformat(&cx,"S%d:",n); - SHA3Update(&cx,(unsigned char*)z,n); + if( z ){ + n = (int)strlen(z); + hash_step_vformat(&cx,"S%d:",n); + SHA3Update(&cx,(unsigned char*)z,n); + } /* Compute a hash over the result of the query */ while( SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -5315,6 +5315,444 @@ int sqlite3_ieee_init( } /************************* End ../ext/misc/ieee754.c ********************/ +/************************* Begin ../ext/misc/series.c ******************/ +/* +** 2015-08-18 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file demonstrates how to create a table-valued-function using +** a virtual table. This demo implements the generate_series() function +** which gives similar results to the eponymous function in PostgreSQL. +** Examples: +** +** SELECT * FROM generate_series(0,100,5); +** +** The query above returns integers from 0 through 100 counting by steps +** of 5. +** +** SELECT * FROM generate_series(0,100); +** +** Integers from 0 through 100 with a step size of 1. +** +** SELECT * FROM generate_series(20) LIMIT 10; +** +** Integers 20 through 29. +** +** HOW IT WORKS +** +** The generate_series "function" is really a virtual table with the +** following schema: +** +** CREATE TABLE generate_series( +** value, +** start HIDDEN, +** stop HIDDEN, +** step HIDDEN +** ); +** +** Function arguments in queries against this virtual table are translated +** into equality constraints against successive hidden columns. In other +** words, the following pairs of queries are equivalent to each other: +** +** SELECT * FROM generate_series(0,100,5); +** SELECT * FROM generate_series WHERE start=0 AND stop=100 AND step=5; +** +** SELECT * FROM generate_series(0,100); +** SELECT * FROM generate_series WHERE start=0 AND stop=100; +** +** SELECT * FROM generate_series(20) LIMIT 10; +** SELECT * FROM generate_series WHERE start=20 LIMIT 10; +** +** The generate_series virtual table implementation leaves the xCreate method +** set to NULL. This means that it is not possible to do a CREATE VIRTUAL +** TABLE command with "generate_series" as the USING argument. Instead, there +** is a single generate_series virtual table that is always available without +** having to be created first. +** +** The xBestIndex method looks for equality constraints against the hidden +** start, stop, and step columns, and if present, it uses those constraints +** to bound the sequence of generated values. If the equality constraints +** are missing, it uses 0 for start, 4294967295 for stop, and 1 for step. +** xBestIndex returns a small cost when both start and stop are available, +** and a very large cost if either start or stop are unavailable. This +** encourages the query planner to order joins such that the bounds of the +** series are well-defined. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include + +#ifndef SQLITE_OMIT_VIRTUALTABLE + + +/* series_cursor is a subclass of sqlite3_vtab_cursor which will +** serve as the underlying representation of a cursor that scans +** over rows of the result +*/ +typedef struct series_cursor series_cursor; +struct series_cursor { + sqlite3_vtab_cursor base; /* Base class - must be first */ + int isDesc; /* True to count down rather than up */ + sqlite3_int64 iRowid; /* The rowid */ + sqlite3_int64 iValue; /* Current value ("value") */ + sqlite3_int64 mnValue; /* Mimimum value ("start") */ + sqlite3_int64 mxValue; /* Maximum value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ +}; + +/* +** The seriesConnect() method is invoked to create a new +** series_vtab that describes the generate_series virtual table. +** +** Think of this routine as the constructor for series_vtab objects. +** +** All this routine needs to do is: +** +** (1) Allocate the series_vtab object and initialize all fields. +** +** (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the +** result set of queries against generate_series will look like. +*/ +static int seriesConnect( + sqlite3 *db, + void *pUnused, + int argcUnused, const char *const*argvUnused, + sqlite3_vtab **ppVtab, + char **pzErrUnused +){ + sqlite3_vtab *pNew; + int rc; + +/* Column numbers */ +#define SERIES_COLUMN_VALUE 0 +#define SERIES_COLUMN_START 1 +#define SERIES_COLUMN_STOP 2 +#define SERIES_COLUMN_STEP 3 + + (void)pUnused; + (void)argcUnused; + (void)argvUnused; + (void)pzErrUnused; + rc = sqlite3_declare_vtab(db, + "CREATE TABLE x(value,start hidden,stop hidden,step hidden)"); + if( rc==SQLITE_OK ){ + pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) ); + if( pNew==0 ) return SQLITE_NOMEM; + memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); + } + return rc; +} + +/* +** This method is the destructor for series_cursor objects. +*/ +static int seriesDisconnect(sqlite3_vtab *pVtab){ + sqlite3_free(pVtab); + return SQLITE_OK; +} + +/* +** Constructor for a new series_cursor object. +*/ +static int seriesOpen(sqlite3_vtab *pUnused, sqlite3_vtab_cursor **ppCursor){ + series_cursor *pCur; + (void)pUnused; + pCur = sqlite3_malloc( sizeof(*pCur) ); + if( pCur==0 ) return SQLITE_NOMEM; + memset(pCur, 0, sizeof(*pCur)); + *ppCursor = &pCur->base; + return SQLITE_OK; +} + +/* +** Destructor for a series_cursor. +*/ +static int seriesClose(sqlite3_vtab_cursor *cur){ + sqlite3_free(cur); + return SQLITE_OK; +} + + +/* +** Advance a series_cursor to its next row of output. +*/ +static int seriesNext(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + pCur->iValue -= pCur->iStep; + }else{ + pCur->iValue += pCur->iStep; + } + pCur->iRowid++; + return SQLITE_OK; +} + +/* +** Return values of columns for the row at which the series_cursor +** is currently pointing. +*/ +static int seriesColumn( + sqlite3_vtab_cursor *cur, /* The cursor */ + sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ + int i /* Which column to return */ +){ + series_cursor *pCur = (series_cursor*)cur; + sqlite3_int64 x = 0; + switch( i ){ + case SERIES_COLUMN_START: x = pCur->mnValue; break; + case SERIES_COLUMN_STOP: x = pCur->mxValue; break; + case SERIES_COLUMN_STEP: x = pCur->iStep; break; + default: x = pCur->iValue; break; + } + sqlite3_result_int64(ctx, x); + return SQLITE_OK; +} + +/* +** Return the rowid for the current row. In this implementation, the +** first row returned is assigned rowid value 1, and each subsequent +** row a value 1 more than that of the previous. +*/ +static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ + series_cursor *pCur = (series_cursor*)cur; + *pRowid = pCur->iRowid; + return SQLITE_OK; +} + +/* +** Return TRUE if the cursor has been moved off of the last +** row of output. +*/ +static int seriesEof(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + return pCur->iValue < pCur->mnValue; + }else{ + return pCur->iValue > pCur->mxValue; + } +} + +/* True to cause run-time checking of the start=, stop=, and/or step= +** parameters. The only reason to do this is for testing the +** constraint checking logic for virtual tables in the SQLite core. +*/ +#ifndef SQLITE_SERIES_CONSTRAINT_VERIFY +# define SQLITE_SERIES_CONSTRAINT_VERIFY 0 +#endif + +/* +** This method is called to "rewind" the series_cursor object back +** to the first row of output. This method is always called at least +** once prior to any call to seriesColumn() or seriesRowid() or +** seriesEof(). +** +** The query plan selected by seriesBestIndex is passed in the idxNum +** parameter. (idxStr is not used in this implementation.) idxNum +** is a bitmask showing which constraints are available: +** +** 1: start=VALUE +** 2: stop=VALUE +** 4: step=VALUE +** +** Also, if bit 8 is set, that means that the series should be output +** in descending order rather than in ascending order. +** +** This routine should initialize the cursor and position it so that it +** is pointing at the first row, or pointing off the end of the table +** (so that seriesEof() will return true) if the table is empty. +*/ +static int seriesFilter( + sqlite3_vtab_cursor *pVtabCursor, + int idxNum, const char *idxStrUnused, + int argc, sqlite3_value **argv +){ + series_cursor *pCur = (series_cursor *)pVtabCursor; + int i = 0; + (void)idxStrUnused; + if( idxNum & 1 ){ + pCur->mnValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mnValue = 0; + } + if( idxNum & 2 ){ + pCur->mxValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mxValue = 0xffffffff; + } + if( idxNum & 4 ){ + pCur->iStep = sqlite3_value_int64(argv[i++]); + if( pCur->iStep<1 ) pCur->iStep = 1; + }else{ + pCur->iStep = 1; + } + for(i=0; imnValue = 1; + pCur->mxValue = 0; + break; + } + } + if( idxNum & 8 ){ + pCur->isDesc = 1; + pCur->iValue = pCur->mxValue; + if( pCur->iStep>0 ){ + pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; + } + }else{ + pCur->isDesc = 0; + pCur->iValue = pCur->mnValue; + } + pCur->iRowid = 1; + return SQLITE_OK; +} + +/* +** SQLite will invoke this method one or more times while planning a query +** that uses the generate_series virtual table. This routine needs to create +** a query plan for each invocation and compute an estimated cost for that +** plan. +** +** In this implementation idxNum is used to represent the +** query plan. idxStr is unused. +** +** The query plan is represented by bits in idxNum: +** +** (1) start = $value -- constraint exists +** (2) stop = $value -- constraint exists +** (4) step = $value -- constraint exists +** (8) output in descending order +*/ +static int seriesBestIndex( + sqlite3_vtab *tabUnused, + sqlite3_index_info *pIdxInfo +){ + int i, j; /* Loop over constraints */ + int idxNum = 0; /* The query plan bitmask */ + int unusableMask = 0; /* Mask of unusable constraints */ + int nArg = 0; /* Number of arguments that seriesFilter() expects */ + int aIdx[3]; /* Constraints on start, stop, and step */ + const struct sqlite3_index_constraint *pConstraint; + + /* This implementation assumes that the start, stop, and step columns + ** are the last three columns in the virtual table. */ + assert( SERIES_COLUMN_STOP == SERIES_COLUMN_START+1 ); + assert( SERIES_COLUMN_STEP == SERIES_COLUMN_START+2 ); + (void)tabUnused; + aIdx[0] = aIdx[1] = aIdx[2] = -1; + pConstraint = pIdxInfo->aConstraint; + for(i=0; inConstraint; i++, pConstraint++){ + int iCol; /* 0 for start, 1 for stop, 2 for step */ + int iMask; /* bitmask for those column */ + if( pConstraint->iColumniColumn - SERIES_COLUMN_START; + assert( iCol>=0 && iCol<=2 ); + iMask = 1 << iCol; + if( pConstraint->usable==0 ){ + unusableMask |= iMask; + continue; + }else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ + idxNum |= iMask; + aIdx[iCol] = i; + } + } + for(i=0; i<3; i++){ + if( (j = aIdx[i])>=0 ){ + pIdxInfo->aConstraintUsage[j].argvIndex = ++nArg; + pIdxInfo->aConstraintUsage[j].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY; + } + } + if( (unusableMask & ~idxNum)!=0 ){ + /* The start, stop, and step columns are inputs. Therefore if there + ** are unusable constraints on any of start, stop, or step then + ** this plan is unusable */ + return SQLITE_CONSTRAINT; + } + if( (idxNum & 3)==3 ){ + /* Both start= and stop= boundaries are available. This is the + ** the preferred case */ + pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0)); + pIdxInfo->estimatedRows = 1000; + if( pIdxInfo->nOrderBy==1 ){ + if( pIdxInfo->aOrderBy[0].desc ) idxNum |= 8; + pIdxInfo->orderByConsumed = 1; + } + }else{ + /* If either boundary is missing, we have to generate a huge span + ** of numbers. Make this case very expensive so that the query + ** planner will work hard to avoid it. */ + pIdxInfo->estimatedRows = 2147483647; + } + pIdxInfo->idxNum = idxNum; + return SQLITE_OK; +} + +/* +** This following structure defines all the methods for the +** generate_series virtual table. +*/ +static sqlite3_module seriesModule = { + 0, /* iVersion */ + 0, /* xCreate */ + seriesConnect, /* xConnect */ + seriesBestIndex, /* xBestIndex */ + seriesDisconnect, /* xDisconnect */ + 0, /* xDestroy */ + seriesOpen, /* xOpen - open a cursor */ + seriesClose, /* xClose - close a cursor */ + seriesFilter, /* xFilter - configure scan constraints */ + seriesNext, /* xNext - advance a cursor */ + seriesEof, /* xEof - check for end of scan */ + seriesColumn, /* xColumn - read data */ + seriesRowid, /* xRowid - read data */ + 0, /* xUpdate */ + 0, /* xBegin */ + 0, /* xSync */ + 0, /* xCommit */ + 0, /* xRollback */ + 0, /* xFindMethod */ + 0, /* xRename */ + 0, /* xSavepoint */ + 0, /* xRelease */ + 0, /* xRollbackTo */ + 0 /* xShadowName */ +}; + +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + +#ifdef _WIN32 + +#endif +int sqlite3_series_init( + sqlite3 *db, + char **pzErrMsg, + const sqlite3_api_routines *pApi +){ + int rc = SQLITE_OK; + SQLITE_EXTENSION_INIT2(pApi); +#ifndef SQLITE_OMIT_VIRTUALTABLE + if( sqlite3_libversion_number()<3008012 ){ + *pzErrMsg = sqlite3_mprintf( + "generate_series() requires SQLite 3.8.12 or later"); + return SQLITE_ERROR; + } + rc = sqlite3_create_module(db, "generate_series", &seriesModule, 0); +#endif + return rc; +} + +/************************* End ../ext/misc/series.c ********************/ #ifdef SQLITE_HAVE_ZLIB /************************* Begin ../ext/misc/zipfile.c ******************/ /* @@ -5842,14 +6280,16 @@ static int zipfileAppendData( const u8 *aWrite, int nWrite ){ - size_t n; - fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); - n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); - if( (int)n!=nWrite ){ - pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); - return SQLITE_ERROR; + if( nWrite>0 ){ + size_t n = nWrite; + fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); + n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); + if( (int)n!=nWrite ){ + pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); + return SQLITE_ERROR; + } + pTab->szCurrent += nWrite; } - pTab->szCurrent += nWrite; return SQLITE_OK; } @@ -8494,6 +8934,7 @@ static int idxGetTableInfo( IdxTable *pNew = 0; int rc, rc2; char *pCsr = 0; + int nPk = 0; rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_info=%Q", zTab); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){ @@ -8504,6 +8945,7 @@ static int idxGetTableInfo( ); nByte += 1 + STRLEN(zCol); nCol++; + nPk += (sqlite3_column_int(p1, 5)>0); } rc2 = sqlite3_reset(p1); if( rc==SQLITE_OK ) rc = rc2; @@ -8523,7 +8965,7 @@ static int idxGetTableInfo( const char *zCol = (const char*)sqlite3_column_text(p1, 1); int nCopy = STRLEN(zCol) + 1; pNew->aCol[nCol].zName = pCsr; - pNew->aCol[nCol].iPk = sqlite3_column_int(p1, 5); + pNew->aCol[nCol].iPk = (sqlite3_column_int(p1, 5)==1 && nPk==1); memcpy(pCsr, zCol, nCopy); pCsr += nCopy; @@ -9528,10 +9970,12 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ idxFinalize(&rc, pIndexXInfo); idxFinalize(&rc, pWrite); - for(i=0; inSlot; i++){ - sqlite3_free(pCtx->aSlot[i].z); + if( pCtx ){ + for(i=0; inSlot; i++){ + sqlite3_free(pCtx->aSlot[i].z); + } + sqlite3_free(pCtx); } - sqlite3_free(pCtx); if( rc==SQLITE_OK ){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); @@ -10771,6 +11215,8 @@ struct ShellState { #define SHFLG_CountChanges 0x00000020 /* .changes setting */ #define SHFLG_Echo 0x00000040 /* .echo or --echo setting */ #define SHFLG_HeaderSet 0x00000080 /* .header has been used */ +#define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ +#define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ /* ** Macros for testing and setting shellFlgs @@ -13291,19 +13737,25 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ const char *zType; const char *zSql; ShellState *p = (ShellState *)pArg; + int dataOnly; + int noSys; UNUSED_PARAMETER(azNotUsed); if( nArg!=3 || azArg==0 ) return 0; zTable = azArg[0]; zType = azArg[1]; zSql = azArg[2]; + dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0; + noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0; - if( strcmp(zTable, "sqlite_sequence")==0 ){ - raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); - }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 ){ - raw_printf(p->out, "ANALYZE sqlite_schema;\n"); + if( strcmp(zTable, "sqlite_sequence")==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); + }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "ANALYZE sqlite_schema;\n"); }else if( strncmp(zTable, "sqlite_", 7)==0 ){ return 0; + }else if( dataOnly ){ + /* no-op */ }else if( strncmp(zSql, "CREATE VIRTUAL TABLE", 20)==0 ){ char *zIns; if( !p->writableSchema ){ @@ -13476,8 +13928,10 @@ static const char *(azHelp[]) = { ".dbinfo ?DB? Show status information about the database", ".dump ?TABLE? Render database content as SQL", " Options:", - " --preserve-rowids Include ROWID values in the output", + " --data-only Output only INSERT statements", " --newlines Allow unescaped newline characters in output", + " --nosys Omit system tables (ex: \"sqlite_stat1\")", + " --preserve-rowids Include ROWID values in the output", " TABLE is a LIKE pattern for the tables to dump", " Additional LIKE patterns can be given in subsequent arguments", ".echo on|off Turn command echo on or off", @@ -13602,8 +14056,9 @@ static const char *(azHelp[]) = { ".save FILE Write in-memory database into FILE", ".scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off", ".schema ?PATTERN? Show the CREATE statements matching PATTERN", - " Options:", - " --indent Try to pretty-print the schema", + " Options:", + " --indent Try to pretty-print the schema", + " --nosys Omit objects whose names start with \"sqlite_\"", ".selftest ?OPTIONS? Run tests defined in the SELFTEST table", " Options:", " --init Create a new SELFTEST table", @@ -14012,6 +14467,20 @@ static void shellIdQuote( } } +/* +** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X. +*/ +static void shellUSleepFunc( + sqlite3_context *context, + int argcUnused, + sqlite3_value **argv +){ + int sleep = sqlite3_value_int(argv[0]); + (void)argcUnused; + sqlite3_sleep(sleep/1000); + sqlite3_result_int(context, sleep); +} + /* ** Scalar function "shell_escape_crnl" used by the .recover command. ** The argument passed to this function is the output of built-in @@ -14176,6 +14645,7 @@ static void open_db(ShellState *p, int openFlags){ sqlite3_uint_init(p->db, 0, 0); sqlite3_decimal_init(p->db, 0, 0); sqlite3_ieee_init(p->db, 0, 0); + sqlite3_series_init(p->db, 0, 0); #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) sqlite3_dbdata_init(p->db, 0, 0); #endif @@ -14195,6 +14665,8 @@ static void open_db(ShellState *p, int openFlags){ shellInt32, 0, 0); sqlite3_create_function(p->db, "shell_idquote", 1, SQLITE_UTF8, 0, shellIdQuote, 0, 0); + sqlite3_create_function(p->db, "usleep",1,SQLITE_UTF8,0, + shellUSleepFunc, 0, 0); #ifndef SQLITE_NOHAVE_SYSTEM sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0, editFunc, 0, 0); @@ -17169,21 +17641,41 @@ static int do_meta_command(char *zLine, ShellState *p){ }else if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ - ShellState data; - char *zErrMsg = 0; + char **azName = 0; + int nName = 0; + sqlite3_stmt *pStmt; + int i; open_db(p, 0); - memcpy(&data, p, sizeof(data)); - data.showHeader = 0; - data.cMode = data.mode = MODE_List; - sqlite3_snprintf(sizeof(data.colSeparator),data.colSeparator,": "); - data.cnt = 0; - sqlite3_exec(p->db, "SELECT name, file FROM pragma_database_list", - callback, &data, &zErrMsg); - if( zErrMsg ){ - utf8_printf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); + rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0); + if( rc ){ + utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); rc = 1; + }else{ + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + const char *zSchema = (const char *)sqlite3_column_text(pStmt,1); + const char *zFile = (const char*)sqlite3_column_text(pStmt,2); + azName = sqlite3_realloc(azName, (nName+1)*2*sizeof(char*)); + if( azName==0 ){ shell_out_of_memory(); /* Does not return */ } + azName[nName*2] = strdup(zSchema); + azName[nName*2+1] = strdup(zFile); + nName++; + } } + sqlite3_finalize(pStmt); + for(i=0; idb, azName[i*2]); + int bRdonly = sqlite3_db_readonly(p->db, azName[i*2]); + const char *z = azName[i*2+1]; + utf8_printf(p->out, "%s: %s %s%s\n", + azName[i*2], + z && z[0] ? z : "\"\"", + bRdonly ? "r/o" : "r/w", + eTxn==SQLITE_TXN_NONE ? "" : + eTxn==SQLITE_TXN_READ ? " read-txn" : " write-txn"); + free(azName[i*2]); + free(azName[i*2+1]); + } + sqlite3_free(azName); }else if( c=='d' && n>=3 && strncmp(azArg[0], "dbconfig", n)==0 ){ @@ -17242,7 +17734,9 @@ static int do_meta_command(char *zLine, ShellState *p){ int i; int savedShowHeader = p->showHeader; int savedShellFlags = p->shellFlgs; - ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo); + ShellClearFlag(p, + SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo + |SHFLG_DumpDataOnly|SHFLG_DumpNoSys); for(i=1; iout, "PRAGMA foreign_keys=OFF;\n"); - raw_printf(p->out, "BEGIN TRANSACTION;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + /* When playing back a "dump", the content might appear in an order + ** which causes immediate foreign key constraints to be violated. + ** So disable foreign-key constraint enforcement to prevent problems. */ + raw_printf(p->out, "PRAGMA foreign_keys=OFF;\n"); + raw_printf(p->out, "BEGIN TRANSACTION;\n"); + } p->writableSchema = 0; p->showHeader = 0; /* Set writable_schema=ON since doing so forces SQLite to initialize @@ -17299,14 +17801,16 @@ static int do_meta_command(char *zLine, ShellState *p){ ); run_schema_dump_query(p,zSql); sqlite3_free(zSql); - zSql = sqlite3_mprintf( - "SELECT sql FROM sqlite_schema " - "WHERE (%s) AND sql NOT NULL" - " AND type IN ('index','trigger','view')", - zLike - ); - run_table_dump_query(p, zSql); - sqlite3_free(zSql); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + zSql = sqlite3_mprintf( + "SELECT sql FROM sqlite_schema " + "WHERE (%s) AND sql NOT NULL" + " AND type IN ('index','trigger','view')", + zLike + ); + run_table_dump_query(p, zSql); + sqlite3_free(zSql); + } sqlite3_free(zLike); if( p->writableSchema ){ raw_printf(p->out, "PRAGMA writable_schema=OFF;\n"); @@ -17314,7 +17818,9 @@ static int do_meta_command(char *zLine, ShellState *p){ } sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0); sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0); - raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + } p->showHeader = savedShowHeader; p->shellFlgs = savedShellFlags; }else @@ -17753,7 +18259,7 @@ static int do_meta_command(char *zLine, ShellState *p){ while( (nSkip--)>0 ){ while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){} } - zSql = sqlite3_mprintf("SELECT * FROM %s", zTable); + zSql = sqlite3_mprintf("SELECT * FROM \"%w\"", zTable); if( zSql==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); @@ -17762,7 +18268,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */ if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){ - char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable); + char *zCreate = sqlite3_mprintf("CREATE TABLE \"%w\"", zTable); char cSep = '('; while( xRead(&sCtx) ){ zCreate = sqlite3_mprintf("%z%c\n \"%w\" TEXT", zCreate, cSep, sCtx.z); @@ -17783,7 +18289,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_exec(p->db, zCreate, 0, 0, 0); sqlite3_free(zCreate); if( rc ){ - utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable, + utf8_printf(stderr, "CREATE TABLE \"%s\"(...) failed: %s\n", zTable, sqlite3_errmsg(p->db)); import_cleanup(&sCtx); rc = 1; @@ -18548,9 +19054,16 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = 1; goto meta_command_exit; } - if( notNormalFile(azArg[1]) - || (p->in = fopen(azArg[1], "rb"))==0 - ){ + if( azArg[1][0]=='|' ){ + p->in = popen(azArg[1]+1, "r"); + if( p->in==0 ){ + utf8_printf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); + rc = 1; + }else{ + rc = process_input(p); + pclose(p->in); + } + }else if( notNormalFile(azArg[1]) || (p->in = fopen(azArg[1], "rb"))==0 ){ utf8_printf(stderr,"Error: cannot open \"%s\"\n", azArg[1]); rc = 1; }else{ @@ -18632,6 +19145,7 @@ static int do_meta_command(char *zLine, ShellState *p){ const char *zName = 0; int iSchema = 0; int bDebug = 0; + int bNoSystemTabs = 0; int ii; open_db(p, 0); @@ -18644,10 +19158,16 @@ static int do_meta_command(char *zLine, ShellState *p){ data.cMode = data.mode = MODE_Pretty; }else if( optionMatch(azArg[ii],"debug") ){ bDebug = 1; + }else if( optionMatch(azArg[ii],"nosys") ){ + bNoSystemTabs = 1; + }else if( azArg[ii][0]=='-' ){ + utf8_printf(stderr, "Unknown option: \"%s\"\n", azArg[ii]); + rc = 1; + goto meta_command_exit; }else if( zName==0 ){ zName = azArg[ii]; }else{ - raw_printf(stderr, "Usage: .schema ?--indent? ?LIKE-PATTERN?\n"); + raw_printf(stderr, "Usage: .schema ?--indent? ?--nosys? ?LIKE-PATTERN?\n"); rc = 1; goto meta_command_exit; } @@ -18733,7 +19253,10 @@ static int do_meta_command(char *zLine, ShellState *p){ appendText(&sSelect, " AND ", 0); sqlite3_free(zQarg); } - appendText(&sSelect, "type!='meta' AND sql IS NOT NULL" + if( bNoSystemTabs ){ + appendText(&sSelect, "name NOT LIKE 'sqlite_%%' AND ", 0); + } + appendText(&sSelect, "sql IS NOT NULL" " ORDER BY snum, rowid", 0); if( bDebug ){ utf8_printf(p->out, "SQL: %s;\n", sSelect.z); @@ -19430,6 +19953,7 @@ static int do_meta_command(char *zLine, ShellState *p){ { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE, "" }, { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE, "" }, *** 5484 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Jan 26 12:24: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 E427A4EC6D1; Tue, 26 Jan 2021 12:24: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 4DQ5X56BvLz3kyJ; Tue, 26 Jan 2021 12:24: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 C7A431507; Tue, 26 Jan 2021 12:24:37 +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 10QCObLH095598; Tue, 26 Jan 2021 12:24:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QCOblA095597; Tue, 26 Jan 2021 12:24:37 GMT (envelope-from git) Date: Tue, 26 Jan 2021 12:24:37 GMT Message-Id: <202101261224.10QCOblA095597@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: 6943671b481e - main - cache: convert cache_fplookup_parse to void now that it always succeeds 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: 6943671b481e571f2f1ffbe407a4d75241d1174e 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, 26 Jan 2021 12:24:38 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6943671b481e571f2f1ffbe407a4d75241d1174e commit 6943671b481e571f2f1ffbe407a4d75241d1174e Author: Mateusz Guzik AuthorDate: 2021-01-26 00:40:47 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-26 12:24:03 +0000 cache: convert cache_fplookup_parse to void now that it always succeeds --- sys/kern/vfs_cache.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index a73e4843b5f3..72669449c26a 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5178,7 +5178,7 @@ cache_fplookup_preparse(struct cache_fpl *fpl) return (0); } -static int +static void cache_fplookup_parse(struct cache_fpl *fpl) { struct nameidata *ndp; @@ -5241,7 +5241,6 @@ cache_fplookup_parse(struct cache_fpl *fpl) panic("%s: ran into degenerate name from [%s]\n", __func__, cnp->cn_pnbuf); } #endif - return (0); } static void @@ -5426,10 +5425,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) } for (;;) { - error = cache_fplookup_parse(fpl); - if (__predict_false(error != 0)) { - break; - } + cache_fplookup_parse(fpl); error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred); if (__predict_false(error != 0)) { From owner-dev-commits-src-main@freebsd.org Tue Jan 26 13:04: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 ADC414EDF4C; Tue, 26 Jan 2021 13:04: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 4DQ6QQ4Zy5z3pJn; Tue, 26 Jan 2021 13:04: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 8F0BB1B25; Tue, 26 Jan 2021 13:04: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 10QD4kdQ047820; Tue, 26 Jan 2021 13:04:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QD4kBn047819; Tue, 26 Jan 2021 13:04:46 GMT (envelope-from git) Date: Tue, 26 Jan 2021 13:04:46 GMT Message-Id: <202101261304.10QD4kBn047819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: a86b0839d7bf - main - marvell: ap806_clock: add missing frequency modes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a86b0839d7bf3fc06b1ae9c50e055b53c50a9d0b 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, 26 Jan 2021 13:04:46 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=a86b0839d7bf3fc06b1ae9c50e055b53c50a9d0b commit a86b0839d7bf3fc06b1ae9c50e055b53c50a9d0b Author: Marcin Wojtas AuthorDate: 2021-01-26 10:49:35 +0000 Commit: Marcin Wojtas CommitDate: 2021-01-26 13:04:22 +0000 marvell: ap806_clock: add missing frequency modes In the driver init routine the CPU clock frequency value is obtained from a dedicated register. Until now only part of the values were handled by the mv_ap806_clock driver. Fix that by adding missing cases. Submitted by: Zyta Szpak MFC after: 1 week Obtained from: Semihalf Sponsored by: Marvell --- sys/arm/mv/mv_ap806_clock.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/arm/mv/mv_ap806_clock.c b/sys/arm/mv/mv_ap806_clock.c index 378640633c03..56041a48d312 100644 --- a/sys/arm/mv/mv_ap806_clock.c +++ b/sys/arm/mv/mv_ap806_clock.c @@ -136,25 +136,51 @@ mv_ap806_clock_attach(device_t dev) return (ENXIO); } - /* - * We might miss some combinations - * Those are the only possible ones on the mcbin - */ reg = RD4(sc, 0x400); switch (reg & 0x1f) { case 0x0: case 0x1: clock_freq = 2000000000; break; + case 0x4: + clock_freq = 1600000000; + break; case 0x6: clock_freq = 1800000000; break; + case 0x7: + clock_freq = 1800000000; + break; + case 0xb: + clock_freq = 1600000000; + break; case 0xd: clock_freq = 1600000000; break; + case 0x13: + clock_freq = 1000000000; + break; case 0x14: clock_freq = 1333000000; break; + case 0x17: + clock_freq = 1333000000; + break; + case 0x19: + clock_freq = 1200000000; + break; + case 0x1a: + clock_freq = 1400000000; + break; + case 0x1b: + clock_freq = 600000000; + break; + case 0x1c: + clock_freq = 800000000; + break; + case 0x1d: + clock_freq = 1000000000; + break; default: device_printf(dev, "Cannot guess clock freq with reg %x\n", reg & 0x1f); From owner-dev-commits-src-main@freebsd.org Tue Jan 26 15:01: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 D70754F222A; Tue, 26 Jan 2021 15:01: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 4DQ90f5pyVz4Vky; Tue, 26 Jan 2021 15:01: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 BA70336CE; Tue, 26 Jan 2021 15:01: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 10QF16XO000587; Tue, 26 Jan 2021 15:01:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QF16hV000586; Tue, 26 Jan 2021 15:01:06 GMT (envelope-from git) Date: Tue, 26 Jan 2021 15:01:06 GMT Message-Id: <202101261501.10QF16hV000586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 84761f3df508 - main - Adjust line length in tcp_prr_partialack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84761f3df508aed50783b60f028af9d98a684b41 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, 26 Jan 2021 15:01:06 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=84761f3df508aed50783b60f028af9d98a684b41 commit 84761f3df508aed50783b60f028af9d98a684b41 Author: Richard Scheffenegger AuthorDate: 2021-01-26 13:47:19 +0000 Commit: Richard Scheffenegger CommitDate: 2021-01-26 13:47:19 +0000 Adjust line length in tcp_prr_partialack Summary: Wrap lines before column 80 in new prr code checked in recently. No functional changes. Reviewers: tuexen, rrs, jtl, mm, kbowling, #transport Reviewed By: tuexen, mm, #transport Subscribers: imp, melifaro Differential Revision: https://reviews.freebsd.org/D28329 --- sys/netinet/tcp_input.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 75718352da00..4b8f91ed9d0b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3949,14 +3949,17 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) * Proportional Rate Reduction */ if (pipe > tp->snd_ssthresh) - snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / tp->sackhint.recover_fs) - - tp->sackhint.sack_bytes_rexmit; + snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / + tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit; else { if (V_tcp_do_prr_conservative) - limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; + limit = tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit; else - if ((tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit) > del_data) - limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit + maxseg; + if ((tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit) > del_data) + limit = tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit + maxseg; else limit = del_data + maxseg; snd_cnt = min((tp->snd_ssthresh - pipe), limit); From owner-dev-commits-src-main@freebsd.org Tue Jan 26 15:09: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 789E44F22F8; Tue, 26 Jan 2021 15:09: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 4DQ99r33SCz4WLM; Tue, 26 Jan 2021 15:09:04 +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 5B72B3895; Tue, 26 Jan 2021 15:09:04 +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 10QF94sp005232; Tue, 26 Jan 2021 15:09:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QF94iV005231; Tue, 26 Jan 2021 15:09:04 GMT (envelope-from git) Date: Tue, 26 Jan 2021 15:09:04 GMT Message-Id: <202101261509.10QF94iV005231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 6a376af0cd21 - main - TCP PRR: Patch div/0 in tcp_prr_partialack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a376af0cd212be4e16d013d35a0e2eec1dbb8ae 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, 26 Jan 2021 15:09:04 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=6a376af0cd212be4e16d013d35a0e2eec1dbb8ae commit 6a376af0cd212be4e16d013d35a0e2eec1dbb8ae Author: Richard Scheffenegger AuthorDate: 2021-01-26 15:06:32 +0000 Commit: Richard Scheffenegger CommitDate: 2021-01-26 15:06:32 +0000 TCP PRR: Patch div/0 in tcp_prr_partialack With clearing of recover_fs in bc7ee8e5bc555, div/0 was observed while processing partial_acks. Suspect that rewind of an erraneous RTO may be causing this - with the above change, recover_fs would no longer retained at the last calculated value, and reset. But CC_RTO_ERR can reenable IN_RECOVERY(), without setting this again. Adding a safety net prior to the division in that function, which I missed in D28114. --- sys/netinet/tcp_input.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 4b8f91ed9d0b..459b78cd444a 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -510,7 +510,6 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) } /* XXXLAS: EXIT_RECOVERY ? */ tp->t_bytes_acked = 0; - tp->sackhint.recover_fs = 0; } /* @@ -3948,10 +3947,13 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) /* * Proportional Rate Reduction */ - if (pipe > tp->snd_ssthresh) + if (pipe > tp->snd_ssthresh) { + if (tp->sackhint.recover_fs == 0) + tp->sackhint.recover_fs = + max(1, tp->snd_nxt - tp->snd_una); snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit; - else { + } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; From owner-dev-commits-src-main@freebsd.org Tue Jan 26 16:00: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 21D0A4F3CFB; Tue, 26 Jan 2021 16:00: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 4DQBJt0P4pz4b9X; Tue, 26 Jan 2021 16:00: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 0056E43E8; Tue, 26 Jan 2021 16:00: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 10QG0D0C074342; Tue, 26 Jan 2021 16:00:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QG0DpZ074330; Tue, 26 Jan 2021 16:00:13 GMT (envelope-from git) Date: Tue, 26 Jan 2021 16:00:13 GMT Message-Id: <202101261600.10QG0DpZ074330@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: cfd6422a5217 - main - netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type 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: cfd6422a5217410fbd66f7a7a8a64d9d85e61229 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, 26 Jan 2021 16:00:14 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=cfd6422a5217410fbd66f7a7a8a64d9d85e61229 commit cfd6422a5217410fbd66f7a7a8a64d9d85e61229 Author: Lutz Donnerhacke AuthorDate: 2021-01-26 15:50:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-01-26 15:53:24 +0000 netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type This node is part of an A10-NSP (L2-BSA) development. Carrier networks tend to stack three or more tags for internal purposes and therefore hiding the service tags deep inside of the stack. When decomposing such an access network frame, the processing order is typically reversed: First distinguish by service, than by other means. This new netgragh node allows to bring the relevant VLAN in front (to the out-most position). This way other netgraph nodes (like ng_vlan) can operate on this specific type. Reviewed by: manpages (gbe), brueffer (manpages), kp Approved by: kp (mentor) MFC after: 1 month Relnotes: yes Sponsored by: IKS Service GmbH Differential Revision: https://reviews.freebsd.org/D22076 --- share/man/man4/Makefile | 1 + share/man/man4/ng_vlan_rotate.4 | 252 +++++++++++++++ sys/conf/files | 1 + sys/modules/netgraph/Makefile | 3 +- sys/modules/netgraph/vlan_rotate/Makefile | 6 + sys/netgraph/ng_vlan_rotate.c | 510 ++++++++++++++++++++++++++++++ sys/netgraph/ng_vlan_rotate.h | 67 ++++ 7 files changed, 839 insertions(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 65f8bc817db3..9b6ec7998fc3 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -393,6 +393,7 @@ MAN= aac.4 \ ng_uni.4 \ ng_vjc.4 \ ng_vlan.4 \ + ng_vlan_rotate.4 \ nmdm.4 \ ${_ntb.4} \ ${_ntb_hw_amd.4} \ diff --git a/share/man/man4/ng_vlan_rotate.4 b/share/man/man4/ng_vlan_rotate.4 new file mode 100644 index 000000000000..4640737c7d54 --- /dev/null +++ b/share/man/man4/ng_vlan_rotate.4 @@ -0,0 +1,252 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2019-2021 IKS Service GmbH +.\" +.\" 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. +.\" +.\" Author: Lutz Donnerhacke +.\" +.\" $FreeBSD$ +.\" +.Dd January 26, 2021 +.Dt NG_VLAN_ROTATE 4 +.Os +.Sh NAME +.Nm ng_vlan_rotate +.Nd IEEE 802.1ad VLAN manipulation netgraph node type +.Sh SYNOPSIS +.In sys/types.h +.In netgraph.h +.In netgraph/ng_vlan_rotate.h +.Sh DESCRIPTION +The +.Nm +node type manipulates the order of VLAN tags of frames tagged +according to the IEEE 802.1ad (an extension of IEEE 802.1Q) standard +between different hooks. +.Pp +Each node has four special hooks, +.Va original , +.Va ordered , +.Va excessive , +and +.Va incomplete . +.Pp +A frame tagged with an arbitrary number of +.Dv ETHERTYPE_VLAN , +.Dv ETHERTYPE_QINQ , +and +.Dv 0x9100 +tags received on the +.Va original +hook will be rearranged to a new order of those tags and is sent out +the +.Dq ordered +hook. +After successful processing the +.Va histogram +counter for the observed stack size increments. +.Pp +If it contains fewer VLANs in the stack than the configured +.Va min +limit, the frame is sent out to the +.Va incomplete +hook and the +.Va incomplete +counter increments. +.Pp +If there are more VLANs in the stack than the configured +.Va max +limit, the frame is sent out to the +.Va excessive +hook and the +.Va excessive +counter increments. +.Pp +If the destination hook is not connected, the frame is dropped and the +.Va drops +counter increments. +.Pp +For Ethernet frames received on the +.Va ordered +hook, the transformation is reversed and is passed to the +.Va original +hook. +Please note that this process is identical to the one described +above, besides the ordered/original hooks are swapped and the +transformation is reversed. +.Pp +An Ethernet frame received on the +.Va incomplete +or +.Va excessive +hook is forwarded to the +.Va original +hook without any modification. +.Pp +This node supports only one operation at the moment: Rotation of the +VLANs in the stack. +Setting the configuration parameter +.Va rot +to a positive value, the stack will roll up by this amount. +Negative values will roll down. +A typical scenario is setting the value to 1 in order to bring the +innermost VLAN tag to the outmost level. +Rotation includes the VLAN id, the ether type, and the QOS parameters +pcp and cfi. +Typical QOS handling refers to the outmost setting, so be careful to +keep your QOS intact. +.Sh HOOKS +This node type supports the following hooks: +.Bl -tag -width incomplete +.It Va original +Typically this hook would be connected to a +.Xr ng_ether 4 +node, using the +.Va lower +hook connected to a carrier network. +.It Va ordered +Typically this hook would be connected to a +.Xr ng_vlan 4 +type node using the +.Va downstream +hook in order to separate services. +.It Va excessive +see below. +.It Va incomplete +Typically those hooks would be attached to a +.Xr ng_eiface 4 +type node using the +.Va ether +hook for anomaly monitoring purposes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_VLANROTATE_GET_CONF Pq Ic getconf +Read the current configuration. +.It Dv NGM_VLANROTATE_SET_CONF Pq Ic setconf +Set the current configuration. +.It Dv NGM_VLANROTATE_GET_STAT Pq Ic getstat +Read the current statistics. +.It Dv NGM_VLANROTATE_CLR_STAT Pq Ic clrstat +Zeroize the statistics. +.It Dv NGM_VLANROTATE_GETCLR_STAT Pq Ic getclrstat +Read the current statistics and zeroize it in one step. +.El +.Sh EXAMPLES +The first example demonstrates how to rotate double or triple tagged +frames so that the innermost C-VLAN can be used as service +discriminator. +The single or double tagged frames (C-VLAN removed) are sent out to an +interface pointing to different infrastucture. +.Bd -literal +#!/bin/sh + +BNG_IF=ixl3 +VOIP_IF=bge2 + +ngctl -f- < 00:01:02:03:04:05, + ethertype 802.1Q-9100 (0x9100), length 110: vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype 802.1Q, vlan 123, p 7, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The frame ejected on the +.Va ordered +hook will look like this: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q (0x8100), length 110: vlan 123, p 7, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +Hence, the frame pushed out to the +.Dv VOIP_IF +will have this form: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The second example distinguishes between double tagged and single +tagged frames. +.Bd -literal +#!/bin/sh + +IN_IF=bge1 + +ngctl -f- < diff --git a/sys/netgraph/ng_vlan_rotate.c b/sys/netgraph/ng_vlan_rotate.c new file mode 100644 index 000000000000..e6de782d9bb3 --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.c @@ -0,0 +1,510 @@ +/*- + * Spdx-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +/* + * This section contains the netgraph method declarations for the + * sample node. These methods define the netgraph 'type'. + */ + +static ng_constructor_t ng_vlanrotate_constructor; +static ng_rcvmsg_t ng_vlanrotate_rcvmsg; +static ng_shutdown_t ng_vlanrotate_shutdown; +static ng_newhook_t ng_vlanrotate_newhook; +static ng_rcvdata_t ng_vlanrotate_rcvdata; +static ng_disconnect_t ng_vlanrotate_disconnect; + +/* Parse type for struct ng_vlanrotate_conf */ +static const struct ng_parse_struct_field ng_vlanrotate_conf_fields[] = { + {"rot", &ng_parse_int8_type}, + {"min", &ng_parse_uint8_type}, + {"max", &ng_parse_uint8_type}, + {NULL} +}; +static const struct ng_parse_type ng_vlanrotate_conf_type = { + &ng_parse_struct_type, + &ng_vlanrotate_conf_fields +}; + +/* Parse type for struct ng_vlanrotate_stat */ +static struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info = { + &ng_parse_uint64_type, + NG_VLANROTATE_MAX_VLANS +}; +static struct ng_parse_type ng_vlanrotate_stat_hist = { + &ng_parse_fixedarray_type, + &ng_vlanrotate_stat_hist_info +}; +static const struct ng_parse_struct_field ng_vlanrotate_stat_fields[] = { + {"drops", &ng_parse_uint64_type}, + {"excessive", &ng_parse_uint64_type}, + {"incomplete", &ng_parse_uint64_type}, + {"histogram", &ng_vlanrotate_stat_hist}, + {NULL} +}; +static struct ng_parse_type ng_vlanrotate_stat_type = { + &ng_parse_struct_type, + &ng_vlanrotate_stat_fields +}; + + +/* List of commands and how to convert arguments to/from ASCII */ +static const struct ng_cmdlist ng_vlanrotate_cmdlist[] = { + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_CONF, + "getconf", + NULL, + &ng_vlanrotate_conf_type, + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_SET_CONF, + "setconf", + &ng_vlanrotate_conf_type, + NULL + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_STAT, + "getstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_CLR_STAT, + "clrstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GETCLR_STAT, + "getclrstat", + NULL, + &ng_vlanrotate_stat_type + }, + {0} +}; + +/* Netgraph node type descriptor */ +static struct ng_type typestruct = { + .version = NG_ABI_VERSION, + .name = NG_VLANROTATE_NODE_TYPE, + .constructor = ng_vlanrotate_constructor, + .rcvmsg = ng_vlanrotate_rcvmsg, + .shutdown = ng_vlanrotate_shutdown, + .newhook = ng_vlanrotate_newhook, + .rcvdata = ng_vlanrotate_rcvdata, + .disconnect = ng_vlanrotate_disconnect, + .cmdlist = ng_vlanrotate_cmdlist, +}; +NETGRAPH_INIT(vlanrotate, &typestruct); + +struct ng_vlanrotate_kernel_stats { + counter_u64_t drops, excessive, incomplete; + counter_u64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Information we store for each node */ +struct vlanrotate { + hook_p original_hook; + hook_p ordered_hook; + hook_p excessive_hook; + hook_p incomplete_hook; + struct ng_vlanrotate_conf conf; + struct ng_vlanrotate_kernel_stats stats; +}; +typedef struct vlanrotate *vlanrotate_p; + +/* + * Set up the private data structure. + */ +static int +ng_vlanrotate_constructor(node_p node) +{ + int i; + + vlanrotate_p vrp = malloc(sizeof(*vrp), M_NETGRAPH, M_WAITOK | M_ZERO); + + vrp->conf.max = NG_VLANROTATE_MAX_VLANS; + + vrp->stats.drops = counter_u64_alloc(M_WAITOK); + vrp->stats.excessive = counter_u64_alloc(M_WAITOK); + vrp->stats.incomplete = counter_u64_alloc(M_WAITOK); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + vrp->stats.histogram[i] = counter_u64_alloc(M_WAITOK); + + NG_NODE_SET_PRIVATE(node, vrp); + return (0); +} + +/* + * Give our ok for a hook to be added. + */ +static int +ng_vlanrotate_newhook(node_p node, hook_p hook, const char *name) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + hook_p *dst = NULL; + + if (strcmp(name, NG_VLANROTATE_HOOK_ORDERED) == 0) { + dst = &vrp->ordered_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_ORIGINAL) == 0) { + dst = &vrp->original_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_EXCESSIVE) == 0) { + dst = &vrp->excessive_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_INCOMPLETE) == 0) { + dst = &vrp->incomplete_hook; + } else + return (EINVAL); /* not a hook we know about */ + + if (*dst != NULL) + return (EADDRINUSE); /* don't override */ + + *dst = hook; + return (0); +} + +/* + * Get a netgraph control message. + * A response is not required. + */ +static int +ng_vlanrotate_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + struct ng_mesg *resp = NULL; + struct ng_mesg *msg; + struct ng_vlanrotate_conf *pcf; + int error = 0; + + NGI_GET_MSG(item, msg); + /* Deal with message according to cookie and command */ + switch (msg->header.typecookie) { + case NGM_VLANROTATE_COOKIE: + switch (msg->header.cmd) { + case NGM_VLANROTATE_GET_CONF: + NG_MKRESPONSE(resp, msg, sizeof(vrp->conf), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + *((struct ng_vlanrotate_conf *)resp->data) = vrp->conf; + break; + case NGM_VLANROTATE_SET_CONF: + if (msg->header.arglen != sizeof(*pcf)) { + error = EINVAL; + break; + } + + pcf = (struct ng_vlanrotate_conf *)msg->data; + + if (pcf->max == 0) /* keep current value */ + pcf->max = vrp->conf.max; + + if ((pcf->max > NG_VLANROTATE_MAX_VLANS) || + (pcf->min > pcf->max) || + (abs(pcf->rot) >= pcf->max)) { + error = EINVAL; + break; + } + + vrp->conf = *pcf; + break; + case NGM_VLANROTATE_GET_STAT: + case NGM_VLANROTATE_GETCLR_STAT: + { + struct ng_vlanrotate_stat *p; + int i; + + NG_MKRESPONSE(resp, msg, sizeof(*p), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + p = (struct ng_vlanrotate_stat *)resp->data; + p->drops = counter_u64_fetch(vrp->stats.drops); + p->excessive = counter_u64_fetch(vrp->stats.excessive); + p->incomplete = counter_u64_fetch(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + p->histogram[i] = counter_u64_fetch(vrp->stats.histogram[i]); + if (msg->header.cmd != NGM_VLANROTATE_GETCLR_STAT) + break; + } + case NGM_VLANROTATE_CLR_STAT: + { + int i; + + counter_u64_zero(vrp->stats.drops); + counter_u64_zero(vrp->stats.excessive); + counter_u64_zero(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_zero(vrp->stats.histogram[i]); + break; + } + default: + error = EINVAL; /* unknown command */ + break; + } + break; + default: + error = EINVAL; /* unknown cookie type */ + break; + } + + /* Take care of synchronous response, if any */ + NG_RESPOND_MSG(error, node, item, resp); + /* Free the message and return */ + NG_FREE_MSG(msg); + return (error); +} + +/* + * Receive data, and do rotate the vlans as desired. + * + * Rotating is quite complicated if the rotation offset and the number + * of vlans are not relativly prime. In this case multiple slices need + * to be rotated separately. + * + * Rotation can be additive or subtractive. Some examples: + * 01234 5 vlans given + * ----- + * 34012 +2 rotate + * 12340 +4 rotate + * 12340 -1 rotate + * + * First some helper functions ... + */ + +struct ether_vlan_stack_entry { + uint16_t proto; + uint16_t tag; +} __packed; + +struct ether_vlan_stack_header { + uint8_t dst[ETHER_ADDR_LEN]; + uint8_t src[ETHER_ADDR_LEN]; + struct ether_vlan_stack_entry vlan_stack[1]; +} __packed; + +static int +ng_vlanrotate_gcd(int a, int b) +{ + if (b == 0) + return a; + else + return ng_vlanrotate_gcd(b, a % b); +} + +static void +ng_vlanrotate_rotate(struct ether_vlan_stack_entry arr[], int d, int n) +{ + int i, j, k; + struct ether_vlan_stack_entry temp; + + /* for each commensurable slice */ + for (i = ng_vlanrotate_gcd(d, n); i-- > 0;) { + /* rotate left aka downwards */ + temp = arr[i]; + j = i; + + while (1) { + k = j + d; + if (k >= n) + k = k - n; + if (k == i) + break; + arr[j] = arr[k]; + j = k; + } + + arr[j] = temp; + } +} + +static int +ng_vlanrotate_rcvdata(hook_p hook, item_p item) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct ether_vlan_stack_header *evsh; + struct mbuf *m = NULL; + hook_p dst_hook; + int8_t rotate; + int8_t vlans = 0; + int error = ENOSYS; + + NGI_GET_M(item, m); + + if (hook == vrp->ordered_hook) { + rotate = +vrp->conf.rot; + dst_hook = vrp->original_hook; + } else if (hook == vrp->original_hook) { + rotate = -vrp->conf.rot; + dst_hook = vrp->ordered_hook; + } else { + dst_hook = vrp->original_hook; + goto send; /* everything else goes out unmodified */ + } + + if (dst_hook == NULL) { + error = ENETDOWN; + goto fail; + } + + /* count the vlans */ + for (vlans = 0; vlans <= NG_VLANROTATE_MAX_VLANS; vlans++) { + size_t expected_len = sizeof(struct ether_vlan_stack_header) + + vlans * sizeof(struct ether_vlan_stack_entry); + + if (m->m_len < expected_len) { + m = m_pullup(m, expected_len); + if (m == NULL) { + error = EINVAL; + goto fail; + } + } + + evsh = mtod(m, struct ether_vlan_stack_header *); + switch (ntohs(evsh->vlan_stack[vlans].proto)) { + case ETHERTYPE_VLAN: + case ETHERTYPE_QINQ: + case ETHERTYPE_8021Q9100: + case ETHERTYPE_8021Q9200: + case ETHERTYPE_8021Q9300: + break; + default: + goto out; + } + } +out: + if ((vlans > vrp->conf.max) || (vlans >= NG_VLANROTATE_MAX_VLANS)) { + counter_u64_add(vrp->stats.excessive, 1); + dst_hook = vrp->excessive_hook; + goto send; + } + + if ((vlans < vrp->conf.min) || (vlans <= abs(rotate))) { + counter_u64_add(vrp->stats.incomplete, 1); + dst_hook = vrp->incomplete_hook; + goto send; + } + counter_u64_add(vrp->stats.histogram[vlans], 1); + + /* rotating upwards always (using modular arithmetics) */ + if (rotate == 0) { + /* nothing to do */ + } else if (rotate > 0) { + ng_vlanrotate_rotate(evsh->vlan_stack, rotate, vlans); + } else { + ng_vlanrotate_rotate(evsh->vlan_stack, vlans + rotate, vlans); + } + +send: + if (dst_hook == NULL) + goto fail; + NG_FWD_NEW_DATA(error, item, dst_hook, m); + return 0; + +fail: + counter_u64_add(vrp->stats.drops, 1); + if (m != NULL) + m_freem(m); + NG_FREE_ITEM(item); + return (error); +} + +/* + * Do local shutdown processing.. + * All our links and the name have already been removed. + */ +static int +ng_vlanrotate_shutdown(node_p node) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + int i; + + NG_NODE_SET_PRIVATE(node, NULL); + + counter_u64_free(vrp->stats.drops); + counter_u64_free(vrp->stats.excessive); + counter_u64_free(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_free(vrp->stats.histogram[i]); + + free(vrp, M_NETGRAPH); + + NG_NODE_UNREF(node); + return (0); +} + +/* + * Hook disconnection + * For this type, removal of the last link destroys the node + */ +static int +ng_vlanrotate_disconnect(hook_p hook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (vrp->original_hook == hook) + vrp->original_hook = NULL; + if (vrp->ordered_hook == hook) + vrp->ordered_hook = NULL; + if (vrp->excessive_hook == hook) + vrp->excessive_hook = NULL; + if (vrp->incomplete_hook == hook) + vrp->incomplete_hook = NULL; + + /* during shutdown the node is invalid, don't shutdown twice */ + if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) && + (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) + ng_rmnode_self(NG_HOOK_NODE(hook)); + return (0); +} diff --git a/sys/netgraph/ng_vlan_rotate.h b/sys/netgraph/ng_vlan_rotate.h new file mode 100644 index 000000000000..ef6dfd6b506a --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.h @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_NG_VLAN_ROTATE_H_ +#define _NETGRAPH_NG_VLAN_ROTATE_H_ + +#define NG_VLANROTATE_NODE_TYPE "vlan_rotate" +#define NGM_VLANROTATE_COOKIE 1568378766 + +/* Hook names */ +#define NG_VLANROTATE_HOOK_ORDERED "ordered" +#define NG_VLANROTATE_HOOK_ORIGINAL "original" +#define NG_VLANROTATE_HOOK_EXCESSIVE "excessive" +#define NG_VLANROTATE_HOOK_INCOMPLETE "incomplete" + +/* Limits */ +#define NG_VLANROTATE_MAX_VLANS 10 + +/* Datastructures for netgraph commands */ +struct ng_vlanrotate_conf { + int8_t rot; + uint8_t min, max; +}; + +struct ng_vlanrotate_stat { + uint64_t drops, excessive, incomplete; + uint64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Netgraph commands understood by this node type */ +enum { + NGM_VLANROTATE_GET_CONF = 1, + NGM_VLANROTATE_SET_CONF, + NGM_VLANROTATE_GET_STAT, + NGM_VLANROTATE_CLR_STAT, + NGM_VLANROTATE_GETCLR_STAT +}; + +#endif /* _NETGRAPH_NG_VLAN_ROTATE_H_ */ From owner-dev-commits-src-main@freebsd.org Tue Jan 26 16:09: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 BFB814F45C8; Tue, 26 Jan 2021 16:09:13 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQBWF4NNgz4bsq; Tue, 26 Jan 2021 16:09:12 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2a02:8109:1140:c3d:8cdb:3c2b:1f77:6217] (unknown [IPv6:2a02:8109:1140:c3d:8cdb:3c2b:1f77:6217]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 4F33A721BE016; Tue, 26 Jan 2021 17:09:09 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: git: 84761f3df508 - main - Adjust line length in tcp_prr_partialack From: Michael Tuexen In-Reply-To: <202101261501.10QF16hV000586@gitrepo.freebsd.org> Date: Tue, 26 Jan 2021 17:09:08 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <84A0BAE9-0553-4D19-9F48-535A4B9473D3@macmic.franken.de> References: <202101261501.10QF16hV000586@gitrepo.freebsd.org> To: Richard Scheffenegger X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4DQBWF4NNgz4bsq 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: Tue, 26 Jan 2021 16:09:13 -0000 > On 26. Jan 2021, at 16:01, Richard Scheffenegger = wrote: >=20 > The branch main has been updated by rscheff: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D84761f3df508aed50783b60f028af9d9= 8a684b41 >=20 > commit 84761f3df508aed50783b60f028af9d98a684b41 > Author: Richard Scheffenegger > AuthorDate: 2021-01-26 13:47:19 +0000 > Commit: Richard Scheffenegger > CommitDate: 2021-01-26 13:47:19 +0000 >=20 > Adjust line length in tcp_prr_partialack >=20 > Summary: > Wrap lines before column 80 in new prr code checked in recently. >=20 > No functional changes. >=20 > Reviewers: tuexen, rrs, jtl, mm, kbowling, #transport >=20 > Reviewed By: tuexen, mm, #transport >=20 > Subscribers: imp, melifaro >=20 > Differential Revision: https://reviews.freebsd.org/D28329 Any plans to MFC this to stable/13? Best regards Michael > --- > sys/netinet/tcp_input.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c > index 75718352da00..4b8f91ed9d0b 100644 > --- a/sys/netinet/tcp_input.c > +++ b/sys/netinet/tcp_input.c > @@ -3949,14 +3949,17 @@ tcp_prr_partialack(struct tcpcb *tp, struct = tcphdr *th) > * Proportional Rate Reduction > */ > if (pipe > tp->snd_ssthresh) > - snd_cnt =3D (tp->sackhint.prr_delivered * = tp->snd_ssthresh / tp->sackhint.recover_fs) - > - tp->sackhint.sack_bytes_rexmit; > + snd_cnt =3D (tp->sackhint.prr_delivered * = tp->snd_ssthresh / > + tp->sackhint.recover_fs) - = tp->sackhint.sack_bytes_rexmit; > else { > if (V_tcp_do_prr_conservative) > - limit =3D tp->sackhint.prr_delivered - = tp->sackhint.sack_bytes_rexmit; > + limit =3D tp->sackhint.prr_delivered - > + tp->sackhint.sack_bytes_rexmit; > else > - if ((tp->sackhint.prr_delivered - = tp->sackhint.sack_bytes_rexmit) > del_data) > - limit =3D tp->sackhint.prr_delivered - = tp->sackhint.sack_bytes_rexmit + maxseg; > + if ((tp->sackhint.prr_delivered - > + tp->sackhint.sack_bytes_rexmit) > del_data) > + limit =3D tp->sackhint.prr_delivered - > + tp->sackhint.sack_bytes_rexmit + = maxseg; > else > limit =3D del_data + maxseg; > snd_cnt =3D min((tp->snd_ssthresh - pipe), limit); From owner-dev-commits-src-main@freebsd.org Tue Jan 26 16:10: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 9B8B14F4784; Tue, 26 Jan 2021 16:10:50 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQBY63SLMz4c9W; Tue, 26 Jan 2021 16:10:50 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2a02:8109:1140:c3d:8cdb:3c2b:1f77:6217] (unknown [IPv6:2a02:8109:1140:c3d:8cdb:3c2b:1f77:6217]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id F25F4721BE016; Tue, 26 Jan 2021 17:10:39 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: git: 6a376af0cd21 - main - TCP PRR: Patch div/0 in tcp_prr_partialack From: Michael Tuexen In-Reply-To: <202101261509.10QF94iV005231@gitrepo.freebsd.org> Date: Tue, 26 Jan 2021 17:10:39 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7F802CA2-DD8B-42E0-9DDA-559AF5EF3BB3@macmic.franken.de> References: <202101261509.10QF94iV005231@gitrepo.freebsd.org> To: Richard Scheffenegger X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4DQBY63SLMz4c9W 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: Tue, 26 Jan 2021 16:10:50 -0000 > On 26. Jan 2021, at 16:09, Richard Scheffenegger = wrote: >=20 > The branch main has been updated by rscheff: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6a376af0cd212be4e16d013d35a0e2ee= c1dbb8ae >=20 > commit 6a376af0cd212be4e16d013d35a0e2eec1dbb8ae > Author: Richard Scheffenegger > AuthorDate: 2021-01-26 15:06:32 +0000 > Commit: Richard Scheffenegger > CommitDate: 2021-01-26 15:06:32 +0000 >=20 > TCP PRR: Patch div/0 in tcp_prr_partialack >=20 > With clearing of recover_fs in bc7ee8e5bc555, div/0 > was observed while processing partial_acks. >=20 > Suspect that rewind of an erraneous RTO may be > causing this - with the above change, recover_fs > would no longer retained at the last calculated > value, and reset. But CC_RTO_ERR can reenable > IN_RECOVERY(), without setting this again. >=20 > Adding a safety net prior to the division in that > function, which I missed in D28114. Any plans to MFC this to stable/13? This commit intends to address an issue reported by mm@ in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252958 Best regards Michael > --- > sys/netinet/tcp_input.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c > index 4b8f91ed9d0b..459b78cd444a 100644 > --- a/sys/netinet/tcp_input.c > +++ b/sys/netinet/tcp_input.c > @@ -510,7 +510,6 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr = *th) > } > /* XXXLAS: EXIT_RECOVERY ? */ > tp->t_bytes_acked =3D 0; > - tp->sackhint.recover_fs =3D 0; > } >=20 > /* > @@ -3948,10 +3947,13 @@ tcp_prr_partialack(struct tcpcb *tp, struct = tcphdr *th) > /* > * Proportional Rate Reduction > */ > - if (pipe > tp->snd_ssthresh) > + if (pipe > tp->snd_ssthresh) { > + if (tp->sackhint.recover_fs =3D=3D 0) > + tp->sackhint.recover_fs =3D > + max(1, tp->snd_nxt - tp->snd_una); > snd_cnt =3D (tp->sackhint.prr_delivered * = tp->snd_ssthresh / > tp->sackhint.recover_fs) - = tp->sackhint.sack_bytes_rexmit; > - else { > + } else { > if (V_tcp_do_prr_conservative) > limit =3D tp->sackhint.prr_delivered - > tp->sackhint.sack_bytes_rexmit; From owner-dev-commits-src-main@freebsd.org Tue Jan 26 16:15: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 C9B6F4F4ACA; Tue, 26 Jan 2021 16:15:05 +0000 (UTC) (envelope-from Richard.Scheffenegger@netapp.com) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2073.outbound.protection.outlook.com [40.107.237.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQBf14QpWz4ccH; Tue, 26 Jan 2021 16:15:05 +0000 (UTC) (envelope-from Richard.Scheffenegger@netapp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kv8nEnZS/vPiJrZ+U6tXUuQM6kaPQQmVx81M+i8jVgh9uiqxJz4YPvy5Zvhx/o4HFxRDZGF00SS1EaW785bSiqVyWRBaeFVDWxeyTI2sKZXdA0a7OqHHGaOrVCmDcpzk7QSb8hFYyRXLhWbMdp/K6guyQu36q8RpMd7OlIXcHOpQCDkuks540R3toyI3R4xd61cimH7saUJ1ERW1+0lalKzjOJ0G0uu2NFYgwhP8C2aV8l+aST7vdF8xgu+R6HfwJKufnAjIpIgV1BhbXgrdef0txKngbcoV4Nrqt8m+CRGHvFmr6JU1aU9j7lEC2ZL2j5TMqpCgfN7NRqUGcstdwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ONwFVmwyPgg7PZoCIP5c1i3yCWKcwiv0vhT42XtSXPU=; b=A8/FfXcSa/Qz2pP3C2TfiKtMxfhBXoqeF3EJNWLkm3qob3tqvQZ0Yqm3LtLJS04blymJgg5Rx8JRM/jr++bskSt+EsC4WBzBMmm104sy4HCoCmO9uRuqPTRvn0z8daQLZE4z9JQoKs3X3p4qak4oEYACnRXpkEGgriwhgHtHUU8XmF5tMnZPLizqEq3v3lBDYXJwTaEuCIBy0Qygqe75/D1XHe/KnC3bkrNGKfMlWAC/ZsawnJOhsRfz4omC95i5EhK+WrxmBo5DtPn0UykHbvwu+zGGVQtkTfsNDHsegup25apXCRsWCxWb2P6j1z2CF3qkft8YsFJBZJCeXvTyjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=netapp.com; dmarc=pass action=none header.from=netapp.com; dkim=pass header.d=netapp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netapp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ONwFVmwyPgg7PZoCIP5c1i3yCWKcwiv0vhT42XtSXPU=; b=M1Ct43xDAC5tN7o/jT7t/uoCiQlkp1PLF69H4vU7UntODsJ28W4c+3QBQfBFJxuD3J4rTsL3XKXfoCqjR5JNMOrUgXbiy4gbMCfbbyfhpYArd8Z9WhzPHUHmtp9uKOrM5udaZSRypjFkfZU/sH2wBzxAPYwTjjPoIOMWkgRy8csY2gJLKbWvUe/kriDZHoiHO3/UKvJQ4A6r8JDHWpxQEWXU/jSiXn9BnKcIP+rqYVgDwLv2sS5SCNjmk2qj5mAy/xw2X/Crgvl9ZDgKCPOCT1gTENDBtIkV1XX9ygOKE2mqG1E+g7TCpChWdQQo5Av5/cSWWHCScdlDHB7EWWtORg== Received: from SN4PR0601MB3728.namprd06.prod.outlook.com (2603:10b6:803:51::24) by SN4PR0601MB3631.namprd06.prod.outlook.com (2603:10b6:803:4f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.13; Tue, 26 Jan 2021 16:15:02 +0000 Received: from SN4PR0601MB3728.namprd06.prod.outlook.com ([fe80::1551:a759:21c5:fd41]) by SN4PR0601MB3728.namprd06.prod.outlook.com ([fe80::1551:a759:21c5:fd41%7]) with mapi id 15.20.3784.019; Tue, 26 Jan 2021 16:15:02 +0000 From: "Scheffenegger, Richard" To: Michael Tuexen , Richard Scheffenegger CC: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: AW: git: 84761f3df508 - main - Adjust line length in tcp_prr_partialack Thread-Topic: git: 84761f3df508 - main - Adjust line length in tcp_prr_partialack Thread-Index: AQHW8/QmmRVHwLlOY06JeclXCRUhYKo6Ez4AgAAAY8A= Date: Tue, 26 Jan 2021 16:15:02 +0000 Message-ID: References: <202101261501.10QF16hV000586@gitrepo.freebsd.org> <84A0BAE9-0553-4D19-9F48-535A4B9473D3@macmic.franken.de> In-Reply-To: <84A0BAE9-0553-4D19-9F48-535A4B9473D3@macmic.franken.de> Accept-Language: de-AT, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [185.236.167.136] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 486b474b-409c-426b-72c9-08d8c2158904 x-ms-traffictypediagnostic: SN4PR0601MB3631: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XxKHTLZGvw0OIl3QqTFxve1cDl01vNHbZbhMSVRvrcc/2WM2dLXxvh00CgrrpP3UjxPeA7gV48Cc4P4ZdJvmVKLs0kaSo+LV/aBP8Guh/uJSeTxg2RxvSEfmMlhtmyLk9UiT9n+EQPLXRsEtxXxkeqf9UpOoxeYEQ3bQ3Vm6yr7zlSHUXX5O8RdZVax1ixw37/eQwSfESsZ/K9SSIFZjPrmvg+JayZ1ChjJCKRsLlx1Z2r0YH7m8bCbX+R24XoHvJWGUAhvWtskZ4sMm5oxCwjT6wblo6Ypy3c2sDnxpTvq71Dh29ux/Bt74u4C7LnIs+XzydNPM/5zEFJFrs0pD3u09juc9OTTMW0kNToGQof5iPEd6eVDRiCWmwazB1Pfzb9SZiVnrYzNkx6i8MThFNJv6j++31szj4kAEYcShXNH8dEuPKib3ElxzZWEnUVRN/A9vZG2fSwm6B2tg86Vqgi3CM4Fp82CrusjzbUdYfLQDf4PaS3+VlGw+Wk+2I0RXBIBMQgiwyZ+TTtLzC58X1ImxUIzGdTJwrdzrlWvN1ituyr3GyKvVFYUCM1Tv5gj6NZcHyBpZZ0PhqedRwEAZVWavlVvrVsBhRjjWX+7wAok= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN4PR0601MB3728.namprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(366004)(39860400002)(346002)(136003)(396003)(83380400001)(66946007)(5660300002)(966005)(4326008)(110136005)(52536014)(8936002)(66556008)(33656002)(66476007)(316002)(86362001)(26005)(478600001)(9686003)(8676002)(76116006)(6506007)(66446008)(54906003)(186003)(7696005)(64756008)(2906002)(55016002)(66574015)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?Q?PuLDJuBYIkhD0paiq+njJeDFr3vRMEqI3bH1JG6jgGzKv7J7GhthRldJwW?= =?iso-8859-1?Q?CCuCz2eoDbZjqNQ4KhaenV3daB/MhFM/kcYXAOO8uITXecH5XcPMcwCtes?= =?iso-8859-1?Q?nNLOpMvU+/wX1pgV+7xcX44kmL518qmIdwrSnfnFV0FN6vU2ne+av/y/MX?= =?iso-8859-1?Q?aJ6A9ff09SZhR+R6hQz1CjJpnwEbBUHQFXf0N+x9JLxZDn0UxqpzI/FjVA?= =?iso-8859-1?Q?hvuMsoalTTf8OeR/FAmtr/VqD5BHmz6NAzblAgg93ga/OkL4RS6w4+yWxY?= =?iso-8859-1?Q?qRoD6xQF9xvUxoukkJDbQXlACG+/aprVzGMgrlCoZCeiLLJvUcHA59WFE4?= =?iso-8859-1?Q?Uh7Ovm+fsWn5b6R/yBHY++AVqSrMe2C5dInogCTP8jgbuxtOJMWF9xYw5O?= =?iso-8859-1?Q?oIa2pts4BlsgzkT/Xriuv1A1kATULhkIXjZNcb/7kv6zPA1n6me935pUHt?= =?iso-8859-1?Q?Bh4Jyw/2et78Zjyr3q7Q3tScnwzrVcFz5tM8PDQI3Z3MOVCWyte7hFX6Yu?= =?iso-8859-1?Q?JjuqkuquLJsJvrL5hGG51gObs6Zwxp7Vj7gERRFycr6WAq0MAJnnY+RCfT?= =?iso-8859-1?Q?YhO5/6FBKvBoQUR+JwtrFoIh9NJy0FjsYkswbEkK/mp0LsvxygxqL86qQS?= =?iso-8859-1?Q?Er4VkaxEbUZAPlz1GQvNeLOSGvQgyvEEMr7N87kalVdWndGhgLOoevD3Jq?= =?iso-8859-1?Q?n6RcOYg7kKIrZj4GQHyzXkjMYQb9sue5VbYFGtxv0kX06OM2wKoRBRdjZB?= =?iso-8859-1?Q?iA1gokqRHL4BoVpngOq2WnAxECRlTbcAVmNXDx3XVTRAtQp3KrDp3UwtmR?= =?iso-8859-1?Q?fnNRkVEcUzbI7fHTBAG54QvKTalmTST8T0xYSKWGs/WkVdE4kMDIDNMKKK?= =?iso-8859-1?Q?1dbsqNLszALmzwXJK34KShLdE/8txUbGxqj/rR2gcbO6hhlLzovDN2rXcA?= =?iso-8859-1?Q?tosrGfaqsQ7BTlySZnTl9zDugU44D6jfsBVpqYzT8X8eLE7VJZkznb8PPY?= =?iso-8859-1?Q?d08yba9LDy8U2xnQAVGEudHyVav37KdqRw6EF1xgnQyFfoED47/MDSBgGL?= =?iso-8859-1?Q?jilvJDM9JRAc1P04MowvoK5Y9JfBWfhasQ1zMmmHItp1?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: netapp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN4PR0601MB3728.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 486b474b-409c-426b-72c9-08d8c2158904 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2021 16:15:02.0887 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4b0911a0-929b-4715-944b-c03745165b3a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: smrXLOMPtsDt2Llhhe9Ho9ZBoTNfNxoiISPW4PQkS0TNjW7U9IZ1PyjJRExSqWgnH6IhuoGHb3bVLbBH8shhDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0601MB3631 X-Rspamd-Queue-Id: 4DQBf14QpWz4ccH 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: Tue, 26 Jan 2021 16:15:05 -0000 Let's discuss this during the next @transport call on thursday; I would wan= t to hold off for next weekend at least for the MFC to apply all related pa= tches in close succession. (and quite frankly didn't think about it) Richard Scheffenegger -----Urspr=FCngliche Nachricht----- Von: Michael Tuexen =20 Gesendet: Dienstag, 26. J=E4nner 2021 17:09 An: Richard Scheffenegger Cc: src-committers@freebsd.org; dev-commits-src-all@freebsd.org; dev-commit= s-src-main@freebsd.org Betreff: Re: git: 84761f3df508 - main - Adjust line length in tcp_prr_parti= alack NetApp Security WARNING: This is an external email. Do not click links or o= pen attachments unless you recognize the sender and know the content is saf= e. > On 26. Jan 2021, at 16:01, Richard Scheffenegger wr= ote: > > The branch main has been updated by rscheff: > > URL:=20 > https://cgit.FreeBSD.org/src/commit/?id=3D84761f3df508aed50783b60f028af9 > d98a684b41 > > commit 84761f3df508aed50783b60f028af9d98a684b41 > Author: Richard Scheffenegger > AuthorDate: 2021-01-26 13:47:19 +0000 > Commit: Richard Scheffenegger > CommitDate: 2021-01-26 13:47:19 +0000 > > Adjust line length in tcp_prr_partialack > > Summary: > Wrap lines before column 80 in new prr code checked in recently. > > No functional changes. > > Reviewers: tuexen, rrs, jtl, mm, kbowling, #transport > > Reviewed By: tuexen, mm, #transport > > Subscribers: imp, melifaro > > Differential Revision: https://reviews.freebsd.org/D28329 Any plans to MFC this to stable/13? Best regards Michael > --- > sys/netinet/tcp_input.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index=20 > 75718352da00..4b8f91ed9d0b 100644 > --- a/sys/netinet/tcp_input.c > +++ b/sys/netinet/tcp_input.c > @@ -3949,14 +3949,17 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphd= r *th) > * Proportional Rate Reduction > */ > if (pipe > tp->snd_ssthresh) > - snd_cnt =3D (tp->sackhint.prr_delivered * tp->snd_ssthresh = / tp->sackhint.recover_fs) - > - tp->sackhint.sack_bytes_rexmit; > + snd_cnt =3D (tp->sackhint.prr_delivered * tp->snd_ssthresh = / > + tp->sackhint.recover_fs) -=20 > + tp->sackhint.sack_bytes_rexmit; > else { > if (V_tcp_do_prr_conservative) > - limit =3D tp->sackhint.prr_delivered - tp->sackhint= .sack_bytes_rexmit; > + limit =3D tp->sackhint.prr_delivered - > + tp->sackhint.sack_bytes_rexmit; > else > - if ((tp->sackhint.prr_delivered - tp->sackhint.sack= _bytes_rexmit) > del_data) > - limit =3D tp->sackhint.prr_delivered - tp->= sackhint.sack_bytes_rexmit + maxseg; > + if ((tp->sackhint.prr_delivered - > + tp->sackhint.sack_bytes_rexmit) > del_data) > + limit =3D tp->sackhint.prr_delivered - > + tp->sackhint.sack_bytes_rexmit +=20 > + maxseg; > else > limit =3D del_data + maxseg; > snd_cnt =3D min((tp->snd_ssthresh - pipe), limit); From owner-dev-commits-src-main@freebsd.org Tue Jan 26 16:52: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 228A54F5C78; Tue, 26 Jan 2021 16:52: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 4DQCTb0WHXz4hRk; Tue, 26 Jan 2021 16:52: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 045094D7C; Tue, 26 Jan 2021 16:52: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 10QGqoe5047770; Tue, 26 Jan 2021 16:52:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QGqo2h047769; Tue, 26 Jan 2021 16:52:50 GMT (envelope-from git) Date: Tue, 26 Jan 2021 16:52:50 GMT Message-Id: <202101261652.10QGqo2h047769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: e63539f30597 - main - Fix clang assertion when compiling the devel/onetbb port MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e63539f3059728ff58328ac0ecb2a7bf4e2f08e8 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, 26 Jan 2021 16:52:51 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e63539f3059728ff58328ac0ecb2a7bf4e2f08e8 commit e63539f3059728ff58328ac0ecb2a7bf4e2f08e8 Author: Dimitry Andric AuthorDate: 2021-01-26 13:07:47 +0000 Commit: Dimitry Andric CommitDate: 2021-01-26 16:51:25 +0000 Fix clang assertion when compiling the devel/onetbb port Merge commit 740a164de from llvm git (by Richard Smith): PR46377: Fix dependence calculation for function types and typedef types. We previously did not treat a function type as dependent if it had a parameter pack with a non-dependent type -- such a function type depends on the arity of the pack so is dependent even though none of the parameter types is dependent. In order to properly handle this, we now treat pack expansion types as always being dependent types (depending on at least the pack arity), and always canonically being pack expansion types, even in the unusual case when the pattern is not a dependent type. This does mean that we can have canonical types that are pack expansions that contain no unexpanded packs, which is unfortunate but not inaccurate. We also previously did not treat a typedef type as instantiation-dependent if its canonical type was not instantiation-dependent. That's wrong because instantiation-dependence is a property of the type sugar, not of the type; an instantiation-dependent type can have a non-instantiation-dependent canonical type. Merge commit 9cf98d26e from llvm git (by Richard Smith): PR46637: Fix handling of placeholder types in trailing-return-types. Only permit a placeholder type in a trailing-return-type if it would also have been permitted in the decl-specifier sequence of a corresponding declaration with no trailing-return-type. The standard doesn't actually say this, but this is the only thing that makes sense. Also fix handling of an 'auto' in a trailing-return-type in a parameter of a generic lambda. We used to crash if we saw such a thing. Merge commit 234f51a65 from llvm git (by Richard Smith): Don't crash if we deserialize a pack expansion type whose pattern contains no packs. Fixes a regression from 740a164dec483225cbd02ab6c82199e2747ffacb. PR: 252892 Reported by: thierry MFC after: 3 days --- .../clang/include/clang/AST/ASTContext.h | 10 +- .../llvm-project/clang/include/clang/AST/Type.h | 13 +-- .../clang/include/clang/AST/TypeProperties.td | 3 +- .../clang/include/clang/Basic/TypeNodes.td | 2 +- .../clang/include/clang/Sema/DeclSpec.h | 9 ++ .../llvm-project/clang/include/clang/Sema/Sema.h | 2 + contrib/llvm-project/clang/lib/AST/ASTContext.cpp | 34 +++--- contrib/llvm-project/clang/lib/AST/ASTImporter.cpp | 3 +- contrib/llvm-project/clang/lib/AST/Type.cpp | 9 +- .../llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp | 1 - .../clang/lib/CodeGen/CodeGenFunction.cpp | 1 - contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 1 - contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp | 3 +- .../clang/lib/Sema/SemaTemplateDeduction.cpp | 7 ++ .../clang/lib/Sema/SemaTemplateVariadic.cpp | 3 +- contrib/llvm-project/clang/lib/Sema/SemaType.cpp | 119 +++++++++++---------- 16 files changed, 121 insertions(+), 99 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTContext.h b/contrib/llvm-project/clang/include/clang/AST/ASTContext.h index 9020e6629d08..3700d0101daf 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTContext.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTContext.h @@ -1475,8 +1475,16 @@ public: void getInjectedTemplateArgs(const TemplateParameterList *Params, SmallVectorImpl &Args); + /// Form a pack expansion type with the given pattern. + /// \param NumExpansions The number of expansions for the pack, if known. + /// \param ExpectPackInType If \c false, we should not expect \p Pattern to + /// contain an unexpanded pack. This only makes sense if the pack + /// expansion is used in a context where the arity is inferred from + /// elsewhere, such as if the pattern contains a placeholder type or + /// if this is the canonical type of another pack expansion type. QualType getPackExpansionType(QualType Pattern, - Optional NumExpansions); + Optional NumExpansions, + bool ExpectPackInType = true); QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl = nullptr) const; diff --git a/contrib/llvm-project/clang/include/clang/AST/Type.h b/contrib/llvm-project/clang/include/clang/AST/Type.h index 736f08651c84..74e4a578cb55 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Type.h +++ b/contrib/llvm-project/clang/include/clang/AST/Type.h @@ -4375,11 +4375,7 @@ class TypedefType : public Type { protected: friend class ASTContext; // ASTContext creates these. - TypedefType(TypeClass tc, const TypedefNameDecl *D, QualType can) - : Type(tc, can, can->getDependence() & ~TypeDependence::UnexpandedPack), - Decl(const_cast(D)) { - assert(!isa(can) && "Invalid canonical type"); - } + TypedefType(TypeClass tc, const TypedefNameDecl *D, QualType can); public: TypedefNameDecl *getDecl() const { return Decl; } @@ -5616,7 +5612,8 @@ class PackExpansionType : public Type, public llvm::FoldingSetNode { PackExpansionType(QualType Pattern, QualType Canon, Optional NumExpansions) : Type(PackExpansion, Canon, - (Pattern->getDependence() | TypeDependence::Instantiation) & + (Pattern->getDependence() | TypeDependence::Dependent | + TypeDependence::Instantiation) & ~TypeDependence::UnexpandedPack), Pattern(Pattern) { PackExpansionTypeBits.NumExpansions = @@ -5637,8 +5634,8 @@ public: return None; } - bool isSugared() const { return !Pattern->isDependentType(); } - QualType desugar() const { return isSugared() ? Pattern : QualType(this, 0); } + bool isSugared() const { return false; } + QualType desugar() const { return QualType(this, 0); } void Profile(llvm::FoldingSetNodeID &ID) { Profile(ID, getPattern(), getNumExpansions()); diff --git a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td index 4540ea0e1952..ed91670829b8 100644 --- a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td +++ b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td @@ -722,7 +722,8 @@ let Class = PackExpansionType in { } def : Creator<[{ - return ctx.getPackExpansionType(pattern, numExpansions); + return ctx.getPackExpansionType(pattern, numExpansions, + /*ExpectPackInType*/false); }]>; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td b/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td index a4e3002b9075..011394c3ef45 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td +++ b/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td @@ -100,7 +100,7 @@ def DeducedTemplateSpecializationType : TypeNode; def InjectedClassNameType : TypeNode, AlwaysDependent, LeafType; def DependentNameType : TypeNode, AlwaysDependent; def DependentTemplateSpecializationType : TypeNode, AlwaysDependent; -def PackExpansionType : TypeNode, NeverCanonicalUnlessDependent; +def PackExpansionType : TypeNode, AlwaysDependent; def ObjCTypeParamType : TypeNode, NeverCanonical; def ObjCObjectType : TypeNode; def ObjCInterfaceType : TypeNode, LeafType; diff --git a/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h b/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h index 8db03babfb1e..0a22b5af7c64 100644 --- a/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h +++ b/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h @@ -2435,6 +2435,15 @@ public: return true; return false; } + /// Get the trailing return type appearing (at any level) within this + /// declarator. + ParsedType getTrailingReturnType() const { + for (const auto &Chunk : type_objects()) + if (Chunk.Kind == DeclaratorChunk::Function && + Chunk.Fun.hasTrailingReturnType()) + return Chunk.Fun.getTrailingReturnType(); + return ParsedType(); + } /// \brief Sets a trailing requires clause for this declarator. void setTrailingRequiresClause(Expr *TRC) { diff --git a/contrib/llvm-project/clang/include/clang/Sema/Sema.h b/contrib/llvm-project/clang/include/clang/Sema/Sema.h index 16a7084f6b08..1b5e389501c3 100644 --- a/contrib/llvm-project/clang/include/clang/Sema/Sema.h +++ b/contrib/llvm-project/clang/include/clang/Sema/Sema.h @@ -8172,6 +8172,8 @@ public: /// Completely replace the \c auto in \p TypeWithAuto by /// \p Replacement. This does not retain any \c auto type sugar. QualType ReplaceAutoType(QualType TypeWithAuto, QualType Replacement); + TypeSourceInfo *ReplaceAutoTypeSourceInfo(TypeSourceInfo *TypeWithAuto, + QualType Replacement); /// Result type of DeduceAutoType. enum DeduceAutoResult { diff --git a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp index bf51d35d9693..1497cccff175 100644 --- a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp +++ b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp @@ -4868,37 +4868,27 @@ ASTContext::getInjectedTemplateArgs(const TemplateParameterList *Params, } QualType ASTContext::getPackExpansionType(QualType Pattern, - Optional NumExpansions) { + Optional NumExpansions, + bool ExpectPackInType) { + assert((!ExpectPackInType || Pattern->containsUnexpandedParameterPack()) && + "Pack expansions must expand one or more parameter packs"); + llvm::FoldingSetNodeID ID; PackExpansionType::Profile(ID, Pattern, NumExpansions); - // A deduced type can deduce to a pack, eg - // auto ...x = some_pack; - // That declaration isn't (yet) valid, but is created as part of building an - // init-capture pack: - // [...x = some_pack] {} - assert((Pattern->containsUnexpandedParameterPack() || - Pattern->getContainedDeducedType()) && - "Pack expansions must expand one or more parameter packs"); void *InsertPos = nullptr; - PackExpansionType *T - = PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); + PackExpansionType *T = PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); if (T) return QualType(T, 0); QualType Canon; if (!Pattern.isCanonical()) { - Canon = getCanonicalType(Pattern); - // The canonical type might not contain an unexpanded parameter pack, if it - // contains an alias template specialization which ignores one of its - // parameters. - if (Canon->containsUnexpandedParameterPack()) { - Canon = getPackExpansionType(Canon, NumExpansions); - - // Find the insert position again, in case we inserted an element into - // PackExpansionTypes and invalidated our insert position. - PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); - } + Canon = getPackExpansionType(getCanonicalType(Pattern), NumExpansions, + /*ExpectPackInType=*/false); + + // Find the insert position again, in case we inserted an element into + // PackExpansionTypes and invalidated our insert position. + PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); } T = new (*this, TypeAlignment) diff --git a/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp b/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp index 3779e0cb872b..e0a186307e93 100644 --- a/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp +++ b/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp @@ -1498,7 +1498,8 @@ ASTNodeImporter::VisitPackExpansionType(const PackExpansionType *T) { return ToPatternOrErr.takeError(); return Importer.getToContext().getPackExpansionType(*ToPatternOrErr, - T->getNumExpansions()); + T->getNumExpansions(), + /*ExpactPack=*/false); } ExpectedType ASTNodeImporter::VisitDependentTemplateSpecializationType( diff --git a/contrib/llvm-project/clang/lib/AST/Type.cpp b/contrib/llvm-project/clang/lib/AST/Type.cpp index 10a6a2610130..ce011eddbd2e 100644 --- a/contrib/llvm-project/clang/lib/AST/Type.cpp +++ b/contrib/llvm-project/clang/lib/AST/Type.cpp @@ -1187,9 +1187,6 @@ public: T->getTypeConstraintArguments()); } - // FIXME: Non-trivial to implement, but important for C++ - SUGARED_TYPE_CLASS(PackExpansion) - QualType VisitObjCObjectType(const ObjCObjectType *T) { QualType baseType = recurse(T->getBaseType()); if (baseType.isNull()) @@ -3317,6 +3314,12 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, getExtProtoInfo(), Ctx, isCanonicalUnqualified()); } +TypedefType::TypedefType(TypeClass tc, const TypedefNameDecl *D, QualType can) + : Type(tc, can, D->getUnderlyingType()->getDependence()), + Decl(const_cast(D)) { + assert(!isa(can) && "Invalid canonical type"); +} + QualType TypedefType::desugar() const { return getDecl()->getUnderlyingType(); } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp index 703f5087370a..143408401245 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp @@ -3268,7 +3268,6 @@ llvm::DIType *CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile *Unit) { case Type::TypeOf: case Type::Decltype: case Type::UnaryTransform: - case Type::PackExpansion: break; } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp b/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp index 8ce488f35dd3..8f79cc77f0e6 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2075,7 +2075,6 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) { case Type::UnaryTransform: case Type::Attributed: case Type::SubstTemplateTypeParm: - case Type::PackExpansion: case Type::MacroQualified: // Keep walking after single level desugaring. type = type.getSingleStepDesugaredType(getContext()); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp index d301e6c732ab..610a77c0e6f2 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp @@ -4345,7 +4345,6 @@ static void captureVariablyModifiedType(ASTContext &Context, QualType T, case Type::UnaryTransform: case Type::Attributed: case Type::SubstTemplateTypeParm: - case Type::PackExpansion: case Type::MacroQualified: // Keep walking after single level desugaring. T = T.getSingleStepDesugaredType(Context); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp b/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp index 657ed13f207a..dc74f6e2f7dc 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp @@ -803,7 +803,8 @@ QualType Sema::buildLambdaInitCaptureInitialization( Diag(EllipsisLoc, getLangOpts().CPlusPlus20 ? diag::warn_cxx17_compat_init_capture_pack : diag::ext_init_capture_pack); - DeductType = Context.getPackExpansionType(DeductType, NumExpansions); + DeductType = Context.getPackExpansionType(DeductType, NumExpansions, + /*ExpectPackInType=*/false); TLB.push(DeductType).setEllipsisLoc(EllipsisLoc); } else { // Just ignore the ellipsis for now and form a non-pack variable. We'll diff --git a/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp b/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp index 5392be57a3aa..eb8677d0e481 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -4894,6 +4894,13 @@ QualType Sema::ReplaceAutoType(QualType TypeWithAuto, .TransformType(TypeWithAuto); } +TypeSourceInfo *Sema::ReplaceAutoTypeSourceInfo(TypeSourceInfo *TypeWithAuto, + QualType TypeToReplaceAuto) { + return SubstituteDeducedTypeTransform(*this, TypeToReplaceAuto, + /*UseTypeSugar*/ false) + .TransformType(TypeWithAuto); +} + void Sema::DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init) { if (isa(Init)) Diag(VDecl->getLocation(), diff --git a/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp b/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp index 7b77d1cb482a..259cc5165776 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp @@ -614,7 +614,8 @@ QualType Sema::CheckPackExpansion(QualType Pattern, SourceRange PatternRange, return QualType(); } - return Context.getPackExpansionType(Pattern, NumExpansions); + return Context.getPackExpansionType(Pattern, NumExpansions, + /*ExpectPackInType=*/false); } ExprResult Sema::ActOnPackExpansion(Expr *Pattern, SourceLocation EllipsisLoc) { diff --git a/contrib/llvm-project/clang/lib/Sema/SemaType.cpp b/contrib/llvm-project/clang/lib/Sema/SemaType.cpp index cc151a048b98..f2c3c6373948 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaType.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaType.cpp @@ -3101,24 +3101,10 @@ static void diagnoseRedundantReturnTypeQualifiers(Sema &S, QualType RetTy, D.getDeclSpec().getUnalignedSpecLoc()); } -static void CopyTypeConstraintFromAutoType(Sema &SemaRef, const AutoType *Auto, - AutoTypeLoc AutoLoc, - TemplateTypeParmDecl *TP, - SourceLocation EllipsisLoc) { - - TemplateArgumentListInfo TAL(AutoLoc.getLAngleLoc(), AutoLoc.getRAngleLoc()); - for (unsigned Idx = 0; Idx < AutoLoc.getNumArgs(); ++Idx) - TAL.addArgument(AutoLoc.getArgLoc(Idx)); - - SemaRef.AttachTypeConstraint( - AutoLoc.getNestedNameSpecifierLoc(), AutoLoc.getConceptNameInfo(), - AutoLoc.getNamedConcept(), - AutoLoc.hasExplicitTemplateArgs() ? &TAL : nullptr, TP, EllipsisLoc); -} - -static QualType InventTemplateParameter( - TypeProcessingState &state, QualType T, TypeSourceInfo *TSI, AutoType *Auto, - InventedTemplateParameterInfo &Info) { +static std::pair +InventTemplateParameter(TypeProcessingState &state, QualType T, + TypeSourceInfo *TrailingTSI, AutoType *Auto, + InventedTemplateParameterInfo &Info) { Sema &S = state.getSema(); Declarator &D = state.getDeclarator(); @@ -3143,13 +3129,25 @@ static QualType InventTemplateParameter( IsParameterPack, /*HasTypeConstraint=*/Auto->isConstrained()); InventedTemplateParam->setImplicit(); Info.TemplateParams.push_back(InventedTemplateParam); - // Attach type constraints + + // Attach type constraints to the new parameter. if (Auto->isConstrained()) { - if (TSI) { - CopyTypeConstraintFromAutoType( - S, Auto, TSI->getTypeLoc().getContainedAutoTypeLoc(), - InventedTemplateParam, D.getEllipsisLoc()); + if (TrailingTSI) { + // The 'auto' appears in a trailing return type we've already built; + // extract its type constraints to attach to the template parameter. + AutoTypeLoc AutoLoc = TrailingTSI->getTypeLoc().getContainedAutoTypeLoc(); + TemplateArgumentListInfo TAL(AutoLoc.getLAngleLoc(), AutoLoc.getRAngleLoc()); + for (unsigned Idx = 0; Idx < AutoLoc.getNumArgs(); ++Idx) + TAL.addArgument(AutoLoc.getArgLoc(Idx)); + + S.AttachTypeConstraint(AutoLoc.getNestedNameSpecifierLoc(), + AutoLoc.getConceptNameInfo(), + AutoLoc.getNamedConcept(), + AutoLoc.hasExplicitTemplateArgs() ? &TAL : nullptr, + InventedTemplateParam, D.getEllipsisLoc()); } else { + // The 'auto' appears in the decl-specifiers; we've not finished forming + // TypeSourceInfo for it yet. TemplateIdAnnotation *TemplateId = D.getDeclSpec().getRepAsTemplateId(); TemplateArgumentListInfo TemplateArgsInfo; if (TemplateId->LAngleLoc.isValid()) { @@ -3167,15 +3165,16 @@ static QualType InventTemplateParameter( } } - // If TSI is nullptr, this is a constrained declspec auto and the type - // constraint will be attached later in TypeSpecLocFiller - // Replace the 'auto' in the function parameter with this invented // template type parameter. // FIXME: Retain some type sugar to indicate that this was written // as 'auto'? - return state.ReplaceAutoType( - T, QualType(InventedTemplateParam->getTypeForDecl(), 0)); + QualType Replacement(InventedTemplateParam->getTypeForDecl(), 0); + QualType NewT = state.ReplaceAutoType(T, Replacement); + TypeSourceInfo *NewTSI = + TrailingTSI ? S.ReplaceAutoTypeSourceInfo(TrailingTSI, Replacement) + : nullptr; + return {NewT, NewTSI}; } static TypeSourceInfo * @@ -3234,8 +3233,19 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, if (!D.getAttributes().empty()) distributeTypeAttrsFromDeclarator(state, T); + // Find the deduced type in this type. Look in the trailing return type if we + // have one, otherwise in the DeclSpec type. + // FIXME: The standard wording doesn't currently describe this. + DeducedType *Deduced = T->getContainedDeducedType(); + bool DeducedIsTrailingReturnType = false; + if (Deduced && isa(Deduced) && D.hasTrailingReturnType()) { + QualType T = SemaRef.GetTypeFromParser(D.getTrailingReturnType()); + Deduced = T.isNull() ? nullptr : T->getContainedDeducedType(); + DeducedIsTrailingReturnType = true; + } + // C++11 [dcl.spec.auto]p5: reject 'auto' if it is not in an allowed context. - if (DeducedType *Deduced = T->getContainedDeducedType()) { + if (Deduced) { AutoType *Auto = dyn_cast(Deduced); int Error = -1; @@ -3269,10 +3279,6 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, } else if (!SemaRef.getCurScope()->isFunctionDeclarationScope()) { Error = 21; break; - } else if (D.hasTrailingReturnType()) { - // This might be OK, but we'll need to convert the trailing return - // type later. - break; } Info = &SemaRef.InventedParameterInfos.back(); @@ -3286,7 +3292,12 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, Info = SemaRef.getCurLambda(); assert(Info && "No LambdaScopeInfo on the stack!"); } - T = InventTemplateParameter(state, T, nullptr, Auto, *Info); + + // We'll deal with inventing template parameters for 'auto' in trailing + // return types when we pick up the trailing return type when processing + // the function chunk. + if (!DeducedIsTrailingReturnType) + T = InventTemplateParameter(state, T, nullptr, Auto, *Info).first; break; } case DeclaratorContext::MemberContext: { @@ -3384,20 +3395,6 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, (!SemaRef.getLangOpts().CPlusPlus11 || !IsCXXAutoType)) Error = 13; - bool HaveTrailing = false; - - // C++11 [dcl.spec.auto]p2: 'auto' is always fine if the declarator - // contains a trailing return type. That is only legal at the outermost - // level. Check all declarator chunks (outermost first) anyway, to give - // better diagnostics. - // We don't support '__auto_type' with trailing return types. - // FIXME: Should we only do this for 'auto' and not 'decltype(auto)'? - if (SemaRef.getLangOpts().CPlusPlus11 && IsCXXAutoType && - D.hasTrailingReturnType()) { - HaveTrailing = true; - Error = -1; - } - SourceRange AutoRange = D.getDeclSpec().getTypeSpecTypeLoc(); if (D.getName().getKind() == UnqualifiedIdKind::IK_ConversionFunctionId) AutoRange = D.getName().getSourceRange(); @@ -3427,8 +3424,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, T = SemaRef.Context.IntTy; D.setInvalidType(true); - } else if (Auto && !HaveTrailing && - D.getContext() != DeclaratorContext::LambdaExprContext) { + } else if (Auto && D.getContext() != DeclaratorContext::LambdaExprContext) { // If there was a trailing return type, we already got // warn_cxx98_compat_trailing_return_type in the parser. SemaRef.Diag(AutoRange.getBegin(), @@ -4881,12 +4877,21 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // An error occurred parsing the trailing return type. T = Context.IntTy; D.setInvalidType(true); - } else if (S.getLangOpts().CPlusPlus20) - // Handle cases like: `auto f() -> auto` or `auto f() -> C auto`. - if (AutoType *Auto = T->getContainedAutoType()) - if (S.getCurScope()->isFunctionDeclarationScope()) - T = InventTemplateParameter(state, T, TInfo, Auto, - S.InventedParameterInfos.back()); + } else if (AutoType *Auto = T->getContainedAutoType()) { + // If the trailing return type contains an `auto`, we may need to + // invent a template parameter for it, for cases like + // `auto f() -> C auto` or `[](auto (*p) -> auto) {}`. + InventedTemplateParameterInfo *InventedParamInfo = nullptr; + if (D.getContext() == DeclaratorContext::PrototypeContext) + InventedParamInfo = &S.InventedParameterInfos.back(); + else if (D.getContext() == + DeclaratorContext::LambdaExprParameterContext) + InventedParamInfo = S.getCurLambda(); + if (InventedParamInfo) { + std::tie(T, TInfo) = InventTemplateParameter( + state, T, TInfo, Auto, *InventedParamInfo); + } + } } else { // This function type is not the type of the entity being declared, // so checking the 'auto' is not the responsibility of this chunk. @@ -5518,7 +5523,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, << T << D.getSourceRange(); D.setEllipsisLoc(SourceLocation()); } else { - T = Context.getPackExpansionType(T, None); + T = Context.getPackExpansionType(T, None, /*ExpectPackInType=*/false); } break; case DeclaratorContext::TemplateParamContext: From owner-dev-commits-src-main@freebsd.org Tue Jan 26 17:02: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 36F9D4F61D8; Tue, 26 Jan 2021 17:02: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 4DQChZ16nbz4hwd; Tue, 26 Jan 2021 17:02: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 194F55608; Tue, 26 Jan 2021 17:02: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 10QH2Mml060624; Tue, 26 Jan 2021 17:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QH2MgG060623; Tue, 26 Jan 2021 17:02:22 GMT (envelope-from git) Date: Tue, 26 Jan 2021 17:02:22 GMT Message-Id: <202101261702.10QH2MgG060623@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: 85d8d30f9f70 - main - Don't allow allocating a new send tag on an INP which is being torn down. This fixes a potential send tag leak. 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: 85d8d30f9f7046f5e89295352ded49135b25fbe3 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, 26 Jan 2021 17:02:22 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=85d8d30f9f7046f5e89295352ded49135b25fbe3 commit 85d8d30f9f7046f5e89295352ded49135b25fbe3 Author: Hans Petter Selasky AuthorDate: 2021-01-26 14:01:38 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-26 17:00:02 +0000 Don't allow allocating a new send tag on an INP which is being torn down. This fixes a potential send tag leak. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/in_pcb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 5adac0fddddf..8232003b3808 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -3399,7 +3399,12 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *ifp, INP_WLOCK_ASSERT(inp); - if (*st != NULL) + /* + * If there is already a send tag, or the INP is being torn + * down, allocating a new send tag is not allowed. Else send + * tags may leak. + */ + if (*st != NULL || (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) != 0) return (EINVAL); error = m_snd_tag_alloc(ifp, ¶ms, st); From owner-dev-commits-src-main@freebsd.org Tue Jan 26 17:02: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 511E64F5F58; Tue, 26 Jan 2021 17:02: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 4DQChb1vTWz4j7p; Tue, 26 Jan 2021 17:02: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 344FA5062; Tue, 26 Jan 2021 17:02: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 10QH2NTb060646; Tue, 26 Jan 2021 17:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QH2N4P060645; Tue, 26 Jan 2021 17:02:23 GMT (envelope-from git) Date: Tue, 26 Jan 2021 17:02:23 GMT Message-Id: <202101261702.10QH2N4P060645@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: 093e72319089 - main - Add missing decrement of active ratelimit connections. 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: 093e7231908908b651b91c68ac03fb697c3a8352 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, 26 Jan 2021 17:02:23 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=093e7231908908b651b91c68ac03fb697c3a8352 commit 093e7231908908b651b91c68ac03fb697c3a8352 Author: Hans Petter Selasky AuthorDate: 2021-01-26 15:59:42 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-26 17:00:21 +0000 Add missing decrement of active ratelimit connections. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/in_pcb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 8232003b3808..59695ee3715d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -3446,6 +3446,9 @@ in_pcbdetach_txrtlmt(struct inpcb *inp) return; m_snd_tag_rele(mst); +#ifdef INET + counter_u64_add(rate_limit_active, -1); +#endif } int From owner-dev-commits-src-main@freebsd.org Tue Jan 26 17:15: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 0C2364F6B83; Tue, 26 Jan 2021 17:15:25 +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 4DQCzc702nz4jmr; Tue, 26 Jan 2021 17:15:24 +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 E2E235445; Tue, 26 Jan 2021 17:15:24 +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 10QHFOVt074970; Tue, 26 Jan 2021 17:15:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QHFOYf074969; Tue, 26 Jan 2021 17:15:24 GMT (envelope-from git) Date: Tue, 26 Jan 2021 17:15:24 GMT Message-Id: <202101261715.10QHFOYf074969@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: ee55e19a7942 - main - vm_map_protect.9: update after code changes 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: ee55e19a79429fe8505ae37d561eccb38d5fa6b8 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, 26 Jan 2021 17:15:25 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ee55e19a79429fe8505ae37d561eccb38d5fa6b8 commit ee55e19a79429fe8505ae37d561eccb38d5fa6b8 Author: Konstantin Belousov AuthorDate: 2021-01-23 20:19:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-01-26 17:15:05 +0000 vm_map_protect.9: update after code changes Reviewed by: brooks, markj Discussed with: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28311 --- share/man/man9/vm_map_protect.9 | 118 +++++++++++++++++++++++++--------------- 1 file changed, 74 insertions(+), 44 deletions(-) diff --git a/share/man/man9/vm_map_protect.9 b/share/man/man9/vm_map_protect.9 index 5e58074ebda7..048f574aef2b 100644 --- a/share/man/man9/vm_map_protect.9 +++ b/share/man/man9/vm_map_protect.9 @@ -1,7 +1,12 @@ .\" .\" Copyright (c) 2003 Bruce M Simpson +.\" Copyright (c) 2021 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" +.\" Parts of this documentation were written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -25,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2019 +.Dd January 23, 2021 .Dt VM_MAP_PROTECT 9 .Os .Sh NAME @@ -37,70 +42,95 @@ .In vm/vm_map.h .Ft int .Fo vm_map_protect -.Fa "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_prot_t new_prot" -.Fa "boolean_t set_max" +.Fa "vm_map_t map" +.Fa "vm_offset_t start" +.Fa "vm_offset_t end" +.Fa "vm_prot_t new_prot" +.Fa "vm_prot_t new_maxprot" +.Fa "int flags" .Fc .Sh DESCRIPTION The .Fn vm_map_protect -function sets the protection bits of the address region bounded by +function sets the protection bits and maximum protection bits of the address +region bounded by .Fa start and .Fa end within the map -.Fa map -to +.Fa map . +.Pp +If the +.Fa flags +argument has the +.Dv VM_MAP_PROTECT_SET_PROT +bit set, then the effective protection is set to .Fa new_prot . -The value specified by -.Fa new_prot -may not include any protection bits that are not set in -.Va max_protection -on every entry within the range. .Pp -If -.Fa set_max -is TRUE, +If the +.Fa flags +argument has the +.Dv VM_MAP_PROTECT_SET_MAXPROT +bit set, then the maximum protection is set to +.Fa new_maxprot . +Protection bits not included into +.Fa new_maxprot +will be cleared from existing entries. +.Pp +The values specified by .Fa new_prot -is treated as the new +and +.Fa new_maxprot +are not allowed to include any protection bits that are not set in existing .Va max_protection -setting for each underlying entry. -Protection bits not included -.Fa new_prot -will be cleared from existing entries. -If -.Fa set_max -is FALSE only the -.Va protection -field is affected. +on every entry within the range. +The operation will fail if this condition is violated. +For instance, this prevents upgrading a shared mapping of a read-only file +from read-only to read-write. .Pp -The range MUST be contiguous, and MUST NOT contain sub-maps. +The specified range must not contain sub-maps. .Sh IMPLEMENTATION NOTES The function acquires a lock on the .Fa map for the duration, by calling .Xr vm_map_lock 9 . +Also, any in-progress wiring operation on the map affecting the specified +range will cause +.Nm +to sleep, waiting for completion. .Sh RETURN VALUES -The -.Fn vm_map_protect -function returns -.Dv KERN_SUCCESS -if the protection bits could be set successfully. -.Pp -If a sub-map entry was encountered in the range, -.Dv KERN_INVALID_ARGUMENT -is returned. -If the value of +.Bl -tag -width "Dv KERN_PROTECTION_FAILURE" +.It Dv KERN_SUCCESS +The specified protection bits were set successfully. +.It Dv KERN_INVALID_ARGUMENT +A sub-map entry was encountered in the range, +.It Dv KERN_PROTECTION_FAILURE +The value of .Fa new_prot -would exceed +or +.Fa new_maxprot +exceed .Va max_protection -for an entry within the range, -.Dv KERN_PROTECTION_FAILURE -is returned. -If a copy-on-write mapping is transitioned from read-only to -read-write, and too little swap space is available for backing the -copied pages, -.Dv KERN_RESOURCE_SHORTAGE -is returned. +for an entry within the range. +.It Dv KERN_PROTECTION_FAILURE +The map does not allow simultaneous setting of write and execute permissions, +but +.Fa new_prot +has both +.Dv VM_PROT_WRITE +and +.Dv VM_PROT_EXECUTE +set. +.It Dv KERN_RESOURCE_SHORTAGE +A copy-on-write mapping is transitioned from read-only to +read-write, and not enough swap space is available to back the +copied pages. +.It Dv KERN_OUT_OF_BOUNDS +Both new protection and new maximum protection updates were requested, +but the specified +.Fa new_prot +is not a subset of +.Fa new_maxprot . .Sh SEE ALSO .Xr vm_map 9 .Sh AUTHORS From owner-dev-commits-src-main@freebsd.org Tue Jan 26 18: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 4664F4FB7DF; Tue, 26 Jan 2021 18: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 4DQFbp1Vd3z3lNR; Tue, 26 Jan 2021 18: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 2616964EB; Tue, 26 Jan 2021 18: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 10QISMxV066352; Tue, 26 Jan 2021 18: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 10QISMcZ066351; Tue, 26 Jan 2021 18:28:22 GMT (envelope-from git) Date: Tue, 26 Jan 2021 18:28:22 GMT Message-Id: <202101261828.10QISMcZ066351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 65a524b499ae - main - Remove documentation of unimplemented syscalls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65a524b499aef18bcc4144a0f7c65d95483b9269 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, 26 Jan 2021 18:28:22 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=65a524b499aef18bcc4144a0f7c65d95483b9269 commit 65a524b499aef18bcc4144a0f7c65d95483b9269 Author: Brooks Davis AuthorDate: 2021-01-26 18:27:44 +0000 Commit: Brooks Davis CommitDate: 2021-01-26 18:27:44 +0000 Remove documentation of unimplemented syscalls We have not been able to run binaries from other BSDs well over a decade. There is no need to document their allocation decisions here. We also don't need to reserve syscall numbers of never-implemented syscalls. Reviewed by: jhb, kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27988 --- sys/kern/init_sysent.c | 30 +++++++++++++++--------------- sys/kern/syscalls.c | 30 +++++++++++++++--------------- sys/kern/syscalls.master | 32 ++++++++------------------------ 3 files changed, 38 insertions(+), 54 deletions(-) diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index efd18ec5ce01..e6a26a649508 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -146,10 +146,10 @@ struct sysent sysent[] = { { compat(AS(osethostname_args),sethostname), .sy_auevent = AUE_SYSCTL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 88 = old sethostname */ { .sy_narg = 0, .sy_call = (sy_call_t *)sys_getdtablesize, .sy_auevent = AUE_GETDTABLESIZE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 89 = getdtablesize */ { .sy_narg = AS(dup2_args), .sy_call = (sy_call_t *)sys_dup2, .sy_auevent = AUE_DUP2, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 90 = dup2 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 91 = getdopt */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 91 = nosys */ { .sy_narg = AS(fcntl_args), .sy_call = (sy_call_t *)sys_fcntl, .sy_auevent = AUE_FCNTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 92 = fcntl */ { .sy_narg = AS(select_args), .sy_call = (sy_call_t *)sys_select, .sy_auevent = AUE_SELECT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 93 = select */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 94 = setdopt */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 94 = nosys */ { .sy_narg = AS(fsync_args), .sy_call = (sy_call_t *)sys_fsync, .sy_auevent = AUE_FSYNC, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 95 = fsync */ { .sy_narg = AS(setpriority_args), .sy_call = (sy_call_t *)sys_setpriority, .sy_auevent = AUE_SETPRIORITY, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 96 = setpriority */ { .sy_narg = AS(socket_args), .sy_call = (sy_call_t *)sys_socket, .sy_auevent = AUE_SOCKET, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 97 = socket */ @@ -174,7 +174,7 @@ struct sysent sysent[] = { { .sy_narg = AS(gettimeofday_args), .sy_call = (sy_call_t *)sys_gettimeofday, .sy_auevent = AUE_GETTIMEOFDAY, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 116 = gettimeofday */ { .sy_narg = AS(getrusage_args), .sy_call = (sy_call_t *)sys_getrusage, .sy_auevent = AUE_GETRUSAGE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 117 = getrusage */ { .sy_narg = AS(getsockopt_args), .sy_call = (sy_call_t *)sys_getsockopt, .sy_auevent = AUE_GETSOCKOPT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 118 = getsockopt */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 119 = resuba */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 119 = nosys */ { .sy_narg = AS(readv_args), .sy_call = (sy_call_t *)sys_readv, .sy_auevent = AUE_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 120 = readv */ { .sy_narg = AS(writev_args), .sy_call = (sy_call_t *)sys_writev, .sy_auevent = AUE_WRITEV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 121 = writev */ { .sy_narg = AS(settimeofday_args), .sy_call = (sy_call_t *)sys_settimeofday, .sy_auevent = AUE_SETTIMEOFDAY, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 122 = settimeofday */ @@ -206,9 +206,9 @@ struct sysent sysent[] = { { .sy_narg = AS(quotactl_args), .sy_call = (sy_call_t *)sys_quotactl, .sy_auevent = AUE_QUOTACTL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 148 = quotactl */ { compat(0,quota), .sy_auevent = AUE_O_QUOTA, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 149 = old quota */ { compat(AS(getsockname_args),getsockname), .sy_auevent = AUE_GETSOCKNAME, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 150 = old getsockname */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 151 = sem_lock */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 152 = sem_wakeup */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 153 = asyncdaemon */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 151 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 152 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 153 = nosys */ { .sy_narg = AS(nlm_syscall_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 154 = nlm_syscall */ { .sy_narg = AS(nfssvc_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 155 = nfssvc */ { compat(AS(ogetdirentries_args),getdirentries), .sy_auevent = AUE_GETDIRENTRIES, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 156 = old getdirentries */ @@ -232,9 +232,9 @@ struct sysent sysent[] = { { compat6(AS(freebsd6_pwrite_args),pwrite), .sy_auevent = AUE_PWRITE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 174 = freebsd6 pwrite */ { .sy_narg = AS(setfib_args), .sy_call = (sy_call_t *)sys_setfib, .sy_auevent = AUE_SETFIB, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 175 = setfib */ { .sy_narg = AS(ntp_adjtime_args), .sy_call = (sy_call_t *)sys_ntp_adjtime, .sy_auevent = AUE_NTP_ADJTIME, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 176 = ntp_adjtime */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 177 = sfork */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 178 = getdescriptor */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 179 = setdescriptor */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 177 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 178 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 179 = nosys */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 180 = nosys */ { .sy_narg = AS(setgid_args), .sy_call = (sy_call_t *)sys_setgid, .sy_auevent = AUE_SETGID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 181 = setgid */ { .sy_narg = AS(setegid_args), .sy_call = (sy_call_t *)sys_setegid, .sy_auevent = AUE_SETEGID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 182 = setegid */ @@ -473,9 +473,9 @@ struct sysent sysent[] = { { .sy_narg = AS(__mac_execve_args), .sy_call = (sy_call_t *)sys___mac_execve, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 415 = __mac_execve */ { .sy_narg = AS(sigaction_args), .sy_call = (sy_call_t *)sys_sigaction, .sy_auevent = AUE_SIGACTION, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 416 = sigaction */ { .sy_narg = AS(sigreturn_args), .sy_call = (sy_call_t *)sys_sigreturn, .sy_auevent = AUE_SIGRETURN, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 417 = sigreturn */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 418 = __xstat */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 419 = __xfstat */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 420 = __xlstat */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 418 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 419 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 420 = nosys */ { .sy_narg = AS(getcontext_args), .sy_call = (sy_call_t *)sys_getcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 421 = getcontext */ { .sy_narg = AS(setcontext_args), .sy_call = (sy_call_t *)sys_setcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 422 = setcontext */ { .sy_narg = AS(swapcontext_args), .sy_call = (sy_call_t *)sys_swapcontext, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 423 = swapcontext */ @@ -524,8 +524,8 @@ struct sysent sysent[] = { { .sy_narg = AS(rtprio_thread_args), .sy_call = (sy_call_t *)sys_rtprio_thread, .sy_auevent = AUE_RTPRIO, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 466 = rtprio_thread */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 467 = nosys */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 468 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 469 = __getpath_fromfd */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 470 = __getpath_fromaddr */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 469 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 470 = nosys */ { .sy_narg = AS(sctp_peeloff_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_ABSENT }, /* 471 = sctp_peeloff */ { .sy_narg = AS(sctp_generic_sendmsg_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_ABSENT }, /* 472 = sctp_generic_sendmsg */ { .sy_narg = AS(sctp_generic_sendmsg_iov_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_ABSENT }, /* 473 = sctp_generic_sendmsg_iov */ @@ -576,7 +576,7 @@ struct sysent sysent[] = { { .sy_narg = AS(pdfork_args), .sy_call = (sy_call_t *)sys_pdfork, .sy_auevent = AUE_PDFORK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 518 = pdfork */ { .sy_narg = AS(pdkill_args), .sy_call = (sy_call_t *)sys_pdkill, .sy_auevent = AUE_PDKILL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 519 = pdkill */ { .sy_narg = AS(pdgetpid_args), .sy_call = (sy_call_t *)sys_pdgetpid, .sy_auevent = AUE_PDGETPID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 520 = pdgetpid */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 521 = pdwait4 */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 521 = nosys */ { .sy_narg = AS(pselect_args), .sy_call = (sy_call_t *)sys_pselect, .sy_auevent = AUE_SELECT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 522 = pselect */ { .sy_narg = AS(getloginclass_args), .sy_call = (sy_call_t *)sys_getloginclass, .sy_auevent = AUE_GETLOGINCLASS, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 523 = getloginclass */ { .sy_narg = AS(setloginclass_args), .sy_call = (sy_call_t *)sys_setloginclass, .sy_auevent = AUE_SETLOGINCLASS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 524 = setloginclass */ diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 88fa3aee980f..c8a0f0ed378f 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -97,10 +97,10 @@ const char *syscallnames[] = { "compat.sethostname", /* 88 = old sethostname */ "getdtablesize", /* 89 = getdtablesize */ "dup2", /* 90 = dup2 */ - "#91", /* 91 = getdopt */ + "#91", /* 91 = nosys */ "fcntl", /* 92 = fcntl */ "select", /* 93 = select */ - "#94", /* 94 = setdopt */ + "#94", /* 94 = nosys */ "fsync", /* 95 = fsync */ "setpriority", /* 96 = setpriority */ "socket", /* 97 = socket */ @@ -125,7 +125,7 @@ const char *syscallnames[] = { "gettimeofday", /* 116 = gettimeofday */ "getrusage", /* 117 = getrusage */ "getsockopt", /* 118 = getsockopt */ - "#119", /* 119 = resuba */ + "#119", /* 119 = nosys */ "readv", /* 120 = readv */ "writev", /* 121 = writev */ "settimeofday", /* 122 = settimeofday */ @@ -157,9 +157,9 @@ const char *syscallnames[] = { "quotactl", /* 148 = quotactl */ "compat.quota", /* 149 = old quota */ "compat.getsockname", /* 150 = old getsockname */ - "#151", /* 151 = sem_lock */ - "#152", /* 152 = sem_wakeup */ - "#153", /* 153 = asyncdaemon */ + "#151", /* 151 = nosys */ + "#152", /* 152 = nosys */ + "#153", /* 153 = nosys */ "nlm_syscall", /* 154 = nlm_syscall */ "nfssvc", /* 155 = nfssvc */ "compat.getdirentries", /* 156 = old getdirentries */ @@ -183,9 +183,9 @@ const char *syscallnames[] = { "compat6.pwrite", /* 174 = freebsd6 pwrite */ "setfib", /* 175 = setfib */ "ntp_adjtime", /* 176 = ntp_adjtime */ - "#177", /* 177 = sfork */ - "#178", /* 178 = getdescriptor */ - "#179", /* 179 = setdescriptor */ + "#177", /* 177 = nosys */ + "#178", /* 178 = nosys */ + "#179", /* 179 = nosys */ "#180", /* 180 = nosys */ "setgid", /* 181 = setgid */ "setegid", /* 182 = setegid */ @@ -424,9 +424,9 @@ const char *syscallnames[] = { "__mac_execve", /* 415 = __mac_execve */ "sigaction", /* 416 = sigaction */ "sigreturn", /* 417 = sigreturn */ - "#418", /* 418 = __xstat */ - "#419", /* 419 = __xfstat */ - "#420", /* 420 = __xlstat */ + "#418", /* 418 = nosys */ + "#419", /* 419 = nosys */ + "#420", /* 420 = nosys */ "getcontext", /* 421 = getcontext */ "setcontext", /* 422 = setcontext */ "swapcontext", /* 423 = swapcontext */ @@ -475,8 +475,8 @@ const char *syscallnames[] = { "rtprio_thread", /* 466 = rtprio_thread */ "#467", /* 467 = nosys */ "#468", /* 468 = nosys */ - "#469", /* 469 = __getpath_fromfd */ - "#470", /* 470 = __getpath_fromaddr */ + "#469", /* 469 = nosys */ + "#470", /* 470 = nosys */ "sctp_peeloff", /* 471 = sctp_peeloff */ "sctp_generic_sendmsg", /* 472 = sctp_generic_sendmsg */ "sctp_generic_sendmsg_iov", /* 473 = sctp_generic_sendmsg_iov */ @@ -527,7 +527,7 @@ const char *syscallnames[] = { "pdfork", /* 518 = pdfork */ "pdkill", /* 519 = pdkill */ "pdgetpid", /* 520 = pdgetpid */ - "#521", /* 521 = pdwait4 */ + "#521", /* 521 = nosys */ "pselect", /* 522 = pselect */ "getloginclass", /* 523 = getloginclass */ "setloginclass", /* 524 = setloginclass */ diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 5c6ebeb9b52f..c4841ffed3ee 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -587,7 +587,7 @@ u_int to ); } -91 AUE_NULL UNIMPL getdopt +91 AUE_NULL UNIMPL nosys 92 AUE_FCNTL STD { int fcntl( int fd, @@ -606,7 +606,7 @@ _In_opt_ struct timeval *tv ); } -94 AUE_NULL UNIMPL setdopt +94 AUE_NULL UNIMPL nosys 95 AUE_FSYNC STD { int fsync( int fd @@ -756,7 +756,7 @@ _Inout_ int *avalsize ); } -119 AUE_NULL UNIMPL resuba (BSD/OS 2.x) +119 AUE_NULL UNIMPL nosys 120 AUE_READV STD { int readv( int fd, @@ -945,13 +945,7 @@ ); } getsockname getsockname_args int -; Syscalls 151-180 inclusive are reserved for vendor-specific -; system calls. (This includes various calls added for compatibity -; with other Unix variants.) -; Some of these calls are now supported by BSD. -151 AUE_NULL UNIMPL sem_lock (BSD/OS 2.x) -152 AUE_NULL UNIMPL sem_wakeup (BSD/OS 2.x) -153 AUE_NULL UNIMPL asyncdaemon (BSD/OS 2.x) +151-153 AUE_NULL UNIMPL nosys ; 154 is initialised by the NLM code, if present. 154 AUE_NULL NOSTD { int nlm_syscall( @@ -1092,12 +1086,7 @@ _Inout_ struct timex *tp ); } -177 AUE_NULL UNIMPL sfork (BSD/OS 2.x) -178 AUE_NULL UNIMPL getdescriptor (BSD/OS 2.x) -179 AUE_NULL UNIMPL setdescriptor (BSD/OS 2.x) -180 AUE_NULL UNIMPL nosys - -; Syscalls 181-199 are used by/reserved for BSD +177-180 AUE_NULL UNIMPL nosys 181 AUE_SETGID STD { int setgid( gid_t gid @@ -1435,7 +1424,6 @@ ); } 249 AUE_NULL UNIMPL nosys -; syscall numbers initially used in OpenBSD 250 AUE_MINHERIT STD { int minherit( _In_ void *addr, @@ -2208,9 +2196,7 @@ _In_ const struct __ucontext *sigcntxp ); } -418 AUE_NULL UNIMPL __xstat -419 AUE_NULL UNIMPL __xfstat -420 AUE_NULL UNIMPL __xlstat +418-420 AUE_NULL UNIMPL nosys 421 AUE_NULL STD { int getcontext( _Out_ struct __ucontext *ucp @@ -2485,9 +2471,7 @@ _Inout_ struct rtprio *rtp ); } -467-468 AUE_NULL UNIMPL nosys -469 AUE_NULL UNIMPL __getpath_fromfd -470 AUE_NULL UNIMPL __getpath_fromaddr +467-470 AUE_NULL UNIMPL nosys 471 AUE_SCTP_PEELOFF NOSTD { int sctp_peeloff( int sd, @@ -2843,7 +2827,7 @@ _Out_ pid_t *pidp ); } -521 AUE_PDWAIT UNIMPL pdwait4 +521 AUE_NULL UNIMPL nosys 522 AUE_SELECT STD { int pselect( int nd, From owner-dev-commits-src-main@freebsd.org Tue Jan 26 18:28: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 66AF24FB854; Tue, 26 Jan 2021 18:28: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 4DQFbq2SNnz3l6D; Tue, 26 Jan 2021 18:28: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 4787D68C9; Tue, 26 Jan 2021 18:28: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 10QISNpa066373; Tue, 26 Jan 2021 18:28:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QISNKl066371; Tue, 26 Jan 2021 18:28:23 GMT (envelope-from git) Date: Tue, 26 Jan 2021 18:28:23 GMT Message-Id: <202101261828.10QISNKl066371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 119fa6ee8a80 - main - syscalls.master: Add a new syscall type: RESERVED MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 119fa6ee8a8056aab5e4ab1719d3c563cdb4a95a 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, 26 Jan 2021 18:28:23 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=119fa6ee8a8056aab5e4ab1719d3c563cdb4a95a commit 119fa6ee8a8056aab5e4ab1719d3c563cdb4a95a Author: Brooks Davis AuthorDate: 2021-01-26 18:27:44 +0000 Commit: Brooks Davis CommitDate: 2021-01-26 18:27:44 +0000 syscalls.master: Add a new syscall type: RESERVED RESERVED syscall number are reserved for local/vendor use. RESERVED is identical to UNIMPL except that comments are ignored. Reviewed by: kevans Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27988 --- sys/kern/syscalls.master | 3 ++- sys/tools/makesyscalls.lua | 23 +++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index c4841ffed3ee..2ddf984549a7 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -11,7 +11,7 @@ ; there is no audit event for the call at this time. For the ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, +; type one of STD, OBSOL, RESERVED, UNIMPL, COMPAT, COMPAT4, COMPAT6, ; COMPAT7, COMPAT11, COMPAT12, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) @@ -32,6 +32,7 @@ ; COMPAT11 included on COMPAT_FREEBSD11 #ifdef (FreeBSD 11 compat) ; COMPAT12 included on COMPAT_FREEBSD12 #ifdef (FreeBSD 12 compat) ; OBSOL obsolete, not included in system, only specifies name +; RESERVED reserved for local or vendor use ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically ; compiled in; sysent entry will be filled with lkmressys diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua index e225e9f7ebbe..3b88c65c4440 100644 --- a/sys/tools/makesyscalls.lua +++ b/sys/tools/makesyscalls.lua @@ -144,12 +144,13 @@ local known_abi_flags = { local known_flags = { STD = 0x00000001, OBSOL = 0x00000002, - UNIMPL = 0x00000004, - NODEF = 0x00000008, - NOARGS = 0x00000010, - NOPROTO = 0x00000020, - NOSTD = 0x00000040, - NOTSTATIC = 0x00000080, + RESERVED = 0x00000004, + UNIMPL = 0x00000008, + NODEF = 0x00000010, + NOARGS = 0x00000020, + NOPROTO = 0x00000040, + NOSTD = 0x00000080, + NOTSTATIC = 0x00000100, -- Compat flags start from here. We have plenty of space. } @@ -905,6 +906,10 @@ local function handle_unimpl(sysnum, sysstart, sysend, comment) end end +local function handle_reserved(sysnum, sysstart, sysend, comment) + handle_unimpl(sysnum, sysstart, sysend, "reserved for local use") +end + process_syscall_def = function(line) local sysstart, sysend, flags, funcname, sysflags local thr_flag, syscallret @@ -949,8 +954,8 @@ process_syscall_def = function(line) flags = flags | known_flags[flag] end - if (flags & known_flags["UNIMPL"]) == 0 and sysnum == nil then - abort(1, "Range only allowed with UNIMPL: " .. line) + if (flags & get_mask({"RESERVED", "UNIMPL"})) == 0 and sysnum == nil then + abort(1, "Range only allowed with RESERVED and UNIMPL: " .. line) end if (flags & known_flags["NOTSTATIC"]) ~= 0 then @@ -1114,6 +1119,8 @@ process_syscall_def = function(line) argalias) elseif flags & known_flags["OBSOL"] ~= 0 then handle_obsol(sysnum, funcname, funcomment) + elseif flags & known_flags["RESERVED"] ~= 0 then + handle_reserved(sysnum, sysstart, sysend) elseif flags & known_flags["UNIMPL"] ~= 0 then handle_unimpl(sysnum, sysstart, sysend, funcomment) else From owner-dev-commits-src-main@freebsd.org Tue Jan 26 18:28: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 4274C4FBA9F; Tue, 26 Jan 2021 18:28:25 +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 4DQFbr53FBz3lSl; Tue, 26 Jan 2021 18:28:24 +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 6DCD268CA; Tue, 26 Jan 2021 18:28:24 +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 10QISObx066393; Tue, 26 Jan 2021 18:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QISOKh066392; Tue, 26 Jan 2021 18:28:24 GMT (envelope-from git) Date: Tue, 26 Jan 2021 18:28:24 GMT Message-Id: <202101261828.10QISOKh066392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: d89c1c461ce3 - main - Reserve gaps in syscall numbers for local use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d89c1c461ce31bfc789dbb7bc5f4fce5824c595e 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, 26 Jan 2021 18:28:27 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d89c1c461ce31bfc789dbb7bc5f4fce5824c595e commit d89c1c461ce31bfc789dbb7bc5f4fce5824c595e Author: Brooks Davis AuthorDate: 2021-01-26 18:27:45 +0000 Commit: Brooks Davis CommitDate: 2021-01-26 18:27:45 +0000 Reserve gaps in syscall numbers for local use It is best for auditing of syscalls.master if we only append to the file. Reserving unimplemented system call numbers for local use makes this policy and provides a large set of syscall numbers FreeBSD derivatives can use without risk of conflict. Reviewed by: jhb, kevans, kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27988 --- sys/kern/init_sysent.c | 120 +++++++++++++++++++++++------------------------ sys/kern/syscalls.c | 120 +++++++++++++++++++++++------------------------ sys/kern/syscalls.master | 55 ++++++++++------------ 3 files changed, 145 insertions(+), 150 deletions(-) diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index e6a26a649508..d47a8fb844a8 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -146,10 +146,10 @@ struct sysent sysent[] = { { compat(AS(osethostname_args),sethostname), .sy_auevent = AUE_SYSCTL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 88 = old sethostname */ { .sy_narg = 0, .sy_call = (sy_call_t *)sys_getdtablesize, .sy_auevent = AUE_GETDTABLESIZE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 89 = getdtablesize */ { .sy_narg = AS(dup2_args), .sy_call = (sy_call_t *)sys_dup2, .sy_auevent = AUE_DUP2, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 90 = dup2 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 91 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 91 = reserved for local use */ { .sy_narg = AS(fcntl_args), .sy_call = (sy_call_t *)sys_fcntl, .sy_auevent = AUE_FCNTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 92 = fcntl */ { .sy_narg = AS(select_args), .sy_call = (sy_call_t *)sys_select, .sy_auevent = AUE_SELECT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 93 = select */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 94 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 94 = reserved for local use */ { .sy_narg = AS(fsync_args), .sy_call = (sy_call_t *)sys_fsync, .sy_auevent = AUE_FSYNC, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 95 = fsync */ { .sy_narg = AS(setpriority_args), .sy_call = (sy_call_t *)sys_setpriority, .sy_auevent = AUE_SETPRIORITY, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 96 = setpriority */ { .sy_narg = AS(socket_args), .sy_call = (sy_call_t *)sys_socket, .sy_auevent = AUE_SOCKET, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 97 = socket */ @@ -174,7 +174,7 @@ struct sysent sysent[] = { { .sy_narg = AS(gettimeofday_args), .sy_call = (sy_call_t *)sys_gettimeofday, .sy_auevent = AUE_GETTIMEOFDAY, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 116 = gettimeofday */ { .sy_narg = AS(getrusage_args), .sy_call = (sy_call_t *)sys_getrusage, .sy_auevent = AUE_GETRUSAGE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 117 = getrusage */ { .sy_narg = AS(getsockopt_args), .sy_call = (sy_call_t *)sys_getsockopt, .sy_auevent = AUE_GETSOCKOPT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 118 = getsockopt */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 119 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 119 = reserved for local use */ { .sy_narg = AS(readv_args), .sy_call = (sy_call_t *)sys_readv, .sy_auevent = AUE_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 120 = readv */ { .sy_narg = AS(writev_args), .sy_call = (sy_call_t *)sys_writev, .sy_auevent = AUE_WRITEV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 121 = writev */ { .sy_narg = AS(settimeofday_args), .sy_call = (sy_call_t *)sys_settimeofday, .sy_auevent = AUE_SETTIMEOFDAY, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 122 = settimeofday */ @@ -206,15 +206,15 @@ struct sysent sysent[] = { { .sy_narg = AS(quotactl_args), .sy_call = (sy_call_t *)sys_quotactl, .sy_auevent = AUE_QUOTACTL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 148 = quotactl */ { compat(0,quota), .sy_auevent = AUE_O_QUOTA, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 149 = old quota */ { compat(AS(getsockname_args),getsockname), .sy_auevent = AUE_GETSOCKNAME, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 150 = old getsockname */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 151 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 152 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 153 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 151 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 152 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 153 = reserved for local use */ { .sy_narg = AS(nlm_syscall_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 154 = nlm_syscall */ { .sy_narg = AS(nfssvc_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 155 = nfssvc */ { compat(AS(ogetdirentries_args),getdirentries), .sy_auevent = AUE_GETDIRENTRIES, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 156 = old getdirentries */ { compat4(AS(freebsd4_statfs_args),statfs), .sy_auevent = AUE_STATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 157 = freebsd4 statfs */ { compat4(AS(freebsd4_fstatfs_args),fstatfs), .sy_auevent = AUE_FSTATFS, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 158 = freebsd4 fstatfs */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 159 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 159 = reserved for local use */ { .sy_narg = AS(lgetfh_args), .sy_call = (sy_call_t *)sys_lgetfh, .sy_auevent = AUE_LGETFH, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 160 = lgetfh */ { .sy_narg = AS(getfh_args), .sy_call = (sy_call_t *)sys_getfh, .sy_auevent = AUE_NFS_GETFH, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 161 = getfh */ { compat4(AS(freebsd4_getdomainname_args),getdomainname), .sy_auevent = AUE_SYSCTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 162 = freebsd4 getdomainname */ @@ -222,20 +222,20 @@ struct sysent sysent[] = { { compat4(AS(freebsd4_uname_args),uname), .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 164 = freebsd4 uname */ { .sy_narg = AS(sysarch_args), .sy_call = (sy_call_t *)sysarch, .sy_auevent = AUE_SYSARCH, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 165 = sysarch */ { .sy_narg = AS(rtprio_args), .sy_call = (sy_call_t *)sys_rtprio, .sy_auevent = AUE_RTPRIO, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 166 = rtprio */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 167 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 168 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 167 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 168 = reserved for local use */ { .sy_narg = AS(semsys_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 169 = semsys */ { .sy_narg = AS(msgsys_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 170 = msgsys */ { .sy_narg = AS(shmsys_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 171 = shmsys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 172 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 172 = reserved for local use */ { compat6(AS(freebsd6_pread_args),pread), .sy_auevent = AUE_PREAD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 173 = freebsd6 pread */ { compat6(AS(freebsd6_pwrite_args),pwrite), .sy_auevent = AUE_PWRITE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 174 = freebsd6 pwrite */ { .sy_narg = AS(setfib_args), .sy_call = (sy_call_t *)sys_setfib, .sy_auevent = AUE_SETFIB, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 175 = setfib */ { .sy_narg = AS(ntp_adjtime_args), .sy_call = (sy_call_t *)sys_ntp_adjtime, .sy_auevent = AUE_NTP_ADJTIME, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 176 = ntp_adjtime */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 177 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 178 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 179 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 180 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 177 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 178 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 179 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 180 = reserved for local use */ { .sy_narg = AS(setgid_args), .sy_call = (sy_call_t *)sys_setgid, .sy_auevent = AUE_SETGID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 181 = setgid */ { .sy_narg = AS(setegid_args), .sy_call = (sy_call_t *)sys_setegid, .sy_auevent = AUE_SETEGID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 182 = setegid */ { .sy_narg = AS(seteuid_args), .sy_call = (sy_call_t *)sys_seteuid, .sy_auevent = AUE_SETEUID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 183 = seteuid */ @@ -248,7 +248,7 @@ struct sysent sysent[] = { { compat11(AS(freebsd11_lstat_args),lstat), .sy_auevent = AUE_LSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 190 = freebsd11 lstat */ { .sy_narg = AS(pathconf_args), .sy_call = (sy_call_t *)sys_pathconf, .sy_auevent = AUE_PATHCONF, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 191 = pathconf */ { .sy_narg = AS(fpathconf_args), .sy_call = (sy_call_t *)sys_fpathconf, .sy_auevent = AUE_FPATHCONF, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 192 = fpathconf */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 193 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 193 = reserved for local use */ { .sy_narg = AS(__getrlimit_args), .sy_call = (sy_call_t *)sys_getrlimit, .sy_auevent = AUE_GETRLIMIT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 194 = getrlimit */ { .sy_narg = AS(__setrlimit_args), .sy_call = (sy_call_t *)sys_setrlimit, .sy_auevent = AUE_SETRLIMIT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 195 = setrlimit */ { compat11(AS(freebsd11_getdirentries_args),getdirentries), .sy_auevent = AUE_GETDIRENTRIES, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 196 = freebsd11 getdirentries */ @@ -263,7 +263,7 @@ struct sysent sysent[] = { { .sy_narg = AS(undelete_args), .sy_call = (sy_call_t *)sys_undelete, .sy_auevent = AUE_UNDELETE, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 205 = undelete */ { .sy_narg = AS(futimes_args), .sy_call = (sy_call_t *)sys_futimes, .sy_auevent = AUE_FUTIMES, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 206 = futimes */ { .sy_narg = AS(getpgid_args), .sy_call = (sy_call_t *)sys_getpgid, .sy_auevent = AUE_GETPGID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 207 = getpgid */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 208 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 208 = reserved for local use */ { .sy_narg = AS(poll_args), .sy_call = (sy_call_t *)sys_poll, .sy_auevent = AUE_POLL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 209 = poll */ { .sy_narg = AS(nosys_args), .sy_call = (sy_call_t *)lkmnosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 210 = lkmnosys */ { .sy_narg = AS(nosys_args), .sy_call = (sy_call_t *)lkmnosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 211 = lkmnosys */ @@ -300,11 +300,11 @@ struct sysent sysent[] = { { .sy_narg = AS(ffclock_setestimate_args), .sy_call = (sy_call_t *)sys_ffclock_setestimate, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 242 = ffclock_setestimate */ { .sy_narg = AS(ffclock_getestimate_args), .sy_call = (sy_call_t *)sys_ffclock_getestimate, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 243 = ffclock_getestimate */ { .sy_narg = AS(clock_nanosleep_args), .sy_call = (sy_call_t *)sys_clock_nanosleep, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 244 = clock_nanosleep */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 245 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 246 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 245 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 246 = reserved for local use */ { .sy_narg = AS(clock_getcpuclockid2_args), .sy_call = (sy_call_t *)sys_clock_getcpuclockid2, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 247 = clock_getcpuclockid2 */ { .sy_narg = AS(ntp_gettime_args), .sy_call = (sy_call_t *)sys_ntp_gettime, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 248 = ntp_gettime */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 249 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 249 = reserved for local use */ { .sy_narg = AS(minherit_args), .sy_call = (sy_call_t *)sys_minherit, .sy_auevent = AUE_MINHERIT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 250 = minherit */ { .sy_narg = AS(rfork_args), .sy_call = (sy_call_t *)sys_rfork, .sy_auevent = AUE_RFORK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 251 = rfork */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 252 = obsolete openbsd_poll */ @@ -313,22 +313,22 @@ struct sysent sysent[] = { { .sy_narg = AS(aio_read_args), .sy_call = (sy_call_t *)sys_aio_read, .sy_auevent = AUE_AIO_READ, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 255 = aio_read */ { .sy_narg = AS(aio_write_args), .sy_call = (sy_call_t *)sys_aio_write, .sy_auevent = AUE_AIO_WRITE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 256 = aio_write */ { .sy_narg = AS(lio_listio_args), .sy_call = (sy_call_t *)sys_lio_listio, .sy_auevent = AUE_LIO_LISTIO, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 257 = lio_listio */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 258 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 259 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 260 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 261 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 262 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 263 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 264 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 265 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 266 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 267 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 268 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 269 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 270 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 271 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 258 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 259 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 260 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 261 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 262 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 263 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 264 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 265 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 266 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 267 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 268 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 269 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 270 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 271 = reserved for local use */ { compat11(AS(freebsd11_getdents_args),getdents), .sy_auevent = AUE_O_GETDENTS, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 272 = freebsd11 getdents */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 273 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 273 = reserved for local use */ { .sy_narg = AS(lchmod_args), .sy_call = (sy_call_t *)sys_lchmod, .sy_auevent = AUE_LCHMOD, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 274 = lchmod */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 275 = obsolete netbsd_lchown */ { .sy_narg = AS(lutimes_args), .sy_call = (sy_call_t *)sys_lutimes, .sy_auevent = AUE_LUTIMES, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 276 = lutimes */ @@ -336,22 +336,22 @@ struct sysent sysent[] = { { compat11(AS(freebsd11_nstat_args),nstat), .sy_auevent = AUE_STAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 278 = freebsd11 nstat */ { compat11(AS(freebsd11_nfstat_args),nfstat), .sy_auevent = AUE_FSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 279 = freebsd11 nfstat */ { compat11(AS(freebsd11_nlstat_args),nlstat), .sy_auevent = AUE_LSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 280 = freebsd11 nlstat */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 281 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 282 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 283 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 284 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 285 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 286 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 287 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 288 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 281 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 282 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 283 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 284 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 285 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 286 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 287 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 288 = reserved for local use */ { .sy_narg = AS(preadv_args), .sy_call = (sy_call_t *)sys_preadv, .sy_auevent = AUE_PREADV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 289 = preadv */ { .sy_narg = AS(pwritev_args), .sy_call = (sy_call_t *)sys_pwritev, .sy_auevent = AUE_PWRITEV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 290 = pwritev */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 291 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 292 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 293 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 294 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 295 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 296 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 291 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 292 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 293 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 294 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 295 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 296 = reserved for local use */ { compat4(AS(freebsd4_fhstatfs_args),fhstatfs), .sy_auevent = AUE_FHSTATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 297 = freebsd4 fhstatfs */ { .sy_narg = AS(fhopen_args), .sy_call = (sy_call_t *)sys_fhopen, .sy_auevent = AUE_FHOPEN, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 298 = fhopen */ { compat11(AS(freebsd11_fhstat_args),fhstat), .sy_auevent = AUE_FHSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 299 = freebsd11 fhstat */ @@ -425,7 +425,7 @@ struct sysent sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 367 = obsolete __cap_get_file */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 368 = obsolete __cap_set_fd */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 369 = obsolete __cap_set_file */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 370 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 370 = reserved for local use */ { .sy_narg = AS(extattr_set_fd_args), .sy_call = (sy_call_t *)sys_extattr_set_fd, .sy_auevent = AUE_EXTATTR_SET_FD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 371 = extattr_set_fd */ { .sy_narg = AS(extattr_get_fd_args), .sy_call = (sy_call_t *)sys_extattr_get_fd, .sy_auevent = AUE_EXTATTR_GET_FD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 372 = extattr_get_fd */ { .sy_narg = AS(extattr_delete_fd_args), .sy_call = (sy_call_t *)sys_extattr_delete_fd, .sy_auevent = AUE_EXTATTR_DELETE_FD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 373 = extattr_delete_fd */ @@ -454,7 +454,7 @@ struct sysent sysent[] = { { compat11(AS(freebsd11_statfs_args),statfs), .sy_auevent = AUE_STATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 396 = freebsd11 statfs */ { compat11(AS(freebsd11_fstatfs_args),fstatfs), .sy_auevent = AUE_FSTATFS, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 397 = freebsd11 fstatfs */ { compat11(AS(freebsd11_fhstatfs_args),fhstatfs), .sy_auevent = AUE_FHSTATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 398 = freebsd11 fhstatfs */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 399 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 399 = reserved for local use */ { .sy_narg = AS(ksem_close_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 400 = ksem_close */ { .sy_narg = AS(ksem_post_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 401 = ksem_post */ { .sy_narg = AS(ksem_wait_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 402 = ksem_wait */ @@ -473,9 +473,9 @@ struct sysent sysent[] = { { .sy_narg = AS(__mac_execve_args), .sy_call = (sy_call_t *)sys___mac_execve, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 415 = __mac_execve */ { .sy_narg = AS(sigaction_args), .sy_call = (sy_call_t *)sys_sigaction, .sy_auevent = AUE_SIGACTION, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 416 = sigaction */ { .sy_narg = AS(sigreturn_args), .sy_call = (sy_call_t *)sys_sigreturn, .sy_auevent = AUE_SIGRETURN, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 417 = sigreturn */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 418 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 419 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 420 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 418 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 419 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 420 = reserved for local use */ { .sy_narg = AS(getcontext_args), .sy_call = (sy_call_t *)sys_getcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 421 = getcontext */ { .sy_narg = AS(setcontext_args), .sy_call = (sy_call_t *)sys_setcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 422 = setcontext */ { .sy_narg = AS(swapcontext_args), .sy_call = (sy_call_t *)sys_swapcontext, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 423 = swapcontext */ @@ -489,8 +489,8 @@ struct sysent sysent[] = { { .sy_narg = AS(thr_exit_args), .sy_call = (sy_call_t *)sys_thr_exit, .sy_auevent = AUE_THR_EXIT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 431 = thr_exit */ { .sy_narg = AS(thr_self_args), .sy_call = (sy_call_t *)sys_thr_self, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 432 = thr_self */ { .sy_narg = AS(thr_kill_args), .sy_call = (sy_call_t *)sys_thr_kill, .sy_auevent = AUE_THR_KILL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 433 = thr_kill */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 434 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 435 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 434 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 435 = reserved for local use */ { .sy_narg = AS(jail_attach_args), .sy_call = (sy_call_t *)sys_jail_attach, .sy_auevent = AUE_JAIL_ATTACH, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 436 = jail_attach */ { .sy_narg = AS(extattr_list_fd_args), .sy_call = (sy_call_t *)sys_extattr_list_fd, .sy_auevent = AUE_EXTATTR_LIST_FD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 437 = extattr_list_fd */ { .sy_narg = AS(extattr_list_file_args), .sy_call = (sy_call_t *)sys_extattr_list_file, .sy_auevent = AUE_EXTATTR_LIST_FILE, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 438 = extattr_list_file */ @@ -522,10 +522,10 @@ struct sysent sysent[] = { { .sy_narg = AS(thr_set_name_args), .sy_call = (sy_call_t *)sys_thr_set_name, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 464 = thr_set_name */ { .sy_narg = AS(aio_fsync_args), .sy_call = (sy_call_t *)sys_aio_fsync, .sy_auevent = AUE_AIO_FSYNC, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 465 = aio_fsync */ { .sy_narg = AS(rtprio_thread_args), .sy_call = (sy_call_t *)sys_rtprio_thread, .sy_auevent = AUE_RTPRIO, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 466 = rtprio_thread */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 467 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 468 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 469 = nosys */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 470 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 467 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 468 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 469 = reserved for local use */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 470 = reserved for local use */ { .sy_narg = AS(sctp_peeloff_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_ABSENT }, /* 471 = sctp_peeloff */ { .sy_narg = AS(sctp_generic_sendmsg_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_ABSENT }, /* 472 = sctp_generic_sendmsg */ { .sy_narg = AS(sctp_generic_sendmsg_iov_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_ABSENT }, /* 473 = sctp_generic_sendmsg_iov */ @@ -576,7 +576,7 @@ struct sysent sysent[] = { { .sy_narg = AS(pdfork_args), .sy_call = (sy_call_t *)sys_pdfork, .sy_auevent = AUE_PDFORK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 518 = pdfork */ { .sy_narg = AS(pdkill_args), .sy_call = (sy_call_t *)sys_pdkill, .sy_auevent = AUE_PDKILL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 519 = pdkill */ { .sy_narg = AS(pdgetpid_args), .sy_call = (sy_call_t *)sys_pdgetpid, .sy_auevent = AUE_PDGETPID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 520 = pdgetpid */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 521 = nosys */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 521 = reserved for local use */ { .sy_narg = AS(pselect_args), .sy_call = (sy_call_t *)sys_pselect, .sy_auevent = AUE_SELECT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 522 = pselect */ { .sy_narg = AS(getloginclass_args), .sy_call = (sy_call_t *)sys_getloginclass, .sy_auevent = AUE_GETLOGINCLASS, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 523 = getloginclass */ { .sy_narg = AS(setloginclass_args), .sy_call = (sy_call_t *)sys_setloginclass, .sy_auevent = AUE_SETLOGINCLASS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 524 = setloginclass */ diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index c8a0f0ed378f..f75e4aaea790 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -97,10 +97,10 @@ const char *syscallnames[] = { "compat.sethostname", /* 88 = old sethostname */ "getdtablesize", /* 89 = getdtablesize */ "dup2", /* 90 = dup2 */ - "#91", /* 91 = nosys */ + "#91", /* 91 = reserved for local use */ "fcntl", /* 92 = fcntl */ "select", /* 93 = select */ - "#94", /* 94 = nosys */ + "#94", /* 94 = reserved for local use */ "fsync", /* 95 = fsync */ "setpriority", /* 96 = setpriority */ "socket", /* 97 = socket */ @@ -125,7 +125,7 @@ const char *syscallnames[] = { "gettimeofday", /* 116 = gettimeofday */ "getrusage", /* 117 = getrusage */ "getsockopt", /* 118 = getsockopt */ - "#119", /* 119 = nosys */ + "#119", /* 119 = reserved for local use */ "readv", /* 120 = readv */ "writev", /* 121 = writev */ "settimeofday", /* 122 = settimeofday */ @@ -157,15 +157,15 @@ const char *syscallnames[] = { "quotactl", /* 148 = quotactl */ "compat.quota", /* 149 = old quota */ "compat.getsockname", /* 150 = old getsockname */ - "#151", /* 151 = nosys */ - "#152", /* 152 = nosys */ - "#153", /* 153 = nosys */ + "#151", /* 151 = reserved for local use */ + "#152", /* 152 = reserved for local use */ + "#153", /* 153 = reserved for local use */ "nlm_syscall", /* 154 = nlm_syscall */ "nfssvc", /* 155 = nfssvc */ "compat.getdirentries", /* 156 = old getdirentries */ "compat4.statfs", /* 157 = freebsd4 statfs */ "compat4.fstatfs", /* 158 = freebsd4 fstatfs */ - "#159", /* 159 = nosys */ + "#159", /* 159 = reserved for local use */ "lgetfh", /* 160 = lgetfh */ "getfh", /* 161 = getfh */ "compat4.getdomainname", /* 162 = freebsd4 getdomainname */ @@ -173,20 +173,20 @@ const char *syscallnames[] = { "compat4.uname", /* 164 = freebsd4 uname */ "sysarch", /* 165 = sysarch */ "rtprio", /* 166 = rtprio */ - "#167", /* 167 = nosys */ - "#168", /* 168 = nosys */ + "#167", /* 167 = reserved for local use */ + "#168", /* 168 = reserved for local use */ "semsys", /* 169 = semsys */ "msgsys", /* 170 = msgsys */ "shmsys", /* 171 = shmsys */ - "#172", /* 172 = nosys */ + "#172", /* 172 = reserved for local use */ "compat6.pread", /* 173 = freebsd6 pread */ "compat6.pwrite", /* 174 = freebsd6 pwrite */ "setfib", /* 175 = setfib */ "ntp_adjtime", /* 176 = ntp_adjtime */ - "#177", /* 177 = nosys */ - "#178", /* 178 = nosys */ - "#179", /* 179 = nosys */ - "#180", /* 180 = nosys */ + "#177", /* 177 = reserved for local use */ + "#178", /* 178 = reserved for local use */ + "#179", /* 179 = reserved for local use */ + "#180", /* 180 = reserved for local use */ "setgid", /* 181 = setgid */ "setegid", /* 182 = setegid */ "seteuid", /* 183 = seteuid */ @@ -199,7 +199,7 @@ const char *syscallnames[] = { "compat11.lstat", /* 190 = freebsd11 lstat */ "pathconf", /* 191 = pathconf */ "fpathconf", /* 192 = fpathconf */ - "#193", /* 193 = nosys */ + "#193", /* 193 = reserved for local use */ "getrlimit", /* 194 = getrlimit */ "setrlimit", /* 195 = setrlimit */ "compat11.getdirentries", /* 196 = freebsd11 getdirentries */ @@ -214,7 +214,7 @@ const char *syscallnames[] = { "undelete", /* 205 = undelete */ "futimes", /* 206 = futimes */ "getpgid", /* 207 = getpgid */ - "#208", /* 208 = nosys */ + "#208", /* 208 = reserved for local use */ "poll", /* 209 = poll */ "lkmnosys", /* 210 = lkmnosys */ "lkmnosys", /* 211 = lkmnosys */ @@ -251,11 +251,11 @@ const char *syscallnames[] = { "ffclock_setestimate", /* 242 = ffclock_setestimate */ "ffclock_getestimate", /* 243 = ffclock_getestimate */ "clock_nanosleep", /* 244 = clock_nanosleep */ - "#245", /* 245 = nosys */ - "#246", /* 246 = nosys */ + "#245", /* 245 = reserved for local use */ + "#246", /* 246 = reserved for local use */ "clock_getcpuclockid2", /* 247 = clock_getcpuclockid2 */ "ntp_gettime", /* 248 = ntp_gettime */ - "#249", /* 249 = nosys */ + "#249", /* 249 = reserved for local use */ "minherit", /* 250 = minherit */ "rfork", /* 251 = rfork */ "obs_openbsd_poll", /* 252 = obsolete openbsd_poll */ @@ -264,22 +264,22 @@ const char *syscallnames[] = { "aio_read", /* 255 = aio_read */ "aio_write", /* 256 = aio_write */ "lio_listio", /* 257 = lio_listio */ - "#258", /* 258 = nosys */ - "#259", /* 259 = nosys */ - "#260", /* 260 = nosys */ - "#261", /* 261 = nosys */ - "#262", /* 262 = nosys */ - "#263", /* 263 = nosys */ - "#264", /* 264 = nosys */ - "#265", /* 265 = nosys */ - "#266", /* 266 = nosys */ - "#267", /* 267 = nosys */ - "#268", /* 268 = nosys */ - "#269", /* 269 = nosys */ - "#270", /* 270 = nosys */ - "#271", /* 271 = nosys */ + "#258", /* 258 = reserved for local use */ + "#259", /* 259 = reserved for local use */ + "#260", /* 260 = reserved for local use */ + "#261", /* 261 = reserved for local use */ + "#262", /* 262 = reserved for local use */ + "#263", /* 263 = reserved for local use */ + "#264", /* 264 = reserved for local use */ + "#265", /* 265 = reserved for local use */ + "#266", /* 266 = reserved for local use */ + "#267", /* 267 = reserved for local use */ + "#268", /* 268 = reserved for local use */ + "#269", /* 269 = reserved for local use */ + "#270", /* 270 = reserved for local use */ + "#271", /* 271 = reserved for local use */ "compat11.getdents", /* 272 = freebsd11 getdents */ - "#273", /* 273 = nosys */ + "#273", /* 273 = reserved for local use */ "lchmod", /* 274 = lchmod */ "obs_netbsd_lchown", /* 275 = obsolete netbsd_lchown */ "lutimes", /* 276 = lutimes */ @@ -287,22 +287,22 @@ const char *syscallnames[] = { "compat11.nstat", /* 278 = freebsd11 nstat */ "compat11.nfstat", /* 279 = freebsd11 nfstat */ "compat11.nlstat", /* 280 = freebsd11 nlstat */ - "#281", /* 281 = nosys */ - "#282", /* 282 = nosys */ - "#283", /* 283 = nosys */ - "#284", /* 284 = nosys */ - "#285", /* 285 = nosys */ - "#286", /* 286 = nosys */ - "#287", /* 287 = nosys */ - "#288", /* 288 = nosys */ + "#281", /* 281 = reserved for local use */ + "#282", /* 282 = reserved for local use */ + "#283", /* 283 = reserved for local use */ + "#284", /* 284 = reserved for local use */ + "#285", /* 285 = reserved for local use */ + "#286", /* 286 = reserved for local use */ + "#287", /* 287 = reserved for local use */ + "#288", /* 288 = reserved for local use */ "preadv", /* 289 = preadv */ "pwritev", /* 290 = pwritev */ - "#291", /* 291 = nosys */ - "#292", /* 292 = nosys */ - "#293", /* 293 = nosys */ - "#294", /* 294 = nosys */ - "#295", /* 295 = nosys */ - "#296", /* 296 = nosys */ + "#291", /* 291 = reserved for local use */ + "#292", /* 292 = reserved for local use */ + "#293", /* 293 = reserved for local use */ + "#294", /* 294 = reserved for local use */ + "#295", /* 295 = reserved for local use */ + "#296", /* 296 = reserved for local use */ "compat4.fhstatfs", /* 297 = freebsd4 fhstatfs */ "fhopen", /* 298 = fhopen */ "compat11.fhstat", /* 299 = freebsd11 fhstat */ @@ -376,7 +376,7 @@ const char *syscallnames[] = { "obs___cap_get_file", /* 367 = obsolete __cap_get_file */ "obs___cap_set_fd", /* 368 = obsolete __cap_set_fd */ "obs___cap_set_file", /* 369 = obsolete __cap_set_file */ - "#370", /* 370 = nosys */ + "#370", /* 370 = reserved for local use */ "extattr_set_fd", /* 371 = extattr_set_fd */ "extattr_get_fd", /* 372 = extattr_get_fd */ "extattr_delete_fd", /* 373 = extattr_delete_fd */ @@ -405,7 +405,7 @@ const char *syscallnames[] = { "compat11.statfs", /* 396 = freebsd11 statfs */ "compat11.fstatfs", /* 397 = freebsd11 fstatfs */ "compat11.fhstatfs", /* 398 = freebsd11 fhstatfs */ - "#399", /* 399 = nosys */ + "#399", /* 399 = reserved for local use */ "ksem_close", /* 400 = ksem_close */ "ksem_post", /* 401 = ksem_post */ "ksem_wait", /* 402 = ksem_wait */ @@ -424,9 +424,9 @@ const char *syscallnames[] = { "__mac_execve", /* 415 = __mac_execve */ "sigaction", /* 416 = sigaction */ "sigreturn", /* 417 = sigreturn */ - "#418", /* 418 = nosys */ - "#419", /* 419 = nosys */ - "#420", /* 420 = nosys */ + "#418", /* 418 = reserved for local use */ + "#419", /* 419 = reserved for local use */ + "#420", /* 420 = reserved for local use */ "getcontext", /* 421 = getcontext */ "setcontext", /* 422 = setcontext */ "swapcontext", /* 423 = swapcontext */ @@ -440,8 +440,8 @@ const char *syscallnames[] = { "thr_exit", /* 431 = thr_exit */ "thr_self", /* 432 = thr_self */ "thr_kill", /* 433 = thr_kill */ - "#434", /* 434 = nosys */ - "#435", /* 435 = nosys */ + "#434", /* 434 = reserved for local use */ + "#435", /* 435 = reserved for local use */ "jail_attach", /* 436 = jail_attach */ "extattr_list_fd", /* 437 = extattr_list_fd */ "extattr_list_file", /* 438 = extattr_list_file */ @@ -473,10 +473,10 @@ const char *syscallnames[] = { "thr_set_name", /* 464 = thr_set_name */ "aio_fsync", /* 465 = aio_fsync */ "rtprio_thread", /* 466 = rtprio_thread */ - "#467", /* 467 = nosys */ - "#468", /* 468 = nosys */ - "#469", /* 469 = nosys */ - "#470", /* 470 = nosys */ + "#467", /* 467 = reserved for local use */ + "#468", /* 468 = reserved for local use */ + "#469", /* 469 = reserved for local use */ + "#470", /* 470 = reserved for local use */ "sctp_peeloff", /* 471 = sctp_peeloff */ "sctp_generic_sendmsg", /* 472 = sctp_generic_sendmsg */ "sctp_generic_sendmsg_iov", /* 473 = sctp_generic_sendmsg_iov */ @@ -527,7 +527,7 @@ const char *syscallnames[] = { "pdfork", /* 518 = pdfork */ "pdkill", /* 519 = pdkill */ "pdgetpid", /* 520 = pdgetpid */ - "#521", /* 521 = nosys */ + "#521", /* 521 = reserved for local use */ "pselect", /* 522 = pselect */ "getloginclass", /* 523 = getloginclass */ "setloginclass", /* 524 = setloginclass */ diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 2ddf984549a7..95317d413209 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -4,6 +4,8 @@ ; System call name/number master file. ; Processed to created init_sysent.c, syscalls.c and syscall.h. +; New FreeBSD system calls should be added to the bottom of this file. + ; Columns: number audit type name alt{name,tag,rtyp}/comments ; number system call number, must be in order ; audit the audit event associated with the system call @@ -32,7 +34,7 @@ ; COMPAT11 included on COMPAT_FREEBSD11 #ifdef (FreeBSD 11 compat) ; COMPAT12 included on COMPAT_FREEBSD12 #ifdef (FreeBSD 12 compat) ; OBSOL obsolete, not included in system, only specifies name -; RESERVED reserved for local or vendor use +; RESERVED reserved for local or vendor use (not for FreeBSD) ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically ; compiled in; sysent entry will be filled with lkmressys @@ -80,12 +82,6 @@ #include #include -; Reserved/unimplemented system calls in the range 0-150 inclusive -; are reserved for use in future Berkeley releases. -; Additional system calls implemented in vendor and other -; redistributions should be placed in the reserved range at the end -; of the current calls. - 0 AUE_NULL STD { int nosys(void); } syscall nosys_args int @@ -588,7 +584,7 @@ u_int to ); } -91 AUE_NULL UNIMPL nosys +91 AUE_NULL RESERVED 92 AUE_FCNTL STD { int fcntl( int fd, @@ -607,7 +603,7 @@ _In_opt_ struct timeval *tv ); } -94 AUE_NULL UNIMPL nosys +94 AUE_NULL RESERVED 95 AUE_FSYNC STD { int fsync( int fd @@ -757,7 +753,7 @@ _Inout_ int *avalsize ); } -119 AUE_NULL UNIMPL nosys +119 AUE_NULL RESERVED 120 AUE_READV STD { int readv( int fd, @@ -946,7 +942,7 @@ ); } getsockname getsockname_args int -151-153 AUE_NULL UNIMPL nosys +151-153 AUE_NULL RESERVED ; 154 is initialised by the NLM code, if present. 154 AUE_NULL NOSTD { int nlm_syscall( @@ -983,7 +979,7 @@ _Out_ struct ostatfs *buf ); } -159 AUE_NULL UNIMPL nosys +159 AUE_NULL RESERVED 160 AUE_LGETFH STD { int lgetfh( _In_z_ const char *fname, @@ -1026,8 +1022,7 @@ _Inout_ struct rtprio *rtp ); } -167 AUE_NULL UNIMPL nosys -168 AUE_NULL UNIMPL nosys +167-168 AUE_NULL RESERVED 169 AUE_SEMSYS NOSTD { int semsys( int which, @@ -1058,7 +1053,7 @@ ); } ; XXX should be { int shmsys(int which, ...); } -172 AUE_NULL UNIMPL nosys +172 AUE_NULL RESERVED 173 AUE_PREAD COMPAT6 { ssize_t pread( int fd, @@ -1087,7 +1082,7 @@ _Inout_ struct timex *tp ); } -177-180 AUE_NULL UNIMPL nosys +177-180 AUE_NULL RESERVED 181 AUE_SETGID STD { int setgid( gid_t gid @@ -1137,7 +1132,7 @@ int name ); } -193 AUE_NULL UNIMPL nosys +193 AUE_NULL RESERVED 194 AUE_GETRLIMIT STD { int getrlimit( u_int which, @@ -1232,7 +1227,7 @@ pid_t pid ); } -208 AUE_NULL UNIMPL nosys +208 AUE_NULL RESERVED 209 AUE_POLL STD { int poll( _Inout_updates_(nfds) struct pollfd *fds, @@ -1411,7 +1406,7 @@ _Out_opt_ struct timespec *rmtp ); } -245-246 AUE_NULL UNIMPL nosys +245-246 AUE_NULL RESERVED 247 AUE_NULL STD { int clock_getcpuclockid2( id_t id, @@ -1424,7 +1419,7 @@ _Out_ struct ntptimeval *ntvp ); } -249 AUE_NULL UNIMPL nosys +249 AUE_NULL RESERVED 250 AUE_MINHERIT STD { int minherit( _In_ void *addr, @@ -1466,7 +1461,7 @@ _In_opt_ struct sigevent *sig ); } -258-271 AUE_NULL UNIMPL nosys +258-271 AUE_NULL RESERVED 272 AUE_O_GETDENTS COMPAT11 { int getdents( int fd, @@ -1474,7 +1469,7 @@ size_t count ); } -273 AUE_NULL UNIMPL nosys +273 AUE_NULL RESERVED 274 AUE_LCHMOD STD { int lchmod( _In_z_ const char *path, @@ -1507,7 +1502,7 @@ _Out_ struct nstat *ub ); } -281-288 AUE_NULL UNIMPL nosys +281-288 AUE_NULL RESERVED 289 AUE_PREADV STD { ssize_t preadv( int fd, @@ -1524,7 +1519,7 @@ off_t offset ); } -291-296 AUE_NULL UNIMPL nosys +291-296 AUE_NULL RESERVED 297 AUE_FHSTATFS COMPAT4 { int fhstatfs( _In_ const struct fhandle *u_fhp, @@ -1924,7 +1919,7 @@ 367 AUE_NULL OBSOL __cap_get_file 368 AUE_NULL OBSOL __cap_set_fd 369 AUE_NULL OBSOL __cap_set_file -370 AUE_NULL UNIMPL nosys +370 AUE_NULL RESERVED 371 AUE_EXTATTR_SET_FD STD { ssize_t extattr_set_fd( int fd, @@ -2082,7 +2077,7 @@ _Out_ struct freebsd11_statfs *buf ); } -399 AUE_NULL UNIMPL nosys +399 AUE_NULL RESERVED 400 AUE_SEMCLOSE NOSTD { int ksem_close( semid_t id @@ -2197,7 +2192,7 @@ _In_ const struct __ucontext *sigcntxp ); } -418-420 AUE_NULL UNIMPL nosys +418-420 AUE_NULL RESERVED 421 AUE_NULL STD { int getcontext( _Out_ struct __ucontext *ucp @@ -2275,7 +2270,7 @@ int sig ); } -434-435 AUE_NULL UNIMPL nosys +434-435 AUE_NULL RESERVED 436 AUE_JAIL_ATTACH STD { int jail_attach( int jid @@ -2472,7 +2467,7 @@ _Inout_ struct rtprio *rtp ); } -467-470 AUE_NULL UNIMPL nosys +467-470 AUE_NULL RESERVED 471 AUE_SCTP_PEELOFF NOSTD { int sctp_peeloff( int sd, @@ -2828,7 +2823,7 @@ _Out_ pid_t *pidp ); } -521 AUE_NULL UNIMPL nosys +521 AUE_NULL RESERVED 522 AUE_SELECT STD { int pselect( int nd, From owner-dev-commits-src-main@freebsd.org Tue Jan 26 18:44: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 D7A034FC148; Tue, 26 Jan 2021 18:44: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 4DQFy55lTzz3mwh; Tue, 26 Jan 2021 18:44: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 B871C6A5E; Tue, 26 Jan 2021 18:44: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 10QIiDot091743; Tue, 26 Jan 2021 18:44:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QIiDG3091742; Tue, 26 Jan 2021 18:44:13 GMT (envelope-from git) Date: Tue, 26 Jan 2021 18:44:13 GMT Message-Id: <202101261844.10QIiDG3091742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 2cf84258922f - main - Bump __FreeBSD_version after e63539f3059728ff58328ac0ecb2a7bf4e2f08e8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cf84258922f306a3f84866685d2f5346f67db58 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, 26 Jan 2021 18:44:13 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2cf84258922f306a3f84866685d2f5346f67db58 commit 2cf84258922f306a3f84866685d2f5346f67db58 Author: Dimitry Andric AuthorDate: 2021-01-26 18:43:55 +0000 Commit: Dimitry Andric CommitDate: 2021-01-26 18:43:55 +0000 Bump __FreeBSD_version after e63539f3059728ff58328ac0ecb2a7bf4e2f08e8 This is to allow ports to detect the clang fix applied in the above commit. PR: 252892 MFC after: 3 days --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index f540b240e848..341319a72012 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400001 /* Master, propagated to newvers */ +#define __FreeBSD_version 1400002 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Tue Jan 26 19: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 45C224FE157; Tue, 26 Jan 2021 19: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 4DQHLx1T3fz3snN; Tue, 26 Jan 2021 19: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 25571783F; Tue, 26 Jan 2021 19: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 10QJlLi4071101; Tue, 26 Jan 2021 19: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 10QJlLTF071100; Tue, 26 Jan 2021 19:47:21 GMT (envelope-from git) Date: Tue, 26 Jan 2021 19:47:21 GMT Message-Id: <202101261947.10QJlLTF071100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 8c22cf9b0997 - main - Fix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c22cf9b0997566ff6f576cfc9296b29bb055f65 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, 26 Jan 2021 19:47:21 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=8c22cf9b0997566ff6f576cfc9296b29bb055f65 commit 8c22cf9b0997566ff6f576cfc9296b29bb055f65 Author: Kirk McKusick AuthorDate: 2021-01-26 19:46:38 +0000 Commit: Kirk McKusick CommitDate: 2021-01-26 19:46:38 +0000 Fix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors. A long-standing bug in Pass 1 of fsck_ffs in which it is reading in blocks of inodes to check their block pointers. It failed to round up the size of the read to a disk block size. When disks would accept 512-byte aligned reads, the bug rarely manifested itself. But many recent disks will no longer accept 512-byte aligned reads but require 4096-byte aligned reads, so the failure to properly round-up read sizes to multiples of 4096 bytes makes the error much more likely to occur. Reported by: Peter Holm and others Tested by: Peter Holm and Rozhuk Ivan MFC after: 3 days Sponsored by: Netflix --- sbin/fsck_ffs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 18a015f8187e..60019425c825 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -611,8 +611,9 @@ setinodebuf(int cg, ino_t inosused) sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode)); readpercg = inosused / fullcnt; partialcnt = inosused % fullcnt; - partialsize = partialcnt * ((sblock.fs_magic == FS_UFS1_MAGIC) ? - sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode)); + partialsize = fragroundup(&sblock, + partialcnt * ((sblock.fs_magic == FS_UFS1_MAGIC) ? + sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode))); if (partialcnt != 0) { readpercg++; } else { From owner-dev-commits-src-main@freebsd.org Tue Jan 26 20:43: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 214B34E0102; Tue, 26 Jan 2021 20:43: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 4DQJc06rRjz4S3y; Tue, 26 Jan 2021 20:43: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 DE24E10823; Tue, 26 Jan 2021 20:43: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 10QKhimm049014; Tue, 26 Jan 2021 20:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QKhihT049013; Tue, 26 Jan 2021 20:43:44 GMT (envelope-from git) Date: Tue, 26 Jan 2021 20:43:44 GMT Message-Id: <202101262043.10QKhihT049013@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: a51eca7936db - main - cache: stop referring to removing entries as invalidating them 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: a51eca7936db50a57d2324d945c3be715df749cd 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, 26 Jan 2021 20:43:45 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a51eca7936db50a57d2324d945c3be715df749cd commit a51eca7936db50a57d2324d945c3be715df749cd Author: Mateusz Guzik AuthorDate: 2021-01-26 20:31:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-26 20:42:53 +0000 cache: stop referring to removing entries as invalidating them Said use is a remnant from the old code and clashes with the NCF_INVALID flag. --- sys/kern/vfs_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 72669449c26a..4e2cfa9edf53 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2597,7 +2597,7 @@ cache_changesize(u_long newmaxvnodes) } /* - * Invalidate all entries from and to a particular vnode. + * Remove all entries from and to a particular vnode. */ static void cache_purge_impl(struct vnode *vp) @@ -2688,7 +2688,7 @@ cache_purge_vgone(struct vnode *vp) } /* - * Invalidate all negative entries for a particular directory vnode. + * Remove all negative entries for a particular directory vnode. */ void cache_purge_negative(struct vnode *vp) From owner-dev-commits-src-main@freebsd.org Tue Jan 26 20:43: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 352F44FFE5F; Tue, 26 Jan 2021 20:43: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 4DQJc213W0z4SBm; Tue, 26 Jan 2021 20:43: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 152161055B; Tue, 26 Jan 2021 20:43: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 10QKhjSB049037; Tue, 26 Jan 2021 20:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QKhjlD049036; Tue, 26 Jan 2021 20:43:45 GMT (envelope-from git) Date: Tue, 26 Jan 2021 20:43:45 GMT Message-Id: <202101262043.10QKhjlD049036@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: a098a831a162 - main - cache: tidy up handling of foo/bar lookups where foo is not a directory 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: a098a831a162fcd55b0097c95e6840621d8c720a 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, 26 Jan 2021 20:43:46 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a098a831a162fcd55b0097c95e6840621d8c720a commit a098a831a162fcd55b0097c95e6840621d8c720a Author: Mateusz Guzik AuthorDate: 2021-01-26 16:19:12 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-26 20:42:53 +0000 cache: tidy up handling of foo/bar lookups where foo is not a directory The code was performing an avoidable check for doomed state to account for foo being a VDIR but turning VBAD. Now that dooming puts a vnode in a permanent "modify" state this is no longer necessary as the final status check will catch it. --- sys/kern/vfs_cache.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 4e2cfa9edf53..b759affcc0ac 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5328,20 +5328,11 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) } /* - * Hack: they may be looking up foo/bar, where foo is a - * regular file. In such a case we need to turn ENOTDIR, - * but we may happen to get here with a different error. + * Hack: they may be looking up foo/bar, where foo is not a directory. + * In such a case we need to return ENOTDIR, but we may happen to get + * here with a different error. */ if (dvp->v_type != VDIR) { - /* - * The check here is predominantly to catch - * EOPNOTSUPP from dead_vnodeops. If the vnode - * gets doomed past this point it is going to - * fail seqc verification. - */ - if (VN_IS_DOOMED(dvp)) { - return (cache_fpl_aborted(fpl)); - } error = ENOTDIR; } From owner-dev-commits-src-main@freebsd.org Tue Jan 26 21:22: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 D56B14E10D9; Tue, 26 Jan 2021 21:22: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 4DQKSN5bshz4Vb3; Tue, 26 Jan 2021 21:22: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 B3C4810EAB; Tue, 26 Jan 2021 21:22: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 10QLMC2r097932; Tue, 26 Jan 2021 21:22:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QLMCXW097931; Tue, 26 Jan 2021 21:22:12 GMT (envelope-from git) Date: Tue, 26 Jan 2021 21:22:12 GMT Message-Id: <202101262122.10QLMCXW097931@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: f1c010d9f9cb - main - tests: Skip cap_fileargs if build without capsicum capabilities 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: f1c010d9f9cbc28412d491689e7f594e56085bcb 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, 26 Jan 2021 21:22:12 -0000 The branch main has been updated by olivier (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f1c010d9f9cbc28412d491689e7f594e56085bcb commit f1c010d9f9cbc28412d491689e7f594e56085bcb Author: Olivier Cochard AuthorDate: 2021-01-26 21:19:36 +0000 Commit: Olivier Cochard CommitDate: 2021-01-26 21:19:36 +0000 tests: Skip cap_fileargs if build without capsicum capabilities Approved by: oshogbo Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D2834 --- lib/libcasper/services/cap_fileargs/tests/Makefile | 2 ++ .../services/cap_fileargs/tests/fileargs_test.c | 29 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib/libcasper/services/cap_fileargs/tests/Makefile b/lib/libcasper/services/cap_fileargs/tests/Makefile index 51674c5f778e..4d63605e794b 100644 --- a/lib/libcasper/services/cap_fileargs/tests/Makefile +++ b/lib/libcasper/services/cap_fileargs/tests/Makefile @@ -4,6 +4,8 @@ ATF_TESTS_C= fileargs_test +CFLAGS+= -I${SRCTOP}/tests + .if ${MK_CASPER} != "no" LIBADD+= casper LIBADD+= cap_fileargs diff --git a/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c b/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c index 9a7f9dfcb9aa..a12afd734998 100644 --- a/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c +++ b/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "freebsd_test_suite/macros.h" + #define MAX_FILES 200 static char *files[MAX_FILES]; @@ -46,6 +48,13 @@ static int fds[MAX_FILES]; #define TEST_FILE "/etc/passwd" +static void +check_capsicum(void) +{ + ATF_REQUIRE_FEATURE("security_capabilities"); + ATF_REQUIRE_FEATURE("security_capability_mode"); +} + static void prepare_files(size_t num, bool create) { @@ -281,6 +290,8 @@ ATF_TC_BODY(fileargs__open_read, tc) size_t i; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); cap_rights_init(&rights, CAP_READ | CAP_FCNTL); @@ -326,6 +337,8 @@ ATF_TC_BODY(fileargs__open_write, tc) size_t i; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); cap_rights_init(&rights, CAP_WRITE | CAP_FCNTL); @@ -371,6 +384,8 @@ ATF_TC_BODY(fileargs__open_create, tc) size_t i; int fd; + check_capsicum(); + prepare_files(MAX_FILES, false); cap_rights_init(&rights, CAP_WRITE | CAP_FCNTL | CAP_READ); @@ -414,6 +429,8 @@ ATF_TC_BODY(fileargs__open_with_casper, tc) size_t i; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); capcas = cap_init(); @@ -448,6 +465,8 @@ ATF_TC_BODY(fileargs__fopen_read, tc) FILE *pfile; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); cap_rights_init(&rights, CAP_READ | CAP_FCNTL); @@ -496,6 +515,8 @@ ATF_TC_BODY(fileargs__fopen_write, tc) FILE *pfile; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); cap_rights_init(&rights, CAP_WRITE | CAP_FCNTL); @@ -544,6 +565,8 @@ ATF_TC_BODY(fileargs__fopen_create, tc) FILE *pfile; int fd; + check_capsicum(); + prepare_files(MAX_FILES, false); cap_rights_init(&rights, CAP_READ | CAP_WRITE | CAP_FCNTL); @@ -585,6 +608,8 @@ ATF_TC_BODY(fileargs__lstat, tc) size_t i; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); fa = fileargs_init(MAX_FILES, files, 0, 0, NULL, FA_LSTAT); @@ -646,6 +671,8 @@ ATF_TC_BODY(fileargs__open_lstat, tc) size_t i; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); cap_rights_init(&rights, CAP_READ | CAP_FCNTL); @@ -692,6 +719,8 @@ ATF_TC_BODY(fileargs__open_realpath, tc) size_t i; int fd; + check_capsicum(); + prepare_files(MAX_FILES, true); cap_rights_init(&rights, CAP_READ | CAP_FCNTL); From owner-dev-commits-src-main@freebsd.org Tue Jan 26 21:32: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 3EC094E134A; Tue, 26 Jan 2021 21:32:30 +0000 (UTC) (envelope-from olivier@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 4DQKhG1KHPz4VmZ; Tue, 26 Jan 2021 21:32:30 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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: olivier/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 20260E22B; Tue, 26 Jan 2021 21:32:30 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: by mail-lf1-f43.google.com with SMTP id b2so2682286lfq.0; Tue, 26 Jan 2021 13:32:30 -0800 (PST) X-Gm-Message-State: AOAM532jAP7MJ5NujQMPK7a8dqkfYcGwD+jl28uQBX/HkZfaYOyUEdP8 MflizbCG0EHaGSpIJildk+TneUwHq0DtV4LDDiA= X-Google-Smtp-Source: ABdhPJww49ibBtE0/vbMNDVSOjyUUcBjukghG+LpxnTphzg8H3Ysy6rrwZ6wUoBrB+SJqxi2zF6eMrOLXXReOJHSykU= X-Received: by 2002:a19:7403:: with SMTP id v3mr3577534lfe.67.1611696748515; Tue, 26 Jan 2021 13:32:28 -0800 (PST) MIME-Version: 1.0 References: <202101262122.10QLMCXW097931@gitrepo.freebsd.org> In-Reply-To: <202101262122.10QLMCXW097931@gitrepo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Tue, 26 Jan 2021 22:32:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: f1c010d9f9cb - main - tests: Skip cap_fileargs if build without capsicum capabilities To: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-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, 26 Jan 2021 21:32:30 -0000 On Tue, Jan 26, 2021 at 10:22 PM Olivier Cochard wrote: > The branch main has been updated by olivier (ports committer): > > URL: > https://cgit.FreeBSD.org/src/commit/?id=f1c010d9f9cbc28412d491689e7f594e56085bcb > > commit f1c010d9f9cbc28412d491689e7f594e56085bcb > Author: Olivier Cochard > AuthorDate: 2021-01-26 21:19:36 +0000 > Commit: Olivier Cochard > CommitDate: 2021-01-26 21:19:36 +0000 > > tests: Skip cap_fileargs if build without capsicum capabilities > > Approved by: oshogbo > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D2834 > --- > > Using the correct review number. Differential Revision: https://reviews.freebsd.org/D28341 From owner-dev-commits-src-main@freebsd.org Tue Jan 26 22:10:18 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 1ECF14E238E; Tue, 26 Jan 2021 22:10:18 +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 4DQLWt0KZBz4XXZ; Tue, 26 Jan 2021 22:10:18 +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 EDABF11841; Tue, 26 Jan 2021 22:10: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 10QMAHHt060967; Tue, 26 Jan 2021 22:10:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QMAHPT060959; Tue, 26 Jan 2021 22:10:17 GMT (envelope-from git) Date: Tue, 26 Jan 2021 22:10:17 GMT Message-Id: <202101262210.10QMAHPT060959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: c1655b0f8998 - main - e1000: consistently use the hw variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1655b0f8998f9e842a004f33e7c9c01c5d9e879 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, 26 Jan 2021 22:10:18 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=c1655b0f8998f9e842a004f33e7c9c01c5d9e879 commit c1655b0f8998f9e842a004f33e7c9c01c5d9e879 Author: Marius Strobl AuthorDate: 2021-01-23 18:18:28 +0000 Commit: Marius Strobl CommitDate: 2021-01-26 21:28:55 +0000 e1000: consistently use the hw variables It's rather confusing when adapter->hw and hw are mixed and matched within a particular function. Some of this was missed in cd1cf2fc1d49c509ded05dcd41b7600a5957fb9a and r353778 respectively. --- sys/dev/e1000/if_em.c | 157 ++++++++++++++++++++++++-------------------------- 1 file changed, 75 insertions(+), 82 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b71e64b214c2..c8a6b209a161 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -828,7 +828,7 @@ em_if_attach_pre(if_ctx_t ctx) device_printf(dev, "attach_pre capping queues at %d\n", scctx->isc_ntxqsets_max); - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(union e1000_adv_tx_desc); @@ -840,7 +840,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities = scctx->isc_capenable = IGB_CAPS; scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP; - if (adapter->hw.mac.type != e1000_82575) + if (hw.mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; /* ** Some new devices, as with ixgbe, now may @@ -848,7 +848,7 @@ em_if_attach_pre(if_ctx_t ctx) ** track of which is used. */ scctx->isc_msix_bar = pci_msix_table_bar(dev); - } else if (adapter->hw.mac.type >= em_mac_min) { + } else if (hw.mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); @@ -880,7 +880,7 @@ em_if_attach_pre(if_ctx_t ctx) * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. */ - if (adapter->hw.mac.type == e1000_82574) { + if (hw.mac.type == e1000_82574) { scctx->isc_msix_bar = pci_msix_table_bar(dev);; } else { scctx->isc_msix_bar = -1; @@ -894,7 +894,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; - if (adapter->hw.mac.type < e1000_82543) + if (hw.mac.type < e1000_82543) scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* INTx only */ scctx->isc_msix_bar = 0; @@ -987,9 +987,9 @@ em_if_attach_pre(if_ctx_t ctx) hw->phy.autoneg_wait_to_complete = FALSE; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; - if (adapter->hw.mac.type < em_mac_min) { - e1000_init_script_state_82541(&adapter->hw, TRUE); - e1000_set_tbi_compatibility_82543(&adapter->hw, TRUE); + if (hw.mac.type < em_mac_min) { + e1000_init_script_state_82541(hw, TRUE); + e1000_set_tbi_compatibility_82543(hw, TRUE); } /* Copper options */ if (hw->phy.media_type == e1000_media_type_copper) { @@ -1002,7 +1002,7 @@ em_if_attach_pre(if_ctx_t ctx) * Set the frame limits assuming * standard ethernet sized frames. */ - scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size = + scctx->isc_max_frame_size = hw.mac.max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE; /* @@ -1205,7 +1205,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) struct adapter *adapter = iflib_get_softc(ctx); if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx); - IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); + IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); switch (adapter->hw.mac.type) { case e1000_82571: @@ -1793,7 +1793,7 @@ em_if_update_admin_status(if_ctx_t ctx) break; case e1000_media_type_internal_serdes: e1000_check_for_link(hw); - link_check = adapter->hw.mac.serdes_has_link; + link_check = hw.mac.serdes_has_link; break; /* VF device is type_unknown */ case e1000_media_type_unknown: @@ -1840,8 +1840,8 @@ em_if_update_admin_status(if_ctx_t ctx) (hw->phy.id == I210_I_PHY_ID)) msec_delay(I210_LINK_DELAY); /* Reset if the media type changed. */ - if ((hw->dev_spec._82575.media_changed) && - (adapter->hw.mac.type >= igb_mac_min)) { + if (hw->dev_spec._82575.media_changed && + hw.mac.type >= igb_mac_min) { hw->dev_spec._82575.media_changed = false; adapter->flags |= IGB_MEDIA_RESET; em_reset(ctx); @@ -1864,8 +1864,7 @@ em_if_update_admin_status(if_ctx_t ctx) lem_smartspeed(adapter); else if (hw->mac.type == e1000_82574 && adapter->intr_type == IFLIB_INTR_MSIX) - E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | - E1000_IMS_LSC); + E1000_WRITE_REG(hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); } static void @@ -2089,13 +2088,13 @@ igb_configure_queues(struct adapter *adapter) u32 tmp, ivar = 0, newitr = 0; /* First turn on RSS capability */ - if (adapter->hw.mac.type != e1000_82575) + if (hw.mac.type != e1000_82575) E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE | E1000_GPIE_EIAME | E1000_GPIE_PBA | E1000_GPIE_NSICR); /* Turn on MSI-X */ - switch (adapter->hw.mac.type) { + switch (hw.mac.type) { case e1000_82580: case e1000_i350: case e1000_i354: @@ -2494,7 +2493,7 @@ em_reset(if_ctx_t ctx) case e1000_ich9lan: case e1000_ich10lan: /* Boost Receive side for jumbo frames */ - if (adapter->hw.mac.max_frame_size > 4096) + if (hw.mac.max_frame_size > 4096) pba = E1000_PBA_14K; else pba = E1000_PBA_10K; @@ -2526,7 +2525,7 @@ em_reset(if_ctx_t ctx) pba = E1000_PBA_34K; break; default: - if (adapter->hw.mac.max_frame_size > 8192) + if (hw.mac.max_frame_size > 8192) pba = E1000_PBA_40K; /* 40K for Rx, 24K for Tx */ else pba = E1000_PBA_48K; /* 48K for Rx, 16K for Tx */ @@ -2538,11 +2537,11 @@ em_reset(if_ctx_t ctx) pba = E1000_READ_REG(hw, E1000_PBA); tx_space = pba >> 16; pba &= 0xffff; - min_tx = (adapter->hw.mac.max_frame_size + + min_tx = (hw.mac.max_frame_size + sizeof(struct e1000_tx_desc) - ETHERNET_FCS_SIZE) * 2; min_tx = roundup2(min_tx, 1024); min_tx >>= 10; - min_rx = adapter->hw.mac.max_frame_size; + min_rx = hw.mac.max_frame_size; min_rx = roundup2(min_rx, 1024); min_rx >>= 10; if (tx_space < min_tx && @@ -2559,7 +2558,7 @@ em_reset(if_ctx_t ctx) } if (hw->mac.type < igb_mac_min) - E1000_WRITE_REG(&adapter->hw, E1000_PBA, pba); + E1000_WRITE_REG(hw, E1000_PBA, pba); INIT_DEBUGOUT1("em_reset: pba=%dK",pba); @@ -2579,7 +2578,7 @@ em_reset(if_ctx_t ctx) */ rx_buffer_size = (pba & 0xffff) << 10; hw->fc.high_water = rx_buffer_size - - roundup2(adapter->hw.mac.max_frame_size, 1024); + roundup2(hw.mac.max_frame_size, 1024); hw->fc.low_water = hw->fc.high_water - 1500; if (adapter->fc) /* locally set flow control value? */ @@ -2654,7 +2653,7 @@ em_reset(if_ctx_t ctx) /* Issue a global reset */ e1000_reset_hw(hw); - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { E1000_WRITE_REG(hw, E1000_WUC, 0); } else { E1000_WRITE_REG(hw, E1000_WUFC, 0); @@ -2670,7 +2669,7 @@ em_reset(if_ctx_t ctx) device_printf(dev, "Hardware Initialization Failed\n"); return; } - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) igb_init_dmac(adapter, pba); E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); @@ -2735,7 +2734,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) u32 rss_key[10], mrqc, shift = 0; /* XXX? */ - if (adapter->hw.mac.type == e1000_82575) + if (hw.mac.type == e1000_82575) shift = 6; /* @@ -2844,11 +2843,11 @@ em_setup_interface(if_ctx_t ctx) * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || - (adapter->hw.phy.media_type == e1000_media_type_internal_serdes)) { + if (hw.phy.media_type == e1000_media_type_fiber || + hw.phy.media_type == e1000_media_type_internal_serdes) { u_char fiber_type = IFM_1000_SX; /* default type */ - if (adapter->hw.mac.type == e1000_82545) + if (hw.mac.type == e1000_82545) fiber_type = IFM_1000_LX; ifmedia_add(adapter->media, IFM_ETHER | fiber_type | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | fiber_type, 0, NULL); @@ -2857,7 +2856,7 @@ em_setup_interface(if_ctx_t ctx) ifmedia_add(adapter->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); - if (adapter->hw.phy.type != e1000_phy_ife) { + if (hw.phy.type != e1000_phy_ife) { ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); } @@ -3032,8 +3031,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_TDH(i), 0); HW_DEBUGOUT2("Base = %x, Length = %x\n", - E1000_READ_REG(&adapter->hw, E1000_TDBAL(i)), - E1000_READ_REG(&adapter->hw, E1000_TDLEN(i))); + E1000_READ_REG(hw, E1000_TDBAL(i)), + E1000_READ_REG(hw, E1000_TDLEN(i))); txdctl = 0; /* clear txdctl */ txdctl |= 0x1f; /* PTHRESH */ @@ -3047,7 +3046,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) } /* Set the default values for the Tx Inter Packet Gap timer */ - switch (adapter->hw.mac.type) { + switch (hw.mac.type) { case e1000_80003es2lan: tipg = DEFAULT_82543_TIPG_IPGR1; tipg |= DEFAULT_80003ES2LAN_TIPG_IPGR2 << @@ -3059,9 +3058,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; break; default: - if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || - (adapter->hw.phy.media_type == - e1000_media_type_internal_serdes)) + if (hw.phy.media_type == e1000_media_type_fiber || + hw.phy.media_type == e1000_media_type_internal_serdes) tipg = DEFAULT_82543_TIPG_IPGT_FIBER; else tipg = DEFAULT_82543_TIPG_IPGT_COPPER; @@ -3069,51 +3067,50 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; } - E1000_WRITE_REG(&adapter->hw, E1000_TIPG, tipg); - E1000_WRITE_REG(&adapter->hw, E1000_TIDV, adapter->tx_int_delay.value); + E1000_WRITE_REG(hw, E1000_TIPG, tipg); + E1000_WRITE_REG(hw, E1000_TIDV, adapter->tx_int_delay.value); - if(adapter->hw.mac.type >= e1000_82540) - E1000_WRITE_REG(&adapter->hw, E1000_TADV, + if(hw.mac.type >= e1000_82540) + E1000_WRITE_REG(hw, E1000_TADV, adapter->tx_abs_int_delay.value); - if ((adapter->hw.mac.type == e1000_82571) || - (adapter->hw.mac.type == e1000_82572)) { - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + if (hw.mac.type == e1000_82571 || hw.mac.type == e1000_82572) { + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_SPEED_MODE_BIT; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - } else if (adapter->hw.mac.type == e1000_80003es2lan) { + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + } else if (hw.mac.type == e1000_80003es2lan) { /* errata: program both queues to unweighted RR */ - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= 1; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(1)); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + tarc = E1000_READ_REG(hw, E1000_TARC(1)); tarc |= 1; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); - } else if (adapter->hw.mac.type == e1000_82574) { - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + E1000_WRITE_REG(hw, E1000_TARC(1), tarc); + } else if (hw.mac.type == e1000_82574) { + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_ERRATA_BIT; if ( adapter->tx_num_queues > 1) { tarc |= (TARC_COMPENSATION_MODE | TARC_MQ_FIX); - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + E1000_WRITE_REG(hw, E1000_TARC(1), tarc); } else - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); } if (adapter->tx_int_delay.value > 0) adapter->txd_cmd |= E1000_TXD_CMD_IDE; /* Program the Transmit Control Register */ - tctl = E1000_READ_REG(&adapter->hw, E1000_TCTL); + tctl = E1000_READ_REG(hw, E1000_TCTL); tctl &= ~E1000_TCTL_CT; tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); - if (adapter->hw.mac.type >= e1000_82571) + if (hw.mac.type >= e1000_82571) tctl |= E1000_TCTL_MULR; /* This write will effectively turn on the transmit unit. */ - E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); + E1000_WRITE_REG(hw, E1000_TCTL, tctl); /* SPT and KBL errata workarounds */ if (hw->mac.type == e1000_pch_spt) { @@ -3176,9 +3173,9 @@ em_initialize_receive_unit(if_ctx_t ctx) if (!em_disable_crc_stripping) rctl |= E1000_RCTL_SECRC; - if (adapter->hw.mac.type >= e1000_82540) { - E1000_WRITE_REG(&adapter->hw, E1000_RADV, - adapter->rx_abs_int_delay.value); + if (hw.mac.type >= e1000_82540) { + E1000_WRITE_REG(hw, E1000_RADV, + adapter->rx_abs_int_delay.value); /* * Set the interrupt throttling rate. Value is calculated @@ -3186,8 +3183,7 @@ em_initialize_receive_unit(if_ctx_t ctx) */ E1000_WRITE_REG(hw, E1000_ITR, DEFAULT_ITR); } - E1000_WRITE_REG(&adapter->hw, E1000_RDTR, - adapter->rx_int_delay.value); + E1000_WRITE_REG(hw, E1000_RDTR, adapter->rx_int_delay.value); /* Use extended rx descriptor formats */ rfctl = E1000_READ_REG(hw, E1000_RFCTL); @@ -3207,9 +3203,9 @@ em_initialize_receive_unit(if_ctx_t ctx) rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && - adapter->hw.mac.type >= e1000_82543) { + hw.mac.type >= e1000_82543) { if (adapter->tx_num_queues > 1) { - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { rxcsum |= E1000_RXCSUM_PCSD; if (hw->mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; @@ -3218,11 +3214,11 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_RXCSUM_IPOFL | E1000_RXCSUM_PCSD; } else { - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) rxcsum |= E1000_RXCSUM_IPPCSE; else rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; - if (adapter->hw.mac.type > e1000_82575) + if (hw.mac.type > e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; } } else @@ -3231,7 +3227,7 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); if (adapter->rx_num_queues > 1) { - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) igb_initialize_rss_mapping(adapter); else em_initialize_rss_mapping(adapter); @@ -3271,14 +3267,11 @@ em_initialize_receive_unit(if_ctx_t ctx) * Only write to RXDCTL(1) if there is a need for different * settings. */ - - if (((adapter->hw.mac.type == e1000_ich9lan) || - (adapter->hw.mac.type == e1000_pch2lan) || - (adapter->hw.mac.type == e1000_ich10lan)) && - (if_getmtu(ifp) > ETHERMTU)) { + if ((hw.mac.type == e1000_ich9lan || hw.mac.type == e1000_pch2lan || + hw.mac.type == e1000_ich10lan) && (if_getmtu(ifp) > ETHERMTU)) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); - } else if (adapter->hw.mac.type == e1000_82574) { + } else if (hw.mac.type == e1000_82574) { for (int i = 0; i < adapter->rx_num_queues; i++) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); rxdctl |= 0x20; /* PTHRESH */ @@ -3287,7 +3280,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= 1 << 24; /* Switch to granularity */ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (adapter->hw.mac.type >= igb_mac_min) { + } else if (hw.mac.type >= igb_mac_min) { u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { @@ -3303,7 +3296,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* are we on a vlan? */ if (ifp->if_vlantrunk != NULL) psize += VLAN_TAG_SIZE; - E1000_WRITE_REG(&adapter->hw, E1000_RLPML, psize); + E1000_WRITE_REG(hw, E1000_RLPML, psize); } else { srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; rctl |= E1000_RCTL_SZ_2048; @@ -3349,7 +3342,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= IGB_RX_WTHRESH << 16; E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (adapter->hw.mac.type >= e1000_pch2lan) { + } else if (hw.mac.type >= e1000_pch2lan) { if (if_getmtu(ifp) > ETHERMTU) e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); else @@ -3359,7 +3352,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; - if (adapter->hw.mac.type < igb_mac_min) { + if (hw.mac.type < igb_mac_min) { if (adapter->rx_mbuf_sz == MCLBYTES) rctl |= E1000_RCTL_SZ_2048; else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) @@ -3822,7 +3815,7 @@ em_enable_phy_wakeup(struct adapter *adapter) e1000_copy_rx_addrs_to_phy_ich8lan(hw); /* copy MAC MTA to PHY MTA */ - for (int i = 0; i < adapter->hw.mac.mta_reg_count; i++) { + for (int i = 0; i < hw.mac.mta_reg_count; i++) { mreg = E1000_READ_REG_ARRAY(hw, E1000_MTA, i); e1000_write_phy_reg(hw, BM_MTA(i), (u16)(mreg & 0xFFFF)); e1000_write_phy_reg(hw, BM_MTA(i) + 1, @@ -3830,7 +3823,7 @@ em_enable_phy_wakeup(struct adapter *adapter) } /* configure PHY Rx Control register */ - e1000_read_phy_reg(&adapter->hw, BM_RCTL, &preg); + e1000_read_phy_reg(hw, BM_RCTL, &preg); mreg = E1000_READ_REG(hw, E1000_RCTL); if (mreg & E1000_RCTL_UPE) preg |= BM_RCTL_UPE; @@ -3847,7 +3840,7 @@ em_enable_phy_wakeup(struct adapter *adapter) mreg = E1000_READ_REG(hw, E1000_CTRL); if (mreg & E1000_CTRL_RFCE) preg |= BM_RCTL_RFCE; - e1000_write_phy_reg(&adapter->hw, BM_RCTL, preg); + e1000_write_phy_reg(hw, BM_RCTL, preg); /* enable PHY wakeup in MAC register */ E1000_WRITE_REG(hw, E1000_WUC, @@ -3855,8 +3848,8 @@ em_enable_phy_wakeup(struct adapter *adapter) E1000_WRITE_REG(hw, E1000_WUFC, adapter->wol); /* configure and enable PHY wakeup in PHY registers */ - e1000_write_phy_reg(&adapter->hw, BM_WUFC, adapter->wol); - e1000_write_phy_reg(&adapter->hw, BM_WUC, E1000_WUC_PME_EN); + e1000_write_phy_reg(hw, BM_WUFC, adapter->wol); + e1000_write_phy_reg(hw, BM_WUC, E1000_WUC_PME_EN); /* activate PHY wakeup */ ret = hw->phy.ops.acquire(hw); From owner-dev-commits-src-main@freebsd.org Tue Jan 26 22:10: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 3BB354E20EF; Tue, 26 Jan 2021 22:10: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 4DQLWw1DCTz4XZx; Tue, 26 Jan 2021 22:10: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 19021118C4; Tue, 26 Jan 2021 22:10: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 10QMAKwe061962; Tue, 26 Jan 2021 22:10:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QMAKJm061959; Tue, 26 Jan 2021 22:10:20 GMT (envelope-from git) Date: Tue, 26 Jan 2021 22:10:20 GMT Message-Id: <202101262210.10QMAKJm061959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 173f6ce152ce - main - KDB: remove obsolete KDB_WHY_NDIS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 173f6ce152ce1c4ea3e685d28a3c6461cc140513 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, 26 Jan 2021 22:10:20 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=173f6ce152ce1c4ea3e685d28a3c6461cc140513 commit 173f6ce152ce1c4ea3e685d28a3c6461cc140513 Author: Marius Strobl AuthorDate: 2021-01-26 21:51:24 +0000 Commit: Marius Strobl CommitDate: 2021-01-26 21:51:24 +0000 KDB: remove obsolete KDB_WHY_NDIS ndis(4) has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. --- sys/sys/kdb.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/kdb.h b/sys/sys/kdb.h index 5ace60740bb6..72eb51d57aee 100644 --- a/sys/sys/kdb.h +++ b/sys/sys/kdb.h @@ -114,7 +114,6 @@ extern const char * volatile kdb_why; #define KDB_WHY_BREAK "break" /* Console or serial break. */ #define KDB_WHY_WATCHDOG "watchdog" /* Watchdog entered debugger. */ #define KDB_WHY_CAM "cam" /* CAM has entered debugger. */ -#define KDB_WHY_NDIS "ndis" /* NDIS entered debugger. */ #define KDB_WHY_ACPI "acpi" /* ACPI entered debugger. */ #define KDB_WHY_TRAPSIG "trapsig" /* Sparc fault. */ #define KDB_WHY_POWERFAIL "powerfail" /* Powerfail NMI. */ From owner-dev-commits-src-main@freebsd.org Tue Jan 26 22:10: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 205D14E20EE; Tue, 26 Jan 2021 22:10: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 4DQLWv0T4Jz4XZs; Tue, 26 Jan 2021 22:10: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 0316811756; Tue, 26 Jan 2021 22:10: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 10QMAIKO061460; Tue, 26 Jan 2021 22:10:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QMAIkL061453; Tue, 26 Jan 2021 22:10:18 GMT (envelope-from git) Date: Tue, 26 Jan 2021 22:10:18 GMT Message-Id: <202101262210.10QMAIkL061453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: f39b49969ac4 - main - man: remove stale references to ndis(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f39b49969ac4ba2151c4c8a6ab273e6fe65ce98a 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, 26 Jan 2021 22:10:19 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=f39b49969ac4ba2151c4c8a6ab273e6fe65ce98a commit f39b49969ac4ba2151c4c8a6ab273e6fe65ce98a Author: Marius Strobl AuthorDate: 2021-01-26 21:46:59 +0000 Commit: Marius Strobl CommitDate: 2021-01-26 21:46:59 +0000 man: remove stale references to ndis(4) The latter has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. --- share/man/man4/altq.4 | 8 +------- share/man/man4/ddb.4 | 7 +------ share/man/man4/wlan.4 | 6 ++---- share/man/man9/ieee80211.9 | 8 ++------ 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/share/man/man4/altq.4 b/share/man/man4/altq.4 index d1a08a89c590..505d45e86acc 100644 --- a/share/man/man4/altq.4 +++ b/share/man/man4/altq.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2020 +.Dd January 26, 2021 .Dt ALTQ 4 .Os .Sh NAME @@ -173,12 +173,6 @@ and .Xr xl 4 . .Pp The -.Xr ndis 4 -framework also has support for -.Nm -and thus all encapsulated drivers. -.Pp -The .Xr tun 4 and .Xr ng_iface 4 diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 91b179e4e6fa..1fe3490edd36 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2020 +.Dd January 26, 2021 .Dt DDB 4 .Os .Sh NAME @@ -1470,10 +1470,6 @@ The kernel debugger was entered as a result of an assertion failure in the .Xr mac_test 4 module of the TrustedBSD MAC Framework. -.It Va kdb.enter.ndis -The kernel debugger was entered as a result of an -.Xr ndis 4 -breakpoint event. .It Va kdb.enter.netgraph The kernel debugger was entered as a result of a .Xr netgraph 4 @@ -1598,7 +1594,6 @@ directory. .Xr acpi 4 , .Xr CAM 4 , .Xr mac_test 4 , -.Xr ndis 4 , .Xr netgraph 4 , .Xr textdump 4 , .Xr witness 4 , diff --git a/share/man/man4/wlan.4 b/share/man/man4/wlan.4 index 2e0ebdb09c2f..d7a186a34efd 100644 --- a/share/man/man4/wlan.4 +++ b/share/man/man4/wlan.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2021 +.Dd January 26, 2021 .Dt WLAN 4 .Os .Sh NAME @@ -41,9 +41,7 @@ Where a device does not directly support 802.11 functionality this layer fills in. The .Nm -module is required by all native 802.11 drivers as well as the -.Xr ndis 4 -support. +module is required by all native 802.11 drivers. .Pp .Nm supports multi-mode devices capable of diff --git a/share/man/man9/ieee80211.9 b/share/man/man9/ieee80211.9 index a6900bd57799..35624f5f39cd 100644 --- a/share/man/man9/ieee80211.9 +++ b/share/man/man9/ieee80211.9 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2017 +.Dd January 26, 2021 .Dt IEEE80211 9 .Os .Sh NAME @@ -72,10 +72,7 @@ applications interact with 802.11 devices. Most drivers depend on the .Nm layer for protocol services but devices that off-load functionality -may bypass the layer to connect directly to the device -(e.g. the -.Xr ndis 4 -emulation support does this). +may bypass the layer to connect directly to the device. .Pp A .Nm @@ -680,7 +677,6 @@ Device supports Reduced Inter Frame Spacing (RIFS). .El .Sh SEE ALSO .Xr ioctl 2 , -.Xr ndis 4 , .Xr ieee80211_amrr 9 , .Xr ieee80211_beacon 9 , .Xr ieee80211_bmiss 9 , From owner-dev-commits-src-main@freebsd.org Tue Jan 26 22:10: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 397EA4E23E1; Tue, 26 Jan 2021 22:10: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 4DQLWx4dKbz4Xjj; Tue, 26 Jan 2021 22:10: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 32B8D1167A; Tue, 26 Jan 2021 22:10: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 10QMAL1x062419; Tue, 26 Jan 2021 22:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QMALvx062416; Tue, 26 Jan 2021 22:10:21 GMT (envelope-from git) Date: Tue, 26 Jan 2021 22:10:21 GMT Message-Id: <202101262210.10QMALvx062416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 84876bf70222 - main - build: remove NDIS option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84876bf70222c4e10144d034119f7f455f99813c 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, 26 Jan 2021 22:10:22 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=84876bf70222c4e10144d034119f7f455f99813c commit 84876bf70222c4e10144d034119f7f455f99813c Author: Marius Strobl AuthorDate: 2021-01-26 21:59:36 +0000 Commit: Marius Strobl CommitDate: 2021-01-26 21:59:36 +0000 build: remove NDIS option ndis(4) has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa. --- tools/build/options/WITHOUT_NDIS | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/build/options/WITHOUT_NDIS b/tools/build/options/WITHOUT_NDIS deleted file mode 100644 index f7bcdae04fce..000000000000 --- a/tools/build/options/WITHOUT_NDIS +++ /dev/null @@ -1,3 +0,0 @@ -.\" $FreeBSD$ -Set to not build programs and libraries -related to NDIS emulation support. From owner-dev-commits-src-main@freebsd.org Tue Jan 26 22:10: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 735404E2274; Tue, 26 Jan 2021 22:10: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 4DQLWy6JHGz4XmN; Tue, 26 Jan 2021 22:10: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 5E323118C5; Tue, 26 Jan 2021 22:10: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 10QMAMF5062738; Tue, 26 Jan 2021 22:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QMAMjS062737; Tue, 26 Jan 2021 22:10:22 GMT (envelope-from git) Date: Tue, 26 Jan 2021 22:10:22 GMT Message-Id: <202101262210.10QMAMjS062737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 7a731da592fa - main - rc.conf(5): regenerate after WITHOUT_NDIS removal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a731da592fae9a75278b2d4139d03d7ef6ba84a 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, 26 Jan 2021 22:10:26 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=7a731da592fae9a75278b2d4139d03d7ef6ba84a commit 7a731da592fae9a75278b2d4139d03d7ef6ba84a Author: Marius Strobl AuthorDate: 2021-01-26 22:02:39 +0000 Commit: Marius Strobl CommitDate: 2021-01-26 22:02:39 +0000 rc.conf(5): regenerate after WITHOUT_NDIS removal ndis(4) has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa and its build option in 84876bf70222c4e10144d034119f7f455f99813c. --- share/man/man5/src.conf.5 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index adee40aa3088..7d9a1b683a62 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 24, 2021 +.Dd January 26, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1178,9 +1178,6 @@ Set to build .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. -.It Va WITHOUT_NDIS -Set to not build programs and libraries -related to NDIS emulation support. .It Va WITHOUT_NETCAT Set to not build .Xr nc 1 From owner-dev-commits-src-main@freebsd.org Tue Jan 26 22:50: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 9D2884E3982; Tue, 26 Jan 2021 22:50:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 4DQMQf2Hq1z4bGV; Tue, 26 Jan 2021 22:50:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 10QMoZQt024283 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Jan 2021 00:50:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 10QMoZQt024283 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 10QMoZDG024282; Wed, 27 Jan 2021 00:50:35 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 27 Jan 2021 00:50:35 +0200 From: Konstantin Belousov To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d89c1c461ce3 - main - Reserve gaps in syscall numbers for local use Message-ID: References: <202101261828.10QISOKh066392@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202101261828.10QISOKh066392@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DQMQf2Hq1z4bGV 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: Tue, 26 Jan 2021 22:50:50 -0000 On Tue, Jan 26, 2021 at 06:28:24PM +0000, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d89c1c461ce31bfc789dbb7bc5f4fce5824c595e > > commit d89c1c461ce31bfc789dbb7bc5f4fce5824c595e > Author: Brooks Davis > AuthorDate: 2021-01-26 18:27:45 +0000 > Commit: Brooks Davis > CommitDate: 2021-01-26 18:27:45 +0000 > > Reserve gaps in syscall numbers for local use > > It is best for auditing of syscalls.master if we only append to the > file. Reserving unimplemented system call numbers for local use makes > this policy and provides a large set of syscall numbers FreeBSD > derivatives can use without risk of conflict. > > Reviewed by: jhb, kevans, kib > Sponsored by: DARPA > Differential Revision: https://reviews.freebsd.org/D27988 > --- > sys/kern/init_sysent.c | 120 +++++++++++++++++++++++------------------------ > sys/kern/syscalls.c | 120 +++++++++++++++++++++++------------------------ > sys/kern/syscalls.master | 55 ++++++++++------------ > 3 files changed, 145 insertions(+), 150 deletions(-) I highly dislike this. You committed both manually edited file and generated files in one commit. Can we please avoid this? It is hard/impossible to read the diff as is. From owner-dev-commits-src-main@freebsd.org Tue Jan 26 23:07: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 DD64E4E3768; Tue, 26 Jan 2021 23:07: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 4DQMnk5zFrz4cKb; Tue, 26 Jan 2021 23:07: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 BFEA812789; Tue, 26 Jan 2021 23:07: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 10QN7MYm032773; Tue, 26 Jan 2021 23:07:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QN7MPa032772; Tue, 26 Jan 2021 23:07:22 GMT (envelope-from git) Date: Tue, 26 Jan 2021 23:07:22 GMT Message-Id: <202101262307.10QN7MPa032772@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: 93ebd6307efe - main - vt: panic while changing vt font 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: 93ebd6307efeb95a29bc614edd0c67c2af850e98 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, 26 Jan 2021 23:07:22 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=93ebd6307efeb95a29bc614edd0c67c2af850e98 commit 93ebd6307efeb95a29bc614edd0c67c2af850e98 Author: Toomas Soome AuthorDate: 2021-01-24 18:59:36 +0000 Commit: Toomas Soome CommitDate: 2021-01-26 23:07:03 +0000 vt: panic while changing vt font Set refcount for loader provided font to 1 to prevent this font from being released (so we can reset to default). PR: 252833 --- sys/dev/vt/vt_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 2352ed823424..ac89d8635e78 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1528,6 +1528,8 @@ 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 Jan 26 23:08: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 571214E3D6D; Tue, 26 Jan 2021 23:08:25 +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 4DQMpx1yqfz4cVX; Tue, 26 Jan 2021 23:08:25 +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 363DD12884; Tue, 26 Jan 2021 23:08:25 +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 10QN8P8g033040; Tue, 26 Jan 2021 23:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QN8PHb033039; Tue, 26 Jan 2021 23:08:25 GMT (envelope-from git) Date: Tue, 26 Jan 2021 23:08:25 GMT Message-Id: <202101262308.10QN8PHb033039@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: 6c7a932d0b8b - main - loader: start kernel in text mode when there is no vbefb vt driver 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: 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd 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, 26 Jan 2021 23:08:25 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd commit 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd Author: Toomas Soome AuthorDate: 2021-01-26 22:47:56 +0000 Commit: Toomas Soome CommitDate: 2021-01-26 23:07:34 +0000 loader: start kernel in text mode when there is no vbefb vt driver If kernel is built without VT vbefb driver, make sure we start kernel in text mode. --- stand/common/gfx_fb.h | 1 + stand/common/load_elf.c | 63 ++++++++++++++++++++++++++++++++++++------- stand/i386/libi386/bootinfo.c | 10 +++++++ stand/loader.mk | 9 +++++++ 4 files changed, 74 insertions(+), 9 deletions(-) diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index 1424b8223136..d046865604ea 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -204,6 +204,7 @@ typedef struct teken_gfx { struct gen_fb tg_fb; teken_funcs_t *tg_functions; void *tg_private; + bool tg_kernel_supported; /* Loaded kernel is supported */ } teken_gfx_t; extern font_list_t fonts; diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index cb542718fe2f..62fdb560ecff 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #define FREEBSD_ELF #include +#include #include "bootstrap.h" @@ -84,12 +85,14 @@ typedef struct elf_file { static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, uint64_t loadaddr); -static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, - const char* name, Elf_Sym* sym); +static int __elfN(lookup_symbol)(elf_file_t ef, const char* name, + Elf_Sym *sym, unsigned char type); static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p, void *val, size_t len); static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p_start, Elf_Addr p_end); +static bool __elfN(parse_vt_drv_set)(struct preloaded_file *mp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end); static symaddr_fn __elfN(symaddr); static char *fake_modname(const char *name); @@ -872,12 +875,24 @@ nosyms: ef->buckets = ef->hashtab + 2; ef->chains = ef->buckets + ef->nbuckets; - if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", - &sym) != 0) + gfx_state.tg_kernel_supported = false; + if (__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, + STT_NOTYPE) == 0) { + p_start = sym.st_value + ef->off; + if (__elfN(lookup_symbol)(ef, "__stop_set_vt_drv_set", &sym, + STT_NOTYPE) == 0) { + p_end = sym.st_value + ef->off; + gfx_state.tg_kernel_supported = + __elfN(parse_vt_drv_set)(fp, ef, p_start, p_end); + } + } + + if (__elfN(lookup_symbol)(ef, "__start_set_modmetadata_set", &sym, + STT_NOTYPE) != 0) return 0; p_start = sym.st_value + ef->off; - if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", - &sym) != 0) + if (__elfN(lookup_symbol)(ef, "__stop_set_modmetadata_set", &sym, + STT_NOTYPE) != 0) return ENOENT; p_end = sym.st_value + ef->off; @@ -1072,6 +1087,36 @@ out: return (err); } +/* + * Walk through vt_drv_set, each vt driver structure starts with + * static 16 chars for driver name. If we have "vbefb", return true. + */ +static bool +__elfN(parse_vt_drv_set)(struct preloaded_file *fp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end) +{ + Elf_Addr v, p; + char vd_name[16]; + int error; + + p = p_start; + while (p < p_end) { + COPYOUT(p, &v, sizeof(v)); + + error = __elfN(reloc_ptr)(fp, ef, p, &v, sizeof(v)); + if (error == EOPNOTSUPP) + v += ef->off; + else if (error != 0) + return (false); + COPYOUT(v, &vd_name, sizeof(vd_name)); + if (strncmp(vd_name, "vbefb", sizeof(vd_name)) == 0) + return (true); + p += sizeof(Elf_Addr); + } + + return (false); +} + int __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef, Elf_Addr p_start, Elf_Addr p_end) @@ -1185,8 +1230,8 @@ elf_hash(const char *name) static const char __elfN(bad_symtable)[] = "elf" __XSTRING(__ELF_WORD_SIZE) "_lookup_symbol: corrupt symbol table\n"; int -__elfN(lookup_symbol)(struct preloaded_file *fp, elf_file_t ef, - const char* name, Elf_Sym *symp) +__elfN(lookup_symbol)(elf_file_t ef, const char* name, Elf_Sym *symp, + unsigned char type) { Elf_Hashelt symnum; Elf_Sym sym; @@ -1213,7 +1258,7 @@ __elfN(lookup_symbol)(struct preloaded_file *fp, elf_file_t ef, free(strp); if (sym.st_shndx != SHN_UNDEF || (sym.st_value != 0 && - ELF_ST_TYPE(sym.st_info) == STT_FUNC)) { + ELF_ST_TYPE(sym.st_info) == type)) { *symp = sym; return 0; } diff --git a/stand/i386/libi386/bootinfo.c b/stand/i386/libi386/bootinfo.c index 71e07cfb9702..57f926b76589 100644 --- a/stand/i386/libi386/bootinfo.c +++ b/stand/i386/libi386/bootinfo.c @@ -41,6 +41,16 @@ __FBSDID("$FreeBSD$"); void bi_load_vbe_data(struct preloaded_file *kfp) { + if (!gfx_state.tg_kernel_supported) { + /* + * Loaded kernel does not have vt/vbe backend, + * switch console to text mode. + */ + if (vbe_available()) + bios_set_text_mode(VGA_TEXT_MODE); + return; + } + if (vbe_available()) { file_addmetadata(kfp, MODINFOMD_VBE_FB, sizeof(gfx_state.tg_fb), &gfx_state.tg_fb); diff --git a/stand/loader.mk b/stand/loader.mk index cde7a31dca7e..3a38a9bc9e63 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -17,23 +17,32 @@ CFLAGS.pnglite.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "aarch64" SRCS+= load_elf64.c reloc_elf64.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c SRCS+= metadata.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "riscv" SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" From owner-dev-commits-src-main@freebsd.org Tue Jan 26 23:34:18 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 A7EC94E45AC; Tue, 26 Jan 2021 23:34:18 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 4DQNNp4PPMz4dQk; Tue, 26 Jan 2021 23:34:18 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 7BB253C0199; Tue, 26 Jan 2021 23:34:17 +0000 (UTC) Date: Tue, 26 Jan 2021 23:34:17 +0000 From: Brooks Davis To: Konstantin Belousov Cc: Brooks Davis , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d89c1c461ce3 - main - Reserve gaps in syscall numbers for local use Message-ID: <20210126233417.GA6607@spindle.one-eyed-alien.net> References: <202101261828.10QISOKh066392@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4DQNNp4PPMz4dQk 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: Tue, 26 Jan 2021 23:34:18 -0000 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 27, 2021 at 12:50:35AM +0200, Konstantin Belousov wrote: > On Tue, Jan 26, 2021 at 06:28:24PM +0000, Brooks Davis wrote: > > The branch main has been updated by brooks: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd89c1c461ce31bfc789dbb7b= c5f4fce5824c595e > >=20 > > commit d89c1c461ce31bfc789dbb7bc5f4fce5824c595e > > Author: Brooks Davis > > AuthorDate: 2021-01-26 18:27:45 +0000 > > Commit: Brooks Davis > > CommitDate: 2021-01-26 18:27:45 +0000 > >=20 > > Reserve gaps in syscall numbers for local use > > =20 > > It is best for auditing of syscalls.master if we only append to the > > file. Reserving unimplemented system call numbers for local use ma= kes > > this policy and provides a large set of syscall numbers FreeBSD > > derivatives can use without risk of conflict. > > =20 > > Reviewed by: jhb, kevans, kib > > Sponsored by: DARPA > > Differential Revision: https://reviews.freebsd.org/D27988 > > --- > > sys/kern/init_sysent.c | 120 +++++++++++++++++++++++----------------= -------- > > sys/kern/syscalls.c | 120 +++++++++++++++++++++++----------------= -------- > > sys/kern/syscalls.master | 55 ++++++++++------------ > > 3 files changed, 145 insertions(+), 150 deletions(-) > I highly dislike this. You committed both manually edited file and gener= ated > files in one commit. Can we please avoid this? >=20 > It is hard/impossible to read the diff as is. While in this case it would be harmless to split the changes, I strongly disagree with the concept of separating syscalls.master changes and generated files because in the common case (adding syscalls) it requires that the first commit break the build. -- Brooks --FCuugMFkClbJLl1L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJgEKb4AAoJEKzQXbSebgfAXKsH/Rnfkc1i61z7J3usGY9zBfGn n9jLvwwsm8p2o7p/jv+UF5/o9uLs3a6mXwjzwUFZPAzP+uF81+7dAFf/FxI2K97G DrIXq7kM2Ia4OtoUKedAiaga1y/XozenPKhzbKPsuPZ7VNJB8DJu7p8a8KYKHp0U HgbdL8Llo+HbvevxiSbAl3oILWkNKOQf8SWiP0ZHHkvDA37VcBwtknGgtpU405pI un0bMeK1oCJcarJOd9NX0RF2tzVP6TR+iHdAgG92fAw9xdqqxu+58xjODhYTy5xU 4IMrEIOloA8P+AiAhkBSFxfOw73xRAdn0Di0sfKR3xkJeDUc29TDpSwRWYXeQQ8= =GUWG -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L-- From owner-dev-commits-src-main@freebsd.org Wed Jan 27 00:00:57 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 86F124E5256; Wed, 27 Jan 2021 00:00:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 4DQNzY2D8Sz4fvb; Wed, 27 Jan 2021 00:00:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 10R00nEw041641 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Jan 2021 02:00:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 10R00nEw041641 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 10R00nP0041636; Wed, 27 Jan 2021 02:00:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 27 Jan 2021 02:00:49 +0200 From: Konstantin Belousov To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d89c1c461ce3 - main - Reserve gaps in syscall numbers for local use Message-ID: References: <202101261828.10QISOKh066392@gitrepo.freebsd.org> <20210126233417.GA6607@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210126233417.GA6607@spindle.one-eyed-alien.net> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DQNzY2D8Sz4fvb 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: Wed, 27 Jan 2021 00:00:57 -0000 On Tue, Jan 26, 2021 at 11:34:17PM +0000, Brooks Davis wrote: > On Wed, Jan 27, 2021 at 12:50:35AM +0200, Konstantin Belousov wrote: > > On Tue, Jan 26, 2021 at 06:28:24PM +0000, Brooks Davis wrote: > > > The branch main has been updated by brooks: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=d89c1c461ce31bfc789dbb7bc5f4fce5824c595e > > > > > > commit d89c1c461ce31bfc789dbb7bc5f4fce5824c595e > > > Author: Brooks Davis > > > AuthorDate: 2021-01-26 18:27:45 +0000 > > > Commit: Brooks Davis > > > CommitDate: 2021-01-26 18:27:45 +0000 > > > > > > Reserve gaps in syscall numbers for local use > > > > > > It is best for auditing of syscalls.master if we only append to the > > > file. Reserving unimplemented system call numbers for local use makes > > > this policy and provides a large set of syscall numbers FreeBSD > > > derivatives can use without risk of conflict. > > > > > > Reviewed by: jhb, kevans, kib > > > Sponsored by: DARPA > > > Differential Revision: https://reviews.freebsd.org/D27988 > > > --- > > > sys/kern/init_sysent.c | 120 +++++++++++++++++++++++------------------------ > > > sys/kern/syscalls.c | 120 +++++++++++++++++++++++------------------------ > > > sys/kern/syscalls.master | 55 ++++++++++------------ > > > 3 files changed, 145 insertions(+), 150 deletions(-) > > I highly dislike this. You committed both manually edited file and generated > > files in one commit. Can we please avoid this? > > > > It is hard/impossible to read the diff as is. > > While in this case it would be harmless to split the changes, I strongly > disagree with the concept of separating syscalls.master changes and > generated files because in the common case (adding syscalls) it requires > that the first commit break the build. That build breakage is a non-issue, even for bisects. Operator just need to move one commit further. But it makes reading the change significantly harder, which is an artificial pain inflicted on everybody who need to follow (and debug) the code. I do not see why it is useful. From owner-dev-commits-src-main@freebsd.org Wed Jan 27 01:06: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 E86654E86B7; Wed, 27 Jan 2021 01:06:39 +0000 (UTC) (envelope-from agh@riseup.net) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQQRM4tXcz4lG8; Wed, 27 Jan 2021 01:06:39 +0000 (UTC) (envelope-from agh@riseup.net) Received: from fews1.riseup.net (unknown [10.0.1.83]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4DQQRB3JQBzFmbP; Tue, 26 Jan 2021 17:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1611709590; bh=DQanqt5slBhI7/P9w7kbkNtWqwjHJVNEfdnvtS5ayrM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SARMmN4nDmjr0u2GFJh3deXD+HLLfPdYrGYwfvxNZeCGTAgHBhw7P78IvRTJOqI45 Ff1gWlx8RUPmzj8xWF5uCfTmEUsX/UPYXX9VlTEnih4MRs25eg7aqCPIyBjqXnmTsr oZmjBdm3elyTuA9WxQ/nsNt2BaKi0B/QPNrDCqi4= X-Riseup-User-ID: D5028D2B3C2FBB7BFF6EFE59C47BFC4C9482ED096EEB12EF4C21EFC1B6DEFE95 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4DQQRB1gJdz5wF0; Tue, 26 Jan 2021 17:06:30 -0800 (PST) MIME-Version: 1.0 Date: Tue, 26 Jan 2021 17:06:30 -0800 From: al To: Marius Strobl Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c1655b0f8998 - main - e1000: consistently use the hw variables In-Reply-To: <202101262210.10QMAHPT060959@gitrepo.freebsd.org> References: <202101262210.10QMAHPT060959@gitrepo.freebsd.org> Message-ID: <74a46a186ae8148a8fec936d1b791ac5@riseup.net> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DQQRM4tXcz4lG8 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: Wed, 27 Jan 2021 01:06:40 -0000 On 2021-01-27 06:10, Marius Strobl wrote: > The branch main has been updated by marius: Hi Marius, > URL: > https://cgit.FreeBSD.org/src/commit/?id=c1655b0f8998f9e842a004f33e7c9c01c5d9e879 [...] > e1000: consistently use the hw variables > > It's rather confusing when adapter->hw and hw are mixed and matched > within a particular function. > Some of this was missed in cd1cf2fc1d49c509ded05dcd41b7600a5957fb9a > and r353778 respectively. > --- > sys/dev/e1000/if_em.c | 157 ++++++++++++++++++++++++-------------------------- > 1 file changed, 75 insertions(+), 82 deletions(-) $ make buildkernel is now failing with: --- if_em.o --- /usr/src/sys/dev/e1000/if_em.c:831:8: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type >= igb_mac_min) { ~~^ -> /usr/src/sys/dev/e1000/if_em.c:843:9: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type != e1000_82575) ~~^ -> /usr/src/sys/dev/e1000/if_em.c:851:15: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? } else if (hw.mac.type >= em_mac_min) { ~~^ -> /usr/src/sys/dev/e1000/if_em.c:883:9: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type == e1000_82574) { ~~^ -> /usr/src/sys/dev/e1000/if_em.c:897:9: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type < e1000_82543) ~~^ -> /usr/src/sys/dev/e1000/if_em.c:990:8: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type < em_mac_min) { ~~^ -> /usr/src/sys/dev/e1000/if_em.c:1005:32: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? scctx->isc_max_frame_size = hw.mac.max_frame_size = ~~^ -> /usr/src/sys/dev/e1000/if_em.c:1796:18: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? link_check = hw.mac.serdes_has_link; ~~^ -> /usr/src/sys/dev/e1000/if_em.c:1844:9: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? hw.mac.type >= igb_mac_min) { ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2091:8: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type != e1000_82575) ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2097:12: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? switch (hw.mac.type) { ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2496:9: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.max_frame_size > 4096) ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2528:9: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.max_frame_size > 8192) [105/1851] ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2540:15: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? min_tx = (hw.mac.max_frame_size + ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2544:14: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? min_rx = hw.mac.max_frame_size; ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2581:17: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? roundup2(hw.mac.max_frame_size, 1024); ~~^ -> /usr/src/sys/sys/param.h:310:27: note: expanded from macro 'roundup2' #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ ^ /usr/src/sys/dev/e1000/if_em.c:2656:8: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type >= igb_mac_min) { ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2672:8: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type >= igb_mac_min) ~~^ -> /usr/src/sys/dev/e1000/if_em.c:2737:8: error: member reference type 'struct e1000_hw *' is a pointer; did you mean to use '->'? if (hw.mac.type == e1000_82575) ~~^ -> fatal error: too many errors emitted, stopping now [-ferror-limit=] To good health, Alastair From owner-dev-commits-src-main@freebsd.org Wed Jan 27 10:35: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 84B284F46D2; Wed, 27 Jan 2021 10:35:25 +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 4DQg3d32WBz3m6G; Wed, 27 Jan 2021 10:35:25 +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 5ACBB1B04E; Wed, 27 Jan 2021 10:35:25 +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 10RAZPBQ031159; Wed, 27 Jan 2021 10:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RAZPOx031158; Wed, 27 Jan 2021 10:35:25 GMT (envelope-from git) Date: Wed, 27 Jan 2021 10:35:25 GMT Message-Id: <202101271035.10RAZPOx031158@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: 042ef1f11550 - main - Remove DTS files for arm boards we don't support 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: 042ef1f115500e53cba8c1497e5af7ad9d98e9ea 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, 27 Jan 2021 10:35:25 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=042ef1f115500e53cba8c1497e5af7ad9d98e9ea commit 042ef1f115500e53cba8c1497e5af7ad9d98e9ea Author: Andrew Turner AuthorDate: 2021-01-26 21:13:29 +0000 Commit: Andrew Turner CommitDate: 2021-01-27 10:02:01 +0000 Remove DTS files for arm boards we don't support These are all FreeBS-specific device tree files. We don't support any of these anymore, remove them. Reviewed by: emaste, manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D28365 --- sys/dts/arm/db78100.dts | 332 -------------------------------------- sys/dts/arm/db88f5182.dts | 223 -------------------------- sys/dts/arm/db88f5281.dts | 227 -------------------------- sys/dts/arm/db88f6281.dts | 299 ----------------------------------- sys/dts/arm/dockstar.dts | 241 ---------------------------- sys/dts/arm/dreamplug-1001.dts | 320 ------------------------------------- sys/dts/arm/dreamplug-1001N.dts | 341 ---------------------------------------- sys/dts/arm/ea3250.dts | 270 ------------------------------- sys/dts/arm/rt1310a.dtsi | 159 ------------------- sys/dts/arm/sheevaplug.dts | 253 ----------------------------- sys/dts/arm/ts7800.dts | 161 ------------------- sys/dts/arm/vsatv102-m6.dts | 309 ------------------------------------ sys/dts/arm/wzr2-g300n.dts | 92 ----------- sys/dts/arm/yyhd18-m3.dts | 237 ---------------------------- 14 files changed, 3464 deletions(-) diff --git a/sys/dts/arm/db78100.dts b/sys/dts/arm/db78100.dts deleted file mode 100644 index 9ac6d01335d9..000000000000 --- a/sys/dts/arm/db78100.dts +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * 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. - * - * Marvell DB-78100 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-78100"; - compatible = "DB-78100-BP", "DB-78100-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - serial0 = &serial0; - serial1 = &serial1; - mpp = &MPP; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR571"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x20000000>; // 512M at 0x0 - }; - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <5>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x2f 0xf9300000 0x00100000 - 0x1 0x3e 0xf9400000 0x00100000 - 0x2 0x3d 0xf9500000 0x02000000 - 0x3 0x3b 0xfb500000 0x00100000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - }; - - nand@3,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mrvl,nfc"; - reg = <0x3 0x0 0x00100000>; - }; - }; - - soc78100@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <8>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 2 /* MPP[0]: GE1_TXCLK */ - 1 2 /* MPP[1]: GE1_TXCTL */ - 2 2 /* MPP[2]: GE1_RXCTL */ - 3 2 /* MPP[3]: GE1_RXCLK */ - 4 2 /* MPP[4]: GE1_TXD[0] */ - 5 2 /* MPP[5]: GE1_TXD[1] */ - 6 2 /* MPP[6]: GE1_TXD[2] */ - 7 2 /* MPP[7]: GE1_TXD[3] */ - 8 2 /* MPP[8]: GE1_RXD[0] */ - 9 2 /* MPP[9]: GE1_RXD[1] */ - 10 2 /* MPP[10]: GE1_RXD[2] */ - 11 2 /* MPP[11]: GE1_RXD[3] */ - 13 3 /* MPP[13]: SYSRST_OUTn */ - 14 3 /* MPP[14]: SATA1_ACTn */ - 15 3 /* MPP[15]: SATA0_ACTn */ - 16 4 /* MPP[16]: UA2_TXD */ - 17 4 /* MPP[17]: UA2_RXD */ - 18 3 /* MPP[18]: */ - 19 3 /* MPP[19]: */ - 20 3 /* MPP[20]: */ - 21 3 /* MPP[21]: */ - 22 4 /* MPP[22]: UA3_TXD */ - 23 4 >; /* MPP[21]: UA3_RXD */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <2>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <56 57 58 59>; - interrupt-parent = <&PIC>; - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <2>; - interrupt-parent = <&PIC>; - }; - - twsi@11100 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11100 0x20>; - interrupts = <3>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <41 42 43 40 70>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x8>; - }; - phy1: ethernet-phy@1 { - reg = <0x9>; - }; - }; - }; - - enet1: ethernet@76000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x76000 0x2000>; - ranges = <0x0 0x76000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <45 46 47 44 70>; - interrupt-parent = <&PIC>; - phy-handle = <&phy1>; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <12>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <13>; - interrupt-parent = <&PIC>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <72 16>; - interrupt-parent = <&PIC>; - }; - - usb@51000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x51000 0x1000>; - interrupts = <72 17>; - interrupt-parent = <&PIC>; - }; - - usb@52000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x52000 0x1000>; - interrupts = <72 18>; - interrupt-parent = <&PIC>; - }; - - xor@60000 { - compatible = "mrvl,xor"; - reg = <0x60000 0x1000>; - interrupts = <22 23>; - interrupt-parent = <&PIC>; - }; - - crypto@90000 { - compatible = "mrvl,cesa"; - reg = <0x90000 0x1000 /* tdma base reg chan 0 */ - 0x9D000 0x1000>; /* cesa base reg chan 0 */ - interrupts = <19>; - interrupt-parent = <&PIC>; - }; - - sata@a0000 { - compatible = "mrvl,sata"; - reg = <0xa0000 0x6000>; - interrupts = <26>; - interrupt-parent = <&PIC>; - }; - }; - - pci0: pcie@f1040000 { - compatible = "mrvl,pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0xf1040000 0x2000>; - bus-range = <0 255>; - ranges = <0x02000000 0x0 0xf2000000 0xf2000000 0x0 0x04000000 - 0x01000000 0x0 0x00000000 0xf1100000 0x0 0x00100000>; - clock-frequency = <33333333>; - interrupt-parent = <&PIC>; - interrupts = <68>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x1 */ - 0x0800 0x0 0x0 0x1 &PIC 0x20 - 0x0800 0x0 0x0 0x2 &PIC 0x21 - 0x0800 0x0 0x0 0x3 &PIC 0x22 - 0x0800 0x0 0x0 0x4 &PIC 0x23 - >; - }; - - sram@fd000000 { - compatible = "mrvl,cesa-sram"; - reg = <0xfd000000 0x00100000>; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/sys/dts/arm/db88f5182.dts b/sys/dts/arm/db88f5182.dts deleted file mode 100644 index 768c9f166991..000000000000 --- a/sys/dts/arm/db88f5182.dts +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * 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. - * - * Marvell DB-88F5182 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-88F5182"; - compatible = "DB-88F5182-BP", "DB-88F5182-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - serial0 = &serial0; - serial1 = &serial1; - mpp = &MPP; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR531"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x08000000>; // 128M at 0x0 - }; - - localbus@f1000000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; - }; - }; - - soc88f5182@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <0>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x54>; - pin-count = <20>; - pin-map = < - 0 3 /* MPP[0]: GPIO[0] */ - 2 2 /* MPP[2]: PCI_REQn[3] */ - 3 2 /* MPP[3]: PCI_GNTn[3] */ - 4 2 /* MPP[4]: PCI_REQn[4] */ - 5 2 /* MPP[5]: PCI_GNTn[4] */ - 6 5 /* MPP[6]: SATA0_ACT */ - 7 5 /* MPP[7]: SATA1_ACT */ - 12 5 /* MPP[12]: SATA0_PRESENT */ - 13 5 /* MPP[13]: SATA1_PRESENT */ - 14 4 /* MPP[14]: NAND Flash REn[2] */ - 15 4 /* MPP[15]: NAND Flash WEn[2] */ - 16 0 /* MPP[16]: UA1_RXD */ - 17 0 /* MPP[17]: UA1_TXD */ - 18 0 /* MPP[18]: UA1_CTS */ - 19 0 >; /* MPP[19]: UA1_RTS */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <2>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <6 7 8 9>; - interrupt-parent = <&PIC>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V1"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <18 19 20 21 22>; - interrupt-parent = <&PIC>; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <3>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <4>; - interrupt-parent = <&PIC>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <17 16>; - interrupt-parent = <&PIC>; - }; - - idma@60000 { - compatible = "mrvl,idma"; - reg = <0x60000 0x1000>; - interrupts = <24 25 26 27 23>; - interrupt-parent = <&PIC>; - }; - - sata@80000 { - compatible = "mrvl,sata"; - reg = <0x80000 0x6000>; - interrupts = <29>; - interrupt-parent = <&PIC>; - }; - }; -}; diff --git a/sys/dts/arm/db88f5281.dts b/sys/dts/arm/db88f5281.dts deleted file mode 100644 index 77a25ba92b73..000000000000 --- a/sys/dts/arm/db88f5281.dts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * 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. - * - * Marvell DB-88F5281 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-88F5281"; - compatible = "DB-88F5281-BP", "DB-88F5281-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - serial0 = &serial0; - serial1 = &serial1; - mpp = &MPP; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR531"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x08000000>; // 128M at 0x0 - }; - - localbus@f1000000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; - }; - }; - - soc88f5281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <0>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x54>; - pin-count = <20>; - pin-map = < - 0 3 /* MPP[0]: GPIO[0] */ - 2 2 /* MPP[2]: PCI_REQn[3] */ - 3 2 /* MPP[3]: PCI_GNTn[3] */ - 4 2 /* MPP[4]: PCI_REQn[4] */ - 5 2 /* MPP[5]: PCI_GNTn[4] */ - 6 3 /* MPP[6]: */ - 7 3 /* MPP[7]: */ - 8 3 /* MPP[8]: */ - 9 3 /* MPP[9]: */ - 14 4 /* MPP[14]: NAND Flash REn[2] */ - 15 4 /* MPP[15]: NAND Flash WEn[2] */ - 16 0 /* MPP[16]: UA1_RXD */ - 17 0 /* MPP[17]: UA1_TXD */ - 18 0 /* MPP[18]: UA1_CTS */ - 19 0 >; /* MPP[19]: UA1_RTS */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <2>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <6 7 8 9>; - interrupt-parent = <&PIC>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V1"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <18 19 20 21 22>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x8>; - }; - }; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <3>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <4>; - interrupt-parent = <&PIC>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <17 16>; - interrupt-parent = <&PIC>; - }; - - idma@60000 { - compatible = "mrvl,idma"; - reg = <0x60000 0x1000>; - interrupts = <24 25 26 27 23>; - interrupt-parent = <&PIC>; - }; - }; -}; diff --git a/sys/dts/arm/db88f6281.dts b/sys/dts/arm/db88f6281.dts deleted file mode 100644 index 6991c713de54..000000000000 --- a/sys/dts/arm/db88f6281.dts +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * 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. - * - * Marvell DB-88F6281 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-88F6281"; - compatible = "DB-88F6281-BP", "DB-88F6281-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - mpp = &MPP; - pci0 = &pci0; - serial0 = &serial0; - serial1 = &serial1; - soc = &SOC; - sram = &SRAM; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR131"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x20000000>; // 512M at 0x0 - }; - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <3>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x2f 0xf9300000 0x00100000>; - - nand@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mrvl,nfc"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - - slice@0 { - reg = <0x0 0x200000>; - label = "u-boot"; - read-only; - }; - - slice@200000 { - reg = <0x200000 0x7e00000>; - label = "root"; - }; - }; - }; - - SOC: soc88f6281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <1>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 1 /* MPP[0]: NF_IO[2] */ - 1 1 /* MPP[1]: NF_IO[3] */ - 2 1 /* MPP[2]: NF_IO[4] */ - 3 1 /* MPP[3]: NF_IO[5] */ - 4 1 /* MPP[4]: NF_IO[6] */ - 5 1 /* MPP[5]: NF_IO[7] */ - 6 1 /* MPP[6]: SYSRST_OUTn */ - 7 2 /* MPP[7]: SPI_SCn */ - 8 1 /* MPP[8]: TW_SDA */ - 9 1 /* MPP[9]: TW_SCK */ - 10 3 /* MPP[10]: UA0_TXD */ - 11 3 /* MPP[11]: UA0_RXD */ - 12 1 /* MPP[12]: SD_CLK */ *** 2596 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Jan 27 10:35: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 916824F4465; Wed, 27 Jan 2021 10:35: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 4DQg3f3kLzz3m23; Wed, 27 Jan 2021 10:35: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 72A791B404; Wed, 27 Jan 2021 10:35: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 10RAZQYo031182; Wed, 27 Jan 2021 10:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RAZQfe031181; Wed, 27 Jan 2021 10:35:26 GMT (envelope-from git) Date: Wed, 27 Jan 2021 10:35:26 GMT Message-Id: <202101271035.10RAZQfe031181@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: 2be9ff2d65e9 - main - Remove old Marvell drivers 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: 2be9ff2d65e968497e04e3cd66ccbf9178252493 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, 27 Jan 2021 10:35:26 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2be9ff2d65e968497e04e3cd66ccbf9178252493 commit 2be9ff2d65e968497e04e3cd66ccbf9178252493 Author: Andrew Turner AuthorDate: 2021-01-26 21:58:16 +0000 Commit: Andrew Turner CommitDate: 2021-01-27 10:02:02 +0000 Remove old Marvell drivers These have probe functions that can only match device tree files that have been removed because the boards they describe are unsupported. Reviewed by: imp, manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D28366 --- sys/arm/mv/files.arm7 | 2 - sys/arm/mv/mv_localbus.c | 488 ----------------------------------------------- sys/arm/mv/mv_ts.c | 182 ------------------ 3 files changed, 672 deletions(-) diff --git a/sys/arm/mv/files.arm7 b/sys/arm/mv/files.arm7 index 6b264c5ab871..6f93fd6edbc5 100644 --- a/sys/arm/mv/files.arm7 +++ b/sys/arm/mv/files.arm7 @@ -4,11 +4,9 @@ arm/mv/armadaxp/armadaxp.c standard arm/mv/gpio.c optional gpio arm/mv/mv_common.c standard -arm/mv/mv_localbus.c standard arm/mv/mv_armv7_machdep.c standard arm/mv/mv_pci_ctrl.c optional pci | fdt arm/mv/mv_pci.c optional pci -arm/mv/mv_ts.c standard arm/mv/timer.c standard arm/mv/mpic.c standard diff --git a/sys/arm/mv/mv_localbus.c b/sys/arm/mv/mv_localbus.c deleted file mode 100644 index a313f9664242..000000000000 --- a/sys/arm/mv/mv_localbus.c +++ /dev/null @@ -1,488 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Semihalf. - * 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 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include "opt_platform.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include - -#include "dev/fdt/fdt_common.h" -#include "ofw_bus_if.h" - -#include -#include - -#ifdef DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ - printf(fmt,##args); } while (0) -#else -#define debugf(fmt, args...) -#endif - -#define MV_LOCALBUS_MAX_BANKS 8 -#define MV_LOCALBUS_MAX_BANK_CELLS 4 - -static MALLOC_DEFINE(M_LOCALBUS, "localbus", "localbus devices information"); - -struct localbus_bank { - vm_offset_t va; /* VA of the bank */ - vm_paddr_t pa; /* physical address of the bank */ - vm_size_t size; /* bank size */ - uint8_t mapped; /* device memory has mapping */ -}; - -struct localbus_softc { - device_t sc_dev; - bus_space_handle_t sc_bsh; - bus_space_tag_t sc_bst; - int sc_rid; - - struct localbus_bank *sc_banks; -}; - -struct localbus_devinfo { - struct ofw_bus_devinfo di_ofw; - struct resource_list di_res; - int di_bank; -}; - -struct localbus_va_entry { - int8_t bank; - vm_offset_t va; - vm_size_t size; -}; - -/* - * Prototypes. - */ -static int localbus_probe(device_t); -static int localbus_attach(device_t); -static int localbus_print_child(device_t, device_t); - -static struct resource *localbus_alloc_resource(device_t, device_t, int, - int *, rman_res_t, rman_res_t, rman_res_t, u_int); -static struct resource_list *localbus_get_resource_list(device_t, device_t); - -static ofw_bus_get_devinfo_t localbus_get_devinfo; - -/* - * Bus interface definition. - */ -static device_method_t localbus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, localbus_probe), - DEVMETHOD(device_attach, localbus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, localbus_print_child), - DEVMETHOD(bus_alloc_resource, localbus_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(bus_get_resource_list, localbus_get_resource_list), - - /* OFW bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, localbus_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } -}; - -static driver_t localbus_driver = { - "localbus", - localbus_methods, - sizeof(struct localbus_softc) -}; - -const struct localbus_va_entry localbus_virtmap[] = { - { 0, MV_DEV_BOOT_BASE, MV_DEV_BOOT_SIZE }, - { 1, MV_DEV_CS0_BASE, MV_DEV_CS0_SIZE }, - { 2, MV_DEV_CS1_BASE, MV_DEV_CS1_SIZE }, - { 3, MV_DEV_CS2_BASE, MV_DEV_CS2_SIZE }, - { -1, 0, 0 } -}; - -static struct localbus_bank localbus_banks[MV_LOCALBUS_MAX_BANKS]; - -devclass_t localbus_devclass; - -DRIVER_MODULE(localbus, ofwbus, localbus_driver, localbus_devclass, 0, 0); - -static int -fdt_localbus_reg_decode(phandle_t node, struct localbus_softc *sc, - struct localbus_devinfo *di) -{ - u_long start, end, count; - pcell_t *reg, *regptr; - pcell_t addr_cells, size_cells; - int tuple_size, tuples; - int i, rv, bank; - - if (fdt_addrsize_cells(OF_parent(node), &addr_cells, &size_cells) != 0) - return (ENXIO); - - tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); - tuples = OF_getprop_alloc_multi(node, "reg", tuple_size, (void **)®); - debugf("addr_cells = %d, size_cells = %d\n", addr_cells, size_cells); - debugf("tuples = %d, tuple size = %d\n", tuples, tuple_size); - if (tuples <= 0) - /* No 'reg' property in this node. */ - return (0); - - regptr = reg; - for (i = 0; i < tuples; i++) { - bank = fdt_data_get((void *)regptr, 1); - - if (bank >= MV_LOCALBUS_MAX_BANKS) { - device_printf(sc->sc_dev, "bank number [%d] out of " - "range\n", bank); - continue; - } - - /* - * If device doesn't have virtual to physical mapping don't add - * resources - */ - if (!(sc->sc_banks[bank].mapped)) { - device_printf(sc->sc_dev, "device [%d]: missing memory " - "mapping\n", bank); - continue; - } - - di->di_bank = bank; - regptr += 1; - - /* Get address/size. */ - rv = fdt_data_to_res(regptr, addr_cells - 1, size_cells, &start, - &count); - if (rv != 0) { - resource_list_free(&di->di_res); - goto out; - } - - /* Check if enough amount of memory is mapped */ - if (sc->sc_banks[bank].size < count) { - device_printf(sc->sc_dev, "device [%d]: not enough " - "memory reserved\n", bank); - continue; - } - - regptr += addr_cells - 1 + size_cells; - - /* Calculate address range relative to VA base. */ - start = sc->sc_banks[bank].va + start; - end = start + count - 1; - - debugf("reg addr bank = %d, start = %lx, end = %lx, " - "count = %lx\n", bank, start, end, count); - - /* Use bank (CS) cell as rid. */ - resource_list_add(&di->di_res, SYS_RES_MEMORY, di->di_bank, - start, end, count); - } - rv = 0; -out: - OF_prop_free(reg); - return (rv); -} - -static int -localbus_probe(device_t dev) -{ - - if (!ofw_bus_is_compatible_strict(dev, "mrvl,lbc")) - return (ENXIO); - - device_set_desc(dev, "Marvell device bus"); - - return (BUS_PROBE_DEFAULT); -} - -static int -localbus_attach(device_t dev) -{ - device_t dev_child; - struct localbus_softc *sc; - struct localbus_devinfo *di; - phandle_t dt_node, dt_child; - - sc = device_get_softc(dev); - sc->sc_dev = dev; - sc->sc_banks = localbus_banks; - - /* - * Walk localbus and add direct subordinates as our children. - */ - dt_node = ofw_bus_get_node(dev); - for (dt_child = OF_child(dt_node); dt_child != 0; - dt_child = OF_peer(dt_child)) { - /* Check and process 'status' property. */ - if (!(ofw_bus_node_status_okay(dt_child))) - continue; - - if (!(mv_fdt_pm(dt_child))) - continue; - - di = malloc(sizeof(*di), M_LOCALBUS, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&di->di_ofw, dt_child) != 0) { - free(di, M_LOCALBUS); - device_printf(dev, "could not set up devinfo\n"); - continue; - } - - resource_list_init(&di->di_res); - if (fdt_localbus_reg_decode(dt_child, sc, di)) { - device_printf(dev, "could not process 'reg' " - "property\n"); - ofw_bus_gen_destroy_devinfo(&di->di_ofw); - free(di, M_LOCALBUS); - continue; - } - - /* Add newbus device for this FDT node */ - dev_child = device_add_child(dev, NULL, -1); - if (dev_child == NULL) { - device_printf(dev, "could not add child: %s\n", - di->di_ofw.obd_name); - resource_list_free(&di->di_res); - ofw_bus_gen_destroy_devinfo(&di->di_ofw); - free(di, M_LOCALBUS); - continue; - } -#ifdef DEBUG - device_printf(dev, "added child: %s\n\n", di->di_ofw.obd_name); -#endif - device_set_ivars(dev_child, di); - } - - return (bus_generic_attach(dev)); -} - -static int -localbus_print_child(device_t dev, device_t child) -{ - struct localbus_devinfo *di; - struct resource_list *rl; - int rv; - - di = device_get_ivars(child); - rl = &di->di_res; - - rv = 0; - rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); - rv += bus_print_child_footer(dev, child); - - return (rv); -} - -static struct resource * -localbus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct localbus_devinfo *di; - struct resource_list_entry *rle; - - /* - * Request for the default allocation with a given rid: use resource - * list stored in the local device info. - */ - if (RMAN_IS_DEFAULT_RANGE(start, end)) { - if ((di = device_get_ivars(child)) == NULL) - return (NULL); - - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - - rid = &di->di_bank; - rle = resource_list_find(&di->di_res, type, *rid); - if (rle == NULL) { - device_printf(bus, "no default resources for " - "rid = %d, type = %d\n", *rid, type); - return (NULL); - } - start = rle->start; - end = rle->end; - count = rle->count; - } - - return (bus_generic_alloc_resource(bus, child, type, rid, start, end, - count, flags)); -} - -static struct resource_list * -localbus_get_resource_list(device_t bus, device_t child) -{ - struct localbus_devinfo *di; - - di = device_get_ivars(child); - return (&di->di_res); -} - -static const struct ofw_bus_devinfo * -localbus_get_devinfo(device_t bus, device_t child) -{ - struct localbus_devinfo *di; - - di = device_get_ivars(child); - return (&di->di_ofw); -} - -int -fdt_localbus_devmap(phandle_t dt_node, struct devmap_entry *fdt_devmap, - int banks_max_num, int *banks_added) -{ - pcell_t ranges[MV_LOCALBUS_MAX_BANKS * MV_LOCALBUS_MAX_BANK_CELLS]; - pcell_t *rangesptr; - uint32_t tuple_size, bank; - vm_paddr_t offset; - vm_size_t size; - int dev_num, addr_cells, size_cells, par_addr_cells, va_index, i, j, k; - - if ((fdt_addrsize_cells(dt_node, &addr_cells, &size_cells)) != 0) - return (EINVAL); - - par_addr_cells = fdt_parent_addr_cells(dt_node); - if (par_addr_cells > 2) { - /* - * Localbus devmap initialization error: unsupported parent - * #addr-cells - */ - return (ERANGE); - } - - tuple_size = (addr_cells + par_addr_cells + size_cells); - if (tuple_size > MV_LOCALBUS_MAX_BANK_CELLS) - return (ERANGE); - - tuple_size *= sizeof(pcell_t); - - dev_num = OF_getprop(dt_node, "ranges", ranges, sizeof(ranges)); - if (dev_num <= 0) - return (EINVAL); - - /* Calculate number of devices attached to bus */ - dev_num = dev_num / tuple_size; - - /* - * If number of ranges > max number of localbus devices, - * additional entries will not be processed - */ - dev_num = MIN(dev_num, banks_max_num); - - rangesptr = &ranges[0]; - j = 0; - - /* Process data from FDT */ - for (i = 0; i < dev_num; i++) { - /* First field is bank number */ - bank = fdt_data_get((void *)rangesptr, 1); - rangesptr += 1; - - if (bank > MV_LOCALBUS_MAX_BANKS) { - /* Bank out of range */ - rangesptr += ((addr_cells - 1) + par_addr_cells + - size_cells); - continue; - } - - /* Find virtmap entry for this bank */ - va_index = -1; - for (k = 0; localbus_virtmap[k].bank >= 0; k++) { - if (localbus_virtmap[k].bank == bank) { - va_index = k; - break; - } - } - - /* Check if virtmap entry was found */ - if (va_index == -1) { - rangesptr += ((addr_cells - 1) + par_addr_cells + - size_cells); - continue; - } - - /* Remaining child's address fields are unused */ - rangesptr += (addr_cells - 1); - - /* Parent address offset */ - offset = fdt_data_get((void *)rangesptr, par_addr_cells); - rangesptr += par_addr_cells; - - /* Last field is size */ - size = fdt_data_get((void *)rangesptr, size_cells); - rangesptr += size_cells; - - if (size > localbus_virtmap[va_index].size) { - /* Not enough space reserved in virtual memory map */ - continue; - } - - fdt_devmap[j].pd_va = localbus_virtmap[va_index].va; - fdt_devmap[j].pd_pa = offset; - fdt_devmap[j].pd_size = size; - - /* Copy data to structure used by localbus driver */ - localbus_banks[bank].va = fdt_devmap[j].pd_va; - localbus_banks[bank].pa = fdt_devmap[j].pd_pa; - localbus_banks[bank].size = fdt_devmap[j].pd_size; - localbus_banks[bank].mapped = 1; - - j++; - } - - *banks_added = j; - return (0); -} diff --git a/sys/arm/mv/mv_ts.c b/sys/arm/mv/mv_ts.c deleted file mode 100644 index 1a7b3981daad..000000000000 --- a/sys/arm/mv/mv_ts.c +++ /dev/null @@ -1,182 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Hiroki Sato - * 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 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. - * - * Driver for on-die thermal sensor in 88F6282 and 88F6283. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -static struct resource_spec mvts_res[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { -1, 0 } -}; - -struct mvts_softc { - device_t sc_dev; - struct resource *sc_res[sizeof(mvts_res)]; -}; - -static int -ts_probe(device_t dev) -{ - uint32_t d, r; - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "mrvl,ts")) - return (ENXIO); - soc_id(&d, &r); - switch (d) { - case MV_DEV_88F6282: - break; - default: - device_printf(dev, "unsupported SoC (ID: 0x%08X)!\n", d); - return (ENXIO); - } - device_set_desc(dev, "Marvell Thermal Sensor"); - - return (0); -} - -#define MV_TEMP_VALID_BIT (1 << 9) -#define MV_TEMP_SENS_OFFS 10 -#define MV_TEMP_SENS_MASK 0x1ff -#define MV_TEMP_SENS_READ_MAX 16 -#define TZ_ZEROC 2731 -#define MV_TEMP_CONVERT(x) ((((322 - x) * 100000) / 13625) + TZ_ZEROC) - -/* - * MSB LSB - * 0000 0000 0000 0000 0000 0000 0000 0000 - * ^- valid bit - * |---------| - * ^--- temperature (9 bits) - */ - -static int -ts_sysctl_handler(SYSCTL_HANDLER_ARGS) -{ - struct mvts_softc *sc; - device_t dev; - uint32_t ret, ret0; - u_int val; - int i; - - dev = (device_t)arg1; - sc = device_get_softc(dev); - val = TZ_ZEROC; - - ret = bus_read_4(sc->sc_res[0], 0); - if ((ret & MV_TEMP_VALID_BIT) == 0) { - device_printf(dev, "temperature sensor is broken.\n"); - goto ts_sysctl_handle_int; - } - ret0 = 0; - for (i = 0; i < MV_TEMP_SENS_READ_MAX; i++) { - ret = bus_read_4(sc->sc_res[0], 0); - ret = (ret >> MV_TEMP_SENS_OFFS) & MV_TEMP_SENS_MASK; - - /* - * Successive reads should returns the same value except - * for the LSB when the sensor is normal. - */ - if (((ret0 ^ ret) & 0x1fe) == 0) - break; - else - ret0 = ret; - } - if (i == MV_TEMP_SENS_READ_MAX) { - device_printf(dev, "temperature sensor is unstable.\n"); - goto ts_sysctl_handle_int; - } - val = (u_int)MV_TEMP_CONVERT(ret); - -ts_sysctl_handle_int: - return (sysctl_handle_int(oidp, &val, 0, req)); -} - -static int -ts_attach(device_t dev) -{ - struct mvts_softc *sc; - struct sysctl_ctx_list *ctx; - int error; - - sc = device_get_softc(dev); - sc->sc_dev = dev; - error = bus_alloc_resources(dev, mvts_res, sc->sc_res); - if (error) { - device_printf(dev, "could not allocate resources\n"); - return (ENXIO); - } - ctx = device_get_sysctl_ctx(dev); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "temperature", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, - 0, ts_sysctl_handler, "IK", "Current Temperature"); - - return (0); -} - -static int -ts_detach(device_t dev) -{ - - return (0); -} - -static device_method_t ts_methods[] = { - DEVMETHOD(device_probe, ts_probe), - DEVMETHOD(device_attach, ts_attach), - DEVMETHOD(device_detach, ts_detach), - {0, 0}, -}; - -static driver_t ts_driver = { - "mvts", - ts_methods, - sizeof(struct mvts_softc), -}; - -static devclass_t ts_devclass; -DRIVER_MODULE(mvts, simplebus, ts_driver, ts_devclass, 0, 0); -MODULE_VERSION(mvts, 1); From owner-dev-commits-src-main@freebsd.org Wed Jan 27 11: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 756024F56F7; Wed, 27 Jan 2021 11:18: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 4DQh1k2wNzz3pXy; Wed, 27 Jan 2021 11:18: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 56FEC1BAA2; Wed, 27 Jan 2021 11:18: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 10RBIowS083639; Wed, 27 Jan 2021 11:18:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBIoxk083638; Wed, 27 Jan 2021 11:18:50 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:18:50 GMT Message-Id: <202101271118.10RBIoxk083638@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: 45b252fc9182 - main - cp: fix indentation 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: 45b252fc9182b96342b8a598f271e49c20cbfe40 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, 27 Jan 2021 11:18:50 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=45b252fc9182b96342b8a598f271e49c20cbfe40 commit 45b252fc9182b96342b8a598f271e49c20cbfe40 Author: Baptiste Daroussin AuthorDate: 2021-01-26 09:52:22 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:18:45 +0000 cp: fix indentation No functional changes --- bin/cp/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 7742b0d0a516..e7ae0c9dd733 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -235,7 +235,7 @@ copy_file(const FTSENT *entp, int dne) do { if (use_copy_file_range) { rcount = copy_file_range(from_fd, NULL, - to_fd, NULL, SSIZE_MAX, 0); + to_fd, NULL, SSIZE_MAX, 0); if (rcount < 0 && errno == EINVAL) { /* Prob a non-seekable FD */ use_copy_file_range = 0; From owner-dev-commits-src-main@freebsd.org Wed Jan 27 11:18: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 94BA24F565B; Wed, 27 Jan 2021 11:18: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 4DQh1l3sH1z3pKt; Wed, 27 Jan 2021 11:18: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 776EE1BC41; Wed, 27 Jan 2021 11:18: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 10RBIp1u083662; Wed, 27 Jan 2021 11:18:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBIpwh083661; Wed, 27 Jan 2021 11:18:51 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:18:51 GMT Message-Id: <202101271118.10RBIpwh083661@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: c440e7870a02 - main - diff: add a test case about the non regular file support 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: c440e7870a020546ad241848e2ff8e9cb27a3073 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, 27 Jan 2021 11:18:51 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c440e7870a020546ad241848e2ff8e9cb27a3073 commit c440e7870a020546ad241848e2ff8e9cb27a3073 Author: Baptiste Daroussin AuthorDate: 2021-01-26 10:38:36 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:18:45 +0000 diff: add a test case about the non regular file support --- usr.bin/diff/tests/diff_test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 6da2bbaea34d..60b56f0d9067 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -16,6 +16,7 @@ atf_test_case tabsize atf_test_case conflicting_format atf_test_case label atf_test_case report_identical +atf_test_case non_regular_file simple_body() { @@ -236,6 +237,19 @@ report_identical_body() -o empty diff -s A B } +non_regular_file_body() +{ + printf "\tA\n" > A + mkfifo B + printf "\tA\n" > B & + + atf_check diff A B + printf "\tB\n" > B & + atf_check -s exit:1 \ + -o inline:"--- A\n+++ B\n@@ -1 +1 @@\n-\tA\n+\tB\n" \ + diff --label A --label B -u A B +} + atf_init_test_cases() { atf_add_test_case simple @@ -254,4 +268,5 @@ atf_init_test_cases() atf_add_test_case conflicting_format atf_add_test_case label atf_add_test_case report_identical + atf_add_test_case non_regular_file } From owner-dev-commits-src-main@freebsd.org Wed Jan 27 11:18: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 4876A4F5828; Wed, 27 Jan 2021 11:18: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 4DQh1n0Gqdz3pVp; Wed, 27 Jan 2021 11:18: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 A585D1BAA3; Wed, 27 Jan 2021 11:18: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 10RBIqJl083682; Wed, 27 Jan 2021 11:18:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBIqus083681; Wed, 27 Jan 2021 11:18:52 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:18:52 GMT Message-Id: <202101271118.10RBIqus083681@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: fa977a3b2bb2 - main - 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: fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1 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, 27 Jan 2021 11:18:53 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1 commit fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1 Author: Baptiste Daroussin AuthorDate: 2021-01-26 10:42:20 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:18:45 +0000 diff: eliminate a useless lseek fdopen with the "r" already position the stream at the beginning of the file. --- usr.bin/diff/diffreg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 4e887ab27c7b..a8d668ea0984 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -491,7 +491,6 @@ 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 Wed Jan 27 11:18: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 AFC584F5887; Wed, 27 Jan 2021 11:18: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 4DQh1n6zXhz3pL3; Wed, 27 Jan 2021 11:18: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 BE0DD1BC97; Wed, 27 Jan 2021 11:18: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 10RBIrtc083702; Wed, 27 Jan 2021 11:18:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBIr26083701; Wed, 27 Jan 2021 11:18:53 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:18:53 GMT Message-Id: <202101271118.10RBIr26083701@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: 15abb2328654 - main - diff: eliminate space at end of line 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: 15abb23286541c17ff95bac056cd4979822c4288 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, 27 Jan 2021 11:18:55 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=15abb23286541c17ff95bac056cd4979822c4288 commit 15abb23286541c17ff95bac056cd4979822c4288 Author: Baptiste Daroussin AuthorDate: 2021-01-27 10:46:15 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:18:45 +0000 diff: eliminate space at end of line No functionnal changes --- usr.bin/diff/diffreg.c | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index a8d668ea0984..282db0f9c447 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -268,17 +268,17 @@ diffreg(char *file1, char *file2, int flags, int capsicum) lastmatchline = 0; context_vec_ptr = context_vec_start - 1; - /* - * hw excludes padding and make sure when -t is not used, + /* + * hw excludes padding and make sure when -t is not used, * the second column always starts from the closest tab stop */ - if (diff_format == D_SIDEBYSIDE) { + if (diff_format == D_SIDEBYSIDE) { hw = width >> 1; padding = tabsize - (hw % tabsize); if ((flags & D_EXPANDTABS) != 0 || (padding % tabsize == 0)) padding = MIN_PAD; - hw = (width >> 1) - + hw = (width >> 1) - ((padding == MIN_PAD) ? (padding << 1) : padding) - 1; } @@ -901,14 +901,14 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) if (diff_format != D_EDIT) { for (i0 = 1; i0 <= m; i0 = i1 + 1) { while (i0 <= m && J[i0] == J[i0 - 1] + 1){ - if (diff_format == D_SIDEBYSIDE && + if (diff_format == D_SIDEBYSIDE && suppress_common != 1) { - nc = fetch(ixold, i0, i0, f1, '\0', + nc = fetch(ixold, i0, i0, f1, '\0', 1, flags); - print_space(nc, - (hw - nc) + (padding << 1) + 1, + print_space(nc, + (hw - nc) + (padding << 1) + 1, flags); - fetch(ixnew, J[i0], J[i0], f2, '\0', + fetch(ixnew, J[i0], J[i0], f2, '\0', 0, flags); diff_output("\n"); } @@ -922,32 +922,32 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) J[i1] = j1; /* - * When using side-by-side, lines from both of the - * files are printed. The algorithm used by diff(1) - * identifies the ranges in which two files differ. - * See the change() function below. - * The for loop below consumes the shorter range, - * whereas one of the while loops deals with the + * When using side-by-side, lines from both of the + * files are printed. The algorithm used by diff(1) + * identifies the ranges in which two files differ. + * See the change() function below. + * The for loop below consumes the shorter range, + * whereas one of the while loops deals with the * longer one. */ if (diff_format == D_SIDEBYSIDE) { - for (i=i0, j=j0; i<=i1 && j<=j1; i++, j++) - change(file1, f1, file2, f2, i, i, + for (i=i0, j=j0; i<=i1 && j<=j1; i++, j++) + change(file1, f1, file2, f2, i, i, j, j, &flags); while (i <= i1) { - change(file1, f1, file2, f2, + change(file1, f1, file2, f2, i, i, j+1, j, &flags); i++; } while (j <= j1) { - change(file1, f1, file2, f2, + change(file1, f1, file2, f2, i+1, i, j, j, &flags); j++; } } else - change(file1, f1, file2, f2, i0, i1, j0, + change(file1, f1, file2, f2, i0, i1, j0, j1, &flags); } } else { @@ -1187,10 +1187,10 @@ proceed: print_space(0, hw + padding , *pflags); } else { nc = fetch(ixold, a, b, f1, '\0', 1, *pflags); - print_space(nc, hw - nc + padding, *pflags); + print_space(nc, hw - nc + padding, *pflags); } diff_output("%c", (a>b)? '>' : ((c>d)? '<' : '|')); - print_space(hw + padding + 1 , padding, *pflags); + print_space(hw + padding + 1 , padding, *pflags); fetch(ixnew, c, d, f2, '\0', 0, *pflags); diff_output("\n"); } @@ -1259,13 +1259,13 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) for (i = a; i <= b; i++) { fseek(lb, f[i - 1], SEEK_SET); nc = (f[i] - f[i - 1]); - if (diff_format == D_SIDEBYSIDE && hw < nc) + if (diff_format == D_SIDEBYSIDE && hw < nc) nc = hw; - if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && + if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && ch != '\0') { diff_output("%c", ch); - if (Tflag && (diff_format == D_NORMAL || - diff_format == D_CONTEXT || + if (Tflag && (diff_format == D_NORMAL || + diff_format == D_CONTEXT || diff_format == D_UNIFIED)) diff_output("\t"); else if (diff_format != D_UNIFIED) @@ -1274,7 +1274,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) col = 0; for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { if ((c = getc(lb)) == EOF) { - if (diff_format == D_EDIT || + if (diff_format == D_EDIT || diff_format == D_REVERSE || diff_format == D_NREVERSE) warnx("No newline at end of file"); @@ -1283,8 +1283,8 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) "file\n"); return col; } - /* - * when using --side-by-side, col needs to be increased + /* + * when using --side-by-side, col needs to be increased * in any case to keep the columns aligned */ if (c == '\t') { @@ -1296,9 +1296,9 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) diff_output(" "); } while (++col < newcol && j < nc); } else { - if (diff_format == D_SIDEBYSIDE) { + if (diff_format == D_SIDEBYSIDE) { if ((j + tabsize) > nc) { - diff_output("%*s", + diff_output("%*s", nc - j,""); j = col = nc; } else { @@ -1690,9 +1690,9 @@ print_header(const char *file1, const char *file2) file2, buf2); } -/* +/* * Prints n number of space characters either by using tab - * or single space characters. + * or single space characters. * nc is the preceding number of characters */ static void From owner-dev-commits-src-main@freebsd.org Wed Jan 27 11:19: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 52C804F565E; Wed, 27 Jan 2021 11:19: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 4DQh1s4f0sz3pQJ; Wed, 27 Jan 2021 11:18: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 09CCD1BC43; Wed, 27 Jan 2021 11:18: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 10RBItWT083746; Wed, 27 Jan 2021 11:18:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBIthN083745; Wed, 27 Jan 2021 11:18:55 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:18:55 GMT Message-Id: <202101271118.10RBIthN083745@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: e52546a3a75f - main - diff: fix typo in a comment 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: e52546a3a75f6e4b327178f4d50a98dd99101c64 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, 27 Jan 2021 11:19:01 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e52546a3a75f6e4b327178f4d50a98dd99101c64 commit e52546a3a75f6e4b327178f4d50a98dd99101c64 Author: Baptiste Daroussin AuthorDate: 2021-01-26 14:20:44 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:18:46 +0000 diff: fix typo in a comment --- usr.bin/diff/diffreg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 282db0f9c447..f8c25f822147 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -348,7 +348,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) if (caph_rights_limit(fileno(f2), &rights_ro) < 0) err(2, "unable to limit rights on: %s", file2); if (fileno(f1) == STDIN_FILENO || fileno(f2) == STDIN_FILENO) { - /* stding has already been limited */ + /* stdin has already been limited */ if (caph_limit_stderr() == -1) err(2, "unable to limit stderr"); if (caph_limit_stdout() == -1) From owner-dev-commits-src-main@freebsd.org Wed Jan 27 11:19: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 4844C4F588F; Wed, 27 Jan 2021 11:19: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 4DQh1t701Fz3pYH; Wed, 27 Jan 2021 11:18: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 D1F9F1BC42; Wed, 27 Jan 2021 11:18: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 10RBIsNB083724; Wed, 27 Jan 2021 11:18:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBIs9v083723; Wed, 27 Jan 2021 11:18:54 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:18:54 GMT Message-Id: <202101271118.10RBIs9v083723@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: 931ad51808a6 - main - diff: remove stalled entries in headers 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: 931ad51808a650fd28be27210f25ba05d8e71199 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, 27 Jan 2021 11:19:01 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=931ad51808a650fd28be27210f25ba05d8e71199 commit 931ad51808a650fd28be27210f25ba05d8e71199 Author: Baptiste Daroussin AuthorDate: 2021-01-27 11:13:47 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:18:45 +0000 diff: remove stalled entries in headers --- usr.bin/diff/diff.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 1974b5cc08d6..b5536bd7bf77 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -102,9 +102,6 @@ extern regex_t ignore_re; char *splice(char *, char *); int diffreg(char *, char *, int, int); -int easprintf(char **, const char *, ...); -void *emalloc(size_t); -void *erealloc(void *, size_t); void diffdir(char *, char *, int); void print_only(const char *, size_t, const char *); void print_status(int, char *, char *, const char *); From owner-dev-commits-src-main@freebsd.org Wed Jan 27 11:28: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 867BA4F597B; Wed, 27 Jan 2021 11:28: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 4DQhF93NMLz3qhB; Wed, 27 Jan 2021 11:28: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 666741BC7F; Wed, 27 Jan 2021 11:28: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 10RBSjJ5097276; Wed, 27 Jan 2021 11:28:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBSjBw097275; Wed, 27 Jan 2021 11:28:45 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:28:45 GMT Message-Id: <202101271128.10RBSjBw097275@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: e43239f5140e - main - diff: simplify the hash functions 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: e43239f5140e1b80de122458a2ac037172866058 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, 27 Jan 2021 11:28:45 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e43239f5140e1b80de122458a2ac037172866058 commit e43239f5140e1b80de122458a2ac037172866058 Author: Baptiste Daroussin AuthorDate: 2021-01-26 15:25:00 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:28:26 +0000 diff: simplify the hash functions Instead of 3 different complex case they have all been folded into a simple on based on switch --- usr.bin/diff/diffreg.c | 77 ++++++++++++++++++-------------------------------- 1 file changed, 27 insertions(+), 50 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index f8c25f822147..564032751862 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1349,64 +1349,41 @@ readhash(FILE *f, int flags) sum = 1; space = 0; - if ((flags & (D_FOLDBLANKS|D_IGNOREBLANKS)) == 0) { - if (flags & D_IGNORECASE) - for (i = 0; (t = getc(f)) != '\n'; i++) { - if (flags & D_STRIPCR && t == '\r') { - t = getc(f); - if (t == '\n') - break; - ungetc(t, f); - } - if (t == EOF) { - if (i == 0) - return (0); + for (i = 0;;) { + switch (t = getc(f)) { + case '\r': + if (flags & D_STRIPCR) { + t = getc(f); + if (t == '\n') break; - } - sum = sum * 127 + chrtran(t); - } - else - for (i = 0; (t = getc(f)) != '\n'; i++) { - if (flags & D_STRIPCR && t == '\r') { - t = getc(f); - if (t == '\n') - break; - ungetc(t, f); - } - if (t == EOF) { - if (i == 0) - return (0); - break; - } - sum = sum * 127 + t; + ungetc(t, f); } - } else { - for (i = 0;;) { - switch (t = getc(f)) { - case '\r': - case '\t': - case '\v': - case '\f': - case ' ': + /* FALLTHROUGH */ + case '\t': + case '\v': + case '\f': + case ' ': + if ((flags & (D_FOLDBLANKS|D_IGNOREBLANKS)) != 0) { space++; continue; - default: - if (space && (flags & D_IGNOREBLANKS) == 0) { - i++; - space = 0; - } - sum = sum * 127 + chrtran(t); + } + /* FALLTHROUGH */ + default: + if (space && (flags & D_IGNOREBLANKS) == 0) { i++; - continue; - case EOF: - if (i == 0) - return (0); - /* FALLTHROUGH */ - case '\n': - break; + space = 0; } + sum = sum * 127 + chrtran(t); + i++; + continue; + case EOF: + if (i == 0) + return (0); + /* FALLTHROUGH */ + case '\n': break; } + break; } /* * There is a remote possibility that we end up with a zero sum. From owner-dev-commits-src-main@freebsd.org Wed Jan 27 11:29:57 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 247B94F5C45; Wed, 27 Jan 2021 11:29:57 +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 4DQhGY0Ydnz3qqk; Wed, 27 Jan 2021 11:29: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 05D1F1BD9C; Wed, 27 Jan 2021 11:29: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 10RBTuEL097564; Wed, 27 Jan 2021 11:29:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBTuIO097563; Wed, 27 Jan 2021 11:29:56 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:29:56 GMT Message-Id: <202101271129.10RBTuIO097563@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: 7a57c9cb5a4d - main - diff: eleminitate useless macros 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: 7a57c9cb5a4dffb0483beeae6da7cf266ea634be 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, 27 Jan 2021 11:29:57 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7a57c9cb5a4dffb0483beeae6da7cf266ea634be commit 7a57c9cb5a4dffb0483beeae6da7cf266ea634be Author: Baptiste Daroussin AuthorDate: 2021-01-27 10:47:17 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:29:33 +0000 diff: eleminitate useless macros The diff_output was not bringing any values but was obfuscating the code. --- usr.bin/diff/diffreg.c | 113 ++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 57 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 564032751862..4c9211510459 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -180,7 +180,6 @@ struct context_vec { int d; /* end line in new file */ }; -#define diff_output printf #define MIN_PAD 1 static FILE *opentemp(const char *); static void output(char *, FILE *, char *, FILE *, int); @@ -910,7 +909,7 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) flags); fetch(ixnew, J[i0], J[i0], f2, '\0', 0, flags); - diff_output("\n"); + printf("\n"); } i0++; } @@ -970,7 +969,7 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) #define c i0 if ((c = getc(f1)) == EOF) return; - diff_output("%c", c); + printf("%c", c); } #undef c } @@ -985,20 +984,20 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) static void range(int a, int b, const char *separator) { - diff_output("%d", a > b ? b : a); + printf("%d", a > b ? b : a); if (a < b) - diff_output("%s%d", separator, b); + printf("%s%d", separator, b); } static void uni_range(int a, int b) { if (a < b) - diff_output("%d,%d", a, b - a + 1); + printf("%d,%d", a, b - a + 1); else if (a == b) - diff_output("%d", b); + printf("%d", b); else - diff_output("%d,0", b); + printf("%d,0", b); } static char * @@ -1089,7 +1088,7 @@ restart: } proceed: if (*pflags & D_HEADER && diff_format != D_BRIEF) { - diff_output("%s %s %s\n", diffargs, file1, file2); + printf("%s %s %s\n", diffargs, file1, file2); *pflags &= ~D_HEADER; } if (diff_format == D_CONTEXT || diff_format == D_UNIFIED) { @@ -1136,24 +1135,24 @@ proceed: case D_NORMAL: case D_EDIT: range(a, b, ","); - diff_output("%c", a > b ? 'a' : c > d ? 'd' : 'c'); + printf("%c", a > b ? 'a' : c > d ? 'd' : 'c'); if (diff_format == D_NORMAL) range(c, d, ","); - diff_output("\n"); + printf("\n"); break; case D_REVERSE: - diff_output("%c", a > b ? 'a' : c > d ? 'd' : 'c'); + printf("%c", a > b ? 'a' : c > d ? 'd' : 'c'); range(a, b, " "); - diff_output("\n"); + printf("\n"); break; case D_NREVERSE: if (a > b) - diff_output("a%d %d\n", b, d - c + 1); + printf("a%d %d\n", b, d - c + 1); else { - diff_output("d%d %d\n", a, b - a + 1); + printf("d%d %d\n", a, b - a + 1); if (!(c > d)) /* add changed lines */ - diff_output("a%d %d\n", b, d - c + 1); + printf("a%d %d\n", b, d - c + 1); } break; } @@ -1162,7 +1161,7 @@ proceed: /* print through if append (a>b), else to (nb: 0 vs 1 orig) */ nc = ixold[a > b ? b : a - 1] - curpos; for (i = 0; i < nc; i++) - diff_output("%c", getc(f1)); + printf("%c", getc(f1)); for (walk = group_format; *walk != '\0'; walk++) { if (*walk == '%') { walk++; @@ -1174,12 +1173,12 @@ proceed: fetch(ixnew, c, d, f2, '>', 0, *pflags); break; default: - diff_output("%%%c", *walk); + printf("%%%c", *walk); break; } continue; } - diff_output("%c", *walk); + printf("%c", *walk); } } if (diff_format == D_SIDEBYSIDE) { @@ -1189,15 +1188,15 @@ proceed: nc = fetch(ixold, a, b, f1, '\0', 1, *pflags); print_space(nc, hw - nc + padding, *pflags); } - diff_output("%c", (a>b)? '>' : ((c>d)? '<' : '|')); + printf("%c", (a>b)? '>' : ((c>d)? '<' : '|')); print_space(hw + padding + 1 , padding, *pflags); fetch(ixnew, c, d, f2, '\0', 0, *pflags); - diff_output("\n"); + printf("\n"); } if (diff_format == D_NORMAL || diff_format == D_IFDEF) { fetch(ixold, a, b, f1, '<', 1, *pflags); if (a <= b && c <= d && diff_format == D_NORMAL) - diff_output("---\n"); + printf("---\n"); } if (diff_format != D_GFORMAT && diff_format != D_SIDEBYSIDE) fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags); @@ -1209,17 +1208,17 @@ proceed: * it. We have to add a substitute command to change this * back and restart where we left off. */ - diff_output(".\n"); - diff_output("%ds/.//\n", a + edoffset - 1); + printf(".\n"); + printf("%ds/.//\n", a + edoffset - 1); b = a + edoffset - 1; a = b + 1; c += edoffset; goto restart; } if ((diff_format == D_EDIT || diff_format == D_REVERSE) && c <= d) - diff_output(".\n"); + printf(".\n"); if (inifdef) { - diff_output("#endif /* %s */\n", ifdefname); + printf("#endif /* %s */\n", ifdefname); inifdef = 0; } } @@ -1240,19 +1239,19 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) /* print through if append (a>b), else to (nb: 0 vs 1 orig) */ nc = f[a > b ? b : a - 1] - curpos; for (i = 0; i < nc; i++) - diff_output("%c", getc(lb)); + printf("%c", getc(lb)); } if (a > b) return (0); if (diff_format == D_IFDEF) { if (inifdef) { - diff_output("#else /* %s%s */\n", + printf("#else /* %s%s */\n", oldfile == 1 ? "!" : "", ifdefname); } else { if (oldfile) - diff_output("#ifndef %s\n", ifdefname); + printf("#ifndef %s\n", ifdefname); else - diff_output("#ifdef %s\n", ifdefname); + printf("#ifdef %s\n", ifdefname); } inifdef = 1 + oldfile; } @@ -1263,13 +1262,13 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) nc = hw; if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && ch != '\0') { - diff_output("%c", ch); + printf("%c", ch); if (Tflag && (diff_format == D_NORMAL || diff_format == D_CONTEXT || diff_format == D_UNIFIED)) - diff_output("\t"); + printf("\t"); else if (diff_format != D_UNIFIED) - diff_output(" "); + printf(" "); } col = 0; for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { @@ -1279,7 +1278,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) diff_format == D_NREVERSE) warnx("No newline at end of file"); else - diff_output("\n\\ No newline at end of " + printf("\n\\ No newline at end of " "file\n"); return col; } @@ -1293,21 +1292,21 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) do { if (diff_format == D_SIDEBYSIDE) j++; - diff_output(" "); + printf(" "); } while (++col < newcol && j < nc); } else { if (diff_format == D_SIDEBYSIDE) { if ((j + tabsize) > nc) { - diff_output("%*s", + printf("%*s", nc - j,""); j = col = nc; } else { - diff_output("\t"); + printf("\t"); col += tabsize - 1; j += tabsize - 1; } } else { - diff_output("\t"); + printf("\t"); col++; } } @@ -1323,13 +1322,13 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) * The caller must check the value * of edoffset */ - diff_output(".\n"); + printf(".\n"); edoffset = i - a + 1; return edoffset; } /* when side-by-side, do not print a newline */ if (diff_format != D_SIDEBYSIDE || c != '\n') { - diff_output("%c", c); + printf("%c", c); col++; } } @@ -1469,15 +1468,15 @@ dump_context_vec(FILE *f1, FILE *f2, int flags) lowc = MAX(1, cvp->c - diff_context); upd = MIN(len[1], context_vec_ptr->d + diff_context); - diff_output("***************"); + printf("***************"); if ((flags & D_PROTOTYPE)) { f = match_function(ixold, lowa-1, f1); if (f != NULL) - diff_output(" %s", f); + printf(" %s", f); } - diff_output("\n*** "); + printf("\n*** "); range(lowa, upb, ","); - diff_output(" ****\n"); + printf(" ****\n"); /* * Output changes to the "old" file. The first loop suppresses @@ -1516,9 +1515,9 @@ dump_context_vec(FILE *f1, FILE *f2, int flags) fetch(ixold, b + 1, upb, f1, ' ', 0, flags); } /* output changes to the "new" file */ - diff_output("--- "); + printf("--- "); range(lowc, upd, ","); - diff_output(" ----\n"); + printf(" ----\n"); do_output = 0; for (cvp = context_vec_start; cvp <= context_vec_ptr; cvp++) @@ -1572,17 +1571,17 @@ dump_unified_vec(FILE *f1, FILE *f2, int flags) lowc = MAX(1, cvp->c - diff_context); upd = MIN(len[1], context_vec_ptr->d + diff_context); - diff_output("@@ -"); + printf("@@ -"); uni_range(lowa, upb); - diff_output(" +"); + printf(" +"); uni_range(lowc, upd); - diff_output(" @@"); + printf(" @@"); if ((flags & D_PROTOTYPE)) { f = match_function(ixold, lowa-1, f1); if (f != NULL) - diff_output(" %s", f); + printf(" %s", f); } - diff_output("\n"); + printf("\n"); /* * Output changes in "unified" diff format--the old and new lines @@ -1654,16 +1653,16 @@ print_header(const char *file1, const char *file2) sprintf(buf2, "%s.%.9d %s", buf2, nsec2, end2); } if (label[0] != NULL) - diff_output("%s %s\n", diff_format == D_CONTEXT ? "***" : "---", + printf("%s %s\n", diff_format == D_CONTEXT ? "***" : "---", label[0]); else - diff_output("%s %s\t%s\n", diff_format == D_CONTEXT ? "***" : "---", + printf("%s %s\t%s\n", diff_format == D_CONTEXT ? "***" : "---", file1, buf1); if (label[1] != NULL) - diff_output("%s %s\n", diff_format == D_CONTEXT ? "---" : "+++", + printf("%s %s\n", diff_format == D_CONTEXT ? "---" : "+++", label[1]); else - diff_output("%s %s\t%s\n", diff_format == D_CONTEXT ? "---" : "+++", + printf("%s %s\t%s\n", diff_format == D_CONTEXT ? "---" : "+++", file2, buf2); } @@ -1681,10 +1680,10 @@ print_space(int nc, int n, int flags) { /* first tabstop may be closer than tabsize */ i = tabsize - (nc % tabsize); while (col >= tabsize) { - diff_output("\t"); + printf("\t"); col -= i; i = tabsize; } } - diff_output("%*s", col, ""); + printf("%*s", col, ""); } From owner-dev-commits-src-main@freebsd.org Wed Jan 27 12:42: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 97E574F80FD; Wed, 27 Jan 2021 12:42: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 4DQjsp3z7jz4RjL; Wed, 27 Jan 2021 12:42: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 7B4F31CC6C; Wed, 27 Jan 2021 12:42: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 10RCg6TH000538; Wed, 27 Jan 2021 12:42:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RCg6wJ000537; Wed, 27 Jan 2021 12:42:06 GMT (envelope-from git) Date: Wed, 27 Jan 2021 12:42:06 GMT Message-Id: <202101271242.10RCg6wJ000537@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: bcb7f57aa227 - main - conf/kern.mk: save some work by using realpath instead of cd ; pwd 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: bcb7f57aa22757dd0206e88894bc003a93d0c351 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, 27 Jan 2021 12:42:06 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bcb7f57aa22757dd0206e88894bc003a93d0c351 commit bcb7f57aa22757dd0206e88894bc003a93d0c351 Author: Mateusz Guzik AuthorDate: 2021-01-27 12:25:21 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-27 12:41:33 +0000 conf/kern.mk: save some work by using realpath instead of cd ; pwd I did not check if the entire ordeal can be avoided in the first place. --- sys/conf/kmod.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index c245f447cefb..c0d4441af029 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -309,7 +309,7 @@ ${_ILINKS}: *) \ path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ - path=`(cd $$path && /bin/pwd)` ; \ + path=`realpath $$path`; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fns $$path ${.TARGET:T} From owner-dev-commits-src-main@freebsd.org Wed Jan 27 14:00: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 86F024F9FE4; Wed, 27 Jan 2021 14:00: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 4DQlcK3SPrz4Xwk; Wed, 27 Jan 2021 14:00: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 6959E1DC9B; Wed, 27 Jan 2021 14:00: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 10RE0XSx000685; Wed, 27 Jan 2021 14:00:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RE0XfG000684; Wed, 27 Jan 2021 14:00:33 GMT (envelope-from git) Date: Wed, 27 Jan 2021 14:00:33 GMT Message-Id: <202101271400.10RE0XfG000684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6f65b505468a - main - firmware(9): extend firmware_get() by a "no warn" flag. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f65b505468aa8cedc57235604bd8df540d42735 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, 27 Jan 2021 14:00:33 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6f65b505468aa8cedc57235604bd8df540d42735 commit 6f65b505468aa8cedc57235604bd8df540d42735 Author: Bjoern A. Zeeb AuthorDate: 2021-01-25 22:41:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-27 13:51:26 +0000 firmware(9): extend firmware_get() by a "no warn" flag. With the upcoming usage from LinuxKPI but also from drivers ported natively we are seeing more probing of various firmware (names). Add the ability to firmware(9) to silence the "firmware image loading/registering errors" by adding a new firmware_get_flags() functions extending firmware_get() and taking a flags argument as firmware_put() already does. Requested-by: zeising (for future LinuxKPI/DRM) Sponsored-by: The FreeBSD Foundation Sponsored-by: Rubicon Communications, LLC ("Netgate") MFC after: 3 days Reviewed-by: markj Differential Revision: https://reviews.freebsd.org/D27413 --- share/man/man9/firmware.9 | 40 +++++++++++++++++++++++++++++++++------- sys/kern/subr_firmware.c | 45 +++++++++++++++++++++++++++++++-------------- sys/sys/firmware.h | 5 +++++ 3 files changed, 69 insertions(+), 21 deletions(-) diff --git a/share/man/man9/firmware.9 b/share/man/man9/firmware.9 index b0d429573cf6..6d91beb3ddd1 100644 --- a/share/man/man9/firmware.9 +++ b/share/man/man9/firmware.9 @@ -23,13 +23,14 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2019 +.Dd January 27, 2021 .Dt FIRMWARE 9 .Os .Sh NAME .Nm firmware_register , .Nm firmware_unregister , .Nm firmware_get , +.Nm firmware_get_flags , .Nm firmware_put .Nd firmware image loading and management .Sh SYNOPSIS @@ -57,6 +58,8 @@ struct firmware { .Fn firmware_unregister "const char *imagename" .Ft "const struct firmware *" .Fn firmware_get "const char *imagename" +.Ft "const struct firmware *" +.Fn firmware_get_flags "const char *imagename" "uint32_t flags" .Ft void .Fn firmware_put "const struct firmware *fp" "int flags" .Sh DESCRIPTION @@ -97,7 +100,13 @@ by calling the function .Fn firmware_get with the .Nm imagename -they want as an argument. +they want as an argument, or by calling +.Fn firmware_get_flags +with the +.Nm imagename +and +.Nm flags +they want as an arguments. If a matching image is not already registered, the firmware subsystem will try to load it using the mechanisms specified below (typically, a kernel module @@ -134,11 +143,22 @@ if there are no pending references to the image, otherwise it does not unregister the image and returns EBUSY. .Pp .Fn firmware_get -returns the requested firmware image. +and +.Fn firmware_get_flags +return the requested firmware image. +The +.Fa flags +argument may be set to +.Dv FIRMWARE_GET_NOWARN +to indicate that errors on firmware load or registration should +only be logged in case of +.Nm booverbose . If the image is not yet registered with the system, -the function tries to load it. +the functions try to load it. This involves the linker subsystem and disk access, so .Fn firmware_get +or +.Fn firmware_get_flags must not be called with any locks (except for .Va Giant ) . Note also that if the firmware image is loaded from a filesystem @@ -149,9 +169,11 @@ already mounted. .Pp On success, .Fn firmware_get -returns a pointer to the image description and increases the reference count +and +.Fn firmware_get_flags +return a pointer to the image description and increase the reference count for this image. -On failure, the function returns NULL. +On failure, the functions return NULL. .Pp .Fn firmware_put drops a reference to a firmware image. @@ -183,10 +205,12 @@ these images in memory before calling .Pp When .Fn firmware_get +or +.Fn firmware_get_flags does not find the requested image, it tries to load it using one of the available loading mechanisms. At the moment, there is only one, namely -.Nm Loadable kernel modules : +.Nm Loadable kernel modules . .Pp A firmware image named .Nm foo @@ -203,6 +227,8 @@ which on most systems defaults to Note that in case a module contains multiple images, the caller should first request a .Fn firmware_get +or +.Fn firmware_get_flags for the first image contained in the module, followed by requests for the other images. .Sh BUILDING FIRMWARE LOADABLE MODULES diff --git a/sys/kern/subr_firmware.c b/sys/kern/subr_firmware.c index db262c121918..0465f2a88483 100644 --- a/sys/kern/subr_firmware.c +++ b/sys/kern/subr_firmware.c @@ -238,36 +238,42 @@ firmware_unregister(const char *imagename) return (err); } +struct fw_loadimage { + const char *imagename; + uint32_t flags; +}; + static void -loadimage(void *arg, int npending) +loadimage(void *arg, int npending __unused) { - char *imagename = arg; + struct fw_loadimage *fwli = arg; struct priv_fw *fp; linker_file_t result; int error; - error = linker_reference_module(imagename, NULL, &result); + error = linker_reference_module(fwli->imagename, NULL, &result); if (error != 0) { - printf("%s: could not load firmware image, error %d\n", - imagename, error); + if (bootverbose || (fwli->flags & FIRMWARE_GET_NOWARN) == 0) + printf("%s: could not load firmware image, error %d\n", + fwli->imagename, error); mtx_lock(&firmware_mtx); goto done; } mtx_lock(&firmware_mtx); - fp = lookup(imagename); + fp = lookup(fwli->imagename); if (fp == NULL || fp->file != NULL) { mtx_unlock(&firmware_mtx); if (fp == NULL) printf("%s: firmware image loaded, " - "but did not register\n", imagename); - (void) linker_release_module(imagename, NULL, NULL); + "but did not register\n", fwli->imagename); + (void) linker_release_module(fwli->imagename, NULL, NULL); mtx_lock(&firmware_mtx); goto done; } fp->file = result; /* record the module identity */ done: - wakeup_one(imagename); + wakeup_one(arg); mtx_unlock(&firmware_mtx); } @@ -279,7 +285,7 @@ done: * release this reference for the image to be eligible for removal/unload. */ const struct firmware * -firmware_get(const char *imagename) +firmware_get_flags(const char *imagename, uint32_t flags) { struct task fwload_task; struct thread *td; @@ -306,11 +312,15 @@ firmware_get(const char *imagename) * Also we must not hold any mtx's over this call which is problematic. */ if (!cold) { - TASK_INIT(&fwload_task, 0, loadimage, __DECONST(void *, - imagename)); + struct fw_loadimage fwli; + + fwli.imagename = imagename; + fwli.flags = flags; + TASK_INIT(&fwload_task, 0, loadimage, (void *)&fwli); taskqueue_enqueue(firmware_tq, &fwload_task); - msleep(__DECONST(void *, imagename), &firmware_mtx, 0, - "fwload", 0); + PHOLD(curproc); + msleep((void *)&fwli, &firmware_mtx, 0, "fwload", 0); + PRELE(curproc); } /* * After attempting to load the module, see if the image is registered. @@ -328,6 +338,13 @@ found: /* common exit point on success */ return &fp->fw; } +const struct firmware * +firmware_get(const char *imagename) +{ + + return (firmware_get_flags(imagename, 0)); +} + /* * Release a reference to a firmware image returned by firmware_get. * The caller may specify, with the FIRMWARE_UNLOAD flag, its desire diff --git a/sys/sys/firmware.h b/sys/sys/firmware.h index 8a9b2cf23bd7..0d74a749f4fc 100644 --- a/sys/sys/firmware.h +++ b/sys/sys/firmware.h @@ -60,7 +60,12 @@ struct firmware { const struct firmware *firmware_register(const char *, const void *, size_t, unsigned int, const struct firmware *); int firmware_unregister(const char *); + +#define FIRMWARE_GET_NOWARN 0x0001 /* Do not warn if firmware not found. */ +const struct firmware *firmware_get_flags(const char *, uint32_t flags); const struct firmware *firmware_get(const char *); + #define FIRMWARE_UNLOAD 0x0001 /* unload if unreferenced */ void firmware_put(const struct firmware *, int); + #endif /* _SYS_FIRMWARE_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Jan 27 14:30: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 490B04FACA9; Wed, 27 Jan 2021 14:30: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 4DQmHQ1gtXz4Zrk; Wed, 27 Jan 2021 14:30: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 223D01E274; Wed, 27 Jan 2021 14:30: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 10REUw8q043782; Wed, 27 Jan 2021 14:30:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10REUwQO043781; Wed, 27 Jan 2021 14:30:58 GMT (envelope-from git) Date: Wed, 27 Jan 2021 14:30:58 GMT Message-Id: <202101271430.10REUwQO043781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: c262e8e87e7b - main - e1000: fix build after c1655b0f MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c262e8e87e7b59b768c717c1779ef1ba28507f44 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, 27 Jan 2021 14:30:58 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=c262e8e87e7b59b768c717c1779ef1ba28507f44 commit c262e8e87e7b59b768c717c1779ef1ba28507f44 Author: Marius Strobl AuthorDate: 2021-01-27 14:28:25 +0000 Commit: Marius Strobl CommitDate: 2021-01-27 14:30:35 +0000 e1000: fix build after c1655b0f --- sys/dev/e1000/if_em.c | 88 +++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index c8a6b209a161..fb15a3e1f610 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -828,7 +828,7 @@ em_if_attach_pre(if_ctx_t ctx) device_printf(dev, "attach_pre capping queues at %d\n", scctx->isc_ntxqsets_max); - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(union e1000_adv_tx_desc); @@ -840,7 +840,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities = scctx->isc_capenable = IGB_CAPS; scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP; - if (hw.mac.type != e1000_82575) + if (hw->mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; /* ** Some new devices, as with ixgbe, now may @@ -848,7 +848,7 @@ em_if_attach_pre(if_ctx_t ctx) ** track of which is used. */ scctx->isc_msix_bar = pci_msix_table_bar(dev); - } else if (hw.mac.type >= em_mac_min) { + } else if (hw->mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); @@ -880,7 +880,7 @@ em_if_attach_pre(if_ctx_t ctx) * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. */ - if (hw.mac.type == e1000_82574) { + if (hw->mac.type == e1000_82574) { scctx->isc_msix_bar = pci_msix_table_bar(dev);; } else { scctx->isc_msix_bar = -1; @@ -894,7 +894,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; - if (hw.mac.type < e1000_82543) + if (hw->mac.type < e1000_82543) scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* INTx only */ scctx->isc_msix_bar = 0; @@ -987,7 +987,7 @@ em_if_attach_pre(if_ctx_t ctx) hw->phy.autoneg_wait_to_complete = FALSE; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; - if (hw.mac.type < em_mac_min) { + if (hw->mac.type < em_mac_min) { e1000_init_script_state_82541(hw, TRUE); e1000_set_tbi_compatibility_82543(hw, TRUE); } @@ -1002,7 +1002,7 @@ em_if_attach_pre(if_ctx_t ctx) * Set the frame limits assuming * standard ethernet sized frames. */ - scctx->isc_max_frame_size = hw.mac.max_frame_size = + scctx->isc_max_frame_size = hw->mac.max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE; /* @@ -1793,7 +1793,7 @@ em_if_update_admin_status(if_ctx_t ctx) break; case e1000_media_type_internal_serdes: e1000_check_for_link(hw); - link_check = hw.mac.serdes_has_link; + link_check = hw->mac.serdes_has_link; break; /* VF device is type_unknown */ case e1000_media_type_unknown: @@ -1841,7 +1841,7 @@ em_if_update_admin_status(if_ctx_t ctx) msec_delay(I210_LINK_DELAY); /* Reset if the media type changed. */ if (hw->dev_spec._82575.media_changed && - hw.mac.type >= igb_mac_min) { + hw->mac.type >= igb_mac_min) { hw->dev_spec._82575.media_changed = false; adapter->flags |= IGB_MEDIA_RESET; em_reset(ctx); @@ -2088,13 +2088,13 @@ igb_configure_queues(struct adapter *adapter) u32 tmp, ivar = 0, newitr = 0; /* First turn on RSS capability */ - if (hw.mac.type != e1000_82575) + if (hw->mac.type != e1000_82575) E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE | E1000_GPIE_EIAME | E1000_GPIE_PBA | E1000_GPIE_NSICR); /* Turn on MSI-X */ - switch (hw.mac.type) { + switch (hw->mac.type) { case e1000_82580: case e1000_i350: case e1000_i354: @@ -2493,7 +2493,7 @@ em_reset(if_ctx_t ctx) case e1000_ich9lan: case e1000_ich10lan: /* Boost Receive side for jumbo frames */ - if (hw.mac.max_frame_size > 4096) + if (hw->mac.max_frame_size > 4096) pba = E1000_PBA_14K; else pba = E1000_PBA_10K; @@ -2525,7 +2525,7 @@ em_reset(if_ctx_t ctx) pba = E1000_PBA_34K; break; default: - if (hw.mac.max_frame_size > 8192) + if (hw->mac.max_frame_size > 8192) pba = E1000_PBA_40K; /* 40K for Rx, 24K for Tx */ else pba = E1000_PBA_48K; /* 48K for Rx, 16K for Tx */ @@ -2537,11 +2537,11 @@ em_reset(if_ctx_t ctx) pba = E1000_READ_REG(hw, E1000_PBA); tx_space = pba >> 16; pba &= 0xffff; - min_tx = (hw.mac.max_frame_size + + min_tx = (hw->mac.max_frame_size + sizeof(struct e1000_tx_desc) - ETHERNET_FCS_SIZE) * 2; min_tx = roundup2(min_tx, 1024); min_tx >>= 10; - min_rx = hw.mac.max_frame_size; + min_rx = hw->mac.max_frame_size; min_rx = roundup2(min_rx, 1024); min_rx >>= 10; if (tx_space < min_tx && @@ -2578,7 +2578,7 @@ em_reset(if_ctx_t ctx) */ rx_buffer_size = (pba & 0xffff) << 10; hw->fc.high_water = rx_buffer_size - - roundup2(hw.mac.max_frame_size, 1024); + roundup2(hw->mac.max_frame_size, 1024); hw->fc.low_water = hw->fc.high_water - 1500; if (adapter->fc) /* locally set flow control value? */ @@ -2653,7 +2653,7 @@ em_reset(if_ctx_t ctx) /* Issue a global reset */ e1000_reset_hw(hw); - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { E1000_WRITE_REG(hw, E1000_WUC, 0); } else { E1000_WRITE_REG(hw, E1000_WUFC, 0); @@ -2669,7 +2669,7 @@ em_reset(if_ctx_t ctx) device_printf(dev, "Hardware Initialization Failed\n"); return; } - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) igb_init_dmac(adapter, pba); E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); @@ -2734,7 +2734,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) u32 rss_key[10], mrqc, shift = 0; /* XXX? */ - if (hw.mac.type == e1000_82575) + if (hw->mac.type == e1000_82575) shift = 6; /* @@ -2843,11 +2843,11 @@ em_setup_interface(if_ctx_t ctx) * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - if (hw.phy.media_type == e1000_media_type_fiber || - hw.phy.media_type == e1000_media_type_internal_serdes) { + if (adapter->hw.phy.media_type == e1000_media_type_fiber || + adapter->hw.phy.media_type == e1000_media_type_internal_serdes) { u_char fiber_type = IFM_1000_SX; /* default type */ - if (hw.mac.type == e1000_82545) + if (adapter->hw.mac.type == e1000_82545) fiber_type = IFM_1000_LX; ifmedia_add(adapter->media, IFM_ETHER | fiber_type | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | fiber_type, 0, NULL); @@ -2856,7 +2856,7 @@ em_setup_interface(if_ctx_t ctx) ifmedia_add(adapter->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); - if (hw.phy.type != e1000_phy_ife) { + if (adapter->hw.phy.type != e1000_phy_ife) { ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); } @@ -3046,7 +3046,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) } /* Set the default values for the Tx Inter Packet Gap timer */ - switch (hw.mac.type) { + switch (hw->mac.type) { case e1000_80003es2lan: tipg = DEFAULT_82543_TIPG_IPGR1; tipg |= DEFAULT_80003ES2LAN_TIPG_IPGR2 << @@ -3058,8 +3058,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; break; default: - if (hw.phy.media_type == e1000_media_type_fiber || - hw.phy.media_type == e1000_media_type_internal_serdes) + if (hw->phy.media_type == e1000_media_type_fiber || + hw->phy.media_type == e1000_media_type_internal_serdes) tipg = DEFAULT_82543_TIPG_IPGT_FIBER; else tipg = DEFAULT_82543_TIPG_IPGT_COPPER; @@ -3070,15 +3070,15 @@ em_initialize_transmit_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_TIPG, tipg); E1000_WRITE_REG(hw, E1000_TIDV, adapter->tx_int_delay.value); - if(hw.mac.type >= e1000_82540) + if(hw->mac.type >= e1000_82540) E1000_WRITE_REG(hw, E1000_TADV, adapter->tx_abs_int_delay.value); - if (hw.mac.type == e1000_82571 || hw.mac.type == e1000_82572) { + if (hw->mac.type == e1000_82571 || hw->mac.type == e1000_82572) { tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_SPEED_MODE_BIT; E1000_WRITE_REG(hw, E1000_TARC(0), tarc); - } else if (hw.mac.type == e1000_80003es2lan) { + } else if (hw->mac.type == e1000_80003es2lan) { /* errata: program both queues to unweighted RR */ tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= 1; @@ -3086,7 +3086,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) tarc = E1000_READ_REG(hw, E1000_TARC(1)); tarc |= 1; E1000_WRITE_REG(hw, E1000_TARC(1), tarc); - } else if (hw.mac.type == e1000_82574) { + } else if (hw->mac.type == e1000_82574) { tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_ERRATA_BIT; if ( adapter->tx_num_queues > 1) { @@ -3106,7 +3106,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); - if (hw.mac.type >= e1000_82571) + if (hw->mac.type >= e1000_82571) tctl |= E1000_TCTL_MULR; /* This write will effectively turn on the transmit unit. */ @@ -3173,7 +3173,7 @@ em_initialize_receive_unit(if_ctx_t ctx) if (!em_disable_crc_stripping) rctl |= E1000_RCTL_SECRC; - if (hw.mac.type >= e1000_82540) { + if (hw->mac.type >= e1000_82540) { E1000_WRITE_REG(hw, E1000_RADV, adapter->rx_abs_int_delay.value); @@ -3203,9 +3203,9 @@ em_initialize_receive_unit(if_ctx_t ctx) rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && - hw.mac.type >= e1000_82543) { + hw->mac.type >= e1000_82543) { if (adapter->tx_num_queues > 1) { - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { rxcsum |= E1000_RXCSUM_PCSD; if (hw->mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; @@ -3214,11 +3214,11 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_RXCSUM_IPOFL | E1000_RXCSUM_PCSD; } else { - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) rxcsum |= E1000_RXCSUM_IPPCSE; else rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; - if (hw.mac.type > e1000_82575) + if (hw->mac.type > e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; } } else @@ -3227,7 +3227,7 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); if (adapter->rx_num_queues > 1) { - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) igb_initialize_rss_mapping(adapter); else em_initialize_rss_mapping(adapter); @@ -3267,11 +3267,11 @@ em_initialize_receive_unit(if_ctx_t ctx) * Only write to RXDCTL(1) if there is a need for different * settings. */ - if ((hw.mac.type == e1000_ich9lan || hw.mac.type == e1000_pch2lan || - hw.mac.type == e1000_ich10lan) && (if_getmtu(ifp) > ETHERMTU)) { + if ((hw->mac.type == e1000_ich9lan || hw->mac.type == e1000_pch2lan || + hw->mac.type == e1000_ich10lan) && if_getmtu(ifp) > ETHERMTU) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); - } else if (hw.mac.type == e1000_82574) { + } else if (hw->mac.type == e1000_82574) { for (int i = 0; i < adapter->rx_num_queues; i++) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); rxdctl |= 0x20; /* PTHRESH */ @@ -3280,7 +3280,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= 1 << 24; /* Switch to granularity */ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (hw.mac.type >= igb_mac_min) { + } else if (hw->mac.type >= igb_mac_min) { u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { @@ -3342,7 +3342,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= IGB_RX_WTHRESH << 16; E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (hw.mac.type >= e1000_pch2lan) { + } else if (hw->mac.type >= e1000_pch2lan) { if (if_getmtu(ifp) > ETHERMTU) e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); else @@ -3352,7 +3352,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; - if (hw.mac.type < igb_mac_min) { + if (hw->mac.type < igb_mac_min) { if (adapter->rx_mbuf_sz == MCLBYTES) rctl |= E1000_RCTL_SZ_2048; else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) @@ -3815,7 +3815,7 @@ em_enable_phy_wakeup(struct adapter *adapter) e1000_copy_rx_addrs_to_phy_ich8lan(hw); /* copy MAC MTA to PHY MTA */ - for (int i = 0; i < hw.mac.mta_reg_count; i++) { + for (int i = 0; i < hw->mac.mta_reg_count; i++) { mreg = E1000_READ_REG_ARRAY(hw, E1000_MTA, i); e1000_write_phy_reg(hw, BM_MTA(i), (u16)(mreg & 0xFFFF)); e1000_write_phy_reg(hw, BM_MTA(i) + 1, From owner-dev-commits-src-main@freebsd.org Wed Jan 27 15:13: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 942224FBC9A; Wed, 27 Jan 2021 15:13: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 4DQnDk3pDGz4dHH; Wed, 27 Jan 2021 15:13: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 758361EE5F; Wed, 27 Jan 2021 15:13: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 10RFDgqT096344; Wed, 27 Jan 2021 15:13:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RFDgOq096343; Wed, 27 Jan 2021 15:13:42 GMT (envelope-from git) Date: Wed, 27 Jan 2021 15:13:42 GMT Message-Id: <202101271513.10RFDgOq096343@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: 5fc384d1810a - main - cache: fallback when encountering a mount point during .. lookup 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: 5fc384d1810a3a0a0acefc67abe1daf6d6cd09e4 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, 27 Jan 2021 15:13:42 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5fc384d1810a3a0a0acefc67abe1daf6d6cd09e4 commit 5fc384d1810a3a0a0acefc67abe1daf6d6cd09e4 Author: Mateusz Guzik AuthorDate: 2021-01-27 12:52:23 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-27 15:00:31 +0000 cache: fallback when encountering a mount point during .. lookup The current abort is overzealous. --- sys/kern/vfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index b759affcc0ac..be06a2edc58b 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4697,7 +4697,7 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) * TODO * The opposite of climb mount is needed here. */ - return (cache_fpl_aborted(fpl)); + return (cache_fpl_partial(fpl)); } ncp = atomic_load_consume_ptr(&dvp->v_cache_dd); From owner-dev-commits-src-main@freebsd.org Wed Jan 27 15:13: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 BA2904FB85E; Wed, 27 Jan 2021 15:13: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 4DQnDl4nXzz4dCG; Wed, 27 Jan 2021 15:13: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 9718C1ECCD; Wed, 27 Jan 2021 15:13: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 10RFDhl1096365; Wed, 27 Jan 2021 15:13:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RFDhlp096364; Wed, 27 Jan 2021 15:13:43 GMT (envelope-from git) Date: Wed, 27 Jan 2021 15:13:43 GMT Message-Id: <202101271513.10RFDhlp096364@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: 5c325977b113 - main - cache: add missing MNT_NOSYMFOLLOW check to symlink traversal 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: 5c325977b1138828367f39a3f2034af24c3654f0 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, 27 Jan 2021 15:13:43 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5c325977b1138828367f39a3f2034af24c3654f0 commit 5c325977b1138828367f39a3f2034af24c3654f0 Author: Mateusz Guzik AuthorDate: 2021-01-27 14:59:53 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-27 15:08:38 +0000 cache: add missing MNT_NOSYMFOLLOW check to symlink traversal --- sys/kern/vfs_cache.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index be06a2edc58b..ff8aad14001b 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4816,6 +4816,7 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) static int __noinline cache_fplookup_symlink(struct cache_fpl *fpl) { + struct mount *mp; struct nameidata *ndp; struct componentname *cnp; struct vnode *dvp, *tvp; @@ -4832,6 +4833,20 @@ cache_fplookup_symlink(struct cache_fpl *fpl) } } + mp = atomic_load_ptr(&dvp->v_mount); + if (__predict_false(mp == NULL)) { + return (cache_fpl_aborted(fpl)); + } + + /* + * Note this check races against setting the flag just like regular + * lookup. + */ + if (__predict_false((mp->mnt_flag & MNT_NOSYMFOLLOW) != 0)) { + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled_error(fpl, EACCES)); + } + error = VOP_FPLOOKUP_SYMLINK(tvp, fpl); if (__predict_false(error != 0)) { switch (error) { From owner-dev-commits-src-main@freebsd.org Wed Jan 27 16:42: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 521644FD8EE; Wed, 27 Jan 2021 16:42: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 4DQqCC1wzbz4kmY; Wed, 27 Jan 2021 16:42: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 34ECE20039; Wed, 27 Jan 2021 16:42: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 10RGgVQf013765; Wed, 27 Jan 2021 16:42:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RGgVnV013764; Wed, 27 Jan 2021 16:42:31 GMT (envelope-from git) Date: Wed, 27 Jan 2021 16:42:31 GMT Message-Id: <202101271642.10RGgVnV013764@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: 7a808c5ee329 - main - pf: Improve pf_rule input validation 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: 7a808c5ee3296fdb72d8e8bc6c7ad6f316a520ab 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, 27 Jan 2021 16:42:31 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a808c5ee3296fdb72d8e8bc6c7ad6f316a520ab commit 7a808c5ee3296fdb72d8e8bc6c7ad6f316a520ab Author: Kristof Provost AuthorDate: 2021-01-26 07:56:51 +0000 Commit: Kristof Provost CommitDate: 2021-01-27 15:42:14 +0000 pf: Improve pf_rule input validation Move the validation checks to pf_rule_to_krule() to reduce duplication. This also makes the checks consistent across different ioctls. Reported-by: syzbot+e9632d7ad17398f0bd8f@syzkaller.appspotmail.com Reviewed by: tuexen@, donner@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28362 --- sys/netpfil/pf/pf_ioctl.c | 72 +++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 60c38a980d1e..644a091808cd 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1557,10 +1557,39 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) rule->u_src_nodes = counter_u64_fetch(krule->src_nodes); } -static void +static int pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) { +#ifndef INET + if (rule->af == AF_INET) { + return (EAFNOSUPPORT); + } +#endif /* INET */ +#ifndef INET6 + if (rule->af == AF_INET6) { + return (EAFNOSUPPORT); + } +#endif /* INET6 */ + + if (rule->src.addr.type != PF_ADDR_ADDRMASK && + rule->src.addr.type != PF_ADDR_DYNIFTL && + rule->src.addr.type != PF_ADDR_TABLE) { + return (EINVAL); + } + if (rule->src.addr.p.dyn != NULL) { + return (EINVAL); + } + + if (rule->dst.addr.type != PF_ADDR_ADDRMASK && + rule->dst.addr.type != PF_ADDR_DYNIFTL && + rule->dst.addr.type != PF_ADDR_TABLE) { + return (EINVAL); + } + if (rule->dst.addr.p.dyn != NULL) { + return (EINVAL); + } + bzero(krule, sizeof(*krule)); bcopy(&rule->src, &krule->src, sizeof(rule->src)); @@ -1641,6 +1670,8 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) krule->set_prio[1] = rule->set_prio[1]; bcopy(&rule->divert, &krule->divert, sizeof(krule->divert)); + + return (0); } static int @@ -1815,26 +1846,13 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td error = EINVAL; break; } - if (pr->rule.src.addr.p.dyn != NULL || - pr->rule.dst.addr.p.dyn != NULL) { - error = EINVAL; - break; - } -#ifndef INET - if (pr->rule.af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pr->rule.af == AF_INET6) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET6 */ rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK); - pf_rule_to_krule(&pr->rule, rule); + error = pf_rule_to_krule(&pr->rule, rule); + if (error != 0) { + free(rule, M_PFRULE); + break; + } if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); @@ -2090,20 +2108,12 @@ DIOCADDRULE_error: } if (pcr->action != PF_CHANGE_REMOVE) { -#ifndef INET - if (pcr->rule.af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pcr->rule.af == AF_INET6) { - error = EAFNOSUPPORT; + newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); + error = pf_rule_to_krule(&pcr->rule, newrule); + if (error != 0) { + free(newrule, M_PFRULE); break; } -#endif /* INET6 */ - newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); - pf_rule_to_krule(&pcr->rule, newrule); if (newrule->ifname[0]) kif = pf_kkif_create(M_WAITOK); From owner-dev-commits-src-main@freebsd.org Wed Jan 27 16:42: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 A089F4FD7DD; Wed, 27 Jan 2021 16:42: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 4DQqCD3TYQz4kpj; Wed, 27 Jan 2021 16:42: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 5F09D201D9; Wed, 27 Jan 2021 16:42: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 10RGgWap013787; Wed, 27 Jan 2021 16:42:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RGgWjm013786; Wed, 27 Jan 2021 16:42:32 GMT (envelope-from git) Date: Wed, 27 Jan 2021 16:42:32 GMT Message-Id: <202101271642.10RGgWjm013786@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: 35dabb7b9cff - main - altq: Fix typo in features sysctl description 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: 35dabb7b9cff601045b623aeca59ccc68930d520 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, 27 Jan 2021 16:42:32 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=35dabb7b9cff601045b623aeca59ccc68930d520 commit 35dabb7b9cff601045b623aeca59ccc68930d520 Author: Kristof Provost AuthorDate: 2021-01-26 15:02:45 +0000 Commit: Kristof Provost CommitDate: 2021-01-27 15:42:14 +0000 altq: Fix typo in features sysctl description Reported by: Jose Luis Duran --- sys/net/altq/altq_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index dff589607ac8..14d9916011da 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -124,7 +124,7 @@ SYSCTL_NODE(_kern_features, OID_AUTO, altq, CTLFLAG_RD | CTLFLAG_CAPRD, 0, desc, "feature") #ifdef ALTQ_CBQ -ALTQ_FEATURE(cbq, "ATLQ Class Based Queuing discipline"); +ALTQ_FEATURE(cbq, "ALTQ Class Based Queuing discipline"); #endif #ifdef ALTQ_CODEL ALTQ_FEATURE(codel, "ALTQ Controlled Delay discipline"); From owner-dev-commits-src-main@freebsd.org Wed Jan 27 17:20: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 11EDF4FF66C; Wed, 27 Jan 2021 17:20: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 4DQr3M5MZ9z4n2G; Wed, 27 Jan 2021 17:20: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 7FE262055C; Wed, 27 Jan 2021 17:20: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 10RHKl3n061593; Wed, 27 Jan 2021 17:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RHKlni061592; Wed, 27 Jan 2021 17:20:47 GMT (envelope-from git) Date: Wed, 27 Jan 2021 17:20:47 GMT Message-Id: <202101271720.10RHKlni061592@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: 8dba3dd846cf - main - cnv(9): Use a proper manual page section 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: 8dba3dd846cf60c9014f81b099058a9023477096 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, 27 Jan 2021 17:20:48 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8dba3dd846cf60c9014f81b099058a9023477096 commit 8dba3dd846cf60c9014f81b099058a9023477096 Author: Gordon Bergling AuthorDate: 2021-01-27 17:18:17 +0000 Commit: Gordon Bergling CommitDate: 2021-01-27 17:18:17 +0000 cnv(9): Use a proper manual page section --- share/man/man9/cnv.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/cnv.9 b/share/man/man9/cnv.9 index 737a1b2fb518..eaae3f7156ab 100644 --- a/share/man/man9/cnv.9 +++ b/share/man/man9/cnv.9 @@ -166,7 +166,7 @@ resources. If an element of the given cookie has the wrong type or does not exist, the program is aborted. -.Sh EXAMPLE +.Sh EXAMPLES The following example demonstrates how to deal with cnvlist API. .Bd -literal int type; From owner-dev-commits-src-main@freebsd.org Wed Jan 27 17:20: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 E64854FF6F9; Wed, 27 Jan 2021 17:20: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 4DQr3Q3vLxz4mrV; Wed, 27 Jan 2021 17:20: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 A14D3206AD; Wed, 27 Jan 2021 17:20: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 10RHKmQF061615; Wed, 27 Jan 2021 17:20:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RHKmvl061614; Wed, 27 Jan 2021 17:20:48 GMT (envelope-from git) Date: Wed, 27 Jan 2021 17:20:48 GMT Message-Id: <202101271720.10RHKmvl061614@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: 8a2f9dff2b93 - main - VOP_BMAP(9): Remove obsolete comma 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: 8a2f9dff2b9393503f63902c6ba7802efd8d6e49 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, 27 Jan 2021 17:20:52 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8a2f9dff2b9393503f63902c6ba7802efd8d6e49 commit 8a2f9dff2b9393503f63902c6ba7802efd8d6e49 Author: Gordon Bergling AuthorDate: 2021-01-27 17:20:04 +0000 Commit: Gordon Bergling CommitDate: 2021-01-27 17:20:04 +0000 VOP_BMAP(9): Remove obsolete comma --- share/man/man9/VOP_BMAP.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/VOP_BMAP.9 b/share/man/man9/VOP_BMAP.9 index 7ddb2b52c7ca..02869838274b 100644 --- a/share/man/man9/VOP_BMAP.9 +++ b/share/man/man9/VOP_BMAP.9 @@ -75,7 +75,7 @@ The vnode will be locked on entry and should remain locked on return. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh SEE ALSO -.Xr vnode 9 , +.Xr vnode 9 .Sh HISTORY A .Fn bmap From owner-dev-commits-src-main@freebsd.org Wed Jan 27 17:49: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 E9C46521BC6; Wed, 27 Jan 2021 17:49: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 4DQrhT6Gsmz4pYR; Wed, 27 Jan 2021 17:49: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 CA1C220CFC; Wed, 27 Jan 2021 17:49: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 10RHnTLu093344; Wed, 27 Jan 2021 17:49:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RHnT9B093343; Wed, 27 Jan 2021 17:49:29 GMT (envelope-from git) Date: Wed, 27 Jan 2021 17:49:29 GMT Message-Id: <202101271749.10RHnT9B093343@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: 4f009328a247 - main - kerberos5: Silence compiler warnings 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: 4f009328a2477f5f1c682629fc5708498b7c689f 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, 27 Jan 2021 17:49:30 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=4f009328a2477f5f1c682629fc5708498b7c689f commit 4f009328a2477f5f1c682629fc5708498b7c689f Author: Alex Richardson AuthorDate: 2021-01-27 10:41:57 +0000 Commit: Alex Richardson CommitDate: 2021-01-27 17:48:47 +0000 kerberos5: Silence compiler warnings Building the kerberos5 subdirectory currently produces lots of warnings. Since there are many instances of these warnings and it's contrib code, this change silences the warnings instead of fixing them. Reviewed By: jhb, cy, bjk Differential Revision: https://reviews.freebsd.org/D28025 --- kerberos5/Makefile.inc | 3 +-- kerberos5/libexec/kcm/Makefile | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kerberos5/Makefile.inc b/kerberos5/Makefile.inc index 5ca8f73faf9b..0d52313977ce 100644 --- a/kerberos5/Makefile.inc +++ b/kerberos5/Makefile.inc @@ -9,8 +9,7 @@ KRB5DIR= ${SRCTOP}/crypto/heimdal CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR:H:H}/include WARNS?= 1 -CWARNFLAGS.clang+= -Wno-error=absolute-value -CWARNFLAGS+= -Wno-error=deprecated-declarations +CWARNFLAGS.clang+= -Wno-absolute-value .if ${MK_OPENLDAP} != "no" && !defined(COMPAT_32BIT) OPENLDAPBASE?= /usr/local diff --git a/kerberos5/libexec/kcm/Makefile b/kerberos5/libexec/kcm/Makefile index fa7a0cfce9cf..35165ef9e424 100644 --- a/kerberos5/libexec/kcm/Makefile +++ b/kerberos5/libexec/kcm/Makefile @@ -19,6 +19,8 @@ SRCS= acl.c \ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ -I${KRB5DIR}/kcm -I${KRB5DIR}/lib/ipc ${LDAPCFLAGS} +# Avoid errors for using deprecated krb5_* APIs +CFLAGS+="-DKRB5_DEPRECATED_FUNCTION(X)=" LIBADD= krb5 roken heimntlm heimipcs crypto DPADD= ${LDAPDPADD} LDADD= ${LIBVERS} ${LDAPLDADD} From owner-dev-commits-src-main@freebsd.org Wed Jan 27 18:54:24 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 0BE314E6104; Wed, 27 Jan 2021 18:54:24 +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 4DQt7M6ybyz4vst; Wed, 27 Jan 2021 18:54: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 E1B7B21C93; Wed, 27 Jan 2021 18:54: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 10RIsNPm083641; Wed, 27 Jan 2021 18:54:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RIsN1E083640; Wed, 27 Jan 2021 18:54:23 GMT (envelope-from git) Date: Wed, 27 Jan 2021 18:54:23 GMT Message-Id: <202101271854.10RIsN1E083640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 24a8f6d36996 - main - When we are about to send down to the driver layer we need to make sure that the m_nextpkt field is NULL else the lower layers may do unwanted things. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24a8f6d369962f189ad808f538029179b1e7dc2f 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, 27 Jan 2021 18:54:24 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=24a8f6d369962f189ad808f538029179b1e7dc2f commit 24a8f6d369962f189ad808f538029179b1e7dc2f Author: Randall Stewart AuthorDate: 2021-01-27 18:32:52 +0000 Commit: Randall Stewart CommitDate: 2021-01-27 18:52:44 +0000 When we are about to send down to the driver layer we need to make sure that the m_nextpkt field is NULL else the lower layers may do unwanted things. Reviewed By: gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D28377 --- sys/netinet6/nd6.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 386eb7cca922..497c0bfc10e8 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -2460,6 +2460,7 @@ nd6_flush_holdchain(struct ifnet *ifp, struct mbuf *chain, while (m_head) { m = m_head; m_head = m_head->m_nextpkt; + m->m_nextpkt = NULL; error = nd6_output_ifp(ifp, ifp, m, dst, NULL); } From owner-dev-commits-src-main@freebsd.org Wed Jan 27 19:02: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 C69114E5FCC; Wed, 27 Jan 2021 19:02: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 4DQtKH5DcWz3Cql; Wed, 27 Jan 2021 19:02: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 A6CEC21EAA; Wed, 27 Jan 2021 19:02: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 10RJ2xCk096290; Wed, 27 Jan 2021 19:02:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RJ2xlE096289; Wed, 27 Jan 2021 19:02:59 GMT (envelope-from git) Date: Wed, 27 Jan 2021 19:02:59 GMT Message-Id: <202101271902.10RJ2xlE096289@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: 7012461c9bf6 - main - stand: ensure that the efi directory's dependencies are correct 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: 7012461c9bf6375cd0b14de16b3b4a753c5c1c7a 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, 27 Jan 2021 19:02:59 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7012461c9bf6375cd0b14de16b3b4a753c5c1c7a commit 7012461c9bf6375cd0b14de16b3b4a753c5c1c7a Author: Kyle Evans AuthorDate: 2021-01-27 18:54:07 +0000 Commit: Kyle Evans CommitDate: 2021-01-27 19:02:51 +0000 stand: ensure that the efi directory's dependencies are correct efi, like the various ${MACHINE} directories, should have a dependency on the enabled interpreters. The general rule here is that any top-level directory that has a program at any depth within that includes loader.mk should add ${INTERP_DEPENDS} added to its dependencies so that the appropriate ficl/lua bits are ready before they begin. Note that the only directories in-tree that require it but will not get it in a more appropriate manner are i386 (on amd64), efi, and userboot. i386 and userboot are handled explicitly in Makefile.amd64 where they are added to S.yes. Reported-by: bcran MFC-after: 3 days --- stand/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/stand/Makefile b/stand/Makefile index f11a77c9a499..c5918a6539eb 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -76,6 +76,7 @@ SUBDIR_DEPEND_${_x}32+= libsa32 SUBDIR_DEPEND_forth+= ficl SUBDIR_DEPEND_lua+= liblua +SUBDIR_DEPEND_efi+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_efi+= fdt .endif From owner-dev-commits-src-main@freebsd.org Wed Jan 27 19:09: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 C9D794E6549; Wed, 27 Jan 2021 19:09: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 4DQtTF5LL3z3DJg; Wed, 27 Jan 2021 19:09: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 9F8C621DF2; Wed, 27 Jan 2021 19:09: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 10RJ9rNE097420; Wed, 27 Jan 2021 19:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RJ9rVj097419; Wed, 27 Jan 2021 19:09:53 GMT (envelope-from git) Date: Wed, 27 Jan 2021 19:09:53 GMT Message-Id: <202101271909.10RJ9rVj097419@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: dd6c1c2a6c0d - main - Remove redundantcy from the arm GIC softc 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: dd6c1c2a6c0d3ac239b55105b6726a594ba79c60 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, 27 Jan 2021 19:09:53 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=dd6c1c2a6c0d3ac239b55105b6726a594ba79c60 commit dd6c1c2a6c0d3ac239b55105b6726a594ba79c60 Author: Andrew Turner AuthorDate: 2021-01-25 20:03:47 +0000 Commit: Andrew Turner CommitDate: 2021-01-27 19:03:39 +0000 Remove redundantcy from the arm GIC softc A struct recource already contains the bus_space_tag_t and bus_space_handle_t. There is no neec to read them and store them again in the drivers softc. Remove them and use the struct resource directly with bus_read_* and bus_write_*. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D28339 --- sys/arm/arm/gic.c | 20 +++++++------------- sys/arm/arm/gic.h | 6 ++---- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c index 8fcf511fda08..1851e69644ed 100644 --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -143,16 +143,18 @@ static u_int arm_gic_map[MAXCPU]; static struct arm_gic_softc *gic_sc = NULL; +/* CPU Interface */ #define gic_c_read_4(_sc, _reg) \ - bus_space_read_4((_sc)->gic_c_bst, (_sc)->gic_c_bsh, (_reg)) + bus_read_4((_sc)->gic_res[GIC_RES_CPU], (_reg)) #define gic_c_write_4(_sc, _reg, _val) \ - bus_space_write_4((_sc)->gic_c_bst, (_sc)->gic_c_bsh, (_reg), (_val)) + bus_write_4((_sc)->gic_res[GIC_RES_CPU], (_reg), (_val)) +/* Distributor Interface */ #define gic_d_read_4(_sc, _reg) \ - bus_space_read_4((_sc)->gic_d_bst, (_sc)->gic_d_bsh, (_reg)) + bus_read_4((_sc)->gic_res[GIC_RES_DIST], (_reg)) #define gic_d_write_1(_sc, _reg, _val) \ - bus_space_write_1((_sc)->gic_d_bst, (_sc)->gic_d_bsh, (_reg), (_val)) + bus_write_1((_sc)->gic_res[GIC_RES_DIST], (_reg), (_val)) #define gic_d_write_4(_sc, _reg, _val) \ - bus_space_write_4((_sc)->gic_d_bst, (_sc)->gic_d_bsh, (_reg), (_val)) + bus_write_4((_sc)->gic_res[GIC_RES_DIST], (_reg), (_val)) static inline void gic_irq_unmask(struct arm_gic_softc *sc, u_int irq) @@ -321,14 +323,6 @@ arm_gic_attach(device_t dev) /* Initialize mutex */ mtx_init(&sc->mutex, "GIC lock", NULL, MTX_SPIN); - /* Distributor Interface */ - sc->gic_d_bst = rman_get_bustag(sc->gic_res[0]); - sc->gic_d_bsh = rman_get_bushandle(sc->gic_res[0]); - - /* CPU Interface */ - sc->gic_c_bst = rman_get_bustag(sc->gic_res[1]); - sc->gic_c_bsh = rman_get_bushandle(sc->gic_res[1]); - /* Disable interrupt forwarding to the CPU interface */ gic_d_write_4(sc, GICD_CTLR, 0x00); diff --git a/sys/arm/arm/gic.h b/sys/arm/arm/gic.h index 3df226c2819a..74cfbbee9d5a 100644 --- a/sys/arm/arm/gic.h +++ b/sys/arm/arm/gic.h @@ -49,11 +49,9 @@ struct arm_gic_softc { device_t gic_dev; void * gic_intrhand; struct gic_irqsrc * gic_irqs; +#define GIC_RES_DIST 0 +#define GIC_RES_CPU 1 struct resource * gic_res[3]; - bus_space_tag_t gic_c_bst; - bus_space_tag_t gic_d_bst; - bus_space_handle_t gic_c_bsh; - bus_space_handle_t gic_d_bsh; uint8_t ver; struct mtx mutex; uint32_t nirqs; From owner-dev-commits-src-main@freebsd.org Wed Jan 27 19:19: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 14CF54E6D09; Wed, 27 Jan 2021 19:19: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 4DQthP07ztz3Dlx; Wed, 27 Jan 2021 19:19: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 EBE1F21ED9; Wed, 27 Jan 2021 19:19: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 10RJJWQL011063; Wed, 27 Jan 2021 19:19:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RJJWnv011062; Wed, 27 Jan 2021 19:19:32 GMT (envelope-from git) Date: Wed, 27 Jan 2021 19:19:32 GMT Message-Id: <202101271919.10RJJWnv011062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 48397f6c7d2d - main - libllvmminimal: Add missing Support/ABIBreak.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48397f6c7d2d693602105d8ec24c5741202e264d 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, 27 Jan 2021 19:19:33 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=48397f6c7d2d693602105d8ec24c5741202e264d commit 48397f6c7d2d693602105d8ec24c5741202e264d Author: Jessica Clarke AuthorDate: 2021-01-27 19:19:00 +0000 Commit: Jessica Clarke CommitDate: 2021-01-27 19:19:00 +0000 libllvmminimal: Add missing Support/ABIBreak.cpp When building natively on RISC-V, linking the bootstrap clang-tblgen fails with: ld: error: undefined symbol: llvm::EnableABIBreakingChecks >>> referenced by PrettyStackTrace.cpp >>> PrettyStackTrace.o:(.sdata+0x0) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a >>> referenced by Signals.cpp >>> Signals.o:(.sdata+0x8) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a >>> referenced by Timer.cpp >>> Timer.o:(.sdata+0x28) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a This is likely due to Error.h's inclusion of abi-breaking.h. It's unclear why this only affects RISC-V, but perhaps relates to its more eager use of .sdata due to the ABI's support for linker relaxations. Regardless, this is theoretically an issue for all architectures. Reported by: Dennis Clarke Reviewed by: dim Tested by: mhorne MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28367 --- lib/clang/libllvmminimal/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/clang/libllvmminimal/Makefile b/lib/clang/libllvmminimal/Makefile index 0b5a204583fb..76826547ddbf 100644 --- a/lib/clang/libllvmminimal/Makefile +++ b/lib/clang/libllvmminimal/Makefile @@ -7,6 +7,7 @@ INTERNALLIB= SRCDIR= llvm/lib SRCS+= Demangle/ItaniumDemangle.cpp +SRCS+= Support/ABIBreak.cpp SRCS+= Support/APFloat.cpp SRCS+= Support/APInt.cpp SRCS+= Support/ARMTargetParser.cpp From owner-dev-commits-src-main@freebsd.org Wed Jan 27 19:40: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 D2FC84E72F1; Wed, 27 Jan 2021 19:40: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 4DQv815bC5z3GDM; Wed, 27 Jan 2021 19:40: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 B2C8222517; Wed, 27 Jan 2021 19:40: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 10RJe1Ne037833; Wed, 27 Jan 2021 19:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RJe1AF037830; Wed, 27 Jan 2021 19:40:01 GMT (envelope-from git) Date: Wed, 27 Jan 2021 19:40:01 GMT Message-Id: <202101271940.10RJe1AF037830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 65efb73fbddd - main - sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65efb73fbddd44116fd39b03991386a67422ba6d 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, 27 Jan 2021 19:40:01 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=65efb73fbddd44116fd39b03991386a67422ba6d commit 65efb73fbddd44116fd39b03991386a67422ba6d Author: Ryan Moeller AuthorDate: 2021-01-27 19:27:46 +0000 Commit: Ryan Moeller CommitDate: 2021-01-27 19:27:46 +0000 sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes The OID is saved when we encounter CTLFLAG_SKIP so that descendants can be skipped as well. We then must not update the skip OID until we are out of the node. This was achieved by resetting the skip OID once the prefix no longer matches, but the case where the OID we reset on has CTLFLAG_SKIP was not accounted for. Reported by: mav Reviewed by: mav MFC after: 2 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D28364 --- sbin/sysctl/sysctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index bd1e357065dc..30d6d94723fa 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1030,7 +1030,8 @@ show_var(int *oid, int nlen, bool honor_skip) } /* keep track of encountered skip nodes, ignoring descendants */ - if (skip_len == 0 && (kind & CTLFLAG_SKIP) != 0) { + if ((skip_len == 0 || skip_len >= nlen * (int)sizeof(int)) && + (kind & CTLFLAG_SKIP) != 0) { /* Save this oid so we can skip descendants. */ skip_len = nlen * sizeof(int); memcpy(skip_oid, oid, skip_len); From owner-dev-commits-src-main@freebsd.org Wed Jan 27 19:55: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 AF3374E7F80; Wed, 27 Jan 2021 19:55:53 +0000 (UTC) (envelope-from jhb@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 4DQvVK4cn5z3Gyp; Wed, 27 Jan 2021 19:55:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:61a6:928a:6f1b:828e]) (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 DF90D28441; Wed, 27 Jan 2021 19:55:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 5fe433a6e4d8 - main - netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support To: Kyle Evans , Lutz Donnerhacke Cc: Lutz Donnerhacke , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101241941.10OJfCGA013081@gitrepo.freebsd.org> <20210124194640.GA6527@belenus.iks-jena.de> From: John Baldwin Message-ID: Date: Wed, 27 Jan 2021 11:55:51 -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: 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, 27 Jan 2021 19:55:53 -0000 On 1/24/21 11:51 AM, Kyle Evans wrote: > On Sun, Jan 24, 2021 at 1:47 PM Lutz Donnerhacke wrote: > We switched up the recommendations[0][1] to advocate for what you've > done here ~2 weeks ago -- so yes, this is good. :-) Note that "Submitted by" may still be needed when there are multiple authors who contribute to a patch. (And I do kind of think pulling it from the template was a bit hasty as it didn't take those cases into account.) I do think we want Author to reflect the primary author of the change though. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Jan 27 19:59: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 6278A4E8021 for ; Wed, 27 Jan 2021 19:59:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 4DQvZM2ByWz3HMT for ; Wed, 27 Jan 2021 19:59:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f51.google.com with SMTP id c128so2720752wme.2 for ; Wed, 27 Jan 2021 11:59:23 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=URJ0yPQQ+FTBhe2a50AICYBIGicsGBXVWDP08AZXEYs=; b=jcFKXP1oyT3D1iWVe9rc0d7pF/97FzYuucJYGSRFtV41w9kQaP4JIyhlXQbg9OMAB0 oUm4XfXilrE+zd5vnH6mpEYzGZgABkGcGcArflX+UXr8GAljmXVpVQDe4oa+ynuqJOVU gkY84Owuv6Eq/80WrRseMjJge4pvEYim1Adc9emqzXF9SD1rBgihw/MDB8suDtV20zDE N55DH6EzYmAtS4tNl08mabdbISdliBEVGYys/d2Wtq0TcJQvHoS0nry9mjZyz3cUw456 w4l+/YEjj8agbAgwZEyzP96KcDPmLkxrPb1TnrjgxJvHF35i0UOSEyUOkkiuj+jVbIPq 7V8w== X-Gm-Message-State: AOAM533r6dUmZxkD9hKJSKSrj7OzKHnjnwpbndUgnZuAYNsY9PBZ0q4K uRL0Y4lRQIsSXzLgOLgIjxh2Ow== X-Google-Smtp-Source: ABdhPJw0topqsRF0CoSjzbP623IIuMbBgLOixbvXspI2TpY20DzNk9eOPhEizmb2rwZrJVFSgPOj0w== X-Received: by 2002:a1c:cc19:: with SMTP id h25mr5601230wmb.124.1611777561927; Wed, 27 Jan 2021 11:59:21 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id h15sm4144995wrt.10.2021.01.27.11.59.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jan 2021 11:59:21 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 5fe433a6e4d8 - main - netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support From: Jessica Clarke In-Reply-To: Date: Wed, 27 Jan 2021 19:59:19 +0000 Cc: Kyle Evans , Lutz Donnerhacke , Lutz Donnerhacke , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <76B5E43D-EB93-4739-BDD1-BECA4340CCDC@freebsd.org> References: <202101241941.10OJfCGA013081@gitrepo.freebsd.org> <20210124194640.GA6527@belenus.iks-jena.de> To: John Baldwin X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DQvZM2ByWz3HMT 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: Wed, 27 Jan 2021 19:59:23 -0000 On 27 Jan 2021, at 19:55, John Baldwin wrote: > On 1/24/21 11:51 AM, Kyle Evans wrote: >> On Sun, Jan 24, 2021 at 1:47 PM Lutz Donnerhacke = wrote: >> We switched up the recommendations[0][1] to advocate for what you've >> done here ~2 weeks ago -- so yes, this is good. :-) >=20 > Note that "Submitted by" may still be needed when there are multiple > authors who contribute to a patch. (And I do kind of think pulling > it from the template was a bit hasty as it didn't take those cases > into account.) I do think we want Author to reflect the primary > author of the change though. The git world (or at least the GitHub world) seems to be settling in Co-authored-by: for that, which is more accurate. Jess From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:09: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 2DDA74E8623; Wed, 27 Jan 2021 20:09:59 +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 4DQvpb0lnFz3JV6; Wed, 27 Jan 2021 20:09:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 03F8E281CE; Wed, 27 Jan 2021 20:09:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f181.google.com with SMTP id r77so3030200qka.12; Wed, 27 Jan 2021 12:09:59 -0800 (PST) X-Gm-Message-State: AOAM533jetzEY0PWZ5CxtuRhjQOolwlNYRLcUi7rlSatThd4Ge6lw+fF 2YQjpk9qNrca9brvTLIBvfNOP3rhhJGvCFUXjTQ= X-Google-Smtp-Source: ABdhPJzZ7Og2v859vCq8F+8ycKrm4quOqUY+7VjBh7WIa1nKmme0S6pYDInusiUkbAq5SvPnp10/htS+wFiDjTxvmpU= X-Received: by 2002:a05:620a:5aa:: with SMTP id q10mr11822300qkq.103.1611778198515; Wed, 27 Jan 2021 12:09:58 -0800 (PST) MIME-Version: 1.0 References: <202101241941.10OJfCGA013081@gitrepo.freebsd.org> <20210124194640.GA6527@belenus.iks-jena.de> <76B5E43D-EB93-4739-BDD1-BECA4340CCDC@freebsd.org> In-Reply-To: <76B5E43D-EB93-4739-BDD1-BECA4340CCDC@freebsd.org> From: Kyle Evans Date: Wed, 27 Jan 2021 14:09:44 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 5fe433a6e4d8 - main - netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support To: Jessica Clarke Cc: John Baldwin , Lutz Donnerhacke , Lutz Donnerhacke , 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: Wed, 27 Jan 2021 20:09:59 -0000 On Wed, Jan 27, 2021 at 1:59 PM Jessica Clarke wrote: > > On 27 Jan 2021, at 19:55, John Baldwin wrote: > > On 1/24/21 11:51 AM, Kyle Evans wrote: > >> On Sun, Jan 24, 2021 at 1:47 PM Lutz Donnerhacke wrote: > >> We switched up the recommendations[0][1] to advocate for what you've > >> done here ~2 weeks ago -- so yes, this is good. :-) > > > > Note that "Submitted by" may still be needed when there are multiple > > authors who contribute to a patch. (And I do kind of think pulling > > it from the template was a bit hasty as it didn't take those cases > > into account.) I do think we want Author to reflect the primary > > author of the change though. > > The git world (or at least the GitHub world) seems to be settling in > Co-authored-by: for that, which is more accurate. > Indeed, whoops- I hadn't thought of specifically noting something for co-authors. =-( I agree with switching to Co-authored-by; some tooling (e.g. GitHub, GitLab) will recognize this and do something appropriate with it if it can identify the coauthors. IMO "Submitted by" is an awkward verbiage for this, as "submitted" would (to me) typically imply the very specific action of presenting the patch and working it through the system (i.e. reviews), and these sets of people don't always match. That's getting pretty pedantic, but I suspect I'm not the only one that makes this kind of association and "co-authors" more clearly spells out how these individuals may be related w.r.t. any given patch in a more objective fashion. Thanks, Kyle Evans From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:24: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 0A2514E8744; Wed, 27 Jan 2021 20:24:22 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQw792j7xz3KTw; Wed, 27 Jan 2021 20:24:19 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2a02:8109:1140:c3d:1047:2f49:ddfe:569c] (unknown [IPv6:2a02:8109:1140:c3d:1047:2f49:ddfe:569c]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id B48A4721BE010; Wed, 27 Jan 2021 21:24:15 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: git: 24a8f6d36996 - main - When we are about to send down to the driver layer we need to make sure that the m_nextpkt field is NULL else the lower layers may do unwanted things. From: Michael Tuexen In-Reply-To: <202101271854.10RIsN1E083640@gitrepo.freebsd.org> Date: Wed, 27 Jan 2021 21:24:12 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <9F54A720-4A55-48E6-88BC-CFEFC48F79B0@macmic.franken.de> References: <202101271854.10RIsN1E083640@gitrepo.freebsd.org> To: Randall Stewart X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4DQw792j7xz3KTw 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: Wed, 27 Jan 2021 20:24:22 -0000 > On 27. Jan 2021, at 19:54, Randall Stewart wrote: >=20 > The branch main has been updated by rrs: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D24a8f6d369962f189ad808f538029179= b1e7dc2f >=20 > commit 24a8f6d369962f189ad808f538029179b1e7dc2f > Author: Randall Stewart > AuthorDate: 2021-01-27 18:32:52 +0000 > Commit: Randall Stewart > CommitDate: 2021-01-27 18:52:44 +0000 >=20 > When we are about to send down to the driver layer > we need to make sure that the m_nextpkt field is NULL > else the lower layers may do unwanted things. >=20 > Reviewed By: gallatin, melifaro > Differential Revision: https://reviews.freebsd.org/D28377 Any plans to MFC this to stable/13 and or stable/12? Best regards Michael > --- > sys/netinet6/nd6.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c > index 386eb7cca922..497c0bfc10e8 100644 > --- a/sys/netinet6/nd6.c > +++ b/sys/netinet6/nd6.c > @@ -2460,6 +2460,7 @@ nd6_flush_holdchain(struct ifnet *ifp, struct = mbuf *chain, > while (m_head) { > m =3D m_head; > m_head =3D m_head->m_nextpkt; > + m->m_nextpkt =3D NULL; > error =3D nd6_output_ifp(ifp, ifp, m, dst, NULL); > } >=20 From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:29: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 406C34E8ACC; Wed, 27 Jan 2021 20:29: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 4DQwFb0Md8z3KxY; Wed, 27 Jan 2021 20:29: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 F37B72301E; Wed, 27 Jan 2021 20:29: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 10RKTsuO002836; Wed, 27 Jan 2021 20:29:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RKTsk5002835; Wed, 27 Jan 2021 20:29:54 GMT (envelope-from git) Date: Wed, 27 Jan 2021 20:29:54 GMT Message-Id: <202101272029.10RKTsk5002835@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: d0d2e523bafb - main - netgraph/ng_car: Add color marking code 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: d0d2e523bafb74180f8bebb90788790f0d2f0290 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, 27 Jan 2021 20:29:55 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=d0d2e523bafb74180f8bebb90788790f0d2f0290 commit d0d2e523bafb74180f8bebb90788790f0d2f0290 Author: Lutz Donnerhacke AuthorDate: 2021-01-27 20:19:14 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-01-27 20:22:51 +0000 netgraph/ng_car: Add color marking code Chained policing should be able to reuse the classification of traffic. A new mbuf_tag type is defined to handle gereral QoS marking. A new subtype is defined to track the color marking. Reviewed by: manpages (bcr), melifaro, kp Approved by: kp (mentor) Sponsored by: IKS Service GmbH MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22110 --- share/man/man4/ng_car.4 | 9 ++++-- sys/netgraph/ng_car.c | 86 +++++++++++++++++++++++++++++++++++++------------ sys/netgraph/ng_car.h | 5 ++- sys/netgraph/qos.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+), 27 deletions(-) diff --git a/share/man/man4/ng_car.4 b/share/man/man4/ng_car.4 index f3a01b6880e1..abb522ae151b 100644 --- a/share/man/man4/ng_car.4 +++ b/share/man/man4/ng_car.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2012 +.Dd January 27, 2021 .Dt NG_CAR 4 .Os .Sh NAME @@ -108,6 +108,7 @@ Traffic shaping is much more polite to the TCP traffic than rate limit on links with bandwidth * delay product less than 6-8 TCP segments, but it consumes additional system resources for queue processing. .El +.Pp By default, all information rates are measured in bits per second and bursts are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled, @@ -138,7 +139,8 @@ struct ng_car_hookconf { /* possible actions (..._action) */ enum { NG_CAR_ACTION_FORWARD = 1, - NG_CAR_ACTION_DROP + NG_CAR_ACTION_DROP, + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -149,7 +151,8 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits for opt) */ +#define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 struct ng_car_bulkconf { diff --git a/sys/netgraph/ng_car.c b/sys/netgraph/ng_car.c index 1f74c4b193d0..9474e2467439 100644 --- a/sys/netgraph/ng_car.c +++ b/sys/netgraph/ng_car.c @@ -3,6 +3,7 @@ * * Copyright (c) 2005 Nuno Antunes * Copyright (c) 2007 Alexander Motin + * Copyright (c) 2019 Lutz Donnerhacke * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,9 +35,9 @@ * * TODO: * - Sanitize input config values (impose some limits) - * - Implement internal packet painting (possibly using mbuf tags) - * - Implement color-aware mode * - Implement DSCP marking for IPv4 + * - Decouple functionality into a simple classifier (g/y/r) + * and various action nodes (i.e. shape, dcsp, pcp) */ #include @@ -50,6 +51,8 @@ #include #include +#include "qos.h" + #define NG_CAR_QUEUE_SIZE 100 /* Maximum queue size for SHAPE mode */ #define NG_CAR_QUEUE_MIN_TH 8 /* Minimum RED threshold for SHAPE mode */ @@ -261,6 +264,8 @@ ng_car_rcvdata(hook_p hook, item_p item ) { struct hookinfo *const hinfo = NG_HOOK_PRIVATE(hook); struct mbuf *m; + struct m_qos_color *colp; + enum qos_color col; int error = 0; u_int len; @@ -272,15 +277,22 @@ ng_car_rcvdata(hook_p hook, item_p item ) m = NGI_M(item); -#define NG_CAR_PERFORM_MATCH_ACTION(a) \ +#define NG_CAR_PERFORM_MATCH_ACTION(a,col) \ do { \ switch (a) { \ case NG_CAR_ACTION_FORWARD: \ /* Do nothing. */ \ break; \ case NG_CAR_ACTION_MARK: \ - /* XXX find a way to mark packets (mbuf tag?) */ \ - ++hinfo->stats.errors; \ + if (colp == NULL) { \ + colp = (void *)m_tag_alloc( \ + M_QOS_COOKIE, M_QOS_COLOR, \ + MTAG_SIZE(m_qos_color), M_NOWAIT); \ + if (colp != NULL) \ + m_tag_prepend(m, &colp->tag); \ + } \ + if (colp != NULL) \ + colp->color = col; \ break; \ case NG_CAR_ACTION_DROP: \ default: \ @@ -298,22 +310,33 @@ ng_car_rcvdata(hook_p hook, item_p item ) len = m->m_pkthdr.len; } + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Check committed token bucket. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green. */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); } else { /* Refill only if not green without it. */ ng_car_refillhook(hinfo); /* Check committed token bucket again after refill. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); /* If not green and mode is SHAPE, enqueue packet. */ } else if (hinfo->conf.mode == NG_CAR_SHAPE) { @@ -323,40 +346,51 @@ ng_car_rcvdata(hook_p hook, item_p item ) /* If not green and mode is RED, calculate probability. */ } else if (hinfo->conf.mode == NG_CAR_RED) { /* Is packet is bigger then extended burst? */ - if (len - (hinfo->tc - len) > hinfo->conf.ebs) { + if (len - (hinfo->tc - len) > hinfo->conf.ebs || + col >= QOS_COLOR_RED) { /* This packet is definitely red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); /* Use token bucket to simulate RED-like drop probability. */ - } else if (hinfo->te + (len - hinfo->tc) < - hinfo->conf.ebs) { + } else if (hinfo->te + (len - hinfo->tc) < hinfo->conf.ebs && + col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te += len - hinfo->tc; /* Go to negative tokens. */ hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is probably red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } /* If not green and mode is SINGLE/DOUBLE RATE. */ } else { /* Check extended token bucket. */ - if (hinfo->te - len >= 0) { + if (hinfo->te - len >= 0 && col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is red */ ++hinfo->stats.red_pkts; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } } } @@ -709,12 +743,21 @@ ng_car_q_event(node_p node, hook_p hook, void *arg, int arg2) static void ng_car_enqueue(struct hookinfo *hinfo, item_p item) { - struct mbuf *m; - int len; + struct mbuf *m; + int len; + struct m_qos_color *colp; + enum qos_color col; NGI_GET_M(item, m); NG_FREE_ITEM(item); + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Lock queue mutex. */ mtx_lock(&hinfo->q_mtx); @@ -725,7 +768,8 @@ ng_car_enqueue(struct hookinfo *hinfo, item_p item) /* If queue is overflowed or we have no RED tokens. */ if ((len >= (NG_CAR_QUEUE_SIZE - 1)) || - (hinfo->te + len >= NG_CAR_QUEUE_SIZE)) { + (hinfo->te + len >= NG_CAR_QUEUE_SIZE) || + (col >= QOS_COLOR_RED)) { /* Drop packet. */ ++hinfo->stats.red_pkts; ++hinfo->stats.dropped_pkts; diff --git a/sys/netgraph/ng_car.h b/sys/netgraph/ng_car.h index 7f07f87e52b8..410161af29ee 100644 --- a/sys/netgraph/ng_car.h +++ b/sys/netgraph/ng_car.h @@ -103,8 +103,7 @@ struct ng_car_hookconf { enum { NG_CAR_ACTION_FORWARD = 1, NG_CAR_ACTION_DROP, - NG_CAR_ACTION_MARK, - NG_CAR_ACTION_SET_TOS + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -115,7 +114,7 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits in opt) */ #define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 diff --git a/sys/netgraph/qos.h b/sys/netgraph/qos.h new file mode 100644 index 000000000000..0e5dfec479eb --- /dev/null +++ b/sys/netgraph/qos.h @@ -0,0 +1,83 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Lutz Donnerhacke + * + * 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 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 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$ + */ + +#ifndef _NETGRAPH_QOS_H_ +#define _NETGRAPH_QOS_H_ + +#include + +/* ABI cookie */ +#define M_QOS_COOKIE 1571268051 +#define MTAG_SIZE(X) ( sizeof(struct X) - sizeof(struct m_tag) ) + +/* + * Definition of types within this ABI: + * - Choose a type (16bit) by i.e. "echo $((1000+$(date +%s)%64536))" + * - Retry if the type is already in use + * - Define the structure for the type according to mbuf_tags(9) + * struct m_qos_foo { + * struct m_tag tag; + * ... + * }; + * Preferred usage: + * struct m_qos_foo *p = (void *)m_tag_locate(m, + * M_QOS_COOKIE, M_QOS_FOO, ...); + * or + * p = (void *)m_tag_alloc( + * M_QOS_COOKIE, M_QOS_FOO, MTAG_SIZE(foo), ...); + m_tag_prepend(m, &p->tag); + */ + +/* Color marking type */ +#define M_QOS_COLOR 23568 +/* Keep colors ordered semantically in order to allow use of "<=" or ">=" */ +enum qos_color { + QOS_COLOR_GREEN, + QOS_COLOR_YELLOW, + QOS_COLOR_RED +}; +struct m_qos_color { + struct m_tag tag; + enum qos_color color; +}; + +/* + * Priority class + * + * Processing per priority requires an overhead, which should + * be static (i.e. for alloctating queues) and small (for memory) + * So keep your chosen range limited. + */ +#define M_QOS_PRIORITY 28858 +struct m_qos_priority { + struct m_tag tag; + uint8_t priority; /* 0 - lowest */ +}; + +#endif /* _NETGRAPH_QOS_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:32: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 433B84E8D59; Wed, 27 Jan 2021 20:32: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 4DQwJN1TKgz3L9k; Wed, 27 Jan 2021 20:32: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 2536A23169; Wed, 27 Jan 2021 20:32: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 10RKWKYF014653; Wed, 27 Jan 2021 20:32:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RKWKNi014652; Wed, 27 Jan 2021 20:32:20 GMT (envelope-from git) Date: Wed, 27 Jan 2021 20:32:20 GMT Message-Id: <202101272032.10RKWKNi014652@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: bd674d8b1fa8 - main - qat: Add support for separate AAD and output buffers 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: bd674d8b1fa808dff1afdcb6afc70226077ee78a 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, 27 Jan 2021 20:32:20 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd674d8b1fa808dff1afdcb6afc70226077ee78a commit bd674d8b1fa808dff1afdcb6afc70226077ee78a Author: Mark Johnston AuthorDate: 2021-01-27 20:30:58 +0000 Commit: Mark Johnston CommitDate: 2021-01-27 20:30:58 +0000 qat: Add support for separate AAD and output buffers MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/qat/qat.c | 293 +++++++++++++++++++++++++++++++++++++------------ sys/dev/qat/qat_hw15.c | 20 +++- sys/dev/qat/qat_hw17.c | 22 +++- sys/dev/qat/qatreg.h | 3 + sys/dev/qat/qatvar.h | 43 ++++---- 5 files changed, 281 insertions(+), 100 deletions(-) diff --git a/sys/dev/qat/qat.c b/sys/dev/qat/qat.c index 1e533d1bebcc..acfe0c6a1e07 100644 --- a/sys/dev/qat/qat.c +++ b/sys/dev/qat/qat.c @@ -1172,9 +1172,8 @@ static void qat_crypto_free_sym_cookie(struct qat_crypto_bank *qcb, struct qat_sym_cookie *qsc) { - - explicit_bzero(qsc->qsc_iv_buf, sizeof(qsc->qsc_iv_buf)); - explicit_bzero(qsc->qsc_auth_res, sizeof(qsc->qsc_auth_res)); + explicit_bzero(qsc->qsc_iv_buf, EALG_MAX_BLOCK_LEN); + explicit_bzero(qsc->qsc_auth_res, QAT_SYM_HASH_BUFFER_LEN); mtx_lock(&qcb->qcb_bank_mtx); qcb->qcb_symck_free[qcb->qcb_symck_free_count++] = qsc; @@ -1350,18 +1349,66 @@ struct qat_crypto_load_cb_arg { int error; }; +static int +qat_crypto_populate_buf_list(struct buffer_list_desc *buffers, + bus_dma_segment_t *segs, int niseg, int noseg, int skip) +{ + struct flat_buffer_desc *flatbuf; + bus_addr_t addr; + bus_size_t len; + int iseg, oseg; + + for (iseg = 0, oseg = noseg; iseg < niseg && oseg < QAT_MAXSEG; + iseg++) { + addr = segs[iseg].ds_addr; + len = segs[iseg].ds_len; + + if (skip > 0) { + if (skip < len) { + addr += skip; + len -= skip; + skip = 0; + } else { + skip -= len; + continue; + } + } + + flatbuf = &buffers->flat_bufs[oseg++]; + flatbuf->data_len_in_bytes = (uint32_t)len; + flatbuf->phy_buffer = (uint64_t)addr; + } + buffers->num_buffers = oseg; + return iseg < niseg ? E2BIG : 0; +} + static void -qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs, int nseg, +qat_crypto_load_aadbuf_cb(void *_arg, bus_dma_segment_t *segs, int nseg, + int error) +{ + struct qat_crypto_load_cb_arg *arg; + struct qat_sym_cookie *qsc; + + arg = _arg; + if (error != 0) { + arg->error = error; + return; + } + + qsc = arg->qsc; + arg->error = qat_crypto_populate_buf_list(&qsc->qsc_buf_list, segs, + nseg, 0, 0); +} + +static void +qat_crypto_load_buf_cb(void *_arg, bus_dma_segment_t *segs, int nseg, int error) { struct cryptop *crp; - struct flat_buffer_desc *flatbuf; struct qat_crypto_load_cb_arg *arg; struct qat_session *qs; struct qat_sym_cookie *qsc; - bus_addr_t addr; - bus_size_t len; - int iseg, oseg, skip; + int noseg, skip; arg = _arg; if (error != 0) { @@ -1374,43 +1421,70 @@ qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs, int nseg, qsc = arg->qsc; if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) { - /* - * The firmware expects AAD to be in a contiguous buffer and - * padded to a multiple of 16 bytes. To satisfy these - * constraints we bounce the AAD into a per-request buffer. - */ - crypto_copydata(crp, crp->crp_aad_start, crp->crp_aad_length, - qsc->qsc_gcm_aad); - memset(qsc->qsc_gcm_aad + crp->crp_aad_length, 0, - roundup2(crp->crp_aad_length, QAT_AES_GCM_AAD_ALIGN) - - crp->crp_aad_length); + /* AAD was handled in qat_crypto_load(). */ skip = crp->crp_payload_start; - } else if (crp->crp_aad_length > 0) { + noseg = 0; + } else if (crp->crp_aad == NULL && crp->crp_aad_length > 0) { skip = crp->crp_aad_start; + noseg = 0; } else { skip = crp->crp_payload_start; + noseg = crp->crp_aad == NULL ? + 0 : qsc->qsc_buf_list.num_buffers; } + arg->error = qat_crypto_populate_buf_list(&qsc->qsc_buf_list, segs, + nseg, noseg, skip); +} - for (iseg = oseg = 0; iseg < nseg; iseg++) { - addr = segs[iseg].ds_addr; - len = segs[iseg].ds_len; +static void +qat_crypto_load_obuf_cb(void *_arg, bus_dma_segment_t *segs, int nseg, + int error) +{ + struct buffer_list_desc *ibufs, *obufs; + struct flat_buffer_desc *ibuf, *obuf; + struct cryptop *crp; + struct qat_crypto_load_cb_arg *arg; + struct qat_session *qs; + struct qat_sym_cookie *qsc; + int buflen, osegs, tocopy; - if (skip > 0) { - if (skip < len) { - addr += skip; - len -= skip; - skip = 0; - } else { - skip -= len; - continue; - } - } + arg = _arg; + if (error != 0) { + arg->error = error; + return; + } - flatbuf = &qsc->qsc_flat_bufs[oseg++]; - flatbuf->data_len_in_bytes = (uint32_t)len; - flatbuf->phy_buffer = (uint64_t)addr; + crp = arg->crp; + qs = arg->qs; + qsc = arg->qsc; + + /* + * The payload must start at the same offset in the output SG list as in + * the input SG list. Copy over SG entries from the input corresponding + * to the AAD buffer. + */ + osegs = 0; + if (qs->qs_auth_algo != HW_AUTH_ALGO_GALOIS_128 && + crp->crp_aad_length > 0) { + tocopy = crp->crp_aad == NULL ? + crp->crp_payload_start - crp->crp_aad_start : + crp->crp_aad_length; + + ibufs = &qsc->qsc_buf_list; + obufs = &qsc->qsc_obuf_list; + for (; osegs < ibufs->num_buffers && tocopy > 0; osegs++) { + ibuf = &ibufs->flat_bufs[osegs]; + obuf = &obufs->flat_bufs[osegs]; + + obuf->phy_buffer = ibuf->phy_buffer; + buflen = imin(ibuf->data_len_in_bytes, tocopy); + obuf->data_len_in_bytes = buflen; + tocopy -= buflen; + } } - qsc->qsc_buf_list.num_buffers = oseg; + + arg->error = qat_crypto_populate_buf_list(&qsc->qsc_obuf_list, segs, + nseg, osegs, crp->crp_payload_output_start); } static int @@ -1426,10 +1500,52 @@ qat_crypto_load(struct qat_session *qs, struct qat_sym_cookie *qsc, arg.qs = qs; arg.qsc = qsc; arg.error = 0; - error = bus_dmamap_load_crp(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, - crp, qat_crypto_load_cb, &arg, BUS_DMA_NOWAIT); - if (error == 0) - error = arg.error; + + error = 0; + if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128 && + crp->crp_aad_length > 0) { + /* + * The firmware expects AAD to be in a contiguous buffer and + * padded to a multiple of 16 bytes. To satisfy these + * constraints we bounce the AAD into a per-request buffer. + * There is a small limit on the AAD size so this is not too + * onerous. + */ + memset(qsc->qsc_gcm_aad, 0, QAT_GCM_AAD_SIZE_MAX); + if (crp->crp_aad == NULL) { + crypto_copydata(crp, crp->crp_aad_start, + crp->crp_aad_length, qsc->qsc_gcm_aad); + } else { + memcpy(qsc->qsc_gcm_aad, crp->crp_aad, + crp->crp_aad_length); + } + } else if (crp->crp_aad != NULL) { + error = bus_dmamap_load( + qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dmamap, + crp->crp_aad, crp->crp_aad_length, + qat_crypto_load_aadbuf_cb, &arg, BUS_DMA_NOWAIT); + if (error == 0) + error = arg.error; + } + if (error == 0) { + error = bus_dmamap_load_crp_buffer( + qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dmamap, + &crp->crp_buf, qat_crypto_load_buf_cb, &arg, + BUS_DMA_NOWAIT); + if (error == 0) + error = arg.error; + } + if (error == 0 && CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + error = bus_dmamap_load_crp_buffer( + qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dmamap, + &crp->crp_obuf, qat_crypto_load_obuf_cb, &arg, + BUS_DMA_NOWAIT); + if (error == 0) + error = arg.error; + } return error; } @@ -1444,11 +1560,11 @@ qat_crypto_select_bank(struct qat_crypto *qcy) static int qat_crypto_setup_ring(struct qat_softc *sc, struct qat_crypto_bank *qcb) { - int error, i, bank; - int curname = 0; char *name; + int bank, curname, error, i, j; bank = qcb->qcb_bank; + curname = 0; name = qcb->qcb_ring_names[curname++]; snprintf(name, QAT_RING_NAME_SIZE, "bank%d sym_tx", bank); @@ -1480,10 +1596,16 @@ qat_crypto_setup_ring(struct qat_softc *sc, struct qat_crypto_bank *qcb) qsc->qsc_self_dma_tag = qdm->qdm_dma_tag; qsc->qsc_bulk_req_params_buf_paddr = qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, - u.qsc_bulk_cookie.qsbc_req_params_buf); + qsc_bulk_cookie.qsbc_req_params_buf); qsc->qsc_buffer_list_desc_paddr = qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, qsc_buf_list); + qsc->qsc_obuffer_list_desc_paddr = + qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, + qsc_obuf_list); + qsc->qsc_obuffer_list_desc_paddr = + qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, + qsc_obuf_list); qsc->qsc_iv_buf_paddr = qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, qsc_iv_buf); @@ -1499,24 +1621,25 @@ qat_crypto_setup_ring(struct qat_softc *sc, struct qat_crypto_bank *qcb) qcb->qcb_symck_free[i] = qsc; qcb->qcb_symck_free_count++; - error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - QAT_MAXLEN, /* maxsize */ - QAT_MAXSEG, /* nsegments */ - QAT_MAXLEN, /* maxsegsize */ - BUS_DMA_COHERENT, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &qsc->qsc_buf_dma_tag); - if (error != 0) - return error; - - error = bus_dmamap_create(qsc->qsc_buf_dma_tag, - BUS_DMA_COHERENT, &qsc->qsc_buf_dmamap); - if (error) - return error; + for (j = 0; j < QAT_SYM_DMA_COUNT; j++) { + error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + QAT_MAXLEN, /* maxsize */ + QAT_MAXSEG, /* nsegments */ + QAT_MAXLEN, /* maxsegsize */ + BUS_DMA_COHERENT, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &qsc->qsc_dma[j].qsd_dma_tag); + if (error != 0) + return error; + error = bus_dmamap_create(qsc->qsc_dma[j].qsd_dma_tag, + BUS_DMA_COHERENT, &qsc->qsc_dma[j].qsd_dmamap); + if (error != 0) + return error; + } } return 0; @@ -1534,10 +1657,17 @@ static void qat_crypto_bank_deinit(struct qat_softc *sc, struct qat_crypto_bank *qcb) { struct qat_dmamem *qdm; - int i; + struct qat_sym_cookie *qsc; + int i, j; for (i = 0; i < QAT_NSYMCOOKIE; i++) { qdm = &qcb->qcb_symck_dmamems[i]; + qsc = qcb->qcb_symck_free[i]; + for (j = 0; j < QAT_SYM_DMA_COUNT; j++) { + bus_dmamap_destroy(qsc->qsc_dma[j].qsd_dma_tag, + qsc->qsc_dma[j].qsd_dmamap); + bus_dma_tag_destroy(qsc->qsc_dma[j].qsd_dma_tag); + } qat_free_dmamem(sc, qdm); } qat_free_dmamem(sc, &qcb->qcb_sym_tx->qr_dma); @@ -1653,6 +1783,15 @@ qat_crypto_stop(struct qat_softc *sc) (void)crypto_unregister_all(qcy->qcy_cid); } +static void +qat_crypto_sym_dma_unload(struct qat_sym_cookie *qsc, enum qat_sym_dma i) +{ + bus_dmamap_sync(qsc->qsc_dma[i].qsd_dma_tag, qsc->qsc_dma[i].qsd_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(qsc->qsc_dma[i].qsd_dma_tag, + qsc->qsc_dma[i].qsd_dmamap); +} + static int qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, void *msg) { @@ -1669,16 +1808,19 @@ qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, void *msg) qsc = *(void **)((uintptr_t)msg + sc->sc_hw.qhw_crypto_opaque_offset); - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; qcy = qsbc->qsbc_crypto; qs = qsbc->qsbc_session; crp = qsbc->qsbc_cb_tag; bus_dmamap_sync(qsc->qsc_self_dma_tag, qsc->qsc_self_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap); + + if (crp->crp_aad != NULL) + qat_crypto_sym_dma_unload(qsc, QAT_SYM_DMA_AADBUF); + qat_crypto_sym_dma_unload(qsc, QAT_SYM_DMA_BUF); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) + qat_crypto_sym_dma_unload(qsc, QAT_SYM_DMA_OBUF); error = 0; if ((auth_sz = qs->qs_auth_mlen) != 0) { @@ -1719,6 +1861,10 @@ qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, void *msg) static int qat_probesession(device_t dev, const struct crypto_session_params *csp) { + if ((csp->csp_flags & ~(CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD)) != + 0) + return EINVAL; + if (csp->csp_cipher_alg == CRYPTO_AES_XTS && qat_lookup(dev)->qatp_chip == QAT_CHIP_C2XXX) { /* @@ -2092,15 +2238,26 @@ qat_process(device_t dev, struct cryptop *crp, int hint) if (error != 0) goto fail2; - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; qsbc->qsbc_crypto = qcy; qsbc->qsbc_session = qs; qsbc->qsbc_cb_tag = crp; sc->sc_hw.qhw_crypto_setup_req_params(qcb, qs, desc, qsc, crp); - bus_dmamap_sync(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, + if (crp->crp_aad != NULL) { + bus_dmamap_sync(qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dmamap, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + } + bus_dmamap_sync(qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dmamap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + bus_dmamap_sync(qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dmamap, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + } bus_dmamap_sync(qsc->qsc_self_dma_tag, qsc->qsc_self_dmamap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); diff --git a/sys/dev/qat/qat_hw15.c b/sys/dev/qat/qat_hw15.c index 4f823a0a9ae4..aab5be9b647d 100644 --- a/sys/dev/qat/qat_hw15.c +++ b/sys/dev/qat/qat_hw15.c @@ -818,7 +818,7 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_bank *qcb, enum fw_la_cmd_id cmd_id = desc->qcd_cmd_id; enum fw_slice next_slice; - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; bulk_req = (struct fw_la_bulk_req *)qsbc->qsbc_msg; memcpy(bulk_req, &desc->qcd_req_cache, QAT_HW15_SESSION_REQ_CACHE_SIZE); @@ -826,7 +826,13 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_bank *qcb, bulk_req->comn_hdr.comn_req_flags = qat_hw15_get_comn_req_flags(qcb->qcb_bank % 2); bulk_req->comn_mid.src_data_addr = qsc->qsc_buffer_list_desc_paddr; - bulk_req->comn_mid.dest_data_addr = qsc->qsc_buffer_list_desc_paddr; + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_obuffer_list_desc_paddr; + } else { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_buffer_list_desc_paddr; + } bulk_req->req_params_addr = qsc->qsc_bulk_req_params_buf_paddr; bulk_req->comn_ftr.next_request_addr = 0; bulk_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)qsc; @@ -918,8 +924,14 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_bank *qcb, cipher_req->curr_id = FW_SLICE_CIPHER; cipher_req->next_id = next_slice; - cipher_req->cipher_off = crp->crp_aad_length == 0 ? 0 : - crp->crp_payload_start - crp->crp_aad_start; + if (crp->crp_aad_length == 0) { + cipher_req->cipher_off = 0; + } else if (crp->crp_aad == NULL) { + cipher_req->cipher_off = + crp->crp_payload_start - crp->crp_aad_start; + } else { + cipher_req->cipher_off = crp->crp_aad_length; + } cipher_req->cipher_len = crp->crp_payload_length; cipher_req->state_address = qsc->qsc_iv_buf_paddr; } diff --git a/sys/dev/qat/qat_hw17.c b/sys/dev/qat/qat_hw17.c index 643b624ba840..92f2c1ee251d 100644 --- a/sys/dev/qat/qat_hw17.c +++ b/sys/dev/qat/qat_hw17.c @@ -581,13 +581,19 @@ qat_hw17_crypto_setup_req_params(struct qat_crypto_bank *qcb __unused, uint8_t *req_params_ptr; enum fw_la_cmd_id cmd_id = desc->qcd_cmd_id; - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; bulk_req = (struct fw_la_bulk_req *)qsbc->qsbc_msg; memcpy(bulk_req, desc->qcd_req_cache, sizeof(struct fw_la_bulk_req)); bulk_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)qsc; bulk_req->comn_mid.src_data_addr = qsc->qsc_buffer_list_desc_paddr; - bulk_req->comn_mid.dest_data_addr = qsc->qsc_buffer_list_desc_paddr; + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_obuffer_list_desc_paddr; + } else { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_buffer_list_desc_paddr; + } if (__predict_false(crp->crp_cipher_key != NULL || crp->crp_auth_key != NULL)) qat_hw17_crypto_req_setkey(desc, qs, qsc, bulk_req, crp); @@ -643,9 +649,15 @@ qat_hw17_crypto_setup_req_params(struct qat_crypto_bank *qcb __unused, } } else { if (cmd_id != FW_LA_CMD_AUTH) { - cipher_param->cipher_offset = - crp->crp_aad_length == 0 ? 0 : - crp->crp_payload_start - crp->crp_aad_start; + if (crp->crp_aad_length == 0) { + cipher_param->cipher_offset = 0; + } else if (crp->crp_aad == NULL) { + cipher_param->cipher_offset = + crp->crp_payload_start - crp->crp_aad_start; + } else { + cipher_param->cipher_offset = + crp->crp_aad_length; + } cipher_param->cipher_length = crp->crp_payload_length; } if (cmd_id != FW_LA_CMD_CIPHER) { diff --git a/sys/dev/qat/qatreg.h b/sys/dev/qat/qatreg.h index 2a0be321b4f9..076354fc6108 100644 --- a/sys/dev/qat/qatreg.h +++ b/sys/dev/qat/qatreg.h @@ -1550,10 +1550,13 @@ struct flat_buffer_desc { uint64_t phy_buffer; }; +#define HW_MAXSEG 32 + struct buffer_list_desc { uint64_t resrvd; uint32_t num_buffers; uint32_t reserved; + struct flat_buffer_desc flat_bufs[HW_MAXSEG]; }; /* -------------------------------------------------------------------------- */ diff --git a/sys/dev/qat/qatvar.h b/sys/dev/qat/qatvar.h index 3326dc268fc1..3f0ecd411874 100644 --- a/sys/dev/qat/qatvar.h +++ b/sys/dev/qat/qatvar.h @@ -69,13 +69,11 @@ #define QAT_NSYMREQ 256 #define QAT_NSYMCOOKIE ((QAT_NSYMREQ * 2 + 1) * 2) -#define QAT_NASYMREQ 64 -#define QAT_BATCH_SUBMIT_FREE_SPACE 2 #define QAT_EV_NAME_SIZE 32 #define QAT_RING_NAME_SIZE 32 -#define QAT_MAXSEG 32 /* max segments for sg dma */ +#define QAT_MAXSEG HW_MAXSEG /* max segments for sg dma */ #define QAT_MAXLEN 65535 /* IP_MAXPACKET */ #define QAT_HB_INTERVAL 500 /* heartbeat msec */ @@ -519,7 +517,7 @@ struct qat_sym_hash_def { struct qat_sym_bulk_cookie { uint8_t qsbc_req_params_buf[QAT_SYM_REQ_PARAMS_SIZE_PADDED]; - /* memory block reserved for request params + /* memory block reserved for request params, QAT 1.5 only * NOTE: Field must be correctly aligned in memory for access by QAT * engine */ struct qat_crypto *qsbc_crypto; @@ -539,25 +537,26 @@ struct qat_sym_bulk_cookie { HASH_CONTENT_DESC_SIZE + CIPHER_CONTENT_DESC_SIZE, \ QAT_OPTIMAL_ALIGN) +enum qat_sym_dma { + QAT_SYM_DMA_AADBUF = 0, + QAT_SYM_DMA_BUF, + QAT_SYM_DMA_OBUF, + QAT_SYM_DMA_COUNT, +}; + +struct qat_sym_dmamap { + bus_dmamap_t qsd_dmamap; + bus_dma_tag_t qsd_dma_tag; +}; + struct qat_sym_cookie { - union qat_sym_cookie_u { - /* should be 64byte aligned */ - struct qat_sym_bulk_cookie qsc_bulk_cookie; - /* symmetric bulk cookie */ -#ifdef notyet - struct qat_sym_key_cookie qsc_key_cookie; - /* symmetric key cookie */ - struct qat_sym_nrbg_cookie qsc_nrbg_cookie; - /* symmetric NRBG cookie */ -#endif - } u; + struct qat_sym_bulk_cookie qsc_bulk_cookie; /* should be 64-byte aligned */ struct buffer_list_desc qsc_buf_list; - struct flat_buffer_desc qsc_flat_bufs[QAT_MAXSEG]; /* should be here */ + struct buffer_list_desc qsc_obuf_list; - bus_dmamap_t qsc_self_dmamap; /* self DMA mapping and - end of DMA region */ + bus_dmamap_t qsc_self_dmamap; bus_dma_tag_t qsc_self_dma_tag; uint8_t qsc_iv_buf[EALG_MAX_BLOCK_LEN]; @@ -565,12 +564,11 @@ struct qat_sym_cookie { uint8_t qsc_gcm_aad[QAT_GCM_AAD_SIZE_MAX]; uint8_t qsc_content_desc[CONTENT_DESC_MAX_SIZE]; - bus_dmamap_t qsc_buf_dmamap; /* qsc_flat_bufs DMA mapping */ - bus_dma_tag_t qsc_buf_dma_tag; - void *qsc_buf; + struct qat_sym_dmamap qsc_dma[QAT_SYM_DMA_COUNT]; bus_addr_t qsc_bulk_req_params_buf_paddr; bus_addr_t qsc_buffer_list_desc_paddr; + bus_addr_t qsc_obuffer_list_desc_paddr; bus_addr_t qsc_iv_buf_paddr; bus_addr_t qsc_auth_res_paddr; bus_addr_t qsc_gcm_aad_paddr; @@ -578,7 +576,7 @@ struct qat_sym_cookie { }; CTASSERT(offsetof(struct qat_sym_cookie, - u.qsc_bulk_cookie.qsbc_req_params_buf) % QAT_OPTIMAL_ALIGN == 0); + qsc_bulk_cookie.qsbc_req_params_buf) % QAT_OPTIMAL_ALIGN == 0); CTASSERT(offsetof(struct qat_sym_cookie, qsc_buf_list) % QAT_OPTIMAL_ALIGN == 0); #define MAX_CIPHER_SETUP_BLK_SZ \ @@ -614,7 +612,6 @@ struct qat_crypto_desc { uint8_t qcd_req_cache[QAT_MSG_SIZE_TO_BYTES(QAT_MAX_MSG_SIZE)]; } __aligned(QAT_OPTIMAL_ALIGN); -/* should be aligned to 64bytes */ struct qat_session { struct qat_crypto_desc *qs_dec_desc; /* should be at top of struct*/ /* decrypt or auth then decrypt or auth */ From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:32: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 6593B4E8D5A; Wed, 27 Jan 2021 20:32: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 4DQwJP2FJ6z3LT0; Wed, 27 Jan 2021 20:32: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 3E4A122F42; Wed, 27 Jan 2021 20:32: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 10RKWL0Q014675; Wed, 27 Jan 2021 20:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RKWLhx014674; Wed, 27 Jan 2021 20:32:21 GMT (envelope-from git) Date: Wed, 27 Jan 2021 20:32:21 GMT Message-Id: <202101272032.10RKWLhx014674@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: e1b50e8184fc - main - qat.4: Minor tweaks 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: e1b50e8184fca00520774d43bd7bdd0ccbe9a1d2 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, 27 Jan 2021 20:32:21 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e1b50e8184fca00520774d43bd7bdd0ccbe9a1d2 commit e1b50e8184fca00520774d43bd7bdd0ccbe9a1d2 Author: Mark Johnston AuthorDate: 2021-01-27 20:31:10 +0000 Commit: Mark Johnston CommitDate: 2021-01-27 20:31:10 +0000 qat.4: Minor tweaks - Document a constraint on the AAD size for AES-GCM. - Note that the list of supported platforms and add-on devices is not complete and indicate that QAT devices will show up in pciconf output. [1] PR: 252984 [1] MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man4/qat.4 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/share/man/man4/qat.4 b/share/man/man4/qat.4 index 9e9491f22aea..92ee85ac64eb 100644 --- a/share/man/man4/qat.4 +++ b/share/man/man4/qat.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2020 +.Dd January 27, 2021 .Dt QAT 4 .Os .Sh NAME @@ -57,17 +57,29 @@ The driver implements .Xr crypto 4 support for some of the cryptographic acceleration functions of the Intel -QuickAssist device. +QuickAssist (QAT) device. The .Nm driver supports the QAT devices integrated with Atom C2000 and C3000 and Xeon -C620 and D-1500 chipsets, and the Intel QAT Adapter 8950. -It can accelerate AES in CBC, CTR, XTS (except for the C2000) and GCM modes, +C620 and D-1500 platforms, and the Intel QAT Adapter 8950. +Other platforms and adapters not listed here may also be supported. +QAT devices are enumerated through PCIe and are thus visible in +.Xr pciconf 8 +output. +.Pp +The +.Nm +driver can accelerate AES in CBC, CTR, XTS (except for the C2000) and GCM modes, and can perform authenticated encryption combining the CBC, CTR and XTS modes with SHA1-HMAC and SHA2-HMAC. The .Nm driver can also compute SHA1 and SHA2 digests. +The implementation of AES-GCM has a firmware-imposed constraint that the length +of any additional authenticated data (AAD) must not exceed 240 bytes. +The driver thus rejects +.Xr crypto 9 +requests that do not satisfy this constraint. .Sh SEE ALSO .Xr crypto 4 , .Xr ipsec 4 , From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:32: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 2261C4E8DA8; Wed, 27 Jan 2021 20:32: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 4DQwJQ4hBFz3L83; Wed, 27 Jan 2021 20:32: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 7678F23231; Wed, 27 Jan 2021 20:32: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 10RKWMV9014694; Wed, 27 Jan 2021 20:32:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RKWMG9014693; Wed, 27 Jan 2021 20:32:22 GMT (envelope-from git) Date: Wed, 27 Jan 2021 20:32:22 GMT Message-Id: <202101272032.10RKWMG9014693@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: 2fccd4f9b6b9 - main - safexcel: Disallow unsupported buffer layouts 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: 2fccd4f9b6b96d75de87df4922eb2bf04fb0a67d 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, 27 Jan 2021 20:32:23 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2fccd4f9b6b96d75de87df4922eb2bf04fb0a67d commit 2fccd4f9b6b96d75de87df4922eb2bf04fb0a67d Author: Mark Johnston AuthorDate: 2021-01-27 20:31:10 +0000 Commit: Mark Johnston CommitDate: 2021-01-27 20:31:10 +0000 safexcel: Disallow unsupported buffer layouts MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/safexcel/safexcel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 3083f5f794fe..71300dcb0393 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -2272,6 +2272,9 @@ safexcel_probe_cipher(const struct crypto_session_params *csp) static int safexcel_probesession(device_t dev, const struct crypto_session_params *csp) { + if (csp->csp_flags != 0) + return (EINVAL); + switch (csp->csp_mode) { case CSP_MODE_CIPHER: if (!safexcel_probe_cipher(csp)) From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:38: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 53E4B4E9448; Wed, 27 Jan 2021 20:38:31 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 4DQwRW1sJWz3MHd; Wed, 27 Jan 2021 20:38:31 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f173.google.com with SMTP id m13so3610488oig.8; Wed, 27 Jan 2021 12:38:31 -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=0wzJ+pSbdQ4tgshE39CNYQ1c6HFZ1xutWMF7PU6BvJY=; b=mg+YALtiAo6BscWQoz2gX30SFc2wtDKj2VHUIQq8+ZpDWAONP/ob7m55o06B4RuBgi Xl19/+HBf6sNqd90g16z2N2rUiH+Lqhmm5+s3ik3TR4THOQr20w7wDVIRMY/yi992Aie CdONpzKKQ+dK8vV5AQCxD+XoFm6VvHDfXw5S7Da6llT1yNS+/fUXaFmvrKb39Xdm/bhE FamGNgspjGtjqbOfne1ASEEUeW7mNXR50ENpnZYim4NmzdTbo1eDgVrTHnkWcP6ze4E4 Ilplxji2OVnXI7XT6GfU1ATmee215FYZ9uf/xbBf9aXc/ZnGqXPpua6jkiUXJOYFNgfz 2NpQ== X-Gm-Message-State: AOAM530/Knx03bP0q0sItOEPAgxnIhinNAnB0aFblwtDi8R42tsc+k4V oHEECnWz0eMNO2Cr7bDhCPiE6Khe/B/ouIoP/CCTqfWZwt0= X-Google-Smtp-Source: ABdhPJwQRH9j9CpCgTvf7jSu10H2LrtG7A6X00IU/1N74JbyR3Uy4h8/kN4uGiyljPkfXF2KCt7uAPOHh1gGtSX/4DY= X-Received: by 2002:aca:cd06:: with SMTP id d6mr4344665oig.57.1611779909822; Wed, 27 Jan 2021 12:38:29 -0800 (PST) MIME-Version: 1.0 References: <202101272032.10RKWKNi014652@gitrepo.freebsd.org> In-Reply-To: <202101272032.10RKWKNi014652@gitrepo.freebsd.org> From: Alan Somers Date: Wed, 27 Jan 2021 13:38:18 -0700 Message-ID: Subject: Re: git: bd674d8b1fa8 - main - qat: Add support for separate AAD and output buffers To: Mark Johnston Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DQwRW1sJWz3MHd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] 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, 27 Jan 2021 20:38:31 -0000 On Wed, Jan 27, 2021 at 1:32 PM Mark Johnston wrote: > The branch main has been updated by markj: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=bd674d8b1fa808dff1afdcb6afc70226077ee78a > > commit bd674d8b1fa808dff1afdcb6afc70226077ee78a > Author: Mark Johnston > AuthorDate: 2021-01-27 20:30:58 +0000 > Commit: Mark Johnston > CommitDate: 2021-01-27 20:30:58 +0000 > > qat: Add support for separate AAD and output buffers > > MFC after: 1 week > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- Is this related to the ZFS crash, PR 252981 ? From owner-dev-commits-src-main@freebsd.org Wed Jan 27 20:42: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 542F14E9372; Wed, 27 Jan 2021 20:42:14 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 4DQwWp1lSTz3MRl; Wed, 27 Jan 2021 20:42:14 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x735.google.com with SMTP id k193so3151065qke.6; Wed, 27 Jan 2021 12:42:14 -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:references:mime-version :content-disposition:in-reply-to; bh=+RtB6ngHsHU5i8kZ9YjD/gTGI9QhqWHafBaldV/rWpE=; b=bS0hJz+XXXWCqF0tEzBmyfioFR5Pl8npxHXUcVeiyjiPycmavuisWTyBS/rlVJu1fe f4rOe35KIxpPF1jMjoQ5fb8wq1+Wt8/FvxKHXCt3i3Ybc6xB+kQLSeb/zTwRP7JHQnIt nY61EuADLavQG9c186R+q4Ds5pv0z8ENgEd+8v8bp8HpoL8MdkEzh0yBtSJ1fVg5IQ5n wYZm156b2kvcMOCUbMHf6PXL3EcCIX+kNi6B1KQ+qmg1ESmE67LlJIultJAtuc/hskcb DJG2LHJCKUjwItYbsj+V9YpY4uTetWK3NEsD2EUP4ujZ5ZjzCprLeE1bL4c1CCKNOk+i MCsA== 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 :references:mime-version:content-disposition:in-reply-to; bh=+RtB6ngHsHU5i8kZ9YjD/gTGI9QhqWHafBaldV/rWpE=; b=VZeOHWUpMfTk0QkQEhMqDkLhGVDf1XwsP+4LCOHMY5VCwYYYgX72qX2uUoz9+n22Nv 4L2bD4r5C0Xhf+WG19j52aCKEQ97oMGmhd7g4z8RxNabYRCYp7U+z1GWS6bBVL3MqiPQ HBAGNixaGuZVCWUPsUiyHaAWtv+N6lKakUuXU+V/6LKoiotYaEtIIAcDQTgEdgtv0IPo TYInVBcIZtq/Yx7IUnHzfCaYMPbCMwhidt8mprEZPRBJE61E+5ne5CXjN29sMD4+W4dq wqc03fLZXMd2xaKInvQo9O8o9sSca2K4qWBXTruAUaglj9VEHEGJYBDZVU73vjjuzSdY x2UQ== X-Gm-Message-State: AOAM533BuUElryFHbaHB6yHasVR2dx5TlH5MMh8nDRhJPeAUkT0YELBV Di5iV1EhZFFAgRga46jfUcHz3VzC1+OTFA== X-Google-Smtp-Source: ABdhPJxvtqvDLhBbur7hdlfDYhtUt8C4KILGcsvhb68R5RHwmtP5NMwrIxrdj3hSvkg2c1rXaTIdbw== X-Received: by 2002:a37:67c4:: with SMTP id b187mr12197519qkc.418.1611780132673; Wed, 27 Jan 2021 12:42:12 -0800 (PST) Received: from raichu ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id e6sm2003661qkb.45.2021.01.27.12.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 12:42:11 -0800 (PST) Sender: Mark Johnston Date: Wed, 27 Jan 2021 15:42:09 -0500 From: Mark Johnston To: Alan Somers Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bd674d8b1fa8 - main - qat: Add support for separate AAD and output buffers Message-ID: References: <202101272032.10RKWKNi014652@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DQwWp1lSTz3MRl 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: Wed, 27 Jan 2021 20:42:14 -0000 On Wed, Jan 27, 2021 at 01:38:18PM -0700, Alan Somers wrote: > On Wed, Jan 27, 2021 at 1:32 PM Mark Johnston wrote: > > > The branch main has been updated by markj: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=bd674d8b1fa808dff1afdcb6afc70226077ee78a > > > > commit bd674d8b1fa808dff1afdcb6afc70226077ee78a > > Author: Mark Johnston > > AuthorDate: 2021-01-27 20:30:58 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-01-27 20:30:58 +0000 > > > > qat: Add support for separate AAD and output buffers > > > > MFC after: 1 week > > Sponsored by: Rubicon Communications, LLC ("Netgate") > > --- > > > Is this related to the ZFS crash, PR 252981 ? No, it's just required for KTLS and IPSec/ESP with extended sequence numbers. From owner-dev-commits-src-main@freebsd.org Wed Jan 27 21:29: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 924244EAB85; Wed, 27 Jan 2021 21:29: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 4DQxYy3HT5z3Ppc; Wed, 27 Jan 2021 21:29: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 6349323BF1; Wed, 27 Jan 2021 21:29: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 10RLTABL080409; Wed, 27 Jan 2021 21:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RLTAee080408; Wed, 27 Jan 2021 21:29:10 GMT (envelope-from git) Date: Wed, 27 Jan 2021 21:29:10 GMT Message-Id: <202101272129.10RLTAee080408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 6e26189be406 - main - Fix loader detection of vbefb support on !amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e26189be406a9a3799074b16925e6cd63cc703b 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, 27 Jan 2021 21:29:10 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6e26189be406a9a3799074b16925e6cd63cc703b commit 6e26189be406a9a3799074b16925e6cd63cc703b Author: Dimitry Andric AuthorDate: 2021-01-27 21:28:43 +0000 Commit: Dimitry Andric CommitDate: 2021-01-27 21:28:43 +0000 Fix loader detection of vbefb support on !amd64 On i386, after 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd, the vbefb vt driver was no longer detected by the loader, if any kernel module was loaded after the kernel itself. This was caused by the parse_vt_drv_set() function being called multiple times, resetting the detection flag. (It was called multiple times, becuase i386 .ko files are shared objects like the kernel proper, while this is not the case on amd64.) Fix this by skipping the set_vt_drv_set lookup if vbefb was already detected. Reviewed by: tsoome --- stand/common/load_elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index 62fdb560ecff..8bb780ef34df 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -875,8 +875,8 @@ nosyms: ef->buckets = ef->hashtab + 2; ef->chains = ef->buckets + ef->nbuckets; - gfx_state.tg_kernel_supported = false; - if (__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, + if (!gfx_state.tg_kernel_supported && + __elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, STT_NOTYPE) == 0) { p_start = sym.st_value + ef->off; if (__elfN(lookup_symbol)(ef, "__stop_set_vt_drv_set", &sym, From owner-dev-commits-src-main@freebsd.org Wed Jan 27 22:32: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 880014EB9BC; Wed, 27 Jan 2021 22:32: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 4DQyyr3RSpz3j4c; Wed, 27 Jan 2021 22:32: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 697D324C9E; Wed, 27 Jan 2021 22:32: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 10RMWKTY068094; Wed, 27 Jan 2021 22:32:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RMWKOl068093; Wed, 27 Jan 2021 22:32:20 GMT (envelope-from git) Date: Wed, 27 Jan 2021 22:32:20 GMT Message-Id: <202101272232.10RMWKOl068093@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: 183d6cc0e0db - main - release: ROCKPRO64: Remove the quirk that disable the big cores 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: 183d6cc0e0db8bd4653245abc1ca30b34ed09d9f 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, 27 Jan 2021 22:32:20 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=183d6cc0e0db8bd4653245abc1ca30b34ed09d9f commit 183d6cc0e0db8bd4653245abc1ca30b34ed09d9f Author: Emmanuel Vadot AuthorDate: 2021-01-27 22:31:18 +0000 Commit: Emmanuel Vadot CommitDate: 2021-01-27 22:31:18 +0000 release: ROCKPRO64: Remove the quirk that disable the big cores It's not needed anymore. --- release/arm64/ROCKPRO64.conf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/release/arm64/ROCKPRO64.conf b/release/arm64/ROCKPRO64.conf index 29d19bd8a46f..fc454e30ec72 100644 --- a/release/arm64/ROCKPRO64.conf +++ b/release/arm64/ROCKPRO64.conf @@ -26,10 +26,3 @@ arm_install_uboot() { of=/dev/${mddev} bs=512 seek=16384 conv=sync return 0 } - -arm_do_quirk() { - echo '# Known issue with big.LITTLE' \ - >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf - echo 'hw.ncpu=4' \ - >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf -} From owner-dev-commits-src-main@freebsd.org Wed Jan 27 23:08: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 8EC424EC7DD; Wed, 27 Jan 2021 23:08:31 +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 4DQzmb3QL5z3l9b; Wed, 27 Jan 2021 23:08:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:30aa:99ed:637e:111e]) (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 E6F4B29CD1; Wed, 27 Jan 2021 23:08:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 6e26189be406 - main - Fix loader detection of vbefb support on !amd64 To: Dimitry Andric , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101272129.10RLTAee080408@gitrepo.freebsd.org> From: John Baldwin Message-ID: <3973a397-1250-1230-fecc-956b84c74fc9@FreeBSD.org> Date: Wed, 27 Jan 2021 15:08:28 -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: <202101272129.10RLTAee080408@gitrepo.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, 27 Jan 2021 23:08:31 -0000 On 1/27/21 1:29 PM, Dimitry Andric wrote: > The branch main has been updated by dim: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6e26189be406a9a3799074b16925e6cd63cc703b > > commit 6e26189be406a9a3799074b16925e6cd63cc703b > Author: Dimitry Andric > AuthorDate: 2021-01-27 21:28:43 +0000 > Commit: Dimitry Andric > CommitDate: 2021-01-27 21:28:43 +0000 > > Fix loader detection of vbefb support on !amd64 > > On i386, after 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd, the vbefb vt > driver was no longer detected by the loader, if any kernel module was > loaded after the kernel itself. > > This was caused by the parse_vt_drv_set() function being called multiple > times, resetting the detection flag. (It was called multiple times, > becuase i386 .ko files are shared objects like the kernel proper, while > this is not the case on amd64.) > > Fix this by skipping the set_vt_drv_set lookup if vbefb was already > detected. > > Reviewed by: tsoome Does the state get reset if you unload one kernel and then load a different one (e.g. via interactive 'unload' and 'load /path/to/my/kernel')? -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Jan 27 23:20: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 5AEFC4ECD68; Wed, 27 Jan 2021 23:20: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 4DR02t292yz3lKk; Wed, 27 Jan 2021 23:20: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 3D1CD251CA; Wed, 27 Jan 2021 23:20: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 10RNKshm031953; Wed, 27 Jan 2021 23:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RNKs1K031952; Wed, 27 Jan 2021 23:20:54 GMT (envelope-from git) Date: Wed, 27 Jan 2021 23:20:54 GMT Message-Id: <202101272320.10RNKs1K031952@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: a6405133b7e1 - main - riscv: style(9) nits in sbi.c 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: a6405133b7e14929f8e8e61cf30d7152b1410e59 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, 27 Jan 2021 23:20:54 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a6405133b7e14929f8e8e61cf30d7152b1410e59 commit a6405133b7e14929f8e8e61cf30d7152b1410e59 Author: Mitchell Horne AuthorDate: 2021-01-27 21:27:15 +0000 Commit: Mitchell Horne CommitDate: 2021-01-27 23:17:26 +0000 riscv: style(9) nits in sbi.c Wrap a few lines at 80 columns, which were overlooked in recent commits. --- sys/riscv/riscv/sbi.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c index d529d2d08351..a7688b13f283 100644 --- a/sys/riscv/riscv/sbi.c +++ b/sys/riscv/riscv/sbi.c @@ -111,10 +111,12 @@ sbi_print_version(void) printf("SBI: Berkely Boot Loader %lu\n", sbi_impl_version); break; case (SBI_IMPL_ID_XVISOR): - printf("SBI: eXtensible Versatile hypervISOR %lu\n", sbi_impl_version); + printf("SBI: eXtensible Versatile hypervISOR %lu\n", + sbi_impl_version); break; case (SBI_IMPL_ID_KVM): - printf("SBI: Kernel-based Virtual Machine %lu\n", sbi_impl_version); + printf("SBI: Kernel-based Virtual Machine %lu\n", + sbi_impl_version); break; case (SBI_IMPL_ID_RUSTSBI): printf("SBI: RustSBI %lu\n", sbi_impl_version); @@ -206,8 +208,9 @@ sbi_remote_sfence_vma_asid(const u_long *hart_mask, u_long start, u_long size, /* Use the RFENCE legacy replacement extension, if available. */ if (has_rfnc_extension) { - ret = SBI_CALL5(SBI_EXT_ID_RFNC, SBI_RFNC_REMOTE_SFENCE_VMA_ASID, - *hart_mask, 0, start, size, asid); + ret = SBI_CALL5(SBI_EXT_ID_RFNC, + SBI_RFNC_REMOTE_SFENCE_VMA_ASID, *hart_mask, 0, start, + size, asid); MPASS(ret.error == SBI_SUCCESS); } else { (void)SBI_CALL4(SBI_REMOTE_SFENCE_VMA_ASID, 0, @@ -220,7 +223,8 @@ sbi_hsm_hart_start(u_long hart, u_long start_addr, u_long priv) { struct sbi_ret ret; - ret = SBI_CALL3(SBI_EXT_ID_HSM, SBI_HSM_HART_START, hart, start_addr, priv); + ret = SBI_CALL3(SBI_EXT_ID_HSM, SBI_HSM_HART_START, hart, start_addr, + priv); return (ret.error != 0 ? (int)ret.error : 0); } From owner-dev-commits-src-main@freebsd.org Wed Jan 27 23:20: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 7D0984ECD7A; Wed, 27 Jan 2021 23:20: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 4DR02v3BQ1z3lR5; Wed, 27 Jan 2021 23:20: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 5E7E0251CB; Wed, 27 Jan 2021 23:20: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 10RNKtXY031975; Wed, 27 Jan 2021 23:20:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RNKtaq031974; Wed, 27 Jan 2021 23:20:55 GMT (envelope-from git) Date: Wed, 27 Jan 2021 23:20:55 GMT Message-Id: <202101272320.10RNKtaq031974@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: 9bae4ce661c5 - main - riscv: add SBI system reset extension 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: 9bae4ce661c59be88fec89b2531148e36dd1a23e 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, 27 Jan 2021 23:20:55 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9bae4ce661c59be88fec89b2531148e36dd1a23e commit 9bae4ce661c59be88fec89b2531148e36dd1a23e Author: Danjel Qyteza AuthorDate: 2021-01-27 16:28:48 +0000 Commit: Mitchell Horne CommitDate: 2021-01-27 23:19:54 +0000 riscv: add SBI system reset extension The System Reset extension provides functions to shutdown or reboot the system via SBI firmware. This newly defined extension supersedes the functionality of the legacy shutdown extension. Update the SBI code to use the new System Reset extension when available, and fall back to the legacy one. Reviewed By: kp, jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28226 --- sys/riscv/include/sbi.h | 28 +++++++++++++++++++++------- sys/riscv/riscv/sbi.c | 20 +++++++++++++++++--- sys/riscv/riscv/vm_machdep.c | 2 +- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/sys/riscv/include/sbi.h b/sys/riscv/include/sbi.h index 50cacb3e6e5a..9d3f4076dcb2 100644 --- a/sys/riscv/include/sbi.h +++ b/sys/riscv/include/sbi.h @@ -99,6 +99,15 @@ #define SBI_HSM_STATUS_START_PENDING 2 #define SBI_HSM_STATUS_STOP_PENDING 3 +/* System Reset (SRST) Extension */ +#define SBI_EXT_ID_SRST 0x53525354 +#define SBI_SRST_SYSTEM_RESET 0 +#define SBI_SRST_TYPE_SHUTDOWN 0 +#define SBI_SRST_TYPE_COLD_REBOOT 1 +#define SBI_SRST_TYPE_WARM_REBOOT 2 +#define SBI_SRST_REASON_NONE 0 +#define SBI_SRST_REASON_SYSTEM_FAILURE 1 + /* Legacy Extensions */ #define SBI_SET_TIMER 0 #define SBI_CONSOLE_PUTCHAR 1 @@ -199,6 +208,18 @@ void sbi_hsm_hart_stop(void); */ int sbi_hsm_hart_status(u_long hart); +/* System Reset extension functions. */ + +/* + * Reset the system based on the following 'type' and 'reason' chosen from: + * - SBI_SRST_TYPE_SHUTDOWN + * - SBI_SRST_TYPE_COLD_REBOOT + * - SBI_SRST_TYPE_WARM_REBOOT + * - SBI_SRST_REASON_NONE + * - SBI_SRST_REASON_SYSTEM_FAILURE + */ +void sbi_system_reset(u_long reset_type, u_long reset_reason); + /* Legacy extension functions. */ static __inline void sbi_console_putchar(int ch) @@ -218,13 +239,6 @@ sbi_console_getchar(void) return (SBI_CALL0(SBI_CONSOLE_GETCHAR, 0).error); } -static __inline void -sbi_shutdown(void) -{ - - (void)SBI_CALL0(SBI_SHUTDOWN, 0); -} - void sbi_print_version(void); void sbi_init(void); diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c index a7688b13f283..6897fce9cad3 100644 --- a/sys/riscv/riscv/sbi.c +++ b/sys/riscv/riscv/sbi.c @@ -49,6 +49,7 @@ u_long sbi_impl_version; static bool has_time_extension = false; static bool has_ipi_extension = false; static bool has_rfnc_extension = false; +static bool has_srst_extension = false; static struct sbi_ret sbi_get_spec_version(void) @@ -90,7 +91,18 @@ static void sbi_shutdown_final(void *dummy __unused, int howto) { if ((howto & RB_POWEROFF) != 0) - sbi_shutdown(); + sbi_system_reset(SBI_SRST_TYPE_SHUTDOWN, SBI_SRST_REASON_NONE); +} + +void +sbi_system_reset(u_long reset_type, u_long reset_reason) +{ + /* Use the SRST extension, if available. */ + if (has_srst_extension) { + (void)SBI_CALL2(SBI_EXT_ID_SRST, SBI_SRST_SYSTEM_RESET, + reset_type, reset_reason); + } + (void)SBI_CALL0(SBI_SHUTDOWN, 0); } void @@ -277,6 +289,8 @@ sbi_init(void) has_ipi_extension = true; if (sbi_probe_extension(SBI_EXT_ID_RFNC) != 0) has_rfnc_extension = true; + if (sbi_probe_extension(SBI_EXT_ID_SRST) != 0) + has_srst_extension = true; /* * Probe for legacy extensions. We still rely on many of them to be @@ -299,8 +313,8 @@ sbi_init(void) KASSERT(has_rfnc_extension || sbi_probe_extension(SBI_REMOTE_SFENCE_VMA_ASID) != 0, ("SBI doesn't implement sbi_remote_sfence_vma_asid()")); - KASSERT(sbi_probe_extension(SBI_SHUTDOWN) != 0, - ("SBI doesn't implement sbi_shutdown()")); + KASSERT(has_srst_extension || sbi_probe_extension(SBI_SHUTDOWN) != 0, + ("SBI doesn't implement a shutdown or reset extension")); } static void diff --git a/sys/riscv/riscv/vm_machdep.c b/sys/riscv/riscv/vm_machdep.c index f38f1c04caa8..094662413f4e 100644 --- a/sys/riscv/riscv/vm_machdep.c +++ b/sys/riscv/riscv/vm_machdep.c @@ -110,7 +110,7 @@ void cpu_reset(void) { - sbi_shutdown(); + sbi_system_reset(SBI_SRST_TYPE_COLD_REBOOT, SBI_SRST_REASON_NONE); while(1); } From owner-dev-commits-src-main@freebsd.org Wed Jan 27 23:35: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 28E5A4ED0CD; Wed, 27 Jan 2021 23:35: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 4DR0N30RM3z3mVw; Wed, 27 Jan 2021 23:35: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 F14782577A; Wed, 27 Jan 2021 23:35: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 10RNZkrJ049623; Wed, 27 Jan 2021 23:35:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RNZk38049622; Wed, 27 Jan 2021 23:35:46 GMT (envelope-from git) Date: Wed, 27 Jan 2021 23:35:46 GMT Message-Id: <202101272335.10RNZk38049622@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: 676b7d077c2c - main - bsdinstall: create /efi/boot directory in ESP 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: 676b7d077c2c5f548334cea7fccfbfb5d097c9df 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, 27 Jan 2021 23:35:47 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=676b7d077c2c5f548334cea7fccfbfb5d097c9df commit 676b7d077c2c5f548334cea7fccfbfb5d097c9df Author: Mitchell Horne AuthorDate: 2021-01-15 16:14:27 +0000 Commit: Mitchell Horne CommitDate: 2021-01-27 23:27:51 +0000 bsdinstall: create /efi/boot directory in ESP If the installer is creating a new ESP, then this directory will not exist and the subsequent cp will fail silently. This is usually of no consequence if /efi/freebsd/loader.efi is set up correctly. Reviewed by: imp MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D28176 --- usr.sbin/bsdinstall/scripts/bootconfig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 93a3bc0a53c2..1593545a1c2e 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -131,7 +131,10 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then # i386) ARCHBOOTNAME=ia32 ;; # no support for this in i386 kernels, rare machines *) die "Unsupported arch $(uname -m) for UEFI install" esac - BOOTNAME="/EFI/BOOT/BOOT${ARCHBOOTNAME}.EFI" + BOOTDIR="/efi/boot" + BOOTNAME="${BOOTDIR}/boot${ARCHBOOTNAME}.efi" + FREEBSD_BOOTDIR="/efi/freebsd" + FREEBSD_BOOTNAME="${FREEBSD_BOOTDIR}/loader.efi" for esp in $ESPS; do f_dprintf "Formatting /dev/${esp} as FAT32" @@ -148,8 +151,8 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then fi f_dprintf "Installing loader.efi onto ESP" - mkdir -p "$mntpt/EFI/freebsd" - cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi" + mkdir -p "${mntpt}/${FREEBSD_BOOTDIR}" "${mntpt}/${BOOTDIR}" + cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${FREEBSD_BOOTNAME}" # # The following shouldn't be necessary. UEFI defines a way to @@ -173,7 +176,7 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then fi f_dprintf "Creating UEFI boot entry" - efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null f_dprintf "Unmounting ESP" umount "${mntpt}" From owner-dev-commits-src-main@freebsd.org Wed Jan 27 23:35: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 2CF494ED8F0; Wed, 27 Jan 2021 23:35: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 4DR0N40gCxz3mhj; Wed, 27 Jan 2021 23:35: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 08763253F0; Wed, 27 Jan 2021 23:35: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 10RNZlYk049646; Wed, 27 Jan 2021 23:35:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RNZlt2049645; Wed, 27 Jan 2021 23:35:47 GMT (envelope-from git) Date: Wed, 27 Jan 2021 23:35:47 GMT Message-Id: <202101272335.10RNZlt2049645@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: 7b08a307e88b - main - bsdinstall: riscv-specific tweaks 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: 7b08a307e88bb1abe17d13d11288392a8e4739ce 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, 27 Jan 2021 23:35:48 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7b08a307e88bb1abe17d13d11288392a8e4739ce commit 7b08a307e88bb1abe17d13d11288392a8e4739ce Author: Mitchell Horne AuthorDate: 2021-01-15 16:34:54 +0000 Commit: Mitchell Horne CommitDate: 2021-01-27 23:29:42 +0000 bsdinstall: riscv-specific tweaks Make the installer more useful, by allowing it to create a bootable installation. Also, enable the menu option for ZFS-on-root. Like arm64, RISC-V boots by UEFI only, so arm64's partedit implementation is renamed and shared among the two platforms. Reviewed by: gjb MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D28180 --- usr.sbin/bsdinstall/partedit/Makefile | 2 ++ usr.sbin/bsdinstall/partedit/{partedit_arm64.c => partedit_efi.c} | 7 ++++++- usr.sbin/bsdinstall/scripts/auto | 2 +- usr.sbin/bsdinstall/scripts/bootconfig | 3 ++- usr.sbin/bsdinstall/scripts/zfsboot | 4 ++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bsdinstall/partedit/Makefile b/usr.sbin/bsdinstall/partedit/Makefile index 7d8f0659da25..a250302a1962 100644 --- a/usr.sbin/bsdinstall/partedit/Makefile +++ b/usr.sbin/bsdinstall/partedit/Makefile @@ -10,6 +10,8 @@ LIBADD+= geom ncursesw util dialog m PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" PARTEDIT_ARCH= x86 +.elif ${MACHINE} == "arm64" || ${MACHINE} == "riscv" +PARTEDIT_ARCH= efi .endif .if !exists(partedit_${PARTEDIT_ARCH}.c) PARTEDIT_ARCH= generic diff --git a/usr.sbin/bsdinstall/partedit/partedit_arm64.c b/usr.sbin/bsdinstall/partedit/partedit_efi.c similarity index 92% rename from usr.sbin/bsdinstall/partedit/partedit_arm64.c rename to usr.sbin/bsdinstall/partedit/partedit_efi.c index 934cd30c72f9..85b3b15d1853 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_arm64.c +++ b/usr.sbin/bsdinstall/partedit/partedit_efi.c @@ -34,6 +34,11 @@ #include "partedit.h" +/* + * partedit implementation for platforms on which the installer only offers + * UEFI-based boot. Currently, this includes arm64 and RISC-V. + */ + /* EFI partition size in bytes */ #define EFI_BOOTPART_SIZE (260 * 1024 * 1024) @@ -94,7 +99,7 @@ const char * partcode_path(const char *part_type, const char *fs_type) { - /* No boot partition data for ARM64 */ + /* No boot partition data. */ return (NULL); } diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index a58a63f2f70c..58e74acb2d92 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -301,7 +301,7 @@ PMODES=" CURARCH=$( uname -m ) case $CURARCH in - amd64|arm64|i386) # Booting ZFS Supported + amd64|arm64|i386|riscv) # Booting ZFS Supported PMODES=" '$msg_auto_zfs' '$msg_auto_zfs_desc' '$msg_auto_zfs_help' $PMODES diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 1593545a1c2e..f07fb3065c23 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -51,7 +51,7 @@ if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "i386" ]; then X86_BOOTMETHOD=$(sysctl -n machdep.bootmethod) fi -if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then +if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "riscv" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then UFSBOOT_ESPS=$(cat $TMPDIR/bsdinstall-esps 2>/dev/null) ZFSBOOT_DISKS=$(cat $TMPDIR/bsdinstall-zfsboot 2>/dev/null) num_esps=0 @@ -127,6 +127,7 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then case $(uname -m) in arm64) ARCHBOOTNAME=aa64 ;; amd64) ARCHBOOTNAME=x64 ;; + riscv) ARCHBOOTNAME=riscv64 ;; # arm) ARCHBOOTNAME=arm ;; # No other support for arm install # i386) ARCHBOOTNAME=ia32 ;; # no support for this in i386 kernels, rare machines *) die "Unsupported arch $(uname -m) for UEFI install" diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index eef482b806c5..33cec0ef9ae9 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -1554,8 +1554,8 @@ f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # Determine default boot type # case $(uname -m) in -arm64) - # We support only UEFI boot for arm64 +arm64|riscv) + # We support only UEFI boot for arm64 and riscv. : ${ZFSBOOT_BOOT_TYPE:=UEFI} : ${ZFSBOOT_PARTITION_SCHEME:=GPT} ;; From owner-dev-commits-src-main@freebsd.org Thu Jan 28 05:52: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 0B0C54F8853; Thu, 28 Jan 2021 05:52: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 4DR8lG5k1Nz4ddh; Thu, 28 Jan 2021 05:52: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 B6D832649; Thu, 28 Jan 2021 05:52: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 10S5qwWr043514; Thu, 28 Jan 2021 05:52:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10S5qw4N043513; Thu, 28 Jan 2021 05:52:58 GMT (envelope-from git) Date: Thu, 28 Jan 2021 05:52:58 GMT Message-Id: <202101280552.10S5qw4N043513@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: 0e01ea872ee4 - main - Fix a typo. 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: 0e01ea872ee475d7aef11d21588504e2ef4eb32c 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, 28 Jan 2021 05:52:59 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0e01ea872ee475d7aef11d21588504e2ef4eb32c commit 0e01ea872ee475d7aef11d21588504e2ef4eb32c Author: Cy Schubert AuthorDate: 2021-01-28 05:52:08 +0000 Commit: Cy Schubert CommitDate: 2021-01-28 05:52:41 +0000 Fix a typo. MFC after: 3 days --- sys/i386/conf/GENERIC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 9ce338f5a181..7d4f195ba28a 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -337,7 +337,7 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# HyperV drivers and enchancement support +# HyperV drivers and enhancement support device hyperv # HyperV drivers # Xen HVM Guest Optimizations From owner-dev-commits-src-main@freebsd.org Thu Jan 28 07:50: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 260144FB6D7; Thu, 28 Jan 2021 07:50:26 +0000 (UTC) (envelope-from dim@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 4DRCLp0ShDz4l3J; Thu, 28 Jan 2021 07:50:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id DC0D42E585; Thu, 28 Jan 2021 07:50:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BF12B5580E; Thu, 28 Jan 2021 08:50:23 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_8111A1CC-7112-4206-951D-1A86CB64A0F0"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: git: 6e26189be406 - main - Fix loader detection of vbefb support on !amd64 Date: Thu, 28 Jan 2021 08:50:16 +0100 In-Reply-To: <3973a397-1250-1230-fecc-956b84c74fc9@FreeBSD.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: John Baldwin References: <202101272129.10RLTAee080408@gitrepo.freebsd.org> <3973a397-1250-1230-fecc-956b84c74fc9@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.17) 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, 28 Jan 2021 07:50:26 -0000 --Apple-Mail=_8111A1CC-7112-4206-951D-1A86CB64A0F0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 28 Jan 2021, at 00:08, John Baldwin wrote: >=20 > On 1/27/21 1:29 PM, Dimitry Andric wrote: >> The branch main has been updated by dim: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6e26189be406a9a3799074b16925e6cd= 63cc703b >> commit 6e26189be406a9a3799074b16925e6cd63cc703b >> Author: Dimitry Andric >> AuthorDate: 2021-01-27 21:28:43 +0000 >> Commit: Dimitry Andric >> CommitDate: 2021-01-27 21:28:43 +0000 >> Fix loader detection of vbefb support on !amd64 >> On i386, after 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd, the = vbefb vt >> driver was no longer detected by the loader, if any kernel module = was >> loaded after the kernel itself. >> This was caused by the parse_vt_drv_set() function being = called multiple >> times, resetting the detection flag. (It was called multiple = times, >> becuase i386 .ko files are shared objects like the kernel proper, = while >> this is not the case on amd64.) >> Fix this by skipping the set_vt_drv_set lookup if vbefb was = already >> detected. >> Reviewed by: tsoome >=20 > Does the state get reset if you unload one kernel and then load a = different > one (e.g. via interactive 'unload' and 'load /path/to/my/kernel')? Ha, good one! I don't think it is. -Dimitry --Apple-Mail=_8111A1CC-7112-4206-951D-1A86CB64A0F0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYBJsuAAKCRCwXqMKLiCW o993AJ0f6St0I69LSbg5bxurOkKtbulmOACgsAn5QTLI+4tbsDK/siplzMup1m0= =24sf -----END PGP SIGNATURE----- --Apple-Mail=_8111A1CC-7112-4206-951D-1A86CB64A0F0-- From owner-dev-commits-src-main@freebsd.org Thu Jan 28 07:51: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 28DC24FB839 for ; Thu, 28 Jan 2021 07:51:37 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-tydg10021701.me.com (pv50p00im-tydg10021701.me.com [17.58.6.54]) (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 4DRCN871xdz4lCc for ; Thu, 28 Jan 2021 07:51:36 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-tydg10021701.me.com (Postfix) with ESMTPSA id 88B0C840170; Thu, 28 Jan 2021 07:51:34 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: git: 6e26189be406 - main - Fix loader detection of vbefb support on !amd64 From: Toomas Soome In-Reply-To: Date: Thu, 28 Jan 2021 09:51:32 +0200 Cc: John Baldwin , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <2EA230CF-B642-456F-ACDA-150C016DAAAE@me.com> References: <202101272129.10RLTAee080408@gitrepo.freebsd.org> <3973a397-1250-1230-fecc-956b84c74fc9@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2021-01-28_02:2021-01-27, 2021-01-28 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2101280038 X-Rspamd-Queue-Id: 4DRCN871xdz4lCc 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: Thu, 28 Jan 2021 07:51:37 -0000 > On 28. Jan 2021, at 09:50, Dimitry Andric wrote: >=20 > On 28 Jan 2021, at 00:08, John Baldwin wrote: >>=20 >> On 1/27/21 1:29 PM, Dimitry Andric wrote: >>> The branch main has been updated by dim: >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6e26189be406a9a3799074b16925e6cd= 63cc703b >>> commit 6e26189be406a9a3799074b16925e6cd63cc703b >>> Author: Dimitry Andric >>> AuthorDate: 2021-01-27 21:28:43 +0000 >>> Commit: Dimitry Andric >>> CommitDate: 2021-01-27 21:28:43 +0000 >>> Fix loader detection of vbefb support on !amd64 >>> On i386, after 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd, the = vbefb vt >>> driver was no longer detected by the loader, if any kernel module = was >>> loaded after the kernel itself. >>> This was caused by the parse_vt_drv_set() function being = called multiple >>> times, resetting the detection flag. (It was called multiple = times, >>> becuase i386 .ko files are shared objects like the kernel proper, = while >>> this is not the case on amd64.) >>> Fix this by skipping the set_vt_drv_set lookup if vbefb was = already >>> detected. >>> Reviewed by: tsoome >>=20 >> Does the state get reset if you unload one kernel and then load a = different >> one (e.g. via interactive 'unload' and 'load /path/to/my/kernel')? >=20 > Ha, good one! I don't think it is. >=20 > -Dimitry >=20 I=E2=80=99m about to push it:) yes, it was missed. thanks, toomas= From owner-dev-commits-src-main@freebsd.org Thu Jan 28 07:52: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 91C644FBA94; Thu, 28 Jan 2021 07:52: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 4DRCPb3Sxxz4lMv; Thu, 28 Jan 2021 07:52: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 6A1734147; Thu, 28 Jan 2021 07:52: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 10S7qpg1098988; Thu, 28 Jan 2021 07:52:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10S7qpg9098987; Thu, 28 Jan 2021 07:52:51 GMT (envelope-from git) Date: Thu, 28 Jan 2021 07:52:51 GMT Message-Id: <202101280752.10S7qpg9098987@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: 9b388ac30375 - main - loader: unload command should reset tg_kernel_supported in gfx_state 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: 9b388ac30375ad4e0259b264a006753edcb2bd3c 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, 28 Jan 2021 07:52:51 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=9b388ac30375ad4e0259b264a006753edcb2bd3c commit 9b388ac30375ad4e0259b264a006753edcb2bd3c Author: Toomas Soome AuthorDate: 2021-01-28 07:45:47 +0000 Commit: Toomas Soome CommitDate: 2021-01-28 07:52:20 +0000 loader: unload command should reset tg_kernel_supported in gfx_state While loading kernel, we check if vt/vbe backend support is included in kernel and set the tg_kernel_supported flag in gfx_state. unload command needs to reset this flag to allow next load to perform this check with new kernel. Reported by: jhb --- stand/common/module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/common/module.c b/stand/common/module.c index 247fc54b6021..34ffc10cded3 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -271,6 +271,8 @@ unload(void) } loadaddr = 0; unsetenv("kernelname"); + /* Reset tg_kernel_supported to allow next load to check it again. */ + gfx_state.tg_kernel_supported = false; } COMMAND_SET(unload, "unload", "unload all modules", command_unload); From owner-dev-commits-src-main@freebsd.org Thu Jan 28 08:20: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 2DF314FC9C2; Thu, 28 Jan 2021 08:20: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 4DRD1B0mvRz4n3t; Thu, 28 Jan 2021 08:20: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 0D6A94629; Thu, 28 Jan 2021 08:20: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 10S8KEM3030518; Thu, 28 Jan 2021 08:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10S8KD83030492; Thu, 28 Jan 2021 08:20:13 GMT (envelope-from git) Date: Thu, 28 Jan 2021 08:20:13 GMT Message-Id: <202101280820.10S8KD83030492@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: f59810e34bae - main - pci_vendors: update to 2021.01.11 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: f59810e34bae867059163cb9f651e074043fcec8 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, 28 Jan 2021 08:20:14 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f59810e34bae867059163cb9f651e074043fcec8 commit f59810e34bae867059163cb9f651e074043fcec8 Author: Baptiste Daroussin AuthorDate: 2021-01-28 08:19:50 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-28 08:20:09 +0000 pci_vendors: update to 2021.01.11 --- share/misc/pci_vendors | 104 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 25 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index 61b9069d9ca7..c5b923d463af 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2020.12.26 -# Date: 2020-12-26 03:15:02 +# Version: 2021.01.11 +# Date: 2021-01-11 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -953,6 +953,7 @@ 1478 Navi 10 XL Upstream Port of PCI Express Switch 1479 Navi 10 XL Downstream Port of PCI Express Switch 154c Kryptos [Radeon RX 350] + 1462 7c28 MS-7C28 Motherboard 154e Garfield 1551 Arlene 1552 Pooky @@ -963,7 +964,7 @@ ea50 cc10 RXi2-BP 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 103c 83c6 Radeon Vega 8 Mobile - 1043 876b PRIME B450M-A Motherboard + 1043 876b PRIME Motherboard 1458 d000 Radeon RX Vega 11 ea50 cc10 RXi2-BP 15de Raven/Raven2/Fenghuang HDMI/DP Audio Controller @@ -977,6 +978,9 @@ 15ff Fenghuang [Zhongshan Subor Z+] 1607 Arden 1636 Renoir + 1638 Cezanne + 163f VanGogh + 164c Lucienne 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 103c 168b ProBook 4535s 3150 RV380/M24 [Mobility Radeon X600] @@ -1766,7 +1770,7 @@ 5964 RV280 [Radeon 9200 SE] 1002 5964 Radeon 9200 SE, 64-bit 128MB DDR, 200/166MHz 1043 c006 Radeon 9200 SE / TD / 128M - 1458 4018 Radeon 9200 SE + 1458 4018 R92S128T (Radeon 9200 SE 128MB) 1458 4032 Radeon 9200 SE 128MB 147b 6191 R9200SE-DT 148c 2073 CN-AG92E @@ -1855,7 +1859,7 @@ 1002 5c63 Apple iBook G4 2004 144d c00c P30 notebook 5d44 RV280 [Radeon 9200 SE] (Secondary) - 1458 4019 Radeon 9200 SE (Secondary) + 1458 4019 R92S128T (Radeon 9200 SE 128MB Secondary) 1458 4032 Radeon 9200 SE 128MB 147b 6190 R9200SE-DT (Secondary) 174b 7c12 Radeon 9200 SE (Secondary) @@ -1994,9 +1998,9 @@ 6667 Jet ULT [Radeon R5 M230] 666f Sun LE [Radeon HD 8550M / R5 M230] 66a0 Vega 20 [Radeon Instinct] - 66a1 Vega 20 + 66a1 Vega 20 WKS GL-XE [Radeon Pro VII] 66a2 Vega 20 - 66a3 Vega 20 + 66a3 Vega 20 [Radeon Pro Vega II/Radeon Pro Vega II Duo] 66a7 Vega 20 [Radeon Pro Vega 20] 66af Vega 20 [Radeon VII] 6704 Cayman PRO GL [FirePro V7900] @@ -2623,6 +2627,7 @@ 1462 3418 Radeon RX 580 Armor 4G OC 1462 341b Radeon RX 570 Armor 8G OC 1462 341e Radeon RX 570 Armor 4G OC + 1462 809e Radeon RX 480 4GB 1462 8a92 Radeon RX 580 148c 2372 Radeon RX 480 [Red Dragon] 148c 2373 Radeon RX 470 @@ -2904,7 +2909,12 @@ 6864 Vega 10 [Radeon Pro V340] 6867 Vega 10 XL [Radeon Pro Vega 56] 6868 Vega 10 [Radeon PRO WX 8100/8200] + 6869 Vega 10 XGA [Radeon Pro Vega 48] + 686a Vega 10 LEA + 686b Vega 10 XTXA [Radeon Pro Vega 64X] 686c Vega 10 [Radeon Instinct MI25 MxGPU] + 686d Vega 10 GLXTA + 686e Vega 10 GLXLA 687f Vega 10 XL/XT [Radeon RX Vega 56/64] 1002 0b36 RX Vega64 1002 6b76 RX Vega64 @@ -3155,6 +3165,7 @@ 17af 3000 Radeon HD 6510 17af 3010 Radeon HD 5630 68da Redwood LE [Radeon HD 5550/5570/5630/6390/6490/7570] + 1462 8071 VR5550-MD1G (Radeon HD 5550) 148c 3000 Radeon HD 6390 148c 3001 Radeon HD 6490 1545 7570 Radeon HD 7570 @@ -3602,6 +3613,9 @@ 7347 Navi 14 [Radeon Pro W5500M] 734f Navi 14 [Radeon Pro W5300M] 7360 Navi 12 [Radeon Pro 5600M] + 7388 Arcturus GL-XL + 738c Arcturus GL-XL [AMD Instinct MI100] + 738e Arcturus GL-XL 73bf Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] 73c3 Navi 22 73df Navi 22 @@ -4677,6 +4691,7 @@ 149b Starship Reserved SSP 149c Matisse USB 3.0 Host Controller 1462 7c37 X570-A PRO motherboard + 149d Vangogh CVIP 1510 Family 14h Processor Root Complex 174b 1001 PURE Fusion Mini 1512 Family 14h Processor Root Port @@ -4776,17 +4791,17 @@ 15dc Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B 15de Raven/Raven2/FireFlight HD Audio Controller 15df Family 17h (Models 10h-1fh) Platform Security Processor - 1043 876b PRIME B450M-A Motherboard + 1043 876b PRIME Motherboard 17aa 5124 ThinkPad E595 ea50 ce19 mCOM10-L1900 15e0 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx - 1043 876b PRIME B450M-A Motherboard + 1043 876b PRIME Motherboard 17aa 5124 ThinkPad E595 ea50 ce19 mCOM10-L1900 15e1 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx - 1043 876b PRIME B450M-A Motherboard + 1043 876b PRIME Motherboard 17aa 5124 ThinkPad E595 ea50 ce19 mCOM10-L1900 15e2 Raven/Raven2/FireFlight/Renoir Audio Processor @@ -4862,6 +4877,8 @@ 1642 Renoir WLAN 1643 Renoir BT 1644 Renoir I2S + 1648 VanGogh Root Complex + 1649 VanGogh PSP/CCP 1700 Family 12h/14h Processor Function 0 1701 Family 12h/14h Processor Function 1 1702 Family 12h/14h Processor Function 2 @@ -5060,7 +5077,7 @@ 7900 FCH SATA Controller [IDE mode] 7901 FCH SATA Controller [AHCI mode] 103c 8615 Pavilion Laptop 15-cw1xxx - 1043 876b PRIME B450M-A Motherboard + 1043 876b PRIME Motherboard 1462 7c37 X570-A PRO motherboard ea50 ce19 mCOM10-L1900 7902 FCH SATA Controller [RAID mode] @@ -5070,7 +5087,7 @@ 7908 FCH USB EHCI Controller 790b FCH SMBus Controller 103c 8615 Pavilion Laptop 15-cw1xxx - 1043 876b PRIME B450M-A Motherboard + 1043 876b PRIME Motherboard 1462 7c37 X570-A PRO motherboard 17aa 5124 ThinkPad E595 ea50 ce19 mCOM10-L1900 @@ -5664,6 +5681,7 @@ 1931 000a GlobeTrotter Fusion Quad Lite (PPP data) 1931 000b GlobeTrotter Fusion Quad Lite (GSM data) 807d 0035 PCI-USB2 (OHCI subsystem) + 8086 4d44 D850EMV2 motherboard 003b PCI to C-bus Bridge 003e NAPCCARD Cardbus Controller 0046 PowerVR PCX2 [midas] @@ -5694,6 +5712,7 @@ 14c2 0205 PTI-205N USB 2.0 Host Controller 1799 0002 Root Hub 807d 1043 PCI-USB2 (EHCI subsystem) + 8086 4d44 D850EMV2 motherboard 00e7 uPD72873 [Firewarden] IEEE1394a OHCI 1.1 Link/2-port PHY Controller 00f2 uPD72874 [Firewarden] IEEE1394a OHCI 1.1 Link/3-port PHY Controller 00f3 uPD6113x Multimedia Decoder/Processor [EMMA2] @@ -11911,6 +11930,7 @@ 1aeb TU116 High Definition Audio Controller 1aec TU116 USB 3.1 Host Controller 1aed TU116 USB Type-C UCSI Controller + 1aef GA102 High Definition Audio Controller 1b00 GP102 [TITAN X] 1b01 GP102 [GeForce GTX 1080 Ti 10GB] 1b02 GP102 [TITAN Xp] @@ -12142,6 +12162,7 @@ 2192 TU116M [GeForce GTX 1650 Ti Mobile] 21ae TU116GL 21bf TU116GL + 21c2 TU116 21c4 TU116 [GeForce GTX 1660 SUPER] 21d1 TU116BM [GeForce GTX 1660 Ti Mobile] 2204 GA102 [GeForce RTX 3090] @@ -12164,9 +12185,11 @@ 2486 GA104 [GeForce RTX 3060 Ti] 249c GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] 249d GA104M [GeForce RTX 3070 Mobile / Max-Q] + 249f GA104M 24ac GA104 [GeForce RTX 30x0 Engineering Sample] 24ad GA104 [GeForce RTX 3060 Engineering Sample] 24af GA104 [GeForce RTX 3070 Engineering Sample] + 24b6 GA104 24bf GA104 [GeForce RTX 3070 Engineering Sample] 24dc GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] 24dd GA104M [GeForce RTX 3070 Mobile / Max-Q] @@ -12558,7 +12581,7 @@ ea50 ce19 mCOM10-L1900 816c RTL8111xP IPMI interface ea50 ce19 mCOM10-L1900 - 816d RTL8111xP EHCI host controller + 816d RTL811x EHCI host controller ea50 ce19 mCOM10-L1900 8171 RTL8191SEvA Wireless LAN Controller 8172 RTL8191SEvB Wireless LAN Controller @@ -12622,6 +12645,7 @@ 5005 Alveo U250 7038 FPGA Card XC7VX690T 17aa 402f FPGA XC7VX690T-3FFG1157E + 8019 Memory controller 8380 Ellips ProfiXpress Profibus Master 8381 Ellips Santos Frame Grabber d154 Copley Controls CAN card (PCI-CAN-02) @@ -16254,6 +16278,7 @@ 8888 IT8888F/G PCI to ISA Bridge with SMB [Golden Gate] 8889 IT8889F PCI to ISA Bridge 8892 IT8892E PCIe to PCI Bridge + 8086 200d DH61CR motherboard 8893 IT8893E PCIe to PCI Bridge e886 IT8330G 1284 Sahara Networks, Inc. @@ -19167,6 +19192,7 @@ 1805 BCM57508 NetXtreme-E RDMA Partition 1806 BCM5750X NetXtreme-E Ethernet Virtual Function 1807 BCM5750X NetXtreme-E RDMA Virtual Function + 2711 BCM2711 PCIe Bridge 3352 BCM3352 3360 BCM3360 4210 BCM4210 iLine10 HomePNA 2.0 @@ -21361,6 +21387,7 @@ 0400 Datacenter Technologies QDF2432 PCI Express Root Port 0401 Datacenter Technologies QDF2400 PCI Express Root Port 1000 QCS405 PCIe Root Complex + 1101 QCA6390 Wireless Network Adapter [AX500-DBS (2x2)] 17cc NetChip Technology, Inc 2280 USB 2.0 17cd Cadence Design Systems, Inc. @@ -22816,8 +22843,9 @@ 9192 88SE9172 SATA III 6Gb/s RAID Controller 91a0 88SE912x SATA 6Gb/s Controller [IDE mode] 91a4 88SE912x IDE Controller + 9215 88SE9215 PCIe 2.0 x1 4-port SATA 6 Gb/s Controller 9220 88SE9220 PCIe 2.0 x2 2-port SATA 6 Gb/s RAID Controller - 9230 88SE9230 PCIe SATA 6Gb/s Controller + 9230 88SE9230 PCIe 2.0 x2 4-port SATA 6 Gb/s RAID Controller 1028 1fd6 BOSS-S1 Adapter 1028 1fdf BOSS-S1 Modular 1028 1fe2 BOSS-S1 Adapter @@ -23060,10 +23088,9 @@ 2839 PE8000 Series NVMe Solid State Drive 1c5c 0100 PE8000 Series NVMe Solid State Drive 1c5f Beijing Memblaze Technology Co. Ltd. - 000d PBlaze5 520/526 AIC - 003d PBlaze5 920/926 AIC - 010d PBlaze5 520/526 U.2 - 013d PBlaze5 920/926 U.2 + 000d PBlaze5 520/526 + 003d PBlaze5 920/926 + 003e PBlaze6 6920 0540 PBlaze4 NVMe SSD 0550 PBlaze5 700/900 0555 PBlaze5 510/516 @@ -23509,6 +23536,7 @@ 0002 T11 [CloudBlazer] 0003 T10s [CloudBlazer] 8011 I10 [CloudBlazer] + 8012 I10L [CloudBlazer] # nee Thinci, Inc 1e38 Blaize, Inc 0102 Xplorer X1600 @@ -23549,7 +23577,7 @@ 1601 NVMe SSD Controller MAP1601 1e4c GSI Technology # Associative Processing Unit (APU) - 0010 APU [Leda-G] + 0010 APU [Leda] 1e4c 0120 SE120 1e57 Beijing Panyi Technology Co., Ltd 0100 The device has already been deleted. @@ -24408,6 +24436,7 @@ 0100 2nd Generation Core Processor Family DRAM Controller 1028 04aa XPS 8300 1043 844d P8P67/P8H67 Series Motherboard + 8086 200d DH61CR motherboard 0101 Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port 1028 04b2 Vostro 3350 106b 00dc MacBookPro8,2 [Core i7, 15", 2011] @@ -24487,6 +24516,7 @@ 1043 844d P8B WS Motherboard 0172 Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller 0176 3rd Gen Core processor Graphics Controller + 0201 Arctic Sound 0284 Comet Lake PCH-LP LPC Premium Controller/eSPI Controller 02a3 Comet Lake PCH-LP SMBus Host Controller 02a4 Comet Lake SPI (flash) Controller @@ -26147,6 +26177,7 @@ 1503 82579V Gigabit Network Connection 1043 849c P8P67 Deluxe Motherboard 10cf 161c LIFEBOOK E752 + 8086 200d DH61CR motherboard 1507 Ethernet Express Module X520-P2 1508 82598EB Gigabit BX Network Connection 1509 82580 Gigabit Network Connection @@ -26704,7 +26735,7 @@ 18a0 C4xxx Series QAT 18a1 C4XXX Series QAT Virtual Function 1900 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers - 1901 6th-9th Gen Core Processor PCIe Controller (x16) + 1901 6th-10th Gen Core Processor PCIe Controller (x16) 1902 HD Graphics 510 1903 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem 1028 06d6 Latitude 7275 tablet @@ -26717,6 +26748,7 @@ 1028 06dc Latitude E7470 1028 06f3 Latitude 3570 103c 8079 EliteBook 840 G3 + 17aa 2247 ThinkPad T570 17aa 382a B51-80 Laptop 1905 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x8) 1906 HD Graphics 510 @@ -26862,6 +26894,7 @@ 1c02 6 Series/C200 Series Chipset Family 6 port Desktop SATA AHCI Controller 1028 04aa XPS 8300 1043 844d P8 series motherboard + 8086 200d DH61CR motherboard 8086 7270 Server Board S1200BT Family 1c03 6 Series/C200 Series Chipset Family 6 port Mobile SATA AHCI Controller 1028 04a3 Precision M4600 @@ -26912,6 +26945,7 @@ 17aa 21cf ThinkPad T520 # Realtek ALC888 audio codec 8086 2008 DQ67SW board + 8086 200d DH61CR motherboard 8086 7270 Apple MacBookPro8,2 [Core i7, 15", 2011] 1c22 6 Series/C200 Series Chipset Family SMBus Controller 1028 04a3 Precision M4600 @@ -26920,6 +26954,7 @@ 1028 04da Vostro 3750 1043 844d P8 series motherboard 17aa 21cf ThinkPad T520 + 8086 200d DH61CR motherboard 8086 7270 Server Board S1200BT Family / Apple MacBook Pro 8,1/8,2 1c24 6 Series/C200 Series Chipset Family Thermal Management Controller 1c25 6 Series/C200 Series Chipset Family DMI to PCI Bridge @@ -26930,6 +26965,7 @@ 1028 04da Vostro 3750 1043 844d P8 series motherboard 17aa 21cf ThinkPad T520 + 8086 200d DH61CR motherboard 8086 7270 Server Board S1200BT Family / Apple MacBook Pro 8,1/8,2 1c27 6 Series/C200 Series Chipset Family USB Universal Host Controller #1 8086 7270 Apple MacBookPro8,2 [Core i7, 15", 2011] @@ -26942,6 +26978,7 @@ 1028 04da Vostro 3750 1043 844d P8 series motherboard 17aa 21cf ThinkPad T520 + 8086 200d DH61CR motherboard 8086 7270 Server Board S1200BT Family / Apple MacBook Pro 8,1/8,2 1c33 6 Series/C200 Series Chipset Family LAN Controller 1c35 6 Series/C200 Series Chipset Family VECI Controller @@ -26952,6 +26989,7 @@ 1028 04da Vostro 3750 1043 844d P8 series motherboard 17aa 21cf ThinkPad T520 + 8086 200d DH61CR motherboard 8086 7270 Apple MacBookPro8,2 [Core i7, 15", 2011] 1c3b 6 Series/C200 Series Chipset Family MEI Controller #2 1c3c 6 Series/C200 Series Chipset Family IDE-r Controller @@ -26995,6 +27033,7 @@ 1c5a Upgraded Q67 Express Chipset LPC Controller 1c5b 6 Series/C200 Series Chipset Family LPC Controller 1c5c H61 Express Chipset LPC Controller + 8086 200d DH61CR motherboard 1c5d 6 Series/C200 Series Chipset Family LPC Controller 1c5e 6 Series/C200 Series Chipset Family LPC Controller 1c5f 6 Series/C200 Series Chipset Family LPC Controller @@ -27458,6 +27497,7 @@ 147b 0507 TH7II-RAID 8086 4532 Desktop Board D815EEA2/D815EFV 8086 4557 D815EGEW Mainboard + 8086 4d44 D850EMV2 motherboard 8086 5744 S845WD1-E mainboard 2443 82801BA/BAM SMBus Controller 1014 01c6 Netvista A40/A40p @@ -27499,6 +27539,7 @@ 147b 0507 TH7II-RAID 8086 4557 D815EGEW Mainboard 8086 4656 Desktop Board D815EFV + 8086 4d44 D850EMV2 motherboard 2446 82801BA/BAM AC'97 Modem Controller 1025 1016 Travelmate 612 TX 104d 80df Vaio PCG-FX403 @@ -27573,6 +27614,7 @@ 15d9 3280 Supermicro P4SBE Mainboard 8086 4532 Desktop Board D815EEA2/D815EFV 8086 4557 D815EGEW Mainboard + 8086 4d44 D850EMV2 motherboard 8086 5744 S845WD1-E mainboard 244c 82801BAM ISA Bridge (LPC) 244e 82801 PCI Bridge @@ -30817,7 +30859,8 @@ 3e81 8th Gen Core Processor PCIe Controller (x16) 3e85 8th Gen Core Processor PCIe Controller (x8) 3e89 8th Gen Core Processor PCIe Controller (x4) - 3e91 8th Gen Core Processor Gaussian Mixture Model + 3e90 UHD Graphics 610 + 3e91 UHD Graphics 630 3e92 UHD Graphics 630 (Desktop) 1028 0869 Vostro 3470 3e93 UHD Graphics 610 @@ -30966,7 +31009,16 @@ 8086 1316 WiMAX/WiFi Link 5150 ABG 444e Turbo Memory Controller 467f Volume Management Device NVMe RAID Controller + 4680 AlderLake-S GT1 + 46a0 AlderLake-P GT2 + 4905 DG1 [Iris Xe MAX Graphics] + 4906 DG1 [Iris Xe Pod] + 4907 SG1 [Server GPU SG-18M] + 4908 DG1 [Iris Xe Graphics] 4c3d Volume Management Device NVMe RAID Controller + 4f80 DG2 + 4f81 DG2 + 4f82 DG2 5001 LE80578 5002 LE80578 Graphics Processor Unit 5009 LE80578 Video Display Controller @@ -31714,15 +31766,17 @@ 9a2f Tiger Lake-H Thunderbolt 4 PCI Express Root Port #2 9a31 Tiger Lake-H Thunderbolt 4 PCI Express Root Port #3 9a33 Tiger Lake Trace Hub - 9a49 Iris Xe Graphics - 9b41 UHD Graphics + 9a49 TigerLake GT2 [Iris Xe Graphics] + 9b41 CometLake-U GT2 [UHD Graphics] 9b44 10th Gen Core Processor Host Bridge/DRAM Registers 9b53 Comet Lake-S 6c Host Bridge/DRAM Controller 9b54 10th Gen Core Processor Host Bridge/DRAM Registers 9b61 Comet Lake-U v1 4c Host Bridge/DRAM Controller + 9b63 10th Gen Core Processor Host Bridge/DRAM Registers 9b64 10th Gen Core Processor Host Bridge/DRAM Registers - 9bc4 UHD Graphics - 9bc8 UHD Graphics 630 + 9bc4 CometLake-H GT2 [UHD Graphics] + 9bc5 CometLake-S GT2 [UHD Graphics 630] + 9bc8 CometLake-S GT2 [UHD Graphics 630] 9c00 8 Series SATA Controller 1 [IDE mode] 9c01 8 Series SATA Controller 1 [IDE mode] 9c02 8 Series SATA Controller 1 [AHCI mode] From owner-dev-commits-src-main@freebsd.org Thu Jan 28 10:40:57 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 EF0CC4FFF2C; Thu, 28 Jan 2021 10:40:57 +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 4DRH7Y6Vc9z4vWw; Thu, 28 Jan 2021 10:40: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 D210F612E; Thu, 28 Jan 2021 10:40: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 10SAevm9018309; Thu, 28 Jan 2021 10:40:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SAev8e018308; Thu, 28 Jan 2021 10:40:57 GMT (envelope-from git) Date: Thu, 28 Jan 2021 10:40:57 GMT Message-Id: <202101281040.10SAev8e018308@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: e09c8c9ad90d - main - Remove leftover big-endian arm support 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: e09c8c9ad90dabe0d627c979e27e4ca3c234d3ab 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, 28 Jan 2021 10:40:58 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e09c8c9ad90dabe0d627c979e27e4ca3c234d3ab commit e09c8c9ad90dabe0d627c979e27e4ca3c234d3ab Author: Andrew Turner AuthorDate: 2021-01-28 10:33:40 +0000 Commit: Andrew Turner CommitDate: 2021-01-28 10:33:40 +0000 Remove leftover big-endian arm support Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28312 --- lib/libc/arm/arith.h | 5 - lib/libc/arm/string/memcpy_arm.S | 66 ------ lib/libc/arm/string/memcpy_xscale.S | 413 ------------------------------------ lib/libc/arm/string/memmove.S | 132 ------------ lib/libc/arm/string/strlen.S | 16 -- 5 files changed, 632 deletions(-) diff --git a/lib/libc/arm/arith.h b/lib/libc/arm/arith.h index 5e2e3891dd91..86121bf9a80c 100644 --- a/lib/libc/arm/arith.h +++ b/lib/libc/arm/arith.h @@ -11,11 +11,6 @@ * architecture. See contrib/gdtoa/gdtoaimp.h for details. */ -#if !defined(__ARMEB__) && (defined(__VFP_FP__) || defined(__ARM_EABI__)) #define IEEE_8087 #define Arith_Kind_ASL 1 #define Sudden_Underflow -#else -#define IEEE_MC68k -#define Arith_Kind_ASL 2 -#endif diff --git a/lib/libc/arm/string/memcpy_arm.S b/lib/libc/arm/string/memcpy_arm.S index 57b0449e5099..050ea8fb315f 100644 --- a/lib/libc/arm/string/memcpy_arm.S +++ b/lib/libc/arm/string/memcpy_arm.S @@ -170,21 +170,8 @@ ENTRY(memcpy) stmdb sp!, {r4, r5} .Lmemcpy_srcul1loop16: -#ifdef __ARMEB__ - mov r3, lr, lsl #8 -#else mov r3, lr, lsr #8 -#endif ldmia r1!, {r4, r5, r12, lr} -#ifdef __ARMEB__ - orr r3, r3, r4, lsr #24 - mov r4, r4, lsl #8 - orr r4, r4, r5, lsr #24 - mov r5, r5, lsl #8 - orr r5, r5, r12, lsr #24 - mov r12, r12, lsl #8 - orr r12, r12, lr, lsr #24 -#else orr r3, r3, r4, lsl #24 mov r4, r4, lsr #8 orr r4, r4, r5, lsl #24 @@ -192,7 +179,6 @@ ENTRY(memcpy) orr r5, r5, r12, lsl #24 mov r12, r12, lsr #8 orr r12, r12, lr, lsl #24 -#endif stmia r0!, {r3-r5, r12} subs r2, r2, #0x10 bge .Lmemcpy_srcul1loop16 @@ -201,17 +187,9 @@ ENTRY(memcpy) blt .Lmemcpy_srcul1l4 .Lmemcpy_srcul1loop4: -#ifdef __ARMEB__ - mov r12, lr, lsl #8 -#else mov r12, lr, lsr #8 -#endif ldr lr, [r1], #4 -#ifdef __ARMEB__ - orr r12, r12, lr, lsr #24 -#else orr r12, r12, lr, lsl #24 -#endif str r12, [r0], #4 subs r2, r2, #4 bge .Lmemcpy_srcul1loop4 @@ -227,21 +205,8 @@ ENTRY(memcpy) stmdb sp!, {r4, r5} .Lmemcpy_srcul2loop16: -#ifdef __ARMEB__ - mov r3, lr, lsl #16 -#else mov r3, lr, lsr #16 -#endif ldmia r1!, {r4, r5, r12, lr} -#ifdef __ARMEB__ - orr r3, r3, r4, lsr #16 - mov r4, r4, lsl #16 - orr r4, r4, r5, lsr #16 - mov r5, r5, lsl #16 - orr r5, r5, r12, lsr #16 - mov r12, r12, lsl #16 - orr r12, r12, lr, lsr #16 -#else orr r3, r3, r4, lsl #16 mov r4, r4, lsr #16 orr r4, r4, r5, lsl #16 @@ -249,7 +214,6 @@ ENTRY(memcpy) orr r5, r5, r12, lsl #16 mov r12, r12, lsr #16 orr r12, r12, lr, lsl #16 -#endif stmia r0!, {r3-r5, r12} subs r2, r2, #0x10 bge .Lmemcpy_srcul2loop16 @@ -258,17 +222,9 @@ ENTRY(memcpy) blt .Lmemcpy_srcul2l4 .Lmemcpy_srcul2loop4: -#ifdef __ARMEB__ - mov r12, lr, lsl #16 -#else mov r12, lr, lsr #16 -#endif ldr lr, [r1], #4 -#ifdef __ARMEB__ - orr r12, r12, lr, lsr #16 -#else orr r12, r12, lr, lsl #16 -#endif str r12, [r0], #4 subs r2, r2, #4 bge .Lmemcpy_srcul2loop4 @@ -284,21 +240,8 @@ ENTRY(memcpy) stmdb sp!, {r4, r5} .Lmemcpy_srcul3loop16: -#ifdef __ARMEB__ - mov r3, lr, lsl #24 -#else mov r3, lr, lsr #24 -#endif ldmia r1!, {r4, r5, r12, lr} -#ifdef __ARMEB__ - orr r3, r3, r4, lsr #8 - mov r4, r4, lsl #24 - orr r4, r4, r5, lsr #8 - mov r5, r5, lsl #24 - orr r5, r5, r12, lsr #8 - mov r12, r12, lsl #24 - orr r12, r12, lr, lsr #8 -#else orr r3, r3, r4, lsl #8 mov r4, r4, lsr #24 orr r4, r4, r5, lsl #8 @@ -306,7 +249,6 @@ ENTRY(memcpy) orr r5, r5, r12, lsl #8 mov r12, r12, lsr #24 orr r12, r12, lr, lsl #8 -#endif stmia r0!, {r3-r5, r12} subs r2, r2, #0x10 bge .Lmemcpy_srcul3loop16 @@ -315,17 +257,9 @@ ENTRY(memcpy) blt .Lmemcpy_srcul3l4 .Lmemcpy_srcul3loop4: -#ifdef __ARMEB__ - mov r12, lr, lsl #24 -#else mov r12, lr, lsr #24 -#endif ldr lr, [r1], #4 -#ifdef __ARMEB__ - orr r12, r12, lr, lsr #8 -#else orr r12, r12, lr, lsl #8 -#endif str r12, [r0], #4 subs r2, r2, #4 bge .Lmemcpy_srcul3loop4 diff --git a/lib/libc/arm/string/memcpy_xscale.S b/lib/libc/arm/string/memcpy_xscale.S index ab01544fc176..63390edeaa95 100644 --- a/lib/libc/arm/string/memcpy_xscale.S +++ b/lib/libc/arm/string/memcpy_xscale.S @@ -219,25 +219,12 @@ ENTRY(memcpy) b .Lmemcpy_bad1 .Lmemcpy_bad1_loop16: -#ifdef __ARMEB__ - mov r4, ip, lsl #8 -#else mov r4, ip, lsr #8 -#endif ldr r5, [r1], #0x04 pld [r1, #0x018] ldr r6, [r1], #0x04 ldr r7, [r1], #0x04 ldr ip, [r1], #0x04 -#ifdef __ARMEB__ - orr r4, r4, r5, lsr #24 - mov r5, r5, lsl #8 - orr r5, r5, r6, lsr #24 - mov r6, r6, lsl #8 - orr r6, r6, r7, lsr #24 - mov r7, r7, lsl #8 - orr r7, r7, ip, lsr #24 -#else orr r4, r4, r5, lsl #24 mov r5, r5, lsr #8 orr r5, r5, r6, lsl #24 @@ -245,7 +232,6 @@ ENTRY(memcpy) orr r6, r6, r7, lsl #24 mov r7, r7, lsr #8 orr r7, r7, ip, lsl #24 -#endif str r4, [r3], #0x04 str r5, [r3], #0x04 str r6, [r3], #0x04 @@ -262,43 +248,22 @@ ENTRY(memcpy) blt .Lmemcpy_bad_done .Lmemcpy_bad1_loop4: -#ifdef __ARMEB__ - mov r4, ip, lsl #8 -#else mov r4, ip, lsr #8 -#endif ldr ip, [r1], #0x04 subs r2, r2, #0x04 -#ifdef __ARMEB__ - orr r4, r4, ip, lsr #24 -#else orr r4, r4, ip, lsl #24 -#endif str r4, [r3], #0x04 bge .Lmemcpy_bad1_loop4 sub r1, r1, #0x03 b .Lmemcpy_bad_done .Lmemcpy_bad2_loop16: -#ifdef __ARMEB__ - mov r4, ip, lsl #16 -#else mov r4, ip, lsr #16 -#endif ldr r5, [r1], #0x04 pld [r1, #0x018] ldr r6, [r1], #0x04 ldr r7, [r1], #0x04 ldr ip, [r1], #0x04 -#ifdef __ARMEB__ - orr r4, r4, r5, lsr #16 - mov r5, r5, lsl #16 - orr r5, r5, r6, lsr #16 - mov r6, r6, lsl #16 - orr r6, r6, r7, lsr #16 - mov r7, r7, lsl #16 - orr r7, r7, ip, lsr #16 -#else orr r4, r4, r5, lsl #16 mov r5, r5, lsr #16 orr r5, r5, r6, lsl #16 @@ -306,7 +271,6 @@ ENTRY(memcpy) orr r6, r6, r7, lsl #16 mov r7, r7, lsr #16 orr r7, r7, ip, lsl #16 -#endif str r4, [r3], #0x04 str r5, [r3], #0x04 str r6, [r3], #0x04 @@ -323,43 +287,22 @@ ENTRY(memcpy) blt .Lmemcpy_bad_done .Lmemcpy_bad2_loop4: -#ifdef __ARMEB__ - mov r4, ip, lsl #16 -#else mov r4, ip, lsr #16 -#endif ldr ip, [r1], #0x04 subs r2, r2, #0x04 -#ifdef __ARMEB__ - orr r4, r4, ip, lsr #16 -#else orr r4, r4, ip, lsl #16 -#endif str r4, [r3], #0x04 bge .Lmemcpy_bad2_loop4 sub r1, r1, #0x02 b .Lmemcpy_bad_done .Lmemcpy_bad3_loop16: -#ifdef __ARMEB__ - mov r4, ip, lsl #24 -#else mov r4, ip, lsr #24 -#endif ldr r5, [r1], #0x04 pld [r1, #0x018] ldr r6, [r1], #0x04 ldr r7, [r1], #0x04 ldr ip, [r1], #0x04 -#ifdef __ARMEB__ - orr r4, r4, r5, lsr #8 - mov r5, r5, lsl #24 - orr r5, r5, r6, lsr #8 - mov r6, r6, lsl #24 - orr r6, r6, r7, lsr #8 - mov r7, r7, lsl #24 - orr r7, r7, ip, lsr #8 -#else orr r4, r4, r5, lsl #8 mov r5, r5, lsr #24 orr r5, r5, r6, lsl #8 @@ -367,7 +310,6 @@ ENTRY(memcpy) orr r6, r6, r7, lsl #8 mov r7, r7, lsr #24 orr r7, r7, ip, lsl #8 -#endif str r4, [r3], #0x04 str r5, [r3], #0x04 str r6, [r3], #0x04 @@ -384,18 +326,10 @@ ENTRY(memcpy) blt .Lmemcpy_bad_done .Lmemcpy_bad3_loop4: -#ifdef __ARMEB__ - mov r4, ip, lsl #24 -#else mov r4, ip, lsr #24 -#endif ldr ip, [r1], #0x04 subs r2, r2, #0x04 -#ifdef __ARMEB__ - orr r4, r4, ip, lsr #8 -#else orr r4, r4, ip, lsl #8 -#endif str r4, [r3], #0x04 bge .Lmemcpy_bad3_loop4 sub r1, r1, #0x01 @@ -473,13 +407,8 @@ ENTRY(memcpy) */ ldr r3, [r1, #-1] /* BE:r3 = x012 LE:r3 = 210x */ ldr r2, [r1, #3] /* BE:r2 = 3xxx LE:r2 = xxx3 */ -#ifdef __ARMEB__ - mov r3, r3, lsl #8 /* r3 = 012. */ - orr r3, r3, r2, lsr #24 /* r3 = 0123 */ -#else mov r3, r3, lsr #8 /* r3 = .210 */ orr r3, r3, r2, lsl #24 /* r3 = 3210 */ -#endif str r3, [r0] bx lr LMEMCPY_4_PAD @@ -487,13 +416,8 @@ ENTRY(memcpy) /* * 0010: dst is 32-bit aligned, src is 16-bit aligned */ -#ifdef __ARMEB__ - ldrh r3, [r1] - ldrh r2, [r1, #0x02] -#else ldrh r3, [r1, #0x02] ldrh r2, [r1] -#endif orr r3, r2, r3, lsl #16 str r3, [r0] bx lr @@ -504,13 +428,8 @@ ENTRY(memcpy) */ ldr r3, [r1, #-3] /* BE:r3 = xxx0 LE:r3 = 0xxx */ ldr r2, [r1, #1] /* BE:r2 = 123x LE:r2 = x321 */ -#ifdef __ARMEB__ - mov r3, r3, lsl #24 /* r3 = 0... */ - orr r3, r3, r2, lsr #8 /* r3 = 0123 */ -#else mov r3, r3, lsr #24 /* r3 = ...0 */ orr r3, r3, r2, lsl #8 /* r3 = 3210 */ -#endif str r3, [r0] bx lr LMEMCPY_4_PAD @@ -519,17 +438,10 @@ ENTRY(memcpy) * 0100: dst is 8-bit aligned, src is 32-bit aligned */ ldr r2, [r1] -#ifdef __ARMEB__ - strb r2, [r0, #0x03] - mov r3, r2, lsr #8 - mov r1, r2, lsr #24 - strb r1, [r0] -#else strb r2, [r0] mov r3, r2, lsr #8 mov r1, r2, lsr #24 strb r1, [r0, #0x03] -#endif strh r3, [r0, #0x01] bx lr LMEMCPY_4_PAD @@ -551,17 +463,10 @@ ENTRY(memcpy) */ ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ ldrh r3, [r1, #0x02] /* LE:r3 = ..23 LE:r3 = ..32 */ -#ifdef __ARMEB__ - mov r1, r2, lsr #8 /* r1 = ...0 */ - strb r1, [r0] - mov r2, r2, lsl #8 /* r2 = .01. */ - orr r2, r2, r3, lsr #8 /* r2 = .012 */ -#else strb r2, [r0] mov r2, r2, lsr #8 /* r2 = ...1 */ orr r2, r2, r3, lsl #8 /* r2 = .321 */ mov r3, r3, lsr #8 /* r3 = ...3 */ -#endif strh r2, [r0, #0x01] strb r3, [r0, #0x03] bx lr @@ -583,15 +488,9 @@ ENTRY(memcpy) * 1000: dst is 16-bit aligned, src is 32-bit aligned */ ldr r2, [r1] -#ifdef __ARMEB__ - strh r2, [r0, #0x02] - mov r3, r2, lsr #16 - strh r3, [r0] -#else strh r2, [r0] mov r3, r2, lsr #16 strh r3, [r0, #0x02] -#endif bx lr LMEMCPY_4_PAD @@ -602,13 +501,8 @@ ENTRY(memcpy) ldr r3, [r1, #3] /* BE:r3 = 3xxx LE:r3 = xxx3 */ mov r1, r2, lsr #8 /* BE:r1 = .x01 LE:r1 = .210 */ strh r1, [r0] -#ifdef __ARMEB__ - mov r2, r2, lsl #8 /* r2 = 012. */ - orr r2, r2, r3, lsr #24 /* r2 = 0123 */ -#else mov r2, r2, lsr #24 /* r2 = ...2 */ orr r2, r2, r3, lsl #8 /* r2 = xx32 */ -#endif strh r2, [r0, #0x02] bx lr LMEMCPY_4_PAD @@ -630,13 +524,8 @@ ENTRY(memcpy) ldr r2, [r1, #-3] /* BE:r2 = xxx0 LE:r2 = 0xxx */ mov r1, r3, lsr #8 /* BE:r1 = .123 LE:r1 = .x32 */ strh r1, [r0, #0x02] -#ifdef __ARMEB__ - mov r3, r3, lsr #24 /* r3 = ...1 */ - orr r3, r3, r2, lsl #8 /* r3 = xx01 */ -#else mov r3, r3, lsl #8 /* r3 = 321. */ orr r3, r3, r2, lsr #24 /* r3 = 3210 */ -#endif strh r3, [r0] bx lr LMEMCPY_4_PAD @@ -645,19 +534,11 @@ ENTRY(memcpy) * 1100: dst is 8-bit aligned, src is 32-bit aligned */ ldr r2, [r1] /* BE:r2 = 0123 LE:r2 = 3210 */ -#ifdef __ARMEB__ - strb r2, [r0, #0x03] - mov r3, r2, lsr #8 - mov r1, r2, lsr #24 - strh r3, [r0, #0x01] - strb r1, [r0] -#else strb r2, [r0] mov r3, r2, lsr #8 mov r1, r2, lsr #24 strh r3, [r0, #0x01] strb r1, [r0, #0x03] -#endif bx lr LMEMCPY_4_PAD @@ -676,16 +557,6 @@ ENTRY(memcpy) /* * 1110: dst is 8-bit aligned, src is 16-bit aligned */ -#ifdef __ARMEB__ - ldrh r3, [r1, #0x02] /* BE:r3 = ..23 LE:r3 = ..32 */ - ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ - strb r3, [r0, #0x03] - mov r3, r3, lsr #8 /* r3 = ...2 */ - orr r3, r3, r2, lsl #8 /* r3 = ..12 */ - strh r3, [r0, #0x01] - mov r2, r2, lsr #8 /* r2 = ...0 */ - strb r2, [r0] -#else ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ ldrh r3, [r1, #0x02] /* BE:r3 = ..23 LE:r3 = ..32 */ strb r2, [r0] @@ -694,7 +565,6 @@ ENTRY(memcpy) strh r2, [r0, #0x01] mov r3, r3, lsr #8 /* r3 = ...3 */ strb r3, [r0, #0x03] -#endif bx lr LMEMCPY_4_PAD @@ -739,13 +609,8 @@ ENTRY(memcpy) */ ldr r2, [r1, #-1] /* BE:r2 = x012 LE:r2 = 210x */ ldr r3, [r1, #0x03] /* BE:r3 = 345x LE:r3 = x543 */ -#ifdef __ARMEB__ - mov r2, r2, lsl #8 /* r2 = 012. */ - orr r2, r2, r3, lsr #24 /* r2 = 0123 */ -#else mov r2, r2, lsr #8 /* r2 = .210 */ orr r2, r2, r3, lsl #24 /* r2 = 3210 */ -#endif mov r3, r3, lsr #8 /* BE:r3 = .345 LE:r3 = .x54 */ str r2, [r0] strh r3, [r0, #0x04] @@ -757,17 +622,10 @@ ENTRY(memcpy) */ ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ -#ifdef __ARMEB__ - mov r1, r3, lsr #16 /* r1 = ..23 */ - orr r1, r1, r2, lsl #16 /* r1 = 0123 */ - str r1, [r0] - strh r3, [r0, #0x04] -#else mov r1, r3, lsr #16 /* r1 = ..54 */ orr r2, r2, r3, lsl #16 /* r2 = 3210 */ str r2, [r0] strh r1, [r0, #0x04] -#endif bx lr LMEMCPY_6_PAD @@ -777,17 +635,10 @@ ENTRY(memcpy) ldr r2, [r1, #-3] /* BE:r2 = xxx0 LE:r2 = 0xxx */ ldr r3, [r1, #1] /* BE:r3 = 1234 LE:r3 = 4321 */ ldr r1, [r1, #5] /* BE:r1 = 5xxx LE:r3 = xxx5 */ -#ifdef __ARMEB__ - mov r2, r2, lsl #24 /* r2 = 0... */ - orr r2, r2, r3, lsr #8 /* r2 = 0123 */ - mov r3, r3, lsl #8 /* r3 = 234. */ - orr r1, r3, r1, lsr #24 /* r1 = 2345 */ -#else mov r2, r2, lsr #24 /* r2 = ...0 */ orr r2, r2, r3, lsl #8 /* r2 = 3210 */ mov r1, r1, lsl #8 /* r1 = xx5. */ orr r1, r1, r3, lsr #24 /* r1 = xx54 */ -#endif str r2, [r0] strh r1, [r0, #0x04] bx lr @@ -800,17 +651,10 @@ ENTRY(memcpy) ldrh r2, [r1, #0x04] /* BE:r2 = ..45 LE:r2 = ..54 */ mov r1, r3, lsr #8 /* BE:r1 = .012 LE:r1 = .321 */ strh r1, [r0, #0x01] -#ifdef __ARMEB__ - mov r1, r3, lsr #24 /* r1 = ...0 */ - strb r1, [r0] - mov r3, r3, lsl #8 /* r3 = 123. */ - orr r3, r3, r2, lsr #8 /* r3 = 1234 */ -#else strb r3, [r0] mov r3, r3, lsr #24 /* r3 = ...3 */ orr r3, r3, r2, lsl #8 /* r3 = .543 */ mov r2, r2, lsr #8 /* r2 = ...5 */ -#endif strh r3, [r0, #0x03] strb r2, [r0, #0x05] bx lr @@ -835,16 +679,6 @@ ENTRY(memcpy) */ ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ ldr r1, [r1, #0x02] /* BE:r1 = 2345 LE:r1 = 5432 */ -#ifdef __ARMEB__ - mov r3, r2, lsr #8 /* r3 = ...0 */ - strb r3, [r0] - strb r1, [r0, #0x05] - mov r3, r1, lsr #8 /* r3 = .234 */ - strh r3, [r0, #0x03] - mov r3, r2, lsl #8 /* r3 = .01. */ - orr r3, r3, r1, lsr #24 /* r3 = .012 */ - strh r3, [r0, #0x01] -#else strb r2, [r0] mov r3, r1, lsr #24 strb r3, [r0, #0x05] @@ -853,7 +687,6 @@ ENTRY(memcpy) mov r3, r2, lsr #8 /* r3 = ...1 */ orr r3, r3, r1, lsl #8 /* r3 = 4321 */ strh r3, [r0, #0x01] -#endif bx lr LMEMCPY_6_PAD @@ -874,21 +707,12 @@ ENTRY(memcpy) /* * 1000: dst is 16-bit aligned, src is 32-bit aligned */ -#ifdef __ARMEB__ - ldr r2, [r1] /* r2 = 0123 */ - ldrh r3, [r1, #0x04] /* r3 = ..45 */ - mov r1, r2, lsr #16 /* r1 = ..01 */ - orr r3, r3, r2, lsl#16 /* r3 = 2345 */ - strh r1, [r0] - str r3, [r0, #0x02] -#else ldrh r2, [r1, #0x04] /* r2 = ..54 */ ldr r3, [r1] /* r3 = 3210 */ mov r2, r2, lsl #16 /* r2 = 54.. */ orr r2, r2, r3, lsr #16 /* r2 = 5432 */ strh r3, [r0] str r2, [r0, #0x02] -#endif bx lr LMEMCPY_6_PAD @@ -898,13 +722,8 @@ ENTRY(memcpy) ldr r3, [r1, #-1] /* BE:r3 = x012 LE:r3 = 210x */ ldr r2, [r1, #3] /* BE:r2 = 345x LE:r2 = x543 */ mov r1, r3, lsr #8 /* BE:r1 = .x01 LE:r1 = .210 */ -#ifdef __ARMEB__ - mov r2, r2, lsr #8 /* r2 = .345 */ - orr r2, r2, r3, lsl #24 /* r2 = 2345 */ -#else mov r2, r2, lsl #8 /* r2 = 543. */ orr r2, r2, r3, lsr #24 /* r2 = 5432 */ -#endif strh r1, [r0] str r2, [r0, #0x02] bx lr @@ -926,15 +745,9 @@ ENTRY(memcpy) ldrb r3, [r1] /* r3 = ...0 */ ldr r2, [r1, #0x01] /* BE:r2 = 1234 LE:r2 = 4321 */ ldrb r1, [r1, #0x05] /* r1 = ...5 */ -#ifdef __ARMEB__ - mov r3, r3, lsl #8 /* r3 = ..0. */ - orr r3, r3, r2, lsr #24 /* r3 = ..01 */ - orr r1, r1, r2, lsl #8 /* r1 = 2345 */ -#else orr r3, r3, r2, lsl #8 /* r3 = 3210 */ mov r1, r1, lsl #24 /* r1 = 5... */ orr r1, r1, r2, lsr #8 /* r1 = 5432 */ -#endif strh r3, [r0] str r1, [r0, #0x02] bx lr @@ -945,17 +758,10 @@ ENTRY(memcpy) */ ldr r2, [r1] /* BE:r2 = 0123 LE:r2 = 3210 */ ldrh r1, [r1, #0x04] /* BE:r1 = ..45 LE:r1 = ..54 */ -#ifdef __ARMEB__ - mov r3, r2, lsr #24 /* r3 = ...0 */ - strb r3, [r0] - mov r2, r2, lsl #8 /* r2 = 123. */ - orr r2, r2, r1, lsr #8 /* r2 = 1234 */ -#else strb r2, [r0] mov r2, r2, lsr #8 /* r2 = .321 */ orr r2, r2, r1, lsl #24 /* r2 = 4321 */ mov r1, r1, lsr #8 /* r1 = ...5 */ -#endif str r2, [r0, #0x01] strb r1, [r0, #0x05] bx lr @@ -980,17 +786,10 @@ ENTRY(memcpy) */ ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ ldr r1, [r1, #0x02] /* BE:r1 = 2345 LE:r1 = 5432 */ -#ifdef __ARMEB__ - mov r3, r2, lsr #8 /* r3 = ...0 */ - strb r3, [r0] - mov r2, r2, lsl #24 /* r2 = 1... */ - orr r2, r2, r1, lsr #8 /* r2 = 1234 */ -#else strb r2, [r0] mov r2, r2, lsr #8 /* r2 = ...1 */ orr r2, r2, r1, lsl #8 /* r2 = 4321 */ mov r1, r1, lsr #24 /* r1 = ...5 */ -#endif str r2, [r0, #0x01] strb r1, [r0, #0x05] bx lr @@ -1038,16 +837,10 @@ ENTRY(memcpy) ldr r3, [r1, #-1] /* BE:r3 = x012 LE:r3 = 210x */ ldr r2, [r1, #0x03] /* BE:r2 = 3456 LE:r2 = 6543 */ ldrb r1, [r1, #0x07] /* r1 = ...7 */ -#ifdef __ARMEB__ - mov r3, r3, lsl #8 /* r3 = 012. */ - orr r3, r3, r2, lsr #24 /* r3 = 0123 */ - orr r2, r1, r2, lsl #8 /* r2 = 4567 */ -#else mov r3, r3, lsr #8 /* r3 = .210 */ orr r3, r3, r2, lsl #24 /* r3 = 3210 */ mov r1, r1, lsl #24 /* r1 = 7... */ orr r2, r1, r2, lsr #8 /* r2 = 7654 */ -#endif str r3, [r0] str r2, [r0, #0x04] bx lr @@ -1059,15 +852,9 @@ ENTRY(memcpy) ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ ldrh r1, [r1, #0x06] /* BE:r1 = ..67 LE:r1 = ..76 */ -#ifdef __ARMEB__ - mov r2, r2, lsl #16 /* r2 = 01.. */ - orr r2, r2, r3, lsr #16 /* r2 = 0123 */ - orr r3, r1, r3, lsl #16 /* r3 = 4567 */ -#else orr r2, r2, r3, lsl #16 /* r2 = 3210 */ mov r3, r3, lsr #16 /* r3 = ..54 */ orr r3, r3, r1, lsl #16 /* r3 = 7654 */ -#endif str r2, [r0] str r3, [r0, #0x04] bx lr @@ -1079,16 +866,9 @@ ENTRY(memcpy) ldrb r3, [r1] /* r3 = ...0 */ ldr r2, [r1, #0x01] /* BE:r2 = 1234 LE:r2 = 4321 */ ldr r1, [r1, #0x05] /* BE:r1 = 567x LE:r1 = x765 */ -#ifdef __ARMEB__ - mov r3, r3, lsl #24 /* r3 = 0... */ - orr r3, r3, r2, lsr #8 /* r3 = 0123 */ - mov r2, r2, lsl #24 /* r2 = 4... */ - orr r2, r2, r1, lsr #8 /* r2 = 4567 */ -#else orr r3, r3, r2, lsl #8 /* r3 = 3210 */ mov r2, r2, lsr #24 /* r2 = ...4 */ orr r2, r2, r1, lsl #8 /* r2 = 7654 */ -#endif str r3, [r0] str r2, [r0, #0x04] bx lr @@ -1099,21 +879,12 @@ ENTRY(memcpy) */ ldr r3, [r1] /* BE:r3 = 0123 LE:r3 = 3210 */ ldr r2, [r1, #0x04] /* BE:r2 = 4567 LE:r2 = 7654 */ -#ifdef __ARMEB__ - mov r1, r3, lsr #24 /* r1 = ...0 */ - strb r1, [r0] - mov r1, r3, lsr #8 /* r1 = .012 */ - strb r2, [r0, #0x07] - mov r3, r3, lsl #24 /* r3 = 3... */ - orr r3, r3, r2, lsr #8 /* r3 = 3456 */ -#else strb r3, [r0] mov r1, r2, lsr #24 /* r1 = ...7 */ strb r1, [r0, #0x07] mov r1, r3, lsr #8 /* r1 = .321 */ mov r3, r3, lsr #24 /* r3 = ...3 */ orr r3, r3, r2, lsl #8 /* r3 = 6543 */ -#endif strh r1, [r0, #0x01] str r3, [r0, #0x03] bx lr @@ -1139,15 +910,6 @@ ENTRY(memcpy) ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ ldrh r1, [r1, #0x06] /* BE:r1 = ..67 LE:r1 = ..76 */ -#ifdef __ARMEB__ - mov ip, r2, lsr #8 /* ip = ...0 */ - strb ip, [r0] - mov ip, r2, lsl #8 /* ip = .01. */ - orr ip, ip, r3, lsr #24 /* ip = .012 */ - strb r1, [r0, #0x07] - mov r3, r3, lsl #8 /* r3 = 345. */ - orr r3, r3, r1, lsr #8 /* r3 = 3456 */ -#else strb r2, [r0] /* 0 */ mov ip, r1, lsr #8 /* ip = ...7 */ strb ip, [r0, #0x07] /* 7 */ @@ -1155,7 +917,6 @@ ENTRY(memcpy) orr ip, ip, r3, lsl #8 /* ip = 4321 */ mov r3, r3, lsr #8 /* r3 = .543 */ orr r3, r3, r1, lsl #24 /* r3 = 6543 */ -#endif strh ip, [r0, #0x01] str r3, [r0, #0x03] bx lr @@ -1170,13 +931,8 @@ ENTRY(memcpy) ldrb r1, [r1, #0x07] /* r1 = ...7 */ strb r3, [r0] mov r3, ip, lsr #16 /* BE:r3 = ..12 LE:r3 = ..43 */ -#ifdef __ARMEB__ - strh r3, [r0, #0x01] - orr r2, r2, ip, lsl #16 /* r2 = 3456 */ -#else strh ip, [r0, #0x01] orr r2, r3, r2, lsl #16 /* r2 = 6543 */ -#endif str r2, [r0, #0x03] strb r1, [r0, #0x07] bx lr @@ -1188,15 +944,9 @@ ENTRY(memcpy) ldr r2, [r1] /* BE:r2 = 0123 LE:r2 = 3210 */ ldr r3, [r1, #0x04] /* BE:r3 = 4567 LE:r3 = 7654 */ mov r1, r2, lsr #16 /* BE:r1 = ..01 LE:r1 = ..32 */ -#ifdef __ARMEB__ - strh r1, [r0] - mov r1, r3, lsr #16 /* r1 = ..45 */ - orr r2, r1 ,r2, lsl #16 /* r2 = 2345 */ -#else strh r2, [r0] orr r2, r1, r3, lsl #16 /* r2 = 5432 */ mov r3, r3, lsr #16 /* r3 = ..76 */ -#endif str r2, [r0, #0x02] strh r3, [r0, #0x06] bx lr @@ -1210,16 +960,10 @@ ENTRY(memcpy) ldrb ip, [r1, #0x07] /* ip = ...7 */ mov r1, r2, lsr #8 /* BE:r1 = .x01 LE:r1 = .210 */ strh r1, [r0] -#ifdef __ARMEB__ - mov r1, r2, lsl #24 /* r1 = 2... */ - orr r1, r1, r3, lsr #8 /* r1 = 2345 */ - orr r3, ip, r3, lsl #8 /* r3 = 4567 */ -#else mov r1, r2, lsr #24 /* r1 = ...2 */ orr r1, r1, r3, lsl #8 /* r1 = 5432 */ mov r3, r3, lsr #24 /* r3 = ...6 */ orr r3, r3, ip, lsl #8 /* r3 = ..76 */ -#endif str r1, [r0, #0x02] strh r3, [r0, #0x06] bx lr @@ -1245,16 +989,9 @@ ENTRY(memcpy) ldrb ip, [r1] /* ip = ...0 */ mov r1, r3, lsr #8 /* BE:r1 = .567 LE:r1 = .x76 */ strh r1, [r0, #0x06] -#ifdef __ARMEB__ - mov r3, r3, lsr #24 /* r3 = ...5 */ - orr r3, r3, r2, lsl #8 /* r3 = 2345 */ - mov r2, r2, lsr #24 /* r2 = ...1 */ - orr r2, r2, ip, lsl #8 /* r2 = ..01 */ -#else mov r3, r3, lsl #24 /* r3 = 5... */ orr r3, r3, r2, lsr #8 /* r3 = 5432 */ orr r2, ip, r2, lsl #8 /* r2 = 3210 */ -#endif str r3, [r0, #0x02] strh r2, [r0] bx lr @@ -1267,21 +1004,12 @@ ENTRY(memcpy) ldr r2, [r1] /* BE:r2 = 0123 LE:r2 = 3210 */ mov r1, r3, lsr #8 /* BE:r1 = .456 LE:r1 = .765 */ strh r1, [r0, #0x05] -#ifdef __ARMEB__ - strb r3, [r0, #0x07] - mov r1, r2, lsr #24 /* r1 = ...0 */ - strb r1, [r0] - mov r2, r2, lsl #8 /* r2 = 123. */ - orr r2, r2, r3, lsr #24 /* r2 = 1234 */ - str r2, [r0, #0x01] -#else strb r2, [r0] mov r1, r3, lsr #24 /* r1 = ...7 */ strb r1, [r0, #0x07] mov r2, r2, lsr #8 /* r2 = .321 */ orr r2, r2, r3, lsl #24 /* r2 = 4321 */ str r2, [r0, #0x01] -#endif bx lr LMEMCPY_8_PAD @@ -1294,13 +1022,8 @@ ENTRY(memcpy) ldrb r1, [r1, #0x07] /* r1 = ...7 */ strb r3, [r0] mov r3, ip, lsr #16 /* BE:r3 = ..34 LE:r3 = ..65 */ -#ifdef __ARMEB__ - strh ip, [r0, #0x05] - orr r2, r3, r2, lsl #16 /* r2 = 1234 */ -#else strh r3, [r0, #0x05] orr r2, r2, ip, lsl #16 /* r2 = 4321 */ -#endif str r2, [r0, #0x01] strb r1, [r0, #0x07] bx lr @@ -1312,15 +1035,6 @@ ENTRY(memcpy) ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ ldrh r1, [r1, #0x06] /* BE:r1 = ..67 LE:r1 = ..76 */ -#ifdef __ARMEB__ - mov ip, r2, lsr #8 /* ip = ...0 */ - strb ip, [r0] - mov ip, r2, lsl #24 /* ip = 1... */ - orr ip, ip, r3, lsr #8 /* ip = 1234 */ - strb r1, [r0, #0x07] - mov r1, r1, lsr #8 /* r1 = ...6 */ - orr r1, r1, r3, lsl #8 /* r1 = 3456 */ -#else strb r2, [r0] mov ip, r2, lsr #8 /* ip = ...1 */ orr ip, ip, r3, lsl #8 /* ip = 4321 */ @@ -1328,7 +1042,6 @@ ENTRY(memcpy) strb r2, [r0, #0x07] mov r1, r1, lsl #8 /* r1 = .76. */ orr r1, r1, r3, lsr #24 /* r1 = .765 */ -#endif str ip, [r0, #0x01] strh r1, [r0, #0x05] bx lr @@ -1380,14 +1093,6 @@ ENTRY(memcpy) ldr ip, [r1, #0x07] /* BE:ip = 789A LE:ip = A987 */ ldr r3, [r1, #0x03] /* BE:r3 = 3456 LE:r3 = 6543 */ ldr r1, [r1, #-1] /* BE:r1 = x012 LE:r1 = 210x */ -#ifdef __ARMEB__ - orr r2, r2, ip, lsl #8 /* r2 = 89AB */ - str r2, [r0, #0x08] - mov r2, ip, lsr #24 /* r2 = ...7 */ - orr r2, r2, r3, lsl #8 /* r2 = 4567 */ - mov r1, r1, lsl #8 /* r1 = 012. */ - orr r1, r1, r3, lsr #24 /* r1 = 0123 */ -#else mov r2, r2, lsl #24 /* r2 = B... */ orr r2, r2, ip, lsr #8 /* r2 = BA98 */ str r2, [r0, #0x08] @@ -1395,7 +1100,6 @@ ENTRY(memcpy) orr r2, r2, r3, lsr #8 /* r2 = 7654 */ mov r1, r1, lsr #8 /* r1 = .210 */ orr r1, r1, r3, lsl #24 /* r1 = 3210 */ -#endif str r2, [r0, #0x04] str r1, [r0] bx lr @@ -1408,21 +1112,12 @@ ENTRY(memcpy) ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ ldr ip, [r1, #0x06] /* BE:ip = 6789 LE:ip = 9876 */ ldrh r1, [r1, #0x0a] /* BE:r1 = ..AB LE:r1 = ..BA */ -#ifdef __ARMEB__ - mov r2, r2, lsl #16 /* r2 = 01.. */ - orr r2, r2, r3, lsr #16 /* r2 = 0123 */ - str r2, [r0] - mov r3, r3, lsl #16 /* r3 = 45.. */ - orr r3, r3, ip, lsr #16 /* r3 = 4567 */ - orr r1, r1, ip, lsl #16 /* r1 = 89AB */ -#else orr r2, r2, r3, lsl #16 /* r2 = 3210 */ str r2, [r0] mov r3, r3, lsr #16 /* r3 = ..54 */ orr r3, r3, ip, lsl #16 /* r3 = 7654 */ mov r1, r1, lsl #16 /* r1 = BA.. */ orr r1, r1, ip, lsr #16 /* r1 = BA98 */ -#endif str r3, [r0, #0x04] str r1, [r0, #0x08] bx lr @@ -1435,22 +1130,12 @@ ENTRY(memcpy) ldr r3, [r1, #0x01] /* BE:r3 = 1234 LE:r3 = 4321 */ ldr ip, [r1, #0x05] /* BE:ip = 5678 LE:ip = 8765 */ ldr r1, [r1, #0x09] /* BE:r1 = 9ABx LE:r1 = xBA9 */ -#ifdef __ARMEB__ - mov r2, r2, lsl #24 /* r2 = 0... */ - orr r2, r2, r3, lsr #8 /* r2 = 0123 */ - str r2, [r0] - mov r3, r3, lsl #24 /* r3 = 4... */ - orr r3, r3, ip, lsr #8 /* r3 = 4567 */ - mov r1, r1, lsr #8 /* r1 = .9AB */ - orr r1, r1, ip, lsl #24 /* r1 = 89AB */ -#else orr r2, r2, r3, lsl #8 /* r2 = 3210 */ str r2, [r0] mov r3, r3, lsr #24 /* r3 = ...4 */ orr r3, r3, ip, lsl #8 /* r3 = 7654 */ mov r1, r1, lsl #8 /* r1 = BA9. */ orr r1, r1, ip, lsr #24 /* r1 = BA98 */ -#endif str r3, [r0, #0x04] str r1, [r0, #0x08] bx lr @@ -1464,21 +1149,12 @@ ENTRY(memcpy) ldr ip, [r1, #0x08] /* BE:ip = 89AB LE:ip = BA98 */ mov r1, r2, lsr #8 /* BE:r1 = .012 LE:r1 = .321 */ strh r1, [r0, #0x01] *** 546 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Jan 28 10:51: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 7375152140C; Thu, 28 Jan 2021 10:51: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 4DRHMl2t9zz3BqZ; Thu, 28 Jan 2021 10:51: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 55A4767D2; Thu, 28 Jan 2021 10:51: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 10SApVXp032087; Thu, 28 Jan 2021 10:51:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SApVei032086; Thu, 28 Jan 2021 10:51:31 GMT (envelope-from git) Date: Thu, 28 Jan 2021 10:51:31 GMT Message-Id: <202101281051.10SApVei032086@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: 4d2ff2330f51 - main - Remove the old ARMv4 memcpy 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: 4d2ff2330f515b0a42b83113a201de48c0f38f7a 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, 28 Jan 2021 10:51:31 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2ff2330f515b0a42b83113a201de48c0f38f7a commit 4d2ff2330f515b0a42b83113a201de48c0f38f7a Author: Andrew Turner AuthorDate: 2021-01-28 10:39:38 +0000 Commit: Andrew Turner CommitDate: 2021-01-28 10:39:38 +0000 Remove the old ARMv4 memcpy This was only used when building for ARMv4 or some ARMv5 or when _STANDALONE is defined. As ARMv4 and ARMv5 support has been removed, and we only define _STANDALONE in the bootloader where we don't use this version of memcpy we can remove it. Differential Revision: https://reviews.freebsd.org/D28313 --- lib/libc/arm/string/memcpy.S | 1376 ++++++++++++++++++++++++++++++++++- lib/libc/arm/string/memcpy_arm.S | 272 ------- lib/libc/arm/string/memcpy_xscale.S | 1375 ---------------------------------- 3 files changed, 1371 insertions(+), 1652 deletions(-) diff --git a/lib/libc/arm/string/memcpy.S b/lib/libc/arm/string/memcpy.S index 3628652681e0..63390edeaa95 100644 --- a/lib/libc/arm/string/memcpy.S +++ b/lib/libc/arm/string/memcpy.S @@ -1,9 +1,1375 @@ -/* $NetBSD: memcpy.S,v 1.4 2003/10/14 07:51:45 scw Exp $ */ +/* $NetBSD: memcpy_xscale.S,v 1.1 2003/10/14 07:51:45 scw Exp $ */ + +/* + * Copyright 2003 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Steve C. Woodford for Wasabi Systems, Inc. + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #include __FBSDID("$FreeBSD$"); -#if !defined(_ARM_ARCH_5E) || defined(_STANDALONE) -#include "memcpy_arm.S" -#else -#include "memcpy_xscale.S" + +.syntax unified + +/* LINTSTUB: Func: void *memcpy(void *dst, const void *src, size_t len) */ +ENTRY(memcpy) + pld [r1] + cmp r2, #0x0c + ble .Lmemcpy_short /* <= 12 bytes */ + mov r3, r0 /* We must not clobber r0 */ + + /* Word-align the destination buffer */ + ands ip, r3, #0x03 /* Already word aligned? */ + beq .Lmemcpy_wordaligned /* Yup */ + cmp ip, #0x02 + ldrb ip, [r1], #0x01 + sub r2, r2, #0x01 + strb ip, [r3], #0x01 + ldrble ip, [r1], #0x01 + suble r2, r2, #0x01 + strble ip, [r3], #0x01 + ldrblt ip, [r1], #0x01 + sublt r2, r2, #0x01 + strblt ip, [r3], #0x01 + + /* Destination buffer is now word aligned */ +.Lmemcpy_wordaligned: + ands ip, r1, #0x03 /* Is src also word-aligned? */ + bne .Lmemcpy_bad_align /* Nope. Things just got bad */ + + /* Quad-align the destination buffer */ + tst r3, #0x07 /* Already quad aligned? */ + ldrne ip, [r1], #0x04 + stmfd sp!, {r4-r9} /* Free up some registers */ + subne r2, r2, #0x04 + strne ip, [r3], #0x04 + + /* Destination buffer quad aligned, source is at least word aligned */ + subs r2, r2, #0x80 + blt .Lmemcpy_w_lessthan128 + + /* Copy 128 bytes at a time */ +.Lmemcpy_w_loop128: + ldr r4, [r1], #0x04 /* LD:00-03 */ + ldr r5, [r1], #0x04 /* LD:04-07 */ + pld [r1, #0x18] /* Prefetch 0x20 */ + ldr r6, [r1], #0x04 /* LD:08-0b */ + ldr r7, [r1], #0x04 /* LD:0c-0f */ + ldr r8, [r1], #0x04 /* LD:10-13 */ + ldr r9, [r1], #0x04 /* LD:14-17 */ + strd r4, [r3], #0x08 /* ST:00-07 */ + ldr r4, [r1], #0x04 /* LD:18-1b */ + ldr r5, [r1], #0x04 /* LD:1c-1f */ + strd r6, [r3], #0x08 /* ST:08-0f */ + ldr r6, [r1], #0x04 /* LD:20-23 */ + ldr r7, [r1], #0x04 /* LD:24-27 */ + pld [r1, #0x18] /* Prefetch 0x40 */ + strd r8, [r3], #0x08 /* ST:10-17 */ + ldr r8, [r1], #0x04 /* LD:28-2b */ + ldr r9, [r1], #0x04 /* LD:2c-2f */ + strd r4, [r3], #0x08 /* ST:18-1f */ + ldr r4, [r1], #0x04 /* LD:30-33 */ + ldr r5, [r1], #0x04 /* LD:34-37 */ + strd r6, [r3], #0x08 /* ST:20-27 */ + ldr r6, [r1], #0x04 /* LD:38-3b */ + ldr r7, [r1], #0x04 /* LD:3c-3f */ + strd r8, [r3], #0x08 /* ST:28-2f */ + ldr r8, [r1], #0x04 /* LD:40-43 */ + ldr r9, [r1], #0x04 /* LD:44-47 */ + pld [r1, #0x18] /* Prefetch 0x60 */ + strd r4, [r3], #0x08 /* ST:30-37 */ + ldr r4, [r1], #0x04 /* LD:48-4b */ + ldr r5, [r1], #0x04 /* LD:4c-4f */ + strd r6, [r3], #0x08 /* ST:38-3f */ + ldr r6, [r1], #0x04 /* LD:50-53 */ + ldr r7, [r1], #0x04 /* LD:54-57 */ + strd r8, [r3], #0x08 /* ST:40-47 */ + ldr r8, [r1], #0x04 /* LD:58-5b */ + ldr r9, [r1], #0x04 /* LD:5c-5f */ + strd r4, [r3], #0x08 /* ST:48-4f */ + ldr r4, [r1], #0x04 /* LD:60-63 */ + ldr r5, [r1], #0x04 /* LD:64-67 */ + pld [r1, #0x18] /* Prefetch 0x80 */ + strd r6, [r3], #0x08 /* ST:50-57 */ + ldr r6, [r1], #0x04 /* LD:68-6b */ + ldr r7, [r1], #0x04 /* LD:6c-6f */ + strd r8, [r3], #0x08 /* ST:58-5f */ + ldr r8, [r1], #0x04 /* LD:70-73 */ + ldr r9, [r1], #0x04 /* LD:74-77 */ + strd r4, [r3], #0x08 /* ST:60-67 */ + ldr r4, [r1], #0x04 /* LD:78-7b */ + ldr r5, [r1], #0x04 /* LD:7c-7f */ + strd r6, [r3], #0x08 /* ST:68-6f */ + strd r8, [r3], #0x08 /* ST:70-77 */ + subs r2, r2, #0x80 + strd r4, [r3], #0x08 /* ST:78-7f */ + bge .Lmemcpy_w_loop128 + +.Lmemcpy_w_lessthan128: + adds r2, r2, #0x80 /* Adjust for extra sub */ + ldmfdeq sp!, {r4-r9} + bxeq lr /* Return now if done */ + subs r2, r2, #0x20 + blt .Lmemcpy_w_lessthan32 + + /* Copy 32 bytes at a time */ +.Lmemcpy_w_loop32: + ldr r4, [r1], #0x04 + ldr r5, [r1], #0x04 + pld [r1, #0x18] + ldr r6, [r1], #0x04 + ldr r7, [r1], #0x04 + ldr r8, [r1], #0x04 + ldr r9, [r1], #0x04 + strd r4, [r3], #0x08 + ldr r4, [r1], #0x04 + ldr r5, [r1], #0x04 + strd r6, [r3], #0x08 + strd r8, [r3], #0x08 + subs r2, r2, #0x20 + strd r4, [r3], #0x08 + bge .Lmemcpy_w_loop32 + +.Lmemcpy_w_lessthan32: + adds r2, r2, #0x20 /* Adjust for extra sub */ + ldmfdeq sp!, {r4-r9} + bxeq lr /* Return now if done */ + + and r4, r2, #0x18 + rsbs r4, r4, #0x18 + addne pc, pc, r4, lsl #1 + nop + + /* At least 24 bytes remaining */ + ldr r4, [r1], #0x04 + ldr r5, [r1], #0x04 + sub r2, r2, #0x08 + strd r4, [r3], #0x08 + + /* At least 16 bytes remaining */ + ldr r4, [r1], #0x04 + ldr r5, [r1], #0x04 + sub r2, r2, #0x08 + strd r4, [r3], #0x08 + + /* At least 8 bytes remaining */ + ldr r4, [r1], #0x04 + ldr r5, [r1], #0x04 + subs r2, r2, #0x08 + strd r4, [r3], #0x08 + + /* Less than 8 bytes remaining */ + ldmfd sp!, {r4-r9} + bxeq lr /* Return now if done */ + subs r2, r2, #0x04 + ldrge ip, [r1], #0x04 + strge ip, [r3], #0x04 + bxeq lr /* Return now if done */ + addlt r2, r2, #0x04 + ldrb ip, [r1], #0x01 + cmp r2, #0x02 + ldrbge r2, [r1], #0x01 + strb ip, [r3], #0x01 + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] + bx lr + + +/* + * At this point, it has not been possible to word align both buffers. + * The destination buffer is word aligned, but the source buffer is not. + */ +.Lmemcpy_bad_align: + stmfd sp!, {r4-r7} + bic r1, r1, #0x03 + cmp ip, #2 + ldr ip, [r1], #0x04 + bgt .Lmemcpy_bad3 + beq .Lmemcpy_bad2 + b .Lmemcpy_bad1 + +.Lmemcpy_bad1_loop16: + mov r4, ip, lsr #8 + ldr r5, [r1], #0x04 + pld [r1, #0x018] + ldr r6, [r1], #0x04 + ldr r7, [r1], #0x04 + ldr ip, [r1], #0x04 + orr r4, r4, r5, lsl #24 + mov r5, r5, lsr #8 + orr r5, r5, r6, lsl #24 + mov r6, r6, lsr #8 + orr r6, r6, r7, lsl #24 + mov r7, r7, lsr #8 + orr r7, r7, ip, lsl #24 + str r4, [r3], #0x04 + str r5, [r3], #0x04 + str r6, [r3], #0x04 + str r7, [r3], #0x04 +.Lmemcpy_bad1: + subs r2, r2, #0x10 + bge .Lmemcpy_bad1_loop16 + + adds r2, r2, #0x10 + ldmfdeq sp!, {r4-r7} + bxeq lr /* Return now if done */ + subs r2, r2, #0x04 + sublt r1, r1, #0x03 + blt .Lmemcpy_bad_done + +.Lmemcpy_bad1_loop4: + mov r4, ip, lsr #8 + ldr ip, [r1], #0x04 + subs r2, r2, #0x04 + orr r4, r4, ip, lsl #24 + str r4, [r3], #0x04 + bge .Lmemcpy_bad1_loop4 + sub r1, r1, #0x03 + b .Lmemcpy_bad_done + +.Lmemcpy_bad2_loop16: + mov r4, ip, lsr #16 + ldr r5, [r1], #0x04 + pld [r1, #0x018] + ldr r6, [r1], #0x04 + ldr r7, [r1], #0x04 + ldr ip, [r1], #0x04 + orr r4, r4, r5, lsl #16 + mov r5, r5, lsr #16 + orr r5, r5, r6, lsl #16 + mov r6, r6, lsr #16 + orr r6, r6, r7, lsl #16 + mov r7, r7, lsr #16 + orr r7, r7, ip, lsl #16 + str r4, [r3], #0x04 + str r5, [r3], #0x04 + str r6, [r3], #0x04 + str r7, [r3], #0x04 +.Lmemcpy_bad2: + subs r2, r2, #0x10 + bge .Lmemcpy_bad2_loop16 + + adds r2, r2, #0x10 + ldmfdeq sp!, {r4-r7} + bxeq lr /* Return now if done */ + subs r2, r2, #0x04 + sublt r1, r1, #0x02 + blt .Lmemcpy_bad_done + +.Lmemcpy_bad2_loop4: + mov r4, ip, lsr #16 + ldr ip, [r1], #0x04 + subs r2, r2, #0x04 + orr r4, r4, ip, lsl #16 + str r4, [r3], #0x04 + bge .Lmemcpy_bad2_loop4 + sub r1, r1, #0x02 + b .Lmemcpy_bad_done + +.Lmemcpy_bad3_loop16: + mov r4, ip, lsr #24 + ldr r5, [r1], #0x04 + pld [r1, #0x018] + ldr r6, [r1], #0x04 + ldr r7, [r1], #0x04 + ldr ip, [r1], #0x04 + orr r4, r4, r5, lsl #8 + mov r5, r5, lsr #24 + orr r5, r5, r6, lsl #8 + mov r6, r6, lsr #24 + orr r6, r6, r7, lsl #8 + mov r7, r7, lsr #24 + orr r7, r7, ip, lsl #8 + str r4, [r3], #0x04 + str r5, [r3], #0x04 + str r6, [r3], #0x04 + str r7, [r3], #0x04 +.Lmemcpy_bad3: + subs r2, r2, #0x10 + bge .Lmemcpy_bad3_loop16 + + adds r2, r2, #0x10 + ldmfdeq sp!, {r4-r7} + bxeq lr /* Return now if done */ + subs r2, r2, #0x04 + sublt r1, r1, #0x01 + blt .Lmemcpy_bad_done + +.Lmemcpy_bad3_loop4: + mov r4, ip, lsr #24 + ldr ip, [r1], #0x04 + subs r2, r2, #0x04 + orr r4, r4, ip, lsl #8 + str r4, [r3], #0x04 + bge .Lmemcpy_bad3_loop4 + sub r1, r1, #0x01 + +.Lmemcpy_bad_done: + ldmfd sp!, {r4-r7} + adds r2, r2, #0x04 + bxeq lr + ldrb ip, [r1], #0x01 + cmp r2, #0x02 + ldrbge r2, [r1], #0x01 + strb ip, [r3], #0x01 + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] + bx lr + + +/* + * Handle short copies (less than 16 bytes), possibly misaligned. + * Some of these are *very* common, thanks to the network stack, + * and so are handled specially. + */ +.Lmemcpy_short: +#ifndef _STANDALONE + add pc, pc, r2, lsl #2 + nop + bx lr /* 0x00 */ + b .Lmemcpy_bytewise /* 0x01 */ + b .Lmemcpy_bytewise /* 0x02 */ + b .Lmemcpy_bytewise /* 0x03 */ + b .Lmemcpy_4 /* 0x04 */ + b .Lmemcpy_bytewise /* 0x05 */ + b .Lmemcpy_6 /* 0x06 */ + b .Lmemcpy_bytewise /* 0x07 */ + b .Lmemcpy_8 /* 0x08 */ + b .Lmemcpy_bytewise /* 0x09 */ + b .Lmemcpy_bytewise /* 0x0a */ + b .Lmemcpy_bytewise /* 0x0b */ + b .Lmemcpy_c /* 0x0c */ #endif +.Lmemcpy_bytewise: + mov r3, r0 /* We must not clobber r0 */ + ldrb ip, [r1], #0x01 +1: subs r2, r2, #0x01 + strb ip, [r3], #0x01 + ldrbne ip, [r1], #0x01 + bne 1b + bx lr + +#ifndef _STANDALONE +/****************************************************************************** + * Special case for 4 byte copies + */ +#define LMEMCPY_4_LOG2 6 /* 64 bytes */ +#define LMEMCPY_4_PAD .align LMEMCPY_4_LOG2 + LMEMCPY_4_PAD +.Lmemcpy_4: + and r2, r1, #0x03 + orr r2, r2, r0, lsl #2 + ands r2, r2, #0x0f + sub r3, pc, #0x14 + addne pc, r3, r2, lsl #LMEMCPY_4_LOG2 + +/* + * 0000: dst is 32-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] + str r2, [r0] + bx lr + LMEMCPY_4_PAD + +/* + * 0001: dst is 32-bit aligned, src is 8-bit aligned + */ + ldr r3, [r1, #-1] /* BE:r3 = x012 LE:r3 = 210x */ + ldr r2, [r1, #3] /* BE:r2 = 3xxx LE:r2 = xxx3 */ + mov r3, r3, lsr #8 /* r3 = .210 */ + orr r3, r3, r2, lsl #24 /* r3 = 3210 */ + str r3, [r0] + bx lr + LMEMCPY_4_PAD + +/* + * 0010: dst is 32-bit aligned, src is 16-bit aligned + */ + ldrh r3, [r1, #0x02] + ldrh r2, [r1] + orr r3, r2, r3, lsl #16 + str r3, [r0] + bx lr + LMEMCPY_4_PAD + +/* + * 0011: dst is 32-bit aligned, src is 8-bit aligned + */ + ldr r3, [r1, #-3] /* BE:r3 = xxx0 LE:r3 = 0xxx */ + ldr r2, [r1, #1] /* BE:r2 = 123x LE:r2 = x321 */ + mov r3, r3, lsr #24 /* r3 = ...0 */ + orr r3, r3, r2, lsl #8 /* r3 = 3210 */ + str r3, [r0] + bx lr + LMEMCPY_4_PAD + +/* + * 0100: dst is 8-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] + strb r2, [r0] + mov r3, r2, lsr #8 + mov r1, r2, lsr #24 + strb r1, [r0, #0x03] + strh r3, [r0, #0x01] + bx lr + LMEMCPY_4_PAD + +/* + * 0101: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldrb r1, [r1, #0x03] + strb r2, [r0] + strh r3, [r0, #0x01] + strb r1, [r0, #0x03] + bx lr + LMEMCPY_4_PAD + +/* + * 0110: dst is 8-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ + ldrh r3, [r1, #0x02] /* LE:r3 = ..23 LE:r3 = ..32 */ + strb r2, [r0] + mov r2, r2, lsr #8 /* r2 = ...1 */ + orr r2, r2, r3, lsl #8 /* r2 = .321 */ + mov r3, r3, lsr #8 /* r3 = ...3 */ + strh r2, [r0, #0x01] + strb r3, [r0, #0x03] + bx lr + LMEMCPY_4_PAD + +/* + * 0111: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldrb r1, [r1, #0x03] + strb r2, [r0] + strh r3, [r0, #0x01] + strb r1, [r0, #0x03] + bx lr + LMEMCPY_4_PAD + +/* + * 1000: dst is 16-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] + strh r2, [r0] + mov r3, r2, lsr #16 + strh r3, [r0, #0x02] + bx lr + LMEMCPY_4_PAD + +/* + * 1001: dst is 16-bit aligned, src is 8-bit aligned + */ + ldr r2, [r1, #-1] /* BE:r2 = x012 LE:r2 = 210x */ + ldr r3, [r1, #3] /* BE:r3 = 3xxx LE:r3 = xxx3 */ + mov r1, r2, lsr #8 /* BE:r1 = .x01 LE:r1 = .210 */ + strh r1, [r0] + mov r2, r2, lsr #24 /* r2 = ...2 */ + orr r2, r2, r3, lsl #8 /* r2 = xx32 */ + strh r2, [r0, #0x02] + bx lr + LMEMCPY_4_PAD + +/* + * 1010: dst is 16-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] + ldrh r3, [r1, #0x02] + strh r2, [r0] + strh r3, [r0, #0x02] + bx lr + LMEMCPY_4_PAD + +/* + * 1011: dst is 16-bit aligned, src is 8-bit aligned + */ + ldr r3, [r1, #1] /* BE:r3 = 123x LE:r3 = x321 */ + ldr r2, [r1, #-3] /* BE:r2 = xxx0 LE:r2 = 0xxx */ + mov r1, r3, lsr #8 /* BE:r1 = .123 LE:r1 = .x32 */ + strh r1, [r0, #0x02] + mov r3, r3, lsl #8 /* r3 = 321. */ + orr r3, r3, r2, lsr #24 /* r3 = 3210 */ + strh r3, [r0] + bx lr + LMEMCPY_4_PAD + +/* + * 1100: dst is 8-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] /* BE:r2 = 0123 LE:r2 = 3210 */ + strb r2, [r0] + mov r3, r2, lsr #8 + mov r1, r2, lsr #24 + strh r3, [r0, #0x01] + strb r1, [r0, #0x03] + bx lr + LMEMCPY_4_PAD + +/* + * 1101: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldrb r1, [r1, #0x03] + strb r2, [r0] + strh r3, [r0, #0x01] + strb r1, [r0, #0x03] + bx lr + LMEMCPY_4_PAD + +/* + * 1110: dst is 8-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ + ldrh r3, [r1, #0x02] /* BE:r3 = ..23 LE:r3 = ..32 */ + strb r2, [r0] + mov r2, r2, lsr #8 /* r2 = ...1 */ + orr r2, r2, r3, lsl #8 /* r2 = .321 */ + strh r2, [r0, #0x01] + mov r3, r3, lsr #8 /* r3 = ...3 */ + strb r3, [r0, #0x03] + bx lr + LMEMCPY_4_PAD + +/* + * 1111: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldrb r1, [r1, #0x03] + strb r2, [r0] + strh r3, [r0, #0x01] + strb r1, [r0, #0x03] + bx lr + LMEMCPY_4_PAD + + +/****************************************************************************** + * Special case for 6 byte copies + */ +#define LMEMCPY_6_LOG2 6 /* 64 bytes */ +#define LMEMCPY_6_PAD .align LMEMCPY_6_LOG2 + LMEMCPY_6_PAD +.Lmemcpy_6: + and r2, r1, #0x03 + orr r2, r2, r0, lsl #2 + ands r2, r2, #0x0f + sub r3, pc, #0x14 + addne pc, r3, r2, lsl #LMEMCPY_6_LOG2 + +/* + * 0000: dst is 32-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] + ldrh r3, [r1, #0x04] + str r2, [r0] + strh r3, [r0, #0x04] + bx lr + LMEMCPY_6_PAD + +/* + * 0001: dst is 32-bit aligned, src is 8-bit aligned + */ + ldr r2, [r1, #-1] /* BE:r2 = x012 LE:r2 = 210x */ + ldr r3, [r1, #0x03] /* BE:r3 = 345x LE:r3 = x543 */ + mov r2, r2, lsr #8 /* r2 = .210 */ + orr r2, r2, r3, lsl #24 /* r2 = 3210 */ + mov r3, r3, lsr #8 /* BE:r3 = .345 LE:r3 = .x54 */ + str r2, [r0] + strh r3, [r0, #0x04] + bx lr + LMEMCPY_6_PAD + +/* + * 0010: dst is 32-bit aligned, src is 16-bit aligned + */ + ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ + ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ + mov r1, r3, lsr #16 /* r1 = ..54 */ + orr r2, r2, r3, lsl #16 /* r2 = 3210 */ + str r2, [r0] + strh r1, [r0, #0x04] + bx lr + LMEMCPY_6_PAD + +/* + * 0011: dst is 32-bit aligned, src is 8-bit aligned + */ + ldr r2, [r1, #-3] /* BE:r2 = xxx0 LE:r2 = 0xxx */ + ldr r3, [r1, #1] /* BE:r3 = 1234 LE:r3 = 4321 */ + ldr r1, [r1, #5] /* BE:r1 = 5xxx LE:r3 = xxx5 */ + mov r2, r2, lsr #24 /* r2 = ...0 */ + orr r2, r2, r3, lsl #8 /* r2 = 3210 */ + mov r1, r1, lsl #8 /* r1 = xx5. */ + orr r1, r1, r3, lsr #24 /* r1 = xx54 */ + str r2, [r0] + strh r1, [r0, #0x04] + bx lr + LMEMCPY_6_PAD + +/* + * 0100: dst is 8-bit aligned, src is 32-bit aligned + */ + ldr r3, [r1] /* BE:r3 = 0123 LE:r3 = 3210 */ + ldrh r2, [r1, #0x04] /* BE:r2 = ..45 LE:r2 = ..54 */ + mov r1, r3, lsr #8 /* BE:r1 = .012 LE:r1 = .321 */ + strh r1, [r0, #0x01] + strb r3, [r0] + mov r3, r3, lsr #24 /* r3 = ...3 */ + orr r3, r3, r2, lsl #8 /* r3 = .543 */ + mov r2, r2, lsr #8 /* r2 = ...5 */ + strh r3, [r0, #0x03] + strb r2, [r0, #0x05] + bx lr + LMEMCPY_6_PAD + +/* + * 0101: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldrh ip, [r1, #0x03] + ldrb r1, [r1, #0x05] + strb r2, [r0] + strh r3, [r0, #0x01] + strh ip, [r0, #0x03] + strb r1, [r0, #0x05] + bx lr + LMEMCPY_6_PAD + +/* + * 0110: dst is 8-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ + ldr r1, [r1, #0x02] /* BE:r1 = 2345 LE:r1 = 5432 */ + strb r2, [r0] + mov r3, r1, lsr #24 + strb r3, [r0, #0x05] + mov r3, r1, lsr #8 /* r3 = .543 */ + strh r3, [r0, #0x03] + mov r3, r2, lsr #8 /* r3 = ...1 */ + orr r3, r3, r1, lsl #8 /* r3 = 4321 */ + strh r3, [r0, #0x01] + bx lr + LMEMCPY_6_PAD + +/* + * 0111: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldrh ip, [r1, #0x03] + ldrb r1, [r1, #0x05] + strb r2, [r0] + strh r3, [r0, #0x01] + strh ip, [r0, #0x03] + strb r1, [r0, #0x05] + bx lr + LMEMCPY_6_PAD + +/* + * 1000: dst is 16-bit aligned, src is 32-bit aligned + */ + ldrh r2, [r1, #0x04] /* r2 = ..54 */ + ldr r3, [r1] /* r3 = 3210 */ + mov r2, r2, lsl #16 /* r2 = 54.. */ + orr r2, r2, r3, lsr #16 /* r2 = 5432 */ + strh r3, [r0] + str r2, [r0, #0x02] + bx lr + LMEMCPY_6_PAD + +/* + * 1001: dst is 16-bit aligned, src is 8-bit aligned + */ + ldr r3, [r1, #-1] /* BE:r3 = x012 LE:r3 = 210x */ + ldr r2, [r1, #3] /* BE:r2 = 345x LE:r2 = x543 */ + mov r1, r3, lsr #8 /* BE:r1 = .x01 LE:r1 = .210 */ + mov r2, r2, lsl #8 /* r2 = 543. */ + orr r2, r2, r3, lsr #24 /* r2 = 5432 */ + strh r1, [r0] + str r2, [r0, #0x02] + bx lr + LMEMCPY_6_PAD + +/* + * 1010: dst is 16-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] + ldr r3, [r1, #0x02] + strh r2, [r0] + str r3, [r0, #0x02] + bx lr + LMEMCPY_6_PAD + +/* + * 1011: dst is 16-bit aligned, src is 8-bit aligned + */ + ldrb r3, [r1] /* r3 = ...0 */ + ldr r2, [r1, #0x01] /* BE:r2 = 1234 LE:r2 = 4321 */ + ldrb r1, [r1, #0x05] /* r1 = ...5 */ + orr r3, r3, r2, lsl #8 /* r3 = 3210 */ + mov r1, r1, lsl #24 /* r1 = 5... */ + orr r1, r1, r2, lsr #8 /* r1 = 5432 */ + strh r3, [r0] + str r1, [r0, #0x02] + bx lr + LMEMCPY_6_PAD + +/* + * 1100: dst is 8-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] /* BE:r2 = 0123 LE:r2 = 3210 */ + ldrh r1, [r1, #0x04] /* BE:r1 = ..45 LE:r1 = ..54 */ + strb r2, [r0] + mov r2, r2, lsr #8 /* r2 = .321 */ + orr r2, r2, r1, lsl #24 /* r2 = 4321 */ + mov r1, r1, lsr #8 /* r1 = ...5 */ + str r2, [r0, #0x01] + strb r1, [r0, #0x05] + bx lr + LMEMCPY_6_PAD + +/* + * 1101: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldrh ip, [r1, #0x03] + ldrb r1, [r1, #0x05] + strb r2, [r0] + strh r3, [r0, #0x01] + strh ip, [r0, #0x03] + strb r1, [r0, #0x05] + bx lr + LMEMCPY_6_PAD + +/* + * 1110: dst is 8-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ + ldr r1, [r1, #0x02] /* BE:r1 = 2345 LE:r1 = 5432 */ + strb r2, [r0] + mov r2, r2, lsr #8 /* r2 = ...1 */ + orr r2, r2, r1, lsl #8 /* r2 = 4321 */ + mov r1, r1, lsr #24 /* r1 = ...5 */ + str r2, [r0, #0x01] + strb r1, [r0, #0x05] + bx lr + LMEMCPY_6_PAD + +/* + * 1111: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldr r3, [r1, #0x01] + ldrb r1, [r1, #0x05] + strb r2, [r0] + str r3, [r0, #0x01] + strb r1, [r0, #0x05] + bx lr + LMEMCPY_6_PAD + + +/****************************************************************************** + * Special case for 8 byte copies + */ +#define LMEMCPY_8_LOG2 6 /* 64 bytes */ +#define LMEMCPY_8_PAD .align LMEMCPY_8_LOG2 + LMEMCPY_8_PAD +.Lmemcpy_8: + and r2, r1, #0x03 + orr r2, r2, r0, lsl #2 + ands r2, r2, #0x0f + sub r3, pc, #0x14 + addne pc, r3, r2, lsl #LMEMCPY_8_LOG2 + +/* + * 0000: dst is 32-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] + ldr r3, [r1, #0x04] + str r2, [r0] + str r3, [r0, #0x04] + bx lr + LMEMCPY_8_PAD + +/* + * 0001: dst is 32-bit aligned, src is 8-bit aligned + */ + ldr r3, [r1, #-1] /* BE:r3 = x012 LE:r3 = 210x */ + ldr r2, [r1, #0x03] /* BE:r2 = 3456 LE:r2 = 6543 */ + ldrb r1, [r1, #0x07] /* r1 = ...7 */ + mov r3, r3, lsr #8 /* r3 = .210 */ + orr r3, r3, r2, lsl #24 /* r3 = 3210 */ + mov r1, r1, lsl #24 /* r1 = 7... */ + orr r2, r1, r2, lsr #8 /* r2 = 7654 */ + str r3, [r0] + str r2, [r0, #0x04] + bx lr + LMEMCPY_8_PAD + +/* + * 0010: dst is 32-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ + ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ + ldrh r1, [r1, #0x06] /* BE:r1 = ..67 LE:r1 = ..76 */ + orr r2, r2, r3, lsl #16 /* r2 = 3210 */ + mov r3, r3, lsr #16 /* r3 = ..54 */ + orr r3, r3, r1, lsl #16 /* r3 = 7654 */ + str r2, [r0] + str r3, [r0, #0x04] + bx lr + LMEMCPY_8_PAD + +/* + * 0011: dst is 32-bit aligned, src is 8-bit aligned + */ + ldrb r3, [r1] /* r3 = ...0 */ + ldr r2, [r1, #0x01] /* BE:r2 = 1234 LE:r2 = 4321 */ + ldr r1, [r1, #0x05] /* BE:r1 = 567x LE:r1 = x765 */ + orr r3, r3, r2, lsl #8 /* r3 = 3210 */ + mov r2, r2, lsr #24 /* r2 = ...4 */ + orr r2, r2, r1, lsl #8 /* r2 = 7654 */ + str r3, [r0] + str r2, [r0, #0x04] + bx lr + LMEMCPY_8_PAD + +/* + * 0100: dst is 8-bit aligned, src is 32-bit aligned + */ + ldr r3, [r1] /* BE:r3 = 0123 LE:r3 = 3210 */ + ldr r2, [r1, #0x04] /* BE:r2 = 4567 LE:r2 = 7654 */ + strb r3, [r0] + mov r1, r2, lsr #24 /* r1 = ...7 */ + strb r1, [r0, #0x07] + mov r1, r3, lsr #8 /* r1 = .321 */ + mov r3, r3, lsr #24 /* r3 = ...3 */ + orr r3, r3, r2, lsl #8 /* r3 = 6543 */ + strh r1, [r0, #0x01] + str r3, [r0, #0x03] + bx lr + LMEMCPY_8_PAD + +/* + * 0101: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r2, [r1] + ldrh r3, [r1, #0x01] + ldr ip, [r1, #0x03] + ldrb r1, [r1, #0x07] + strb r2, [r0] + strh r3, [r0, #0x01] + str ip, [r0, #0x03] + strb r1, [r0, #0x07] + bx lr + LMEMCPY_8_PAD + +/* + * 0110: dst is 8-bit aligned, src is 16-bit aligned + */ + ldrh r2, [r1] /* BE:r2 = ..01 LE:r2 = ..10 */ + ldr r3, [r1, #0x02] /* BE:r3 = 2345 LE:r3 = 5432 */ + ldrh r1, [r1, #0x06] /* BE:r1 = ..67 LE:r1 = ..76 */ + strb r2, [r0] /* 0 */ + mov ip, r1, lsr #8 /* ip = ...7 */ + strb ip, [r0, #0x07] /* 7 */ + mov ip, r2, lsr #8 /* ip = ...1 */ + orr ip, ip, r3, lsl #8 /* ip = 4321 */ + mov r3, r3, lsr #8 /* r3 = .543 */ + orr r3, r3, r1, lsl #24 /* r3 = 6543 */ + strh ip, [r0, #0x01] + str r3, [r0, #0x03] + bx lr + LMEMCPY_8_PAD + +/* + * 0111: dst is 8-bit aligned, src is 8-bit aligned + */ + ldrb r3, [r1] /* r3 = ...0 */ + ldr ip, [r1, #0x01] /* BE:ip = 1234 LE:ip = 4321 */ + ldrh r2, [r1, #0x05] /* BE:r2 = ..56 LE:r2 = ..65 */ + ldrb r1, [r1, #0x07] /* r1 = ...7 */ + strb r3, [r0] + mov r3, ip, lsr #16 /* BE:r3 = ..12 LE:r3 = ..43 */ + strh ip, [r0, #0x01] + orr r2, r3, r2, lsl #16 /* r2 = 6543 */ + str r2, [r0, #0x03] + strb r1, [r0, #0x07] + bx lr + LMEMCPY_8_PAD + +/* + * 1000: dst is 16-bit aligned, src is 32-bit aligned + */ + ldr r2, [r1] /* BE:r2 = 0123 LE:r2 = 3210 */ + ldr r3, [r1, #0x04] /* BE:r3 = 4567 LE:r3 = 7654 */ + mov r1, r2, lsr #16 /* BE:r1 = ..01 LE:r1 = ..32 */ + strh r2, [r0] + orr r2, r1, r3, lsl #16 /* r2 = 5432 */ + mov r3, r3, lsr #16 /* r3 = ..76 */ + str r2, [r0, #0x02] + strh r3, [r0, #0x06] + bx lr + LMEMCPY_8_PAD *** 2081 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Jan 28 10:51: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 A7A46521397; Thu, 28 Jan 2021 10:51: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 4DRHMm3y1yz4vqZ; Thu, 28 Jan 2021 10:51: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 7946D66BE; Thu, 28 Jan 2021 10:51: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 10SApWOe032109; Thu, 28 Jan 2021 10:51:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SApWC7032108; Thu, 28 Jan 2021 10:51:32 GMT (envelope-from git) Date: Thu, 28 Jan 2021 10:51:32 GMT Message-Id: <202101281051.10SApWC7032108@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: 4e76e4c301c7 - main - Remove obsolete code gated on _ARM_ARCH_* 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: 4e76e4c301c72698e111580e278872a8323fba50 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, 28 Jan 2021 10:51:32 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4e76e4c301c72698e111580e278872a8323fba50 commit 4e76e4c301c72698e111580e278872a8323fba50 Author: Andrew Turner AuthorDate: 2021-01-28 10:41:45 +0000 Commit: Andrew Turner CommitDate: 2021-01-28 10:41:45 +0000 Remove obsolete code gated on _ARM_ARCH_* This is all code only run on ARMv4 and ARMv5. Support for these have been dropped from FreeBSD. Differential Revision: https://reviews.freebsd.org/D28314 --- lib/libc/arm/string/ffs.S | 28 ---------------------------- lib/libc/arm/string/memset.S | 41 ----------------------------------------- stand/arm/uboot/start.S | 2 -- sys/arm/arm/machdep.c | 2 +- sys/libkern/arm/ffs.S | 29 ----------------------------- 5 files changed, 1 insertion(+), 101 deletions(-) diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S index 1e25960d9bec..5756dd81d21d 100644 --- a/lib/libc/arm/string/ffs.S +++ b/lib/libc/arm/string/ffs.S @@ -48,38 +48,10 @@ ENTRY(ffs) /* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */ rsb r1, r0, #0 ands r0, r0, r1 -#ifndef _ARM_ARCH_5 - /* - * now r0 has at most one set bit, call this X - * if X = 0, all further instructions are skipped - */ - adrne r2, .L_ffs_table - orrne r0, r0, r0, lsl #4 /* r0 = X * 0x11 */ - orrne r0, r0, r0, lsl #6 /* r0 = X * 0x451 */ - rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */ - - /* now lookup in table indexed on top 6 bits of r0 */ - ldrbne r0, [ r2, r0, lsr #26 ] - - RET -.text; -.type .L_ffs_table, _ASM_TYPE_OBJECT; -.L_ffs_table: -/* 0 1 2 3 4 5 6 7 */ - .byte 0, 1, 2, 13, 3, 7, 0, 14 /* 0- 7 */ - .byte 4, 0, 8, 0, 0, 0, 0, 15 /* 8-15 */ - .byte 11, 5, 0, 0, 9, 0, 0, 26 /* 16-23 */ - .byte 0, 0, 0, 0, 0, 22, 28, 16 /* 24-31 */ - .byte 32, 12, 6, 0, 0, 0, 0, 0 /* 32-39 */ - .byte 10, 0, 0, 25, 0, 0, 21, 27 /* 40-47 */ - .byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */ - .byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */ -#else itt ne clzne r0, r0 rsbne r0, r0, #32 RET -#endif END(ffs) .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S index 96d2f93183c4..6ac64274db95 100644 --- a/lib/libc/arm/string/memset.S +++ b/lib/libc/arm/string/memset.S @@ -105,20 +105,14 @@ ENTRY(memset) #ifndef _BZERO orr r3, r3, r3, lsl #8 /* Extend value to 16-bits */ #endif -#ifdef _ARM_ARCH_5E tst ip, #0x04 /* Quad-align for armv5e */ -#else - cmp r1, #0x10 -#endif #ifndef _BZERO orr r3, r3, r3, lsl #16 /* Extend value to 32-bits */ #endif -#ifdef _ARM_ARCH_5E itt ne subne r1, r1, #0x04 /* Quad-align if necessary */ strne r3, [ip], #0x04 cmp r1, #0x10 -#endif blt .Lmemset_loop4 /* If less than 16 then use words */ mov r2, r3 /* Duplicate data */ cmp r1, #0x80 /* If < 128 then skip the big loop */ @@ -127,7 +121,6 @@ ENTRY(memset) /* Do 128 bytes at a time */ .Lmemset_loop128: subs r1, r1, #0x80 -#ifdef _ARM_ARCH_5E itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 @@ -148,24 +141,6 @@ ENTRY(memset) strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 -#else - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} -#endif bgt .Lmemset_loop128 it eq RETeq /* Zero length so just exit */ @@ -176,17 +151,10 @@ ENTRY(memset) .Lmemset_loop32: subs r1, r1, #0x20 itttt ge -#ifdef _ARM_ARCH_5E strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 -#else - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} -#endif bgt .Lmemset_loop32 it eq RETeq /* Zero length so just exit */ @@ -195,13 +163,8 @@ ENTRY(memset) /* Deal with 16 bytes or more */ itt ge -#ifdef _ARM_ARCH_5E strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 -#else - stmiage ip!, {r2-r3} - stmiage ip!, {r2-r3} -#endif it eq RETeq /* Zero length so just exit */ @@ -217,15 +180,11 @@ ENTRY(memset) it eq RETeq /* Zero length so just exit */ -#ifdef _ARM_ARCH_5E /* Compensate for 64-bit alignment check */ adds r1, r1, #0x04 it eq RETeq cmp r1, #2 -#else - cmp r1, #-2 -#endif strb r3, [ip], #0x01 /* Set 1 byte */ it ge diff --git a/stand/arm/uboot/start.S b/stand/arm/uboot/start.S index ede6a620e08f..781d4829df35 100644 --- a/stand/arm/uboot/start.S +++ b/stand/arm/uboot/start.S @@ -39,12 +39,10 @@ .globl _start _start: -#ifdef _ARM_ARCH_6 mrc p15, 0, ip, c1, c0, 0 orr ip, ip, #(CPU_CONTROL_UNAL_ENABLE) orr ip, ip, #(CPU_CONTROL_AFLT_ENABLE) mcr p15, 0, ip, c1, c0, 0 -#endif /* Save the arguments and return register before calling self_reloc */ push {r0, r1, r9, lr} diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index 3296adaaa44b..3d966527599d 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -107,7 +107,7 @@ __FBSDID("$FreeBSD$"); #endif -#ifndef _ARM_ARCH_6 +#if __ARM_ARCH < 6 #error FreeBSD requires ARMv6 or later #endif diff --git a/sys/libkern/arm/ffs.S b/sys/libkern/arm/ffs.S index 1ddec95de0b1..871ca64b9a84 100644 --- a/sys/libkern/arm/ffs.S +++ b/sys/libkern/arm/ffs.S @@ -51,37 +51,8 @@ ENTRY(ffs) /* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */ rsb r1, r0, #0 ands r0, r0, r1 -#ifndef _ARM_ARCH_5 - - /* - * now r0 has at most one set bit, call this X - * if X = 0, all further instructions are skipped - */ - adrne r2, .L_ffs_table - orrne r0, r0, r0, lsl #4 /* r0 = X * 0x11 */ - orrne r0, r0, r0, lsl #6 /* r0 = X * 0x451 */ - rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */ - - /* now lookup in table indexed on top 6 bits of r0 */ - ldrbne r0, [ r2, r0, lsr #26 ] - - RET -.text; -.type .L_ffs_table, _ASM_TYPE_OBJECT; -.L_ffs_table: -/* 0 1 2 3 4 5 6 7 */ - .byte 0, 1, 2, 13, 3, 7, 0, 14 /* 0- 7 */ - .byte 4, 0, 8, 0, 0, 0, 0, 15 /* 8-15 */ - .byte 11, 5, 0, 0, 9, 0, 0, 26 /* 16-23 */ - .byte 0, 0, 0, 0, 0, 22, 28, 16 /* 24-31 */ - .byte 32, 12, 6, 0, 0, 0, 0, 0 /* 32-39 */ - .byte 10, 0, 0, 25, 0, 0, 21, 27 /* 40-47 */ - .byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */ - .byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */ -#else clzne r0, r0 rsbne r0, r0, #32 RET -#endif END(ffs) From owner-dev-commits-src-main@freebsd.org Thu Jan 28 14:40: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 D1BBA52675A; Thu, 28 Jan 2021 14:40: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 4DRNSH5f0Tz3h4n; Thu, 28 Jan 2021 14:40: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 B531E11A83; Thu, 28 Jan 2021 14:40: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 10SEel7V031435; Thu, 28 Jan 2021 14:40:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SEeli2031434; Thu, 28 Jan 2021 14:40:47 GMT (envelope-from git) Date: Thu, 28 Jan 2021 14:40:47 GMT Message-Id: <202101281440.10SEeli2031434@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: b8051298b0a3 - main - Fix missing value in uar_page field for ratelimit in mlx5en(4). This is a regression issue after the new UAR API was introduced by f8f5b459d21e . 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: b8051298b0a345ae0bdfcd2ddf89bca1b96c6c2a 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, 28 Jan 2021 14:40:47 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=b8051298b0a345ae0bdfcd2ddf89bca1b96c6c2a commit b8051298b0a345ae0bdfcd2ddf89bca1b96c6c2a Author: Hans Petter Selasky AuthorDate: 2021-01-26 16:01:34 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-28 13:51:58 +0000 Fix missing value in uar_page field for ratelimit in mlx5en(4). This is a regression issue after the new UAR API was introduced by f8f5b459d21e . MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/mlx5/mlx5_en/mlx5_en_rl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c index 95fb59726e24..33b93b1b5ced 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c @@ -66,6 +66,7 @@ mlx5e_rl_build_cq_param(struct mlx5e_rl_priv_data *rl, MLX5_SET(cqc, cqc, log_cq_size, log_sq_size); MLX5_SET(cqc, cqc, cq_period, rl->param.tx_coalesce_usecs); MLX5_SET(cqc, cqc, cq_max_count, rl->param.tx_coalesce_pkts); + MLX5_SET(cqc, cqc, uar_page, rl->priv->mdev->priv.uar->index); switch (rl->param.tx_coalesce_mode) { case 0: From owner-dev-commits-src-main@freebsd.org Thu Jan 28 16:45: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 C8FAD4E1F97; Thu, 28 Jan 2021 16:45: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 4DRRDl247Jz3qZk; Thu, 28 Jan 2021 16:45: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 39CC41333F; Thu, 28 Jan 2021 16:45: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 10SGjxMQ088820; Thu, 28 Jan 2021 16:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGjxkx088819; Thu, 28 Jan 2021 16:45:59 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:45:59 GMT Message-Id: <202101281645.10SGjxkx088819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4abbf816bf06 - main - LinuxKPI: upstream a collection of drm-kmod conflicting changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4abbf816bf06aa70200c5d1d976dd61c2752bdaf 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, 28 Jan 2021 16:45:59 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4abbf816bf06aa70200c5d1d976dd61c2752bdaf commit 4abbf816bf06aa70200c5d1d976dd61c2752bdaf Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:15:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-28 16:15:12 +0000 LinuxKPI: upstream a collection of drm-kmod conflicting changes The upcoming in-kernel implementations for LinuxKPI based on work on iwlwifi (and other wireless drivers) conflicts in a few places with the drm-kmod graphics work outside the base system. In order to transition smoothly extract the conflicting bits. This included "unaligned" accessor functions, sg_pcopy_from_buffer(), IS_*() macros (to be further restricted in the future), power management bits (possibly no longer conflicting with DRM), and other minor changes. Obtained-from: bz_iwlwifi Sponsored-by: The FreeBSD Foundation MFC after: 3 days Reviewed by: kib, hselasky, manu, bdragon (looked at earlier versions) Differential Revision: https://reviews.freebsd.org/D26598 --- sys/compat/linuxkpi/common/include/asm/unaligned.h | 78 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/kernel.h | 42 ++++++++++++ sys/compat/linuxkpi/common/include/linux/kobject.h | 14 ++++ sys/compat/linuxkpi/common/include/linux/lockdep.h | 1 + sys/compat/linuxkpi/common/include/linux/pm.h | 52 +++++++++++++++ .../linuxkpi/common/include/linux/scatterlist.h | 54 +++++++++++++++ 6 files changed, 241 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/asm/unaligned.h b/sys/compat/linuxkpi/common/include/asm/unaligned.h new file mode 100644 index 000000000000..7597f00f7596 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/asm/unaligned.h @@ -0,0 +1,78 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb under sponsorship from + * the FreeBSD Foundation. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _ASM_UNALIGNED_H +#define _ASM_UNALIGNED_H + +#include +#include + +static __inline uint32_t +get_unaligned_le32(const void *p) +{ + + return (le32_to_cpup((const __le32 *)p)); +} + +static __inline void +put_unaligned_le32(__le32 v, void *p) +{ + __le32 x; + + x = cpu_to_le32(v); + memcpy(p, &x, sizeof(x)); +} + +static __inline void +put_unaligned_le64(__le64 v, void *p) +{ + __le64 x; + + x = cpu_to_le64(v); + memcpy(p, &x, sizeof(x)); +} + +static __inline uint16_t +get_unaligned_be16(const void *p) +{ + + return (be16_to_cpup((const __be16 *)p)); +} + +static __inline uint32_t +get_unaligned_be32(const void *p) +{ + + return (be32_to_cpup((const __be32 *)p)); +} + +#endif /* _ASM_UNALIGNED_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 9b0a2df72322..daef6216a151 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -593,4 +593,46 @@ linux_ratelimited(linux_ratelimit_t *rl) #define TAINT_WARN 0 #define test_taint(x) (0) +/* + * Checking if an option is defined would be easy if we could do CPP inside CPP. + * The defined case whether -Dxxx or -Dxxx=1 are easy to deal with. In either + * case the defined value is "1". A more general -Dxxx= case will require + * more effort to deal with all possible "true" values. Hope we do not have + * to do this as well. + * The real problem is the undefined case. To avoid this problem we do the + * concat/varargs trick: "yyy" ## xxx can make two arguments if xxx is "1" + * by having a #define for yyy_1 which is "ignore,". + * Otherwise we will just get "yyy". + * Need to be careful about variable substitutions in macros though. + * This way we make a (true, false) problem a (don't care, true, false) or a + * (don't care true, false). Then we can use a variadic macro to only select + * the always well known and defined argument #2. And that seems to be + * exactly what we need. Use 1 for true and 0 for false to also allow + * #if IS_*() checks pre-compiler checks which do not like #if true. + */ +#define ___XAB_1 dontcare, +#define ___IS_XAB(_ignore, _x, ...) (_x) +#define __IS_XAB(_x) ___IS_XAB(_x 1, 0) +#define _IS_XAB(_x) __IS_XAB(__CONCAT(___XAB_, _x)) + +/* This is if CONFIG_ccc=y. */ +#define IS_BUILTIN(_x) _IS_XAB(_x) +/* This is if CONFIG_ccc=m. */ +#define IS_MODULE(_x) _IS_XAB(_x ## _MODULE) +/* This is if CONFIG_ccc is compiled in(=y) or a module(=m). */ +#define IS_ENABLED(_x) (IS_BUILTIN(_x) || IS_MODULE(_x)) +/* + * This is weird case. If the CONFIG_ccc is builtin (=y) this returns true; + * or if the CONFIG_ccc is a module (=m) and the caller is built as a module + * (-DMODULE defined) this returns true, but if the callers is not a module + * (-DMODULE not defined, which means caller is BUILTIN) then it returns + * false. In other words, a module can reach the kernel, a module can reach + * a module, but the kernel cannot reach a module, and code never compiled + * cannot be reached either. + * XXX -- I'd hope the module-to-module case would be handled by a proper + * module dependency definition (MODULE_DEPEND() in FreeBSD). + */ +#define IS_REACHABLE(_x) (IS_BUILTIN(_x) || \ + (IS_MODULE(_x) && IS_BUILTIN(MODULE))) + #endif /* _LINUX_KERNEL_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/kobject.h b/sys/compat/linuxkpi/common/include/linux/kobject.h index bd9e1c4ec6f5..403ec1495c32 100644 --- a/sys/compat/linuxkpi/common/include/linux/kobject.h +++ b/sys/compat/linuxkpi/common/include/linux/kobject.h @@ -41,6 +41,8 @@ struct kobject; struct sysctl_oid; +#define KOBJ_CHANGE 0x01 + struct kobj_type { void (*release)(struct kobject *kobj); const struct sysfs_ops *sysfs_ops; @@ -151,4 +153,16 @@ int kobject_set_name(struct kobject *kobj, const char *fmt, ...); int kobject_init_and_add(struct kobject *kobj, const struct kobj_type *ktype, struct kobject *parent, const char *fmt, ...); +static __inline void +kobject_uevent_env(struct kobject *kobj, int action, char *envp[]) +{ + + /* + * iwlwifi(4) sends an INACCESSIBLE event when it detects that the card + * (pice endpoint) is gone and it attempts a removal cleanup. + * Not sure if we do anything related to udev/sysfs at the moment or + * need a shortcut or simply ignore it (for now). + */ +} + #endif /* _LINUX_KOBJECT_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index d2b3d4485dde..a86157ba5924 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -42,6 +42,7 @@ struct lock_class_key { #define lockdep_set_class_and_name(lock, key, name) #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) +#define lockdep_init_map(_map, _name, _key, _x) do { } while(0) #ifdef INVARIANTS #define lockdep_assert_held(m) do { \ diff --git a/sys/compat/linuxkpi/common/include/linux/pm.h b/sys/compat/linuxkpi/common/include/linux/pm.h new file mode 100644 index 000000000000..6b8a7e768a8c --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/pm.h @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb under sponsorship from + * the FreeBSD Foundation. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_PM_H +#define _LINUXKPI_LINUX_PM_H + +#ifdef CONFIG_PM_SLEEP +#define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ + .suspend = _suspendfunc, \ + .resume = _resumefunc, \ + .freeze = _suspendfunc, \ + .thaw = _resumefunc, \ + .poweroff = _suspendfunc, \ + .restore = _resumefunc, \ +} +#else +#define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ +} +#endif + +#endif /* _LINUXKPI_LINUX_PM_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 9104cb8dd78a..ebf0632f6f58 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -32,6 +32,9 @@ #ifndef _LINUX_SCATTERLIST_H_ #define _LINUX_SCATTERLIST_H_ +#include +#include + #include #include #include @@ -479,4 +482,55 @@ sg_page_iter_page(struct sg_page_iter *piter) return (nth_page(sg_page(piter->sg), piter->sg_pgoffset)); } +static __inline size_t +sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents, + const void *buf, size_t buflen, off_t skip) +{ + struct sg_page_iter piter; + struct page *page; + struct sf_buf *sf; + size_t len, copied; + char *p, *b; + + if (buflen == 0) + return (0); + + b = __DECONST(char *, buf); + copied = 0; + sched_pin(); + for_each_sg_page(sgl, &piter, nents, 0) { + + /* Skip to the start. */ + if (piter.sg->length <= skip) { + skip -= piter.sg->length; + continue; + } + + /* See how much to copy. */ + KASSERT(((piter.sg->length - skip) != 0 && (buflen != 0)), + ("%s: sg len %u - skip %ju || buflen %zu is 0\n", + __func__, piter.sg->length, (uintmax_t)skip, buflen)); + len = min(piter.sg->length - skip, buflen); + + page = sg_page_iter_page(&piter); + sf = sf_buf_alloc(page, SFB_CPUPRIVATE | SFB_NOWAIT); + if (sf == NULL) + break; + p = (char *)sf_buf_kva(sf) + piter.sg_pgoffset + skip; + memcpy(p, b, len); + sf_buf_free(sf); + + copied += len; + /* Either we exactly filled the page, or we are done. */ + buflen -= len; + if (buflen == 0) + break; + skip -= len; + b += len; + } + sched_unpin(); + + return (copied); +} + #endif /* _LINUX_SCATTERLIST_H_ */ From owner-dev-commits-src-main@freebsd.org Thu Jan 28 16:46: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 70F6A4E1E7C; Thu, 28 Jan 2021 16:46: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 4DRRDm2kXWz3qB4; Thu, 28 Jan 2021 16:46: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 50F3013340; Thu, 28 Jan 2021 16:46: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 10SGk055088838; Thu, 28 Jan 2021 16:46:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGk0aL088837; Thu, 28 Jan 2021 16:46:00 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:46:00 GMT Message-Id: <202101281646.10SGk0aL088837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1fac2cb4d6e5 - main - LinuxKPI: enhance PCI bits for DRM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fac2cb4d6e5cfa1b8ff689213011b0fe077ffa7 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, 28 Jan 2021 16:46:00 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1fac2cb4d6e5cfa1b8ff689213011b0fe077ffa7 commit 1fac2cb4d6e5cfa1b8ff689213011b0fe077ffa7 Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:23:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-28 16:23:19 +0000 LinuxKPI: enhance PCI bits for DRM In pci_domain_nr() directly return the domain which got set in lkpifill_pci_dev() in all cases. This was missed between D27550 and 105a37cac76b971f7a94409fbdc4f508a7e97fa0 . In order to implement pci_dev_put() harmonize further code (which was started in the aforementioned commit) and add kobj related bits (through the now common lkpifill_pci_dev() code) to the DRM specific calls without adding the DRM allocated pci devices to the pci_devices list. Add a release for the lkpinew_pci_dev() (DRM) case so freeing will work. This allows the DRM created devices to use the normal kobj/refcount logic and work with, e.g., pci_dev_put(). (For a slightly more detailed code walk see the review). Sponsored-by: The FreeBSD Foundation Obtained-from: bz_iwlwifi (partially) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28188 --- sys/compat/linuxkpi/common/include/linux/pci.h | 10 +++++- sys/compat/linuxkpi/common/src/linux_pci.c | 42 +++++++++++++++----------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 6338f5795f0a..ddb3f0b222a5 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -338,6 +338,14 @@ pci_set_drvdata(struct pci_dev *pdev, void *data) dev_set_drvdata(&pdev->dev, data); } +static __inline void +pci_dev_put(struct pci_dev *pdev) +{ + + if (pdev != NULL) + put_device(&pdev->dev); +} + static inline int pci_enable_device(struct pci_dev *pdev) { @@ -1094,7 +1102,7 @@ static inline int pci_domain_nr(struct pci_bus *pbus) { - return (pci_get_domain(pbus->self->dev.bsddev)); + return (pbus->domain); } static inline int diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 0e184b64884b..075df3c2adf7 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -220,24 +220,42 @@ lkpifill_pci_dev(device_t dev, struct pci_dev *pdev) pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); pdev->vendor = pci_get_vendor(dev); pdev->device = pci_get_device(dev); + pdev->subsystem_vendor = pci_get_subvendor(dev); + pdev->subsystem_device = pci_get_subdevice(dev); pdev->class = pci_get_class(dev); pdev->revision = pci_get_revid(dev); - pdev->dev.bsddev = dev; + pdev->bus = malloc(sizeof(*pdev->bus), M_DEVBUF, M_WAITOK | M_ZERO); pdev->bus->self = pdev; pdev->bus->number = pci_get_bus(dev); pdev->bus->domain = pci_get_domain(dev); + pdev->dev.bsddev = dev; + pdev->dev.parent = &linux_root_device; + INIT_LIST_HEAD(&pdev->dev.irqents); + kobject_init(&pdev->dev.kobj, &linux_dev_ktype); + kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); + kobject_add(&pdev->dev.kobj, &linux_root_device.kobj, + kobject_name(&pdev->dev.kobj)); +} + +static void +lkpinew_pci_dev_release(struct device *dev) +{ + struct pci_dev *pdev; + + pdev = to_pci_dev(dev); + free(pdev->bus, M_DEVBUF); + free(pdev, M_DEVBUF); } static struct pci_dev * lkpinew_pci_dev(device_t dev) { struct pci_dev *pdev; - struct pci_bus *pbus; pdev = malloc(sizeof(*pdev), M_DEVBUF, M_WAITOK|M_ZERO); - pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK|M_ZERO); - pdev->bus = pbus; lkpifill_pci_dev(dev, pdev); + pdev->dev.release = lkpinew_pci_dev_release; + return (pdev); } @@ -309,7 +327,6 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, const struct pci_device_id *id, struct pci_dev *pdev) { struct resource_list_entry *rle; - struct pci_devinfo *dinfo; device_t parent; uintptr_t rid; int error; @@ -321,30 +338,19 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, isdrm = pdrv != NULL && pdrv->isdrm; if (isdrm) { + struct pci_devinfo *dinfo; + dinfo = device_get_ivars(parent); device_set_ivars(dev, dinfo); - } else { - dinfo = device_get_ivars(dev); } - pdev->bus = malloc(sizeof(*pdev->bus), M_DEVBUF, M_WAITOK | M_ZERO); lkpifill_pci_dev(dev, pdev); - pdev->dev.parent = &linux_root_device; - INIT_LIST_HEAD(&pdev->dev.irqents); if (isdrm) PCI_GET_ID(device_get_parent(parent), parent, PCI_ID_RID, &rid); else PCI_GET_ID(parent, dev, PCI_ID_RID, &rid); pdev->devfn = rid; - pdev->device = dinfo->cfg.device; - pdev->vendor = dinfo->cfg.vendor; - pdev->subsystem_vendor = dinfo->cfg.subvendor; - pdev->subsystem_device = dinfo->cfg.subdevice; pdev->pdrv = pdrv; - kobject_init(&pdev->dev.kobj, &linux_dev_ktype); - kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); - kobject_add(&pdev->dev.kobj, &linux_root_device.kobj, - kobject_name(&pdev->dev.kobj)); rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 0); if (rle != NULL) pdev->dev.irq = rle->start; From owner-dev-commits-src-main@freebsd.org Thu Jan 28 16:45: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 40AE14E1ED1; Thu, 28 Jan 2021 16:45: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 4DRRDk1Zs1z3q5G; Thu, 28 Jan 2021 16:45: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 1C77013558; Thu, 28 Jan 2021 16:45: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 10SGjwNc088798; Thu, 28 Jan 2021 16:45:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGjwmh088797; Thu, 28 Jan 2021 16:45:58 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:45:58 GMT Message-Id: <202101281645.10SGjwmh088797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a6c2507d1bae - main - LinuxKPI: add firmware loading support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6c2507d1baedb183268e31bc6b6f659a9529904 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, 28 Jan 2021 16:45:59 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a6c2507d1baedb183268e31bc6b6f659a9529904 commit a6c2507d1baedb183268e31bc6b6f659a9529904 Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:05:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-28 16:05:32 +0000 LinuxKPI: add firmware loading support Implement linux firmware KPI compat code. This includes: request_firmware() request_firmware_nowait(), request_firmware_direct(), firmware_request_nowarn(), and release_firmware(). Given we will try to map requested names from natively ported or full-linuxkpi-using drivers to a firmware(9) auto-loading name format (.ko file name and image name matching), we quieten firmware(9) and print success or failure (unless the _nowarn() version was called) in the linuxkpi implementation. At the moment we try up-to 4 different naming combinations, with path stripped, original name, and requested name with '/' or '.' replaced. We do not currently defer loading in the "nowait" case. Sponsored-by: The FreeBSD Foundation Sponsored-by: Rubicon Communications, LLC ("Netgate") (firmware(9) nowarn update from D27413) MFC after: 3 days Reviewed by: kib, manu (looked at older versions) Differential Revision: https://reviews.freebsd.org/D27414 --- .../linuxkpi/common/include/linux/firmware.h | 105 ++++++++++++ sys/compat/linuxkpi/common/src/linux_firmware.c | 178 +++++++++++++++++++++ sys/conf/files | 2 + sys/modules/linuxkpi/Makefile | 1 + 4 files changed, 286 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/firmware.h b/sys/compat/linuxkpi/common/include/linux/firmware.h new file mode 100644 index 000000000000..ada7d0d73edf --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/firmware.h @@ -0,0 +1,105 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb under sponsorship from + * the FreeBSD Foundation. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_FIRMWARE_H +#define _LINUXKPI_LINUX_FIRMWARE_H + +#include +#include +#include + +struct firmware; + +struct linuxkpi_firmware { + size_t size; + const uint8_t *data; + /* XXX Does Linux expose anything else? */ + + /* This is LinuxKPI implementation private. */ + const struct firmware *fbdfw; +}; + +int linuxkpi_request_firmware_nowait(struct module *, bool, const char *, + struct device *, gfp_t, void *, + void(*cont)(const struct linuxkpi_firmware *, void *)); +int linuxkpi_request_firmware(const struct linuxkpi_firmware **, + const char *, struct device *); +int linuxkpi_firmware_request_nowarn(const struct linuxkpi_firmware **, + const char *, struct device *); +void linuxkpi_release_firmware(const struct linuxkpi_firmware *); + + +static __inline int +request_firmware_nowait(struct module *mod, bool _t, + const char *fw_name, struct device *dev, gfp_t gfp, void *drv, + void(*cont)(const struct linuxkpi_firmware *, void *)) +{ + + + return (linuxkpi_request_firmware_nowait(mod, _t, fw_name, dev, gfp, + drv, cont)); +} + +static __inline int +request_firmware(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (linuxkpi_request_firmware(fw, fw_name, dev)); +} + +static __inline int +request_firmware_direct(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (linuxkpi_request_firmware(fw, fw_name, dev)); +} + +static __inline int +firmware_request_nowarn(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (linuxkpi_firmware_request_nowarn(fw, fw_name, dev)); +} + +static __inline void +release_firmware(const struct linuxkpi_firmware *fw) +{ + + linuxkpi_release_firmware(fw); +} + +#define firmware linuxkpi_firmware + +#endif /* _LINUXKPI_LINUX_FIRMWARE_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_firmware.c b/sys/compat/linuxkpi/common/src/linux_firmware.c new file mode 100644 index 000000000000..75147a311827 --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_firmware.c @@ -0,0 +1,178 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb under sponsorship from + * the FreeBSD Foundation. + * + * 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. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include + +#include +#undef firmware + +MALLOC_DEFINE(M_LKPI_FW, "lkpifw", "LinuxKPI firmware"); + +static int +_linuxkpi_request_firmware(const char *fw_name, const struct linuxkpi_firmware **fw, + struct device *dev, gfp_t gfp __unused, bool enoentok, bool warn) +{ + const struct firmware *fbdfw; + struct linuxkpi_firmware *lfw; + const char *fwimg; + char *p; + uint32_t flags; + + if (fw_name == NULL || fw == NULL || dev == NULL) + return (-EINVAL); + + /* Set independent on "warn". To debug, bootverbose is avail. */ + flags = FIRMWARE_GET_NOWARN; + + KASSERT(gfp == GFP_KERNEL, ("%s: gfp %#x\n", __func__, gfp)); + lfw = malloc(sizeof(*lfw), M_LKPI_FW, M_WAITOK | M_ZERO); + + /* + * Linux can have a path in the firmware which is hard to replicate + * for auto-firmware-module-loading. + * On FreeBSD, depending on what people do, the firmware will either + * be called "fw", or "dir_fw", or "modname_dir_fw". The latter the + * driver author has to deal with herself (requesting the special name). + * We also optionally flatten '/'s and '.'s as some firmware modules do. + * We probe in the least-of-work order avoiding memory operations. + * It will be preferred to build the firmware .ko in a well matching + * way rather than adding more name-mangling-hacks here in the future + * (though we could if needed). + */ + /* (1) Try any name removed of path. */ + fwimg = strrchr(fw_name, '/'); + if (fwimg != NULL) + fwimg++; + if (fwimg == NULL || *fwimg == '\0') + fwimg = fw_name; + fbdfw = firmware_get_flags(fwimg, flags); + /* (2) Try the original name if we have not yet. */ + if (fbdfw == NULL && fwimg != fw_name) { + fwimg = fw_name; + fbdfw = firmware_get_flags(fwimg, flags); + } + /* (3) Flatten '/' and then '.' to '_' and try with adjusted name. */ + if (fbdfw == NULL && + (strchr(fw_name, '/') != NULL || strchr(fw_name, '.') != NULL)) { + fwimg = strdup(fw_name, M_LKPI_FW); + if (fwimg != NULL) { + while ((p = strchr(fwimg, '/')) != NULL) + *p = '_'; + fbdfw = firmware_get_flags(fwimg, flags); + if (fbdfw == NULL) { + while ((p = strchr(fwimg, '.')) != NULL) + *p = '_'; + fbdfw = firmware_get_flags(fwimg, flags); + } + free(__DECONST(void *, fwimg), M_LKPI_FW); + } + } + if (fbdfw == NULL) { + if (enoentok) + *fw = lfw; + else { + free(lfw, M_LKPI_FW); + *fw = NULL; + } + if (warn) + device_printf(dev->bsddev, "could not load firmware " + "image '%s'\n", fw_name); + return (-ENOENT); + } + + device_printf(dev->bsddev,"successfully loaded firmware image '%s'\n", + fw_name); + lfw->fbdfw = fbdfw; + lfw->data = (const uint8_t *)fbdfw->data; + lfw->size = fbdfw->datasize; + *fw = lfw; + return (0); +} + +int +linuxkpi_request_firmware_nowait(struct module *mod __unused, bool _t __unused, + const char *fw_name, struct device *dev, gfp_t gfp, void *drv, + void(*cont)(const struct linuxkpi_firmware *, void *)) +{ + const struct linuxkpi_firmware *lfw; + int error; + + /* + * Linux seems to run the callback if it cannot find the firmware. + * The fact that this is "_nowait()" and has a callback seems to + * imply that this is run in a deferred conext which we currently + * do not do. Should it become necessary (a driver actually requiring + * it) we would need to implement it here. + */ + error = _linuxkpi_request_firmware(fw_name, &lfw, dev, gfp, true, true); + if (error == -ENOENT) + error = 0; + if (error == 0) + cont(lfw, drv); + + return (error); +} + +int +linuxkpi_request_firmware(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (_linuxkpi_request_firmware(fw_name, fw, dev, GFP_KERNEL, false, + true)); +} + +int +linuxkpi_firmware_request_nowarn(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (_linuxkpi_request_firmware(fw_name, fw, dev, GFP_KERNEL, false, + false)); +} + +void +linuxkpi_release_firmware(const struct linuxkpi_firmware *fw) +{ + + if (fw == NULL) + return; + + if (fw->fbdfw) + firmware_put(fw->fbdfw, FIRMWARE_UNLOAD); + free(__DECONST(void *, fw), M_LKPI_FW); +} diff --git a/sys/conf/files b/sys/conf/files index 2bcda0c0d779..bb6d622b1e9a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4559,6 +4559,8 @@ compat/linuxkpi/common/src/linux_current.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_dmi.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_firmware.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_hrtimer.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_kthread.c optional compat_linuxkpi \ diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile index f9ae0e60e339..7bb4080fa81d 100644 --- a/sys/modules/linuxkpi/Makefile +++ b/sys/modules/linuxkpi/Makefile @@ -5,6 +5,7 @@ KMOD= linuxkpi SRCS= linux_compat.c \ linux_current.c \ linux_dmi.c \ + linux_firmware.c \ linux_hrtimer.c \ linux_idr.c \ linux_kmod.c \ From owner-dev-commits-src-main@freebsd.org Thu Jan 28 16:46: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 8283C4E2095; Thu, 28 Jan 2021 16:46: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 4DRRDp1Phyz3qZs; Thu, 28 Jan 2021 16:46: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 9F4061342F; Thu, 28 Jan 2021 16:46: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 10SGk1O0088857; Thu, 28 Jan 2021 16:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGk1Ur088856; Thu, 28 Jan 2021 16:46:01 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:46:01 GMT Message-Id: <202101281646.10SGk1Ur088856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: fa765ca73e55 - main - LinuxKPI: implement devres() framework parts and two examples MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa765ca73e553399ffbad382e579e4c2b4d0fc12 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, 28 Jan 2021 16:46:03 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fa765ca73e553399ffbad382e579e4c2b4d0fc12 commit fa765ca73e553399ffbad382e579e4c2b4d0fc12 Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:32:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-28 16:32:43 +0000 LinuxKPI: implement devres() framework parts and two examples This code implements a version of the devres framework found working for various iwlwifi use cases and also providing functions for ttm_page_alloc_dma.c from DRM. Part of the framework replicates the consumed KPI, while others are internal helper functions. In addition the simple devm_k*malloc() consumers were implemented and kvasprintf() was enhanced to also work for the devm_kasprintf() case. Addmittingly lkpi_devm_kmalloc_release() could be avoided but for the overall understanding of the code and possible memory tracing it may still be helpful. Further devsres consumer are implemented for iwlwifi but will follow later as the main reason for this change is to sort out overlap with DRM. Sponsored-by: The FreeBSD Foundation Obtained-from: bz_iwlwifi MFC After: 3 days Reviewed-by: hselasky, manu Differential Revision: https://reviews.freebsd.org/D28189 --- sys/compat/linuxkpi/common/include/linux/device.h | 42 ++++ sys/compat/linuxkpi/common/src/linux_compat.c | 29 ++- sys/compat/linuxkpi/common/src/linux_devres.c | 226 ++++++++++++++++++++++ sys/conf/files | 2 + sys/modules/linuxkpi/Makefile | 1 + 5 files changed, 297 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index a55f6b0215ce..2ffe70f45c6e 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -562,5 +562,47 @@ dev_to_node(struct device *dev) char *kvasprintf(gfp_t, const char *, va_list); char *kasprintf(gfp_t, const char *, ...); +char *lkpi_devm_kasprintf(struct device *, gfp_t, const char *, ...); + +#define devm_kasprintf(_dev, _gfp, _fmt, ...) \ + lkpi_devm_kasprintf(_dev, _gfp, _fmt, ##__VA_ARGS__) + +void *lkpi_devres_alloc(void(*release)(struct device *, void *), size_t, gfp_t); +void lkpi_devres_add(struct device *, void *); +void lkpi_devres_free(void *); +void *lkpi_devres_find(struct device *, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *); +int lkpi_devres_destroy(struct device *, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *); +#define devres_alloc(_r, _s, _g) lkpi_devres_alloc(_r, _s, _g) +#define devres_add(_d, _p) lkpi_devres_add(_d, _p) +#define devres_free(_p) lkpi_devres_free(_p) +#define devres_find(_d, _rfn, _mfn, _mp) \ + lkpi_devres_find(_d, _rfn, _mfn, _mp) +#define devres_destroy(_d, _rfn, _mfn, _mp) \ + lkpi_devres_destroy(_d, _rfn, _mfn, _mp) + +/* LinuxKPI internal functions. */ +void lkpi_devres_release_free_list(struct device *); +void lkpi_devres_unlink(struct device *, void *); +void lkpi_devm_kmalloc_release(struct device *, void *); + +static __inline void * +devm_kmalloc(struct device *dev, size_t size, gfp_t gfp) +{ + void *p; + + p = lkpi_devres_alloc(lkpi_devm_kmalloc_release, size, gfp); + if (p != NULL) + lkpi_devres_add(dev, p); + + return (p); +} + +#define devm_kzalloc(_dev, _size, _gfp) \ + devm_kmalloc((_dev), (_size), (_gfp) | __GFP_ZERO) + +#define devm_kcalloc(_dev, _sizen, _size, _gfp) \ + devm_kmalloc((_dev), ((_sizen) * (_size)), (_gfp) | __GFP_ZERO) #endif /* _LINUX_DEVICE_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index b73f6fed03af..2ad936311204 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1854,8 +1854,8 @@ vunmap(void *addr) kfree(vmmap); } -char * -kvasprintf(gfp_t gfp, const char *fmt, va_list ap) +static char * +devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, va_list ap) { unsigned int len; char *p; @@ -1865,13 +1865,36 @@ kvasprintf(gfp_t gfp, const char *fmt, va_list ap) len = vsnprintf(NULL, 0, fmt, aq); va_end(aq); - p = kmalloc(len + 1, gfp); + if (dev != NULL) + p = devm_kmalloc(dev, len + 1, gfp); + else + p = kmalloc(len + 1, gfp); if (p != NULL) vsnprintf(p, len + 1, fmt, ap); return (p); } +char * +kvasprintf(gfp_t gfp, const char *fmt, va_list ap) +{ + + return (devm_kvasprintf(NULL, gfp, fmt, ap)); +} + +char * +lkpi_devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...) +{ + va_list ap; + char *p; + + va_start(ap, fmt); + p = devm_kvasprintf(dev, gfp, fmt, ap); + va_end(ap); + + return (p); +} + char * kasprintf(gfp_t gfp, const char *fmt, ...) { diff --git a/sys/compat/linuxkpi/common/src/linux_devres.c b/sys/compat/linuxkpi/common/src/linux_devres.c new file mode 100644 index 000000000000..96ff3e486d1d --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_devres.c @@ -0,0 +1,226 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 The FreeBSD Foundation + * + * This software was developed by Bj\xc3\xb6rn Zeeb under sponsorship from + * the FreeBSD Foundation. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +/* + * Linux devres KPI implementation. + */ + +struct devres { + struct list_head entry; + void (*release)(struct device *, void *); + + /* Must come last. */ + uint8_t __drdata[0] __aligned(CACHE_LINE_SIZE); +}; + +void * +lkpi_devres_alloc(void(*release)(struct device *, void *), + size_t size, gfp_t gfp) +{ + void *p; + struct devres *dr; + size_t total; + + if (size == 0) + return (NULL); + + total = sizeof(*dr) + size; + dr = kmalloc(total, gfp); + if (dr == NULL) + return (NULL); + + INIT_LIST_HEAD(&dr->entry); + dr->release = release; + p = (void *)(dr+1); + + return (p); +} + +static void +lkpi_devres_free_dr(struct devres *dr) +{ + + /* + * We have no dev, so cannot lock. This means someone else has + * to do this prior to us if devres_add() had been called. + */ + KASSERT(list_empty_careful(&dr->entry), + ("%s: dr %p still on devres_head\n", __func__, dr)); + kfree(dr); +} + +void +lkpi_devres_free(void *p) +{ + struct devres *dr; + + if (p == NULL) + return; + + dr = container_of(p, struct devres, __drdata); + lkpi_devres_free_dr(dr); +} + +void +lkpi_devres_add(struct device *dev, void *p) +{ + struct devres *dr; + + KASSERT(dev != NULL && p != NULL, ("%s: dev %p p %p\n", + __func__, dev, p)); + + dr = container_of(p, struct devres, __drdata); + spin_lock(&dev->devres_lock); + list_add(&dr->entry, &dev->devres_head); + spin_unlock(&dev->devres_lock); +} + +static struct devres * +lkpi_devres_find_dr(struct device *dev, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *mp) +{ + struct devres *dr, *next; + void *p; + + KASSERT(dev != NULL, ("%s: dev %p\n", __func__, dev)); + assert_spin_locked(&dev->devres_lock); + + list_for_each_entry_safe(dr, next, &dev->devres_head, entry) { + if (dr->release != release) + continue; + p = (void *)(dr+1); + if (match != NULL && match(dev, p, mp) == false) + continue; + return (dr); + } + + return (NULL); +} + +void * +lkpi_devres_find(struct device *dev, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *mp) +{ + struct devres *dr; + + KASSERT(dev != NULL, ("%s: dev %p\n", __func__, dev)); + + spin_lock(&dev->devres_lock); + dr = lkpi_devres_find_dr(dev, release, match, mp); + spin_unlock(&dev->devres_lock); + + if (dr == NULL) + return (NULL); + + return ((void *)(dr + 1)); +} + +static void +lkpi_devres_unlink_locked(struct device *dev, struct devres *dr) +{ + KASSERT(dev != NULL, ("%s: dev %p\n", __func__, dev)); + KASSERT(dr != NULL, ("%s: dr %p\n", __func__, dr)); + assert_spin_locked(&dev->devres_lock); + + list_del_init(&dr->entry); +} + +void +lkpi_devres_unlink(struct device *dev, void *p) +{ + struct devres *dr; + + KASSERT(dev != NULL && p != NULL, ("%s: dev %p p %p\n", + __func__, dev, p)); + + dr = container_of(p, struct devres, __drdata); + spin_lock(&dev->devres_lock); + lkpi_devres_unlink_locked(dev, dr); + spin_unlock(&dev->devres_lock); +} + +/* This is called on device free. */ +void +lkpi_devres_release_free_list(struct device *dev) +{ + struct devres *dr, *next; + void *p; + + /* Free any resources allocated on the device. */ + /* No need to lock anymore. */ + list_for_each_entry_safe(dr, next, &dev->devres_head, entry) { + p = (void *)(dr+1); + if (dr->release != NULL) + dr->release(dev, p); + /* This should probably be a function of some kind. */ + list_del_init(&dr->entry); + lkpi_devres_free(p); + } +} + +int +lkpi_devres_destroy(struct device *dev, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *mp) +{ + struct devres *dr; + + spin_lock(&dev->devres_lock); + dr = lkpi_devres_find_dr(dev, release, match, mp); + if (dr != NULL) + lkpi_devres_unlink_locked(dev, dr); + spin_unlock(&dev->devres_lock); + + if (dr == NULL) + return (-ENOENT); + lkpi_devres_free_dr(dr); + + return (0); +} + +/* + * Devres release function for k*malloc(). + * While there is nothing to do here adding, e.g., tracing would be + * possible so we leave the empty function here. + * Also good for documentation as it is the simplest example. + */ +void +lkpi_devm_kmalloc_release(struct device *dev __unused, void *p __unused) +{ + + /* Nothing to do. Freed with the devres. */ +} diff --git a/sys/conf/files b/sys/conf/files index bb6d622b1e9a..edca1003e904 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4557,6 +4557,8 @@ compat/linuxkpi/common/src/linux_compat.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_current.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_devres.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_dmi.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_firmware.c optional compat_linuxkpi \ diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile index 7bb4080fa81d..4274d211b10e 100644 --- a/sys/modules/linuxkpi/Makefile +++ b/sys/modules/linuxkpi/Makefile @@ -4,6 +4,7 @@ KMOD= linuxkpi SRCS= linux_compat.c \ linux_current.c \ + linux_devres.c \ linux_dmi.c \ linux_firmware.c \ linux_hrtimer.c \ From owner-dev-commits-src-main@freebsd.org Thu Jan 28 16:46: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 9A8E04E2100; Thu, 28 Jan 2021 16:46: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 4DRRDr3W1mz3qBP; Thu, 28 Jan 2021 16:46:04 +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 1CE9413559; Thu, 28 Jan 2021 16:46: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 10SGk2Fg088875; Thu, 28 Jan 2021 16:46:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGk21K088874; Thu, 28 Jan 2021 16:46:02 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:46:02 GMT Message-Id: <202101281646.10SGk21K088874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d386f3a3c32f - main - Bump __FreeBSD_version for multiple LinuxKPI updates conflicting with DRM. Be sure to update your drm-kmod port to after the update. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d386f3a3c32f0396aa7995349dd65d6c59711393 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, 28 Jan 2021 16:46:07 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d386f3a3c32f0396aa7995349dd65d6c59711393 commit d386f3a3c32f0396aa7995349dd65d6c59711393 Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:37:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-28 16:37:28 +0000 Bump __FreeBSD_version for multiple LinuxKPI updates conflicting with DRM. Be sure to update your drm-kmod port to after the update. --- UPDATING | 5 +++++ sys/sys/param.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index b947129ca7a5..31ec79ed8437 100644 --- a/UPDATING +++ b/UPDATING @@ -26,6 +26,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20210128: + Various LinuxKPI functionality was added which conflicts with DRM. + Please update your drm-kmod port to after the __FreeBSD_verison 1400003 + update. + 20210108: PC Card attachments for all devices have been removed. In the case of wi and cmx, the entire drivers were removed because they were only diff --git a/sys/sys/param.h b/sys/sys/param.h index 341319a72012..c0d365a40f72 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400002 /* Master, propagated to newvers */ +#define __FreeBSD_version 1400003 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Thu Jan 28 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 33B784E233C; Thu, 28 Jan 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 4DRRJ310Hjz3rRM; Thu, 28 Jan 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 09E6913438; Thu, 28 Jan 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 10SGmoxo089414; Thu, 28 Jan 2021 16:48:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGmoXS089413; Thu, 28 Jan 2021 16:48:50 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:48:50 GMT Message-Id: <202101281648.10SGmoXS089413@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: 0c458752ceee - main - pf: duplicate frames only once when using dup-to pf rule 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: 0c458752ceee14818034df7bfcdfb04129dceeda 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, 28 Jan 2021 16:48:51 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0c458752ceee14818034df7bfcdfb04129dceeda commit 0c458752ceee14818034df7bfcdfb04129dceeda Author: Yannis Planus AuthorDate: 2021-01-28 13:59:07 +0000 Commit: Kristof Provost CommitDate: 2021-01-28 15:46:44 +0000 pf: duplicate frames only once when using dup-to pf rule When using DUP-TO rule, frames are duplicated 3 times on both output interfaces and duplication interface. Add a flag to not duplicate a duplicated frame. Inspired by a patch from MiÅ‚osz Kaniewski milosz.kaniewski at gmail.com https://lists.freebsd.org/pipermail/freebsd-pf/2015-November/007886.html Reviewed by: kp@ Differential Revision: https://reviews.freebsd.org/D27018 --- sys/netpfil/pf/pf.c | 50 ++++++++++++++++++++++++++++++++++++++++++------ sys/netpfil/pf/pf_mtag.h | 1 + 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4cccb0101650..86354e69d11f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5488,10 +5488,29 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, } if (r->rt == PF_DUPTO) { - if ((m0 = m_dup(*m, M_NOWAIT)) == NULL) { - if (s) + if ((pd->pf_mtag->flags & PF_DUPLICATED)) { + if (s == NULL) { + ifp = r->rpool.cur->kif ? + r->rpool.cur->kif->pfik_ifp : NULL; + } else { + ifp = s->rt_kif ? s->rt_kif->pfik_ifp : NULL; PF_STATE_UNLOCK(s); - return; + } + if (ifp == oifp) { + /* When the 2nd interface is not skipped */ + return; + } else { + m0 = *m; + *m = NULL; + goto bad; + } + } else { + pd->pf_mtag->flags |= PF_DUPLICATED; + if (((m0 = m_dup(*m, M_NOWAIT)) == NULL)) { + if (s) + PF_STATE_UNLOCK(s); + return; + } } } else { if ((r->rt == PF_REPLYTO) == (r->direction == dir)) { @@ -5649,10 +5668,29 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, } if (r->rt == PF_DUPTO) { - if ((m0 = m_dup(*m, M_NOWAIT)) == NULL) { - if (s) + if ((pd->pf_mtag->flags & PF_DUPLICATED)) { + if (s == NULL) { + ifp = r->rpool.cur->kif ? + r->rpool.cur->kif->pfik_ifp : NULL; + } else { + ifp = s->rt_kif ? s->rt_kif->pfik_ifp : NULL; PF_STATE_UNLOCK(s); - return; + } + if (ifp == oifp) { + /* When the 2nd interface is not skipped */ + return; + } else { + m0 = *m; + *m = NULL; + goto bad; + } + } else { + pd->pf_mtag->flags |= PF_DUPLICATED; + if (((m0 = m_dup(*m, M_NOWAIT)) == NULL)) { + if (s) + PF_STATE_UNLOCK(s); + return; + } } } else { if ((r->rt == PF_REPLYTO) == (r->direction == dir)) { diff --git a/sys/netpfil/pf/pf_mtag.h b/sys/netpfil/pf/pf_mtag.h index 67c79350e8eb..ad28ab7a7c30 100644 --- a/sys/netpfil/pf/pf_mtag.h +++ b/sys/netpfil/pf/pf_mtag.h @@ -42,6 +42,7 @@ #define PF_PACKET_LOOPED 0x08 #define PF_FASTFWD_OURS_PRESENT 0x10 #define PF_REASSEMBLED 0x20 +#define PF_DUPLICATED 0x40 struct pf_mtag { void *hdr; /* saved hdr pos in mbuf, for ECN */ From owner-dev-commits-src-main@freebsd.org Thu Jan 28 16:48: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 4C9314E25B3; Thu, 28 Jan 2021 16:48: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 4DRRJ41fjmz3rWW; Thu, 28 Jan 2021 16:48: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 2B9C6131FF; Thu, 28 Jan 2021 16:48: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 10SGmqWI089437; Thu, 28 Jan 2021 16:48:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGmq7L089436; Thu, 28 Jan 2021 16:48:52 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:48:52 GMT Message-Id: <202101281648.10SGmq7L089436@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: cd579b6fba46 - main - pf tests: Test that dup-to doesn't produce extra duplicate packets 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: cd579b6fba46b9f5005358d1e82def7b26703224 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, 28 Jan 2021 16:48:52 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cd579b6fba46b9f5005358d1e82def7b26703224 commit cd579b6fba46b9f5005358d1e82def7b26703224 Author: Kristof Provost AuthorDate: 2021-01-28 10:02:20 +0000 Commit: Kristof Provost CommitDate: 2021-01-28 15:46:44 +0000 pf tests: Test that dup-to doesn't produce extra duplicate packets --- tests/sys/netpfil/common/pft_ping.py | 32 ++++++++++++++ tests/sys/netpfil/common/sniffer.py | 7 +++- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/dup.sh | 81 ++++++++++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index d960426e4b42..812250803309 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -34,6 +34,27 @@ from sniffer import Sniffer PAYLOAD_MAGIC = bytes.fromhex('42c0ffee') +dup_found = 0 + +def check_dup(args, packet): + """ + Verify that this is an ICMP packet, and that we only see one + """ + global dup_found + + icmp = packet.getlayer(sp.ICMP) + if not icmp: + return False + + raw = packet.getlayer(sp.Raw) + if not raw: + return False + if raw.load != PAYLOAD_MAGIC: + return False + + dup_found = dup_found + 1 + return False + def check_ping_request(args, packet): if args.ip6: return check_ping6_request(args, packet) @@ -169,6 +190,8 @@ def main(): help='The interface through which the packet(s) will be sent') parser.add_argument('--recvif', nargs=1, help='The interface on which to expect the ICMP echo response') + parser.add_argument('--checkdup', nargs=1, + help='The interface on which to expect the duplicated ICMP packets') parser.add_argument('--ip6', action='store_true', help='Use IPv6') parser.add_argument('--to', nargs=1, @@ -202,6 +225,10 @@ def main(): sniffer = Sniffer(args, checkfn) + dupsniffer = None + if args.checkdup is not None: + dupsniffer = Sniffer(args, check_dup, recvif=args.checkdup[0]) + if args.tcpsyn: tcpsyn(args.sendif[0], args.to[0], args) else: @@ -210,6 +237,11 @@ def main(): else: ping(args.sendif[0], args.to[0], args) + if dupsniffer: + dupsniffer.join() + if dup_found != 1: + sys.exit(1) + if sniffer: sniffer.join() diff --git a/tests/sys/netpfil/common/sniffer.py b/tests/sys/netpfil/common/sniffer.py index 58df32cce276..200ac750dd7f 100644 --- a/tests/sys/netpfil/common/sniffer.py +++ b/tests/sys/netpfil/common/sniffer.py @@ -30,11 +30,14 @@ import threading import scapy.all as sp class Sniffer(threading.Thread): - def __init__(self, args, check_function): + def __init__(self, args, check_function, recvif=None): threading.Thread.__init__(self) self._args = args - self._recvif = args.recvif[0] + if recvif is not None: + self._recvif = recvif + else: + self._recvif = args.recvif[0] self._check_function = check_function self.foundCorrectPacket = False diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 99b22399231e..f00f64d849d2 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -8,6 +8,7 @@ TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= altq \ anchor \ checksum \ + dup \ forward \ fragmentation \ icmp \ diff --git a/tests/sys/netpfil/pf/dup.sh b/tests/sys/netpfil/pf/dup.sh new file mode 100644 index 000000000000..7b9a91804e96 --- /dev/null +++ b/tests/sys/netpfil/pf/dup.sh @@ -0,0 +1,81 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Kristof Provost +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "dup_to" "cleanup" +do_to_head() +{ + atf_set descr 'dup-to test' + atf_set require.user root +} + +dup_to_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + epair_recv=$(vnet_mkepair) + ifconfig ${epair_recv}a up + + epair_dupto=$(vnet_mkepair) + ifconfig ${epair_dupto}a up + + vnet_mkjail alcatraz ${epair_send}b ${epair_recv}b ${epair_dupto}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_recv}b 198.51.100.2/24 up + jexec alcatraz ifconfig ${epair_dupto}b 203.0.113.2/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + jexec alcatraz arp -s 198.51.100.3 00:01:02:03:04:05 + jexec alcatraz arp -s 203.0.113.3 01:02:03:04:05:06 + route add -net 198.51.100.0/24 192.0.2.2 + + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "pass out on { ${epair_recv}b } \ + dup-to (${epair_dupto}b 203.0.113.3)" + + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recv ${epair_recv}a \ + --checkdup ${epair_dupto}a +} + +dup_to_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "dup_to" +} From owner-dev-commits-src-main@freebsd.org Thu Jan 28 16:53: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 E06704E265F; Thu, 28 Jan 2021 16:53: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 4DRRPC5vz8z3s2C; Thu, 28 Jan 2021 16:53: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 BDBFD1362C; Thu, 28 Jan 2021 16:53: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 10SGrJuf002302; Thu, 28 Jan 2021 16:53:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SGrJWf002301; Thu, 28 Jan 2021 16:53:19 GMT (envelope-from git) Date: Thu, 28 Jan 2021 16:53:19 GMT Message-Id: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: 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. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a714ff204193b9eb810426048e03f5d76e9730e 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, 28 Jan 2021 16:53:19 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=1a714ff204193b9eb810426048e03f5d76e9730e commit 1a714ff204193b9eb810426048e03f5d76e9730e Author: Randall Stewart AuthorDate: 2021-01-26 16:54:42 +0000 Commit: Randall Stewart CommitDate: 2021-01-28 16:53:05 +0000 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. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D28357 --- sys/net/if_lagg.c | 11 + sys/net/if_var.h | 2 + sys/net/if_vlan.c | 30 +++ sys/netinet/in_pcb.c | 9 + sys/netinet/tcp_log_buf.h | 2 +- sys/netinet/tcp_ratelimit.c | 584 +++++++++++++++++++++++++++--------------- sys/netinet/tcp_ratelimit.h | 24 +- sys/netinet/tcp_stacks/bbr.c | 4 +- sys/netinet/tcp_stacks/rack.c | 14 +- 9 files changed, 464 insertions(+), 216 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 3144f86901b2..9a3c22789fa5 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct m_snd_tag *, static int lagg_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); static void lagg_snd_tag_free(struct m_snd_tag *); +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); static void lagg_ratelimit_query(struct ifnet *, struct if_ratelimit_query_results *); #endif @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) ifp->if_snd_tag_modify = lagg_snd_tag_modify; ifp->if_snd_tag_query = lagg_snd_tag_query; ifp->if_snd_tag_free = lagg_snd_tag_free; + ifp->if_next_snd_tag = lagg_next_snd_tag; ifp->if_ratelimit_query = lagg_ratelimit_query; #endif ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, return (0); } +static struct m_snd_tag * +lagg_next_snd_tag(struct m_snd_tag *mst) +{ + struct lagg_snd_tag *lst; + + lst = mst_to_lst(mst); + return (lst->tag); +} + static int lagg_snd_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index beb9596895ee..9ecdfb684296 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params * typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); typedef void (if_snd_tag_free_t)(struct m_snd_tag *); +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); typedef void (if_ratelimit_query_t)(struct ifnet *, struct if_ratelimit_query_results *); typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t); @@ -422,6 +423,7 @@ struct ifnet { if_snd_tag_modify_t *if_snd_tag_modify; if_snd_tag_query_t *if_snd_tag_query; if_snd_tag_free_t *if_snd_tag_free; + if_next_send_tag_t *if_next_snd_tag; if_ratelimit_query_t *if_ratelimit_query; if_ratelimit_setup_t *if_ratelimit_setup; diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 9358724844cb..9703e5e7753f 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag *, static int vlan_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); static void vlan_snd_tag_free(struct m_snd_tag *); +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); +static void vlan_ratelimit_query(struct ifnet *, + struct if_ratelimit_query_results *); #endif static void vlan_qflush(struct ifnet *ifp); static int vlan_setflag(struct ifnet *ifp, int flag, int status, @@ -1071,6 +1074,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifp->if_snd_tag_modify = vlan_snd_tag_modify; ifp->if_snd_tag_query = vlan_snd_tag_query; ifp->if_snd_tag_free = vlan_snd_tag_free; + ifp->if_next_snd_tag = vlan_next_snd_tag; + ifp->if_ratelimit_query = vlan_ratelimit_query; #endif ifp->if_flags = VLAN_IFFLAGS; ether_ifattach(ifp, eaddr); @@ -2073,6 +2078,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, return (0); } +static struct m_snd_tag * +vlan_next_snd_tag(struct m_snd_tag *mst) +{ + struct vlan_snd_tag *vst; + + vst = mst_to_vst(mst); + return (vst->tag); +} + static int vlan_snd_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) @@ -2102,4 +2116,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) m_snd_tag_rele(vst->tag); free(vst, M_VLAN); } + +static void +vlan_ratelimit_query(struct ifnet *ifp __unused, struct if_ratelimit_query_results *q) +{ + /* + * For vlan, we have an indirect + * interface. The caller needs to + * get a ratelimit tag on the actual + * interface the flow will go on. + */ + q->rate_table = NULL; + q->flags = RT_IS_INDIRECT; + q->max_flows = 0; + q->number_of_rates = 0; +} + #endif diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 59695ee3715d..40a0b4c0676e 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, "allocation before switching to a random one"); #ifdef RATELIMIT +counter_u64_t rate_limit_new; +counter_u64_t rate_limit_chg; counter_u64_t rate_limit_active; counter_u64_t rate_limit_alloc_fail; counter_u64_t rate_limit_set_ok; @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, alloc_fail, CTLFLAG_RD, &rate_limit_alloc_fail, "Rate limited connection failures"); SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, &rate_limit_set_ok, "Rate limited setting succeeded"); +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, + &rate_limit_new, "Total Rate limit new attempts"); +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, + &rate_limit_chg, "Total Rate limited change attempts"); + #endif /* RATELIMIT */ #endif /* INET */ @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) static void rl_init(void *st) { + rate_limit_new = counter_u64_alloc(M_WAITOK); + rate_limit_chg = counter_u64_alloc(M_WAITOK); rate_limit_active = counter_u64_alloc(M_WAITOK); rate_limit_alloc_fail = counter_u64_alloc(M_WAITOK); rate_limit_set_ok = counter_u64_alloc(M_WAITOK); diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 0d9b14a08f53..436383124dce 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -221,7 +221,7 @@ enum tcp_log_events { BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 */ TCP_LOG_REASS, /* Reassembly buffer logging 50 */ - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 */ + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this) 51 */ BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 */ TCP_LOG_CONNEND, /* End of connection 54 */ diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index 97f066be69e0..aeb1ed6906b5 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #endif +#include +#include #include #ifndef USECS_IN_SECOND #define USECS_IN_SECOND 1000000 @@ -154,108 +156,77 @@ const uint64_t desired_rates[] = { 180500, /* 1.44Mpbs - rate 2 common rate */ 375000, /* 3Mbps - rate 3 */ 625000, /* 5Mbps - rate 4 */ - 875000, /* 7Mbps - rate 5 */ - 1125000, /* 9Mbps - rate 6 */ - 1375000, /* 11Mbps - rate 7 */ - 1625000, /* 13Mbps - rate 8 */ - 2625000, /* 21Mbps - rate 9 */ - 3875000, /* 31Mbps - rate 10 */ - 5125000, /* 41Meg - rate 11 */ - 12500000, /* 100Mbps - rate 12 */ - 25000000, /* 200Mbps - rate 13 */ - 50000000, /* 400Mbps - rate 14 */ - 63750000, /* 51Mbps - rate 15 */ + 1250000, /* 10Mbps - rate 5 */ + 1875000, /* 15Mbps - rate 6 */ + 2500000, /* 20Mbps - rate 7 */ + 3125000, /* 25Mbps - rate 8 */ + 3750000, /* 30Mbps - rate 9 */ + 4375000, /* 35Mbps - rate 10 */ + 5000000, /* 40Meg - rate 11 */ + 6250000, /* 50Mbps - rate 12 */ + 12500000, /* 100Mbps - rate 13 */ + 25000000, /* 200Mbps - rate 14 */ + 50000000, /* 400Mbps - rate 15 */ 100000000, /* 800Mbps - rate 16 */ - 1875000, /* 15Mbps - rate 17 */ - 2125000, /* 17Mbps - rate 18 */ - 2375000, /* 19Mbps - rate 19 */ - 2875000, /* 23Mbps - rate 20 */ - 3125000, /* 25Mbps - rate 21 */ - 3375000, /* 27Mbps - rate 22 */ - 3625000, /* 29Mbps - rate 23 */ - 4125000, /* 33Mbps - rate 24 */ - 4375000, /* 35Mbps - rate 25 */ - 4625000, /* 37Mbps - rate 26 */ - 4875000, /* 39Mbps - rate 27 */ - 5375000, /* 43Mbps - rate 28 */ - 5625000, /* 45Mbps - rate 29 */ - 5875000, /* 47Mbps - rate 30 */ - 6125000, /* 49Mbps - rate 31 */ - 6625000, /* 53Mbps - rate 32 */ - 6875000, /* 55Mbps - rate 33 */ - 7125000, /* 57Mbps - rate 34 */ - 7375000, /* 59Mbps - rate 35 */ - 7625000, /* 61Mbps - rate 36 */ - 7875000, /* 63Mbps - rate 37 */ - 8125000, /* 65Mbps - rate 38 */ - 8375000, /* 67Mbps - rate 39 */ - 8625000, /* 69Mbps - rate 40 */ - 8875000, /* 71Mbps - rate 41 */ - 9125000, /* 73Mbps - rate 42 */ - 9375000, /* 75Mbps - rate 43 */ - 9625000, /* 77Mbps - rate 44 */ - 9875000, /* 79Mbps - rate 45 */ - 10125000, /* 81Mbps - rate 46 */ - 10375000, /* 83Mbps - rate 47 */ - 10625000, /* 85Mbps - rate 48 */ - 10875000, /* 87Mbps - rate 49 */ - 11125000, /* 89Mbps - rate 50 */ - 11375000, /* 91Mbps - rate 51 */ - 11625000, /* 93Mbps - rate 52 */ - 11875000, /* 95Mbps - rate 53 */ - 13125000, /* 105Mbps - rate 54 */ - 13750000, /* 110Mbps - rate 55 */ - 14375000, /* 115Mbps - rate 56 */ - 15000000, /* 120Mbps - rate 57 */ - 15625000, /* 125Mbps - rate 58 */ - 16250000, /* 130Mbps - rate 59 */ - 16875000, /* 135Mbps - rate 60 */ - 17500000, /* 140Mbps - rate 61 */ - 18125000, /* 145Mbps - rate 62 */ - 18750000, /* 150Mbps - rate 64 */ - 20000000, /* 160Mbps - rate 65 */ - 21250000, /* 170Mbps - rate 66 */ - 22500000, /* 180Mbps - rate 67 */ - 23750000, /* 190Mbps - rate 68 */ - 26250000, /* 210Mbps - rate 69 */ - 27500000, /* 220Mbps - rate 70 */ - 28750000, /* 230Mbps - rate 71 */ - 30000000, /* 240Mbps - rate 72 */ - 31250000, /* 250Mbps - rate 73 */ - 34375000, /* 275Mbps - rate 74 */ - 37500000, /* 300Mbps - rate 75 */ - 40625000, /* 325Mbps - rate 76 */ - 43750000, /* 350Mbps - rate 77 */ - 46875000, /* 375Mbps - rate 78 */ - 53125000, /* 425Mbps - rate 79 */ - 56250000, /* 450Mbps - rate 80 */ - 59375000, /* 475Mbps - rate 81 */ - 62500000, /* 500Mbps - rate 82 */ - 68750000, /* 550Mbps - rate 83 */ - 75000000, /* 600Mbps - rate 84 */ - 81250000, /* 650Mbps - rate 85 */ - 87500000, /* 700Mbps - rate 86 */ - 93750000, /* 750Mbps - rate 87 */ - 106250000, /* 850Mbps - rate 88 */ - 112500000, /* 900Mbps - rate 89 */ - 125000000, /* 1Gbps - rate 90 */ - 156250000, /* 1.25Gps - rate 91 */ - 187500000, /* 1.5Gps - rate 92 */ - 218750000, /* 1.75Gps - rate 93 */ - 250000000, /* 2Gbps - rate 94 */ - 281250000, /* 2.25Gps - rate 95 */ - 312500000, /* 2.5Gbps - rate 96 */ - 343750000, /* 2.75Gbps - rate 97 */ - 375000000, /* 3Gbps - rate 98 */ - 500000000, /* 4Gbps - rate 99 */ - 625000000, /* 5Gbps - rate 100 */ - 750000000, /* 6Gbps - rate 101 */ - 875000000, /* 7Gbps - rate 102 */ - 1000000000, /* 8Gbps - rate 103 */ - 1125000000, /* 9Gbps - rate 104 */ - 1250000000, /* 10Gbps - rate 105 */ - 1875000000, /* 15Gbps - rate 106 */ - 2500000000 /* 20Gbps - rate 107 */ + 5625000, /* 45Mbps - rate 17 */ + 6875000, /* 55Mbps - rate 19 */ + 7500000, /* 60Mbps - rate 20 */ + 8125000, /* 65Mbps - rate 21 */ + 8750000, /* 70Mbps - rate 22 */ + 9375000, /* 75Mbps - rate 23 */ + 10000000, /* 80Mbps - rate 24 */ + 10625000, /* 85Mbps - rate 25 */ + 11250000, /* 90Mbps - rate 26 */ + 11875000, /* 95Mbps - rate 27 */ + 12500000, /* 100Mbps - rate 28 */ + 13750000, /* 110Mbps - rate 29 */ + 15000000, /* 120Mbps - rate 30 */ + 16250000, /* 130Mbps - rate 31 */ + 17500000, /* 140Mbps - rate 32 */ + 18750000, /* 150Mbps - rate 33 */ + 20000000, /* 160Mbps - rate 34 */ + 21250000, /* 170Mbps - rate 35 */ + 22500000, /* 180Mbps - rate 36 */ + 23750000, /* 190Mbps - rate 37 */ + 26250000, /* 210Mbps - rate 38 */ + 27500000, /* 220Mbps - rate 39 */ + 28750000, /* 230Mbps - rate 40 */ + 30000000, /* 240Mbps - rate 41 */ + 31250000, /* 250Mbps - rate 42 */ + 34375000, /* 275Mbps - rate 43 */ + 37500000, /* 300Mbps - rate 44 */ + 40625000, /* 325Mbps - rate 45 */ + 43750000, /* 350Mbps - rate 46 */ + 46875000, /* 375Mbps - rate 47 */ + 53125000, /* 425Mbps - rate 48 */ + 56250000, /* 450Mbps - rate 49 */ + 59375000, /* 475Mbps - rate 50 */ + 62500000, /* 500Mbps - rate 51 */ + 68750000, /* 550Mbps - rate 52 */ + 75000000, /* 600Mbps - rate 53 */ + 81250000, /* 650Mbps - rate 54 */ + 87500000, /* 700Mbps - rate 55 */ + 93750000, /* 750Mbps - rate 56 */ + 106250000, /* 850Mbps - rate 57 */ + 112500000, /* 900Mbps - rate 58 */ + 125000000, /* 1Gbps - rate 59 */ + 156250000, /* 1.25Gps - rate 60 */ + 187500000, /* 1.5Gps - rate 61 */ + 218750000, /* 1.75Gps - rate 62 */ + 250000000, /* 2Gbps - rate 63 */ + 281250000, /* 2.25Gps - rate 64 */ + 312500000, /* 2.5Gbps - rate 65 */ + 343750000, /* 2.75Gbps - rate 66 */ + 375000000, /* 3Gbps - rate 67 */ + 500000000, /* 4Gbps - rate 68 */ + 625000000, /* 5Gbps - rate 69 */ + 750000000, /* 6Gbps - rate 70 */ + 875000000, /* 7Gbps - rate 71 */ + 1000000000, /* 8Gbps - rate 72 */ + 1125000000, /* 9Gbps - rate 73 */ + 1250000000, /* 10Gbps - rate 74 */ + 1875000000, /* 15Gbps - rate 75 */ + 2500000000 /* 20Gbps - rate 76 */ }; #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; static struct mtx rs_mtx; uint32_t rs_number_alive; uint32_t rs_number_dead; +static uint32_t rs_floor_mss = 0; +static uint32_t wait_time_floor = 8000; /* 8 ms */ +static uint32_t rs_hw_floor_mss = 16; +static uint32_t num_of_waits_allowed = 1; /* How many time blocks are we willing to wait */ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Ratelimit stats"); @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, CTLFLAG_RW, SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, &rs_number_dead, 0, "Number of interfaces departing from ratelimiting"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, + &rs_floor_mss, 0, + "Number of MSS that will override the normal minimums (0 means don't enforce)"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, + &wait_time_floor, 2000, + "Has b/w increases what is the wait floor we are willing to wait at the end?"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, + &num_of_waits_allowed, 1, + "How many time blocks on the end should software pacing be willing to wait?"); + +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, + &rs_hw_floor_mss, 16, + "Number of mss that are a minum for hardware pacing?"); + static void rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) @@ -383,6 +372,17 @@ 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 @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) } #ifdef INET +extern counter_u64_t rate_limit_new; +extern counter_u64_t rate_limit_chg; extern counter_u64_t rate_limit_set_ok; extern counter_u64_t rate_limit_active; extern counter_u64_t rate_limit_alloc_fail; @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) int i; struct if_ratelimit_query_results rl; struct sysctl_oid *rl_sysctl_root; + struct epoch_tracker et; /* * We expect to enter with the * mutex locked. @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } else if ((rl.flags & RT_IS_INDIRECT) == RT_IS_INDIRECT) { memset(rs, 0, sizeof(struct tcp_rate_set)); @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } else if ((rl.flags & RT_IS_FIXED_TABLE) == RT_IS_FIXED_TABLE) { /* Mellanox C4 likely */ @@ -671,6 +678,8 @@ 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. */ @@ -741,18 +750,24 @@ handle_err: CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } +/* + * For an explanation of why the argument is volatile please + * look at the comments around rt_setup_rate(). + */ static const struct tcp_hwrate_limit_table * -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, - uint64_t bytes_per_sec, uint32_t flags) +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) { struct tcp_hwrate_limit_table *arte = NULL, *rte = NULL; - uint64_t mbits_per_sec, ind_calc; + uint64_t mbits_per_sec, ind_calc, previous_rate = 0; int i; mbits_per_sec = (bytes_per_sec * 8); @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, * Smaller than 1Meg, only * 3 entries can match it. */ + previous_rate = 0; for(i = rs->rs_lowest_valid; i < 3; i++) { if (bytes_per_sec <= rs->rs_rlt[i].rate) { rte = &rs->rs_rlt[i]; @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, } else if (rs->rs_rlt[i].flags & HDWRPACE_INITED) { arte = &rs->rs_rlt[i]; } + previous_rate = rs->rs_rlt[i].rate; } goto done; } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, rte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; else arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; goto done; } /* @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, ind_calc = ALL_HARDWARE_RATES-1; } if ((ind_calc >= rs->rs_lowest_valid) && - (ind_calc <= rs->rs_highest_valid)) - rte = &rs->rs_rlt[ind_calc]; + (ind_calc <= rs->rs_highest_valid)) { + rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; + } } else if (flags & RS_PACING_EXACT_MATCH) { if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && (rs->rs_lowest_valid <= 2)){ @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, for (i=2; i>=rs->rs_lowest_valid; i--) { if (bytes_per_sec < rs->rs_rlt[i].rate) { rte = &rs->rs_rlt[i]; + if (i >= 1) { + previous_rate = rs->rs_rlt[(i-1)].rate; + } break; } else if ((flags & RS_PACING_GEQ) && (bytes_per_sec == rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; + if (i >= 1) { + previous_rate = rs->rs_rlt[(i-1)].rate; + } break; } else { arte = &rs->rs_rlt[i]; /* new alternate */ @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, /* The top rate is an alternative */ arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; } + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; } else { /* Its in our range 1Meg - 1Gig */ if (flags & RS_PACING_GEQ) { @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, ind_calc = (ALL_HARDWARE_RATES-1); } rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; } goto done; } @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, /* This should not happen */ ind_calc = ALL_HARDWARE_RATES-1; } - if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) + if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) { rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; + } } } done: @@ -893,11 +926,17 @@ done: /* We can use the substitute */ rte = arte; } + if (lower_rate) + *lower_rate = previous_rate; return (rte); } +/* + * For an explanation of why the argument is volatile please + * look at the comments around rt_setup_rate(). + */ static const struct tcp_hwrate_limit_table * -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, uint32_t flags) +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) { /** * Hunt the rate table with the restrictions in flags and find a @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui */ int i, matched; struct tcp_hwrate_limit_table *rte = NULL; + uint64_t previous_rate = 0; if ((rs->rs_flags & RS_INT_TBL) && (rs->rs_rate_cnt >= ALL_HARDWARE_RATES)) { @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui * from 1Meg - 1000Meg in 1Meg increments. * Use an alternate method to "lookup". */ - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags)); + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate)); } if ((flags & RS_PACING_LT) || (flags & RS_PACING_EXACT_MATCH)) { @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui (bytes_per_sec == rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; matched = 1; + if (lower_rate != NULL) + *lower_rate = previous_rate; break; } else if ((flags & RS_PACING_LT) && (bytes_per_sec <= rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; matched = 1; + if (lower_rate != NULL) + *lower_rate = previous_rate; break; } + previous_rate = rs->rs_rlt[i].rate; if (bytes_per_sec > rs->rs_rlt[i].rate) break; } @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui * We found a table entry that is smaller, * stop there will be none greater or equal. */ + if (lower_rate != NULL) + *lower_rate = rs->rs_rlt[i].rate; break; } } @@ -995,10 +1042,10 @@ static struct ifnet * rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) { struct ifnet *tifp; - struct m_snd_tag *tag; + struct m_snd_tag *tag, *ntag; union if_snd_tag_alloc_params params = { .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, - .rate_limit.hdr.flowid = 1, + .rate_limit.hdr.flowid = inp->inp_flowid, .rate_limit.hdr.numa_domain = inp->inp_numa_domain, .rate_limit.max_rate = COMMON_RATE, .rate_limit.flags = M_NOWAIT, @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) *error = err; return (NULL); } - tifp = tag->ifp; + ntag = tag; + while(ntag->ifp->if_next_snd_tag != NULL) { + ntag = ntag->ifp->if_next_snd_tag(ntag); + } + tifp = ntag->ifp; m_snd_tag_rele(tag); return (tifp); } +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); +} + +/* + * Do NOT take the __noinline out of the + * find_rs_for_ifp() function. If you do the inline + * of it for the rt_setup_rate() will show you a + * compiler bug. For some reason the compiler thinks + * the list can never be empty. The consequence of + * this will be a crash when we dereference NULL + * if an ifp is removed just has a hw rate limit + * is attempted. If you are working on the compiler + * and want to "test" this go ahead and take the noinline + * out otherwise let sleeping dogs ly until such time + * as we get a compiler fix 10/2/20 -- RRS + */ +static __noinline struct tcp_rate_set * +find_rs_for_ifp(struct ifnet *ifp) +{ + struct tcp_rate_set *rs; + + CK_LIST_FOREACH(rs, &int_rs, next) { + if ((rs->rs_ifp == ifp) && + (rs->rs_if_dunit == ifp->if_dunit)) { + /* Ok we found it */ + return (rs); + } + } + return (NULL); +} + + static const struct tcp_hwrate_limit_table * rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t bytes_per_sec, - uint32_t flags, int *error) + uint32_t flags, int *error, uint64_t *lower_rate) { /* First lets find the interface if it exists */ const struct tcp_hwrate_limit_table *rte; - struct tcp_rate_set *rs; + /* + * So why is rs volatile? This is to defeat a + * compiler bug where in the compiler is convinced + * that rs can never be NULL (which is not true). Because + * of its conviction it nicely optimizes out the if ((rs == NULL + * below which means if you get a NULL back you dereference it. + */ + volatile struct tcp_rate_set *rs; struct epoch_tracker et; + struct ifnet *oifp = ifp; int err; NET_EPOCH_ENTER(et); use_real_interface: - CK_LIST_FOREACH(rs, &int_rs, next) { - /* - * Note we don't look with the lock since we either see a - * new entry or will get one when we try to add it. - */ - if (rs->rs_flags & RS_IS_DEAD) { - /* The dead are not looked at */ - continue; - } - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - /* Ok we found it */ - break; - } - } + rs = find_rs_for_ifp(ifp); if ((rs == NULL) || (rs->rs_flags & RS_INTF_NO_SUP) || (rs->rs_flags & RS_IS_DEAD)) { @@ -1063,14 +1164,14 @@ use_real_interface: * might be arguable, but its impossible * to tell from the departing case. */ - if (rs->rs_disable && error) + if (error) *error = ENODEV; NET_EPOCH_EXIT(et); return (NULL); } if ((rs == NULL) || (rs->rs_disable != 0)) { - if (rs->rs_disable && error) + if (error) *error = ENOSPC; NET_EPOCH_EXIT(et); return (NULL); @@ -1086,6 +1187,10 @@ use_real_interface: NET_EPOCH_EXIT(et); return (NULL); } + KASSERT((tifp != ifp), + ("Lookup failure ifp:%p inp:%p rt_find_real_interface() returns the same interface tifp:%p?\n", + ifp, inp, tifp)); + ifp = tifp; goto use_real_interface; } if (rs->rs_flow_limit && @@ -1095,9 +1200,9 @@ use_real_interface: NET_EPOCH_EXIT(et); return (NULL); } - rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags); + rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate); if (rte) { - err = in_pcbattach_txrtlmt(inp, rs->rs_ifp, + err = in_pcbattach_txrtlmt(inp, oifp, inp->inp_flowtype, inp->inp_flowid, rte->rate, @@ -1107,6 +1212,11 @@ use_real_interface: if (error) *error = err; 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)); + counter_u64_add(rate_limit_new, 1); } } if (rte) { @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state) { int error; struct tcp_rate_set *rs; + struct epoch_tracker et; if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || (link_state != LINK_STATE_UP)) { @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state) */ return; } + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); - CK_LIST_FOREACH(rs, &int_rs, next) { - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - /* We already have initialized this guy */ - mtx_unlock(&rs_mtx); - return; - } + rs = find_rs_for_ifp(ifp); + if (rs) { + /* We already have initialized this guy */ + mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); + return; } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); rt_setup_new_rs(ifp, &error); } static void tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) { - struct tcp_rate_set *rs, *nrs; + struct tcp_rate_set *rs; + struct epoch_tracker et; int i; + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - CK_LIST_REMOVE(rs, next); - rs_number_alive--; - rs->rs_flags |= RS_IS_DEAD; - for (i = 0; i < rs->rs_rate_cnt; i++) { - if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { - in_pcbdetach_tag(rs->rs_rlt[i].tag); - rs->rs_rlt[i].tag = NULL; - } - rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; + rs = find_rs_for_ifp(ifp); + if (rs) { + CK_LIST_REMOVE(rs, next); + rs_number_alive--; + rs->rs_flags |= RS_IS_DEAD; + for (i = 0; i < rs->rs_rate_cnt; i++) { + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { + in_pcbdetach_tag(rs->rs_rlt[i].tag); + rs->rs_rlt[i].tag = NULL; } - if (rs->rs_flows_using == 0) - rs_defer_destroy(rs); - break; + rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; } + if (rs->rs_flows_using == 0) + rs_defer_destroy(rs); } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); } static void tcp_rl_shutdown(void *arg __unused, int howto __unused) { struct tcp_rate_set *rs, *nrs; + struct epoch_tracker et; int i; + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { CK_LIST_REMOVE(rs, next); @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int howto __unused) rs_defer_destroy(rs); } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); } const struct tcp_hwrate_limit_table * tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, - uint64_t bytes_per_sec, int flags, int *error) + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) { const struct tcp_hwrate_limit_table *rte; #ifdef KERN_TLS @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, } } #endif - rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error); + rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error, lower_rate); + if (rte) + rl_increment_using(rte); #ifdef KERN_TLS if (rte != NULL && tls != NULL && tls->snd_tag != NULL) { /* @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, *error = EINVAL; rte = NULL; } - tp->t_pacing_rate = rte->rate; - *error = 0; + if (rte != NULL) { + tp->t_pacing_rate = rte->rate; + *error = 0; + } return (rte); } const struct tcp_hwrate_limit_table * tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, struct tcpcb *tp, struct ifnet *ifp, - uint64_t bytes_per_sec, int flags, int *error) + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) { const struct tcp_hwrate_limit_table *nrte; const struct tcp_rate_set *rs; #ifdef KERN_TLS struct ktls_session *tls = NULL; #endif - int is_indirect = 0; int err; INP_WLOCK_ASSERT(tp->t_inpcb); @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if ((rs->rs_flags & RS_IS_DEAD) || (crte->flags & HDWRPACE_IFPDEPARTED)) { /* Release the rate, and try anew */ -re_rate: + tcp_rel_pacing_rate(crte, tp); nrte = tcp_set_pacing_rate(tp, ifp, - bytes_per_sec, flags, error); *** 386 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Jan 28 17:39: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 C023D4E470D; Thu, 28 Jan 2021 17:39: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 4DRSQk57hCz3wJj; Thu, 28 Jan 2021 17:39: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 A32D313EA4; Thu, 28 Jan 2021 17:39: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 10SHdgto056774; Thu, 28 Jan 2021 17:39:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SHdgG0056773; Thu, 28 Jan 2021 17:39:42 GMT (envelope-from git) Date: Thu, 28 Jan 2021 17:39:42 GMT Message-Id: <202101281739.10SHdgG0056773@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: bcc5b2445674 - main - rc.d/auditd: set pidfile 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: bcc5b2445674e4691853d7533e4873a6712f67ee 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, 28 Jan 2021 17:39:42 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=bcc5b2445674e4691853d7533e4873a6712f67ee commit bcc5b2445674e4691853d7533e4873a6712f67ee Author: Alex Richardson AuthorDate: 2021-01-28 17:17:07 +0000 Commit: Alex Richardson CommitDate: 2021-01-28 17:24:24 +0000 rc.d/auditd: set pidfile auditd creates a pidfile so we should use it for status checks. This also seems to speed up the frequent onestatus checks used in tests/sys/audit. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D28389 --- libexec/rc/rc.d/auditd | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc.d/auditd b/libexec/rc/rc.d/auditd index 637214282de0..084b2b764655 100755 --- a/libexec/rc/rc.d/auditd +++ b/libexec/rc/rc.d/auditd @@ -16,6 +16,7 @@ name="auditd" desc="Audit daemon" stop_cmd="auditd_stop" command="/usr/sbin/${name}" +pidfile="/var/run/${name}.pid" rcvar="auditd_enable" command_args="${auditd_flags}" required_files="/etc/security/audit_class /etc/security/audit_control From owner-dev-commits-src-main@freebsd.org Thu Jan 28 17:39: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 471EA4E43F1; Thu, 28 Jan 2021 17:39: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 4DRSQl70wbz3wJq; Thu, 28 Jan 2021 17:39: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 D4AC1138E5; Thu, 28 Jan 2021 17:39: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 10SHdhrm056797; Thu, 28 Jan 2021 17:39:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SHdh37056796; Thu, 28 Jan 2021 17:39:43 GMT (envelope-from git) Date: Thu, 28 Jan 2021 17:39:43 GMT Message-Id: <202101281739.10SHdh37056796@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: 83ff5d5d98cb - main - Un-XFAIL two tests with Clang > 10 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: 83ff5d5d98cbcf9b66dccd70022358aec8918a14 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, 28 Jan 2021 17:39:44 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=83ff5d5d98cbcf9b66dccd70022358aec8918a14 commit 83ff5d5d98cbcf9b66dccd70022358aec8918a14 Author: Alex Richardson AuthorDate: 2021-01-28 17:17:49 +0000 Commit: Alex Richardson CommitDate: 2021-01-28 17:24:24 +0000 Un-XFAIL two tests with Clang > 10 SVN r343917 fixed this for in-tree clang, but when building with a newer out-of-tree clang the test was still marked as XFAIL. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D28390 --- contrib/netbsd-tests/lib/libm/t_cbrt.c | 4 ++-- lib/msun/tests/trig_test.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/netbsd-tests/lib/libm/t_cbrt.c b/contrib/netbsd-tests/lib/libm/t_cbrt.c index d2cdd47a5beb..08e9faeb145c 100644 --- a/contrib/netbsd-tests/lib/libm/t_cbrt.c +++ b/contrib/netbsd-tests/lib/libm/t_cbrt.c @@ -269,8 +269,8 @@ ATF_TC_BODY(cbrtl_powl, tc) size_t i; #if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 && \ - __FreeBSD_cc_version < 1300002 - atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 + atf_tc_expect_fail("test fails with clang 7-9 - bug 234040"); #endif for (i = 0; i < __arraycount(x); i++) { diff --git a/lib/msun/tests/trig_test.c b/lib/msun/tests/trig_test.c index 483a5e187d50..ba1975721d3f 100644 --- a/lib/msun/tests/trig_test.c +++ b/lib/msun/tests/trig_test.c @@ -161,7 +161,7 @@ ATF_TC_BODY(reduction, tc) unsigned i; #if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 && \ - __FreeBSD_cc_version < 1300002 + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); #endif From owner-dev-commits-src-main@freebsd.org Thu Jan 28 17:39: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 61B724E43F7; Thu, 28 Jan 2021 17:39: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 4DRSQn1Hhrz3wJw; Thu, 28 Jan 2021 17:39: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 EBDCB13F74; Thu, 28 Jan 2021 17:39: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 10SHdigN056819; Thu, 28 Jan 2021 17:39:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SHdiL1056818; Thu, 28 Jan 2021 17:39:44 GMT (envelope-from git) Date: Thu, 28 Jan 2021 17:39:44 GMT Message-Id: <202101281739.10SHdiL1056818@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: 869cc06480b7 - main - tests/sys/audit: fix timeout calculation 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: 869cc06480b75b4caea0d049e0cf7f82bb5aeed1 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, 28 Jan 2021 17:39:45 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=869cc06480b75b4caea0d049e0cf7f82bb5aeed1 commit 869cc06480b75b4caea0d049e0cf7f82bb5aeed1 Author: Alex Richardson AuthorDate: 2021-01-28 17:23:27 +0000 Commit: Alex Richardson CommitDate: 2021-01-28 17:24:24 +0000 tests/sys/audit: fix timeout calculation This changes the behaviour to a 30s total timeout (needed when running on slow emulated uniprocessor systems) and timing out after 10s without any input. This also uses timespecsub() instead of ignoring the nanoseconds field. After this change the tests runs more reliably on QEMU and time out less frequently. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D28391 --- tests/sys/audit/utils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/sys/audit/utils.c b/tests/sys/audit/utils.c index 531c99ea77da..d7a1e6792b1c 100644 --- a/tests/sys/audit/utils.c +++ b/tests/sys/audit/utils.c @@ -146,13 +146,18 @@ check_auditpipe(struct pollfd fd[], const char *auditregex, FILE *pipestream) /* Set the expire time for poll(2) while waiting for syscall audit */ ATF_REQUIRE_EQ(0, clock_gettime(CLOCK_MONOTONIC, &endtime)); - endtime.tv_sec += 10; - timeout.tv_nsec = endtime.tv_nsec; + /* Set limit to 30 seconds total and ~10s without an event. */ + endtime.tv_sec += 30; for (;;) { /* Update the time left for auditpipe to return any event */ ATF_REQUIRE_EQ(0, clock_gettime(CLOCK_MONOTONIC, &currtime)); - timeout.tv_sec = endtime.tv_sec - currtime.tv_sec; + timespecsub(&endtime, &currtime, &timeout); + timeout.tv_sec = MIN(timeout.tv_sec, 9); + if (timeout.tv_sec < 0) { + atf_tc_fail("%s not found in auditpipe within the " + "time limit", auditregex); + } switch (ppoll(fd, 1, &timeout, NULL)) { /* ppoll(2) returns, check if it's what we want */ From owner-dev-commits-src-main@freebsd.org Thu Jan 28 17:39: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 4D89D4E4646; Thu, 28 Jan 2021 17:39: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 4DRSQp3W5nz3wPc; Thu, 28 Jan 2021 17:39: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 37F6813F75; Thu, 28 Jan 2021 17:39: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 10SHdjHU056837; Thu, 28 Jan 2021 17:39:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SHdjFR056836; Thu, 28 Jan 2021 17:39:45 GMT (envelope-from git) Date: Thu, 28 Jan 2021 17:39:45 GMT Message-Id: <202101281739.10SHdjFR056836@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: 9a0a48b12d3d - main - usr.sbin/pkg: Don't re-define roundup2 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: 9a0a48b12d3d85f0f00b99439e6a8779f5f1abb6 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, 28 Jan 2021 17:39:48 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9a0a48b12d3d85f0f00b99439e6a8779f5f1abb6 commit 9a0a48b12d3d85f0f00b99439e6a8779f5f1abb6 Author: Alex Richardson AuthorDate: 2021-01-28 17:25:50 +0000 Commit: Alex Richardson CommitDate: 2021-01-28 17:25:53 +0000 usr.sbin/pkg: Don't re-define roundup2 The file already includes sys/param.h and should use that definition. I found this while testing D28332. Reviewed By: bapt Differential Revision: https://reviews.freebsd.org/D28331 --- usr.sbin/pkg/config.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index aaa9010b295d..7402112a967e 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include "config.h" -#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ - struct config_value { char *value; STAILQ_ENTRY(config_value) next; From owner-dev-commits-src-main@freebsd.org Thu Jan 28 17:42: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 2854D4E4C88 for ; Thu, 28 Jan 2021 17:42:34 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 4DRSV20CrTz4R4Z for ; Thu, 28 Jan 2021 17:42:33 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f41.google.com with SMTP id a1so6295268wrq.6 for ; Thu, 28 Jan 2021 09:42:33 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ntyw12YzgyfdRixlPgtmryqiCV/2WVCuKGhPZlyCy9E=; b=F/TvMhpaGXCn5nwq9hBgN9PYCP7KxAc7twhb5fjLoRv7vWH48YPpAGHaAuI83yYOWB AEE3Nb+XkgXFw39qhJUx9LvZbzV0G/4/TECvULAl9pgciSie8/Cdnu6HBvW+gjTbf0TN YqMi3juKpGadoRPgODazkHkZB9WIC1SPNN9T/W/V3iVGa/3yILuNYL19nrdi3bkC3dMo ZINI4A1+PU6kGyvZerZRcux0fMeu8dsRpXogadpO9dXqXKDE34Yi6W2Hr/i1w+fbsauk pLPRuakubSKABxm4eGwBb9/iK1XYnt3a5PPJ5bpBcM2JW/5Ub/j2T1/kMs/cB6Ug0VP/ d7LQ== X-Gm-Message-State: AOAM533ZohQEFebqH88VlZg49ZBAI1T2pBlBGKjdcqkyu62vMcr0oqIx /nL/jKtJk9dyFHydqWiaPcQv60ZYIsf/P6R5r1Y= X-Google-Smtp-Source: ABdhPJw7nD9YHrEIBliOnAMH/kn558k7SWnL4dMBH48EejaziRsg4HQtUbOsQLjK2mkMxm2zJk6OzA== X-Received: by 2002:a5d:62c1:: with SMTP id o1mr158120wrv.275.1611855752524; Thu, 28 Jan 2021 09:42:32 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id x1sm6973247wmi.14.2021.01.28.09.42.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 09:42:31 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 83ff5d5d98cb - main - Un-XFAIL two tests with Clang > 10 From: Jessica Clarke In-Reply-To: <202101281739.10SHdh37056796@gitrepo.freebsd.org> Date: Thu, 28 Jan 2021 17:42:30 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6B60F7D5-AD3E-459E-801A-65234A689A01@freebsd.org> References: <202101281739.10SHdh37056796@gitrepo.freebsd.org> To: Alex Richardson X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DRSV20CrTz4R4Z 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: Thu, 28 Jan 2021 17:42:34 -0000 Is the commit message or the diff wrong? Both use strict inequalities. Jess On 28 Jan 2021, at 17:39, Alex Richardson = wrote: >=20 > The branch main has been updated by arichardson: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D83ff5d5d98cbcf9b66dccd70022358ae= c8918a14 >=20 > commit 83ff5d5d98cbcf9b66dccd70022358aec8918a14 > Author: Alex Richardson > AuthorDate: 2021-01-28 17:17:49 +0000 > Commit: Alex Richardson > CommitDate: 2021-01-28 17:24:24 +0000 >=20 > Un-XFAIL two tests with Clang > 10 >=20 > SVN r343917 fixed this for in-tree clang, but when building with a = newer > out-of-tree clang the test was still marked as XFAIL. >=20 > Reviewed By: dim > Differential Revision: https://reviews.freebsd.org/D28390 > --- > contrib/netbsd-tests/lib/libm/t_cbrt.c | 4 ++-- > lib/msun/tests/trig_test.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/contrib/netbsd-tests/lib/libm/t_cbrt.c = b/contrib/netbsd-tests/lib/libm/t_cbrt.c > index d2cdd47a5beb..08e9faeb145c 100644 > --- a/contrib/netbsd-tests/lib/libm/t_cbrt.c > +++ b/contrib/netbsd-tests/lib/libm/t_cbrt.c > @@ -269,8 +269,8 @@ ATF_TC_BODY(cbrtl_powl, tc) > size_t i; >=20 > #if defined(__amd64__) && defined(__clang__) && __clang_major__ >=3D 7 = && \ > - __FreeBSD_cc_version < 1300002 > - atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); > + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 > + atf_tc_expect_fail("test fails with clang 7-9 - bug 234040"); > #endif >=20 > for (i =3D 0; i < __arraycount(x); i++) { > diff --git a/lib/msun/tests/trig_test.c b/lib/msun/tests/trig_test.c > index 483a5e187d50..ba1975721d3f 100644 > --- a/lib/msun/tests/trig_test.c > +++ b/lib/msun/tests/trig_test.c > @@ -161,7 +161,7 @@ ATF_TC_BODY(reduction, tc) > unsigned i; >=20 > #if defined(__amd64__) && defined(__clang__) && __clang_major__ >=3D 7 = && \ > - __FreeBSD_cc_version < 1300002 > + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 > atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); > #endif >=20 From owner-dev-commits-src-main@freebsd.org Thu Jan 28 17:46: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 A25DC4E4F0F; Thu, 28 Jan 2021 17:46:53 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 4DRSb144j5z4RbM; Thu, 28 Jan 2021 17:46:53 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f51.google.com with SMTP id bl23so9064900ejb.5; Thu, 28 Jan 2021 09:46:53 -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=pft0Nd6zH0A5xIhZFdxbUamrFXUws+kz0nzElSewkBA=; b=LeM2FLkC0mYTg1TmjAYnVI+WXsMpjWCR7FTi1cYmxG+p/YV3hvZwCvsPbW/bCo2sDV JGepFsC9ftHutdemmtJBqZfi6oEhhK3q02wVpuHsMC6HN4o6ZXelCu4iOQ6D3GdFRnGV WAcGLDiDKzSy7Nt6rF5s0KP7SyBCKAMCYNFfr1Ai4GLxUE1jhITd7j6hp3Fk3cGiDMIZ 6sAeO9sgzRQ+R6dcpIEtYDXVr6OiT+GdvCyQ6fdofutTuHnChU/CG/REr531eRuOcdn9 BeCEubC4XAPZ4Ebi1i0uvUz2tv8bQ5XXjVLK1cdT7+ihhidL5/IaXeeIaXBC+acyOPjX NStg== X-Gm-Message-State: AOAM531QBRr9gEisY/wvnRzrBHVeyh/8yoackkRyx56qCDjnBoUtqwhO 6j1hhgD4DGTqJM1kauuYjz3g9BfPU1xWTg== X-Google-Smtp-Source: ABdhPJxRkAlq/GZfXh+odAuli5Ej+ik3FjBXb42uqwj+4SzRL7+mMCKRP0oAL3d5BuvMtVj2CLYXCg== X-Received: by 2002:a17:907:a077:: with SMTP id ia23mr518631ejc.434.1611856012018; Thu, 28 Jan 2021 09:46:52 -0800 (PST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com. [209.85.128.43]) by smtp.gmail.com with ESMTPSA id pg19sm2716497ejb.0.2021.01.28.09.46.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jan 2021 09:46:51 -0800 (PST) Received: by mail-wm1-f43.google.com with SMTP id m2so5005571wmm.1; Thu, 28 Jan 2021 09:46:51 -0800 (PST) X-Received: by 2002:a1c:2c0b:: with SMTP id s11mr358781wms.13.1611856011426; Thu, 28 Jan 2021 09:46:51 -0800 (PST) MIME-Version: 1.0 References: <202101281739.10SHdh37056796@gitrepo.freebsd.org> <6B60F7D5-AD3E-459E-801A-65234A689A01@freebsd.org> In-Reply-To: <6B60F7D5-AD3E-459E-801A-65234A689A01@freebsd.org> From: Alexander Richardson Date: Thu, 28 Jan 2021 17:46:39 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 83ff5d5d98cb - main - Un-XFAIL two tests with Clang > 10 To: Jessica Clarke 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: 4DRSb144j5z4RbM 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, 28 Jan 2021 17:46:53 -0000 On Thu, 28 Jan 2021 at 17:42, Jessica Clarke wrote: > > Is the commit message or the diff wrong? Both use strict inequalities. > > Jess Sorry the commit message should be >= 10. Alex > > On 28 Jan 2021, at 17:39, Alex Richardson wrote: > > > > The branch main has been updated by arichardson: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=83ff5d5d98cbcf9b66dccd70022358aec8918a14 > > > > commit 83ff5d5d98cbcf9b66dccd70022358aec8918a14 > > Author: Alex Richardson > > AuthorDate: 2021-01-28 17:17:49 +0000 > > Commit: Alex Richardson > > CommitDate: 2021-01-28 17:24:24 +0000 > > > > Un-XFAIL two tests with Clang > 10 > > > > SVN r343917 fixed this for in-tree clang, but when building with a newer > > out-of-tree clang the test was still marked as XFAIL. > > > > Reviewed By: dim > > Differential Revision: https://reviews.freebsd.org/D28390 > > --- > > contrib/netbsd-tests/lib/libm/t_cbrt.c | 4 ++-- > > lib/msun/tests/trig_test.c | 2 +- > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/contrib/netbsd-tests/lib/libm/t_cbrt.c b/contrib/netbsd-tests/lib/libm/t_cbrt.c > > index d2cdd47a5beb..08e9faeb145c 100644 > > --- a/contrib/netbsd-tests/lib/libm/t_cbrt.c > > +++ b/contrib/netbsd-tests/lib/libm/t_cbrt.c > > @@ -269,8 +269,8 @@ ATF_TC_BODY(cbrtl_powl, tc) > > size_t i; > > > > #if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 && \ > > - __FreeBSD_cc_version < 1300002 > > - atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); > > + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 > > + atf_tc_expect_fail("test fails with clang 7-9 - bug 234040"); > > #endif > > > > for (i = 0; i < __arraycount(x); i++) { > > diff --git a/lib/msun/tests/trig_test.c b/lib/msun/tests/trig_test.c > > index 483a5e187d50..ba1975721d3f 100644 > > --- a/lib/msun/tests/trig_test.c > > +++ b/lib/msun/tests/trig_test.c > > @@ -161,7 +161,7 @@ ATF_TC_BODY(reduction, tc) > > unsigned i; > > > > #if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 && \ > > - __FreeBSD_cc_version < 1300002 > > + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 > > atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); > > #endif > > > From owner-dev-commits-src-main@freebsd.org Thu Jan 28 18:25: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 B72D94E5EB8; Thu, 28 Jan 2021 18:25: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 4DRTRY4XyXz4TNH; Thu, 28 Jan 2021 18:25: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 8E8F91491E; Thu, 28 Jan 2021 18:25: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 10SIPTLH021105; Thu, 28 Jan 2021 18:25:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SIPTGJ021104; Thu, 28 Jan 2021 18:25:29 GMT (envelope-from git) Date: Thu, 28 Jan 2021 18:25:29 GMT Message-Id: <202101281825.10SIPTGJ021104@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: aa906e2a4957 - main - OpenSSL: Support for kernel TLS offload (KTLS) 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: aa906e2a4957db700d9e6cc60857e1afe1aecc85 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, 28 Jan 2021 18:25:29 -0000 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 --- crypto/openssl/CHANGES | 5 + crypto/openssl/Configure | 29 ++ crypto/openssl/INSTALL | 9 + crypto/openssl/apps/s_client.c | 6 + crypto/openssl/apps/s_server.c | 6 + crypto/openssl/crypto/bio/b_sock2.c | 12 + crypto/openssl/crypto/bio/bss_conn.c | 46 ++- crypto/openssl/crypto/bio/bss_sock.c | 57 ++- crypto/openssl/crypto/err/openssl.txt | 1 + crypto/openssl/crypto/evp/e_aes.c | 8 + crypto/openssl/doc/man3/BIO_ctrl.pod | 21 +- crypto/openssl/doc/man3/SSL_CTX_set_mode.pod | 17 + .../man3/SSL_CTX_set_record_padding_callback.pod | 10 +- crypto/openssl/doc/man3/SSL_write.pod | 31 +- crypto/openssl/engines/e_afalg.c | 3 +- crypto/openssl/include/internal/bio.h | 39 ++ crypto/openssl/include/internal/ktls.h | 403 +++++++++++++++++++++ crypto/openssl/include/openssl/bio.h | 20 + crypto/openssl/include/openssl/err.h | 1 + crypto/openssl/include/openssl/evp.h | 2 + crypto/openssl/include/openssl/ssl.h | 12 +- crypto/openssl/include/openssl/sslerr.h | 1 + crypto/openssl/ssl/build.info | 5 + crypto/openssl/ssl/ktls.c | 221 +++++++++++ crypto/openssl/ssl/record/rec_layer_s3.c | 137 +++++-- crypto/openssl/ssl/record/record.h | 2 + crypto/openssl/ssl/record/record_local.h | 3 + crypto/openssl/ssl/record/ssl3_buffer.c | 33 +- crypto/openssl/ssl/record/ssl3_record.c | 47 ++- crypto/openssl/ssl/ssl_err.c | 1 + crypto/openssl/ssl/ssl_lib.c | 104 +++++- crypto/openssl/ssl/ssl_local.h | 13 + crypto/openssl/ssl/t1_enc.c | 128 +++++++ crypto/openssl/ssl/tls13_enc.c | 81 ++++- secure/lib/libcrypto/Makefile | 18 +- secure/lib/libcrypto/opensslconf.h.in | 3 + secure/lib/libssl/Makefile | 6 + secure/lib/libssl/Version.map | 6 + share/mk/src.opts.mk | 7 + tools/build/options/WITHOUT_OPENSSL_KTLS | 1 + tools/build/options/WITH_OPENSSL_KTLS | 1 + 41 files changed, 1465 insertions(+), 91 deletions(-) diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES index 37dd60b726ee..4d61c1dadbaa 100644 --- a/crypto/openssl/CHANGES +++ b/crypto/openssl/CHANGES @@ -390,6 +390,11 @@ necessary to configure just to create a source distribution. [Richard Levitte] + *) Added support for Linux Kernel TLS data-path. The Linux Kernel data-path + improves application performance by removing data copies and providing + applications with zero-copy system calls such as sendfile and splice. + [Boris Pismenny] + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] *) Timing vulnerability in DSA signature generation diff --git a/crypto/openssl/Configure b/crypto/openssl/Configure index 1d73d06e1b3b..1423e1bfe14f 100755 --- a/crypto/openssl/Configure +++ b/crypto/openssl/Configure @@ -387,6 +387,7 @@ my @disablables = ( "heartbeats", "hw(-.+)?", "idea", + "ktls", "makedepend", "md2", "md4", @@ -474,6 +475,7 @@ our %disabled = ( # "what" => "comment" "weak-ssl-ciphers" => "default", "zlib" => "default", "zlib-dynamic" => "default", + "ktls" => "default", ); # Note: => pair form used for aesthetics, not to truly make a hash table @@ -1580,6 +1582,33 @@ unless ($disabled{devcryptoeng}) { } } +unless ($disabled{ktls}) { + $config{ktls}=""; + if ($target =~ m/^linux/) { + my $usr = "/usr/$config{cross_compile_prefix}"; + chop($usr); + if ($config{cross_compile_prefix} eq "") { + $usr = "/usr"; + } + my $minver = (4 << 16) + (13 << 8) + 0; + my @verstr = split(" ",`cat $usr/include/linux/version.h | grep LINUX_VERSION_CODE`); + + if ($verstr[2] < $minver) { + disable('too-old-kernel', 'ktls'); + } + } elsif ($target =~ m/^BSD/) { + my $cc = $config{CROSS_COMPILE}.$config{CC}; + system("printf '#include \n#include ' | $cc -E - >/dev/null 2>&1"); + if ($? != 0) { + disable('too-old-freebsd', 'ktls'); + } + } else { + disable('not-linux-or-freebsd', 'ktls'); + } +} + +push @{$config{openssl_other_defines}}, "OPENSSL_NO_KTLS" if ($disabled{ktls}); + # Get the extra flags used when building shared libraries and modules. We # do this late because some of them depend on %disabled. diff --git a/crypto/openssl/INSTALL b/crypto/openssl/INSTALL index f5118428b3bc..be84f2aa8e5d 100644 --- a/crypto/openssl/INSTALL +++ b/crypto/openssl/INSTALL @@ -262,6 +262,15 @@ Don't build the AFALG engine. This option will be forced if on a platform that does not support AFALG. + enable-ktls + Build with Kernel TLS support. This option will enable the + use of the Kernel TLS data-path, which can improve + performance and allow for the use of sendfile and splice + system calls on TLS sockets. The Kernel may use TLS + accelerators if any are available on the system. + This option will be forced off on systems that do not support + the Kernel TLS data-path. + enable-asan Build with the Address sanitiser. This is a developer option only. It may not work on all platforms and should never be diff --git a/crypto/openssl/apps/s_client.c b/crypto/openssl/apps/s_client.c index 83b3fc9c7f13..68bd9ced015f 100644 --- a/crypto/openssl/apps/s_client.c +++ b/crypto/openssl/apps/s_client.c @@ -3282,6 +3282,12 @@ static void print_stuff(BIO *bio, SSL *s, int full) BIO_printf(bio, "Expansion: %s\n", expansion ? SSL_COMP_get_name(expansion) : "NONE"); #endif +#ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_send(SSL_get_wbio(s))) + BIO_printf(bio_err, "Using Kernel TLS for sending\n"); + if (BIO_get_ktls_recv(SSL_get_rbio(s))) + BIO_printf(bio_err, "Using Kernel TLS for receiving\n"); +#endif #ifdef SSL_DEBUG { diff --git a/crypto/openssl/apps/s_server.c b/crypto/openssl/apps/s_server.c index 0ba75999fd28..ddc0b4bcd76d 100644 --- a/crypto/openssl/apps/s_server.c +++ b/crypto/openssl/apps/s_server.c @@ -2923,6 +2923,12 @@ static void print_connection_info(SSL *con) } OPENSSL_free(exportedkeymat); } +#ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_send(SSL_get_wbio(con))) + BIO_printf(bio_err, "Using Kernel TLS for sending\n"); + if (BIO_get_ktls_recv(SSL_get_rbio(con))) + BIO_printf(bio_err, "Using Kernel TLS for receiving\n"); +#endif (void)BIO_flush(bio_s_out); } diff --git a/crypto/openssl/crypto/bio/b_sock2.c b/crypto/openssl/crypto/bio/b_sock2.c index 335dfabc6180..80ef348d9254 100644 --- a/crypto/openssl/crypto/bio/b_sock2.c +++ b/crypto/openssl/crypto/bio/b_sock2.c @@ -12,6 +12,7 @@ #include #include "bio_local.h" +#include "internal/ktls.h" #include @@ -50,6 +51,17 @@ int BIO_socket(int domain, int socktype, int protocol, int options) BIOerr(BIO_F_BIO_SOCKET, BIO_R_UNABLE_TO_CREATE_SOCKET); return INVALID_SOCKET; } +# ifndef OPENSSL_NO_KTLS + { + /* + * The new socket is created successfully regardless of ktls_enable. + * ktls_enable doesn't change any functionality of the socket, except + * changing the setsockopt to enable the processing of ktls_start. + * Thus, it is not a problem to call it for non-TLS sockets. + */ + ktls_enable(sock); + } +# endif return sock; } diff --git a/crypto/openssl/crypto/bio/bss_conn.c b/crypto/openssl/crypto/bio/bss_conn.c index 807a82b23ba2..d4786442803e 100644 --- a/crypto/openssl/crypto/bio/bss_conn.c +++ b/crypto/openssl/crypto/bio/bss_conn.c @@ -11,6 +11,7 @@ #include #include "bio_local.h" +#include "internal/ktls.h" #ifndef OPENSSL_NO_SOCK @@ -20,6 +21,9 @@ typedef struct bio_connect_st { char *param_hostname; char *param_service; int connect_mode; +# ifndef OPENSSL_NO_KTLS + unsigned char record_type; +# endif BIO_ADDRINFO *addr_first; const BIO_ADDRINFO *addr_iter; @@ -320,7 +324,12 @@ static int conn_read(BIO *b, char *out, int outl) if (out != NULL) { clear_socket_error(); - ret = readsocket(b->num, out, outl); +# ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_recv(b)) + ret = ktls_read_record(b->num, out, outl); + else +# endif + ret = readsocket(b->num, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -345,7 +354,16 @@ static int conn_write(BIO *b, const char *in, int inl) } clear_socket_error(); - ret = writesocket(b->num, in, inl); +# ifndef OPENSSL_NO_KTLS + if (BIO_should_ktls_ctrl_msg_flag(b)) { + ret = ktls_send_ctrl_message(b->num, data->record_type, in, inl); + if (ret >= 0) { + ret = inl; + BIO_clear_ktls_ctrl_msg_flag(b); + } + } else +# endif + ret = writesocket(b->num, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -361,6 +379,9 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) const char **pptr = NULL; long ret = 1; BIO_CONNECT *data; +# ifndef OPENSSL_NO_KTLS + ktls_crypto_info_t *crypto_info; +# endif data = (BIO_CONNECT *)b->ptr; @@ -520,6 +541,27 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_EOF: ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; break; +# ifndef OPENSSL_NO_KTLS + case BIO_CTRL_SET_KTLS: + crypto_info = (ktls_crypto_info_t *)ptr; + ret = ktls_start(b->num, crypto_info, num); + if (ret) + BIO_set_ktls_flag(b, num); + break; + case BIO_CTRL_GET_KTLS_SEND: + return BIO_should_ktls_flag(b, 1); + case BIO_CTRL_GET_KTLS_RECV: + return BIO_should_ktls_flag(b, 0); + case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: + BIO_set_ktls_ctrl_msg_flag(b); + data->record_type = num; + ret = 0; + break; + case BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG: + BIO_clear_ktls_ctrl_msg_flag(b); + ret = 0; + break; +# endif default: ret = 0; break; diff --git a/crypto/openssl/crypto/bio/bss_sock.c b/crypto/openssl/crypto/bio/bss_sock.c index 6251f3d46a17..a1fc23c7c938 100644 --- a/crypto/openssl/crypto/bio/bss_sock.c +++ b/crypto/openssl/crypto/bio/bss_sock.c @@ -11,6 +11,7 @@ #include #include "bio_local.h" #include "internal/cryptlib.h" +#include "internal/ktls.h" #ifndef OPENSSL_NO_SOCK @@ -64,6 +65,17 @@ BIO *BIO_new_socket(int fd, int close_flag) if (ret == NULL) return NULL; BIO_set_fd(ret, fd, close_flag); +# ifndef OPENSSL_NO_KTLS + { + /* + * The new socket is created successfully regardless of ktls_enable. + * ktls_enable doesn't change any functionality of the socket, except + * changing the setsockopt to enable the processing of ktls_start. + * Thus, it is not a problem to call it for non-TLS sockets. + */ + ktls_enable(fd); + } +# endif return ret; } @@ -96,7 +108,12 @@ static int sock_read(BIO *b, char *out, int outl) if (out != NULL) { clear_socket_error(); - ret = readsocket(b->num, out, outl); +# ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_recv(b)) + ret = ktls_read_record(b->num, out, outl); + else +# endif + ret = readsocket(b->num, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -110,10 +127,20 @@ static int sock_read(BIO *b, char *out, int outl) static int sock_write(BIO *b, const char *in, int inl) { - int ret; + int ret = 0; clear_socket_error(); - ret = writesocket(b->num, in, inl); +# ifndef OPENSSL_NO_KTLS + if (BIO_should_ktls_ctrl_msg_flag(b)) { + unsigned char record_type = (intptr_t)b->ptr; + ret = ktls_send_ctrl_message(b->num, record_type, in, inl); + if (ret >= 0) { + ret = inl; + BIO_clear_ktls_ctrl_msg_flag(b); + } + } else +# endif + ret = writesocket(b->num, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -126,6 +153,9 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) { long ret = 1; int *ip; +# ifndef OPENSSL_NO_KTLS + ktls_crypto_info_t *crypto_info; +# endif switch (cmd) { case BIO_C_SET_FD: @@ -153,6 +183,27 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_FLUSH: ret = 1; break; +# ifndef OPENSSL_NO_KTLS + case BIO_CTRL_SET_KTLS: + crypto_info = (ktls_crypto_info_t *)ptr; + ret = ktls_start(b->num, crypto_info, num); + if (ret) + BIO_set_ktls_flag(b, num); + break; + case BIO_CTRL_GET_KTLS_SEND: + return BIO_should_ktls_flag(b, 1); + case BIO_CTRL_GET_KTLS_RECV: + return BIO_should_ktls_flag(b, 0); + case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: + BIO_set_ktls_ctrl_msg_flag(b); + b->ptr = (void *)num; + ret = 0; + break; + case BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG: + BIO_clear_ktls_ctrl_msg_flag(b); + ret = 0; + break; +# endif case BIO_CTRL_EOF: ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; break; diff --git a/crypto/openssl/crypto/err/openssl.txt b/crypto/openssl/crypto/err/openssl.txt index 815460b24f67..d547c45913d6 100644 --- a/crypto/openssl/crypto/err/openssl.txt +++ b/crypto/openssl/crypto/err/openssl.txt @@ -1318,6 +1318,7 @@ SSL_F_SSL_RENEGOTIATE:516:SSL_renegotiate SSL_F_SSL_RENEGOTIATE_ABBREVIATED:546:SSL_renegotiate_abbreviated SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT:320:* SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT:321:* +SSL_F_SSL_SENDFILE:639:SSL_sendfile SSL_F_SSL_SESSION_DUP:348:ssl_session_dup SSL_F_SSL_SESSION_NEW:189:SSL_SESSION_new SSL_F_SSL_SESSION_PRINT_FP:190:SSL_SESSION_print_fp diff --git a/crypto/openssl/crypto/evp/e_aes.c b/crypto/openssl/crypto/evp/e_aes.c index 405ddbf9bf09..4640c7528a20 100644 --- a/crypto/openssl/crypto/evp/e_aes.c +++ b/crypto/openssl/crypto/evp/e_aes.c @@ -2895,6 +2895,14 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) memcpy(ptr, c->buf, arg); return 1; + case EVP_CTRL_GET_IV: + if (gctx->iv_gen != 1) + return 0; + if (gctx->ivlen != arg) + return 0; + memcpy(ptr, gctx->iv, arg); + return 1; + case EVP_CTRL_GCM_SET_IV_FIXED: /* Special case: -1 length restores whole IV */ if (arg == -1) { diff --git a/crypto/openssl/doc/man3/BIO_ctrl.pod b/crypto/openssl/doc/man3/BIO_ctrl.pod index 2e438c3ce952..31b18b2879fe 100644 --- a/crypto/openssl/doc/man3/BIO_ctrl.pod +++ b/crypto/openssl/doc/man3/BIO_ctrl.pod @@ -5,7 +5,8 @@ BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, -BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb +BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb, BIO_get_ktls_send, +BIO_get_ktls_recv - BIO control operations =head1 SYNOPSIS @@ -34,6 +35,9 @@ BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb int BIO_get_info_callback(BIO *b, BIO_info_cb **cbp); int BIO_set_info_callback(BIO *b, BIO_info_cb *cb); + int BIO_get_ktls_send(BIO *b); + int BIO_get_ktls_recv(BIO *b); + =head1 DESCRIPTION BIO_ctrl(), BIO_callback_ctrl(), BIO_ptr_ctrl() and BIO_int_ctrl() @@ -72,6 +76,11 @@ Not all BIOs support these calls. BIO_ctrl_pending() and BIO_ctrl_wpending() return a size_t type and are functions, BIO_pending() and BIO_wpending() are macros which call BIO_ctrl(). +BIO_get_ktls_send() returns 1 if the BIO is using the Kernel TLS data-path for +sending. Otherwise, it returns zero. +BIO_get_ktls_recv() returns 1 if the BIO is using the Kernel TLS data-path for +receiving. Otherwise, it returns zero. + =head1 RETURN VALUES BIO_reset() normally returns 1 for success and 0 or -1 for failure. File @@ -92,6 +101,11 @@ BIO_get_close() returns the close flag value: BIO_CLOSE or BIO_NOCLOSE. BIO_pending(), BIO_ctrl_pending(), BIO_wpending() and BIO_ctrl_wpending() return the amount of pending data. +BIO_get_ktls_send() returns 1 if the BIO is using the Kernel TLS data-path for +sending. Otherwise, it returns zero. +BIO_get_ktls_recv() returns 1 if the BIO is using the Kernel TLS data-path for +receiving. Otherwise, it returns zero. + =head1 NOTES BIO_flush(), because it can write data may return 0 or -1 indicating @@ -124,6 +138,11 @@ particular a return value of 0 can be returned if an operation is not supported, if an error occurred, if EOF has not been reached and in the case of BIO_seek() on a file BIO for a successful operation. +=head1 HISTORY + +The BIO_get_ktls_send() and BIO_get_ktls_recv() functions were added in +OpenSSL 3.0.0. + =head1 COPYRIGHT Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod index 85e3353e0e2c..27eaebad1ea0 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod @@ -114,6 +114,22 @@ enables this behaviour to allow interoperability with such broken implementations. Please note that setting this option breaks interoperability with correct implementations. This option only applies to DTLS over SCTP. +=item SSL_MODE_NO_KTLS_TX + +Disable the use of the kernel TLS egress data-path. +By default kernel TLS is enabled if it is supported by the negotiated ciphersuites +and extensions and OpenSSL has been compiled with support for it. +The kernel TLS data-path implements the record layer, +and the crypto algorithm. The kernel will utilize the best hardware +available for crypto. Using the kernel data-path should reduce the memory +footprint of OpenSSL because no buffering is required. Also, the throughput +should improve because data copy is avoided when user data is encrypted into +kernel memory instead of the usual encrypt than copy to kernel. + +Kernel TLS might not support all the features of OpenSSL. For instance, +renegotiation, and setting the maximum fragment size is not possible as of +Linux 4.20. + =back All modes are off by default except for SSL_MODE_AUTO_RETRY which is on by @@ -134,6 +150,7 @@ L, L =head1 HISTORY SSL_MODE_ASYNC was added in OpenSSL 1.1.0. +SSL_MODE_NO_KTLS_TX was first added to OpenSSL 3.0.0. =head1 COPYRIGHT diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod b/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod index 13e56f0c57f6..247a39fc0355 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod @@ -16,7 +16,7 @@ SSL_set_block_padding - install callback to specify TLS 1.3 record padding #include void SSL_CTX_set_record_padding_callback(SSL_CTX *ctx, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); - void SSL_set_record_padding_callback(SSL *ssl, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); + int SSL_set_record_padding_callback(SSL *ssl, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); void SSL_CTX_set_record_padding_callback_arg(SSL_CTX *ctx, void *arg); void *SSL_CTX_get_record_padding_callback_arg(const SSL_CTX *ctx); @@ -32,6 +32,8 @@ SSL_set_block_padding - install callback to specify TLS 1.3 record padding SSL_CTX_set_record_padding_callback() or SSL_set_record_padding_callback() can be used to assign a callback function I to specify the padding for TLS 1.3 records. The value set in B is copied to a new SSL by SSL_new(). +Kernel TLS is not possible if the record padding callback is set, and the callback +function cannot be set if Kernel TLS is already configured for the current SSL object. SSL_CTX_set_record_padding_callback_arg() and SSL_set_record_padding_callback_arg() assign a value B that is passed to the callback when it is invoked. The value @@ -64,6 +66,9 @@ indicates no padding will be added. A return value that causes the record to exceed the maximum record size (SSL3_RT_MAX_PLAIN_LENGTH) will pad out to the maximum record size. +The SSL_CTX_get_record_padding_callback_arg() function returns 1 on success or 0 if +the callback function is not set because Kernel TLS is configured for the SSL object. + =head1 NOTES The default behavior is to add no padding to the record. @@ -84,6 +89,9 @@ L, L The record padding API was added for TLS 1.3 support in OpenSSL 1.1.1. +The return type of SSL_CTX_set_record_padding_callback() function was +changed to int in OpenSSL 3.0. + =head1 COPYRIGHT Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved. diff --git a/crypto/openssl/doc/man3/SSL_write.pod b/crypto/openssl/doc/man3/SSL_write.pod index 5e3ce1e7e4dd..20c7953deb06 100644 --- a/crypto/openssl/doc/man3/SSL_write.pod +++ b/crypto/openssl/doc/man3/SSL_write.pod @@ -2,12 +2,13 @@ =head1 NAME -SSL_write_ex, SSL_write - write bytes to a TLS/SSL connection +SSL_write_ex, SSL_write, SSL_sendfile - write bytes to a TLS/SSL connection =head1 SYNOPSIS #include + ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, int flags); int SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *written); int SSL_write(SSL *ssl, const void *buf, int num); @@ -17,6 +18,14 @@ SSL_write_ex() and SSL_write() write B bytes from the buffer B into the specified B connection. On success SSL_write_ex() will store the number of bytes written in B<*written>. +SSL_sendfile() writes B bytes from offset B in the file +descriptor B to the specified SSL connection B. This function provides +efficient zero-copy semantics. SSL_sendfile() is available only when +Kernel TLS is enabled, which can be checked by calling BIO_get_ktls_send(). +It is provided here to allow users to maintain the same interface. +The meaning of B is platform dependent. +Currently, under Linux it is ignored. + =head1 NOTES In the paragraphs below a "write function" is defined as one of either @@ -104,17 +113,35 @@ You should instead call SSL_get_error() to find out if it's retryable. =back +For SSL_sendfile(), the following return values can occur: + +=over 4 + +=item Z<>>= 0 + +The write operation was successful, the return value is the number +of bytes of the file written to the TLS/SSL connection. + +=item E 0 + +The write operation was not successful, because either the connection was +closed, an error occured or action must be taken by the calling process. +Call SSL_get_error() with the return value to find out the reason. + +=back + =head1 SEE ALSO L, L, L L, L, L, L -L, +L, L, L, L =head1 HISTORY The SSL_write_ex() function was added in OpenSSL 1.1.1. +The SSL_sendfile() function was added in OpenSSL 3.0.0. =head1 COPYRIGHT diff --git a/crypto/openssl/engines/e_afalg.c b/crypto/openssl/engines/e_afalg.c index 4b1722846133..5ef3a8d457e6 100644 --- a/crypto/openssl/engines/e_afalg.c +++ b/crypto/openssl/engines/e_afalg.c @@ -407,7 +407,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in, size_t inl, const unsigned char *iv, unsigned int enc) { - struct msghdr msg = { 0 }; + struct msghdr msg; struct cmsghdr *cmsg; struct iovec iov; ssize_t sbytes; @@ -416,6 +416,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in, # endif char cbuf[CMSG_SPACE(ALG_IV_LEN(ALG_AES_IV_LEN)) + CMSG_SPACE(ALG_OP_LEN)]; + memset(&msg, 0, sizeof(msg)); memset(cbuf, 0, sizeof(cbuf)); msg.msg_control = cbuf; msg.msg_controllen = sizeof(cbuf); diff --git a/crypto/openssl/include/internal/bio.h b/crypto/openssl/include/internal/bio.h index c343b276295c..521b5fa2198f 100644 --- a/crypto/openssl/include/internal/bio.h +++ b/crypto/openssl/include/internal/bio.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#ifndef HEADER_INTERNAL_BIO_H +# define HEADER_INTERNAL_BIO_H + #include struct bio_method_st { @@ -31,3 +34,39 @@ void bio_cleanup(void); /* Old style to new style BIO_METHOD conversion functions */ int bwrite_conv(BIO *bio, const char *data, size_t datal, size_t *written); int bread_conv(BIO *bio, char *data, size_t datal, size_t *read); + +/* Changes to these internal BIOs must also update include/openssl/bio.h */ +# define BIO_CTRL_SET_KTLS 72 +# define BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG 74 +# define BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG 75 + +/* + * This is used with socket BIOs: + * BIO_FLAGS_KTLS_TX means we are using ktls with this BIO for sending. + * BIO_FLAGS_KTLS_TX_CTRL_MSG means we are about to send a ctrl message next. + * BIO_FLAGS_KTLS_RX means we are using ktls with this BIO for receiving. + */ +# define BIO_FLAGS_KTLS_TX 0x800 +# define BIO_FLAGS_KTLS_TX_CTRL_MSG 0x1000 +# define BIO_FLAGS_KTLS_RX 0x2000 + +/* KTLS related controls and flags */ +# define BIO_set_ktls_flag(b, is_tx) \ + BIO_set_flags(b, (is_tx) ? BIO_FLAGS_KTLS_TX : BIO_FLAGS_KTLS_RX) +# define BIO_should_ktls_flag(b, is_tx) \ + BIO_test_flags(b, (is_tx) ? BIO_FLAGS_KTLS_TX : BIO_FLAGS_KTLS_RX) +# define BIO_set_ktls_ctrl_msg_flag(b) \ + BIO_set_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) +# define BIO_should_ktls_ctrl_msg_flag(b) \ + BIO_test_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) +# define BIO_clear_ktls_ctrl_msg_flag(b) \ + BIO_clear_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) + +# define BIO_set_ktls(b, keyblob, is_tx) \ + BIO_ctrl(b, BIO_CTRL_SET_KTLS, is_tx, keyblob) +# define BIO_set_ktls_ctrl_msg(b, record_type) \ + BIO_ctrl(b, BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG, record_type, NULL) +# define BIO_clear_ktls_ctrl_msg(b) \ + BIO_ctrl(b, BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG, 0, NULL) + +#endif diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h new file mode 100644 index 000000000000..9032c0ed6174 --- /dev/null +++ b/crypto/openssl/include/internal/ktls.h @@ -0,0 +1,403 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#if defined(OPENSSL_SYS_LINUX) +# ifndef OPENSSL_NO_KTLS +# include +# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) +# define OPENSSL_NO_KTLS +# ifndef PEDANTIC +# warning "KTLS requires Kernel Headers >= 4.13.0" +# warning "Skipping Compilation of KTLS" +# endif +# endif +# endif +#endif + +#ifndef HEADER_INTERNAL_KTLS +# define HEADER_INTERNAL_KTLS +# ifndef OPENSSL_NO_KTLS + +# if defined(__FreeBSD__) +# include +# include +# include +# include +# include +# include "openssl/ssl3.h" + +# ifndef TCP_RXTLS_ENABLE +# define OPENSSL_NO_KTLS_RX +# endif +# define OPENSSL_KTLS_AES_GCM_128 +# define OPENSSL_KTLS_AES_GCM_256 +# define OPENSSL_KTLS_TLS13 + +/* + * Only used by the tests in sslapitest.c. + */ +# define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 8 +# define TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE 8 + +typedef struct tls_enable ktls_crypto_info_t; + +/* + * FreeBSD does not require any additional steps to enable KTLS before + * setting keys. + */ +static ossl_inline int ktls_enable(int fd) +{ + return 1; +} + +/* + * The TCP_TXTLS_ENABLE socket option marks the outgoing socket buffer + * as using TLS. If successful, then data sent using this socket will + * be encrypted and encapsulated in TLS records using the tls_en + * provided here. + * + * The TCP_RXTLS_ENABLE socket option marks the incoming socket buffer + * as using TLS. If successful, then data received for this socket will + * be authenticated and decrypted using the tls_en provided here. + */ +static ossl_inline int ktls_start(int fd, ktls_crypto_info_t *tls_en, int is_tx) +{ + if (is_tx) + return setsockopt(fd, IPPROTO_TCP, TCP_TXTLS_ENABLE, + tls_en, sizeof(*tls_en)) ? 0 : 1; +# ifndef OPENSSL_NO_KTLS_RX + return setsockopt(fd, IPPROTO_TCP, TCP_RXTLS_ENABLE, tls_en, + sizeof(*tls_en)) ? 0 : 1; +# else + return 0; +# endif +} + +/* + * Send a TLS record using the tls_en provided in ktls_start and use + * record_type instead of the default SSL3_RT_APPLICATION_DATA. + * When the socket is non-blocking, then this call either returns EAGAIN or + * the entire record is pushed to TCP. It is impossible to send a partial + * record using this control message. + */ +static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type, + const void *data, size_t length) +{ + struct msghdr msg = { 0 }; + int cmsg_len = sizeof(record_type); + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(cmsg_len)]; + struct iovec msg_iov; /* Vector of data to send/receive into */ + + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_TCP; + cmsg->cmsg_type = TLS_SET_RECORD_TYPE; + cmsg->cmsg_len = CMSG_LEN(cmsg_len); + *((unsigned char *)CMSG_DATA(cmsg)) = record_type; + msg.msg_controllen = cmsg->cmsg_len; + + msg_iov.iov_base = (void *)data; + msg_iov.iov_len = length; + msg.msg_iov = &msg_iov; + msg.msg_iovlen = 1; + + return sendmsg(fd, &msg, 0); +} + +# ifdef OPENSSL_NO_KTLS_RX + +static ossl_inline int ktls_read_record(int fd, void *data, size_t length) +{ + return -1; +} + +# else /* !defined(OPENSSL_NO_KTLS_RX) */ + +/* + * Receive a TLS record using the tls_en provided in ktls_start. The + * kernel strips any explicit IV and authentication tag, but provides + * the TLS record header via a control message. If there is an error + * with the TLS record such as an invalid header, invalid padding, or + * authentication failure recvmsg() will fail with an error. + */ +static ossl_inline int ktls_read_record(int fd, void *data, size_t length) +{ + struct msghdr msg = { 0 }; + int cmsg_len = sizeof(struct tls_get_record); + struct tls_get_record *tgr; + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(cmsg_len)]; + struct iovec msg_iov; /* Vector of data to send/receive into */ + int ret; + unsigned char *p = data; + const size_t prepend_length = SSL3_RT_HEADER_LENGTH; + + if (length <= prepend_length) { + errno = EINVAL; + return -1; + } + + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + + msg_iov.iov_base = p + prepend_length; + msg_iov.iov_len = length - prepend_length; + msg.msg_iov = &msg_iov; + msg.msg_iovlen = 1; + + ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + return ret; + + if ((msg.msg_flags & (MSG_EOR | MSG_CTRUNC)) != MSG_EOR) { + errno = EMSGSIZE; + return -1; + } + + if (msg.msg_controllen == 0) { + errno = EBADMSG; + return -1; + } + + cmsg = CMSG_FIRSTHDR(&msg); + if (cmsg->cmsg_level != IPPROTO_TCP || cmsg->cmsg_type != TLS_GET_RECORD + || cmsg->cmsg_len != CMSG_LEN(cmsg_len)) { + errno = EBADMSG; + return -1; + } + + tgr = (struct tls_get_record *)CMSG_DATA(cmsg); + p[0] = tgr->tls_type; + p[1] = tgr->tls_vmajor; + p[2] = tgr->tls_vminor; + *(uint16_t *)(p + 3) = htons(ret); + + return ret + prepend_length; +} + +# endif /* OPENSSL_NO_KTLS_RX */ + +/* + * KTLS enables the sendfile system call to send data from a file over + * TLS. + */ +static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, + size_t size, int flags) +{ + off_t sbytes; + int ret; + + ret = sendfile(fd, s, off, size, NULL, &sbytes, flags); + if (ret == -1) { + if (errno == EAGAIN && sbytes != 0) + return sbytes; + return -1; + } + return sbytes; +} + +# endif /* __FreeBSD__ */ + +# if defined(OPENSSL_SYS_LINUX) + +# include +# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) +# define OPENSSL_NO_KTLS_RX +# ifndef PEDANTIC +# warning "KTLS requires Kernel Headers >= 4.17.0 for receiving" +# warning "Skipping Compilation of KTLS receive data path" +# endif +# endif +# define OPENSSL_KTLS_AES_GCM_128 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +# define OPENSSL_KTLS_AES_GCM_256 +# define OPENSSL_KTLS_TLS13 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) +# define OPENSSL_KTLS_AES_CCM_128 +# endif +# endif + +# include +# include +# include +# include "openssl/ssl3.h" +# include "openssl/tls1.h" +# include "openssl/evp.h" + +# ifndef SOL_TLS +# define SOL_TLS 282 +# endif + +# ifndef TCP_ULP +# define TCP_ULP 31 +# endif + +# ifndef TLS_RX *** 1681 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Jan 28 18:25: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 EB3E84E6022; Thu, 28 Jan 2021 18:25:30 +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 4DRTRZ6HYWz4TWx; Thu, 28 Jan 2021 18:25:30 +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 CAB211491F; Thu, 28 Jan 2021 18:25:30 +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 10SIPUUa021127; Thu, 28 Jan 2021 18:25:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SIPUWJ021126; Thu, 28 Jan 2021 18:25:30 GMT (envelope-from git) Date: Thu, 28 Jan 2021 18:25:30 GMT Message-Id: <202101281825.10SIPUWJ021126@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: bb8acd558e66 - main - OpenSSL: Regenerate manual pages. 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: bb8acd558e66bd4bae31602fcbe569863f47382c 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, 28 Jan 2021 18:25:31 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bb8acd558e66bd4bae31602fcbe569863f47382c commit bb8acd558e66bd4bae31602fcbe569863f47382c Author: Jung-uk Kim AuthorDate: 2021-01-26 22:26:51 +0000 Commit: John Baldwin CommitDate: 2021-01-28 18:24:24 +0000 OpenSSL: Regenerate manual pages. MFC after: 1 week --- secure/lib/libcrypto/man/man3/ADMISSIONS.3 | 2 +- .../libcrypto/man/man3/ASN1_INTEGER_get_int64.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_generate_nconf.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_start_job.3 | 2 +- secure/lib/libcrypto/man/man3/BF_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDR.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ctrl.3 | 23 +- secure/lib/libcrypto/man/man3/BIO_f_base64.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_f_buffer.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_md.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_null.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_f_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_find_type.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_data.3 | 2 +- .../lib/libcrypto/man/man3/BIO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 | 280 +++++++++++++++++++++ secure/lib/libcrypto/man/man3/BIO_get_ktls_send.3 | 280 +++++++++++++++++++++ secure/lib/libcrypto/man/man3/BIO_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_printf.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_push.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_read.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_accept.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_bio.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_fd.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_file.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_mem.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_null.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_s_socket.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_set_callback.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_should_retry.3 | 2 +- secure/lib/libcrypto/man/man3/BN_BLINDING_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_start.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add_word.3 | 2 +- secure/lib/libcrypto/man/man3/BN_bn2bin.3 | 2 +- secure/lib/libcrypto/man/man3/BN_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/BN_copy.3 | 2 +- secure/lib/libcrypto/man/man3/BN_generate_prime.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_inverse.3 | 4 +- .../lib/libcrypto/man/man3/BN_mod_mul_montgomery.3 | 2 +- .../lib/libcrypto/man/man3/BN_mod_mul_reciprocal.3 | 2 +- secure/lib/libcrypto/man/man3/BN_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_num_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/BN_rand.3 | 2 +- secure/lib/libcrypto/man/man3/BN_security_bits.3 | 4 +- secure/lib/libcrypto/man/man3/BN_set_bit.3 | 2 +- secure/lib/libcrypto/man/man3/BN_swap.3 | 4 +- secure/lib/libcrypto/man/man3/BN_zero.3 | 2 +- secure/lib/libcrypto/man/man3/BUF_MEM_new.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add0_cert.3 | 2 +- .../libcrypto/man/man3/CMS_add1_recipient_cert.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add1_signer.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_compress.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_decrypt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_encrypt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_final.3 | 4 +- .../libcrypto/man/man3/CMS_get0_RecipientInfos.3 | 2 +- .../lib/libcrypto/man/man3/CMS_get0_SignerInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_type.3 | 2 +- .../libcrypto/man/man3/CMS_get1_ReceiptRequest.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_sign_receipt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_uncompress.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_verify.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify_receipt.3 | 4 +- secure/lib/libcrypto/man/man3/CONF_modules_free.3 | 2 +- .../libcrypto/man/man3/CONF_modules_load_file.3 | 2 +- .../libcrypto/man/man3/CRYPTO_THREAD_run_once.3 | 2 +- .../libcrypto/man/man3/CRYPTO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_memcmp.3 | 4 +- .../man/man3/CTLOG_STORE_get0_log_by_id.3 | 4 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_new.3 | 2 +- .../libcrypto/man/man3/CT_POLICY_EVAL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/DEFINE_STACK_OF.3 | 2 +- secure/lib/libcrypto/man/man3/DES_random_key.3 | 2 +- secure/lib/libcrypto/man/man3/DH_generate_key.3 | 2 +- .../libcrypto/man/man3/DH_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get_1024_160.3 | 2 +- secure/lib/libcrypto/man/man3/DH_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new_by_nid.3 | 2 +- secure/lib/libcrypto/man/man3/DH_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DH_size.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_SIG_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_do_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_dup_DH.3 | 4 +- secure/lib/libcrypto/man/man3/DSA_generate_key.3 | 4 +- .../libcrypto/man/man3/DSA_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/DTLS_get_data_mtu.3 | 4 +- secure/lib/libcrypto/man/man3/DTLS_set_timer_cb.3 | 2 +- secure/lib/libcrypto/man/man3/DTLSv1_listen.3 | 2 +- secure/lib/libcrypto/man/man3/ECDSA_SIG_new.3 | 2 +- .../lib/libcrypto/man/man3/ECPKParameters_print.3 | 2 +- .../lib/libcrypto/man/man3/EC_GFp_simple_method.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_copy.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_new.3 | 2 +- .../lib/libcrypto/man/man3/EC_KEY_get_enc_flags.3 | 2 +- secure/lib/libcrypto/man/man3/EC_KEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_add.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_new.3 | 2 +- secure/lib/libcrypto/man/man3/ENGINE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_GET_LIB.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_clear_error.3 | 4 +- secure/lib/libcrypto/man/man3/ERR_error_string.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_get_error.3 | 2 +- .../libcrypto/man/man3/ERR_load_crypto_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_load_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_print_errors.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_put_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_remove_state.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_set_mark.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_BytesToKey.3 | 4 +- .../man/man3/EVP_CIPHER_CTX_get_cipher_data.3 | 2 +- .../lib/libcrypto/man/man3/EVP_CIPHER_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestSignInit.3 | 2 +- .../lib/libcrypto/man/man3/EVP_DigestVerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncodeInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncryptInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_MD_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_OpenInit.3 | 2 +- .../lib/libcrypto/man/man3/EVP_PKEY_ASN1_METHOD.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_new.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set1_pbe_pass.3 | 4 +- .../libcrypto/man/man3/EVP_PKEY_CTX_set_hkdf_md.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_CTX_set_scrypt_N.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_asn1_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_derive.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_encrypt.3 | 2 +- .../man/man3/EVP_PKEY_get_default_digest_nid.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_PKEY_keygen.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_meth_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_new.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_print_private.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_set1_RSA.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_sign.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_size.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_verify.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_verify_recover.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SealInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SignInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_VerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aes.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aria.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_bf_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_blake2b512.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_camellia.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_cast5_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_chacha20.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_des.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_desx_cbc.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_idea_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md2.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_md4.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_md5.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_mdc2.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_rc2_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc4.3 | 2 +- .../lib/libcrypto/man/man3/EVP_rc5_32_12_16_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_ripemd160.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_seed_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha1.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_sha224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha3_224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm3.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_sm4_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_whirlpool.3 | 4 +- secure/lib/libcrypto/man/man3/HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/MD5.3 | 2 +- secure/lib/libcrypto/man/man3/MDC2_Init.3 | 2 +- secure/lib/libcrypto/man/man3/Makefile | 3 + secure/lib/libcrypto/man/man3/OBJ_nid2obj.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_REQUEST_new.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_cert_to_id.3 | 2 +- .../libcrypto/man/man3/OCSP_request_add1_nonce.3 | 2 +- .../lib/libcrypto/man/man3/OCSP_resp_find_status.3 | 2 +- .../lib/libcrypto/man/man3/OCSP_response_status.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_sendreq_new.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_Applink.3 | 4 +- .../lib/libcrypto/man/man3/OPENSSL_LH_COMPFUNC.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_stats.3 | 2 +- .../libcrypto/man/man3/OPENSSL_VERSION_NUMBER.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_config.3 | 2 +- .../lib/libcrypto/man/man3/OPENSSL_fork_prepare.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_ia32cap.3 | 4 +- .../lib/libcrypto/man/man3/OPENSSL_init_crypto.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_ssl.3 | 4 +- .../libcrypto/man/man3/OPENSSL_instrument_bus.3 | 2 +- .../man/man3/OPENSSL_load_builtin_modules.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_malloc.3 | 2 +- .../lib/libcrypto/man/man3/OPENSSL_secure_malloc.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_INFO.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_LOADER.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_SEARCH.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_expect.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_open.3 | 2 +- .../man/man3/OpenSSL_add_all_algorithms.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_bytes_read_bio.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_CMS.3 | 2 +- .../libcrypto/man/man3/PEM_read_bio_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_ex.3 | 2 +- .../libcrypto/man/man3/PEM_write_bio_CMS_stream.3 | 4 +- .../man/man3/PEM_write_bio_PKCS7_stream.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_create.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_newpass.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_parse.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_decrypt.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_encrypt.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_sign.3 | 4 +- .../lib/libcrypto/man/man3/PKCS7_sign_add_signer.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_verify.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_generate.3 | 2 +- .../lib/libcrypto/man/man3/RAND_DRBG_get0_master.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_new.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_reseed.3 | 2 +- .../libcrypto/man/man3/RAND_DRBG_set_callbacks.3 | 2 +- .../lib/libcrypto/man/man3/RAND_DRBG_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_add.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_cleanup.3 | 4 +- secure/lib/libcrypto/man/man3/RAND_egd.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_load_file.3 | 2 +- .../lib/libcrypto/man/man3/RAND_set_rand_method.3 | 2 +- secure/lib/libcrypto/man/man3/RC4_set_key.3 | 2 +- secure/lib/libcrypto/man/man3/RIPEMD160_Init.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_blinding_on.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_check_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_get0_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_new.3 | 2 +- .../man/man3/RSA_padding_add_PKCS1_type_1.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_print.3 | 2 +- .../lib/libcrypto/man/man3/RSA_private_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_public_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_sign.3 | 2 +- .../man/man3/RSA_sign_ASN1_OCTET_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_new.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_print.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_validate.3 | 2 +- secure/lib/libcrypto/man/man3/SHA256_Init.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_read_PKCS7.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_write_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_write_PKCS7.3 | 4 +- .../lib/libcrypto/man/man3/SSL_CIPHER_get_name.3 | 2 +- .../man/man3/SSL_COMP_add_compression_method.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_new.3 | 2 +- .../libcrypto/man/man3/SSL_CONF_CTX_set1_prefix.3 | 4 +- .../libcrypto/man/man3/SSL_CONF_CTX_set_flags.3 | 2 +- .../libcrypto/man/man3/SSL_CONF_CTX_set_ssl_ctx.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd_argv.3 | 4 +- .../libcrypto/man/man3/SSL_CTX_add1_chain_cert.3 | 2 +- .../man/man3/SSL_CTX_add_extra_chain_cert.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_add_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_config.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_ctrl.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_dane_enable.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_flush_sessions.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_CTX_free.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_CTX_get0_param.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_get_verify_mode.3 | 2 +- .../man/man3/SSL_CTX_has_client_custom_ext.3 | 4 +- .../man/man3/SSL_CTX_load_verify_locations.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_new.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_sess_number.3 | 2 +- .../man/man3/SSL_CTX_sess_set_cache_size.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_sess_set_get_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sessions.3 | 4 +- .../lib/libcrypto/man/man3/SSL_CTX_set0_CA_list.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set1_curves.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set1_sigalgs.3 | 2 +- .../man/man3/SSL_CTX_set1_verify_cert_store.3 | 2 +- .../man/man3/SSL_CTX_set_alpn_select_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_cert_cb.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_cert_store.3 | 2 +- .../man/man3/SSL_CTX_set_cert_verify_callback.3 | 4 +- .../libcrypto/man/man3/SSL_CTX_set_cipher_list.3 | 2 +- .../man/man3/SSL_CTX_set_client_cert_cb.3 | 2 +- .../man/man3/SSL_CTX_set_client_hello_cb.3 | 2 +- .../man/man3/SSL_CTX_set_ct_validation_callback.3 | 2 +- .../man/man3/SSL_CTX_set_ctlog_list_file.3 | 2 +- .../man/man3/SSL_CTX_set_default_passwd_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_ex_data.3 | 2 +- .../man/man3/SSL_CTX_set_generate_session_id.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_info_callback.3 | 2 +- .../man/man3/SSL_CTX_set_keylog_callback.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_max_cert_list.3 | 2 +- .../man/man3/SSL_CTX_set_min_proto_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_mode.3 | 20 +- .../libcrypto/man/man3/SSL_CTX_set_msg_callback.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_num_tickets.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_options.3 | 2 +- .../man/man3/SSL_CTX_set_psk_client_callback.3 | 2 +- .../man/man3/SSL_CTX_set_quiet_shutdown.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_read_ahead.3 | 2 +- .../man/man3/SSL_CTX_set_record_padding_callback.3 | 14 +- .../man/man3/SSL_CTX_set_security_level.3 | 2 +- .../man/man3/SSL_CTX_set_session_cache_mode.3 | 2 +- .../man/man3/SSL_CTX_set_session_id_context.3 | 2 +- .../man/man3/SSL_CTX_set_session_ticket_cb.3 | 2 +- .../man/man3/SSL_CTX_set_split_send_fragment.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_ssl_version.3 | 2 +- .../SSL_CTX_set_stateless_cookie_generate_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_timeout.3 | 2 +- .../man3/SSL_CTX_set_tlsext_servername_callback.3 | 2 +- .../man/man3/SSL_CTX_set_tlsext_status_cb.3 | 2 +- .../man/man3/SSL_CTX_set_tlsext_ticket_key_cb.3 | 4 +- .../man/man3/SSL_CTX_set_tlsext_use_srtp.3 | 2 +- .../man/man3/SSL_CTX_set_tmp_dh_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_verify.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_use_certificate.3 | 2 +- .../man/man3/SSL_CTX_use_psk_identity_hint.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_use_serverinfo.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_free.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_get0_cipher.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_get0_hostname.3 | 2 +- .../man/man3/SSL_SESSION_get0_id_context.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_get0_peer.3 | 4 +- .../man/man3/SSL_SESSION_get_compress_id.3 | 4 +- .../libcrypto/man/man3/SSL_SESSION_get_ex_data.3 | 2 +- .../man/man3/SSL_SESSION_get_protocol_version.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_get_time.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_has_ticket.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_is_resumable.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_SESSION_print.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_set1_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_accept.3 | 4 +- .../lib/libcrypto/man/man3/SSL_alert_type_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_alloc_buffers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_check_chain.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_clear.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_connect.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_do_handshake.3 | 4 +- .../man/man3/SSL_export_keying_material.3 | 2 +- .../libcrypto/man/man3/SSL_extension_supported.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_free.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get0_peer_scts.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_SSL_CTX.3 | 4 +- .../lib/libcrypto/man/man3/SSL_get_all_async_fds.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_ciphers.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_client_random.3 | 2 +- .../libcrypto/man/man3/SSL_get_current_cipher.3 | 2 +- .../libcrypto/man/man3/SSL_get_default_timeout.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_error.3 | 4 +- .../lib/libcrypto/man/man3/SSL_get_extms_support.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_fd.3 | 2 +- .../libcrypto/man/man3/SSL_get_peer_cert_chain.3 | 2 +- .../libcrypto/man/man3/SSL_get_peer_certificate.3 | 4 +- .../man/man3/SSL_get_peer_signature_nid.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_peer_tmp_key.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_psk_identity.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_rbio.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_session.3 | 2 +- .../libcrypto/man/man3/SSL_get_shared_sigalgs.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_verify_result.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_in_init.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_key_update.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_library_init.3 | 2 +- .../libcrypto/man/man3/SSL_load_client_CA_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_pending.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_read.3 | 2 +- .../lib/libcrypto/man/man3/SSL_read_early_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_rstate_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_session_reused.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_set1_host.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_bio.3 | 2 +- .../lib/libcrypto/man/man3/SSL_set_connect_state.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_session.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_set_shutdown.3 | 2 +- .../lib/libcrypto/man/man3/SSL_set_verify_result.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_shutdown.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_state_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_want.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_write.3 | 29 ++- secure/lib/libcrypto/man/man3/UI_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/UI_UTIL_read_pw.3 | 2 +- secure/lib/libcrypto/man/man3/UI_create_method.3 | 2 +- secure/lib/libcrypto/man/man3/UI_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509V3_get_d2i.3 | 2 +- secure/lib/libcrypto/man/man3/X509_ALGOR_dup.3 | 2 +- .../libcrypto/man/man3/X509_CRL_get0_by_serial.3 | 2 +- .../libcrypto/man/man3/X509_EXTENSION_set_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP.3 | 2 +- .../lib/libcrypto/man/man3/X509_LOOKUP_hash_dir.3 | 2 +- .../lib/libcrypto/man/man3/X509_LOOKUP_meth_new.3 | 2 +- .../man/man3/X509_NAME_ENTRY_get_object.3 | 2 +- .../man/man3/X509_NAME_add_entry_by_txt.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get0_der.3 | 4 +- .../man/man3/X509_NAME_get_index_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/X509_PUBKEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_SIG_get0.3 | 2 +- .../libcrypto/man/man3/X509_STORE_CTX_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_new.3 | 2 +- .../man/man3/X509_STORE_CTX_set_verify_cb.3 | 2 +- .../lib/libcrypto/man/man3/X509_STORE_add_cert.3 | 2 +- .../lib/libcrypto/man/man3/X509_STORE_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_new.3 | 2 +- .../man/man3/X509_STORE_set_verify_cb_func.3 | 2 +- .../man/man3/X509_VERIFY_PARAM_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_ca.3 | 4 +- secure/lib/libcrypto/man/man3/X509_check_host.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_issued.3 | 4 +- .../libcrypto/man/man3/X509_check_private_key.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_purpose.3 | 4 +- secure/lib/libcrypto/man/man3/X509_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/X509_cmp_time.3 | 2 +- secure/lib/libcrypto/man/man3/X509_digest.3 | 2 +- secure/lib/libcrypto/man/man3/X509_dup.3 | 2 +- .../lib/libcrypto/man/man3/X509_get0_notBefore.3 | 2 +- .../lib/libcrypto/man/man3/X509_get0_signature.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_uids.3 | 4 +- .../libcrypto/man/man3/X509_get_extension_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_pubkey.3 | 2 +- .../lib/libcrypto/man/man3/X509_get_serialNumber.3 | 2 +- .../lib/libcrypto/man/man3/X509_get_subject_name.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/X509_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_sign.3 | 2 +- secure/lib/libcrypto/man/man3/X509_verify_cert.3 | 4 +- .../lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_DHparams.3 | 2 +- .../libcrypto/man/man3/d2i_PKCS8PrivateKey_bio.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_SSL_SESSION.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_X509.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_CMS_bio_stream.3 | 4 +- .../lib/libcrypto/man/man3/i2d_PKCS7_bio_stream.3 | 4 +- secure/lib/libcrypto/man/man3/i2d_re_X509_tbs.3 | 2 +- secure/lib/libcrypto/man/man3/o2i_SCT_LIST.3 | 2 +- secure/lib/libcrypto/man/man5/x509v3_config.5 | 2 +- secure/lib/libcrypto/man/man7/Ed25519.7 | 2 +- secure/lib/libcrypto/man/man7/RAND.7 | 4 +- secure/lib/libcrypto/man/man7/RAND_DRBG.7 | 4 +- secure/lib/libcrypto/man/man7/RSA-PSS.7 | 4 +- secure/lib/libcrypto/man/man7/SM2.7 | 4 +- secure/lib/libcrypto/man/man7/X25519.7 | 2 +- secure/lib/libcrypto/man/man7/bio.7 | 4 +- secure/lib/libcrypto/man/man7/ct.7 | 4 +- secure/lib/libcrypto/man/man7/des_modes.7 | 4 +- secure/lib/libcrypto/man/man7/evp.7 | 4 +- secure/lib/libcrypto/man/man7/ossl_store-file.7 | 4 +- secure/lib/libcrypto/man/man7/ossl_store.7 | 4 +- .../lib/libcrypto/man/man7/passphrase-encoding.7 | 4 +- secure/lib/libcrypto/man/man7/proxy-certificates.7 | 4 +- secure/lib/libcrypto/man/man7/scrypt.7 | 4 +- secure/lib/libcrypto/man/man7/ssl.7 | 4 +- secure/lib/libcrypto/man/man7/x509.7 | 4 +- secure/usr.bin/openssl/man/CA.pl.1 | 4 +- secure/usr.bin/openssl/man/asn1parse.1 | 2 +- secure/usr.bin/openssl/man/ca.1 | 2 +- secure/usr.bin/openssl/man/ciphers.1 | 2 +- secure/usr.bin/openssl/man/cms.1 | 2 +- secure/usr.bin/openssl/man/crl.1 | 2 +- secure/usr.bin/openssl/man/crl2pkcs7.1 | 2 +- secure/usr.bin/openssl/man/dgst.1 | 2 +- secure/usr.bin/openssl/man/dhparam.1 | 2 +- secure/usr.bin/openssl/man/dsa.1 | 2 +- secure/usr.bin/openssl/man/dsaparam.1 | 2 +- secure/usr.bin/openssl/man/ec.1 | 2 +- secure/usr.bin/openssl/man/ecparam.1 | 2 +- secure/usr.bin/openssl/man/enc.1 | 2 +- secure/usr.bin/openssl/man/engine.1 | 2 +- secure/usr.bin/openssl/man/errstr.1 | 2 +- secure/usr.bin/openssl/man/gendsa.1 | 2 +- secure/usr.bin/openssl/man/genpkey.1 | 2 +- secure/usr.bin/openssl/man/genrsa.1 | 2 +- secure/usr.bin/openssl/man/list.1 | 2 +- secure/usr.bin/openssl/man/nseq.1 | 2 +- secure/usr.bin/openssl/man/ocsp.1 | 2 +- secure/usr.bin/openssl/man/openssl.1 | 4 +- secure/usr.bin/openssl/man/passwd.1 | 2 +- secure/usr.bin/openssl/man/pkcs12.1 | 2 +- secure/usr.bin/openssl/man/pkcs7.1 | 2 +- secure/usr.bin/openssl/man/pkcs8.1 | 2 +- secure/usr.bin/openssl/man/pkey.1 | 2 +- secure/usr.bin/openssl/man/pkeyparam.1 | 2 +- secure/usr.bin/openssl/man/pkeyutl.1 | 2 +- secure/usr.bin/openssl/man/prime.1 | 2 +- secure/usr.bin/openssl/man/rand.1 | 2 +- secure/usr.bin/openssl/man/req.1 | 2 +- secure/usr.bin/openssl/man/rsa.1 | 2 +- secure/usr.bin/openssl/man/rsautl.1 | 2 +- secure/usr.bin/openssl/man/s_client.1 | 2 +- secure/usr.bin/openssl/man/s_server.1 | 2 +- secure/usr.bin/openssl/man/s_time.1 | 2 +- secure/usr.bin/openssl/man/sess_id.1 | 2 +- secure/usr.bin/openssl/man/smime.1 | 2 +- secure/usr.bin/openssl/man/speed.1 | 2 +- secure/usr.bin/openssl/man/spkac.1 | 2 +- secure/usr.bin/openssl/man/srp.1 | 2 +- secure/usr.bin/openssl/man/storeutl.1 | 2 +- secure/usr.bin/openssl/man/ts.1 | 2 +- secure/usr.bin/openssl/man/tsget.1 | 2 +- secure/usr.bin/openssl/man/verify.1 | 2 +- secure/usr.bin/openssl/man/version.1 | 2 +- secure/usr.bin/openssl/man/x509.1 | 2 +- 537 files changed, 1269 insertions(+), 644 deletions(-) diff --git a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 index 787f87e8f013..048d4fc2b64b 100644 --- a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 +++ b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 index 4277347439b2..135a622a91c8 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 index f469ec947480..9ac1969ef577 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 index 3e36faa9efcc..f5a4c0f68510 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 index af133ca346e2..9b9613637d3a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 index 1976aa20db2a..ad33ca4b7b2a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 index 15a6dfc41f63..f2c2afe53015 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 index 193dd4715024..d2394acf12e7 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 index fc26c41498f0..562929c6cd9f 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 index bbcf08b8fdd4..930a32de6d33 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 index bb8ab5bebd01..c139f0a79d4a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 index ab3b56231eba..b09d540d97e5 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 index f9bb9aea0fe9..0917cbf28d0a 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BF_encrypt.3 b/secure/lib/libcrypto/man/man3/BF_encrypt.3 index 263e9f4aee6a..1e67cea75097 100644 --- a/secure/lib/libcrypto/man/man3/BF_encrypt.3 +++ b/secure/lib/libcrypto/man/man3/BF_encrypt.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 index 4867c770113f..3f0f0cfd2170 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 index 4f6558313eaf..5df20d27fde8 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_connect.3 b/secure/lib/libcrypto/man/man3/BIO_connect.3 index 72e03a6d0908..f9fdd9b15d37 100644 --- a/secure/lib/libcrypto/man/man3/BIO_connect.3 +++ b/secure/lib/libcrypto/man/man3/BIO_connect.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 index 31c70dbb37a8..487f6d192c8c 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,13 +133,13 @@ .\" ======================================================================== .\" .IX Title "BIO_CTRL 3" -.TH BIO_CTRL 3 "2020-12-08" "1.1.1i" "OpenSSL" +.TH BIO_CTRL 3 "2021-01-21" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" -BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb \&\- BIO control operations +BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb, BIO_get_ktls_send, BIO_get_ktls_recv \&\- BIO control operations .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 @@ -166,6 +166,9 @@ BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BI \& \& int BIO_get_info_callback(BIO *b, BIO_info_cb **cbp); \& int BIO_set_info_callback(BIO *b, BIO_info_cb *cb); +\& +\& int BIO_get_ktls_send(BIO *b); +\& int BIO_get_ktls_recv(BIO *b); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" @@ -204,6 +207,11 @@ return the number of pending characters in the BIOs read and write buffers. Not all BIOs support these calls. \fBBIO_ctrl_pending()\fR and \fBBIO_ctrl_wpending()\fR return a size_t type and are functions, \fBBIO_pending()\fR and \fBBIO_wpending()\fR are macros which call \fBBIO_ctrl()\fR. +.PP +\&\fBBIO_get_ktls_send()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +sending. Otherwise, it returns zero. +\&\fBBIO_get_ktls_recv()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +receiving. Otherwise, it returns zero. .SH "RETURN VALUES" .IX Header "RETURN VALUES" \&\fBBIO_reset()\fR normally returns 1 for success and 0 or \-1 for failure. File @@ -223,6 +231,11 @@ for success and \-1 for failure. .PP \&\fBBIO_pending()\fR, \fBBIO_ctrl_pending()\fR, \fBBIO_wpending()\fR and \fBBIO_ctrl_wpending()\fR return the amount of pending data. +.PP +\&\fBBIO_get_ktls_send()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +sending. Otherwise, it returns zero. +\&\fBBIO_get_ktls_recv()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +receiving. Otherwise, it returns zero. .SH "NOTES" .IX Header "NOTES" \&\fBBIO_flush()\fR, because it can write data may return 0 or \-1 indicating @@ -253,6 +266,10 @@ Some of the return values are ambiguous and care should be taken. In particular a return value of 0 can be returned if an operation is not supported, if an error occurred, if \s-1EOF\s0 has not been reached and in the case of \fBBIO_seek()\fR on a file \s-1BIO\s0 for a successful operation. +.SH "HISTORY" +.IX Header "HISTORY" +The \fBBIO_get_ktls_send()\fR and \fBBIO_get_ktls_recv()\fR functions were added in +OpenSSL 3.0.0. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2000\-2020 The OpenSSL Project Authors. All Rights Reserved. diff --git a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 index 6c2c7de56ed1..d42d2eb6c9ec 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BASE64 3" -.TH BIO_F_BASE64 3 "2020-09-22" "1.1.1h" "OpenSSL" +.TH BIO_F_BASE64 3 "2020-12-08" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 index 6105f2a83361..9b4bc1c800c5 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 index ae9a6747fcb4..a26d0f5cca2f 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_md.3 b/secure/lib/libcrypto/man/man3/BIO_f_md.3 index 8e3cd75c5553..ba7f598a14fc 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_md.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_md.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_null.3 b/secure/lib/libcrypto/man/man3/BIO_f_null.3 index e01f9b021520..44d680123203 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_null.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_null.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_NULL 3" -.TH BIO_F_NULL 3 "2020-09-22" "1.1.1h" "OpenSSL" +.TH BIO_F_NULL 3 "2020-12-08" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 index 3779dfbfeba3..ce95b5d29fd3 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_find_type.3 b/secure/lib/libcrypto/man/man3/BIO_find_type.3 index 878e2c65b24f..8ed77ea8ae03 100644 --- a/secure/lib/libcrypto/man/man3/BIO_find_type.3 +++ b/secure/lib/libcrypto/man/man3/BIO_find_type.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_data.3 b/secure/lib/libcrypto/man/man3/BIO_get_data.3 index 4069639cc4aa..dc9eb33aba84 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_data.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_data.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 index 93a2e5521f3a..a1ff83189d93 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 b/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 new file mode 100644 index 000000000000..487f6d192c8c --- /dev/null +++ b/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 @@ -0,0 +1,280 @@ +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 *** 6631 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Jan 28 18:25: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 304154E623C; Thu, 28 Jan 2021 18:25: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 4DRTRc0Wgpz4TjD; Thu, 28 Jan 2021 18:25: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 ED7E514877; Thu, 28 Jan 2021 18:25: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 10SIPVoo021145; Thu, 28 Jan 2021 18:25:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SIPVZx021144; Thu, 28 Jan 2021 18:25:31 GMT (envelope-from git) Date: Thu, 28 Jan 2021 18:25:31 GMT Message-Id: <202101281825.10SIPVZx021144@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: ae257282ae5b - main - Regenerate src.conf.5 for MK_OPENSSL_KTLS 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: ae257282ae5b08db94ae46271d0fc3c24f0a0a4b 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, 28 Jan 2021 18:25:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ae257282ae5b08db94ae46271d0fc3c24f0a0a4b commit ae257282ae5b08db94ae46271d0fc3c24f0a0a4b Author: John Baldwin AuthorDate: 2021-01-26 22:33:08 +0000 Commit: John Baldwin CommitDate: 2021-01-28 18:24:24 +0000 Regenerate src.conf.5 for MK_OPENSSL_KTLS --- share/man/man5/src.conf.5 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 7d9a1b683a62..ecfebff05623 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1302,6 +1302,16 @@ When set, these options are also in effect: .Va WITH_GSSAPI is set explicitly) .El +.It Va WITHOUT_OPENSSL_KTLS +Set to not include kernel TLS support in OpenSSL. +.Pp +This is a default setting on +arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mips, mips/mips64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. +.It Va WITH_OPENSSL_KTLS +Set to include kernel TLS support in OpenSSL. +.Pp +This is a default setting on +amd64/amd64. .It Va WITHOUT_PAM Set to not build PAM library and modules. .Bf -symbolic From owner-dev-commits-src-main@freebsd.org Thu Jan 28 18:29: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 45C874E62C5 for ; Thu, 28 Jan 2021 18:29:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.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 4DRTX21N4Tz4Tqb for ; Thu, 28 Jan 2021 18:29:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f48.google.com with SMTP id s7so3423737wru.5 for ; Thu, 28 Jan 2021 10:29:22 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=w7s7kwVypItHslAc1aebknBDWy4tIV/FiTp8vAADVkk=; b=hXkvLsKqsdr9zIlSC7EyQB83s1IjMXtRRuLnAVokCJdKGWa7kfJggyM2iE7o/pF/7C YG1e5neVOaEHnRBuTwGdFiJBS2/G4FTseyKXf2iVoUF7ymm0chNGZD/oBEoL8WaG57c3 MZdY8z3tQwEXmBWdVbZM0asXnzDE3SnEgG9KnsmFBf6xq/S7VIqFAVcpwQSz38x9YFxD 5hPfBs8yKBtbtYZIejz6O4F56hwx/wx2iVV7ra7MUi5uMB76qWbdIQdQKwNE2S+EF1sJ 7wa0TG2rJZqPZKiW1RUi9AGpDFNhRGqXAWCfu2eHNB8lUksjzOLVS7ARHRmhrG1mB2ns CMUw== X-Gm-Message-State: AOAM5329fhWtE/e94iErbKwr2AIWjZBmULRfiCnJO5XfWdLxl7zL1YEL b9X4RNmuOBIr7RGboaqOSnBMzQ== X-Google-Smtp-Source: ABdhPJx17gDKLA7LdNOrqY24JmZHM5HBu+PIkKe3eZ6eTMvkwqBca3ers3/1c4AqZl/3LBeY+0jE5Q== X-Received: by 2002:adf:d0d2:: with SMTP id z18mr504249wrh.70.1611858560903; Thu, 28 Jan 2021 10:29:20 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id d30sm8381324wrc.92.2021.01.28.10.29.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 10:29:20 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 83ff5d5d98cb - main - Un-XFAIL two tests with Clang > 10 From: Jessica Clarke In-Reply-To: Date: Thu, 28 Jan 2021 18:29:19 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202101281739.10SHdh37056796@gitrepo.freebsd.org> <6B60F7D5-AD3E-459E-801A-65234A689A01@freebsd.org> To: Alexander Richardson X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DRTX21N4Tz4Tqb 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: Thu, 28 Jan 2021 18:29:22 -0000 On 28 Jan 2021, at 17:46, Alexander Richardson = wrote: > On Thu, 28 Jan 2021 at 17:42, Jessica Clarke = wrote: >>=20 >> Is the commit message or the diff wrong? Both use strict = inequalities. >>=20 >> Jess >=20 > Sorry the commit message should be >=3D 10. Thanks. I see now the first XFAIL message was updated to say 7-9 (which answers my question), but the second one I was looking at was not. Could you please correct that? Jess >>=20 >> On 28 Jan 2021, at 17:39, Alex Richardson = wrote: >>>=20 >>> The branch main has been updated by arichardson: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D83ff5d5d98cbcf9b66dccd70022358ae= c8918a14 >>>=20 >>> commit 83ff5d5d98cbcf9b66dccd70022358aec8918a14 >>> Author: Alex Richardson >>> AuthorDate: 2021-01-28 17:17:49 +0000 >>> Commit: Alex Richardson >>> CommitDate: 2021-01-28 17:24:24 +0000 >>>=20 >>> Un-XFAIL two tests with Clang > 10 >>>=20 >>> SVN r343917 fixed this for in-tree clang, but when building with a = newer >>> out-of-tree clang the test was still marked as XFAIL. >>>=20 >>> Reviewed By: dim >>> Differential Revision: https://reviews.freebsd.org/D28390 >>> --- >>> contrib/netbsd-tests/lib/libm/t_cbrt.c | 4 ++-- >>> lib/msun/tests/trig_test.c | 2 +- >>> 2 files changed, 3 insertions(+), 3 deletions(-) >>>=20 >>> diff --git a/contrib/netbsd-tests/lib/libm/t_cbrt.c = b/contrib/netbsd-tests/lib/libm/t_cbrt.c >>> index d2cdd47a5beb..08e9faeb145c 100644 >>> --- a/contrib/netbsd-tests/lib/libm/t_cbrt.c >>> +++ b/contrib/netbsd-tests/lib/libm/t_cbrt.c >>> @@ -269,8 +269,8 @@ ATF_TC_BODY(cbrtl_powl, tc) >>> size_t i; >>>=20 >>> #if defined(__amd64__) && defined(__clang__) && __clang_major__ >=3D = 7 && \ >>> - __FreeBSD_cc_version < 1300002 >>> - atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); >>> + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 >>> + atf_tc_expect_fail("test fails with clang 7-9 - bug 234040"); >>> #endif >>>=20 >>> for (i =3D 0; i < __arraycount(x); i++) { >>> diff --git a/lib/msun/tests/trig_test.c b/lib/msun/tests/trig_test.c >>> index 483a5e187d50..ba1975721d3f 100644 >>> --- a/lib/msun/tests/trig_test.c >>> +++ b/lib/msun/tests/trig_test.c >>> @@ -161,7 +161,7 @@ ATF_TC_BODY(reduction, tc) >>> unsigned i; >>>=20 >>> #if defined(__amd64__) && defined(__clang__) && __clang_major__ >=3D = 7 && \ >>> - __FreeBSD_cc_version < 1300002 >>> + __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 >>> atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); >>> #endif >>>=20 >>=20 From owner-dev-commits-src-main@freebsd.org Thu Jan 28 19:24: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 031E64E8617; Thu, 28 Jan 2021 19:24: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 4DRVm36jbCz4Yl8; Thu, 28 Jan 2021 19:24: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 D4F10155A1; Thu, 28 Jan 2021 19:24: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 10SJOp4U000372; Thu, 28 Jan 2021 19:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SJOp8d000371; Thu, 28 Jan 2021 19:24:51 GMT (envelope-from git) Date: Thu, 28 Jan 2021 19:24:51 GMT Message-Id: <202101281924.10SJOp8d000371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: c926114f2ff2 - main - Fix getblk() with GB_NOCREAT returning false-negatives. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c926114f2ff20d7c3e5a157f1618b6228f391bf7 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, 28 Jan 2021 19:24:52 -0000 The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=c926114f2ff20d7c3e5a157f1618b6228f391bf7 commit c926114f2ff20d7c3e5a157f1618b6228f391bf7 Author: Bryan Drewery AuthorDate: 2021-01-27 17:59:50 +0000 Commit: Bryan Drewery CommitDate: 2021-01-28 19:24:24 +0000 Fix getblk() with GB_NOCREAT returning false-negatives. It is possible for a buf to be reassigned between the dirty and clean lists while gbincore_unlocked() looks in each list. Avoid creating a buffer in that case and fallback to a locked lookup. This fixes a regression from r363482. More discussion on potential improvements to the clean and dirty lists handling is in the review. Reviewed by: cem, kib, markj, vangyzen, rlibby Reported by: Suraj.Raju at dell.com Submitted by: Suraj.Raju at dell.com, cem, [based on both] MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D28375 --- sys/kern/vfs_bio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 2f18221e9270..ff25e5b0043c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3888,8 +3888,15 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int slpflag, /* Attempt lockless lookup first. */ bp = gbincore_unlocked(bo, blkno); - if (bp == NULL) + if (bp == NULL) { + /* + * With GB_NOCREAT we must be sure about not finding the buffer + * as it may have been reassigned during unlocked lookup. + */ + if ((flags & GB_NOCREAT) != 0) + goto loop; goto newbuf_unlocked; + } error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL, "getblku", 0, 0); From owner-dev-commits-src-main@freebsd.org Thu Jan 28 20:05: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 28B764EC0B9; Thu, 28 Jan 2021 20:05: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 4DRWft0c4tz4dP9; Thu, 28 Jan 2021 20:05: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 084D815BEC; Thu, 28 Jan 2021 20:05: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 10SK5P7S053186; Thu, 28 Jan 2021 20:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SK5PLY053185; Thu, 28 Jan 2021 20:05:25 GMT (envelope-from git) Date: Thu, 28 Jan 2021 20:05:25 GMT Message-Id: <202101282005.10SK5PLY053185@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: 4f9548640dd1 - main - arch.7: update 11.x to 11.4 as the last FreeBSD 11 release 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: 4f9548640dd1c7e9602f0d01647b112e51792224 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, 28 Jan 2021 20:05:26 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4f9548640dd1c7e9602f0d01647b112e51792224 commit 4f9548640dd1c7e9602f0d01647b112e51792224 Author: Ed Maste AuthorDate: 2021-01-28 20:02:24 +0000 Commit: Ed Maste CommitDate: 2021-01-28 20:03:25 +0000 arch.7: update 11.x to 11.4 as the last FreeBSD 11 release armeb and pc98 were both discontinued after FreeBSD 11. FreeBSD 11.4 is now known to be the final 11.x release, so update to the specific version. --- share/man/man7/arch.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index a334d509d7b7..45df736b8a37 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -92,7 +92,7 @@ architectures, the final release. .It alpha Ta 3.2 Ta 6.4 .It amd64 Ta 5.1 .It arm Ta 6.0 Ta 12.x -.It armeb Ta 8.0 Ta 11.x +.It armeb Ta 8.0 Ta 11.4 .It armv6 Ta 10.0 .It armv7 Ta 12.0 .It ia64 Ta 5.0 Ta 10.4 @@ -106,7 +106,7 @@ architectures, the final release. .It mips64el Ta 9.0 .It mips64elhf Ta 12.0 .It mips64hf Ta 12.0 -.It pc98 Ta 2.2 Ta 11.x +.It pc98 Ta 2.2 Ta 11.4 .It powerpc Ta 6.0 .It powerpcspe Ta 12.0 .It powerpc64 Ta 6.0 From owner-dev-commits-src-main@freebsd.org Thu Jan 28 20:50: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 E6E1D4ECC72; Thu, 28 Jan 2021 20:50: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 4DRXfp5BDQz4gnQ; Thu, 28 Jan 2021 20:50: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 35703161F8; Thu, 28 Jan 2021 20:50: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 10SKoQha013564; Thu, 28 Jan 2021 20:50:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SKoQk2013563; Thu, 28 Jan 2021 20:50:26 GMT (envelope-from git) Date: Thu, 28 Jan 2021 20:50:26 GMT Message-Id: <202101282050.10SKoQk2013563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: f9322ff6efa5 - main - Enable KERN_TLS by default in ARM64 GENERIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9322ff6efa508df8368e31e3c4880cff11b0e23 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, 28 Jan 2021 20:50:28 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=f9322ff6efa508df8368e31e3c4880cff11b0e23 commit f9322ff6efa508df8368e31e3c4880cff11b0e23 Author: Allan Jude AuthorDate: 2021-01-28 20:48:37 +0000 Commit: Allan Jude CommitDate: 2021-01-28 20:48:37 +0000 Enable KERN_TLS by default in ARM64 GENERIC Sponsored-by: Ampere Computing Submitted-by: Klara, Inc. --- sys/arm64/conf/GENERIC | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index d1ad101975de..59f89555dd88 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -36,6 +36,7 @@ options TCP_OFFLOAD # TCP offload options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open options SCTP_SUPPORT # Allow kldload of SCTP +options KERN_TLS # TLS transmit & receive offload options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists From owner-dev-commits-src-main@freebsd.org Thu Jan 28 20:55: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 304F24ED49C; Thu, 28 Jan 2021 20:55: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 4DRXmh0tc2z4hHP; Thu, 28 Jan 2021 20:55: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 117F416A10; Thu, 28 Jan 2021 20:55: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 10SKtWgD018464; Thu, 28 Jan 2021 20:55:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SKtWEQ018463; Thu, 28 Jan 2021 20:55:32 GMT (envelope-from git) Date: Thu, 28 Jan 2021 20:55:32 GMT Message-Id: <202101282055.10SKtWEQ018463@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: d2c9d0a41811 - main - Bump date after ae257282ae5b. 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: d2c9d0a41811344a2a0bf517d96d52d7c350c88e 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, 28 Jan 2021 20:55:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c9d0a41811344a2a0bf517d96d52d7c350c88e commit d2c9d0a41811344a2a0bf517d96d52d7c350c88e Author: John Baldwin AuthorDate: 2021-01-28 20:18:54 +0000 Commit: John Baldwin CommitDate: 2021-01-28 20:55:22 +0000 Bump date after ae257282ae5b. --- share/man/man5/src.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index ecfebff05623..ddcf01cc2903 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 26, 2021 +.Dd January 28, 2021 .Dt SRC.CONF 5 .Os .Sh NAME From owner-dev-commits-src-main@freebsd.org Thu Jan 28 20:56: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 508794ED684; Thu, 28 Jan 2021 20:56:54 +0000 (UTC) (envelope-from jhb@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 4DRXpG1q8Hz4hGS; Thu, 28 Jan 2021 20:56:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (c-98-35-218-221.hsd1.ca.comcast.net [98.35.218.221]) (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 B223948B8; Thu, 28 Jan 2021 20:56:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: f9322ff6efa5 - main - Enable KERN_TLS by default in ARM64 GENERIC To: Allan Jude , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101282050.10SKoQk2013563@gitrepo.freebsd.org> From: John Baldwin Message-ID: <1df6186a-59b9-cd5c-6732-fd7ae88ae079@FreeBSD.org> Date: Thu, 28 Jan 2021 12:56:52 -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: <202101282050.10SKoQk2013563@gitrepo.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: Thu, 28 Jan 2021 20:56:54 -0000 On 1/28/21 12:50 PM, Allan Jude wrote: > The branch main has been updated by allanjude: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f9322ff6efa508df8368e31e3c4880cff11b0e23 > > commit f9322ff6efa508df8368e31e3c4880cff11b0e23 > Author: Allan Jude > AuthorDate: 2021-01-28 20:48:37 +0000 > Commit: Allan Jude > CommitDate: 2021-01-28 20:48:37 +0000 > > Enable KERN_TLS by default in ARM64 GENERIC You might want to flip the default for MK_OPENSSL_KTLS in src.conf to match. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Thu Jan 28 21:22: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 5192A4EDC92; Thu, 28 Jan 2021 21:22: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 4DRYNJ1v35z4jG3; Thu, 28 Jan 2021 21:22: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 334CE16E96; Thu, 28 Jan 2021 21:22: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 10SLMugm057330; Thu, 28 Jan 2021 21:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SLMuob057329; Thu, 28 Jan 2021 21:22:56 GMT (envelope-from git) Date: Thu, 28 Jan 2021 21:22:56 GMT Message-Id: <202101282122.10SLMuob057329@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: b75168ed24ca - main - Make software iSCSI more configurable. 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: b75168ed24ca74f65929e5c57d4fed5f0ab08f2a 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, 28 Jan 2021 21:22:56 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=b75168ed24ca74f65929e5c57d4fed5f0ab08f2a commit b75168ed24ca74f65929e5c57d4fed5f0ab08f2a Author: Alexander Motin AuthorDate: 2021-01-28 20:53:49 +0000 Commit: Alexander Motin CommitDate: 2021-01-28 21:22:45 +0000 Make software iSCSI more configurable. Move software iSCSI tunables/sysctls into kern.icl.soft subtree. Replace several hardcoded length constants there with variables. While there, stretch the limits to better match Linux' open-iscsi and our own initiator with new MAXPHYS of 1MB. Our CTL target is also optimized for up to 1MB I/Os, so there is also a match now. For Windows 10 and VMware 6.7 initiators at default settings it should make no change, since previous limits were sufficient there. Tests of QD1 1MB writes from FreeBSD over 10GigE link show throughput increase by 29% on idle connection and 132% with concurrent QD8 reads. MFC after: 3 days Sponsored by: iXsystems, Inc. --- sys/dev/iscsi/icl.h | 2 -- sys/dev/iscsi/icl_soft.c | 45 +++++++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h index 06108802766d..0b897a50302a 100644 --- a/sys/dev/iscsi/icl.h +++ b/sys/dev/iscsi/icl.h @@ -89,8 +89,6 @@ struct icl_pdu { #define ICL_CONN_STATE_DATA 4 #define ICL_CONN_STATE_DATA_DIGEST 5 -#define ICL_MAX_DATA_SEGMENT_LENGTH (128 * 1024) - #define ICL_NOCOPY (1 << 30) struct icl_conn { diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 41d20b4abf69..a8986b3d4253 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -72,18 +72,29 @@ struct icl_soft_pdu { int error; }; +SYSCTL_NODE(_kern_icl, OID_AUTO, soft, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Software iSCSI"); static int coalesce = 1; -SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, +SYSCTL_INT(_kern_icl_soft, OID_AUTO, coalesce, CTLFLAG_RWTUN, &coalesce, 0, "Try to coalesce PDUs before sending"); -static int partial_receive_len = 128 * 1024; -SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, +static int partial_receive_len = 256 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, &partial_receive_len, 0, "Minimum read size for partially received " "data segment"); -static int sendspace = 1048576; -SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RWTUN, +static int max_data_segment_length = 256 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, max_data_segment_length, CTLFLAG_RWTUN, + &max_data_segment_length, 0, "Maximum data segment length"); +static int first_burst_length = 1024 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, first_burst_length, CTLFLAG_RWTUN, + &first_burst_length, 0, "First burst length"); +static int max_burst_length = 1024 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, max_burst_length, CTLFLAG_RWTUN, + &max_burst_length, 0, "Maximum burst length"); +static int sendspace = 1536 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, sendspace, CTLFLAG_RWTUN, &sendspace, 0, "Default send socket buffer size"); -static int recvspace = 1048576; -SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RWTUN, +static int recvspace = 1536 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, recvspace, CTLFLAG_RWTUN, &recvspace, 0, "Default receive socket buffer size"); static MALLOC_DEFINE(M_ICL_SOFT, "icl_soft", "iSCSI software backend"); @@ -663,10 +674,8 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) len = icl_pdu_data_segment_length(request); if (len > ic->ic_max_data_segment_length) { ICL_WARN("received data segment " - "length %zd is larger than negotiated " - "MaxDataSegmentLength %zd; " - "dropping connection", - len, ic->ic_max_data_segment_length); + "length %zd is larger than negotiated; " + "dropping connection", len); error = EINVAL; break; } @@ -1230,7 +1239,7 @@ icl_soft_new_conn(const char *name, struct mtx *lock) #ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); #endif - ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; + ic->ic_max_data_segment_length = max_data_segment_length; ic->ic_name = name; ic->ic_offload = "None"; ic->ic_unmapped = false; @@ -1280,10 +1289,6 @@ icl_conn_start(struct icl_conn *ic) * For sendspace, this is required because the current code cannot * send a PDU in pieces; thus, the minimum buffer size is equal * to the maximum PDU size. "+4" is to account for possible padding. - * - * What we should actually do here is to use autoscaling, but set - * some minimal buffer size to "minspace". I don't know a way to do - * that, though. */ minspace = sizeof(struct iscsi_bhs) + ic->ic_max_data_segment_length + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; @@ -1520,10 +1525,10 @@ static int icl_soft_limits(struct icl_drv_limits *idl) { - idl->idl_max_recv_data_segment_length = 128 * 1024; - idl->idl_max_send_data_segment_length = 128 * 1024; - idl->idl_max_burst_length = 262144; - idl->idl_first_burst_length = idl->idl_max_burst_length; + idl->idl_max_recv_data_segment_length = max_data_segment_length; + idl->idl_max_send_data_segment_length = max_data_segment_length; + idl->idl_max_burst_length = max_burst_length; + idl->idl_first_burst_length = first_burst_length; return (0); } From owner-dev-commits-src-main@freebsd.org Thu Jan 28 21:35: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 C0A824EDB70; Thu, 28 Jan 2021 21:35: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 4DRYgF54dLz4kCM; Thu, 28 Jan 2021 21:35: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 9CFA617281; Thu, 28 Jan 2021 21:35: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 10SLZr0C070866; Thu, 28 Jan 2021 21:35:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SLZrOi070865; Thu, 28 Jan 2021 21:35:53 GMT (envelope-from git) Date: Thu, 28 Jan 2021 21:35:53 GMT Message-Id: <202101282135.10SLZrOi070865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: e6b7809cdfc4 - main - Flip the default for OPENSSL_KTLS to arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6b7809cdfc4389d2fc1df2c7fdff08a4a110c77 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, 28 Jan 2021 21:35:53 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=e6b7809cdfc4389d2fc1df2c7fdff08a4a110c77 commit e6b7809cdfc4389d2fc1df2c7fdff08a4a110c77 Author: Allan Jude AuthorDate: 2021-01-28 21:28:18 +0000 Commit: Allan Jude CommitDate: 2021-01-28 21:35:42 +0000 Flip the default for OPENSSL_KTLS to arm64 This is required to make use of KERN_TLS Reviewed by: jhb Sponsored by: Ampere Computing Submitted by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D28405 --- share/mk/src.opts.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index dec6eca65bed..e531916b5976 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -330,8 +330,8 @@ BROKEN_OPTIONS+=LOADER_UBOOT BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif -# Kernel TLS is enabled by default on amd64 -.if ${__T} == "amd64" +# Kernel TLS is enabled by default on amd64 and aarch64 +.if ${__T} == "aarch64" || ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=OPENSSL_KTLS .else __DEFAULT_NO_OPTIONS+=OPENSSL_KTLS From owner-dev-commits-src-main@freebsd.org Thu Jan 28 21:35: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 1492A4EDC7A; Thu, 28 Jan 2021 21:35: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 4DRYgG61Sgz4k9T; Thu, 28 Jan 2021 21:35: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 BB45417145; Thu, 28 Jan 2021 21:35: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 10SLZsbZ070889; Thu, 28 Jan 2021 21:35:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SLZsmD070888; Thu, 28 Jan 2021 21:35:54 GMT (envelope-from git) Date: Thu, 28 Jan 2021 21:35:54 GMT Message-Id: <202101282135.10SLZsmD070888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: b1f1917de48b - main - Regenerate src.conf.5 after enabling MK_OPENSSL_KTLS for arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1f1917de48b3eda092937c2af159aa5bc116d37 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, 28 Jan 2021 21:35:55 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=b1f1917de48b3eda092937c2af159aa5bc116d37 commit b1f1917de48b3eda092937c2af159aa5bc116d37 Author: Allan Jude AuthorDate: 2021-01-28 21:31:40 +0000 Commit: Allan Jude CommitDate: 2021-01-28 21:35:43 +0000 Regenerate src.conf.5 after enabling MK_OPENSSL_KTLS for arm64 --- share/man/man5/src.conf.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index ddcf01cc2903..dee1ffb84e20 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1306,12 +1306,12 @@ is set explicitly) Set to not include kernel TLS support in OpenSSL. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mips, mips/mips64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. +arm/armv6, arm/armv7, i386/i386, mips/mips, mips/mips64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_OPENSSL_KTLS Set to include kernel TLS support in OpenSSL. .Pp This is a default setting on -amd64/amd64. +amd64/amd64 and arm64/aarch64. .It Va WITHOUT_PAM Set to not build PAM library and modules. .Bf -symbolic From owner-dev-commits-src-main@freebsd.org Thu Jan 28 21:40: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 462DF4EE3A2; Thu, 28 Jan 2021 21:40:25 +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 4DRYmT1R9zz4kPh; Thu, 28 Jan 2021 21:40:25 +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 241F01714A; Thu, 28 Jan 2021 21:40:25 +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 10SLePIq079013; Thu, 28 Jan 2021 21:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SLeP2m079012; Thu, 28 Jan 2021 21:40:25 GMT (envelope-from git) Date: Thu, 28 Jan 2021 21:40:25 GMT Message-Id: <202101282140.10SLeP2m079012@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: 5c689e213614 - main - hsctrl: Fix manpage typo 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: 5c689e213614bff65e9789875f839aa05053126b 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, 28 Jan 2021 21:40:25 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5c689e213614bff65e9789875f839aa05053126b commit 5c689e213614bff65e9789875f839aa05053126b Author: Vladimir Kondratyev AuthorDate: 2021-01-28 21:35:11 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-01-28 21:40:01 +0000 hsctrl: Fix manpage typo Use hsctrl_load to load the module at boot time. Submitted by: Shunchao Hu Reviewed by: wulf MFC after: 3 days Differential revision: https://reviews.freebsd.org/D28343 --- share/man/man4/hsctrl.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/hsctrl.4 b/share/man/man4/hsctrl.4 index ba7976c3c03d..e4a44ce11630 100644 --- a/share/man/man4/hsctrl.4 +++ b/share/man/man4/hsctrl.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2020 +.Dd January 26, 2021 .Dt HSCTRL 4 .Os .Sh NAME @@ -45,7 +45,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -hgame_load="YES" +hsctrl_load="YES" .Ed .Sh DESCRIPTION The From owner-dev-commits-src-main@freebsd.org Thu Jan 28 23:13: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 6A1F34F05FB; Thu, 28 Jan 2021 23:13: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 4DRbr92WFBz4qmp; Thu, 28 Jan 2021 23:13: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 49071182FE; Thu, 28 Jan 2021 23:13: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 10SNDjSD000824; Thu, 28 Jan 2021 23:13:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SNDjEJ000823; Thu, 28 Jan 2021 23:13:45 GMT (envelope-from git) Date: Thu, 28 Jan 2021 23:13:45 GMT Message-Id: <202101282313.10SNDjEJ000823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Ambrisko Subject: git: 0c852bb9b928 - main - Add support for some more Intel VMD controllers. Some of the newer controller have a sparce bus space that can be figured out by probing the HW. This gives the starting bus number. When reading the PCI config. space behind the VMD controller, the offset of the starting bus needs to be subtracted from the bus being read. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ambrisko X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c852bb9b9282b30fd047ac1de398358f33777f4 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, 28 Jan 2021 23:13:45 -0000 The branch main has been updated by ambrisko: URL: https://cgit.FreeBSD.org/src/commit/?id=0c852bb9b9282b30fd047ac1de398358f33777f4 commit 0c852bb9b9282b30fd047ac1de398358f33777f4 Author: Doug Ambrisko AuthorDate: 2021-01-28 23:12:14 +0000 Commit: Doug Ambrisko CommitDate: 2021-01-28 23:12:14 +0000 Add support for some more Intel VMD controllers. Some of the newer controller have a sparce bus space that can be figured out by probing the HW. This gives the starting bus number. When reading the PCI config. space behind the VMD controller, the offset of the starting bus needs to be subtracted from the bus being read. Fixed a bug in which in which not all of the devices directly attached to the VMD controller would be probed. On my initial test HW, a switch was found at bus 0, slot 0 and function 0. All of the NVME drives were behind that switch. Now scan for all slots and functions attached to bus 0. If a something was found then run attach after the scan. On detach also go through all slots and functions on bus 0. Tested with device ID's: 0x201d & 0x9a0b Tested by: nc@ MFC after: 7 days PR: 252253 --- sys/dev/vmd/vmd.c | 75 ++++++++++++++++++++++++++++++++++++++++++++------- sys/dev/vmd/vmd.h | 1 + sys/dev/vmd/vmd_bus.c | 73 ++++++++++++++++++++++++++++++------------------- 3 files changed, 113 insertions(+), 36 deletions(-) diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index 616fd4c8373e..80eeda4639fa 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -61,16 +61,32 @@ struct vmd_type { u_int16_t vmd_vid; u_int16_t vmd_did; char *vmd_name; + int flags; +#define BUS_RESTRICT 1 }; #define INTEL_VENDOR_ID 0x8086 -#define INTEL_DEVICE_ID_VMD 0x201d -#define INTEL_DEVICE_ID_VMD2 0x28c0 +#define INTEL_DEVICE_ID_201d 0x201d +#define INTEL_DEVICE_ID_28c0 0x28c0 +#define INTEL_DEVICE_ID_467f 0x467f +#define INTEL_DEVICE_ID_4c3d 0x4c3d +#define INTEL_DEVICE_ID_9a0b 0x9a0b + +#define VMD_CAP 0x40 +#define VMD_BUS_RESTRICT 0x1 + +#define VMD_CONFIG 0x44 +#define VMD_BUS_START(x) ((x >> 8) & 0x3) + +#define VMD_LOCK 0x70 static struct vmd_type vmd_devs[] = { - { INTEL_VENDOR_ID, INTEL_DEVICE_ID_VMD, "Intel Volume Management Device" }, - { INTEL_VENDOR_ID, INTEL_DEVICE_ID_VMD2, "Intel Volume Management Device" }, - { 0, 0, NULL } + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_201d, "Intel Volume Management Device", 0 }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_28c0, "Intel Volume Management Device", BUS_RESTRICT }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_467f, "Intel Volume Management Device", BUS_RESTRICT }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_4c3d, "Intel Volume Management Device", BUS_RESTRICT }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_9a0b, "Intel Volume Management Device", BUS_RESTRICT }, + { 0, 0, NULL, 0 } }; static int @@ -92,7 +108,7 @@ vmd_probe(device_t dev) t++; } -return (ENXIO); + return (ENXIO); } static void @@ -157,8 +173,12 @@ vmd_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) struct vmd_softc *sc; bus_addr_t offset; - offset = (b << 20) + (s << 15) + (f << 12) + reg; sc = device_get_softc(dev); + if (b < sc->vmd_bus_start) + return (0xffffffff); + + offset = ((b - sc->vmd_bus_start) << 20) + (s << 15) + (f << 12) + reg; + switch(width) { case 4: return (bus_space_read_4(sc->vmd_btag, sc->vmd_bhandle, @@ -183,8 +203,11 @@ vmd_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, struct vmd_softc *sc; bus_addr_t offset; - offset = (b << 20) + (s << 15) + (f << 12) + reg; sc = device_get_softc(dev); + if (b < sc->vmd_bus_start) + return; + + offset = ((b - sc->vmd_bus_start) << 20) + (s << 15) + (f << 12) + reg; switch(width) { case 4: @@ -271,6 +294,8 @@ vmd_attach(device_t dev) { struct vmd_softc *sc; struct pcib_secbus *bus; + struct vmd_type *t; + uint16_t vid, did; uint32_t bar; int i, j, error; int rid, sec_reg; @@ -325,13 +350,45 @@ vmd_attach(device_t dev) pci_write_config(dev, PCIR_PRIBUS_2, pcib_get_bus(device_get_parent(dev)), 1); + t = vmd_devs; + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + + sc->vmd_bus_start = 0; + while (t->vmd_name != NULL) { + if (vid == t->vmd_vid && + did == t->vmd_did) { + if (t->flags == BUS_RESTRICT) { + if (pci_read_config(dev, VMD_CAP, 2) & + VMD_BUS_RESTRICT) + switch (VMD_BUS_START(pci_read_config( + dev, VMD_CONFIG, 2))) { + case 1: + sc->vmd_bus_start = 128; + break; + case 2: + sc->vmd_bus_start = 224; + break; + case 3: + device_printf(dev, + "Unknown bug offset\n"); + goto fail; + break; + } + } + } + t++; + } + + device_printf(dev, "VMD bus starts at %d\n", sc->vmd_bus_start); + sec_reg = PCIR_SECBUS_1; bus = &sc->vmd_bus; bus->sub_reg = PCIR_SUBBUS_1; bus->sec = vmd_read_config(dev, b, s, f, sec_reg, 1); bus->sub = vmd_read_config(dev, b, s, f, bus->sub_reg, 1); bus->dev = dev; - bus->rman.rm_start = 0; + bus->rman.rm_start = sc->vmd_bus_start; bus->rman.rm_end = PCI_BUSMAX; bus->rman.rm_type = RMAN_ARRAY; snprintf(buf, sizeof(buf), "%s bus numbers", device_get_nameunit(dev)); diff --git a/sys/dev/vmd/vmd.h b/sys/dev/vmd/vmd.h index f86630d72c24..e51448c7733e 100644 --- a/sys/dev/vmd/vmd.h +++ b/sys/dev/vmd/vmd.h @@ -78,6 +78,7 @@ struct vmd_softc void *vmd_intr; struct vmd_irq *vmd_irq; int vmd_msix_count; + uint8_t vmd_bus_start; #ifdef TASK_QUEUE_INTR struct taskqueue *vmd_irq_tq; struct task vmd_irq_task; diff --git a/sys/dev/vmd/vmd_bus.c b/sys/dev/vmd/vmd_bus.c index 74a6faa812b1..5eed6176630f 100644 --- a/sys/dev/vmd/vmd_bus.c +++ b/sys/dev/vmd/vmd_bus.c @@ -71,32 +71,45 @@ vmd_bus_attach(device_t dev) struct pci_devinfo *dinfo; rman_res_t start, end; int b, s, f; + int found; sc = device_get_softc(device_get_parent(dev)); - /* Start at max PCI vmd_domain and work down */ - b = s = f = 0; - dinfo = pci_read_device(device_get_parent(dev), dev, - PCI_DOMAINMAX - device_get_unit(device_get_parent(dev)), - b, s, f); - if (dinfo == NULL) { - device_printf(dev, "Cannot allocate dinfo!\n"); - return (ENOENT); + /* + * Start at max PCI vmd_domain and work down. Only VMD + * starting bus is connect to VMD device directly. Scan al + * lslots and function connected to starting bus. + */ + + b = sc->vmd_bus_start; + + found = 0; + for (s = 0; s < PCI_SLOTMAX; s++) { + for (f = 0; f < PCI_FUNCMAX; f++) { + dinfo = pci_read_device(device_get_parent(dev), dev, + PCI_DOMAINMAX - device_get_unit( + device_get_parent(dev)), b, s, f); + if (dinfo != NULL) { + found = 1; + pci_add_child(dev, dinfo); + + start = rman_get_start(sc->vmd_regs_resource[1]); + end = rman_get_end(sc->vmd_regs_resource[1]); + resource_list_add_next(&dinfo->resources, + SYS_RES_MEMORY, start, end, end - start + 1); + + start = rman_get_start(sc->vmd_io_resource); + end = rman_get_end(sc->vmd_io_resource); + resource_list_add_next(&dinfo->resources, + SYS_RES_IOPORT, start, end, end - start + 1); + + } + } } - pci_add_child(dev, dinfo); - - start = rman_get_start(sc->vmd_regs_resource[1]); - end = rman_get_end(sc->vmd_regs_resource[1]); - resource_list_add_next(&dinfo->resources, SYS_RES_MEMORY, start, end, - end - start + 1); - - start = rman_get_start(sc->vmd_io_resource); - end = rman_get_end(sc->vmd_io_resource); - resource_list_add_next(&dinfo->resources, SYS_RES_IOPORT, start, end, - end - start + 1); - - bus_generic_attach(dev); + if (found) { + bus_generic_attach(dev); + } return (0); } @@ -104,17 +117,23 @@ vmd_bus_attach(device_t dev) static int vmd_bus_detach(device_t dev) { + struct vmd_softc *sc; struct pci_devinfo *dinfo; int b, s, f; device_delete_children(dev); - b = s = f = 0; - dinfo = pci_read_device(device_get_parent(dev), dev, - PCI_DOMAINMAX - device_get_unit(device_get_parent(dev)), - b, s, f); - if (dinfo == NULL) { - resource_list_free(&dinfo->resources); + sc = device_get_softc(device_get_parent(dev)); + b = sc->vmd_bus_start; + + for (s = 0; s < PCI_SLOTMAX; s++) { + for (f = 0; f < PCI_FUNCMAX; f++) { + dinfo = pci_read_device(device_get_parent(dev), dev, + PCI_DOMAINMAX - device_get_unit( + device_get_parent(dev)), b, s, f); + if (dinfo != NULL) + resource_list_free(&dinfo->resources); + } } return (0); } From owner-dev-commits-src-main@freebsd.org Thu Jan 28 23:20: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 C95BC4F04EE; Thu, 28 Jan 2021 23:20: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 4DRbzS5K0Rz4qvy; Thu, 28 Jan 2021 23:20:04 +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 A48F61870C; Thu, 28 Jan 2021 23:20:04 +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 10SNK4Nk003349; Thu, 28 Jan 2021 23:20:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10SNK4BV003346; Thu, 28 Jan 2021 23:20:04 GMT (envelope-from git) Date: Thu, 28 Jan 2021 23:20:04 GMT Message-Id: <202101282320.10SNK4BV003346@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: 8fee65d0c70c - main - Add missing newlines. 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: 8fee65d0c70c99999b2fe5b49b267547b7ed2a49 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, 28 Jan 2021 23:20:04 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=8fee65d0c70c99999b2fe5b49b267547b7ed2a49 commit 8fee65d0c70c99999b2fe5b49b267547b7ed2a49 Author: Alexander Motin AuthorDate: 2021-01-28 23:18:53 +0000 Commit: Alexander Motin CommitDate: 2021-01-28 23:20:00 +0000 Add missing newlines. MFC after: 3 days --- sys/dev/acpica/acpi_apei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_apei.c b/sys/dev/acpica/acpi_apei.c index 2ba5f864e7a1..bc1f38f2fc8f 100644 --- a/sys/dev/acpica/acpi_apei.c +++ b/sys/dev/acpica/acpi_apei.c @@ -333,10 +333,10 @@ apei_ged_handler(ACPI_HEST_GENERIC_DATA *ged) t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]); } if (ged->ValidationBits & ACPI_HEST_GEN_VALID_FRU_STRING) - printf(" FRU Text: %.20s", ged->FruText); + printf(" FRU Text: %.20s\n", ged->FruText); if (ged->Revision == 0x300 && ged->ValidationBits & ACPI_HEST_GEN_VALID_TIMESTAMP) - printf(" Timestamp: %016jx", ged3->TimeStamp); + printf(" Timestamp: %016jx\n", ged3->TimeStamp); } static int From owner-dev-commits-src-main@freebsd.org Fri Jan 29 00:52: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 06F124F3718; Fri, 29 Jan 2021 00:52: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 4DRf236sTWz3Dn7; Fri, 29 Jan 2021 00:52: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 DEB6219B99; Fri, 29 Jan 2021 00:52: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 10T0qRKf030947; Fri, 29 Jan 2021 00:52:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T0qRJr030946; Fri, 29 Jan 2021 00:52:27 GMT (envelope-from git) Date: Fri, 29 Jan 2021 00:52:27 GMT Message-Id: <202101290052.10T0qRJr030946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8a51f14a7833 - main - newvers: tweak uname to be more useful MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a51f14a7833fd14e1f125e63a0af9d260dcd287 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, 29 Jan 2021 00:52:28 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8a51f14a7833fd14e1f125e63a0af9d260dcd287 commit 8a51f14a7833fd14e1f125e63a0af9d260dcd287 Author: Warner Losh AuthorDate: 2021-01-25 19:53:31 +0000 Commit: Warner Losh CommitDate: 2021-01-29 00:44:56 +0000 newvers: tweak uname to be more useful The current uname is branch-cXXXX-gHASH Three changes to make uname more useful. 1. Move from using git rev-list --count to git rev-lis --count --first-parent since that gives a better, incrementing number. 2. Report this count as 'nXXXXX' rather than 'cXXXXX' because c is part of a hash and we've changed the sematnics of XXXXX 3. Remove g to make HASH cut and pastable. Durting review, #1 & #3 had the largest consensus. There was a diversity of opinion on #2, but on the whole it was positive so I'll acknowledge the dissent, but move forward with something seems to have support since the dissent was all about what letter to use where I chose 'n'. MFC After: 3 days Reviewed by: rgrimes, emaste (earlier version) Differential Revision: https://reviews.freebsd.org/D28338 --- sys/conf/newvers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 497ea44cdd64..847c01186aeb 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -253,9 +253,9 @@ fi if [ -n "$git_cmd" ] ; then git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) if [ "$($git_cmd rev-parse --is-shallow-repository)" = false ] ; then - git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) + git_cnt=$($git_cmd rev-list --first-parent --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="c${git_cnt}-g${git}" + git="n${git_cnt}-${git}" fi fi git_b=$($git_cmd rev-parse --abbrev-ref HEAD) From owner-dev-commits-src-main@freebsd.org Fri Jan 29 01:25: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 15B6F4F4C4D; Fri, 29 Jan 2021 01:25: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 4DRfmQ05vqz3KMR; Fri, 29 Jan 2021 01:25: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 EA64A1A29D; Fri, 29 Jan 2021 01:25: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 10T1PfiK071428; Fri, 29 Jan 2021 01:25:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T1Pf6n071427; Fri, 29 Jan 2021 01:25:41 GMT (envelope-from git) Date: Fri, 29 Jan 2021 01:25:41 GMT Message-Id: <202101290125.10T1Pf6n071427@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: 0f919ed4ae4d - main - tmpfs: push VEXEC check into tmpfs_lookup() 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: 0f919ed4ae4df082eefb517afe02752b1790afd3 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, 29 Jan 2021 01:25:42 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0f919ed4ae4df082eefb517afe02752b1790afd3 commit 0f919ed4ae4df082eefb517afe02752b1790afd3 Author: Kyle Evans AuthorDate: 2021-01-28 14:27:28 +0000 Commit: Kyle Evans CommitDate: 2021-01-29 01:25:11 +0000 tmpfs: push VEXEC check into tmpfs_lookup() vfs_cache_lookup() has already done the appropriate VEXEC check, therefore we must not re-check in VOP_CACHEDLOOKUP. This fixes O_SEARCH semantics on tmpfs and removes a redundant descent into VOP_ACCESS() in the common case. Reported-by: arichardson (via CheriBSD Jenkins CI) Reviewed-by: kib MFC-after: 3 days Differential Revision: https://reviews.freebsd.org/D28401 --- sys/fs/tmpfs/tmpfs_vnops.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 7614287c642e..7be2655dcf0b 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -91,14 +91,10 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) struct tmpfs_mount *tm; int error; + /* Caller assumes responsibility for ensuring access (VEXEC). */ dnode = VP_TO_TMPFS_DIR(dvp); *vpp = NULLVP; - /* Check accessibility of requested node as a first step. */ - error = vn_dir_check_exec(dvp, cnp); - if (error != 0) - goto out; - /* We cannot be requesting the parent directory of the root node. */ MPASS(IMPLIES(dnode->tn_type == VDIR && dnode->tn_dir.tn_parent == dnode, @@ -241,8 +237,17 @@ tmpfs_cached_lookup(struct vop_cachedlookup_args *v) static int tmpfs_lookup(struct vop_lookup_args *v) { + struct vnode *dvp = v->a_dvp; + struct vnode **vpp = v->a_vpp; + struct componentname *cnp = v->a_cnp; + int error; - return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp)); + /* Check accessibility of requested node as a first step. */ + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) + return (error); + + return (tmpfs_lookup1(dvp, vpp, cnp)); } static int From owner-dev-commits-src-main@freebsd.org Fri Jan 29 01:37: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 092B74F530C; Fri, 29 Jan 2021 01:37:03 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 4DRg1V6Tltz3Kjw; Fri, 29 Jan 2021 01:37:02 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x331.google.com with SMTP id i9so5993502wmq.1; Thu, 28 Jan 2021 17:37:02 -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=k7GKpCKtbtpu6MhZEpKrKhKKixZx3Awqi5XMY2nUn2c=; b=ifwsDKQ5N38AMZ6wL+xRyLMcUSHOOEGcHJfpY45FVbEs6x1YklUJkPtf+HpzVPz5UJ TU1ciANEwqQms+KUcNo/5/7SDxNFnnPkDMF5wvqtUQuqkTdZWVN1EKKdPe/dElU3bk0t NshX+Ym8TWPXCVvica16nUUPYcRoS+Geq+UUl5xEdyy59oVQOdusXNXd/6KOexWbPDOc EMD7EonA7367aUnYy9RhjspxZ7gZzXM34H4emzbuSmwFhOhFrsAtrC3liSg2NDi9A3RS bR312tN/dB6Zi4ZSLMShz6HKK19NynjzHJBIjcIY0mjn5bh9ufYq+Qc/u1y7NVRaj/eL UXEA== 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=k7GKpCKtbtpu6MhZEpKrKhKKixZx3Awqi5XMY2nUn2c=; b=cRdzACeIm2QjYqqyLg4E5WZNGCh/bZlTGPvrXRjgQwDmlV/MZq2InAUeWbRfAefH/q h2g+bQIik5Sh4vgQIOC6xTJoGPZeZ+OdVuuqpa+8qOltkpttcVeebEgb7IPjziQhmY/h 9OQ4N/UGlg7qGG/3cjxPts6Dy3gbt+GfXyoD6K+4KPTSv1JGMdaXE1AjZfblGdirovlM ZWHGS/7cOCYgnKt5NQBCXQ6AUsfl+TIB+u/Uxsdtp/mnnE3XRDqWTwaaGDMw5zKkz8Bw VPzngFi9ksPny+dJ7sw70CZCE7/v5Cs5tUcnepi2tU3Nprt/Lji5vVExGaY0hvw1w5lx ULFg== X-Gm-Message-State: AOAM532+mpLex+qP35UPKs4y37NNtWIDxU+a44vYDiuvpq8u8WGnqiC0 qXPSMdNZCTxShhs4KmZ7Fk0VCVFp2QVBK+oR0MFPa+cTcKM= X-Google-Smtp-Source: ABdhPJy9OWI7cpqWZOI9TKl3AWr6QNqrkF1M2FU2kFc+Ccb8PrOGmbh0/Kf9QghQp4hZeaRqU9wsHFVKYNbwAfgc1qY= X-Received: by 2002:a1c:2ec2:: with SMTP id u185mr1545467wmu.83.1611884219862; Thu, 28 Jan 2021 17:36:59 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Thu, 28 Jan 2021 17:36:58 -0800 (PST) In-Reply-To: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> From: Mateusz Guzik Date: Fri, 29 Jan 2021 02:36:58 +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: Randall Stewart 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: 4DRg1V6Tltz3Kjw 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: Fri, 29 Jan 2021 01:37:03 -0000 This breaks tinderbox: arm LINT kernel failed, check _.arm.LINT for details i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details i386 LINT kernel failed, check _.i386.LINT for details amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details On 1/28/21, Randall Stewart wrote: > The branch main has been updated by rrs: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=1a714ff204193b9eb810426048e03f5d76e9730e > > commit 1a714ff204193b9eb810426048e03f5d76e9730e > Author: Randall Stewart > AuthorDate: 2021-01-26 16:54:42 +0000 > Commit: Randall Stewart > CommitDate: 2021-01-28 16:53:05 +0000 > > 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. > > Sponsored by: Netflix Inc. > Differential Revision: https://reviews.freebsd.org/D28357 > --- > sys/net/if_lagg.c | 11 + > sys/net/if_var.h | 2 + > sys/net/if_vlan.c | 30 +++ > sys/netinet/in_pcb.c | 9 + > sys/netinet/tcp_log_buf.h | 2 +- > sys/netinet/tcp_ratelimit.c | 584 > +++++++++++++++++++++++++++--------------- > sys/netinet/tcp_ratelimit.h | 24 +- > sys/netinet/tcp_stacks/bbr.c | 4 +- > sys/netinet/tcp_stacks/rack.c | 14 +- > 9 files changed, 464 insertions(+), 216 deletions(-) > > diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c > index 3144f86901b2..9a3c22789fa5 100644 > --- a/sys/net/if_lagg.c > +++ b/sys/net/if_lagg.c > @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct m_snd_tag *, > static int lagg_snd_tag_query(struct m_snd_tag *, > union if_snd_tag_query_params *); > static void lagg_snd_tag_free(struct m_snd_tag *); > +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); > static void lagg_ratelimit_query(struct ifnet *, > struct if_ratelimit_query_results *); > #endif > @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, > caddr_t params) > ifp->if_snd_tag_modify = lagg_snd_tag_modify; > ifp->if_snd_tag_query = lagg_snd_tag_query; > ifp->if_snd_tag_free = lagg_snd_tag_free; > + ifp->if_next_snd_tag = lagg_next_snd_tag; > ifp->if_ratelimit_query = lagg_ratelimit_query; > #endif > ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; > @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, > return (0); > } > > +static struct m_snd_tag * > +lagg_next_snd_tag(struct m_snd_tag *mst) > +{ > + struct lagg_snd_tag *lst; > + > + lst = mst_to_lst(mst); > + return (lst->tag); > +} > + > static int > lagg_snd_tag_modify(struct m_snd_tag *mst, > union if_snd_tag_modify_params *params) > diff --git a/sys/net/if_var.h b/sys/net/if_var.h > index beb9596895ee..9ecdfb684296 100644 > --- a/sys/net/if_var.h > +++ b/sys/net/if_var.h > @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, union > if_snd_tag_alloc_params * > typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union > if_snd_tag_modify_params *); > typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union > if_snd_tag_query_params *); > typedef void (if_snd_tag_free_t)(struct m_snd_tag *); > +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); > typedef void (if_ratelimit_query_t)(struct ifnet *, > struct if_ratelimit_query_results *); > typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t); > @@ -422,6 +423,7 @@ struct ifnet { > if_snd_tag_modify_t *if_snd_tag_modify; > if_snd_tag_query_t *if_snd_tag_query; > if_snd_tag_free_t *if_snd_tag_free; > + if_next_send_tag_t *if_next_snd_tag; > if_ratelimit_query_t *if_ratelimit_query; > if_ratelimit_setup_t *if_ratelimit_setup; > > diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c > index 9358724844cb..9703e5e7753f 100644 > --- a/sys/net/if_vlan.c > +++ b/sys/net/if_vlan.c > @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag *, > static int vlan_snd_tag_query(struct m_snd_tag *, > union if_snd_tag_query_params *); > static void vlan_snd_tag_free(struct m_snd_tag *); > +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); > +static void vlan_ratelimit_query(struct ifnet *, > + struct if_ratelimit_query_results *); > #endif > static void vlan_qflush(struct ifnet *ifp); > static int vlan_setflag(struct ifnet *ifp, int flag, int status, > @@ -1071,6 +1074,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, > size_t len, caddr_t params) > ifp->if_snd_tag_modify = vlan_snd_tag_modify; > ifp->if_snd_tag_query = vlan_snd_tag_query; > ifp->if_snd_tag_free = vlan_snd_tag_free; > + ifp->if_next_snd_tag = vlan_next_snd_tag; > + ifp->if_ratelimit_query = vlan_ratelimit_query; > #endif > ifp->if_flags = VLAN_IFFLAGS; > ether_ifattach(ifp, eaddr); > @@ -2073,6 +2078,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, > return (0); > } > > +static struct m_snd_tag * > +vlan_next_snd_tag(struct m_snd_tag *mst) > +{ > + struct vlan_snd_tag *vst; > + > + vst = mst_to_vst(mst); > + return (vst->tag); > +} > + > static int > vlan_snd_tag_modify(struct m_snd_tag *mst, > union if_snd_tag_modify_params *params) > @@ -2102,4 +2116,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) > m_snd_tag_rele(vst->tag); > free(vst, M_VLAN); > } > + > +static void > +vlan_ratelimit_query(struct ifnet *ifp __unused, struct > if_ratelimit_query_results *q) > +{ > + /* > + * For vlan, we have an indirect > + * interface. The caller needs to > + * get a ratelimit tag on the actual > + * interface the flow will go on. > + */ > + q->rate_table = NULL; > + q->flags = RT_IS_INDIRECT; > + q->max_flows = 0; > + q->number_of_rates = 0; > +} > + > #endif > diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c > index 59695ee3715d..40a0b4c0676e 100644 > --- a/sys/netinet/in_pcb.c > +++ b/sys/netinet/in_pcb.c > @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, > randomtime, > "allocation before switching to a random one"); > > #ifdef RATELIMIT > +counter_u64_t rate_limit_new; > +counter_u64_t rate_limit_chg; > counter_u64_t rate_limit_active; > counter_u64_t rate_limit_alloc_fail; > counter_u64_t rate_limit_set_ok; > @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, > alloc_fail, CTLFLAG_RD, > &rate_limit_alloc_fail, "Rate limited connection failures"); > SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, > &rate_limit_set_ok, "Rate limited setting succeeded"); > +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, > + &rate_limit_new, "Total Rate limit new attempts"); > +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, > + &rate_limit_chg, "Total Rate limited change attempts"); > + > #endif /* RATELIMIT */ > > #endif /* INET */ > @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) > static void > rl_init(void *st) > { > + rate_limit_new = counter_u64_alloc(M_WAITOK); > + rate_limit_chg = counter_u64_alloc(M_WAITOK); > rate_limit_active = counter_u64_alloc(M_WAITOK); > rate_limit_alloc_fail = counter_u64_alloc(M_WAITOK); > rate_limit_set_ok = counter_u64_alloc(M_WAITOK); > diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h > index 0d9b14a08f53..436383124dce 100644 > --- a/sys/netinet/tcp_log_buf.h > +++ b/sys/netinet/tcp_log_buf.h > @@ -221,7 +221,7 @@ enum tcp_log_events { > BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ > BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 */ > TCP_LOG_REASS, /* Reassembly buffer logging 50 */ > - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 */ > + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this) 51 > */ > BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ > BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 */ > TCP_LOG_CONNEND, /* End of connection 54 */ > diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c > index 97f066be69e0..aeb1ed6906b5 100644 > --- a/sys/netinet/tcp_ratelimit.c > +++ b/sys/netinet/tcp_ratelimit.c > @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); > #ifdef INET6 > #include > #endif > +#include > +#include > #include > #ifndef USECS_IN_SECOND > #define USECS_IN_SECOND 1000000 > @@ -154,108 +156,77 @@ const uint64_t desired_rates[] = { > 180500, /* 1.44Mpbs - rate 2 common rate */ > 375000, /* 3Mbps - rate 3 */ > 625000, /* 5Mbps - rate 4 */ > - 875000, /* 7Mbps - rate 5 */ > - 1125000, /* 9Mbps - rate 6 */ > - 1375000, /* 11Mbps - rate 7 */ > - 1625000, /* 13Mbps - rate 8 */ > - 2625000, /* 21Mbps - rate 9 */ > - 3875000, /* 31Mbps - rate 10 */ > - 5125000, /* 41Meg - rate 11 */ > - 12500000, /* 100Mbps - rate 12 */ > - 25000000, /* 200Mbps - rate 13 */ > - 50000000, /* 400Mbps - rate 14 */ > - 63750000, /* 51Mbps - rate 15 */ > + 1250000, /* 10Mbps - rate 5 */ > + 1875000, /* 15Mbps - rate 6 */ > + 2500000, /* 20Mbps - rate 7 */ > + 3125000, /* 25Mbps - rate 8 */ > + 3750000, /* 30Mbps - rate 9 */ > + 4375000, /* 35Mbps - rate 10 */ > + 5000000, /* 40Meg - rate 11 */ > + 6250000, /* 50Mbps - rate 12 */ > + 12500000, /* 100Mbps - rate 13 */ > + 25000000, /* 200Mbps - rate 14 */ > + 50000000, /* 400Mbps - rate 15 */ > 100000000, /* 800Mbps - rate 16 */ > - 1875000, /* 15Mbps - rate 17 */ > - 2125000, /* 17Mbps - rate 18 */ > - 2375000, /* 19Mbps - rate 19 */ > - 2875000, /* 23Mbps - rate 20 */ > - 3125000, /* 25Mbps - rate 21 */ > - 3375000, /* 27Mbps - rate 22 */ > - 3625000, /* 29Mbps - rate 23 */ > - 4125000, /* 33Mbps - rate 24 */ > - 4375000, /* 35Mbps - rate 25 */ > - 4625000, /* 37Mbps - rate 26 */ > - 4875000, /* 39Mbps - rate 27 */ > - 5375000, /* 43Mbps - rate 28 */ > - 5625000, /* 45Mbps - rate 29 */ > - 5875000, /* 47Mbps - rate 30 */ > - 6125000, /* 49Mbps - rate 31 */ > - 6625000, /* 53Mbps - rate 32 */ > - 6875000, /* 55Mbps - rate 33 */ > - 7125000, /* 57Mbps - rate 34 */ > - 7375000, /* 59Mbps - rate 35 */ > - 7625000, /* 61Mbps - rate 36 */ > - 7875000, /* 63Mbps - rate 37 */ > - 8125000, /* 65Mbps - rate 38 */ > - 8375000, /* 67Mbps - rate 39 */ > - 8625000, /* 69Mbps - rate 40 */ > - 8875000, /* 71Mbps - rate 41 */ > - 9125000, /* 73Mbps - rate 42 */ > - 9375000, /* 75Mbps - rate 43 */ > - 9625000, /* 77Mbps - rate 44 */ > - 9875000, /* 79Mbps - rate 45 */ > - 10125000, /* 81Mbps - rate 46 */ > - 10375000, /* 83Mbps - rate 47 */ > - 10625000, /* 85Mbps - rate 48 */ > - 10875000, /* 87Mbps - rate 49 */ > - 11125000, /* 89Mbps - rate 50 */ > - 11375000, /* 91Mbps - rate 51 */ > - 11625000, /* 93Mbps - rate 52 */ > - 11875000, /* 95Mbps - rate 53 */ > - 13125000, /* 105Mbps - rate 54 */ > - 13750000, /* 110Mbps - rate 55 */ > - 14375000, /* 115Mbps - rate 56 */ > - 15000000, /* 120Mbps - rate 57 */ > - 15625000, /* 125Mbps - rate 58 */ > - 16250000, /* 130Mbps - rate 59 */ > - 16875000, /* 135Mbps - rate 60 */ > - 17500000, /* 140Mbps - rate 61 */ > - 18125000, /* 145Mbps - rate 62 */ > - 18750000, /* 150Mbps - rate 64 */ > - 20000000, /* 160Mbps - rate 65 */ > - 21250000, /* 170Mbps - rate 66 */ > - 22500000, /* 180Mbps - rate 67 */ > - 23750000, /* 190Mbps - rate 68 */ > - 26250000, /* 210Mbps - rate 69 */ > - 27500000, /* 220Mbps - rate 70 */ > - 28750000, /* 230Mbps - rate 71 */ > - 30000000, /* 240Mbps - rate 72 */ > - 31250000, /* 250Mbps - rate 73 */ > - 34375000, /* 275Mbps - rate 74 */ > - 37500000, /* 300Mbps - rate 75 */ > - 40625000, /* 325Mbps - rate 76 */ > - 43750000, /* 350Mbps - rate 77 */ > - 46875000, /* 375Mbps - rate 78 */ > - 53125000, /* 425Mbps - rate 79 */ > - 56250000, /* 450Mbps - rate 80 */ > - 59375000, /* 475Mbps - rate 81 */ > - 62500000, /* 500Mbps - rate 82 */ > - 68750000, /* 550Mbps - rate 83 */ > - 75000000, /* 600Mbps - rate 84 */ > - 81250000, /* 650Mbps - rate 85 */ > - 87500000, /* 700Mbps - rate 86 */ > - 93750000, /* 750Mbps - rate 87 */ > - 106250000, /* 850Mbps - rate 88 */ > - 112500000, /* 900Mbps - rate 89 */ > - 125000000, /* 1Gbps - rate 90 */ > - 156250000, /* 1.25Gps - rate 91 */ > - 187500000, /* 1.5Gps - rate 92 */ > - 218750000, /* 1.75Gps - rate 93 */ > - 250000000, /* 2Gbps - rate 94 */ > - 281250000, /* 2.25Gps - rate 95 */ > - 312500000, /* 2.5Gbps - rate 96 */ > - 343750000, /* 2.75Gbps - rate 97 */ > - 375000000, /* 3Gbps - rate 98 */ > - 500000000, /* 4Gbps - rate 99 */ > - 625000000, /* 5Gbps - rate 100 */ > - 750000000, /* 6Gbps - rate 101 */ > - 875000000, /* 7Gbps - rate 102 */ > - 1000000000, /* 8Gbps - rate 103 */ > - 1125000000, /* 9Gbps - rate 104 */ > - 1250000000, /* 10Gbps - rate 105 */ > - 1875000000, /* 15Gbps - rate 106 */ > - 2500000000 /* 20Gbps - rate 107 */ > + 5625000, /* 45Mbps - rate 17 */ > + 6875000, /* 55Mbps - rate 19 */ > + 7500000, /* 60Mbps - rate 20 */ > + 8125000, /* 65Mbps - rate 21 */ > + 8750000, /* 70Mbps - rate 22 */ > + 9375000, /* 75Mbps - rate 23 */ > + 10000000, /* 80Mbps - rate 24 */ > + 10625000, /* 85Mbps - rate 25 */ > + 11250000, /* 90Mbps - rate 26 */ > + 11875000, /* 95Mbps - rate 27 */ > + 12500000, /* 100Mbps - rate 28 */ > + 13750000, /* 110Mbps - rate 29 */ > + 15000000, /* 120Mbps - rate 30 */ > + 16250000, /* 130Mbps - rate 31 */ > + 17500000, /* 140Mbps - rate 32 */ > + 18750000, /* 150Mbps - rate 33 */ > + 20000000, /* 160Mbps - rate 34 */ > + 21250000, /* 170Mbps - rate 35 */ > + 22500000, /* 180Mbps - rate 36 */ > + 23750000, /* 190Mbps - rate 37 */ > + 26250000, /* 210Mbps - rate 38 */ > + 27500000, /* 220Mbps - rate 39 */ > + 28750000, /* 230Mbps - rate 40 */ > + 30000000, /* 240Mbps - rate 41 */ > + 31250000, /* 250Mbps - rate 42 */ > + 34375000, /* 275Mbps - rate 43 */ > + 37500000, /* 300Mbps - rate 44 */ > + 40625000, /* 325Mbps - rate 45 */ > + 43750000, /* 350Mbps - rate 46 */ > + 46875000, /* 375Mbps - rate 47 */ > + 53125000, /* 425Mbps - rate 48 */ > + 56250000, /* 450Mbps - rate 49 */ > + 59375000, /* 475Mbps - rate 50 */ > + 62500000, /* 500Mbps - rate 51 */ > + 68750000, /* 550Mbps - rate 52 */ > + 75000000, /* 600Mbps - rate 53 */ > + 81250000, /* 650Mbps - rate 54 */ > + 87500000, /* 700Mbps - rate 55 */ > + 93750000, /* 750Mbps - rate 56 */ > + 106250000, /* 850Mbps - rate 57 */ > + 112500000, /* 900Mbps - rate 58 */ > + 125000000, /* 1Gbps - rate 59 */ > + 156250000, /* 1.25Gps - rate 60 */ > + 187500000, /* 1.5Gps - rate 61 */ > + 218750000, /* 1.75Gps - rate 62 */ > + 250000000, /* 2Gbps - rate 63 */ > + 281250000, /* 2.25Gps - rate 64 */ > + 312500000, /* 2.5Gbps - rate 65 */ > + 343750000, /* 2.75Gbps - rate 66 */ > + 375000000, /* 3Gbps - rate 67 */ > + 500000000, /* 4Gbps - rate 68 */ > + 625000000, /* 5Gbps - rate 69 */ > + 750000000, /* 6Gbps - rate 70 */ > + 875000000, /* 7Gbps - rate 71 */ > + 1000000000, /* 8Gbps - rate 72 */ > + 1125000000, /* 9Gbps - rate 73 */ > + 1250000000, /* 10Gbps - rate 74 */ > + 1875000000, /* 15Gbps - rate 75 */ > + 2500000000 /* 20Gbps - rate 76 */ > }; > > #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) > @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; > static struct mtx rs_mtx; > uint32_t rs_number_alive; > uint32_t rs_number_dead; > +static uint32_t rs_floor_mss = 0; > +static uint32_t wait_time_floor = 8000; /* 8 ms */ > +static uint32_t rs_hw_floor_mss = 16; > +static uint32_t num_of_waits_allowed = 1; /* How many time blocks are we > willing to wait */ > > SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, > "TCP Ratelimit stats"); > @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, > CTLFLAG_RW, > SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, > &rs_number_dead, 0, > "Number of interfaces departing from ratelimiting"); > +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, > + &rs_floor_mss, 0, > + "Number of MSS that will override the normal minimums (0 means don't > enforce)"); > +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, > + &wait_time_floor, 2000, > + "Has b/w increases what is the wait floor we are willing to wait at the > end?"); > +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, > + &num_of_waits_allowed, 1, > + "How many time blocks on the end should software pacing be willing to > wait?"); > + > +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, > + &rs_hw_floor_mss, 16, > + "Number of mss that are a minum for hardware pacing?"); > + > > static void > rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set > *rs) > @@ -383,6 +372,17 @@ 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 > @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) > } > > #ifdef INET > +extern counter_u64_t rate_limit_new; > +extern counter_u64_t rate_limit_chg; > extern counter_u64_t rate_limit_set_ok; > extern counter_u64_t rate_limit_active; > extern counter_u64_t rate_limit_alloc_fail; > @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) > int i; > struct if_ratelimit_query_results rl; > struct sysctl_oid *rl_sysctl_root; > + struct epoch_tracker et; > /* > * We expect to enter with the > * mutex locked. > @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) > CTLFLAG_RW | CTLFLAG_MPSAFE, 0, > ""); > rl_add_syctl_entries(rl_sysctl_root, rs); > + NET_EPOCH_ENTER(et); > mtx_lock(&rs_mtx); > CK_LIST_INSERT_HEAD(&int_rs, rs, next); > mtx_unlock(&rs_mtx); > + NET_EPOCH_EXIT(et); > return (rs); > } else if ((rl.flags & RT_IS_INDIRECT) == RT_IS_INDIRECT) { > memset(rs, 0, sizeof(struct tcp_rate_set)); > @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) > CTLFLAG_RW | CTLFLAG_MPSAFE, 0, > ""); > rl_add_syctl_entries(rl_sysctl_root, rs); > + NET_EPOCH_ENTER(et); > mtx_lock(&rs_mtx); > CK_LIST_INSERT_HEAD(&int_rs, rs, next); > mtx_unlock(&rs_mtx); > + NET_EPOCH_EXIT(et); > return (rs); > } else if ((rl.flags & RT_IS_FIXED_TABLE) == RT_IS_FIXED_TABLE) { > /* Mellanox C4 likely */ > @@ -671,6 +678,8 @@ 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. > */ > @@ -741,18 +750,24 @@ handle_err: > CTLFLAG_RW | CTLFLAG_MPSAFE, 0, > ""); > rl_add_syctl_entries(rl_sysctl_root, rs); > + NET_EPOCH_ENTER(et); > mtx_lock(&rs_mtx); > CK_LIST_INSERT_HEAD(&int_rs, rs, next); > mtx_unlock(&rs_mtx); > + NET_EPOCH_EXIT(et); > return (rs); > } > > +/* > + * For an explanation of why the argument is volatile please > + * look at the comments around rt_setup_rate(). > + */ > static const struct tcp_hwrate_limit_table * > -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, > - uint64_t bytes_per_sec, uint32_t flags) > +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, > + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) > { > struct tcp_hwrate_limit_table *arte = NULL, *rte = NULL; > - uint64_t mbits_per_sec, ind_calc; > + uint64_t mbits_per_sec, ind_calc, previous_rate = 0; > int i; > > mbits_per_sec = (bytes_per_sec * 8); > @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > * Smaller than 1Meg, only > * 3 entries can match it. > */ > + previous_rate = 0; > for(i = rs->rs_lowest_valid; i < 3; i++) { > if (bytes_per_sec <= rs->rs_rlt[i].rate) { > rte = &rs->rs_rlt[i]; > @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > } else if (rs->rs_rlt[i].flags & HDWRPACE_INITED) { > arte = &rs->rs_rlt[i]; > } > + previous_rate = rs->rs_rlt[i].rate; > } > goto done; > } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && > @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > rte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; > else > arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; > + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; > goto done; > } > /* > @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > ind_calc = ALL_HARDWARE_RATES-1; > } > if ((ind_calc >= rs->rs_lowest_valid) && > - (ind_calc <= rs->rs_highest_valid)) > - rte = &rs->rs_rlt[ind_calc]; > + (ind_calc <= rs->rs_highest_valid)) { > + rte = &rs->rs_rlt[ind_calc]; > + if (ind_calc >= 1) > + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; > + } > } else if (flags & RS_PACING_EXACT_MATCH) { > if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && > (rs->rs_lowest_valid <= 2)){ > @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > for (i=2; i>=rs->rs_lowest_valid; i--) { > if (bytes_per_sec < rs->rs_rlt[i].rate) { > rte = &rs->rs_rlt[i]; > + if (i >= 1) { > + previous_rate = rs->rs_rlt[(i-1)].rate; > + } > break; > } else if ((flags & RS_PACING_GEQ) && > (bytes_per_sec == rs->rs_rlt[i].rate)) { > rte = &rs->rs_rlt[i]; > + if (i >= 1) { > + previous_rate = rs->rs_rlt[(i-1)].rate; > + } > break; > } else { > arte = &rs->rs_rlt[i]; /* new alternate */ > @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > /* The top rate is an alternative */ > arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; > } > + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; > } else { > /* Its in our range 1Meg - 1Gig */ > if (flags & RS_PACING_GEQ) { > @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > ind_calc = (ALL_HARDWARE_RATES-1); > } > rte = &rs->rs_rlt[ind_calc]; > + if (ind_calc >= 1) > + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; > } > goto done; > } > @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set > *rs, > /* This should not happen */ > ind_calc = ALL_HARDWARE_RATES-1; > } > - if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) > + if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) { > rte = &rs->rs_rlt[ind_calc]; > + if (ind_calc >= 1) > + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; > + } > } > } > done: > @@ -893,11 +926,17 @@ done: > /* We can use the substitute */ > rte = arte; > } > + if (lower_rate) > + *lower_rate = previous_rate; > return (rte); > } > > +/* > + * For an explanation of why the argument is volatile please > + * look at the comments around rt_setup_rate(). > + */ > static const struct tcp_hwrate_limit_table * > -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t > bytes_per_sec, uint32_t flags) > +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, uint64_t > bytes_per_sec, uint32_t flags, uint64_t *lower_rate) > { > /** > * Hunt the rate table with the restrictions in flags and find a > @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, > uint64_t bytes_per_sec, ui > */ > int i, matched; > struct tcp_hwrate_limit_table *rte = NULL; > + uint64_t previous_rate = 0; > > if ((rs->rs_flags & RS_INT_TBL) && > (rs->rs_rate_cnt >= ALL_HARDWARE_RATES)) { > @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, > uint64_t bytes_per_sec, ui > * from 1Meg - 1000Meg in 1Meg increments. > * Use an alternate method to "lookup". > */ > - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags)); > + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags, > lower_rate)); > } > if ((flags & RS_PACING_LT) || > (flags & RS_PACING_EXACT_MATCH)) { > @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, > uint64_t bytes_per_sec, ui > (bytes_per_sec == rs->rs_rlt[i].rate)) { > rte = &rs->rs_rlt[i]; > matched = 1; > + if (lower_rate != NULL) > + *lower_rate = previous_rate; > break; > } else if ((flags & RS_PACING_LT) && > (bytes_per_sec <= rs->rs_rlt[i].rate)) { > rte = &rs->rs_rlt[i]; > matched = 1; > + if (lower_rate != NULL) > + *lower_rate = previous_rate; > break; > } > + previous_rate = rs->rs_rlt[i].rate; > if (bytes_per_sec > rs->rs_rlt[i].rate) > break; > } > @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, > uint64_t bytes_per_sec, ui > * We found a table entry that is smaller, > * stop there will be none greater or equal. > */ > + if (lower_rate != NULL) > + *lower_rate = rs->rs_rlt[i].rate; > break; > } > } > @@ -995,10 +1042,10 @@ static struct ifnet * > rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) > { > struct ifnet *tifp; > - struct m_snd_tag *tag; > + struct m_snd_tag *tag, *ntag; > union if_snd_tag_alloc_params params = { > .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, > - .rate_limit.hdr.flowid = 1, > + .rate_limit.hdr.flowid = inp->inp_flowid, > .rate_limit.hdr.numa_domain = inp->inp_numa_domain, > .rate_limit.max_rate = COMMON_RATE, > .rate_limit.flags = M_NOWAIT, > @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, struct > inpcb *inp, int *error) > *error = err; > return (NULL); > } > - tifp = tag->ifp; > + ntag = tag; > + while(ntag->ifp->if_next_snd_tag != NULL) { > + ntag = ntag->ifp->if_next_snd_tag(ntag); > + } > + tifp = ntag->ifp; > m_snd_tag_rele(tag); > return (tifp); > } > > +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); > +} > + > +/* > + * Do NOT take the __noinline out of the > + * find_rs_for_ifp() function. If you do the inline > + * of it for the rt_setup_rate() will show you a > + * compiler bug. For some reason the compiler thinks > + * the list can never be empty. The consequence of > + * this will be a crash when we dereference NULL > + * if an ifp is removed just has a hw rate limit > + * is attempted. If you are working on the compiler > + * and want to "test" this go ahead and take the noinline > + * out otherwise let sleeping dogs ly until such time > + * as we get a compiler fix 10/2/20 -- RRS > + */ > +static __noinline struct tcp_rate_set * > +find_rs_for_ifp(struct ifnet *ifp) > +{ > + struct tcp_rate_set *rs; > + > + CK_LIST_FOREACH(rs, &int_rs, next) { > + if ((rs->rs_ifp == ifp) && > + (rs->rs_if_dunit == ifp->if_dunit)) { > + /* Ok we found it */ > + return (rs); > + } > + } > + return (NULL); > +} > + > + > static const struct tcp_hwrate_limit_table * > rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t > bytes_per_sec, > - uint32_t flags, int *error) > + uint32_t flags, int *error, uint64_t *lower_rate) > { > /* First lets find the interface if it exists */ > const struct tcp_hwrate_limit_table *rte; > - struct tcp_rate_set *rs; > + /* > + * So why is rs volatile? This is to defeat a > + * compiler bug where in the compiler is convinced > + * that rs can never be NULL (which is not true). Because > + * of its conviction it nicely optimizes out the if ((rs == NULL > + * below which means if you get a NULL back you dereference it. > + */ > + volatile struct tcp_rate_set *rs; > struct epoch_tracker et; > + struct ifnet *oifp = ifp; > int err; > > NET_EPOCH_ENTER(et); > use_real_interface: > - CK_LIST_FOREACH(rs, &int_rs, next) { > - /* > - * Note we don't look with the lock since we either see a > - * new entry or will get one when we try to add it. > - */ > - if (rs->rs_flags & RS_IS_DEAD) { > - /* The dead are not looked at */ > - continue; > - } > - if ((rs->rs_ifp == ifp) && > - (rs->rs_if_dunit == ifp->if_dunit)) { > - /* Ok we found it */ > - break; > - } > - } > + rs = find_rs_for_ifp(ifp); > if ((rs == NULL) || > (rs->rs_flags & RS_INTF_NO_SUP) || > (rs->rs_flags & RS_IS_DEAD)) { > @@ -1063,14 +1164,14 @@ use_real_interface: > * might be arguable, but its impossible > * to tell from the departing case. > */ > - if (rs->rs_disable && error) > + if (error) > *error = ENODEV; > NET_EPOCH_EXIT(et); > return (NULL); > } > > if ((rs == NULL) || (rs->rs_disable != 0)) { > - if (rs->rs_disable && error) > + if (error) > *error = ENOSPC; > NET_EPOCH_EXIT(et); > return (NULL); > @@ -1086,6 +1187,10 @@ use_real_interface: > NET_EPOCH_EXIT(et); > return (NULL); > } > + KASSERT((tifp != ifp), > + ("Lookup failure ifp:%p inp:%p rt_find_real_interface() returns the same > interface tifp:%p?\n", > + ifp, inp, tifp)); > + ifp = tifp; > goto use_real_interface; > } > if (rs->rs_flow_limit && > @@ -1095,9 +1200,9 @@ use_real_interface: > NET_EPOCH_EXIT(et); > return (NULL); > } > - rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags); > + rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate); > if (rte) { > - err = in_pcbattach_txrtlmt(inp, rs->rs_ifp, > + err = in_pcbattach_txrtlmt(inp, oifp, > inp->inp_flowtype, > inp->inp_flowid, > rte->rate, > @@ -1107,6 +1212,11 @@ use_real_interface: > if (error) > *error = err; > 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)); > + counter_u64_add(rate_limit_new, 1); > } > } > if (rte) { > @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet > *ifp, int link_state) > { > int error; > struct tcp_rate_set *rs; > + struct epoch_tracker et; > > if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || > (link_state != LINK_STATE_UP)) { > @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet > *ifp, int link_state) > */ > return; > } > + NET_EPOCH_ENTER(et); > mtx_lock(&rs_mtx); > - CK_LIST_FOREACH(rs, &int_rs, next) { > - if ((rs->rs_ifp == ifp) && > - (rs->rs_if_dunit == ifp->if_dunit)) { > - /* We already have initialized this guy */ > - mtx_unlock(&rs_mtx); > - return; > - } > + rs = find_rs_for_ifp(ifp); > + if (rs) { > + /* We already have initialized this guy */ > + mtx_unlock(&rs_mtx); > + NET_EPOCH_EXIT(et); > + return; > } > mtx_unlock(&rs_mtx); > + NET_EPOCH_EXIT(et); > rt_setup_new_rs(ifp, &error); > } > > static void > tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) > { > - struct tcp_rate_set *rs, *nrs; > + struct tcp_rate_set *rs; > + struct epoch_tracker et; > int i; > > + NET_EPOCH_ENTER(et); > mtx_lock(&rs_mtx); > - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { > - if ((rs->rs_ifp == ifp) && > - (rs->rs_if_dunit == ifp->if_dunit)) { > - CK_LIST_REMOVE(rs, next); > - rs_number_alive--; > - rs->rs_flags |= RS_IS_DEAD; > - for (i = 0; i < rs->rs_rate_cnt; i++) { > - if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { > - in_pcbdetach_tag(rs->rs_rlt[i].tag); > - rs->rs_rlt[i].tag = NULL; > - } > - rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; > + rs = find_rs_for_ifp(ifp); > + if (rs) { > + CK_LIST_REMOVE(rs, next); > + rs_number_alive--; > + rs->rs_flags |= RS_IS_DEAD; > + for (i = 0; i < rs->rs_rate_cnt; i++) { > + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { > + in_pcbdetach_tag(rs->rs_rlt[i].tag); > + rs->rs_rlt[i].tag = NULL; > } > - if (rs->rs_flows_using == 0) > - rs_defer_destroy(rs); > - break; > + rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; > } > + if (rs->rs_flows_using == 0) > + rs_defer_destroy(rs); > } > mtx_unlock(&rs_mtx); > + NET_EPOCH_EXIT(et); > } > > static void > tcp_rl_shutdown(void *arg __unused, int howto __unused) > { > struct tcp_rate_set *rs, *nrs; > + struct epoch_tracker et; > int i; > > + NET_EPOCH_ENTER(et); > mtx_lock(&rs_mtx); > CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { > CK_LIST_REMOVE(rs, next); > @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int howto > __unused) > rs_defer_destroy(rs); > } > mtx_unlock(&rs_mtx); > + NET_EPOCH_EXIT(et); > } > > const struct tcp_hwrate_limit_table * > tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, > - uint64_t bytes_per_sec, int flags, int *error) > + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) > { > const struct tcp_hwrate_limit_table *rte; > #ifdef KERN_TLS > @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet > *ifp, > } > } > #endif > - rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error); > + rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error, > lower_rate); > + if (rte) > + rl_increment_using(rte); > #ifdef KERN_TLS > if (rte != NULL && tls != NULL && tls->snd_tag != NULL) { > /* > @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet > *ifp, > *error = EINVAL; > rte = NULL; > } > - tp->t_pacing_rate = rte->rate; > - *error = 0; > + if (rte != NULL) { > + tp->t_pacing_rate = rte->rate; > + *error = 0; > + } > return (rte); > } > > const struct tcp_hwrate_limit_table * > tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, > struct tcpcb *tp, struct ifnet *ifp, > - uint64_t bytes_per_sec, int flags, int *error) > + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) > { > const struct tcp_hwrate_limit_table *nrte; > const struct tcp_rate_set *rs; > #ifdef KERN_TLS > struct ktls_session *tls = NULL; > #endif > - int is_indirect = 0; > int err; > > INP_WLOCK_ASSERT(tp->t_inpcb); > @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct > tcp_hwrate_limit_table *crte, > if ((rs->rs_flags & RS_IS_DEAD) || > (crte->flags & HDWRPACE_IFPDEPARTED)) { > /* Release the rate, and try anew */ > -re_rate: > + > tcp_rel_pacing_rate(crte, tp); > nrte = tcp_set_pacing_rate(tp, ifp, > - bytes_per_sec, flags, error); > *** 386 LINES SKIPPED *** > _______________________________________________ > 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 Fri Jan 29 03:03: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 6C0024F9A33; Fri, 29 Jan 2021 03:03: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 4DRhxQ2Zq5z3kN9; Fri, 29 Jan 2021 03:03: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 4B6AF1B7B8; Fri, 29 Jan 2021 03:03: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 10T33ceu002351; Fri, 29 Jan 2021 03:03:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T33cwo002350; Fri, 29 Jan 2021 03:03:38 GMT (envelope-from git) Date: Fri, 29 Jan 2021 03:03:38 GMT Message-Id: <202101290303.10T33cwo002350@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: bf59049c27ef - main - du: tests: use dollar-single quotes where appropriate 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: bf59049c27ef86669a94ffd43f7216107b5c57ff 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, 29 Jan 2021 03:03:38 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bf59049c27ef86669a94ffd43f7216107b5c57ff commit bf59049c27ef86669a94ffd43f7216107b5c57ff Author: Kyle Evans AuthorDate: 2021-01-29 03:01:12 +0000 Commit: Kyle Evans CommitDate: 2021-01-29 03:02:58 +0000 du: tests: use dollar-single quotes where appropriate No need for "foo$(printf "\t")", $'\t' is both more readable and still functional. Reported-by: Jamie Landeg-Jones --- usr.bin/du/tests/du_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 92a26deae02b..1c283b58fef4 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -46,7 +46,7 @@ H_flag_body() { local paths1='testdir/A/B testdir/A testdir/C testdir' local paths2='testdir/C/B testdir/C' - local lineprefix="^[0-9]+$(printf "\t")" + local lineprefix=$'^[0-9]+\t' local sep="\$\n${lineprefix}" atf_check mkdir testdir From owner-dev-commits-src-main@freebsd.org Fri Jan 29 03:11: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 918934FA1F5; Fri, 29 Jan 2021 03:11:33 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 4DRj6X69Fwz3kqw; Fri, 29 Jan 2021 03:11:32 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf1-x42f.google.com with SMTP id w14so5346193pfi.2; Thu, 28 Jan 2021 19:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=RbfLezO11+fVy3VqF9SFeFsfyjAMFafOciZ+/DGiHP4=; b=J5wHfz4DN59/UTyz33lV2/wh/jREmXwzzi8j9H8K1/1qTq/x6MTcpavq2Rq5Zbm1kq vUm6uC/VwngYqkZvmBju8W49WXNCAgsOr2rkwH2QpmVY49nVfHHZBx6wC4NmmP/lxV2K LyoaCHit2vuVApRNuzyg7OimB4PovQg5J3g3gR3WRvsIvgV+1JkTj8UxP08gHNbgttSe XOgXMMD23KUhNKDFmPcId3UGLgqpCIpLJ2fdP7jKO4w3QmSF8mhYsRtrFpzOsWrZzhIi O+Iakr1opWtsux0pRtvNbJTfUDd2P6fvszq0Ewm94/ZAeGHPJ4ayPfmBfpq2u5MKwmB3 iwYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :reply-to:subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=RbfLezO11+fVy3VqF9SFeFsfyjAMFafOciZ+/DGiHP4=; b=e8i3MhuviiWrQ6NcTXC3QP4/AjmIg+EV4bw8qTMxsvc5WImXz7ii1h1o7JBaHpR5oz dvYXfsUBV+BSPtaJ5AhrUqiS+qrLgE3lDHhHihES4Hu0HdffyrvmP9dLY4R3780oR4DJ eW0nbGP0UaP7apWZ9XZCzTzfkQ+Prcc6GLgtpTl1GhpnlYeg2Qh8OfMpAiR+j3jHjArj HdYN0zXdv1n20wIBgR9naeMX9Eq5ow5YTHOsn9pZOeP6jTKZNVk9sc52Jn1b7SL2g6gO X6hyB9BP2wFXxSMiC9+daaLdvWQGFsg259E6eF1AthU8o9AqPNjlVKnHXc3m/Fow0XZ6 32bA== X-Gm-Message-State: AOAM533x97UMdof5rI5Pe6ucdC2kB5oTfU82P+sbIs85YBtc+AybS46m 7JsAEPip5hxOiGyLknwba/FeOzrpVrk= X-Google-Smtp-Source: ABdhPJzg8J7R07Y+nzOivROgoNuPna2uIitv7YbNLX1c7pb+B1lGREGf8xyOry4b/Wb75CwQ6gVF8Q== X-Received: by 2002:a63:1f1e:: with SMTP id f30mr2539146pgf.141.1611889890841; Thu, 28 Jan 2021 19:11:30 -0800 (PST) Received: from [192.168.1.109] (180-150-68-130.b49644.syd.nbn.aussiebb.net. [180.150.68.130]) by smtp.gmail.com with UTF8SMTPSA id b14sm5525982pfi.74.2021.01.28.19.11.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jan 2021 19:11:30 -0800 (PST) Sender: Kubilay Kocak Message-ID: <6be9d1bd-5180-e4f0-5f52-c50fdefbc5ec@FreeBSD.org> Date: Fri, 29 Jan 2021 14:11:05 +1100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Thunderbird/87.0a1 Reply-To: koobs@FreeBSD.org Subject: Re: git: 02ec31bdf60f - main - cache: add back target entry on rename Content-Language: en-US To: Mateusz Guzik , Oliver Pinter Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202101231810.10NIAKXd018767@gitrepo.freebsd.org> From: Kubilay Kocak In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DRj6X69Fwz3kqw X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=J5wHfz4D; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::42f as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [0.80 / 15.00]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::42f:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::42f:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::42f:from]; MAILMAN_DEST(0.00)[dev-commits-src-main,dev-commits-src-all] 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, 29 Jan 2021 03:11:33 -0000 On 24/01/2021 7:22 am, Mateusz Guzik wrote: > The sysctl at hand is temporary in case someone reports trouble -- > then they can flip it. I don't expect it to survive more than a month. > > On 1/23/21, Oliver Pinter wrote: >> On Saturday, January 23, 2021, Mateusz Guzik wrote: >> >>> The branch main has been updated by mjg: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id= >>> 02ec31bdf60fa3a8530544cb3c8c4ec1df6cde0d >>> >>> commit 02ec31bdf60fa3a8530544cb3c8c4ec1df6cde0d >>> Author: Mateusz Guzik >>> AuthorDate: 2021-01-23 17:21:42 +0000 >>> Commit: Mateusz Guzik >>> CommitDate: 2021-01-23 18:10:16 +0000 >>> >>> cache: add back target entry on rename >>> --- >>> sys/kern/vfs_cache.c | 19 +++++++++++++++++++ >>> 1 file changed, 19 insertions(+) >>> >>> diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c >>> index 770c8ebf061b..03bafc75acaa 100644 >>> --- a/sys/kern/vfs_cache.c >>> +++ b/sys/kern/vfs_cache.c >>> @@ -367,6 +367,10 @@ static bool __read_frequently cache_fast_revlookup = >>> true; >>> SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_revlookup, CTLFLAG_RW, >>> &cache_fast_revlookup, 0, ""); >>> >>> +static bool __read_mostly cache_rename_add = true; >>> +SYSCTL_BOOL(_vfs, OID_AUTO, cache_rename_add, CTLFLAG_RW, >>> + &cache_rename_add, 0, ""); >> >> >> It would be really if the description were filled with proper info. >> >> + >>> static u_int __exclusive_cache_line neg_cycle; >>> >>> #define ncneghash 3 >>> @@ -2731,6 +2735,21 @@ cache_vop_rename(struct vnode *fdvp, struct vnode >>> *fvp, struct vnode *tdvp, >>> } else { >>> cache_remove_cnp(tdvp, tcnp); >>> } >>> + >>> + /* >>> + * TODO >>> + * >>> + * Historically renaming was always purging all revelang entries, >>> + * but that's quite wasteful. In particular turns out that in >>> many >>> cases >>> + * the target file is immediately accessed after rename, inducing >>> a cache >>> + * miss. >>> + * >>> + * Recode this to reduce relocking and reuse the existing entry >>> (if any) >>> + * instead of just removing it above and allocating a new one >>> here. >>> + */ >>> + if (cache_rename_add) { >>> + cache_enter(tdvp, fvp, tcnp); >>> + } >>> } >>> >>> void >>> _______________________________________________ >>> 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" >>> >> > > Could we: description: "QA/Testing (temporary) tunable: " ? From owner-dev-commits-src-main@freebsd.org Fri Jan 29 05:52: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 B7D7F4FE277; Fri, 29 Jan 2021 05:52: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 4DRmh14v5Nz3tKd; Fri, 29 Jan 2021 05:52: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 9ADBE1DA35; Fri, 29 Jan 2021 05:52: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 10T5qH6d023736; Fri, 29 Jan 2021 05:52:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T5qHSl023735; Fri, 29 Jan 2021 05:52:17 GMT (envelope-from git) Date: Fri, 29 Jan 2021 05:52:17 GMT Message-Id: <202101290552.10T5qHSl023735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: c050ea803eaa - main - jail: Handle a parent jail when a child is added to it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c050ea803eaa1087313b86628b5d486c0e59e41b 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, 29 Jan 2021 05:52:17 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=c050ea803eaa1087313b86628b5d486c0e59e41b commit c050ea803eaa1087313b86628b5d486c0e59e41b Author: Jamie Gritton AuthorDate: 2021-01-29 05:51:09 +0000 Commit: Jamie Gritton CommitDate: 2021-01-29 05:51:09 +0000 jail: Handle a parent jail when a child is added to it It's possible when adding a jail that its dying parent comes back to life. Only allow that to happen when JAIL_DYING is specified. And if it does happen, call PR_METHOD_CREATE on it. --- sys/kern/kern_jail.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 064f1afa4133..ece0aa33e642 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1105,6 +1105,14 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) "jail \"%s\" not found", name); goto done_deref; } + if (!(flags & JAIL_DYING) && + !prison_isalive(ppr)) { + mtx_unlock(&ppr->pr_mtx); + error = ENOENT; + vfs_opterror(opts, + "jail \"%s\" is dying", name); + goto done_deref; + } mtx_unlock(&ppr->pr_mtx); *namelc = '.'; } @@ -1200,8 +1208,18 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) goto done_deref; } prison_hold(ppr); - refcount_acquire(&ppr->pr_uref); - mtx_unlock(&ppr->pr_mtx); + if (refcount_acquire(&ppr->pr_uref)) + mtx_unlock(&ppr->pr_mtx); + else { + /* This brings the parent back to life. */ + mtx_unlock(&ppr->pr_mtx); + error = osd_jail_call(ppr, PR_METHOD_CREATE, opts); + if (error) { + pr = ppr; + drflags |= PD_DEREF | PD_DEUREF; + goto done_deref; + } + } if (jid == 0 && (jid = get_next_prid(&inspr)) == 0) { error = EAGAIN; From owner-dev-commits-src-main@freebsd.org Fri Jan 29 07: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 4C3C94E016D; Fri, 29 Jan 2021 07: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 4DRpnZ1TTnz4T4X; Fri, 29 Jan 2021 07: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 251B81ED03; Fri, 29 Jan 2021 07: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 10T7REBF041743; Fri, 29 Jan 2021 07: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 10T7RE56041742; Fri, 29 Jan 2021 07:27:14 GMT (envelope-from git) Date: Fri, 29 Jan 2021 07:27:14 GMT Message-Id: <202101290727.10T7RE56041742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 07d218f70c2f - main - Now that the portsnap buildbox is generating the raw bits for INDEX-14, add it to the set of INDEX files built by portsnap. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07d218f70c2fdaf4ad78aaa14355be415ed58bce 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, 29 Jan 2021 07:27:14 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=07d218f70c2fdaf4ad78aaa14355be415ed58bce commit 07d218f70c2fdaf4ad78aaa14355be415ed58bce Author: Xin LI AuthorDate: 2021-01-29 07:25:19 +0000 Commit: Xin LI CommitDate: 2021-01-29 07:26:14 +0000 Now that the portsnap buildbox is generating the raw bits for INDEX-14, add it to the set of INDEX files built by portsnap. Switch to INDEX-14 for main. --- usr.sbin/portsnap/portsnap/portsnap.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/portsnap/portsnap/portsnap.conf b/usr.sbin/portsnap/portsnap/portsnap.conf index 9b7af2d5aec2..ab1d93c9b653 100644 --- a/usr.sbin/portsnap/portsnap/portsnap.conf +++ b/usr.sbin/portsnap/portsnap/portsnap.conf @@ -32,4 +32,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3aede40c98633216c330 # List of INDEX files to build and the DESCRIBE file to use for each #INDEX INDEX-11 DESCRIBE.11 #INDEX INDEX-12 DESCRIBE.12 -INDEX INDEX-13 DESCRIBE.13 +#INDEX INDEX-13 DESCRIBE.13 +INDEX INDEX-14 DESCRIBE.14 From owner-dev-commits-src-main@freebsd.org Fri Jan 29 09:20: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 548374E3A3E; Fri, 29 Jan 2021 09:20:11 +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 4DRsHv1rZmz4ZWw; Fri, 29 Jan 2021 09:20:11 +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 3242A1FE75; Fri, 29 Jan 2021 09:20:11 +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 10T9KBjk089147; Fri, 29 Jan 2021 09:20:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T9KB7L089140; Fri, 29 Jan 2021 09:20:11 GMT (envelope-from git) Date: Fri, 29 Jan 2021 09:20:11 GMT Message-Id: <202101290920.10T9KB7L089140@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: d4a6843bb120 - main - Update comment missed in 83ff5d5d98cbcf9b66dccd70022358aec8918a14 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: d4a6843bb1207d71234099ded81cee75d3ae8864 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, 29 Jan 2021 09:20:11 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d4a6843bb1207d71234099ded81cee75d3ae8864 commit d4a6843bb1207d71234099ded81cee75d3ae8864 Author: Alex Richardson AuthorDate: 2021-01-29 09:19:27 +0000 Commit: Alex Richardson CommitDate: 2021-01-29 09:19:27 +0000 Update comment missed in 83ff5d5d98cbcf9b66dccd70022358aec8918a14 Reported by: jrtc27 --- lib/msun/tests/trig_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/tests/trig_test.c b/lib/msun/tests/trig_test.c index ba1975721d3f..b725b0b9eb55 100644 --- a/lib/msun/tests/trig_test.c +++ b/lib/msun/tests/trig_test.c @@ -162,7 +162,7 @@ ATF_TC_BODY(reduction, tc) #if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 && \ __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 - atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); + atf_tc_expect_fail("test fails with clang 7-9 - bug 234040"); #endif for (i = 0; i < nitems(f_pi_odd); i++) { From owner-dev-commits-src-main@freebsd.org Fri Jan 29 09:31: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 0FBC94E3F67; Fri, 29 Jan 2021 09:31: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 4DRsYM74hqz4bJ8; Fri, 29 Jan 2021 09:31: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 E5E1F203E2; Fri, 29 Jan 2021 09:31: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 10T9VpFf010035; Fri, 29 Jan 2021 09:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T9Vp4W010034; Fri, 29 Jan 2021 09:31:51 GMT (envelope-from git) Date: Fri, 29 Jan 2021 09:31:51 GMT Message-Id: <202101290931.10T9Vp4W010034@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: 4d2edf3af1db - main - test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() 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: 4d2edf3af1dbd8a3e7cf1b22343a1ecfc2dd41ba 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, 29 Jan 2021 09:31:52 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2edf3af1dbd8a3e7cf1b22343a1ecfc2dd41ba commit 4d2edf3af1dbd8a3e7cf1b22343a1ecfc2dd41ba Author: Alex Richardson AuthorDate: 2021-01-29 09:28:40 +0000 Commit: Alex Richardson CommitDate: 2021-01-29 09:28:40 +0000 test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28396 --- lib/msun/tests/ctrig_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index b47ad43fa199..effc4cfce281 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -249,7 +249,7 @@ ATF_TC_BODY(test_inf_inputs, tc) unsigned i; if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244732"); + atf_tc_expect_fail("https://bugs.freebsd.org/244732"); /* * IN CSINH CCOSH CTANH From owner-dev-commits-src-main@freebsd.org Fri Jan 29 09:31: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 272974E3F6F; Fri, 29 Jan 2021 09:31: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 4DRsYP0ftXz4bWl; Fri, 29 Jan 2021 09:31: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 09B64205A2; Fri, 29 Jan 2021 09:31: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 10T9Vq21010058; Fri, 29 Jan 2021 09:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T9Vqeu010057; Fri, 29 Jan 2021 09:31:52 GMT (envelope-from git) Date: Fri, 29 Jan 2021 09:31:52 GMT Message-Id: <202101290931.10T9Vqeu010057@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: 892a05ee3a6a - main - Avoid double output in fenv_test 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: 892a05ee3a6abd8d84f46a1b895b1d2bf805d08a 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, 29 Jan 2021 09:31:53 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=892a05ee3a6abd8d84f46a1b895b1d2bf805d08a commit 892a05ee3a6abd8d84f46a1b895b1d2bf805d08a Author: Alex Richardson AuthorDate: 2021-01-29 09:29:26 +0000 Commit: Alex Richardson CommitDate: 2021-01-29 09:29:27 +0000 Avoid double output in fenv_test This tests fork()s, so if there is still data in the stdout buffer on fork it will print it again in the child process. This was happening in the CheriBSD CI and caused the test to complain about malformed TAP output. Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28397 --- lib/msun/tests/fenv_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index 9b615b100e8a..62abfefb4a8a 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -539,6 +539,8 @@ test_feholdupdate(void) int main(void) { + /* Avoid double output after fork() */ + setvbuf(stdout, NULL, _IONBF, 0); printf("1..8\n"); init_exceptsets(); From owner-dev-commits-src-main@freebsd.org Fri Jan 29 09:31: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 A89724E4300; Fri, 29 Jan 2021 09:31: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 4DRsYQ2cHfz4bZ0; Fri, 29 Jan 2021 09:31: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 32B70204B9; Fri, 29 Jan 2021 09:31: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 10T9Vs61010080; Fri, 29 Jan 2021 09:31:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T9Vs7B010079; Fri, 29 Jan 2021 09:31:54 GMT (envelope-from git) Date: Fri, 29 Jan 2021 09:31:54 GMT Message-Id: <202101290931.10T9Vs7B010079@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: 1d15bceae63c - main - tmpfs: implement pathconf(_PC_SYMLINK_MAX) 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: 1d15bceae63c438e3ff7dc7a0ca8a2c538e357b9 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, 29 Jan 2021 09:31:55 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1d15bceae63c438e3ff7dc7a0ca8a2c538e357b9 commit 1d15bceae63c438e3ff7dc7a0ca8a2c538e357b9 Author: Alex Richardson AuthorDate: 2021-01-29 09:30:25 +0000 Commit: Alex Richardson CommitDate: 2021-01-29 09:30:25 +0000 tmpfs: implement pathconf(_PC_SYMLINK_MAX) This fixes one of the sys/audit tests when running them on tmpfs. Reviewed By: delphij, kib Differential Revision: https://reviews.freebsd.org/D28387 --- sys/fs/tmpfs/tmpfs_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 7be2655dcf0b..94cb7fd868fa 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1609,6 +1609,10 @@ tmpfs_pathconf(struct vop_pathconf_args *v) *retval = TMPFS_LINK_MAX; break; + case _PC_SYMLINK_MAX: + *retval = MAXPATHLEN; + break; + case _PC_NAME_MAX: *retval = NAME_MAX; break; From owner-dev-commits-src-main@freebsd.org Fri Jan 29 11:07:24 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 6C9E54E7919; Fri, 29 Jan 2021 11:07:24 +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 4DRvgc2cDwz4kDv; Fri, 29 Jan 2021 11:07:24 +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 480BD21861; Fri, 29 Jan 2021 11:07:24 +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 10TB7OYu029424; Fri, 29 Jan 2021 11:07:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TB7OWA029423; Fri, 29 Jan 2021 11:07:24 GMT (envelope-from git) Date: Fri, 29 Jan 2021 11:07:24 GMT Message-Id: <202101291107.10TB7OWA029423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: abd619045a54 - main - __FreeBSD_version: update the references to the doc tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abd619045a54c73f41a95b3e038a5ba083391400 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, 29 Jan 2021 11:07:24 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=abd619045a54c73f41a95b3e038a5ba083391400 commit abd619045a54c73f41a95b3e038a5ba083391400 Author: Bjoern A. Zeeb AuthorDate: 2021-01-29 10:57:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-29 11:00:17 +0000 __FreeBSD_version: update the references to the doc tree Update the reference of which file to update in the doc tree when bumping __FreeBSD_version. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index c0d365a40f72..079357a19d47 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -52,7 +52,7 @@ * there. * Currently this lives here in the doc/ repository: * - * head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml + * documentation/content/en/books/porters-handbook/versions/chapter.adoc * * scheme is: Rxx * 'R' is in the range 0 to 4 if this is a release branch or From owner-dev-commits-src-main@freebsd.org Fri Jan 29 11:24: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 2B0A04E7BF7; Fri, 29 Jan 2021 11:24: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 4DRw2t0q2Gz4lVC; Fri, 29 Jan 2021 11:24: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 046AE215F4; Fri, 29 Jan 2021 11:24: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 10TBO55q054679; Fri, 29 Jan 2021 11:24:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TBO571054678; Fri, 29 Jan 2021 11:24:05 GMT (envelope-from git) Date: Fri, 29 Jan 2021 11:24:05 GMT Message-Id: <202101291124.10TBO571054678@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: eaad8d1303da - main - fd: add fget_only_user 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: eaad8d1303da500ed691bd774742a4555a05e729 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, 29 Jan 2021 11:24:06 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=eaad8d1303da500ed691bd774742a4555a05e729 commit eaad8d1303da500ed691bd774742a4555a05e729 Author: Mateusz Guzik AuthorDate: 2021-01-28 23:27:44 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-29 11:23:43 +0000 fd: add fget_only_user This can be used by single-threaded processes which don't share a file descriptor table to access their file objects without having to reference them. For example select consumers tend to match the requirement and have several file descriptors to inspect. --- sys/kern/kern_descrip.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++--- sys/sys/filedesc.h | 12 +++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 257b1de2a6ac..059e5123c7b5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1860,10 +1860,14 @@ fdgrowtable(struct filedesc *fdp, int nfd) * which must not be freed. */ if (onfiles > NDFILE) { - if (curproc->p_numthreads == 1 && - refcount_load(&fdp->fd_refcnt) == 1) + /* + * Note we may be called here from fdinit while allocating a + * table for a new process in which case ->p_fd points + * elsewhere. + */ + if (curproc->p_fd != fdp || FILEDESC_IS_ONLY_USER(fdp)) { free(otable, M_FILEDESC); - else { + } else { ft = (struct freetable *)&otable->fdt_ofiles[onfiles]; fdp0 = (struct filedesc0 *)fdp; ft->ft_table = otable; @@ -3176,6 +3180,66 @@ out_fallback: return (fget_unlocked_seq(fdp, fd, needrightsp, fpp, NULL)); } +/* + * Translate fd -> file when the caller guarantees the file descriptor table + * can't be changed by others. + * + * Note this does not mean the file object itself is only visible to the caller, + * merely that it wont disappear without having to be referenced. + * + * Must be paired with fput_only_user. + */ +#ifdef CAPABILITIES +int +fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp) +{ + const struct filedescent *fde; + const struct fdescenttbl *fdt; + const cap_rights_t *haverights; + struct file *fp; + int error; + + MPASS(FILEDESC_IS_ONLY_USER(fdp)); + + if (__predict_false(fd >= fdp->fd_nfiles)) + return (EBADF); + + fdt = fdp->fd_files; + fde = &fdt->fdt_ofiles[fd]; + fp = fde->fde_file; + if (__predict_false(fp == NULL)) + return (EBADF); + MPASS(refcount_load(&fp->f_count) > 0); + haverights = cap_rights_fde_inline(fde); + error = cap_check_inline(haverights, needrightsp); + if (__predict_false(error != 0)) + return (EBADF); + *fpp = fp; + return (0); +} +#else +int +fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp) +{ + struct file *fp; + + MPASS(FILEDESC_IS_ONLY_USER(fdp)); + + if (__predict_false(fd >= fdp->fd_nfiles)) + return (EBADF); + + fp = fdp->fd_ofiles[fd].fde_file; + if (__predict_false(fp == NULL)) + return (EBADF); + + MPASS(refcount_load(&fp->f_count) > 0); + *fpp = fp; + return (0); +} +#endif + /* * Extract the file pointer associated with the specified descriptor for the * current user process. diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 9b65c7a66054..890232b7f160 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -177,6 +177,11 @@ struct filedesc_to_leader { SX_NOTRECURSED) #define FILEDESC_UNLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_UNLOCKED) +#define FILEDESC_IS_ONLY_USER(fdp) ({ \ + struct filedesc *_fdp = (fdp); \ + MPASS(curproc->p_fd == _fdp); \ + (curproc->p_numthreads == 1 && refcount_load(&_fdp->fd_refcnt) == 1); \ +}) #else /* @@ -272,6 +277,13 @@ int fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp); int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp); +/* Return a file pointer without a ref. FILEDESC_IS_ONLY_USER must be true. */ +int fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp); +#define fput_only_user(fdp, fp) ({ \ + MPASS(FILEDESC_IS_ONLY_USER(fdp)); \ + MPASS(refcount_load(&fp->f_count) > 0); \ +}) /* Requires a FILEDESC_{S,X}LOCK held and returns without a ref. */ static __inline struct file * From owner-dev-commits-src-main@freebsd.org Fri Jan 29 11:24: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 456144E7E91; Fri, 29 Jan 2021 11:24:07 +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 4DRw2v1TTMz4lZr; Fri, 29 Jan 2021 11:24:07 +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 25C3421BBC; Fri, 29 Jan 2021 11:24:07 +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 10TBO7Ld054697; Fri, 29 Jan 2021 11:24:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TBO7HW054696; Fri, 29 Jan 2021 11:24:07 GMT (envelope-from git) Date: Fri, 29 Jan 2021 11:24:07 GMT Message-Id: <202101291124.10TBO7HW054696@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: 6affe1b71238 - main - select: employ fget_only_user 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: 6affe1b71238df7bbbca6e2059e5494d91e68d2d 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, 29 Jan 2021 11:24:07 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6affe1b71238df7bbbca6e2059e5494d91e68d2d commit 6affe1b71238df7bbbca6e2059e5494d91e68d2d Author: Mateusz Guzik AuthorDate: 2021-01-28 23:33:46 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-29 11:23:44 +0000 select: employ fget_only_user Since most select users are single-threaded this avoid a lot of work in the common case. For example select of 16 fds (ops/s): before: 2114536 after: 2991010 --- sys/kern/sys_generic.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index a055f4a9b597..dc2cd56f5077 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1304,13 +1304,6 @@ selsetbits(fd_mask **ibits, fd_mask **obits, int idx, fd_mask bit, int events) return (n); } -static __inline int -getselfd_cap(struct filedesc *fdp, int fd, struct file **fpp) -{ - - return (fget_unlocked(fdp, fd, &cap_event_rights, fpp)); -} - /* * Traverse the list of fds attached to this thread's seltd and check for * completion. @@ -1327,10 +1320,12 @@ selrescan(struct thread *td, fd_mask **ibits, fd_mask **obits) fd_mask bit; int fd, ev, n, idx; int error; + bool only_user; fdp = td->td_proc->p_fd; stp = td->td_sel; n = 0; + only_user = FILEDESC_IS_ONLY_USER(fdp); STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) { fd = (int)(uintptr_t)sfp->sf_cookie; si = sfp->sf_si; @@ -1338,13 +1333,19 @@ selrescan(struct thread *td, fd_mask **ibits, fd_mask **obits) /* If the selinfo wasn't cleared the event didn't fire. */ if (si != NULL) continue; - error = getselfd_cap(fdp, fd, &fp); - if (error) + if (only_user) + error = fget_only_user(fdp, fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) return (error); idx = fd / NFDBITS; bit = (fd_mask)1 << (fd % NFDBITS); ev = fo_poll(fp, selflags(ibits, idx, bit), td->td_ucred, td); - fdrop(fp, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); if (ev != 0) n += selsetbits(ibits, obits, idx, bit, ev); } @@ -1366,9 +1367,11 @@ selscan(struct thread *td, fd_mask **ibits, fd_mask **obits, int nfd) int ev, flags, end, fd; int n, idx; int error; + bool only_user; fdp = td->td_proc->p_fd; n = 0; + only_user = FILEDESC_IS_ONLY_USER(fdp); for (idx = 0, fd = 0; fd < nfd; idx++) { end = imin(fd + NFDBITS, nfd); for (bit = 1; fd < end; bit <<= 1, fd++) { @@ -1376,12 +1379,18 @@ selscan(struct thread *td, fd_mask **ibits, fd_mask **obits, int nfd) flags = selflags(ibits, idx, bit); if (flags == 0) continue; - error = getselfd_cap(fdp, fd, &fp); - if (error) + if (only_user) + error = fget_only_user(fdp, fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) return (error); selfdalloc(td, (void *)(uintptr_t)fd); ev = fo_poll(fp, flags, td->td_ucred, td); - fdrop(fp, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); if (ev != 0) n += selsetbits(ibits, obits, idx, bit, ev); } From owner-dev-commits-src-main@freebsd.org Fri Jan 29 11:24:09 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 1AB554E7B7F; Fri, 29 Jan 2021 11:24:09 +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 4DRw2w5QP3z4lDq; Fri, 29 Jan 2021 11:24:08 +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 6D38F21BBD; Fri, 29 Jan 2021 11:24:08 +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 10TBO8P0054722; Fri, 29 Jan 2021 11:24:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TBO842054721; Fri, 29 Jan 2021 11:24:08 GMT (envelope-from git) Date: Fri, 29 Jan 2021 11:24:08 GMT Message-Id: <202101291124.10TBO842054721@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: 45e1f8541428 - main - poll: use fget_unlocked or fget_only_user when feasible 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: 45e1f8541428c19f63dba65d78a8d138e1bc6915 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, 29 Jan 2021 11:24:10 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=45e1f8541428c19f63dba65d78a8d138e1bc6915 commit 45e1f8541428c19f63dba65d78a8d138e1bc6915 Author: Mateusz Guzik AuthorDate: 2021-01-28 23:52:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-29 11:23:44 +0000 poll: use fget_unlocked or fget_only_user when feasible This follows select by eleminating the use of filedesc lock. This is a win for single-threaded processes and a mixed bag for others as at small concurrency it is faster to take the lock instead of refing/unrefing each file descriptor. Nonetheless, removal of shared lock usage is a step towards a mtx-protected fd table. --- sys/kern/sys_generic.c | 75 ++++++++++++++++---------------------------------- 1 file changed, 24 insertions(+), 51 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index dc2cd56f5077..6fcdee7a088f 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1547,49 +1547,6 @@ sys_ppoll(struct thread *td, struct ppoll_args *uap) return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp)); } -#ifdef CAPABILITIES -static int -poll_fget(struct filedesc *fdp, int fd, struct file **fpp) -{ - const struct filedescent *fde; - const struct fdescenttbl *fdt; - const cap_rights_t *haverights; - struct file *fp; - int error; - - if (__predict_false(fd >= fdp->fd_nfiles)) - return (EBADF); - - fdt = fdp->fd_files; - fde = &fdt->fdt_ofiles[fd]; - fp = fde->fde_file; - if (__predict_false(fp == NULL)) - return (EBADF); - haverights = cap_rights_fde_inline(fde); - error = cap_check_inline(haverights, &cap_event_rights); - if (__predict_false(error != 0)) - return (EBADF); - *fpp = fp; - return (0); -} -#else -static int -poll_fget(struct filedesc *fdp, int fd, struct file **fpp) -{ - struct file *fp; - - if (__predict_false(fd >= fdp->fd_nfiles)) - return (EBADF); - - fp = fdp->fd_ofiles[fd].fde_file; - if (__predict_false(fp == NULL)) - return (EBADF); - - *fpp = fp; - return (0); -} -#endif - static int pollrescan(struct thread *td) { @@ -1600,12 +1557,13 @@ pollrescan(struct thread *td) struct filedesc *fdp; struct file *fp; struct pollfd *fd; - int n; + int n, error; + bool only_user; n = 0; fdp = td->td_proc->p_fd; stp = td->td_sel; - FILEDESC_SLOCK(fdp); + only_user = FILEDESC_IS_ONLY_USER(fdp); STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) { fd = (struct pollfd *)sfp->sf_cookie; si = sfp->sf_si; @@ -1613,7 +1571,11 @@ pollrescan(struct thread *td) /* If the selinfo wasn't cleared the event didn't fire. */ if (si != NULL) continue; - if (poll_fget(fdp, fd->fd, &fp) != 0) { + if (only_user) + error = fget_only_user(fdp, fd->fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fd->fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) { fd->revents = POLLNVAL; n++; continue; @@ -1623,10 +1585,13 @@ pollrescan(struct thread *td) * POLLERR if appropriate. */ fd->revents = fo_poll(fp, fd->events, td->td_ucred, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); if (fd->revents != 0) n++; } - FILEDESC_SUNLOCK(fdp); stp->st_flags = 0; td->td_retval[0] = n; return (0); @@ -1658,17 +1623,22 @@ pollscan(struct thread *td, struct pollfd *fds, u_int nfd) { struct filedesc *fdp; struct file *fp; - int i, n; + int i, n, error; + bool only_user; n = 0; fdp = td->td_proc->p_fd; - FILEDESC_SLOCK(fdp); + only_user = FILEDESC_IS_ONLY_USER(fdp); for (i = 0; i < nfd; i++, fds++) { if (fds->fd < 0) { fds->revents = 0; continue; } - if (poll_fget(fdp, fds->fd, &fp) != 0) { + if (only_user) + error = fget_only_user(fdp, fds->fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fds->fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) { fds->revents = POLLNVAL; n++; continue; @@ -1680,6 +1650,10 @@ pollscan(struct thread *td, struct pollfd *fds, u_int nfd) selfdalloc(td, fds); fds->revents = fo_poll(fp, fds->events, td->td_ucred, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); /* * POSIX requires POLLOUT to be never * set simultaneously with POLLHUP. @@ -1690,7 +1664,6 @@ pollscan(struct thread *td, struct pollfd *fds, u_int nfd) if (fds->revents != 0) n++; } - FILEDESC_SUNLOCK(fdp); td->td_retval[0] = n; return (0); } From owner-dev-commits-src-main@freebsd.org Fri Jan 29 11:38: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 627D24E85F3; Fri, 29 Jan 2021 11:38: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 4DRwMw2LdZz4mmm; Fri, 29 Jan 2021 11:38: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 4297D21F1B; Fri, 29 Jan 2021 11:38: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 10TBcq4f068940; Fri, 29 Jan 2021 11:38:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TBcqVV068939; Fri, 29 Jan 2021 11:38:52 GMT (envelope-from git) Date: Fri, 29 Jan 2021 11:38:52 GMT Message-Id: <202101291138.10TBcqVV068939@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: ebc61c86b556 - main - netgraph/ng_source: Switch queuing 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: ebc61c86b5567f2e5a3c5f452e86879b558b376b 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, 29 Jan 2021 11:38:52 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=ebc61c86b5567f2e5a3c5f452e86879b558b376b commit ebc61c86b5567f2e5a3c5f452e86879b558b376b Author: Lutz Donnerhacke AuthorDate: 2021-01-29 11:03:17 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-01-29 11:34:53 +0000 netgraph/ng_source: Switch queuing framework Change the queuing framework from ifq to mbufq. Reported by: glebius Reviewed by: glebius, kp Approved by: kp (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28407 --- sys/netgraph/ng_source.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c index 4bde62e5898a..0eee9ceb25c5 100644 --- a/sys/netgraph/ng_source.c +++ b/sys/netgraph/ng_source.c @@ -85,7 +85,7 @@ struct privdata { hook_p input; hook_p output; struct ng_source_stats stats; - struct ifqueue snd_queue; /* packets to send */ + struct mbufq snd_queue; /* packets to send */ struct mbuf *last_packet; /* last pkt in queue */ struct ifnet *output_ifp; struct callout intr_ch; @@ -284,7 +284,7 @@ ng_source_constructor(node_p node) NG_NODE_SET_PRIVATE(node, sc); sc->node = node; - sc->snd_queue.ifq_maxlen = 2048; + mbufq_init(&sc->snd_queue, 2048); ng_callout_init(&sc->intr_ch); return (0); @@ -374,7 +374,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) goto done; } sc->stats.queueOctets = sc->queueOctets; - sc->stats.queueFrames = sc->snd_queue.ifq_len; + sc->stats.queueFrames = mbufq_len(&sc->snd_queue); if ((sc->node->nd_flags & NG_SOURCE_ACTIVE) && !timevalisset(&sc->stats.endTime)) { getmicrotime(&sc->stats.elapsedTime); @@ -568,11 +568,11 @@ ng_source_rcvdata(hook_p hook, item_p item) KASSERT(hook == sc->input, ("%s: no hook!", __func__)); /* Enqueue packet if the queue isn't full. */ - if (_IF_QFULL(&sc->snd_queue)) { + error = mbufq_enqueue(&sc->snd_queue, m); + if (error) { NG_FREE_M(m); - return (ENOBUFS); + return (error); } - _IF_ENQUEUE(&sc->snd_queue, m); sc->queueOctets += m->m_pkthdr.len; sc->last_packet = m; @@ -671,7 +671,7 @@ ng_source_clr_data (sc_p sc) struct mbuf *m; for (;;) { - _IF_DEQUEUE(&sc->snd_queue, m); + m = mbufq_dequeue(&sc->snd_queue); if (m == NULL) break; NG_FREE_M(m); @@ -744,7 +744,7 @@ ng_source_intr(node_p node, hook_p hook, void *arg1, int arg2) ifq = (struct ifqueue *)&sc->output_ifp->if_snd; packets = ifq->ifq_maxlen - ifq->ifq_len; } else - packets = sc->snd_queue.ifq_len; + packets = mbufq_len(&sc->snd_queue); if (sc->stats.maxPps != 0) { struct timeval now, elapsed; @@ -788,7 +788,7 @@ ng_source_send(sc_p sc, int tosend, int *sent_p) /* Go through the queue sending packets one by one. */ for (sent = 0; error == 0 && sent < tosend; ++sent) { - _IF_DEQUEUE(&sc->snd_queue, m); + m = mbufq_dequeue(&sc->snd_queue); if (m == NULL) break; @@ -796,14 +796,20 @@ ng_source_send(sc_p sc, int tosend, int *sent_p) error = ng_source_dup_mod(sc, m, &m2); if (error) { if (error == ENOBUFS) - _IF_PREPEND(&sc->snd_queue, m); + mbufq_prepend(&sc->snd_queue, m); else - _IF_ENQUEUE(&sc->snd_queue, m); + (void)mbufq_enqueue(&sc->snd_queue, m); break; } - /* Re-enqueue the original packet for us. */ - _IF_ENQUEUE(&sc->snd_queue, m); + /* + * Re-enqueue the original packet for us. The queue + * has a free slot, because we dequeued the packet + * above and this callout function runs under WRITER + * lock. + */ + error = mbufq_enqueue(&sc->snd_queue, m); + KASSERT(error == 0, ("%s: re-enqueue packet failed", __func__)); sc->stats.outFrames++; sc->stats.outOctets += m2->m_pkthdr.len; From owner-dev-commits-src-main@freebsd.org Fri Jan 29 14:28:57 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 145AB4EDD2B; Fri, 29 Jan 2021 14:28:57 +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 4DS089023Vz3Cq2; Fri, 29 Jan 2021 14:28: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 E7D9323DEE; Fri, 29 Jan 2021 14:28: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 10TESuZV090320; Fri, 29 Jan 2021 14:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TESuW7090319; Fri, 29 Jan 2021 14:28:56 GMT (envelope-from git) Date: Fri, 29 Jan 2021 14:28:56 GMT Message-Id: <202101291428.10TESuW7090319@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: b6d85a5f51e4 - main - stand/multiboot: adjust the protocol between loader and kernel 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: b6d85a5f51e4147452b35d76478fb9e191b7734b 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, 29 Jan 2021 14:28:57 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=b6d85a5f51e4147452b35d76478fb9e191b7734b commit b6d85a5f51e4147452b35d76478fb9e191b7734b Author: Roger Pau Monné AuthorDate: 2021-01-27 10:12:07 +0000 Commit: Roger Pau Monné CommitDate: 2021-01-29 14:23:26 +0000 stand/multiboot: adjust the protocol between loader and kernel There's a currently ad-hoc protocol to hand off the FreeBSD kernel payload between the loader and the kernel itself when Xen is in the middle of the picture. Such protocol wasn't very resilient to changes to the loader itself, because it relied on moving metadata around to package it using a certain layout. This has proven to be fragile, so replace it with a more robust version. The new protocol requires using a xen_header structure that will be used to pass data between the FreeBSD loader and the FreeBSD kernel when booting in dom0 mode. At the moment the only data conveyed is the offset of the start of the module metadata relative to the start of the module itself. This is a slightly disruptive change since it also requires a change to the kernel which is contained in this patch. In order to update with this change the kernel must be updated before updating the loader, as described in the handbook. Note this is only required when booting a FreeBSD/Xen dom0. This change doesn't affect the normal FreeBSD boot protocol. This fixes booting FreeBSD/Xen in dom0 mode after 3630506b9daec9167a89bc4525638ea45a00769e. Sponsored by: Citrix Systems R&D MFC after: 3 days Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D28411 --- stand/i386/libi386/multiboot.c | 156 +++++++++++------------------------------ sys/x86/include/metadata.h | 21 ++++++ sys/x86/xen/pv.c | 67 +++++++++++++----- 3 files changed, 111 insertions(+), 133 deletions(-) diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c index a29696e4baec..71fd63bb4c88 100644 --- a/stand/i386/libi386/multiboot.c +++ b/stand/i386/libi386/multiboot.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #define _MACHINE_ELF_WANT_32BIT #include +#include #include #include @@ -55,11 +56,6 @@ __FBSDID("$FreeBSD$"); #define MULTIBOOT_SUPPORTED_FLAGS \ (MULTIBOOT_PAGE_ALIGN|MULTIBOOT_MEMORY_INFO) #define NUM_MODULES 2 -#define METADATA_FIXED_SIZE (PAGE_SIZE*4) -#define METADATA_MODULE_SIZE PAGE_SIZE - -#define METADATA_RESV_SIZE(mod_num) \ - roundup(METADATA_FIXED_SIZE + METADATA_MODULE_SIZE * mod_num, PAGE_SIZE) extern int elf32_loadfile_raw(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot); @@ -81,32 +77,6 @@ extern void multiboot_tramp(); static const char mbl_name[] = "FreeBSD Loader"; -static int -num_modules(struct preloaded_file *kfp) -{ - struct kernel_module *kmp; - int mod_num = 0; - - for (kmp = kfp->f_modules; kmp != NULL; kmp = kmp->m_next) - mod_num++; - - return (mod_num); -} - -static vm_offset_t -max_addr(void) -{ - struct preloaded_file *fp; - vm_offset_t addr = 0; - - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - if (addr < (fp->f_addr + fp->f_size)) - addr = fp->f_addr + fp->f_size; - } - - return (addr); -} - static int multiboot_loadfile(char *filename, uint64_t dest, struct preloaded_file **result) @@ -188,7 +158,6 @@ out: static int multiboot_exec(struct preloaded_file *fp) { - vm_offset_t module_start, last_addr, metadata_size; vm_offset_t modulep, kernend, entry; struct file_metadata *md; Elf_Ehdr *ehdr; @@ -197,6 +166,9 @@ multiboot_exec(struct preloaded_file *fp) char *cmdline = NULL; size_t len; int error, mod_num; + struct xen_header header; + + CTASSERT(sizeof(header) <= PAGE_SIZE); /* * Don't pass the memory size found by the bootloader, the memory @@ -260,13 +232,11 @@ multiboot_exec(struct preloaded_file *fp) * FreeBSD kernel loaded as a raw file. The second module is going * to contain the metadata info and the loaded modules. * - * On native FreeBSD loads all the modules and then places the - * metadata info at the end, but this is painful when running on Xen, - * because it relocates the second multiboot module wherever it - * likes. In order to workaround this limitation the metadata - * information is placed at the start of the second module and - * the original modulep value is saved together with the other - * metadata, so we can relocate everything. + * There's a small header prefixed in the second module that contains + * some information required to calculate the relocated address of + * modulep based on the original offset of modulep from the start of + * the module address. Note other fields might be added to this header + * if required. * * Native layout: * fp->f_addr + fp->f_size @@ -277,27 +247,16 @@ multiboot_exec(struct preloaded_file *fp) * +---------+----------------+------------+ * fp->f_addr modulep kernend * - * Xen layout: - * - * Initial: - * fp->f_addr + fp->f_size - * +---------+----------+----------------+------------+ - * | | | | | - * | Kernel | Reserved | Modules | Metadata | - * | | | | dry run | - * +---------+----------+----------------+------------+ - * fp->f_addr - * - * After metadata polacement (ie: final): - * fp->f_addr + fp->f_size - * +-----------+---------+----------+----------------+ - * | | | | | - * | Kernel | Free | Metadata | Modules | - * | | | | | - * +-----------+---------+----------+----------------+ - * fp->f_addr modulep kernend - * \__________/ \__________________________/ - * Multiboot module 0 Multiboot module 1 + * Xen dom0 layout: + * fp->f_addr fp->f_addr + fp->f_size + * +---------+------------+----------------+------------+ + * | | | | | + * | Kernel | xen_header | Modules | Metadata | + * | | | | | + * +---------+------------+----------------+------------+ + * modulep kernend + * \________/\__________________________________________/ + * module 0 module 1 */ fp = file_findfile(NULL, "elf kernel"); @@ -307,13 +266,6 @@ multiboot_exec(struct preloaded_file *fp) goto error; } - if (fp->f_metadata != NULL) { - printf("FreeBSD kernel already contains metadata, aborting\n"); - error = EINVAL; - goto error; - } - - mb_mod = malloc(sizeof(struct multiboot_mod_list) * NUM_MODULES); if (mb_mod == NULL) { error = ENOMEM; @@ -322,61 +274,34 @@ multiboot_exec(struct preloaded_file *fp) bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES); - /* - * Calculate how much memory is needed for the metatdata. We did - * an approximation of the maximum size when loading the kernel, - * but now we know the exact size, so we can release some of this - * preallocated memory if not needed. - */ - last_addr = roundup(max_addr(), PAGE_SIZE); - mod_num = num_modules(fp); - - /* - * Place the metadata after the last used address in order to - * calculate it's size, this will not be used. - */ - error = bi_load64(fp->f_args, last_addr, &modulep, &kernend, 0); + error = bi_load64(fp->f_args, 0, &modulep, &kernend, 0); if (error != 0) { printf("bi_load64 failed: %d\n", error); goto error; } - metadata_size = roundup(kernend - last_addr, PAGE_SIZE); - /* Check that the size is not greater than what we have reserved */ - if (metadata_size > METADATA_RESV_SIZE(mod_num)) { - printf("Required memory for metadata is greater than reserved " - "space, please increase METADATA_FIXED_SIZE and " - "METADATA_MODULE_SIZE and rebuild the loader\n"); + mb_mod[0].mod_start = fp->f_addr; + mb_mod[0].mod_end = fp->f_addr + fp->f_size - PAGE_SIZE; + + mb_mod[1].mod_start = mb_mod[0].mod_end; + mb_mod[1].mod_end = kernend; + /* Indicate the kernel metadata is prefixed with a xen_header. */ + cmdline = strdup("header"); + if (cmdline == NULL) { + printf("Out of memory, aborting\n"); error = ENOMEM; goto error; } - - /* Clean the metadata added to the kernel in the bi_load64 dry run */ - file_removemetadata(fp); - - /* - * This is the position where the second multiboot module - * will be placed. - */ - module_start = fp->f_addr + fp->f_size - metadata_size; - - error = bi_load64(fp->f_args, module_start, &modulep, &kernend, 0); - if (error != 0) { - printf("bi_load64 failed: %d\n", error); - goto error; - } - - mb_mod[0].mod_start = fp->f_addr; - mb_mod[0].mod_end = fp->f_addr + fp->f_size; - mb_mod[0].mod_end -= METADATA_RESV_SIZE(mod_num); - - mb_mod[1].mod_start = module_start; - mb_mod[1].mod_end = last_addr; + mb_mod[1].cmdline = VTOP(cmdline); mb_info->mods_count = NUM_MODULES; mb_info->mods_addr = VTOP(mb_mod); mb_info->flags |= MULTIBOOT_INFO_MODS; + header.flags = XENHEADER_HAS_MODULEP_OFFSET; + header.modulep_offset = modulep - mb_mod[1].mod_start; + archsw.arch_copyin(&header, mb_mod[1].mod_start, sizeof(header)); + dev_cleanup(); __exec((void *)VTOP(multiboot_tramp), (void *)entry, (void *)VTOP(mb_info)); @@ -434,17 +359,14 @@ multiboot_obj_loadfile(char *filename, uint64_t dest, return (EINVAL); } + /* - * Save space at the end of the kernel in order to place - * the metadata information. We do an approximation of the - * max metadata size, this is not optimal but it's probably - * the best we can do at this point. Once all modules are - * loaded and the size of the metadata is known this - * space will be recovered if not used. + * Reserve one page at the end of the kernel to place some + * metadata in order to cope for Xen relocating the modules and + * the metadata information. */ - mod_num = num_modules(rfp); rfp->f_size = roundup(rfp->f_size, PAGE_SIZE); - rfp->f_size += METADATA_RESV_SIZE(mod_num); + rfp->f_size += PAGE_SIZE; *result = rfp; } else { /* The rest should be loaded as regular modules */ diff --git a/sys/x86/include/metadata.h b/sys/x86/include/metadata.h index d157df0307fd..be0eae43d34c 100644 --- a/sys/x86/include/metadata.h +++ b/sys/x86/include/metadata.h @@ -68,4 +68,25 @@ struct vbe_fb { uint32_t fb_bpp; }; +/* + * The structure below is used when FreeBSD kernel is booted as a dom0 kernel + * from Xen. In such scenario we need to accommodate the modules and the + * metadata as a contiguous memory region, so it can be passed as a multiboot + * module, and some extra information is required which is conveyed from the + * loader to the kernel using the xen_header structure below. + * + * See the comment in multiboot.c about how the structure below is packaged + * together with the rest of the kernel payload data. + */ +struct xen_header { + uint64_t flags; +#define XENHEADER_HAS_MODULEP_OFFSET (1ull << 0) + + /* + * Offset of the modulep location from the start of the multiboot + * module blob. + */ + uint64_t modulep_offset; +}; + #endif /* !_MACHINE_METADATA_H_ */ diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index 34fcbd990491..2fd698772f9d 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -568,25 +568,60 @@ xen_pvh_parse_preload_data(uint64_t modulep) if (start_info->modlist_paddr != 0) { struct hvm_modlist_entry *mod; + const char *cmdline; mod = (struct hvm_modlist_entry *) (start_info->modlist_paddr + KERNBASE); - preload_metadata = (caddr_t)(mod[0].paddr + KERNBASE); - - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - KASSERT(kmdp != NULL, ("unable to find kernel")); - - /* - * Xen has relocated the metadata and the modules, - * so we need to recalculate it's position. This is - * done by saving the original modulep address and - * then calculating the offset with mod_start, - * which contains the relocated modulep address. - */ - metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, vm_paddr_t); - off = mod[0].paddr + KERNBASE - metadata; + cmdline = mod[0].cmdline_paddr ? + (const char *)(mod[0].cmdline_paddr + KERNBASE) : NULL; + + if (strcmp(cmdline, "header") == 0) { + struct xen_header *header; + + header = (struct xen_header *)(mod[0].paddr + KERNBASE); + + if ((header->flags & XENHEADER_HAS_MODULEP_OFFSET) != + XENHEADER_HAS_MODULEP_OFFSET) { + xc_printf("Unable to load module metadata\n"); + HYPERVISOR_shutdown(SHUTDOWN_crash); + } + + preload_metadata = (caddr_t)(mod[0].paddr + + header->modulep_offset + KERNBASE); + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + if (kmdp == NULL) { + xc_printf("Unable to find kernel\n"); + HYPERVISOR_shutdown(SHUTDOWN_crash); + } + + /* + * Xen has relocated the metadata and the modules, so + * we need to recalculate it's position. This is done + * by saving the original modulep address and then + * calculating the offset from the real modulep + * position. + */ + metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, + vm_paddr_t); + off = mod[0].paddr + header->modulep_offset - metadata + + KERNBASE; + } else { + preload_metadata = (caddr_t)(mod[0].paddr + KERNBASE); + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + if (kmdp == NULL) { + xc_printf("Unable to find kernel\n"); + HYPERVISOR_shutdown(SHUTDOWN_crash); + } + + metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, vm_paddr_t); + off = mod[0].paddr + KERNBASE - metadata; + } preload_bootstrap_relocate(off); From owner-dev-commits-src-main@freebsd.org Fri Jan 29 14:29: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 160594EDE92; Fri, 29 Jan 2021 14:29: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 4DS0976z32z3DG6; Fri, 29 Jan 2021 14:29: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 E2344240CD; Fri, 29 Jan 2021 14:29: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 10TETl3p090562; Fri, 29 Jan 2021 14:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TETlxn090561; Fri, 29 Jan 2021 14:29:47 GMT (envelope-from git) Date: Fri, 29 Jan 2021 14:29:47 GMT Message-Id: <202101291429.10TETlxn090561@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: fcb4797c90f3 - main - Cirrus-CI: Use the default Git history depth 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: fcb4797c90f3f62a18b67542ae5b576a1271e6d4 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, 29 Jan 2021 14:29:48 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fcb4797c90f3f62a18b67542ae5b576a1271e6d4 commit fcb4797c90f3f62a18b67542ae5b576a1271e6d4 Author: Fedor Korotkov AuthorDate: 2021-01-29 14:22:54 +0000 Commit: Ed Maste CommitDate: 2021-01-29 14:29:30 +0000 Cirrus-CI: Use the default Git history depth Which is `50`. I saw a few errors like `Failed to force reset to SHA: object not found!` which seems is happening because the SHA is not available because there were two commits pushed almost simultaneously and the second from the top fails with this error because the SHA is not in the history. Pull Request: https://github.com/freebsd/freebsd-src/pull/454 --- .cirrus.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 71bd02a2ca8c..a35b40c113b4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,9 +7,6 @@ freebsd_instance: cpu: 8 memory: 24G -env: - CIRRUS_CLONE_DEPTH: 1 - task: only_if: $CIRRUS_BRANCH != 'svn_head' timeout_in: 120m From owner-dev-commits-src-main@freebsd.org Fri Jan 29 14:38: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 E819D4EE1C8; Fri, 29 Jan 2021 14:38: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 4DS0Mf6FdRz3DsL; Fri, 29 Jan 2021 14:38: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 C9654241D2; Fri, 29 Jan 2021 14:38: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 10TEcsZF003464; Fri, 29 Jan 2021 14:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TEcsjH003463; Fri, 29 Jan 2021 14:38:54 GMT (envelope-from git) Date: Fri, 29 Jan 2021 14:38:54 GMT Message-Id: <202101291438.10TEcsjH003463@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: f17fc5439f51 - main - Cirrus-CI: remove svn2git remnant 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: f17fc5439f517d06ac8976f53354789cde5a7427 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, 29 Jan 2021 14:38:55 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f17fc5439f517d06ac8976f53354789cde5a7427 commit f17fc5439f517d06ac8976f53354789cde5a7427 Author: Ed Maste AuthorDate: 2021-01-29 14:34:27 +0000 Commit: Ed Maste CommitDate: 2021-01-29 14:37:47 +0000 Cirrus-CI: remove svn2git remnant Previously Cirrus was skipped on svn_head to avoid running CI on two different branches with identical content. With the transition to git this serves no purpose. Reported by: kevans Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index a35b40c113b4..ce6f8202a6d8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,7 +8,6 @@ freebsd_instance: memory: 24G task: - only_if: $CIRRUS_BRANCH != 'svn_head' timeout_in: 120m install_script: - pkg install -y qemu42 uefi-edk2-qemu-x86_64 llvm11 From owner-dev-commits-src-main@freebsd.org Fri Jan 29 15: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 8D31C4EED9C; Fri, 29 Jan 2021 15:06:46 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DS0zm6mCYz3Gbr; Fri, 29 Jan 2021 15:06:44 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1611932801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4b2ziIeUyvB5DOMVR6Yiguiv1spZsyq4DpriYe5e8Hc=; b=FtOra0YTyVPAWRjJF2SJBsGJowXAR89LaZD/SdDTYB1bVnG5U6Jzy/eqhK7CbWOmGuWyNo 1mZSVWVLq9IoA9HF4xw+hufJCWGz9UhGEMqmPPYoKohB4wniyiJ1HGSP1O2DgVvM6VOJ7O SsijPOz95fHqsKknVOOSNEBk+PFGTpU= Received: from skull.home.blih.net (lfbn-idf2-1-745-114.w86-247.abo.wanadoo.fr [86.247.192.114]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 04806492 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 29 Jan 2021 15:06:41 +0000 (UTC) Date: Fri, 29 Jan 2021 16:06:39 +0100 From: Emmanuel Vadot To: Glen Barber Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-Id: <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> In-Reply-To: <202101140002.10E0211m024446@gitrepo.freebsd.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DS0zm6mCYz3Gbr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=FtOra0YT; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-1.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SPAMHAUS_ZRD(0.00)[212.83.155.74:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.83.155.74:from]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; 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: Fri, 29 Jan 2021 15:06:46 -0000 Hi Glen, On Thu, 14 Jan 2021 00:02:01 GMT Glen Barber wrote: > The branch main has been updated by gjb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > Author: Glen Barber > AuthorDate: 2021-01-14 00:01:30 +0000 > Commit: Glen Barber > CommitDate: 2021-01-14 00:01:30 +0000 > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > Sponsored by: Rubicon Communications, LLC (netgate.com) > --- > sys/conf/newvers.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > index b8667844210b..2a0ace45f2f6 100644 > --- a/sys/conf/newvers.sh > +++ b/sys/conf/newvers.sh > @@ -54,7 +54,7 @@ > > TYPE="FreeBSD" > REVISION="13.0" > -BRANCH="CURRENT" > +BRANCH="ALPHA1" > if [ -n "${BRANCH_OVERRIDE}" ]; then > BRANCH=${BRANCH_OVERRIDE} > fi So since ALPHA1 we do not have new GCP images. Is that intended ? Also there is no 14.0 snapshot while there was some new 11/12 images and no 13-ALPHA3 too it seems. Could you clarify the situation on this please ? Cheers, -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Fri Jan 29 16:07: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 B608B4F0A90; Fri, 29 Jan 2021 16:07:10 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DS2KV4h8sz3Kkx; Fri, 29 Jan 2021 16:07:10 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1611936430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pt9TDAsikQ7c5OePyd+hm4SkbHrH8oD65QBgZWr0HK8=; b=dQMtItowzOvqpEeQCwE0SnPPJQjecLcj9z++dizbEaLCmPcwBClXtRO6LQWuZGGbCKMCpT 7hkquYcXtqqt0+Mv1n/7WH7KqbbwM3wAoyX/JRAAUdgIgocFFpBAMxQMqTi2RuBejZwZS9 lATX035zP09TosA2l494Tp3v8d+AjoH5vbrxTJJ5T4/1+YeIs4bQEBE75yI0rPs0uxd2cD Y2cGI6k/APk4CUf9n7f3Mofy4nPtkq7VW4KRjXZI+XAqipxSCau73+2NU53smzVsdip0Cp ogw+0OGELMecN4n62ntUv9WeVNeBfJ8x2pLNiyZuFxKJFfimskoF/gR8izvbrw== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 3184E7C86; Fri, 29 Jan 2021 16:07:10 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Fri, 29 Jan 2021 16:07:08 +0000 From: Glen Barber To: Emmanuel Vadot Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-ID: <20210129160708.GR77557@FreeBSD.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CCT1URigZHXF2ubj" Content-Disposition: inline In-Reply-To: <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1611936430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pt9TDAsikQ7c5OePyd+hm4SkbHrH8oD65QBgZWr0HK8=; b=EkUk3uBDnmJ4zPEqOeumrah5linrF2xTM6/pAOMbDHH4ReucAO9d72gVqkLPKNhEmMcmkx AVzz+c6uDId/G3yMkv6LUyPwVZAPg4YYo7nZeLZrQE1ljDemQBe2vWhyLopsnty1EhsYOM UGQ3rKOF5faid/GJ/zwmmLmrapEpvUSVJn21eVm2Dv9ydaDlRBXuowTNZ/OT7kpFsyik2t 0NJN/cLN0dlJ/vDmi+7w8CTCMP1s+LxZ9u2NRo0oCUmBp8o+K0u1F3ZwMEJdR9i37e87bT Pygpm7lfGcE5hZkuIlAAz82rnqP2uHWALgon4Q8VmXVAfbKEIbJ95NbEnSSQfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1611936430; a=rsa-sha256; cv=none; b=gaqklWnjIsr3q02g8lMfSVdovxCfvTc2jP/NppvBoC4O+nH8vv7vadf0xh7HVt+N25X+zk OE5kOng31jADiftQI2SWdqQyqnqwqFQsCuS/g5F8i7jNJsJ0A+aU8hq+0j9GAWNaVuVOHW VAEdf6WIHclbPs6+aytsGPwqPzmFV8NYG5LGWKZ33/4l+Ul+IsqrafvEBJqhkYKMY2O0n7 vG1zGgoOIxW6nYLO3hfERQ2eAA4Sm3ourzYqn/8QGs/MsLGVnTie45wUms/888YrxTzaqR uUfFhi+34b4CKLn/q3PDuWO7jBYICltyfpePaeFZZdcDhJhIbN7rM8Ga6PrY0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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, 29 Jan 2021 16:07:10 -0000 --CCT1URigZHXF2ubj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 29, 2021 at 04:06:39PM +0100, Emmanuel Vadot wrote: >=20 > Hi Glen, >=20 > On Thu, 14 Jan 2021 00:02:01 GMT > Glen Barber wrote: >=20 > > The branch main has been updated by gjb: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7ae27c2d6c4fe4f21e1219bb= 5d8a37cfc932337b > >=20 > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > Author: Glen Barber > > AuthorDate: 2021-01-14 00:01:30 +0000 > > Commit: Glen Barber > > CommitDate: 2021-01-14 00:01:30 +0000 > >=20 > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > =20 > > Sponsored by: Rubicon Communications, LLC (netgate.com) > > --- > > sys/conf/newvers.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > > index b8667844210b..2a0ace45f2f6 100644 > > --- a/sys/conf/newvers.sh > > +++ b/sys/conf/newvers.sh > > @@ -54,7 +54,7 @@ > > =20 > > TYPE=3D"FreeBSD" > > REVISION=3D"13.0" > > -BRANCH=3D"CURRENT" > > +BRANCH=3D"ALPHA1" > > if [ -n "${BRANCH_OVERRIDE}" ]; then > > BRANCH=3D${BRANCH_OVERRIDE} > > fi >=20 > So since ALPHA1 we do not have new GCP images. > Is that intended ? >=20 I see 13.0-ALPHA3 GCE images: NAME PROJECT FAMILY DEPRECATED = STATUS freebsd-13-0-alpha3-amd64 freebsd-org-cloud-dev freebsd-13-0 = READY > Also there is no 14.0 snapshot while there was some new 11/12 images > and no 13-ALPHA3 too it seems. Right. We likely will not have 14-CURRENT builds until releng/13.0 is branched. 13.0-ALPHA3 was built a day later so it is ready for Friday, the same as is done for BETA* and RC* builds. > Could you clarify the situation on this please ? >=20 Glen --CCT1URigZHXF2ubj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmAUMqwACgkQAxRYpUeP 4pO4BQ/6A4kFtk+8etkHZTImxNfZLAkN1Fki2RFnx8sEQrcQlEk2WsO6rNaOXbFY bPPFvIJD8RgSJAGDdL8e+/w/2wpC6jJSXaxqwy8PvBRBnnDa7uFI3rd/zjNY246U Cumb4U/gmeynzmRMfehIzHxQ5dCI1pZLRAt0NZcbxA6LPanUcRdH8IQvxIuGELMf 15tAaA8XgXGupdSFRZ7p1U1v9T/rVxFR1+i0sSksoe6dDZPqhRYsGk7Jt/P41VlM gTmQpggtquC5ByilJ/bsAMTqmUB99QPBEIsYOjLygOaSzec1F3LbO+jB9PVl4Rv5 soxh8Sh9Z0IQiIhv8RRweIzTY5p6eb1rUNGz4gTlAXJ86tOayluU2Sgn0GDwFntb 9XrdpQ9aBl0JLLTSC8Ty829VsxnbNaLnYOjIhwyLlGgtN2eUXu7P3iHm1hbUrmr2 TdVDcDvzRDwQnQBbap9C9tDQt+5W7rJt1UzAkkKfiPyKjig4btDED6VY30UJUs4t CaEecjCJekNh86cY0mbyms7oEkqZy/NQxhJLPTRwoRurrF8vQId9BzIc4e8h2QQk i1b8Vm3vJBwtDhXxwDBBEPte8vDjv34s5dkuPpa6RC+hHdbWTxhONp3EzLSdoI+C UrYcQ5HUwyIrvKqDKE21LdcDvKH98cEIiKeCawDHIi07/9BQsy8= =BTq7 -----END PGP SIGNATURE----- --CCT1URigZHXF2ubj-- From owner-dev-commits-src-main@freebsd.org Fri Jan 29 16:26: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 087D44F0FF1; Fri, 29 Jan 2021 16:26: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 4DS2mB6qnKz3M2f; Fri, 29 Jan 2021 16:26: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 D90AD25C92; Fri, 29 Jan 2021 16:26: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 10TGQoqN046833; Fri, 29 Jan 2021 16:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TGQos3046832; Fri, 29 Jan 2021 16:26:50 GMT (envelope-from git) Date: Fri, 29 Jan 2021 16:26:50 GMT Message-Id: <202101291626.10TGQos3046832@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: 80a840b8ba03 - main - Revert "Cirrus-CI: Use the default Git history depth" 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: 80a840b8ba03bafe299112e2364959d937a87fe1 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, 29 Jan 2021 16:26:51 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=80a840b8ba03bafe299112e2364959d937a87fe1 commit 80a840b8ba03bafe299112e2364959d937a87fe1 Author: Ed Maste AuthorDate: 2021-01-29 16:22:03 +0000 Commit: Ed Maste CommitDate: 2021-01-29 16:22:03 +0000 Revert "Cirrus-CI: Use the default Git history depth" This reverts commit fcb4797c90f3f62a18b67542ae5b576a1271e6d4. With `CIRRUS_CLONE_DEPTH` unspecified (using the default of 50) the time to clone the repo increased from a little under 2 minutes to over 6 minutes, possibly due to additional processing required by GitHub. We will want to watch out for occasional `Failed to force reset to SHA: object not found!` errors. --- .cirrus.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index ce6f8202a6d8..c577ca8aeca3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,6 +7,9 @@ freebsd_instance: cpu: 8 memory: 24G +env: + CIRRUS_CLONE_DEPTH: 1 + task: timeout_in: 120m install_script: From owner-dev-commits-src-main@freebsd.org Fri Jan 29 16:28: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 E9BA14F1781; Fri, 29 Jan 2021 16:28:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DS2pB5MfNz3M1C; Fri, 29 Jan 2021 16:28:34 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1611937709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dzzTP67BJ2OpxWhxhD0mjZAx9i0XeymceKOHuP+43vA=; b=hxigjM3wFa08MCxcSLox2hNeL1ekSlm0n8ybLR2/SG79qOBF2gyBAli4Oq2IwIm2Q0ooqI dgyjxoHjv88tz3tCjXG/9J4KTT+ZFGJbnF/IviI19JaMZEvDMC40DDvYmzDtc1Gr6l23RM Drth2VR9LR2abcsF56V7mXehWiNDmj0= Received: from skull.home.blih.net (lfbn-idf2-1-745-114.w86-247.abo.wanadoo.fr [86.247.192.114]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 5c794401 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 29 Jan 2021 16:28:29 +0000 (UTC) Date: Fri, 29 Jan 2021 17:28:29 +0100 From: Emmanuel Vadot To: Glen Barber Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-Id: <20210129172829.a5508a3f415baf47acd2fe8c@bidouilliste.com> In-Reply-To: <20210129160708.GR77557@FreeBSD.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> <20210129160708.GR77557@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DS2pB5MfNz3M1C X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=hxigjM3w; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-1.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SPAMHAUS_ZRD(0.00)[212.83.155.74:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.83.155.74:from]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; 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: Fri, 29 Jan 2021 16:28:36 -0000 On Fri, 29 Jan 2021 16:07:08 +0000 Glen Barber wrote: > On Fri, Jan 29, 2021 at 04:06:39PM +0100, Emmanuel Vadot wrote: > > > > Hi Glen, > > > > On Thu, 14 Jan 2021 00:02:01 GMT > > Glen Barber wrote: > > > > > The branch main has been updated by gjb: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > Author: Glen Barber > > > AuthorDate: 2021-01-14 00:01:30 +0000 > > > Commit: Glen Barber > > > CommitDate: 2021-01-14 00:01:30 +0000 > > > > > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > > > > > Sponsored by: Rubicon Communications, LLC (netgate.com) > > > --- > > > sys/conf/newvers.sh | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > > > index b8667844210b..2a0ace45f2f6 100644 > > > --- a/sys/conf/newvers.sh > > > +++ b/sys/conf/newvers.sh > > > @@ -54,7 +54,7 @@ > > > > > > TYPE="FreeBSD" > > > REVISION="13.0" > > > -BRANCH="CURRENT" > > > +BRANCH="ALPHA1" > > > if [ -n "${BRANCH_OVERRIDE}" ]; then > > > BRANCH=${BRANCH_OVERRIDE} > > > fi > > > > So since ALPHA1 we do not have new GCP images. > > Is that intended ? > > > > I see 13.0-ALPHA3 GCE images: > > NAME PROJECT FAMILY DEPRECATED STATUS > freebsd-13-0-alpha3-amd64 freebsd-org-cloud-dev freebsd-13-0 READY Ah sorry, no idea how I missed it. Anyhow when I try to use it in cirrus-ci I have : Failed to start an instance: INVALID_ARGUMENT: Not Found Tested with the full name freebsd-13-0-alpha3-amd64 and the small name freebsd-13-0. Any tips on that ? > > Also there is no 14.0 snapshot while there was some new 11/12 images > > and no 13-ALPHA3 too it seems. > > Right. We likely will not have 14-CURRENT builds until releng/13.0 is > branched. 13.0-ALPHA3 was built a day later so it is ready for Friday, > the same as is done for BETA* and RC* builds. Ok, I indeed see some alpha3 images on the ftp but I don't see any for armv7 or aarch64, was there any problems ? > > Could you clarify the situation on this please ? > > > > Glen > -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Fri Jan 29 16:40: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 05BB84F187E; Fri, 29 Jan 2021 16:40:29 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DS33w6kG2z3MsD; Fri, 29 Jan 2021 16:40:28 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1611938429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WuNbvMn01oooVBBr+Kc+gnZS7O1ZppHG5+SRgW8RlJ8=; b=kRG8n/aP5Pu0IRU+uxP8CxQJZpAHmITBEPDwgSUhKejmSSGObpzNJTZmVVoVNhdNMlEuDj hzZlnNd+GAVquYE/7FBGxY/KY28oko6TJLWSWE98YR3kwcVqb2wKduWTjdhxduUJj1MLMj a+BOLYXcP5OjtX4wGSOdqXT477rSSQP5tq47958xcb0pdwVUdc3aNXg+i3w8bV9zdQ5ZM7 aNLTq1voARDr1iZz09qhgTLQlr1R3/lWJnisEy0rr5uuT7aiN3Qv0m6Gn0OdGmVqWmQYLJ 1zXXNF5BiHltudqwVdeswA57MDzGdv/HDaK6w92ke4WLpXKgAhjrQtyGNdzfrQ== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 6BFCF838E; Fri, 29 Jan 2021 16:40:28 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Fri, 29 Jan 2021 16:40:25 +0000 From: Glen Barber To: Emmanuel Vadot Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-ID: <20210129164025.GS77557@FreeBSD.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> <20210129160708.GR77557@FreeBSD.org> <20210129172829.a5508a3f415baf47acd2fe8c@bidouilliste.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uRJ407LMRYUmu53i" Content-Disposition: inline In-Reply-To: <20210129172829.a5508a3f415baf47acd2fe8c@bidouilliste.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1611938428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WuNbvMn01oooVBBr+Kc+gnZS7O1ZppHG5+SRgW8RlJ8=; b=AfApoxv2pEY1D6Q9ac6QhLPnCwDgQ4yP9+pu9D+DuLtT7N14hnnWp2pyUSu3XZVYyQhHFV tFR8vChspKR6e3hJtdyrDgInkg4zoUBGnotCDjS541nHz2cjQr95A0wQk7jkqBXYDzcRmu Vu2MptBV7UxT9EkQzO16WJpvM3NPFembvqoUrNVXDwhl+ZihSWZPVw3rOjODOdKzh+Pnqz YsexqhTwgqGeWLb+xn1MjPl/JOKg6ovFWEfmhrUDZ/X7KMSQpTPU1o5c1cORNSlNLrX0W7 AsleRC5y7cW8tSVEa6hpkCIbq40EKH9HzGIy4+GwgyZNLUjWP/Xt64/k34KdwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1611938428; a=rsa-sha256; cv=none; b=BBY61IFb1vh+nowwYU4afnUFULV+yAZIP+BHIXuvadxH7h/h76mOh0ZJXgITJTzbKLLYO2 iottt4Lh2oasxsQsrdi+gQM5crYi40/jTP1iQmRDgzHartN7Oon0/xSuOk2VD96jUprDO8 gKSqaFjjLBTe+DzW/0EXRwbDDTAkB+nqEJtaD745Sydf6kqTQ8aR8hvqeepg1CqD982lsD MnJ0nYpxmFnURwqGpvshqzgsD7dK2V/jKPld1IlomZonSx0G6BrxF+hiT9kDwzx23qj8/p TcWVSRJiZP16sQiYnl5fDZO3W+da4ekjJUr4E+Y5vZQUMVApfoWXwgg/IHeu7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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, 29 Jan 2021 16:40:29 -0000 --uRJ407LMRYUmu53i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 29, 2021 at 05:28:29PM +0100, Emmanuel Vadot wrote: > On Fri, 29 Jan 2021 16:07:08 +0000 > Glen Barber wrote: >=20 > > On Fri, Jan 29, 2021 at 04:06:39PM +0100, Emmanuel Vadot wrote: > > >=20 > > > Hi Glen, > > >=20 > > > On Thu, 14 Jan 2021 00:02:01 GMT > > > Glen Barber wrote: > > >=20 > > > > The branch main has been updated by gjb: > > > >=20 > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7ae27c2d6c4fe4f21e12= 19bb5d8a37cfc932337b > > > >=20 > > > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > Author: Glen Barber > > > > AuthorDate: 2021-01-14 00:01:30 +0000 > > > > Commit: Glen Barber > > > > CommitDate: 2021-01-14 00:01:30 +0000 > > > >=20 > > > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > > > =20 > > > > Sponsored by: Rubicon Communications, LLC (netgate.com) > > > > --- > > > > sys/conf/newvers.sh | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > >=20 > > > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > > > > index b8667844210b..2a0ace45f2f6 100644 > > > > --- a/sys/conf/newvers.sh > > > > +++ b/sys/conf/newvers.sh > > > > @@ -54,7 +54,7 @@ > > > > =20 > > > > TYPE=3D"FreeBSD" > > > > REVISION=3D"13.0" > > > > -BRANCH=3D"CURRENT" > > > > +BRANCH=3D"ALPHA1" > > > > if [ -n "${BRANCH_OVERRIDE}" ]; then > > > > BRANCH=3D${BRANCH_OVERRIDE} > > > > fi > > >=20 > > > So since ALPHA1 we do not have new GCP images. > > > Is that intended ? > > >=20 > >=20 > > I see 13.0-ALPHA3 GCE images: > >=20 > > NAME PROJECT FAMILY DEPRECA= TED STATUS > > freebsd-13-0-alpha3-amd64 freebsd-org-cloud-dev freebsd-13-0 = READY >=20 > Ah sorry, no idea how I missed it. > Anyhow when I try to use it in cirrus-ci I have : > Failed to start an instance: INVALID_ARGUMENT: Not Found >=20 > Tested with the full name freebsd-13-0-alpha3-amd64 and the small name > freebsd-13-0. Any tips on that ? >=20 Hmm, I am not sure. I do not see any errors (i.e., from installing ports or the like) in the log. > > > Also there is no 14.0 snapshot while there was some new 11/12 images > > > and no 13-ALPHA3 too it seems. > >=20 > > Right. We likely will not have 14-CURRENT builds until releng/13.0 is > > branched. 13.0-ALPHA3 was built a day later so it is ready for Friday, > > the same as is done for BETA* and RC* builds. >=20 > Ok, I indeed see some alpha3 images on the ftp but I don't see any for > armv7 or aarch64, was there any problems ? >=20 Yes, all arm builds failed because of a problem in the ports tree. -------------------------- begin quoted text --------------------------- Installing gettext-tools-0.21... =3D=3D=3D> p5-Locale-gettext-1.07 depends on executable: msgfmt - found =3D=3D=3D> Returning to build of p5-Locale-gettext-1.07 =3D=3D=3D> p5-Locale-gettext-1.07 depends on package: perl5>=3D5.32.r0<5.= 33 - found =3D=3D=3D> p5-Locale-gettext-1.07 depends on shared library: libintl.so -= found (/usr/local/lib/libintl.so) =3D=3D=3D> Configuring for p5-Locale-gettext-1.07 env: /usr/local/bin/perl5.32.1: No such file or directory *** Error code 127 --------------------------- end quoted text ---------------------------- Glen --uRJ407LMRYUmu53i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmAUOnkACgkQAxRYpUeP 4pM4eg//UeIH2ZmM/6o53/TInoe/Kci8ddnsTKVG6ZhBExl/l7ojLay8spA9AWRg OXQHeYNqQtHKBpegU/RR4u9hCm17cEdlqwrl858jng6K+LF/Tb9Bg5H5N4R0cF2y 2nwRKUrPx8RhVk6kQlkCWQNp+gnKgz9ri+j71QJ2SXvYOAnXJoLXVFSxePz+eSKF W9vwkev/EgDp3nW0JzoKJjBO1FALHee4sC/KeCJhjsxYnGIDVPrlSwuzFINEAdlU MVlqEoqr9uvPJCOHKJsVoJEGuZ+GzFravkj2xB2h/X+NRes0Ks6j9/LUK8dNY4mk 6ElFFC3ujX6k3gc6BE7kC6WK6eLOVP1euv8nB5tVB8yPQ03VlnhN45+lPmEQu+oj BkZ5DcoRtoSLCgbjZBonHt2GUIZ3VWJgNExwiKEtMa8+VXPB5MQwHNGB+tV/k+kr i+Rc69MSV5kZceRuYfwyDyPaLv7h83z5a39LGFkzhSBFWlSh9Uc+eqCH17rDVMMZ eZWDLgtUndgkuY0wFwRTq27cA0dDb7yjrUckriYbJ3XNVQg3sbjVwy/sx81gOgMJ Dy67jKuea41CsXMD3+BvczA9gmu3BiBKz3J69sEk6CMhHDye+2CL/yCEvkXqUvMB gs2W06Z2QbHm5CHQni3u7+PzWllpQmCHK6DMawIN8nC6vT/XjoM= =0ZHa -----END PGP SIGNATURE----- --uRJ407LMRYUmu53i-- From owner-dev-commits-src-main@freebsd.org Fri Jan 29 18:47: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 8E9504F58F9; Fri, 29 Jan 2021 18:47: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 4DS5tg3cm9z3mPb; Fri, 29 Jan 2021 18:47: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 6D67627742; Fri, 29 Jan 2021 18:47: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 10TIldJQ030064; Fri, 29 Jan 2021 18:47:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TIldN4030063; Fri, 29 Jan 2021 18:47:39 GMT (envelope-from git) Date: Fri, 29 Jan 2021 18:47:39 GMT Message-Id: <202101291847.10TIldN4030063@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: e25ee296c919 - main - stand: lua: enhance lfs.dir() to speed up kernels_autodetect 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: e25ee296c919d6567aa76058a7049eac974797fb 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, 29 Jan 2021 18:47:39 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e25ee296c919d6567aa76058a7049eac974797fb commit e25ee296c919d6567aa76058a7049eac974797fb Author: Kyle Evans AuthorDate: 2021-01-24 01:32:38 +0000 Commit: Kyle Evans CommitDate: 2021-01-29 18:47:29 +0000 stand: lua: enhance lfs.dir() to speed up kernels_autodetect This eliminates a lot of stat() calls that happen when lualoader renders the menu with the default settings, and greatly speeds up rendering on my laptop. ftype is nil if loader/loader.efi hasn't been updated yet, falling back to lfs.attributes() to test. This is technically incompatible with lfs, but not in a particularly terrible way. Reviewed-by: cem MFC-after: 4 days Differential Revision: https://reviews.freebsd.org/D27542 --- libexec/flua/modules/lfs.c | 28 +++++++++++++++++++++++++++- stand/lua/core.lua | 8 ++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/libexec/flua/modules/lfs.c b/libexec/flua/modules/lfs.c index 52a30c1515a9..e36c78d3b35b 100644 --- a/libexec/flua/modules/lfs.c +++ b/libexec/flua/modules/lfs.c @@ -122,6 +122,27 @@ __FBSDID("$FreeBSD$"); #define DIR_METATABLE "directory iterator metatable" +static int +lua_dir_iter_pushtype(lua_State *L __unused, const struct dirent *ent __unused) +{ + + /* + * This is a non-standard extension to luafilesystem for loader's + * benefit. The extra stat() calls to determine the entry type can + * be quite expensive on some systems, so this speeds up enumeration of + * /boot greatly by providing the type up front. + * + * This extension is compatible enough with luafilesystem, in that we're + * just using an extra return value for the iterator. + */ +#ifdef _STANDALONE + lua_pushinteger(L, ent->d_type); + return 1; +#else + return 0; +#endif +} + static int lua_dir_iter_next(lua_State *L) { @@ -144,7 +165,7 @@ lua_dir_iter_next(lua_State *L) } lua_pushstring(L, entry->d_name); - return 1; + return 1 + lua_dir_iter_pushtype(L, entry); } static int @@ -420,5 +441,10 @@ luaopen_lfs(lua_State *L) { register_metatable(L); luaL_newlib(L, fslib); +#ifdef _STANDALONE + /* Non-standard extension for loader, used with lfs.dir(). */ + lua_pushinteger(L, DT_DIR); + lua_setfield(L, -2, "DT_DIR"); +#endif return 1; } diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 9d331bc0ad3a..a119c3c258f8 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -240,14 +240,18 @@ function core.kernelList() -- Automatically detect other bootable kernel directories using a -- heuristic. Any directory in /boot that contains an ordinary file -- named "kernel" is considered eligible. - for file in lfs.dir("/boot") do + for file, ftype in lfs.dir("/boot") do local fname = "/boot/" .. file if file == "." or file == ".." then goto continue end - if lfs.attributes(fname, "mode") ~= "directory" then + if ftype then + if ftype ~= lfs.DT_DIR then + goto continue + end + elseif lfs.attributes(fname, "mode") ~= "directory" then goto continue end From owner-dev-commits-src-main@freebsd.org Fri Jan 29 18:56: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 A8F9A4F616B; Fri, 29 Jan 2021 18:56: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 4DS6524Pqtz3n87; Fri, 29 Jan 2021 18:56: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 7D3C4277BB; Fri, 29 Jan 2021 18:56: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 10TIuc1T042866; Fri, 29 Jan 2021 18:56:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TIucrW042865; Fri, 29 Jan 2021 18:56:38 GMT (envelope-from git) Date: Fri, 29 Jan 2021 18:56:38 GMT Message-Id: <202101291856.10TIucrW042865@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: 9d4104b21496 - main - Fix ldd to work with more ELF files. 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: 9d4104b214963bb3371ada05cae8006940121634 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, 29 Jan 2021 18:56:38 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9d4104b214963bb3371ada05cae8006940121634 commit 9d4104b214963bb3371ada05cae8006940121634 Author: John Baldwin AuthorDate: 2021-01-29 18:53:50 +0000 Commit: John Baldwin CommitDate: 2021-01-29 18:53:50 +0000 Fix ldd to work with more ELF files. - Use libelf to parse ELF data structures and remove code duplication for ELF32. - Don't require the OSABI field to be set to the FreeBSD OSABI for shared libraries. Both AArch64 and RISC-V leave it set to "none" and instead depend on the ABI tag note. For ldd, this means falling back to walking the notes in PT_NOTE segments to find the ABI tag note to determine if an ELF shared library without OSABI set in the header file is a FreeBSD shared library. Reviewed by: kib MFC after: 5 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D28342 --- usr.bin/ldd/Makefile | 2 + usr.bin/ldd/ldd.c | 335 ++++++++++++++++++++++++++++----------------------- 2 files changed, 187 insertions(+), 150 deletions(-) diff --git a/usr.bin/ldd/Makefile b/usr.bin/ldd/Makefile index 5d2beb7bb6c0..78e551d80a33 100644 --- a/usr.bin/ldd/Makefile +++ b/usr.bin/ldd/Makefile @@ -3,4 +3,6 @@ PROG?= ldd SRCS= ldd.c +LIBADD= elf + .include diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index 08c91d829bd7..f948b7312863 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.c @@ -33,6 +33,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -43,6 +44,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include @@ -259,179 +263,210 @@ usage(void) exit(1); } -static int -is_executable(const char *fname, int fd, int *is_shlib, int *type) +static bool +has_freebsd_abi_tag(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, + size_t len) { - union { -#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) - Elf32_Ehdr elf32; -#endif - Elf_Ehdr elf; - } hdr; - Elf_Phdr phdr, dynphdr; - Elf_Dyn *dynp; - void *dyndata; -#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) - Elf32_Phdr phdr32, dynphdr32; - Elf32_Dyn *dynp32; -#endif - int df1pie, dynamic, i, n; - - *is_shlib = 0; - *type = TYPE_UNKNOWN; - df1pie = 0; + Elf_Data dst, src; + const Elf_Note *note; + char *buf; + const char *name; + void *copy; + size_t namesz, descsz; + bool has_abi_tag; + + buf = elf_rawfile(elf, NULL); + if (buf == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (false); + } - if ((n = read(fd, &hdr, sizeof(hdr))) == -1) { - warn("%s: can't read program header", fname); - return (0); + memset(&src, 0, sizeof(src)); + src.d_buf = buf + offset; + src.d_size = len; + src.d_type = ELF_T_NOTE; + src.d_version = EV_CURRENT; + + memset(&dst, 0, sizeof(dst)); + dst.d_buf = copy = malloc(len); + dst.d_size = len; + dst.d_type = ELF_T_NOTE; + dst.d_version = EV_CURRENT; + + if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { + warnx("%s: failed to parse notes: %s", fname, elf_errmsg(0)); + free(copy); + return (false); } -#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) - if ((size_t)n >= sizeof(hdr.elf32) && IS_ELF(hdr.elf32) && - hdr.elf32.e_ident[EI_CLASS] == ELFCLASS32) { - /* Handle 32 bit ELF objects */ + buf = copy; + has_abi_tag = false; + for (;;) { + if (len < sizeof(*note)) + break; - dynamic = 0; - *type = TYPE_ELF32; + note = (const void *)buf; + buf += sizeof(*note); + len -= sizeof(*note); - if (lseek(fd, hdr.elf32.e_phoff, SEEK_SET) == -1) { - warnx("%s: header too short", fname); - return (0); - } - for (i = 0; i < hdr.elf32.e_phnum; i++) { - if (read(fd, &phdr32, hdr.elf32.e_phentsize) != - sizeof(phdr32)) { - warnx("%s: can't read program header", fname); - return (0); - } - if (phdr32.p_type == PT_DYNAMIC) { - dynamic = 1; - dynphdr32 = phdr32; - break; - } - } + namesz = roundup2(note->n_namesz, sizeof(uint32_t)); + descsz = roundup2(note->n_descsz, sizeof(uint32_t)); + if (len < namesz + descsz) + break; - if (!dynamic) { - warnx("%s: not a dynamic ELF executable", fname); - return (0); + name = buf; + if (note->n_namesz == sizeof(ELF_NOTE_FREEBSD) && + strncmp(name, ELF_NOTE_FREEBSD, note->n_namesz) == 0 && + note->n_type == NT_FREEBSD_ABI_TAG && + note->n_descsz == sizeof(uint32_t)) { + has_abi_tag = true; + break; } - if (hdr.elf32.e_type == ET_DYN) { - if (lseek(fd, dynphdr32.p_offset, SEEK_SET) == -1) { - warnx("%s: dynamic segment out of range", - fname); - return (0); - } - dyndata = malloc(dynphdr32.p_filesz); - if (dyndata == NULL) { - warn("malloc"); - return (0); - } - if (read(fd, dyndata, dynphdr32.p_filesz) != - (ssize_t)dynphdr32.p_filesz) { - free(dyndata); - warnx("%s: can't read dynamic segment", fname); - return (0); - } - for (dynp32 = dyndata; dynp32->d_tag != DT_NULL; - dynp32++) { - if (dynp32->d_tag != DT_FLAGS_1) - continue; - df1pie = (dynp32->d_un.d_val & DF_1_PIE) != 0; - break; - } - free(dyndata); + buf += namesz + descsz; + len -= namesz + descsz; + } - if (hdr.elf32.e_ident[EI_OSABI] == ELFOSABI_FREEBSD) { - if (!df1pie) - *is_shlib = 1; - return (1); - } - warnx("%s: not a FreeBSD ELF shared object", fname); - return (0); - } + free(copy); + return (has_abi_tag); +} - return (1); +static bool +is_pie(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, size_t len) +{ + Elf_Data dst, src; + char *buf; + void *copy; + const GElf_Dyn *dyn; + size_t dynsize; + u_int count, i; + bool pie; + + buf = elf_rawfile(elf, NULL); + if (buf == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (false); } -#endif - if ((size_t)n >= sizeof(hdr.elf) && IS_ELF(hdr.elf) && - hdr.elf.e_ident[EI_CLASS] == ELF_TARG_CLASS) { - /* Handle default ELF objects on this architecture */ + dynsize = gelf_fsize(elf, ELF_T_DYN, 1, EV_CURRENT); + if (dynsize == 0) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (false); + } + count = len / dynsize; + + memset(&src, 0, sizeof(src)); + src.d_buf = buf + offset; + src.d_size = len; + src.d_type = ELF_T_DYN; + src.d_version = EV_CURRENT; + + memset(&dst, 0, sizeof(dst)); + dst.d_buf = copy = malloc(count * sizeof(*dyn)); + dst.d_size = count * sizeof(*dyn); + dst.d_type = ELF_T_DYN; + dst.d_version = EV_CURRENT; + + if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { + warnx("%s: failed to parse .dynamic: %s", fname, elf_errmsg(0)); + free(copy); + return (false); + } + + dyn = copy; + pie = false; + for (i = 0; i < count; i++) { + if (dyn[i].d_tag != DT_FLAGS_1) + continue; + + pie = (dyn[i].d_un.d_val & DF_1_PIE) != 0; + break; + } + + free(copy); + return (pie); +} + +static int +is_executable(const char *fname, int fd, int *is_shlib, int *type) +{ + Elf *elf; + GElf_Ehdr ehdr; + GElf_Phdr phdr; + bool dynamic, freebsd, pie; + int i; + + *is_shlib = 0; + *type = TYPE_UNKNOWN; + dynamic = false; + freebsd = false; + pie = false; + + if (elf_version(EV_CURRENT) == EV_NONE) { + warnx("unsupported libelf"); + return (0); + } + elf = elf_begin(fd, ELF_C_READ, NULL); + if (elf == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (0); + } + if (elf_kind(elf) != ELF_K_ELF) { + elf_end(elf); + warnx("%s: not a dynamic ELF executable", fname); + return (0); + } + if (gelf_getehdr(elf, &ehdr) == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + elf_end(elf); + return (0); + } - dynamic = 0; - *type = TYPE_ELF; + *type = TYPE_ELF; +#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) + if (gelf_getclass(elf) == ELFCLASS32) { + *type = TYPE_ELF32; + } +#endif - if (lseek(fd, hdr.elf.e_phoff, SEEK_SET) == -1) { - warnx("%s: header too short", fname); + freebsd = ehdr.e_ident[EI_OSABI] == ELFOSABI_FREEBSD; + for (i = 0; i < ehdr.e_phnum; i++) { + if (gelf_getphdr(elf, i, &phdr) == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + elf_end(elf); return (0); } - for (i = 0; i < hdr.elf.e_phnum; i++) { - if (read(fd, &phdr, hdr.elf.e_phentsize) - != sizeof(phdr)) { - warnx("%s: can't read program header", fname); - return (0); - } - if (phdr.p_type == PT_DYNAMIC) { - dynamic = 1; - dynphdr = phdr; - break; - } + switch (phdr.p_type) { + case PT_NOTE: + if (ehdr.e_ident[EI_OSABI] == ELFOSABI_NONE && !freebsd) + freebsd = has_freebsd_abi_tag(fname, elf, &ehdr, + phdr.p_offset, phdr.p_filesz); + break; + case PT_DYNAMIC: + dynamic = true; + if (ehdr.e_type == ET_DYN) + pie = is_pie(fname, elf, &ehdr, phdr.p_offset, + phdr.p_filesz); + break; } + } - if (!dynamic) { - warnx("%s: not a dynamic ELF executable", fname); - return (0); - } + if (!dynamic) { + elf_end(elf); + warnx("%s: not a dynamic ELF executable", fname); + return (0); + } - if (hdr.elf.e_type == ET_DYN) { - if (lseek(fd, dynphdr.p_offset, SEEK_SET) == -1) { - warnx("%s: dynamic segment out of range", - fname); - return (0); - } - dyndata = malloc(dynphdr.p_filesz); - if (dyndata == NULL) { - warn("malloc"); - return (0); - } - if (read(fd, dyndata, dynphdr.p_filesz) != - (ssize_t)dynphdr.p_filesz) { - free(dyndata); - warnx("%s: can't read dynamic segment", fname); - return (0); - } - for (dynp = dyndata; dynp->d_tag != DT_NULL; dynp++) { - if (dynp->d_tag != DT_FLAGS_1) - continue; - df1pie = (dynp->d_un.d_val & DF_1_PIE) != 0; - break; - } - free(dyndata); - - switch (hdr.elf.e_ident[EI_OSABI]) { - case ELFOSABI_FREEBSD: - if (!df1pie) - *is_shlib = 1; - return (1); -#ifdef __ARM_EABI__ - case ELFOSABI_NONE: - if (hdr.elf.e_machine != EM_ARM) - break; - if (EF_ARM_EABI_VERSION(hdr.elf.e_flags) < - EF_ARM_EABI_FREEBSD_MIN) - break; - *is_shlib = 1; - return (1); -#endif - } + if (ehdr.e_type == ET_DYN && !pie) { + *is_shlib = 1; + + if (!freebsd) { + elf_end(elf); warnx("%s: not a FreeBSD ELF shared object", fname); return (0); } - - return (1); } - warnx("%s: not a dynamic executable", fname); - return (0); + elf_end(elf); + return (1); } From owner-dev-commits-src-main@freebsd.org Fri Jan 29 20:08: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 C27D74F7A7B; Fri, 29 Jan 2021 20:08:19 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DS7gj5Hr3z3s7q; Fri, 29 Jan 2021 20:08:17 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1611950894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pYcF4ht8e/NWDdAT9CvA1u9NBu+jl3/GNFmxWZeyKBs=; b=ba/5Wx356/f30OAE7FGe9r58G5E5Le01UwLtaMa0GdsB/9lK/IC/wjyyvbTcQ23uWyZh1G Opb/MBpl8UcVsDE6QaPo9kCHdBSrCtI6JQJZd6GwAJT29Z8nznHL6hTvuFCUg/uFfoV8bY dbUdLQ+kr/NtB0DLGvdIoBXW3cmM5i4= Received: from skull.home.blih.net (lfbn-idf2-1-745-114.w86-247.abo.wanadoo.fr [86.247.192.114]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 78c8b834 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 29 Jan 2021 20:08:14 +0000 (UTC) Date: Fri, 29 Jan 2021 21:08:14 +0100 From: Emmanuel Vadot To: Glen Barber Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-Id: <20210129210814.e2dba591fe1d309268673a29@bidouilliste.com> In-Reply-To: <20210129164025.GS77557@FreeBSD.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> <20210129160708.GR77557@FreeBSD.org> <20210129172829.a5508a3f415baf47acd2fe8c@bidouilliste.com> <20210129164025.GS77557@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DS7gj5Hr3z3s7q X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=ba/5Wx35; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-1.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SPAMHAUS_ZRD(0.00)[212.83.155.74:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.83.155.74:from]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; 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: Fri, 29 Jan 2021 20:08:19 -0000 On Fri, 29 Jan 2021 16:40:25 +0000 Glen Barber wrote: > On Fri, Jan 29, 2021 at 05:28:29PM +0100, Emmanuel Vadot wrote: > > On Fri, 29 Jan 2021 16:07:08 +0000 > > Glen Barber wrote: > > > > > On Fri, Jan 29, 2021 at 04:06:39PM +0100, Emmanuel Vadot wrote: > > > > > > > > Hi Glen, > > > > > > > > On Thu, 14 Jan 2021 00:02:01 GMT > > > > Glen Barber wrote: > > > > > > > > > The branch main has been updated by gjb: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > > > > > > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > > Author: Glen Barber > > > > > AuthorDate: 2021-01-14 00:01:30 +0000 > > > > > Commit: Glen Barber > > > > > CommitDate: 2021-01-14 00:01:30 +0000 > > > > > > > > > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > > > > > > > > > Sponsored by: Rubicon Communications, LLC (netgate.com) > > > > > --- > > > > > sys/conf/newvers.sh | 2 +- > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > > > > > index b8667844210b..2a0ace45f2f6 100644 > > > > > --- a/sys/conf/newvers.sh > > > > > +++ b/sys/conf/newvers.sh > > > > > @@ -54,7 +54,7 @@ > > > > > > > > > > TYPE="FreeBSD" > > > > > REVISION="13.0" > > > > > -BRANCH="CURRENT" > > > > > +BRANCH="ALPHA1" > > > > > if [ -n "${BRANCH_OVERRIDE}" ]; then > > > > > BRANCH=${BRANCH_OVERRIDE} > > > > > fi > > > > > > > > So since ALPHA1 we do not have new GCP images. > > > > Is that intended ? > > > > > > > > > > I see 13.0-ALPHA3 GCE images: > > > > > > NAME PROJECT FAMILY DEPRECATED STATUS > > > freebsd-13-0-alpha3-amd64 freebsd-org-cloud-dev freebsd-13-0 READY > > > > Ah sorry, no idea how I missed it. > > Anyhow when I try to use it in cirrus-ci I have : > > Failed to start an instance: INVALID_ARGUMENT: Not Found > > > > Tested with the full name freebsd-13-0-alpha3-amd64 and the small name > > freebsd-13-0. Any tips on that ? > > > > Hmm, I am not sure. I do not see any errors (i.e., from installing > ports or the like) in the log. > > > > > Also there is no 14.0 snapshot while there was some new 11/12 images > > > > and no 13-ALPHA3 too it seems. > > > > > > Right. We likely will not have 14-CURRENT builds until releng/13.0 is > > > branched. 13.0-ALPHA3 was built a day later so it is ready for Friday, > > > the same as is done for BETA* and RC* builds. > > > > Ok, I indeed see some alpha3 images on the ftp but I don't see any for > > armv7 or aarch64, was there any problems ? > > > > Yes, all arm builds failed because of a problem in the ports tree. > > -------------------------- begin quoted text --------------------------- > Installing gettext-tools-0.21... > ===> p5-Locale-gettext-1.07 depends on executable: msgfmt - found > ===> Returning to build of p5-Locale-gettext-1.07 > ===> p5-Locale-gettext-1.07 depends on package: perl5>=5.32.r0<5.33 - found > ===> p5-Locale-gettext-1.07 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so) > ===> Configuring for p5-Locale-gettext-1.07 > env: /usr/local/bin/perl5.32.1: No such file or directory > *** Error code 127 > --------------------------- end quoted text ---------------------------- > > Glen > Mhm ok, is there a place where we can see those errors or at least be aware of them ? -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Fri Jan 29 20:10: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 49D464F7AFE; Fri, 29 Jan 2021 20:10: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 4DS7k00QYmz3sHv; Fri, 29 Jan 2021 20:10: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 010806D0; Fri, 29 Jan 2021 20:10: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 10TKAF9e039681; Fri, 29 Jan 2021 20:10:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TKAFGO039671; Fri, 29 Jan 2021 20:10:15 GMT (envelope-from git) Date: Fri, 29 Jan 2021 20:10:15 GMT Message-Id: <202101292010.10TKAFGO039671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3f43ada98c89 - main - Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f43ada98c89bce5ae416e203ba0e81595a5cd88 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, 29 Jan 2021 20:10:16 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3f43ada98c89bce5ae416e203ba0e81595a5cd88 commit 3f43ada98c89bce5ae416e203ba0e81595a5cd88 Author: Gleb Smirnoff AuthorDate: 2021-01-28 21:08:48 +0000 Commit: Gleb Smirnoff CommitDate: 2021-01-29 19:46:24 +0000 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. Originally IFCAP_NOMAP meant that the mbuf has external storage pointer that points to unmapped address. Then, this was extended to array of such pointers. Then, such mbufs were augmented with header/trailer. Basically, extended mbufs are extended, and set of features is subject to change. The new name should be generic enough to avoid further renaming. --- sbin/ifconfig/ifconfig.8 | 16 +++++++++------- sbin/ifconfig/ifconfig.c | 4 ++-- sys/dev/cxgbe/t4_main.c | 6 +++--- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 6 +++--- sys/kern/uipc_ktls.c | 2 +- sys/net/if.h | 2 +- sys/net/if_vlan.c | 4 ++-- sys/net/iflib.c | 8 ++++---- sys/netinet/ip_output.c | 2 +- sys/netinet6/ip6_output.c | 2 +- 10 files changed, 27 insertions(+), 25 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index bbaaa00d419b..b8adad3c75b0 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd November 1, 2020 +.Dd January 28, 2021 .Dt IFCONFIG 8 .Os .Sh NAME @@ -554,12 +554,14 @@ and Enable use of rate limiting (packet pacing) for TLS offload. .It Fl txtlsrtlmt Disable use of rate limiting for TLS offload. -.It Cm nomap -If the driver supports unmapped network buffers, -enable them on the interface. -.It Fl nomap -If the driver supports unmapped network buffers, -disable them on the interface. +.It Cm mextpg +If the driver supports extended multi-page +.Xr mbuf 9 +buffers, enable them on the interface. +.It Fl mextpg +If the driver supports extended multi-page +.Xr mbuf 9 +biffers, disable them on the interface. .It Cm wol , wol_ucast , wol_mcast , wol_magic Enable Wake On Lan (WOL) support, if available. WOL is a facility whereby a machine in a low power state may be woken diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 90a84f2996bc..5b12baa0656e 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1658,8 +1658,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-link2", -IFF_LINK2, setifflags), DEF_CMD("monitor", IFF_MONITOR, setifflags), DEF_CMD("-monitor", -IFF_MONITOR, setifflags), - DEF_CMD("nomap", IFCAP_NOMAP, setifcap), - DEF_CMD("-nomap", -IFCAP_NOMAP, setifcap), + DEF_CMD("mextpg", IFCAP_MEXTPG, setifcap), + DEF_CMD("-mextpg", -IFCAP_MEXTPG, setifcap), DEF_CMD("staticarp", IFF_STATICARP, setifflags), DEF_CMD("-staticarp", -IFF_STATICARP, setifflags), DEF_CMD("rxcsum6", IFCAP_RXCSUM_IPV6, setifcap), diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 32a229bed52b..994fe2e78de5 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1782,7 +1782,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS | \ - IFCAP_HWRXTSTMP | IFCAP_NOMAP) + IFCAP_HWRXTSTMP | IFCAP_MEXTPG) #define T4_CAP_ENABLE (T4_CAP) static int @@ -2182,8 +2182,8 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) rxq->iq.flags &= ~IQ_RX_TIMESTAMP; } } - if (mask & IFCAP_NOMAP) - ifp->if_capenable ^= IFCAP_NOMAP; + if (mask & IFCAP_MEXTPG) + ifp->if_capenable ^= IFCAP_MEXTPG; #ifdef KERN_TLS if (mask & IFCAP_TXTLS) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 023f519f7ced..296252875888 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3379,8 +3379,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) "tso6 disabled due to -txcsum6.\n"); } } - if (mask & IFCAP_NOMAP) - ifp->if_capenable ^= IFCAP_NOMAP; + if (mask & IFCAP_MEXTPG) + ifp->if_capenable ^= IFCAP_MEXTPG; if (mask & IFCAP_TXTLS4) ifp->if_capenable ^= IFCAP_TXTLS4; if (mask & IFCAP_TXTLS6) @@ -4397,7 +4397,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) ifp->if_capabilities |= IFCAP_LRO; ifp->if_capabilities |= IFCAP_TSO | IFCAP_VLAN_HWTSO; ifp->if_capabilities |= IFCAP_HWSTATS | IFCAP_HWRXTSTMP; - ifp->if_capabilities |= IFCAP_NOMAP; + ifp->if_capabilities |= IFCAP_MEXTPG; ifp->if_capabilities |= IFCAP_TXTLS4 | IFCAP_TXTLS6; #ifdef RATELIMIT ifp->if_capabilities |= IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT; diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 72c228e80199..700206681965 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -868,7 +868,7 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force, params.hdr.numa_domain = inp->inp_numa_domain; INP_RUNLOCK(inp); - if ((ifp->if_capenable & IFCAP_NOMAP) == 0) { + if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { error = EOPNOTSUPP; goto out; } diff --git a/sys/net/if.h b/sys/net/if.h index a886474780dd..eabd4e053733 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -245,7 +245,7 @@ struct if_data { #define IFCAP_HWSTATS 0x800000 /* manages counters internally */ #define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */ #define IFCAP_HWRXTSTMP 0x2000000 /* hardware rx timestamping */ -#define IFCAP_NOMAP 0x4000000 /* can TX unmapped mbufs */ +#define IFCAP_MEXTPG 0x4000000 /* understands M_EXTPG mbufs */ #define IFCAP_TXTLS4 0x8000000 /* can do TLS encryption and segmentation for TCP */ #define IFCAP_TXTLS6 0x10000000 /* can do TLS encryption and segmentation for TCP6 */ #define IFCAP_VXLAN_HWCSUM 0x20000000 /* can do IFCAN_HWCSUM on VXLANs */ diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 9703e5e7753f..e1c4160495bc 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1775,8 +1775,8 @@ vlan_capabilities(struct ifvlan *ifv) * are prepended in normal mbufs to unmapped mbufs holding * payload data. */ - cap |= (p->if_capabilities & IFCAP_NOMAP); - ena |= (mena & IFCAP_NOMAP); + cap |= (p->if_capabilities & IFCAP_MEXTPG); + ena |= (mena & IFCAP_MEXTPG); /* * If the parent interface can offload encryption and segmentation diff --git a/sys/net/iflib.c b/sys/net/iflib.c index d10c11f865fe..cfc6972bf987 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4231,7 +4231,7 @@ iflib_if_qflush(if_t ifp) #define IFCAP_FLAGS (IFCAP_HWCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ - IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_NOMAP) + IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_MEXTPG) static int iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) @@ -4358,7 +4358,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) oldmask = if_getcapenable(ifp); mask = ifr->ifr_reqcap ^ oldmask; - mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_NOMAP; + mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_MEXTPG; setmask = 0; #ifdef TCP_OFFLOAD setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6); @@ -4759,9 +4759,9 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct #endif if_setcapabilities(ifp, - scctx->isc_capabilities | IFCAP_HWSTATS | IFCAP_NOMAP); + scctx->isc_capabilities | IFCAP_HWSTATS | IFCAP_MEXTPG); if_setcapenable(ifp, - scctx->isc_capenable | IFCAP_HWSTATS | IFCAP_NOMAP); + scctx->isc_capenable | IFCAP_HWSTATS | IFCAP_MEXTPG); if (scctx->isc_ntxqsets == 0 || (scctx->isc_ntxqsets_max && scctx->isc_ntxqsets_max < scctx->isc_ntxqsets)) scctx->isc_ntxqsets = scctx->isc_ntxqsets_max; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 2d45d583df15..405490e890c0 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -746,7 +746,7 @@ sendit: } in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; - } else if ((ifp->if_capenable & IFCAP_NOMAP) == 0) { + } else if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { m = mb_unmapped_to_ext(m); if (m == NULL) { IPSTAT_INC(ips_odropped); diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 4e8f22a01b0a..df1e9e6f2dcd 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -225,7 +225,7 @@ ip6_output_delayed_csum(struct mbuf *m, struct ifnet *ifp, int csum_flags, #if defined(SCTP) || defined(SCTP_SUPPORT) (csum_flags & CSUM_SCTP_IPV6) || #endif - (!frag && (ifp->if_capenable & IFCAP_NOMAP) == 0)) { + (!frag && (ifp->if_capenable & IFCAP_MEXTPG) == 0)) { m = mb_unmapped_to_ext(m); if (m == NULL) { if (frag) From owner-dev-commits-src-main@freebsd.org Fri Jan 29 20:10: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 0275A4F7E04; Fri, 29 Jan 2021 20:10: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 4DS7jy6gSQz3s3v; Fri, 29 Jan 2021 20:10: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 D7CA3A81; Fri, 29 Jan 2021 20:10: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 10TKAEEE039186; Fri, 29 Jan 2021 20:10:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TKAEGT039179; Fri, 29 Jan 2021 20:10:14 GMT (envelope-from git) Date: Fri, 29 Jan 2021 20:10:14 GMT Message-Id: <202101292010.10TKAEGT039179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: cf6ff85fe847 - main - Catch up with 6edfd179c86: document M_EXTPG. While here sore flags as they are in sys/mbuf.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf6ff85fe847225e7b7ca1c3669cab6412076765 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, 29 Jan 2021 20:10:15 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=cf6ff85fe847225e7b7ca1c3669cab6412076765 commit cf6ff85fe847225e7b7ca1c3669cab6412076765 Author: Gleb Smirnoff AuthorDate: 2021-01-28 20:56:36 +0000 Commit: Gleb Smirnoff CommitDate: 2021-01-29 19:46:24 +0000 Catch up with 6edfd179c86: document M_EXTPG. While here sore flags as they are in sys/mbuf.h --- share/man/man9/mbuf.9 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index 8d5d40da15bf..9089ab56d58c 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2020 +.Dd January 28, 2021 .Dt MBUF 9 .Os .\" @@ -213,12 +213,12 @@ flag bits are defined as follows: #define M_PKTHDR 0x00000002 /* start of record */ #define M_EOR 0x00000004 /* end of record */ #define M_RDONLY 0x00000008 /* associated data marked read-only */ -#define M_NOMAP 0x00000100 /* mbuf data is unmapped */ -#define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ #define M_BCAST 0x00000010 /* send/received as link-level broadcast */ #define M_MCAST 0x00000020 /* send/received as link-level multicast */ #define M_PROMISC 0x00000040 /* packet was not for us */ #define M_VLANTAG 0x00000080 /* ether_vtag is valid */ +#define M_EXTPG 0x00000100 /* has array of unmapped pages and TLS */ +#define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ #define M_TSTMP 0x00000400 /* rcv_tstmp field is valid */ #define M_TSTMP_HPREC 0x00000800 /* rcv_tstmp is high-prec, typically hw-stamped on port (useful for IEEE 1588 From owner-dev-commits-src-main@freebsd.org Fri Jan 29 20:18: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 B75ED4F8682; Fri, 29 Jan 2021 20:18:48 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DS7vr4nQsz3tdR; Fri, 29 Jan 2021 20:18:48 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1611951528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OL9kW1hzuAo2pkZ+dB9q1NabCFKH+fAjG75H/rv8VmM=; b=oege/7lYiVTWuK7pLi+4aBTxIe2p5fz0jN3v9UBQrd8bFrACuXx7HQXRdviNQfY9Ddoepy 2dz+yHqBOptKyi589gsnHDQu14IwbaEL9Jm+5Hzfwwo/O6ImRa4o+oyDHW1bYUYJXPgzyJ DUa0Cg7UMMD6x6b3tpe2n5NuQby3eksdqc97QRHhwKmhMvbPypgRIkqwsqWXkWw0CCyWvB Ir+/hQsD0WL1kYZG7YPvAcy74g0Xu9hni2lUM1eHX9oX2jZ7fF+TwJw9XmmpRZJ1fMoYm6 f+XWG+xd8w9QUiZYC8AupEGN3tiPIQLV20425+gV8lfgYiGS6yOkbQqkIBlfNw== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 46C45BB8A; Fri, 29 Jan 2021 20:18:48 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Fri, 29 Jan 2021 20:18:45 +0000 From: Glen Barber To: Emmanuel Vadot Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-ID: <20210129201845.GU77557@FreeBSD.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> <20210129160708.GR77557@FreeBSD.org> <20210129172829.a5508a3f415baf47acd2fe8c@bidouilliste.com> <20210129164025.GS77557@FreeBSD.org> <20210129210814.e2dba591fe1d309268673a29@bidouilliste.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8tL1MfGjVkXqw1I1" Content-Disposition: inline In-Reply-To: <20210129210814.e2dba591fe1d309268673a29@bidouilliste.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1611951528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OL9kW1hzuAo2pkZ+dB9q1NabCFKH+fAjG75H/rv8VmM=; b=O2e6jBXBIygKjUgpCrlvfmrKfGg8epZOFv4mxJy2RbG3igzvEJ3JgRCCahjwbWZ/vP74IS r5XA7dFZhTSt24Tq21I5AT82TvnTY+7xftkadsx+2koaTlESo8Hn9mk1kuVWkFaM7G9wKu n0GCRpziwYSJixJXO1GSlW5gpod73oJEKrdoqPDtixS4hypkSuGPvNnhYECuWCbniC1owH KxITkZ+e765sRmRmimG7MHi+zVMXDrCm9Hbes1O1P2WmOqGif6zYh35iZs52uLKWohP7Mv goa2JUcffCGDMh+10A0xjdGb2qkEIcQBJWMpopjgIbvVpoo8OFeUNZCrBLq8/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1611951528; a=rsa-sha256; cv=none; b=Hd+SyoWVTp7GjT5PmeQqxsTay/36xQJVOGYEnDNKdPaJRSLhrg2XXRnSKLXmm+eLXaYkxF jrKSrLwzXVySYwXy3EdHLBhxj7hXPZba1mWsXNQXThYp4Zx3aY2DaazhwZ45SKXec9Ekzo 7Dl/ES4drPTX3MDdW1dUrUPSu/AnkQ1CD6iUKaP2tHpMlE63noEetGuNxjTCIbgMDyp+Z8 JLLI2CpBoM/Y6zRgDi4LLYdNvBJJsQDuUBmWdlisIhRWUqpaGmneRyYxk+qE+U7WLEpLHQ mg41SrDazBiPmyE69OQ9MOlCl0aM1Nmr/wQz3dKBUX/vSmcTxtuYmbwgdNHjYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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, 29 Jan 2021 20:18:48 -0000 --8tL1MfGjVkXqw1I1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 29, 2021 at 09:08:14PM +0100, Emmanuel Vadot wrote: > On Fri, 29 Jan 2021 16:40:25 +0000 > Glen Barber wrote: >=20 > > On Fri, Jan 29, 2021 at 05:28:29PM +0100, Emmanuel Vadot wrote: > > > On Fri, 29 Jan 2021 16:07:08 +0000 > > > Glen Barber wrote: > > >=20 > > > > On Fri, Jan 29, 2021 at 04:06:39PM +0100, Emmanuel Vadot wrote: > > > > >=20 > > > > > Hi Glen, > > > > >=20 > > > > > On Thu, 14 Jan 2021 00:02:01 GMT > > > > > Glen Barber wrote: > > > > >=20 > > > > > > The branch main has been updated by gjb: > > > > > >=20 > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7ae27c2d6c4fe4f2= 1e1219bb5d8a37cfc932337b > > > > > >=20 > > > > > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > > > Author: Glen Barber > > > > > > AuthorDate: 2021-01-14 00:01:30 +0000 > > > > > > Commit: Glen Barber > > > > > > CommitDate: 2021-01-14 00:01:30 +0000 > > > > > >=20 > > > > > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > > > > > =20 > > > > > > Sponsored by: Rubicon Communications, LLC (netgate.com) > > > > > > --- > > > > > > sys/conf/newvers.sh | 2 +- > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > >=20 > > > > > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > > > > > > index b8667844210b..2a0ace45f2f6 100644 > > > > > > --- a/sys/conf/newvers.sh > > > > > > +++ b/sys/conf/newvers.sh > > > > > > @@ -54,7 +54,7 @@ > > > > > > =20 > > > > > > TYPE=3D"FreeBSD" > > > > > > REVISION=3D"13.0" > > > > > > -BRANCH=3D"CURRENT" > > > > > > +BRANCH=3D"ALPHA1" > > > > > > if [ -n "${BRANCH_OVERRIDE}" ]; then > > > > > > BRANCH=3D${BRANCH_OVERRIDE} > > > > > > fi > > > > >=20 > > > > > So since ALPHA1 we do not have new GCP images. > > > > > Is that intended ? > > > > >=20 > > > >=20 > > > > I see 13.0-ALPHA3 GCE images: > > > >=20 > > > > NAME PROJECT FAMILY DEP= RECATED STATUS > > > > freebsd-13-0-alpha3-amd64 freebsd-org-cloud-dev freebsd-13-0 = READY > > >=20 > > > Ah sorry, no idea how I missed it. > > > Anyhow when I try to use it in cirrus-ci I have : > > > Failed to start an instance: INVALID_ARGUMENT: Not Found > > >=20 > > > Tested with the full name freebsd-13-0-alpha3-amd64 and the small na= me > > > freebsd-13-0. Any tips on that ? > > >=20 > >=20 > > Hmm, I am not sure. I do not see any errors (i.e., from installing > > ports or the like) in the log. > >=20 > > > > > Also there is no 14.0 snapshot while there was some new 11/12 im= ages > > > > > and no 13-ALPHA3 too it seems. > > > >=20 > > > > Right. We likely will not have 14-CURRENT builds until releng/13.0= is > > > > branched. 13.0-ALPHA3 was built a day later so it is ready for Fri= day, > > > > the same as is done for BETA* and RC* builds. > > >=20 > > > Ok, I indeed see some alpha3 images on the ftp but I don't see any f= or > > > armv7 or aarch64, was there any problems ? > > >=20 > >=20 > > Yes, all arm builds failed because of a problem in the ports tree. > >=20 > > -------------------------- begin quoted text --------------------------- > > Installing gettext-tools-0.21... > > =3D=3D=3D> p5-Locale-gettext-1.07 depends on executable: msgfmt - fou= nd > > =3D=3D=3D> Returning to build of p5-Locale-gettext-1.07 > > =3D=3D=3D> p5-Locale-gettext-1.07 depends on package: perl5>=3D5.32.r= 0<5.33 - found > > =3D=3D=3D> p5-Locale-gettext-1.07 depends on shared library: libintl.= so - found (/usr/local/lib/libintl.so) > > =3D=3D=3D> Configuring for p5-Locale-gettext-1.07 > > env: /usr/local/bin/perl5.32.1: No such file or directory > > *** Error code 127 > > --------------------------- end quoted text ---------------------------- > >=20 > > Glen > >=20 >=20 > Mhm ok, is there a place where we can see those errors or at least be > aware of them ? >=20 Not exactly. I am happy to make the logs public on an as-needed basis, but they contain environment information that potentially contains sensitive data (i.e., API keys and such). When there is a specific cause to a failure, I do ping those involved in the cause (i.e., a port build failure, or a userland/kernel failure). In this case, the error is uninteresting. The failure is exactly as what is included above. The odd thing though, is /usr/local/bin/perl5.32.0 is installed in the chroot(8), not /usr/local/bin/perl5.32.1, but I have not yet had luck tracking down exactly why. Glen --8tL1MfGjVkXqw1I1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmAUbaEACgkQAxRYpUeP 4pMvcQ/9FiXKhwMe0438JV7RBhFD8NRNpYo4iZLYw7OpcscWoqC+kdatvfHw/0Zg pwgFX77S4CuqW3laSlFNnyfOsBy5yo7F4sppFV34NG93rxEvfOej9yd62lxm4mQa oMekFEmwvPIk7J+Yah0TnGZmdIiWQUyhQ9RCCq3zyhH2rUhrmBiLEaATKJACjIm6 QimQNK1K7S1yl4x+koiSHqj+41KAee2lxaygGney9+0bbok3xfjJkB7S50+2U26P zHHcA3GQNQDQN1b2wMRXJTxHbG3C07G1h2Wz6/XimmKikEtANXmupC7qdN4oC+nv uk6D99VaZQ7FkEZElmSXrM8dcXFYF3K3DrEweY9QW57My7TH9EzNYIBTYkOtODyc YUbcZ11eGM44gG+DupTWbrXCNRJu7wiU9+eT7C5zlfBLSg922hn2vw1W6P+eQuEr sRp5IWtMyxLW1yEXzN7kdnUPadBZEYvPvSWreThA2MHehHCbMGzOAZyEWjGtwTMj Bv7HbK0jFwEzisLnmSSVAlnaDJcEvVZMveO3OWHTbdT+t/YHDC34yo20DUZjfVLy T+O4eL7oGO17iX1quA5wb9Vy6BJsCPT5X/CvahcJbUjWDejII4T3Dd5bL7u78GFi 7zhzH531k7+mCv+Zy8HSBzN3LbB/ODPo2imuQ0lNOi7tMT9Skz4= =zYzV -----END PGP SIGNATURE----- --8tL1MfGjVkXqw1I1-- From owner-dev-commits-src-main@freebsd.org Fri Jan 29 21:43: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 D79CF4FA13B; Fri, 29 Jan 2021 21:43: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 4DS9nk5nQmz4SnR; Fri, 29 Jan 2021 21:43: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 B947E1B5B; Fri, 29 Jan 2021 21:43: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 10TLhctH065462; Fri, 29 Jan 2021 21:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TLhchD065461; Fri, 29 Jan 2021 21:43:38 GMT (envelope-from git) Date: Fri, 29 Jan 2021 21:43:38 GMT Message-Id: <202101292143.10TLhchD065461@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: 53729367d388 - main - Fix subinterface vlan creation. 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: 53729367d388e4a6d0ff9be9995bcd4957e9c114 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, 29 Jan 2021 21:43:38 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=53729367d388e4a6d0ff9be9995bcd4957e9c114 commit 53729367d388e4a6d0ff9be9995bcd4957e9c114 Author: Alexander V. Chernikov AuthorDate: 2021-01-26 07:22:23 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-29 21:43:20 +0000 Fix subinterface vlan creation. D26436 introduced support for stacked vlans that changed the way vlans are configured. In particular, this change broke setups that have same-number vlans as subinterfaces. Vlan support was initially created assuming "vlanX" semantics. In this paradigm, automatic number assignment supported by cloning (ifconfig vlan create) was a natural fit. When "ifaceX.Y" support was added, allowing to have the same vlan number on multiple devices, cloning code became more complex, as the is no unified "vlan" namespace anymore. Such interfaces got the first spare index from "vlan" cloner. This, in turn, led to the following problem: ifconfig ix0.333 create -> index 1 ifconfig ix0.444 create -> index 2 ifconfig vlan2 create -> allocation failure This change fixes such allocations by using cloning indexes only for "vlanX" interfaces. Reviewed by: hselasky MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D27505 --- sys/net/if_clone.c | 7 +++-- sys/net/if_vlan.c | 75 +++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index a55ce9c3005d..a98e43328e0c 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -571,7 +571,7 @@ if_clone_addgroup(struct ifnet *ifp, struct if_clone *ifc) /* * A utility function to extract unit numbers from interface names of - * the form name###[.###]. + * the form name###. * * Returns 0 on success and an error on failure. */ @@ -582,9 +582,8 @@ ifc_name2unit(const char *name, int *unit) int cutoff = INT_MAX / 10; int cutlim = INT_MAX % 10; - if ((cp = strrchr(name, '.')) == NULL) - cp = name; - for (; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++); + for (cp = name; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++) + ; if (*cp == '\0') { *unit = -1; } else if (cp[0] == '0' && cp[1] != '\0') { diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index e1c4160495bc..229cd331c7a1 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -980,63 +980,86 @@ static int vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { char *dp; - int wildcard; + bool wildcard = false; + bool subinterface = false; int unit; int error; - int vid; - uint16_t proto; + int vid = 0; + uint16_t proto = ETHERTYPE_VLAN; struct ifvlan *ifv; struct ifnet *ifp; - struct ifnet *p; + struct ifnet *p = NULL; struct ifaddr *ifa; struct sockaddr_dl *sdl; struct vlanreq vlr; static const u_char eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ - proto = ETHERTYPE_VLAN; /* - * There are two ways to specify the cloned device: + * There are three ways to specify the cloned device: * o pass a parameter block with the clone request. + * o specify parameters in the text of the clone device name * o specify no parameters and get an unattached device that * must be configured separately. - * The first technique is preferred; the latter is supported + * The first technique is preferred; the latter two are supported * for backwards compatibility. * * XXXRW: Note historic use of the word "tag" here. New ioctls may be * called for. */ + if (params) { error = copyin(params, &vlr, sizeof(vlr)); if (error) return error; + vid = vlr.vlr_tag; + proto = vlr.vlr_proto; + p = ifunit_ref(vlr.vlr_parent); if (p == NULL) return (ENXIO); - error = ifc_name2unit(name, &unit); - if (error != 0) { - if_rele(p); - return (error); - } - vid = vlr.vlr_tag; - proto = vlr.vlr_proto; - wildcard = (unit < 0); - } else { - p = NULL; - error = ifc_name2unit(name, &unit); - if (error != 0) - return (error); + } + + if ((error = ifc_name2unit(name, &unit)) == 0) { + /* + * vlanX interface. Set wildcard to true if the unit number + * is not fixed (-1) + */ wildcard = (unit < 0); + } else { + struct ifnet *p_tmp = vlan_clone_match_ethervid(name, &vid); + if (p_tmp != NULL) { + error = 0; + subinterface = true; + unit = IF_DUNIT_NONE; + wildcard = false; + if (p != NULL) { + if_rele(p_tmp); + if (p != p_tmp) + error = EINVAL; + } else + p = p_tmp; + } else + error = ENXIO; } - error = ifc_alloc_unit(ifc, &unit); if (error != 0) { if (p != NULL) if_rele(p); return (error); } + if (!subinterface) { + /* vlanX interface, mark X as busy or allocate new unit # */ + error = ifc_alloc_unit(ifc, &unit); + if (error != 0) { + if (p != NULL) + if_rele(p); + return (error); + } + } + /* In the wildcard case, we need to update the name. */ if (wildcard) { for (dp = name; *dp != '\0'; dp++); @@ -1049,7 +1072,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifv = malloc(sizeof(struct ifvlan), M_VLAN, M_WAITOK | M_ZERO); ifp = ifv->ifv_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - ifc_free_unit(ifc, unit); + if (!subinterface) + ifc_free_unit(ifc, unit); free(ifv, M_VLAN); if (p != NULL) if_rele(p); @@ -1099,7 +1123,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ether_ifdetach(ifp); vlan_unconfig(ifp); if_free(ifp); - ifc_free_unit(ifc, unit); + if (!subinterface) + ifc_free_unit(ifc, unit); free(ifv, M_VLAN); return (error); @@ -1113,6 +1138,7 @@ static int vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) { struct ifvlan *ifv = ifp->if_softc; + int unit = ifp->if_dunit; if (ifp->if_vlantrunk) return (EBUSY); @@ -1128,7 +1154,8 @@ vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) NET_EPOCH_WAIT(); if_free(ifp); free(ifv, M_VLAN); - ifc_free_unit(ifc, ifp->if_dunit); + if (unit != IF_DUNIT_NONE) + ifc_free_unit(ifc, unit); return (0); } From owner-dev-commits-src-main@freebsd.org Fri Jan 29 22:20: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 3BD284FAA3A; Fri, 29 Jan 2021 22:20:33 +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 4DSBcK1G26z4VB0; Fri, 29 Jan 2021 22:20:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:6de1:a2f9:53d8:6c1d]) (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 A612DFC55; Fri, 29 Jan 2021 22:20:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 3f43ada98c89 - main - Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. To: Gleb Smirnoff , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101292010.10TKAFGO039671@gitrepo.freebsd.org> From: John Baldwin Message-ID: <90c5436e-1df9-d755-be5f-ea87d6a9da4f@FreeBSD.org> Date: Fri, 29 Jan 2021 14:20:31 -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: <202101292010.10TKAFGO039671@gitrepo.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: Fri, 29 Jan 2021 22:20:33 -0000 On 1/29/21 12:10 PM, Gleb Smirnoff wrote: > The branch main has been updated by glebius: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3f43ada98c89bce5ae416e203ba0e81595a5cd88 > > commit 3f43ada98c89bce5ae416e203ba0e81595a5cd88 > Author: Gleb Smirnoff > AuthorDate: 2021-01-28 21:08:48 +0000 > Commit: Gleb Smirnoff > CommitDate: 2021-01-29 19:46:24 +0000 > > Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. > > Originally IFCAP_NOMAP meant that the mbuf has external storage pointer > that points to unmapped address. Then, this was extended to array of > such pointers. Then, such mbufs were augmented with header/trailer. > Basically, extended mbufs are extended, and set of features is subject > to change. The new name should be generic enough to avoid further > renaming. Are you planning to merge this to 13? I didn't see a MFC after, but it would be really odd to have -nomap present on 13.x only to break it on 14.0. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Fri Jan 29 22:38: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 A97EF4FB42F; Fri, 29 Jan 2021 22:38:29 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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 (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSC111Rthz4WYJ; Fri, 29 Jan 2021 22:38:27 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 10TMcJNM021231 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 29 Jan 2021 14:38:19 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 10TMcJsM021230; Fri, 29 Jan 2021 14:38:19 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 29 Jan 2021 14:38:19 -0800 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3f43ada98c89 - main - Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. Message-ID: References: <202101292010.10TKAFGO039671@gitrepo.freebsd.org> <90c5436e-1df9-d755-be5f-ea87d6a9da4f@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90c5436e-1df9-d755-be5f-ea87d6a9da4f@FreeBSD.org> X-Rspamd-Queue-Id: 4DSC111Rthz4WYJ 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: Fri, 29 Jan 2021 22:38:29 -0000 On Fri, Jan 29, 2021 at 02:20:31PM -0800, John Baldwin wrote: J> On 1/29/21 12:10 PM, Gleb Smirnoff wrote: J> > The branch main has been updated by glebius: J> > J> > URL: https://cgit.FreeBSD.org/src/commit/?id=3f43ada98c89bce5ae416e203ba0e81595a5cd88 J> > J> > commit 3f43ada98c89bce5ae416e203ba0e81595a5cd88 J> > Author: Gleb Smirnoff J> > AuthorDate: 2021-01-28 21:08:48 +0000 J> > Commit: Gleb Smirnoff J> > CommitDate: 2021-01-29 19:46:24 +0000 J> > J> > Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. J> > J> > Originally IFCAP_NOMAP meant that the mbuf has external storage pointer J> > that points to unmapped address. Then, this was extended to array of J> > such pointers. Then, such mbufs were augmented with header/trailer. J> > Basically, extended mbufs are extended, and set of features is subject J> > to change. The new name should be generic enough to avoid further J> > renaming. J> J> Are you planning to merge this to 13? I didn't see a MFC after, but it would J> be really odd to have -nomap present on 13.x only to break it on 14.0. Yes, of course planned to MFC to 13. -- Gleb Smirnoff From owner-dev-commits-src-main@freebsd.org Fri Jan 29 23:17: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 EBF8E4FBF5E; Fri, 29 Jan 2021 23:17: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 4DSCst64jzz4Ybn; Fri, 29 Jan 2021 23:17: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 C36563203; Fri, 29 Jan 2021 23:17: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 10TNHMQW082709; Fri, 29 Jan 2021 23:17:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TNHMq6082708; Fri, 29 Jan 2021 23:17:22 GMT (envelope-from git) Date: Fri, 29 Jan 2021 23:17:22 GMT Message-Id: <202101292317.10TNHMq6082708@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: cb984c62d705 - main - Fix multipath support for rib_lookup_info(). 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: cb984c62d705e4229998fdb076d012666a2196da 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, 29 Jan 2021 23:17:23 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=cb984c62d705e4229998fdb076d012666a2196da commit cb984c62d705e4229998fdb076d012666a2196da Author: Alexander V. Chernikov AuthorDate: 2021-01-29 23:10:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-29 23:14:24 +0000 Fix multipath support for rib_lookup_info(). The initial plan was to remove rib_lookup_info() before FreeBSD 13. As several customers are still remaining, fix rib_lookup_info() for the multipath use case. --- sys/net/route.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index 7e087569d45f..a68e46c37861 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -79,8 +79,8 @@ EVENTHANDLER_LIST_DEFINE(rt_addrmsg); static int rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *, void *arg); -static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, - int flags); +static int rt_exportinfo(struct rtentry *rt, struct nhop_object *nh, + struct rt_addrinfo *info, int flags); /* * route initialization must occur before ip6_init2(), which happenas at @@ -330,15 +330,14 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, * * Returns 0 on success. */ -int -rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags) +static int +rt_exportinfo(struct rtentry *rt, struct nhop_object *nh, + struct rt_addrinfo *info, int flags) { struct rt_metrics *rmx; struct sockaddr *src, *dst; - struct nhop_object *nh; int sa_len; - nh = rt->rt_nhop; if (flags & NHR_COPY) { /* Copy destination if dst is non-zero */ src = rt_key(rt); @@ -424,6 +423,7 @@ rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, struct rib_head *rh; struct radix_node *rn; struct rtentry *rt; + struct nhop_object *nh; int error; KASSERT((fibnum < rt_numfibs), ("rib_lookup_rte: bad fibnum")); @@ -435,10 +435,11 @@ rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, rn = rh->rnh_matchaddr(__DECONST(void *, dst), &rh->head); if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { rt = RNTORT(rn); + nh = nhop_select(rt->rt_nhop, flowid); /* Ensure route & ifp is UP */ - if (RT_LINK_IS_UP(rt->rt_nhop->nh_ifp)) { + if (RT_LINK_IS_UP(nh->nh_ifp)) { flags = (flags & NHR_REF) | NHR_COPY; - error = rt_exportinfo(rt, info, flags); + error = rt_exportinfo(rt, nh, info, flags); RIB_RUNLOCK(rh); return (error); From owner-dev-commits-src-main@freebsd.org Fri Jan 29 23:48: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 B24914FCAC1; Fri, 29 Jan 2021 23:48: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 4DSDYq4gq1z4bR0; Fri, 29 Jan 2021 23:48: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 934FA33FC; Fri, 29 Jan 2021 23:48: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 10TNmVIE022428; Fri, 29 Jan 2021 23:48:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TNmV8Z022427; Fri, 29 Jan 2021 23:48:31 GMT (envelope-from git) Date: Fri, 29 Jan 2021 23:48:31 GMT Message-Id: <202101292348.10TNmV8Z022427@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: 710e45c4b853 - main - 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: 710e45c4b8539d028877769f1a4ec088c48fb5f1 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, 29 Jan 2021 23:48:31 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=710e45c4b8539d028877769f1a4ec088c48fb5f1 commit 710e45c4b8539d028877769f1a4ec088c48fb5f1 Author: Mateusz Guzik AuthorDate: 2021-01-29 21:48:11 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-29 23:48:26 +0000 Reimplement strlen The previous code neglected to use primitives which can find the end of the string without having to branch on every character. While here augment the somewhat misleading commentary -- strlen as implemented here leaves performance on the table, especially so for userspace. Every arch should get a dedicated variant instead. In the meantime this commit lessens the problem. Tested with glibc test suite. Naive test just calling strlen in a loop on Haswell (ops/s): $(perl -e "print 'A' x 3"): before: 211198039 after: 338626619 $(perl -e "print 'A' x 100"): before: 83151997 after: 98285919 --- lib/libc/string/strlen.c | 82 +++++++++++++++++------------------------------- sys/libkern/strlen.c | 79 +++++++++++++++------------------------------- 2 files changed, 53 insertions(+), 108 deletions(-) diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index a862ffc245ca..0bdc81d7bb9a 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -35,10 +35,6 @@ __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) @@ -46,18 +42,13 @@ __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; @@ -70,62 +61,45 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -/* - * 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) +#if BYTE_ORDER == LITTLE_ENDIAN +#define FINDZERO __builtin_ctzl +#else +#define FINDZERO __builtin_clzl +#endif size_t strlen(const char *str) { - const char *p; const unsigned long *lp; + unsigned long mask; long va, vb; + long val; - /* - * 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); + 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++; + } - /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - 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 + return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); } } - /* NOTREACHED */ + __builtin_unreachable(); return (0); } diff --git a/sys/libkern/strlen.c b/sys/libkern/strlen.c index a8c7964f69a3..8fa5f3927ea9 100644 --- a/sys/libkern/strlen.c +++ b/sys/libkern/strlen.c @@ -34,10 +34,6 @@ __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) @@ -45,18 +41,10 @@ __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; @@ -69,62 +57,45 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -/* - * 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) +#if BYTE_ORDER == LITTLE_ENDIAN +#define FINDZERO __builtin_ctzl +#else +#define FINDZERO __builtin_clzl +#endif size_t (strlen)(const char *str) { - const char *p; const unsigned long *lp; + unsigned long mask; long va, vb; + long val; - /* - * 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); + 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++; + } - /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - 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 + return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); } } - /* NOTREACHED */ + __builtin_unreachable(); return (0); } From owner-dev-commits-src-main@freebsd.org Fri Jan 29 23:49: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 616BF4FCF07 for ; Fri, 29 Jan 2021 23:49:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 4DSDbD1psRz4bNr for ; Fri, 29 Jan 2021 23:49:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f41.google.com with SMTP id e15so8413455wme.0 for ; Fri, 29 Jan 2021 15:49:43 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3lVOq4W14UHSIyoFdXZwTJp/s3ZC7fxeSVPaWypW2Co=; b=cpWJAwYEmTtKscqWGQAr0Xpp0ECa8fRFQrAUsRPWYEdomQ1kZYeRSAbhdAbLS60ajk nPg3tfNmkV6LXDtUNZGhzqllFjn9niandmahVRb9UxvcQKqSCZpK18OTI38YGSc+O21M T7hmuWeNwXsSldRJCesX8daonsZPr+JbCJXUo0evlBb2LIafg4jofME8OHzD/nR4sKzB Bra0Qz5e43HwCM8wv6HTs/tAKAm5dJUM/ONlUDn//kvjTSgj2IbLFXm9TVcY7b7ydtk9 wturMJIJqft4RfG3DuVJbTtWPaWuuHChB9kiHET+LWL2WWmcwlwSSQ4DwQxG4jHPt+kC txZw== X-Gm-Message-State: AOAM530a+2Lk59Z8KiHO5UxUZ713rlD4dwgpMuQlPlFN9SgLSEUvijuU 4kmwlnO31ADzuK1dzPnzfAgIMA== X-Google-Smtp-Source: ABdhPJwI5z319wQaZqrHEGf6KoTnJUXKB+ueamc8ZNYbNMMiPfZ8nGweNMPTE+EeEPC93zzUucafMg== X-Received: by 2002:a1c:f70f:: with SMTP id v15mr5722956wmh.38.1611964182673; Fri, 29 Jan 2021 15:49:42 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id y18sm14455728wrt.19.2021.01.29.15.49.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jan 2021 15:49:41 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 710e45c4b853 - main - Reimplement strlen From: Jessica Clarke In-Reply-To: <202101292348.10TNmV8Z022427@gitrepo.freebsd.org> Date: Fri, 29 Jan 2021 23:49:40 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202101292348.10TNmV8Z022427@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DSDbD1psRz4bNr 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: Fri, 29 Jan 2021 23:49:44 -0000 On 29 Jan 2021, at 23:48, Mateusz Guzik wrote: >=20 > The branch main has been updated by mjg: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D710e45c4b8539d028877769f1a4ec088= c48fb5f1 >=20 > commit 710e45c4b8539d028877769f1a4ec088c48fb5f1 > Author: Mateusz Guzik > AuthorDate: 2021-01-29 21:48:11 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-01-29 23:48:26 +0000 >=20 > Reimplement strlen This really should have gone through code review. Jess From owner-dev-commits-src-main@freebsd.org Sat Jan 30 00:01: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 D12BA4FD50E; Sat, 30 Jan 2021 00:01: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 4DSDsC5557z4cBK; Sat, 30 Jan 2021 00:01: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 A1F7A39E6; Sat, 30 Jan 2021 00:01: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 10U01pUI047011; Sat, 30 Jan 2021 00:01:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U01pro047010; Sat, 30 Jan 2021 00:01:51 GMT (envelope-from git) Date: Sat, 30 Jan 2021 00:01:51 GMT Message-Id: <202101300001.10U01pro047010@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: 164c3b81848b - main - amd64: add missing ALIGN_TEXT to loops in memset and memmove 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: 164c3b81848bc81dc200b12370999474225447a3 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, 30 Jan 2021 00:01:51 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=164c3b81848bc81dc200b12370999474225447a3 commit 164c3b81848bc81dc200b12370999474225447a3 Author: Mateusz Guzik AuthorDate: 2021-01-29 15:09:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-30 00:01:44 +0000 amd64: add missing ALIGN_TEXT to loops in memset and memmove --- lib/libc/amd64/string/memmove.S | 2 ++ lib/libc/amd64/string/memset.S | 1 + sys/amd64/amd64/support.S | 3 +++ 3 files changed, 6 insertions(+) diff --git a/lib/libc/amd64/string/memmove.S b/lib/libc/amd64/string/memmove.S index accc86440610..4797140a1c16 100644 --- a/lib/libc/amd64/string/memmove.S +++ b/lib/libc/amd64/string/memmove.S @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -198,6 +199,7 @@ __FBSDID("$FreeBSD$"); cmpq $32,%rcx jb 2016f + ALIGN_TEXT 2032: movq (%rsi),%rdx movq %rdx,(%rdi) diff --git a/lib/libc/amd64/string/memset.S b/lib/libc/amd64/string/memset.S index 67f21714b3d1..0639573a4a3e 100644 --- a/lib/libc/amd64/string/memset.S +++ b/lib/libc/amd64/string/memset.S @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq %r10,(%rdi) movq %r10,8(%rdi) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index b0ef54a27ca1..35e73e413e87 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -322,6 +322,7 @@ END(memcmp) cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -455,6 +456,7 @@ END(memcmp) cmpq $32,%rcx jb 2016f + ALIGN_TEXT 2032: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -595,6 +597,7 @@ END(memcpy_erms) cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq %r10,(%rdi) movq %r10,8(%rdi) From owner-dev-commits-src-main@freebsd.org Sat Jan 30 00:13: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 26CAC4FD8F4; Sat, 30 Jan 2021 00:13:43 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (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 4DSF6t74Ztz4crH; Sat, 30 Jan 2021 00:13:42 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id E718216057; Sat, 30 Jan 2021 01:13:34 +0100 (CET) Date: Sat, 30 Jan 2021 01:13:34 +0100 From: Steffen Nurpmeso To: Jessica Clarke Cc: Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 710e45c4b853 - main - Reimplement strlen Message-ID: <20210130001334.riY1-%steffen@sdaoden.eu> In-Reply-To: References: <202101292348.10TNmV8Z022427@gitrepo.freebsd.org> User-Agent: s-nail v14.9.21-98-g07264876 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4DSF6t74Ztz4crH 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, 30 Jan 2021 00:13:43 -0000 Jessica Clarke wrote in : |On 29 Jan 2021, at 23:48, Mateusz Guzik wrote: |> |> The branch main has been updated by mjg: |> |> URL: https://cgit.FreeBSD.org/src/commit/?id=710e45c4b8539d028877769f1a4\ |> ec088c48fb5f1 |> |> commit 710e45c4b8539d028877769f1a4ec088c48fb5f1 |> Author: Mateusz Guzik |> AuthorDate: 2021-01-29 21:48:11 +0000 |> Commit: Mateusz Guzik |> CommitDate: 2021-01-29 23:48:26 +0000 |> |> Reimplement strlen | |This really should have gone through code review. Out of topic: i seem to recall to have seen these masks and similar code (with predictions) in the Linux kernel about 20 years ago. I admire people who grasp and wrap their heads around such maths on the fly. I tend to forget it again and again. Mind you, cycling two days ago over across the small hill i landed in winter, today it was all melted and the sheeps adored it. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From owner-dev-commits-src-main@freebsd.org Sat Jan 30 00:22: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 1B6784FD9D1; Sat, 30 Jan 2021 00:22: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 4DSFK90FQ0z4dKC; Sat, 30 Jan 2021 00:22: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 EF694419B; Sat, 30 Jan 2021 00:22: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 10U0MaFF073735; Sat, 30 Jan 2021 00:22:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U0Mav8073734; Sat, 30 Jan 2021 00:22:36 GMT (envelope-from git) Date: Sat, 30 Jan 2021 00:22:36 GMT Message-Id: <202101300022.10U0Mav8073734@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: d1de5698dfe6 - main - amd64: retire sse2_pagezero 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: d1de5698dfe6109308d4e5d6536a2ac93941d23a 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, 30 Jan 2021 00:22:37 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d1de5698dfe6109308d4e5d6536a2ac93941d23a commit d1de5698dfe6109308d4e5d6536a2ac93941d23a Author: Mateusz Guzik AuthorDate: 2021-01-30 00:17:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-30 00:17:15 +0000 amd64: retire sse2_pagezero All page zeroing is using temporal stores with rep movs*, the routine is unused for several years. Should a need arise for zeroing using non-temporal stores, a more optimized variant can be implemented with a more descriptive name. --- sys/amd64/amd64/support.S | 24 ------------------------ sys/amd64/include/md_var.h | 1 - 2 files changed, 25 deletions(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 35e73e413e87..49baa50ac294 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -81,30 +81,6 @@ ENTRY(pagecopy) ret END(pagecopy) -/* Address: %rdi */ -ENTRY(sse2_pagezero) - PUSH_FRAME_POINTER - movq $-PAGE_SIZE,%rdx - subq %rdx,%rdi - xorl %eax,%eax - jmp 1f - /* - * The loop takes 29 bytes. Ensure that it doesn't cross a 32-byte - * cache line. - */ - .p2align 5,0x90 -1: - movnti %rax,(%rdi,%rdx) - movnti %rax,8(%rdi,%rdx) - movnti %rax,16(%rdi,%rdx) - movnti %rax,24(%rdi,%rdx) - addq $32,%rdx - jne 1b - sfence - POP_FRAME_POINTER - ret -END(sse2_pagezero) - /* * memcmpy(b1, b2, len) * rdi,rsi,rdx diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 6b6201e4c0f1..3b2454a4b441 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -85,7 +85,6 @@ void gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault)); void fpstate_drop(struct thread *td); void pagezero(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); -void sse2_pagezero(void *addr); void set_top_of_stack_td(struct thread *td); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); From owner-dev-commits-src-main@freebsd.org Sat Jan 30 01:41: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 610934FFE0C; Sat, 30 Jan 2021 01:41:11 +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 4DSH3q2HW6z4jDW; Sat, 30 Jan 2021 01:41:11 +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 41A9E4FC6; Sat, 30 Jan 2021 01:41:11 +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 10U1fBd6074419; Sat, 30 Jan 2021 01:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U1fBQ5074418; Sat, 30 Jan 2021 01:41:11 GMT (envelope-from git) Date: Sat, 30 Jan 2021 01:41:11 GMT Message-Id: <202101300141.10U1fBQ5074418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 385fb5d933b5 - main - acpica: Import ACPICA 20201217. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 385fb5d933b55dbfe6f0eaf4d937ee89026c9ef5 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, 30 Jan 2021 01:41:11 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=385fb5d933b55dbfe6f0eaf4d937ee89026c9ef5 commit 385fb5d933b55dbfe6f0eaf4d937ee89026c9ef5 Author: Jung-uk Kim AuthorDate: 2021-01-04 22:20:55 +0000 Commit: Jung-uk Kim CommitDate: 2021-01-30 00:48:02 +0000 acpica: Import ACPICA 20201217. (cherry picked from commit a4634ed7779f0905e3bfeb781e58d40a5bdf9bb7) --- sys/contrib/dev/acpica/changes.txt | 35 ++++++++++++++++++++++ sys/contrib/dev/acpica/compiler/aslanalyze.c | 2 +- sys/contrib/dev/acpica/compiler/aslcompiler.l | 4 +-- sys/contrib/dev/acpica/compiler/aslerror.c | 2 +- sys/contrib/dev/acpica/compiler/aslmethod.c | 1 + sys/contrib/dev/acpica/compiler/aslparseop.c | 4 +-- sys/contrib/dev/acpica/compiler/aslwalks.c | 2 +- sys/contrib/dev/acpica/compiler/dtfield.c | 2 +- sys/contrib/dev/acpica/compiler/dttemplate.c | 3 +- .../dev/acpica/components/debugger/dbinput.c | 4 +-- .../dev/acpica/components/debugger/dbobject.c | 2 +- .../dev/acpica/components/disassembler/dmwalk.c | 8 ++--- .../dev/acpica/components/dispatcher/dscontrol.c | 2 +- .../dev/acpica/components/dispatcher/dsdebug.c | 2 +- .../dev/acpica/components/dispatcher/dswexec.c | 3 +- .../dev/acpica/components/dispatcher/dswload.c | 2 +- .../dev/acpica/components/dispatcher/dswload2.c | 2 +- .../dev/acpica/components/executer/exfldio.c | 2 +- .../dev/acpica/components/executer/exresop.c | 4 +-- .../dev/acpica/components/executer/exstore.c | 4 +-- sys/contrib/dev/acpica/components/hardware/hwgpe.c | 2 +- sys/contrib/dev/acpica/components/parser/psloop.c | 3 +- sys/contrib/dev/acpica/components/parser/psparse.c | 2 +- .../dev/acpica/components/utilities/utdelete.c | 2 +- .../dev/acpica/components/utilities/utstrsuppt.c | 4 +-- sys/contrib/dev/acpica/include/acexcep.h | 10 +++---- sys/contrib/dev/acpica/include/acpixf.h | 2 +- sys/contrib/dev/acpica/include/actypes.h | 5 ++++ sys/contrib/dev/acpica/include/platform/acgcc.h | 15 ++++++++++ 29 files changed, 95 insertions(+), 40 deletions(-) diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt index e7cc572a0cc3..d27547d31b76 100644 --- a/sys/contrib/dev/acpica/changes.txt +++ b/sys/contrib/dev/acpica/changes.txt @@ -1,5 +1,40 @@ ---------------------------------------- +17 December 2020. Summary of changes for version 20201217: +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Note: The implementation of ACPI 6.4 is underway, and is expected to be +mostly finished next month, when ACPI 6.4 is released. + +From qzed:- fixed-ae-class-macros. Fix exception code class checks. Added +several new macros, such as ACPI_CNTL_EXCEPTION(Status) in order to +enable this. + +AcpiExec/iASL/AcpiHelp: Added a few changes for support of GCC 10.2.0. +These included a few casts, as well as a null pointer check. + +Fix -Wfallthrough: GCC 7.1 gained -Wimplicit-fallthrough to warn on +implicit fallthrough, as well as __attribute__((__fallthrough__)) and +comments to explicitly denote that cases of fallthrough were intentional. +Clang also supports this warning and statement attribute, but not the +comment form. Added a new macro, ACPI_FALLTHROUGH to support this feature +of GCC. With assistance from @nickdesaulniers. + +2) iASL Compiler/Disassembler and ACPICA tools: + +Added improvement to method call analysis by saving the return type and +relaxing certain cases of type checking. + +iASL Table Compiler: Improved info messages. Added a message to the -T +option for when the default template (DSDT) is used. +Also added a note for when multiple SSDTs are created with a DSDT that +the SSDTs are created in the same file as the DSDT. + + +---------------------------------------- 13 November 2020. Summary of changes for version 20201113: diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c index df37dac214ab..fe1f2f8cd410 100644 --- a/sys/contrib/dev/acpica/compiler/aslanalyze.c +++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c @@ -470,7 +470,7 @@ AnCheckMethodReturnValue ( "Method returns [%s], %s operator requires [%s]", AslGbl_StringBuffer, OpInfo->Name, AslGbl_StringBuffer2); - AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, AslGbl_MsgBuffer); + AslError (ASL_WARNING, ASL_MSG_INVALID_TYPE, ArgOp, AslGbl_MsgBuffer); } } diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l index 524dd0a67ff5..3127447710a5 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompiler.l +++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l @@ -812,9 +812,9 @@ NamePathTail [.]{NameSeg} "__PATH__" { count (0); return (PARSEOP___PATH__); } "__METHOD__" { count (0); return (PARSEOP___METHOD__); } "__EXPECT__"{ErrorCode} { char *s; - int index = 0; + unsigned int index = 0; count (0); - while (!isdigit (AslCompilertext[index])) + while (!isdigit ((int) AslCompilertext[index])) { index++; } diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c index 924e8d715712..48ac99ef62c2 100644 --- a/sys/contrib/dev/acpica/compiler/aslerror.c +++ b/sys/contrib/dev/acpica/compiler/aslerror.c @@ -1456,7 +1456,7 @@ AslIsExceptionDisabled ( { return (TRUE); } - /* Fall through */ + ACPI_FALLTHROUGH; case ASL_WARNING: case ASL_REMARK: diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c index 859e0d8e69ac..e474b957074d 100644 --- a/sys/contrib/dev/acpica/compiler/aslmethod.c +++ b/sys/contrib/dev/acpica/compiler/aslmethod.c @@ -288,6 +288,7 @@ MtMethodAnalysisWalkBegin ( NextType = Next->Asl.Child; MethodInfo->ValidReturnTypes = MtProcessTypeOp (NextType); + Op->Asl.AcpiBtype |= MethodInfo->ValidReturnTypes; /* Get the ParameterType node */ diff --git a/sys/contrib/dev/acpica/compiler/aslparseop.c b/sys/contrib/dev/acpica/compiler/aslparseop.c index c3b9630a53fe..e21f91509aa4 100644 --- a/sys/contrib/dev/acpica/compiler/aslparseop.c +++ b/sys/contrib/dev/acpica/compiler/aslparseop.c @@ -414,7 +414,7 @@ TrCreateValuedLeafOp ( for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { - if (islower (Op->Asl.Value.Name[i])) + if (islower ((int) Op->Asl.Value.Name[i])) { AcpiUtStrupr (&Op->Asl.Value.Name[i]); AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMESEG, Op, Op->Asl.Value.Name); @@ -431,7 +431,7 @@ TrCreateValuedLeafOp ( StringPtr = Op->Asl.Value.Name; for (i = 0; *StringPtr; i++) { - if (islower (*StringPtr)) + if (islower ((int) *StringPtr)) { AcpiUtStrupr (&Op->Asl.Value.Name[i]); AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMEPATH, Op, Op->Asl.Value.Name); diff --git a/sys/contrib/dev/acpica/compiler/aslwalks.c b/sys/contrib/dev/acpica/compiler/aslwalks.c index 09bf205f5f8d..902a1700718b 100644 --- a/sys/contrib/dev/acpica/compiler/aslwalks.c +++ b/sys/contrib/dev/acpica/compiler/aslwalks.c @@ -516,7 +516,7 @@ AnOperandTypecheckWalkEnd ( break; } - /* Fallthrough */ + ACPI_FALLTHROUGH; case ARGI_STORE_TARGET: diff --git a/sys/contrib/dev/acpica/compiler/dtfield.c b/sys/contrib/dev/acpica/compiler/dtfield.c index ab9f7903f033..b81f77edf733 100644 --- a/sys/contrib/dev/acpica/compiler/dtfield.c +++ b/sys/contrib/dev/acpica/compiler/dtfield.c @@ -227,7 +227,7 @@ DtCompileOneField ( break; } - /* Fall through. */ + ACPI_FALLTHROUGH; case DT_FIELD_TYPE_BUFFER: diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.c b/sys/contrib/dev/acpica/compiler/dttemplate.c index 1beb67ac3b34..ad15f6e74bf0 100644 --- a/sys/contrib/dev/acpica/compiler/dttemplate.c +++ b/sys/contrib/dev/acpica/compiler/dttemplate.c @@ -255,6 +255,7 @@ DtCreateTemplates ( if (AcpiGbl_Optind < 3) { + fprintf (stderr, "Creating default template: [DSDT]\n"); Status = DtCreateOneTemplateFile (ACPI_SIG_DSDT, 0); goto Exit; } @@ -640,7 +641,7 @@ DtCreateOneTemplate ( { fprintf (stderr, "Created ACPI table templates for [%4.4s] " - "and %u [SSDT], written to \"%s\"\n", + "and %u [SSDT] in same file, written to \"%s\"\n", Signature, TableCount, DisasmFilename); } diff --git a/sys/contrib/dev/acpica/components/debugger/dbinput.c b/sys/contrib/dev/acpica/components/debugger/dbinput.c index 50463d06d461..76a3aa112299 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbinput.c +++ b/sys/contrib/dev/acpica/components/debugger/dbinput.c @@ -642,7 +642,7 @@ AcpiDbGetNextToken ( /* Remove any spaces at the beginning, ignore blank lines */ - while (*String && isspace (*String)) + while (*String && isspace ((int) *String)) { String++; } @@ -754,7 +754,7 @@ AcpiDbGetNextToken ( /* Find end of token */ - while (*String && !isspace (*String)) + while (*String && !isspace ((int) *String)) { String++; } diff --git a/sys/contrib/dev/acpica/components/debugger/dbobject.c b/sys/contrib/dev/acpica/components/debugger/dbobject.c index f6bca7ea65b1..eb38f1315e73 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbobject.c +++ b/sys/contrib/dev/acpica/components/debugger/dbobject.c @@ -201,7 +201,7 @@ AcpiDbDumpMethodInfo ( /* Ignore control codes, they are not errors */ - if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) + if (ACPI_CNTL_EXCEPTION (Status)) { return; } diff --git a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c index 88658cfac8f8..5c41c5a2e308 100644 --- a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c +++ b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c @@ -400,7 +400,7 @@ AcpiDmBlockType ( return (BLOCK_NONE); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case AML_PACKAGE_OP: case AML_VARIABLE_PACKAGE_OP: @@ -422,7 +422,7 @@ AcpiDmBlockType ( return (BLOCK_NONE); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: @@ -688,7 +688,7 @@ AcpiDmDescendingOp ( return (AE_OK); } - /* Fallthrough */ + ACPI_FALLTHROUGH; default: @@ -772,7 +772,7 @@ AcpiDmDescendingOp ( AcpiDmNamestring (NextOp->Common.Value.Name); AcpiOsPrintf (", "); - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: diff --git a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c index 5452cc8e763b..22821f258ce3 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c @@ -210,7 +210,7 @@ AcpiDsExecBeginControlOp ( } } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case AML_IF_OP: /* diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c index 42566e7ce7cf..33ed97ce8f87 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c @@ -254,7 +254,7 @@ AcpiDsDumpMethodStack ( /* Ignore control codes, they are not errors */ - if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) + if (ACPI_CNTL_EXCEPTION (Status)) { return_VOID; } diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c index 267cca7e6507..329e29749046 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c @@ -772,8 +772,7 @@ AcpiDsExecEndOp ( break; } - /* Fall through */ - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case AML_INT_EVAL_SUBTREE_OP: diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c index 02b215aff735..0bd36d81c623 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c @@ -375,7 +375,7 @@ AcpiDsLoad1BeginOp ( break; } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c index e47f0c23d47a..7c1994296459 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c @@ -366,7 +366,7 @@ AcpiDsLoad2BeginOp ( break; } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: diff --git a/sys/contrib/dev/acpica/components/executer/exfldio.c b/sys/contrib/dev/acpica/components/executer/exfldio.c index 3f9407e80f09..7ca430b267a2 100644 --- a/sys/contrib/dev/acpica/components/executer/exfldio.c +++ b/sys/contrib/dev/acpica/components/executer/exfldio.c @@ -616,7 +616,7 @@ AcpiExFieldDatumIo ( * RegionField case and write the datum to the Operation Region */ - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_TYPE_LOCAL_REGION_FIELD: /* diff --git a/sys/contrib/dev/acpica/components/executer/exresop.c b/sys/contrib/dev/acpica/components/executer/exresop.c index ad9f0132ee05..4ed21ab6aec0 100644 --- a/sys/contrib/dev/acpica/components/executer/exresop.c +++ b/sys/contrib/dev/acpica/components/executer/exresop.c @@ -358,7 +358,7 @@ AcpiExResolveOperands ( TargetOp = AML_DEBUG_OP; - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_REFCLASS_ARG: case ACPI_REFCLASS_LOCAL: @@ -422,7 +422,7 @@ AcpiExResolveOperands ( * Else not a string - fall through to the normal Reference * case below */ - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ARGI_REFERENCE: /* References: */ case ARGI_INTEGER_REF: diff --git a/sys/contrib/dev/acpica/components/executer/exstore.c b/sys/contrib/dev/acpica/components/executer/exstore.c index f90b702627af..067ee8b9e4bb 100644 --- a/sys/contrib/dev/acpica/components/executer/exstore.c +++ b/sys/contrib/dev/acpica/components/executer/exstore.c @@ -248,7 +248,7 @@ AcpiExStore ( return_ACPI_STATUS (AE_OK); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: @@ -585,7 +585,7 @@ AcpiExStoreObjectToNode ( break; } - /* Fallthrough */ + ACPI_FALLTHROUGH; case ACPI_TYPE_DEVICE: case ACPI_TYPE_EVENT: diff --git a/sys/contrib/dev/acpica/components/hardware/hwgpe.c b/sys/contrib/dev/acpica/components/hardware/hwgpe.c index 8d8ab0a11211..f645396b136d 100644 --- a/sys/contrib/dev/acpica/components/hardware/hwgpe.c +++ b/sys/contrib/dev/acpica/components/hardware/hwgpe.c @@ -254,7 +254,7 @@ AcpiHwLowSetGpe ( return (AE_BAD_PARAMETER); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_GPE_ENABLE: diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c index 781575cfaf7a..2d56407c5bcf 100644 --- a/sys/contrib/dev/acpica/components/parser/psloop.c +++ b/sys/contrib/dev/acpica/components/parser/psloop.c @@ -410,8 +410,7 @@ AcpiPsParseLoop ( */ WalkState->Op = NULL; Status = AcpiDsGetPredicateValue (WalkState, ACPI_TO_POINTER (TRUE)); - if (ACPI_FAILURE (Status) && - ((Status & AE_CODE_MASK) != AE_CODE_CONTROL)) + if (ACPI_FAILURE (Status) && !ACPI_CNTL_EXCEPTION (Status)) { if (Status == AE_AML_NO_RETURN_VALUE) { diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c index 75ec3dca1aad..41a8e4626287 100644 --- a/sys/contrib/dev/acpica/components/parser/psparse.c +++ b/sys/contrib/dev/acpica/components/parser/psparse.c @@ -533,7 +533,7 @@ AcpiPsNextParseState ( default: Status = CallbackStatus; - if ((CallbackStatus & AE_CODE_MASK) == AE_CODE_CONTROL) + if (ACPI_CNTL_EXCEPTION (CallbackStatus)) { Status = AE_OK; } diff --git a/sys/contrib/dev/acpica/components/utilities/utdelete.c b/sys/contrib/dev/acpica/components/utilities/utdelete.c index 032bf9fae7bf..8ce9196343ca 100644 --- a/sys/contrib/dev/acpica/components/utilities/utdelete.c +++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c @@ -266,7 +266,7 @@ AcpiUtDeleteInternalObj ( (void) AcpiEvDeleteGpeBlock (Object->Device.GpeBlock); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: diff --git a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c index 3c5e591735b0..18e95a254e0d 100644 --- a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c +++ b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c @@ -274,7 +274,7 @@ AcpiUtConvertDecimalString ( * 1) Runtime: terminate with no error, per the ACPI spec * 2) Compiler: return an error */ - if (!isdigit (*String)) + if (!isdigit ((int) *String)) { #ifdef ACPI_ASL_COMPILER Status = AE_BAD_DECIMAL_CONSTANT; @@ -336,7 +336,7 @@ AcpiUtConvertHexString ( * 1) Runtime: terminate with no error, per the ACPI spec * 2) Compiler: return an error */ - if (!isxdigit (*String)) + if (!isxdigit ((int) *String)) { #ifdef ACPI_ASL_COMPILER Status = AE_BAD_HEX_CONSTANT; diff --git a/sys/contrib/dev/acpica/include/acexcep.h b/sys/contrib/dev/acpica/include/acexcep.h index 11c81398e915..8cbd75498642 100644 --- a/sys/contrib/dev/acpica/include/acexcep.h +++ b/sys/contrib/dev/acpica/include/acexcep.h @@ -204,11 +204,11 @@ typedef struct acpi_exception_info #define AE_OK (ACPI_STATUS) 0x0000 -#define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL) -#define ACPI_AML_EXCEPTION(Status) (Status & AE_CODE_AML) -#define ACPI_PROG_EXCEPTION(Status) (Status & AE_CODE_PROGRAMMER) -#define ACPI_TABLE_EXCEPTION(Status) (Status & AE_CODE_ACPI_TABLES) -#define ACPI_CNTL_EXCEPTION(Status) (Status & AE_CODE_CONTROL) +#define ACPI_ENV_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_ENVIRONMENTAL) +#define ACPI_AML_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_AML) +#define ACPI_PROG_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_PROGRAMMER) +#define ACPI_TABLE_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_ACPI_TABLES) +#define ACPI_CNTL_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_CONTROL) /* diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h index 60eb6818b7e3..3e00747aebca 100644 --- a/sys/contrib/dev/acpica/include/acpixf.h +++ b/sys/contrib/dev/acpica/include/acpixf.h @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20201113 +#define ACPI_CA_VERSION 0x20201217 #include #include diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h index 48388c2198ed..1f0a189ab4ba 100644 --- a/sys/contrib/dev/acpica/include/actypes.h +++ b/sys/contrib/dev/acpica/include/actypes.h @@ -1537,5 +1537,10 @@ typedef enum #define ACPI_OPT_END -1 +/* Definitions for explicit fallthrough */ + +#ifndef ACPI_FALLTHROUGH +#define ACPI_FALLTHROUGH do {} while(0) +#endif #endif /* __ACTYPES_H__ */ diff --git a/sys/contrib/dev/acpica/include/platform/acgcc.h b/sys/contrib/dev/acpica/include/platform/acgcc.h index 1b48d6040c64..29ee8a30307a 100644 --- a/sys/contrib/dev/acpica/include/platform/acgcc.h +++ b/sys/contrib/dev/acpica/include/platform/acgcc.h @@ -198,4 +198,19 @@ typedef __builtin_va_list va_list; #define ACPI_USE_NATIVE_MATH64 +/* GCC did not support __has_attribute until 5.1. */ + +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + +/* + * Explictly mark intentional explicit fallthrough to silence + * -Wimplicit-fallthrough in GCC 7.1+. + */ + +#if __has_attribute(__fallthrough__) +#define ACPI_FALLTHROUGH __attribute__((__fallthrough__)) +#endif + #endif /* __ACGCC_H__ */ From owner-dev-commits-src-main@freebsd.org Sat Jan 30 01:54: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 6CC6C521086; Sat, 30 Jan 2021 01:54: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 4DSHMX2Pg7z4jhC; Sat, 30 Jan 2021 01:54: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 451BE51C7; Sat, 30 Jan 2021 01:54: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 10U1smht091758; Sat, 30 Jan 2021 01:54:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U1smN8091757; Sat, 30 Jan 2021 01:54:48 GMT (envelope-from git) Date: Sat, 30 Jan 2021 01:54:48 GMT Message-Id: <202101300154.10U1smN8091757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 29f37e9bcc67 - main - acpica: Import ACPICA 20210105. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29f37e9bcc67d5d94c9d6bbbcf2717e16bf25c4e 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, 30 Jan 2021 01:54:48 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=29f37e9bcc67d5d94c9d6bbbcf2717e16bf25c4e commit 29f37e9bcc67d5d94c9d6bbbcf2717e16bf25c4e Author: Jung-uk Kim AuthorDate: 2021-01-06 03:13:30 +0000 Commit: Jung-uk Kim CommitDate: 2021-01-30 01:53:07 +0000 acpica: Import ACPICA 20210105. (cherry picked from commit a61ec1492c58c40bd0d968794c380668c157e2ef) --- sys/contrib/dev/acpica/changes.txt | 21 +++++++++ sys/contrib/dev/acpica/common/acfileio.c | 2 +- sys/contrib/dev/acpica/common/acgetline.c | 2 +- sys/contrib/dev/acpica/common/adfile.c | 2 +- sys/contrib/dev/acpica/common/adisasm.c | 2 +- sys/contrib/dev/acpica/common/adwalk.c | 2 +- sys/contrib/dev/acpica/common/ahids.c | 2 +- sys/contrib/dev/acpica/common/ahpredef.c | 2 +- sys/contrib/dev/acpica/common/ahtable.c | 4 +- sys/contrib/dev/acpica/common/ahuuids.c | 2 +- sys/contrib/dev/acpica/common/cmfsize.c | 2 +- sys/contrib/dev/acpica/common/dmextern.c | 2 +- sys/contrib/dev/acpica/common/dmrestag.c | 2 +- sys/contrib/dev/acpica/common/dmswitch.c | 2 +- sys/contrib/dev/acpica/common/dmtable.c | 4 +- sys/contrib/dev/acpica/common/dmtables.c | 2 +- sys/contrib/dev/acpica/common/dmtbdump.c | 2 +- sys/contrib/dev/acpica/common/dmtbdump1.c | 2 +- sys/contrib/dev/acpica/common/dmtbdump2.c | 55 +--------------------- sys/contrib/dev/acpica/common/dmtbdump3.c | 55 +--------------------- sys/contrib/dev/acpica/common/dmtbinfo.c | 2 +- sys/contrib/dev/acpica/common/dmtbinfo1.c | 2 +- sys/contrib/dev/acpica/common/dmtbinfo2.c | 24 +--------- sys/contrib/dev/acpica/common/dmtbinfo3.c | 23 +-------- sys/contrib/dev/acpica/common/getopt.c | 2 +- sys/contrib/dev/acpica/compiler/aslallocate.c | 2 +- sys/contrib/dev/acpica/compiler/aslanalyze.c | 2 +- sys/contrib/dev/acpica/compiler/aslascii.c | 2 +- sys/contrib/dev/acpica/compiler/aslbtypes.c | 2 +- sys/contrib/dev/acpica/compiler/aslcache.c | 2 +- sys/contrib/dev/acpica/compiler/aslcodegen.c | 2 +- sys/contrib/dev/acpica/compiler/aslcompile.c | 2 +- sys/contrib/dev/acpica/compiler/aslcompiler.h | 2 +- sys/contrib/dev/acpica/compiler/aslcompiler.l | 2 +- sys/contrib/dev/acpica/compiler/aslcstyle.y | 2 +- sys/contrib/dev/acpica/compiler/asldebug.c | 2 +- sys/contrib/dev/acpica/compiler/asldefine.h | 2 +- sys/contrib/dev/acpica/compiler/aslerror.c | 2 +- sys/contrib/dev/acpica/compiler/aslexternal.c | 2 +- sys/contrib/dev/acpica/compiler/aslfileio.c | 2 +- sys/contrib/dev/acpica/compiler/aslfiles.c | 2 +- sys/contrib/dev/acpica/compiler/aslfold.c | 2 +- sys/contrib/dev/acpica/compiler/aslglobal.h | 2 +- sys/contrib/dev/acpica/compiler/aslhelp.c | 2 +- sys/contrib/dev/acpica/compiler/aslhelpers.y | 2 +- sys/contrib/dev/acpica/compiler/aslhex.c | 2 +- sys/contrib/dev/acpica/compiler/aslkeywords.y | 2 +- sys/contrib/dev/acpica/compiler/asllength.c | 2 +- sys/contrib/dev/acpica/compiler/asllisting.c | 2 +- sys/contrib/dev/acpica/compiler/asllistsup.c | 2 +- sys/contrib/dev/acpica/compiler/aslload.c | 2 +- sys/contrib/dev/acpica/compiler/asllookup.c | 2 +- sys/contrib/dev/acpica/compiler/aslmain.c | 2 +- sys/contrib/dev/acpica/compiler/aslmap.c | 2 +- sys/contrib/dev/acpica/compiler/aslmapenter.c | 2 +- sys/contrib/dev/acpica/compiler/aslmapoutput.c | 2 +- sys/contrib/dev/acpica/compiler/aslmaputils.c | 2 +- sys/contrib/dev/acpica/compiler/aslmessages.c | 2 +- sys/contrib/dev/acpica/compiler/aslmessages.h | 2 +- sys/contrib/dev/acpica/compiler/aslmethod.c | 2 +- sys/contrib/dev/acpica/compiler/aslnamesp.c | 2 +- sys/contrib/dev/acpica/compiler/asloffset.c | 2 +- sys/contrib/dev/acpica/compiler/aslopcodes.c | 2 +- sys/contrib/dev/acpica/compiler/asloperands.c | 2 +- sys/contrib/dev/acpica/compiler/aslopt.c | 2 +- sys/contrib/dev/acpica/compiler/asloptions.c | 2 +- sys/contrib/dev/acpica/compiler/aslparseop.c | 2 +- sys/contrib/dev/acpica/compiler/aslparser.y | 2 +- sys/contrib/dev/acpica/compiler/aslpld.c | 2 +- sys/contrib/dev/acpica/compiler/aslpredef.c | 2 +- sys/contrib/dev/acpica/compiler/aslprepkg.c | 2 +- sys/contrib/dev/acpica/compiler/aslprimaries.y | 2 +- sys/contrib/dev/acpica/compiler/aslprintf.c | 2 +- sys/contrib/dev/acpica/compiler/aslprune.c | 2 +- sys/contrib/dev/acpica/compiler/aslresource.c | 2 +- sys/contrib/dev/acpica/compiler/aslresources.y | 2 +- sys/contrib/dev/acpica/compiler/aslrestype1.c | 2 +- sys/contrib/dev/acpica/compiler/aslrestype1i.c | 2 +- sys/contrib/dev/acpica/compiler/aslrestype2.c | 2 +- sys/contrib/dev/acpica/compiler/aslrestype2d.c | 2 +- sys/contrib/dev/acpica/compiler/aslrestype2e.c | 2 +- sys/contrib/dev/acpica/compiler/aslrestype2q.c | 2 +- sys/contrib/dev/acpica/compiler/aslrestype2s.c | 2 +- sys/contrib/dev/acpica/compiler/aslrestype2w.c | 2 +- sys/contrib/dev/acpica/compiler/aslrules.y | 2 +- sys/contrib/dev/acpica/compiler/aslstartup.c | 2 +- sys/contrib/dev/acpica/compiler/aslstubs.c | 2 +- sys/contrib/dev/acpica/compiler/aslsupport.l | 2 +- sys/contrib/dev/acpica/compiler/aslsupport.y | 2 +- sys/contrib/dev/acpica/compiler/asltokens.y | 2 +- sys/contrib/dev/acpica/compiler/asltransform.c | 2 +- sys/contrib/dev/acpica/compiler/asltree.c | 2 +- sys/contrib/dev/acpica/compiler/asltypes.h | 2 +- sys/contrib/dev/acpica/compiler/asltypes.y | 2 +- sys/contrib/dev/acpica/compiler/aslutils.c | 2 +- sys/contrib/dev/acpica/compiler/asluuid.c | 2 +- sys/contrib/dev/acpica/compiler/aslwalks.c | 2 +- sys/contrib/dev/acpica/compiler/aslxref.c | 2 +- sys/contrib/dev/acpica/compiler/aslxrefout.c | 2 +- sys/contrib/dev/acpica/compiler/cvcompiler.c | 2 +- sys/contrib/dev/acpica/compiler/cvdisasm.c | 2 +- sys/contrib/dev/acpica/compiler/cvparser.c | 2 +- sys/contrib/dev/acpica/compiler/dtcompile.c | 2 +- sys/contrib/dev/acpica/compiler/dtcompiler.h | 12 +---- sys/contrib/dev/acpica/compiler/dtcompilerparser.l | 2 +- sys/contrib/dev/acpica/compiler/dtcompilerparser.y | 2 +- sys/contrib/dev/acpica/compiler/dtexpress.c | 2 +- sys/contrib/dev/acpica/compiler/dtfield.c | 2 +- sys/contrib/dev/acpica/compiler/dtio.c | 2 +- sys/contrib/dev/acpica/compiler/dtparser.l | 2 +- sys/contrib/dev/acpica/compiler/dtparser.y | 2 +- sys/contrib/dev/acpica/compiler/dtsubtable.c | 2 +- sys/contrib/dev/acpica/compiler/dttable.c | 2 +- sys/contrib/dev/acpica/compiler/dttable1.c | 2 +- sys/contrib/dev/acpica/compiler/dttable2.c | 52 +------------------- sys/contrib/dev/acpica/compiler/dttemplate.c | 2 +- sys/contrib/dev/acpica/compiler/dttemplate.h | 29 +----------- sys/contrib/dev/acpica/compiler/dtutils.c | 2 +- sys/contrib/dev/acpica/compiler/preprocess.h | 2 +- sys/contrib/dev/acpica/compiler/prexpress.c | 2 +- sys/contrib/dev/acpica/compiler/prmacros.c | 2 +- sys/contrib/dev/acpica/compiler/prparser.l | 2 +- sys/contrib/dev/acpica/compiler/prparser.y | 2 +- sys/contrib/dev/acpica/compiler/prscan.c | 2 +- sys/contrib/dev/acpica/compiler/prutils.c | 2 +- .../dev/acpica/components/debugger/dbcmds.c | 2 +- .../dev/acpica/components/debugger/dbconvert.c | 2 +- .../dev/acpica/components/debugger/dbdisply.c | 2 +- .../dev/acpica/components/debugger/dbexec.c | 2 +- .../dev/acpica/components/debugger/dbfileio.c | 2 +- .../dev/acpica/components/debugger/dbhistry.c | 2 +- .../dev/acpica/components/debugger/dbinput.c | 2 +- .../dev/acpica/components/debugger/dbmethod.c | 2 +- .../dev/acpica/components/debugger/dbnames.c | 2 +- .../dev/acpica/components/debugger/dbobject.c | 2 +- .../dev/acpica/components/debugger/dbstats.c | 2 +- .../dev/acpica/components/debugger/dbtest.c | 2 +- .../dev/acpica/components/debugger/dbutils.c | 2 +- .../dev/acpica/components/debugger/dbxface.c | 2 +- .../dev/acpica/components/disassembler/dmbuffer.c | 2 +- .../dev/acpica/components/disassembler/dmcstyle.c | 2 +- .../acpica/components/disassembler/dmdeferred.c | 2 +- .../dev/acpica/components/disassembler/dmnames.c | 2 +- .../dev/acpica/components/disassembler/dmopcode.c | 2 +- .../dev/acpica/components/disassembler/dmresrc.c | 2 +- .../dev/acpica/components/disassembler/dmresrcl.c | 2 +- .../dev/acpica/components/disassembler/dmresrcl2.c | 2 +- .../dev/acpica/components/disassembler/dmresrcs.c | 2 +- .../dev/acpica/components/disassembler/dmutils.c | 2 +- .../dev/acpica/components/disassembler/dmwalk.c | 2 +- .../dev/acpica/components/dispatcher/dsargs.c | 2 +- .../dev/acpica/components/dispatcher/dscontrol.c | 2 +- .../dev/acpica/components/dispatcher/dsdebug.c | 2 +- .../dev/acpica/components/dispatcher/dsfield.c | 2 +- .../dev/acpica/components/dispatcher/dsinit.c | 2 +- .../dev/acpica/components/dispatcher/dsmethod.c | 2 +- .../dev/acpica/components/dispatcher/dsmthdat.c | 2 +- .../dev/acpica/components/dispatcher/dsobject.c | 2 +- .../dev/acpica/components/dispatcher/dsopcode.c | 2 +- .../dev/acpica/components/dispatcher/dspkginit.c | 2 +- .../dev/acpica/components/dispatcher/dsutils.c | 2 +- .../dev/acpica/components/dispatcher/dswexec.c | 2 +- .../dev/acpica/components/dispatcher/dswload.c | 2 +- .../dev/acpica/components/dispatcher/dswload2.c | 2 +- .../dev/acpica/components/dispatcher/dswscope.c | 2 +- .../dev/acpica/components/dispatcher/dswstate.c | 2 +- sys/contrib/dev/acpica/components/events/evevent.c | 2 +- sys/contrib/dev/acpica/components/events/evglock.c | 2 +- sys/contrib/dev/acpica/components/events/evgpe.c | 2 +- .../dev/acpica/components/events/evgpeblk.c | 2 +- .../dev/acpica/components/events/evgpeinit.c | 2 +- .../dev/acpica/components/events/evgpeutil.c | 2 +- .../dev/acpica/components/events/evhandler.c | 2 +- sys/contrib/dev/acpica/components/events/evmisc.c | 2 +- .../dev/acpica/components/events/evregion.c | 2 +- .../dev/acpica/components/events/evrgnini.c | 2 +- sys/contrib/dev/acpica/components/events/evsci.c | 2 +- sys/contrib/dev/acpica/components/events/evxface.c | 2 +- .../dev/acpica/components/events/evxfevnt.c | 2 +- sys/contrib/dev/acpica/components/events/evxfgpe.c | 2 +- .../dev/acpica/components/events/evxfregn.c | 2 +- .../dev/acpica/components/executer/exconcat.c | 2 +- .../dev/acpica/components/executer/exconfig.c | 2 +- .../dev/acpica/components/executer/exconvrt.c | 2 +- .../dev/acpica/components/executer/excreate.c | 2 +- .../dev/acpica/components/executer/exdebug.c | 2 +- .../dev/acpica/components/executer/exdump.c | 2 +- .../dev/acpica/components/executer/exfield.c | 2 +- .../dev/acpica/components/executer/exfldio.c | 2 +- .../dev/acpica/components/executer/exmisc.c | 2 +- .../dev/acpica/components/executer/exmutex.c | 2 +- .../dev/acpica/components/executer/exnames.c | 2 +- .../dev/acpica/components/executer/exoparg1.c | 2 +- .../dev/acpica/components/executer/exoparg2.c | 2 +- .../dev/acpica/components/executer/exoparg3.c | 2 +- .../dev/acpica/components/executer/exoparg6.c | 2 +- .../dev/acpica/components/executer/exprep.c | 2 +- .../dev/acpica/components/executer/exregion.c | 2 +- .../dev/acpica/components/executer/exresnte.c | 2 +- .../dev/acpica/components/executer/exresolv.c | 2 +- .../dev/acpica/components/executer/exresop.c | 2 +- .../dev/acpica/components/executer/exserial.c | 2 +- .../dev/acpica/components/executer/exstore.c | 2 +- .../dev/acpica/components/executer/exstoren.c | 2 +- .../dev/acpica/components/executer/exstorob.c | 2 +- .../dev/acpica/components/executer/exsystem.c | 2 +- .../dev/acpica/components/executer/extrace.c | 2 +- .../dev/acpica/components/executer/exutils.c | 2 +- .../dev/acpica/components/hardware/hwacpi.c | 2 +- .../dev/acpica/components/hardware/hwesleep.c | 2 +- sys/contrib/dev/acpica/components/hardware/hwgpe.c | 2 +- sys/contrib/dev/acpica/components/hardware/hwpci.c | 2 +- .../dev/acpica/components/hardware/hwregs.c | 2 +- .../dev/acpica/components/hardware/hwsleep.c | 2 +- .../dev/acpica/components/hardware/hwtimer.c | 2 +- .../dev/acpica/components/hardware/hwvalid.c | 2 +- .../dev/acpica/components/hardware/hwxface.c | 2 +- .../dev/acpica/components/hardware/hwxfsleep.c | 2 +- .../dev/acpica/components/namespace/nsaccess.c | 2 +- .../dev/acpica/components/namespace/nsalloc.c | 2 +- .../dev/acpica/components/namespace/nsarguments.c | 2 +- .../dev/acpica/components/namespace/nsconvert.c | 2 +- .../dev/acpica/components/namespace/nsdump.c | 2 +- .../dev/acpica/components/namespace/nsdumpdv.c | 2 +- .../dev/acpica/components/namespace/nseval.c | 2 +- .../dev/acpica/components/namespace/nsinit.c | 2 +- .../dev/acpica/components/namespace/nsload.c | 2 +- .../dev/acpica/components/namespace/nsnames.c | 2 +- .../dev/acpica/components/namespace/nsobject.c | 2 +- .../dev/acpica/components/namespace/nsparse.c | 2 +- .../dev/acpica/components/namespace/nspredef.c | 2 +- .../dev/acpica/components/namespace/nsprepkg.c | 2 +- .../dev/acpica/components/namespace/nsrepair.c | 2 +- .../dev/acpica/components/namespace/nsrepair2.c | 2 +- .../dev/acpica/components/namespace/nssearch.c | 2 +- .../dev/acpica/components/namespace/nsutils.c | 2 +- .../dev/acpica/components/namespace/nswalk.c | 2 +- .../dev/acpica/components/namespace/nsxfeval.c | 2 +- .../dev/acpica/components/namespace/nsxfname.c | 2 +- .../dev/acpica/components/namespace/nsxfobj.c | 2 +- sys/contrib/dev/acpica/components/parser/psargs.c | 2 +- sys/contrib/dev/acpica/components/parser/psloop.c | 2 +- .../dev/acpica/components/parser/psobject.c | 2 +- .../dev/acpica/components/parser/psopcode.c | 2 +- .../dev/acpica/components/parser/psopinfo.c | 2 +- sys/contrib/dev/acpica/components/parser/psparse.c | 2 +- sys/contrib/dev/acpica/components/parser/psscope.c | 2 +- sys/contrib/dev/acpica/components/parser/pstree.c | 2 +- sys/contrib/dev/acpica/components/parser/psutils.c | 2 +- sys/contrib/dev/acpica/components/parser/pswalk.c | 2 +- sys/contrib/dev/acpica/components/parser/psxface.c | 2 +- .../dev/acpica/components/resources/rsaddr.c | 2 +- .../dev/acpica/components/resources/rscalc.c | 2 +- .../dev/acpica/components/resources/rscreate.c | 2 +- .../dev/acpica/components/resources/rsdump.c | 2 +- .../dev/acpica/components/resources/rsdumpinfo.c | 2 +- .../dev/acpica/components/resources/rsinfo.c | 2 +- sys/contrib/dev/acpica/components/resources/rsio.c | 2 +- .../dev/acpica/components/resources/rsirq.c | 2 +- .../dev/acpica/components/resources/rslist.c | 2 +- .../dev/acpica/components/resources/rsmemory.c | 2 +- .../dev/acpica/components/resources/rsmisc.c | 2 +- .../dev/acpica/components/resources/rsserial.c | 2 +- .../dev/acpica/components/resources/rsutils.c | 2 +- .../dev/acpica/components/resources/rsxface.c | 2 +- sys/contrib/dev/acpica/components/tables/tbdata.c | 2 +- sys/contrib/dev/acpica/components/tables/tbfadt.c | 2 +- sys/contrib/dev/acpica/components/tables/tbfind.c | 2 +- .../dev/acpica/components/tables/tbinstal.c | 2 +- sys/contrib/dev/acpica/components/tables/tbprint.c | 2 +- sys/contrib/dev/acpica/components/tables/tbutils.c | 2 +- sys/contrib/dev/acpica/components/tables/tbxface.c | 2 +- .../dev/acpica/components/tables/tbxfload.c | 2 +- .../dev/acpica/components/tables/tbxfroot.c | 2 +- .../dev/acpica/components/utilities/utaddress.c | 2 +- .../dev/acpica/components/utilities/utalloc.c | 2 +- .../dev/acpica/components/utilities/utascii.c | 2 +- .../dev/acpica/components/utilities/utbuffer.c | 2 +- .../dev/acpica/components/utilities/utcache.c | 2 +- .../dev/acpica/components/utilities/utcopy.c | 2 +- .../dev/acpica/components/utilities/utdebug.c | 2 +- .../dev/acpica/components/utilities/utdecode.c | 2 +- .../dev/acpica/components/utilities/utdelete.c | 2 +- .../dev/acpica/components/utilities/uterror.c | 2 +- .../dev/acpica/components/utilities/uteval.c | 2 +- .../dev/acpica/components/utilities/utexcep.c | 2 +- .../dev/acpica/components/utilities/utglobal.c | 2 +- .../dev/acpica/components/utilities/uthex.c | 2 +- .../dev/acpica/components/utilities/utids.c | 2 +- .../dev/acpica/components/utilities/utinit.c | 2 +- .../dev/acpica/components/utilities/utlock.c | 2 +- .../dev/acpica/components/utilities/utmath.c | 2 +- .../dev/acpica/components/utilities/utmisc.c | 2 +- .../dev/acpica/components/utilities/utmutex.c | 2 +- .../dev/acpica/components/utilities/utnonansi.c | 2 +- .../dev/acpica/components/utilities/utobject.c | 2 +- .../dev/acpica/components/utilities/utosi.c | 2 +- .../dev/acpica/components/utilities/utownerid.c | 2 +- .../dev/acpica/components/utilities/utpredef.c | 2 +- .../dev/acpica/components/utilities/utresdecode.c | 2 +- .../dev/acpica/components/utilities/utresrc.c | 2 +- .../dev/acpica/components/utilities/utstate.c | 2 +- .../dev/acpica/components/utilities/utstring.c | 2 +- .../dev/acpica/components/utilities/utstrsuppt.c | 2 +- .../dev/acpica/components/utilities/utstrtoul64.c | 2 +- .../dev/acpica/components/utilities/uttrack.c | 2 +- .../dev/acpica/components/utilities/utuuid.c | 2 +- .../dev/acpica/components/utilities/utxface.c | 2 +- .../dev/acpica/components/utilities/utxferror.c | 2 +- .../dev/acpica/components/utilities/utxfinit.c | 2 +- .../dev/acpica/components/utilities/utxfmutex.c | 2 +- sys/contrib/dev/acpica/include/acapps.h | 4 +- sys/contrib/dev/acpica/include/acbuffer.h | 2 +- sys/contrib/dev/acpica/include/acclib.h | 2 +- sys/contrib/dev/acpica/include/accommon.h | 2 +- sys/contrib/dev/acpica/include/acconfig.h | 2 +- sys/contrib/dev/acpica/include/acconvert.h | 2 +- sys/contrib/dev/acpica/include/acdebug.h | 2 +- sys/contrib/dev/acpica/include/acdisasm.h | 14 +----- sys/contrib/dev/acpica/include/acdispat.h | 2 +- sys/contrib/dev/acpica/include/acevents.h | 2 +- sys/contrib/dev/acpica/include/acexcep.h | 2 +- sys/contrib/dev/acpica/include/acglobal.h | 2 +- sys/contrib/dev/acpica/include/achware.h | 2 +- sys/contrib/dev/acpica/include/acinterp.h | 2 +- sys/contrib/dev/acpica/include/aclocal.h | 2 +- sys/contrib/dev/acpica/include/acmacros.h | 2 +- sys/contrib/dev/acpica/include/acnames.h | 2 +- sys/contrib/dev/acpica/include/acnamesp.h | 2 +- sys/contrib/dev/acpica/include/acobject.h | 2 +- sys/contrib/dev/acpica/include/acopcode.h | 2 +- sys/contrib/dev/acpica/include/acoutput.h | 2 +- sys/contrib/dev/acpica/include/acparser.h | 2 +- sys/contrib/dev/acpica/include/acpi.h | 2 +- sys/contrib/dev/acpica/include/acpiosxf.h | 2 +- sys/contrib/dev/acpica/include/acpixf.h | 4 +- sys/contrib/dev/acpica/include/acpredef.h | 2 +- sys/contrib/dev/acpica/include/acresrc.h | 2 +- sys/contrib/dev/acpica/include/acrestyp.h | 2 +- sys/contrib/dev/acpica/include/acstruct.h | 2 +- sys/contrib/dev/acpica/include/actables.h | 2 +- sys/contrib/dev/acpica/include/actbinfo.h | 4 +- sys/contrib/dev/acpica/include/actbl.h | 2 +- sys/contrib/dev/acpica/include/actbl1.h | 2 +- sys/contrib/dev/acpica/include/actbl2.h | 31 +----------- sys/contrib/dev/acpica/include/actbl3.h | 30 +----------- sys/contrib/dev/acpica/include/actypes.h | 2 +- sys/contrib/dev/acpica/include/acutils.h | 2 +- sys/contrib/dev/acpica/include/acuuid.h | 2 +- sys/contrib/dev/acpica/include/amlcode.h | 2 +- sys/contrib/dev/acpica/include/amlresrc.h | 2 +- sys/contrib/dev/acpica/include/platform/acenv.h | 2 +- sys/contrib/dev/acpica/include/platform/acenvex.h | 2 +- .../dev/acpica/include/platform/acfreebsd.h | 2 +- sys/contrib/dev/acpica/include/platform/acgcc.h | 2 +- sys/contrib/dev/acpica/include/platform/acgccex.h | 2 +- .../acpica/os_specific/service_layers/osunixxf.c | 2 +- 357 files changed, 379 insertions(+), 669 deletions(-) diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt index d27547d31b76..e58f906382b5 100644 --- a/sys/contrib/dev/acpica/changes.txt +++ b/sys/contrib/dev/acpica/changes.txt @@ -1,3 +1,24 @@ +---------------------------------------- +05 January 2021. Summary of changes for version 20210105: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Updated all copyrights to 2021. This affects all ACPICA source code +modules. + +2) iASL Compiler/Disassembler and ACPICA tools: + +ASL test suite (ASLTS): Updated all copyrights to 2021. + +Tools and utilities: Updated all signon copyrights to 2021. + +iASL Table Compiler: Removed support for obsolete ACPI tables: VRTC, +MTMR. Al Stone. + + ---------------------------------------- 17 December 2020. Summary of changes for version 20201217: diff --git a/sys/contrib/dev/acpica/common/acfileio.c b/sys/contrib/dev/acpica/common/acfileio.c index 55a15c8d6e13..5124e2d7f1ed 100644 --- a/sys/contrib/dev/acpica/common/acfileio.c +++ b/sys/contrib/dev/acpica/common/acfileio.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/acgetline.c b/sys/contrib/dev/acpica/common/acgetline.c index b8ead45f155b..1c00f33e1775 100644 --- a/sys/contrib/dev/acpica/common/acgetline.c +++ b/sys/contrib/dev/acpica/common/acgetline.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/adfile.c b/sys/contrib/dev/acpica/common/adfile.c index 5196c2fcc6fe..61df767eb690 100644 --- a/sys/contrib/dev/acpica/common/adfile.c +++ b/sys/contrib/dev/acpica/common/adfile.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/adisasm.c b/sys/contrib/dev/acpica/common/adisasm.c index 2ef3dfc49338..1c45e52413fd 100644 --- a/sys/contrib/dev/acpica/common/adisasm.c +++ b/sys/contrib/dev/acpica/common/adisasm.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/adwalk.c b/sys/contrib/dev/acpica/common/adwalk.c index b4d38922a9f8..133a4d98bb26 100644 --- a/sys/contrib/dev/acpica/common/adwalk.c +++ b/sys/contrib/dev/acpica/common/adwalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/ahids.c b/sys/contrib/dev/acpica/common/ahids.c index 0ebdde314e16..6249fa40369a 100644 --- a/sys/contrib/dev/acpica/common/ahids.c +++ b/sys/contrib/dev/acpica/common/ahids.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/ahpredef.c b/sys/contrib/dev/acpica/common/ahpredef.c index 6853c7d359c1..5f407bcbf2f4 100644 --- a/sys/contrib/dev/acpica/common/ahpredef.c +++ b/sys/contrib/dev/acpica/common/ahpredef.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/ahtable.c b/sys/contrib/dev/acpica/common/ahtable.c index 7638b43b5f5f..cf369e4c0695 100644 --- a/sys/contrib/dev/acpica/common/ahtable.c +++ b/sys/contrib/dev/acpica/common/ahtable.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License @@ -229,7 +229,6 @@ const AH_TABLE AcpiGbl_SupportedTables[] = {ACPI_SIG_MPST, "Memory Power State Table"}, {ACPI_SIG_MSCT, "Maximum System Characteristics Table"}, {ACPI_SIG_MSDM, "Microsoft Data Management table"}, - {ACPI_SIG_MTMR, "MID Timer Table"}, {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, {ACPI_SIG_PDTT, "Platform Debug Trigger Table"}, @@ -252,7 +251,6 @@ const AH_TABLE AcpiGbl_SupportedTables[] = {ACPI_SIG_TCPA, "Trusted Computing Platform Alliance table"}, {ACPI_SIG_TPM2, "Trusted Platform Module hardware interface table"}, {ACPI_SIG_UEFI, "UEFI Boot Optimization Table"}, - {ACPI_SIG_VRTC, "Virtual Real-Time Clock Table"}, {ACPI_SIG_WAET, "Windows ACPI Emulated Devices Table"}, {ACPI_SIG_WDAT, "Watchdog Action Table"}, {ACPI_SIG_WDDT, "Watchdog Description Table"}, diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c index 19c881c964fa..13c764d298a8 100644 --- a/sys/contrib/dev/acpica/common/ahuuids.c +++ b/sys/contrib/dev/acpica/common/ahuuids.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/cmfsize.c b/sys/contrib/dev/acpica/common/cmfsize.c index c6718faebcc9..7026c17b43bc 100644 --- a/sys/contrib/dev/acpica/common/cmfsize.c +++ b/sys/contrib/dev/acpica/common/cmfsize.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmextern.c b/sys/contrib/dev/acpica/common/dmextern.c index 44494cbff8bd..df6de46a2a4f 100644 --- a/sys/contrib/dev/acpica/common/dmextern.c +++ b/sys/contrib/dev/acpica/common/dmextern.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmrestag.c b/sys/contrib/dev/acpica/common/dmrestag.c index a79eb0bf4027..15ddb8f2da44 100644 --- a/sys/contrib/dev/acpica/common/dmrestag.c +++ b/sys/contrib/dev/acpica/common/dmrestag.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmswitch.c b/sys/contrib/dev/acpica/common/dmswitch.c index 44aab815f0b6..c1a00333204d 100644 --- a/sys/contrib/dev/acpica/common/dmswitch.c +++ b/sys/contrib/dev/acpica/common/dmswitch.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c index 635828ebe777..565a76071aad 100644 --- a/sys/contrib/dev/acpica/common/dmtable.c +++ b/sys/contrib/dev/acpica/common/dmtable.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License @@ -509,7 +509,6 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst}, {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct}, {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm}, - {ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr}, {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt}, @@ -530,7 +529,6 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa}, {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2}, {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi}, - {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc}, {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet}, {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat}, {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt}, diff --git a/sys/contrib/dev/acpica/common/dmtables.c b/sys/contrib/dev/acpica/common/dmtables.c index 33f9227b989d..db2aa172710f 100644 --- a/sys/contrib/dev/acpica/common/dmtables.c +++ b/sys/contrib/dev/acpica/common/dmtables.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c index bd3e00de31e0..1f8e147f06f4 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump.c +++ b/sys/contrib/dev/acpica/common/dmtbdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmtbdump1.c b/sys/contrib/dev/acpica/common/dmtbdump1.c index 27e754395a22..b9b30dc2f4a5 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump1.c +++ b/sys/contrib/dev/acpica/common/dmtbdump1.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmtbdump2.c b/sys/contrib/dev/acpica/common/dmtbdump2.c index bc20d42450ed..e5124a26d587 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump2.c +++ b/sys/contrib/dev/acpica/common/dmtbdump2.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License @@ -1114,59 +1114,6 @@ AcpiDmDumpMsct ( } -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpMtmr - * - * PARAMETERS: Table - A MTMR table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a MTMR - * - ******************************************************************************/ - -void -AcpiDmDumpMtmr ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset = sizeof (ACPI_TABLE_MTMR); - ACPI_MTMR_ENTRY *Subtable; - - - /* Main table */ - - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable */ - - Offset += sizeof (ACPI_MTMR_ENTRY); - Subtable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Subtable, - sizeof (ACPI_MTMR_ENTRY)); - } -} - - /******************************************************************************* * * FUNCTION: AcpiDmDumpNfit diff --git a/sys/contrib/dev/acpica/common/dmtbdump3.c b/sys/contrib/dev/acpica/common/dmtbdump3.c index 948675781c54..0dac4d401a2c 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump3.c +++ b/sys/contrib/dev/acpica/common/dmtbdump3.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License @@ -601,59 +601,6 @@ AcpiDmDumpTpm2 ( } -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpVrtc - * - * PARAMETERS: Table - A VRTC table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a VRTC - * - ******************************************************************************/ - -void -AcpiDmDumpVrtc ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset = sizeof (ACPI_TABLE_VRTC); - ACPI_VRTC_ENTRY *Subtable; - - - /* Main table */ - - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable */ - - Offset += sizeof (ACPI_VRTC_ENTRY); - Subtable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Subtable, - sizeof (ACPI_VRTC_ENTRY)); - } -} - - /******************************************************************************* * * FUNCTION: AcpiDmDumpWdat diff --git a/sys/contrib/dev/acpica/common/dmtbinfo.c b/sys/contrib/dev/acpica/common/dmtbinfo.c index c4a449a0622c..9e9fdd7e63c7 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmtbinfo1.c b/sys/contrib/dev/acpica/common/dmtbinfo1.c index 133bec7b6220..9792f47ac377 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo1.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo1.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/common/dmtbinfo2.c b/sys/contrib/dev/acpica/common/dmtbinfo2.c index da919afb32e9..9056c043129f 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo2.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo2.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License @@ -909,28 +909,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] = }; -/******************************************************************************* - * - * MTMR - MID Timer Table - * - ******************************************************************************/ - -ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[] = -{ - ACPI_DMT_TERMINATOR -}; - -/* MTMR Subtables - MTMR Entry */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[] = -{ - {ACPI_DMT_GAS, ACPI_MTMR0_OFFSET (PhysicalAddress), "PhysicalAddress", 0}, - {ACPI_DMT_UINT32, ACPI_MTMR0_OFFSET (Frequency), "Frequency", 0}, - {ACPI_DMT_UINT32, ACPI_MTMR0_OFFSET (Irq), "IRQ", 0}, - ACPI_DMT_TERMINATOR -}; - - /******************************************************************************* * * NFIT - NVDIMM Firmware Interface Table and Subtables - (ACPI 6.0) diff --git a/sys/contrib/dev/acpica/common/dmtbinfo3.c b/sys/contrib/dev/acpica/common/dmtbinfo3.c index 1c2995717089..d2526f1a834a 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo3.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo3.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License @@ -526,27 +526,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] = }; -/******************************************************************************* - * - * VRTC - Virtual Real Time Clock Table - * - ******************************************************************************/ - -ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[] = -{ - ACPI_DMT_TERMINATOR -}; - -/* VRTC Subtables - VRTC Entry */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[] = -{ - {ACPI_DMT_GAS, ACPI_VRTC0_OFFSET (PhysicalAddress), "PhysicalAddress", 0}, - {ACPI_DMT_UINT32, ACPI_VRTC0_OFFSET (Irq), "IRQ", 0}, - ACPI_DMT_TERMINATOR -}; - - /******************************************************************************* * * WAET - Windows ACPI Emulated devices Table diff --git a/sys/contrib/dev/acpica/common/getopt.c b/sys/contrib/dev/acpica/common/getopt.c index 933db7630d79..1fe8980f8615 100644 --- a/sys/contrib/dev/acpica/common/getopt.c +++ b/sys/contrib/dev/acpica/common/getopt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/compiler/aslallocate.c b/sys/contrib/dev/acpica/compiler/aslallocate.c index 6c7c7b313e27..c0e3dbc3ae89 100644 --- a/sys/contrib/dev/acpica/compiler/aslallocate.c +++ b/sys/contrib/dev/acpica/compiler/aslallocate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c index fe1f2f8cd410..dfc867a6bdd9 100644 --- a/sys/contrib/dev/acpica/compiler/aslanalyze.c +++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/compiler/aslascii.c b/sys/contrib/dev/acpica/compiler/aslascii.c index 47334b41fdeb..a74c899e5579 100644 --- a/sys/contrib/dev/acpica/compiler/aslascii.c +++ b/sys/contrib/dev/acpica/compiler/aslascii.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/compiler/aslbtypes.c b/sys/contrib/dev/acpica/compiler/aslbtypes.c index 03a4794448c5..04e4819b32c8 100644 --- a/sys/contrib/dev/acpica/compiler/aslbtypes.c +++ b/sys/contrib/dev/acpica/compiler/aslbtypes.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * * 2. License diff --git a/sys/contrib/dev/acpica/compiler/aslcache.c b/sys/contrib/dev/acpica/compiler/aslcache.c index 76026276c586..062e288c2e90 100644 --- a/sys/contrib/dev/acpica/compiler/aslcache.c +++ b/sys/contrib/dev/acpica/compiler/aslcache.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp. * All rights reserved. * *** 4554 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sat Jan 30 05:52: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 49176526166; Sat, 30 Jan 2021 05:52: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 4DSNdm1cnRz3CrK; Sat, 30 Jan 2021 05:52: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 2A7D710674; Sat, 30 Jan 2021 05:52: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 10U5qSCg005000; Sat, 30 Jan 2021 05:52:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U5qSUc004999; Sat, 30 Jan 2021 05:52:28 GMT (envelope-from git) Date: Sat, 30 Jan 2021 05:52:28 GMT Message-Id: <202101300552.10U5qSUc004999@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: 9ca71db4959f - main - ofed: fix the WITH_OFED_EXTRA build 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: 9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb 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, 30 Jan 2021 05:52:28 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb commit 9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb Author: Kyle Evans AuthorDate: 2021-01-30 05:48:28 +0000 Commit: Kyle Evans CommitDate: 2021-01-30 05:52:13 +0000 ofed: fix the WITH_OFED_EXTRA build This option was not tested when WARNS was globally lifted in the src tree up to 6. Drop WARNS back down to unbreak the build; note that this is still enabling more warnings than it had before the WARNS change, so the gcc build may need to be independently evaluated at this level. PR: 252865 Reported-by: Build Option Servey via Michael Dexter MFC-after: 3 days --- usr.bin/ofed/opensm/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/ofed/opensm/Makefile b/usr.bin/ofed/opensm/Makefile index 2c1f504dc191..738b6ace31a1 100644 --- a/usr.bin/ofed/opensm/Makefile +++ b/usr.bin/ofed/opensm/Makefile @@ -99,4 +99,6 @@ CFLAGS+= -I${_spath:H} -DHAVE_CONFIG_H=1 CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband LIBADD= opensm osmvendor osmcomp wrap pthread +WARNS?= 2 + .include From owner-dev-commits-src-main@freebsd.org Sat Jan 30 06:07: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 AC349526869; Sat, 30 Jan 2021 06:07: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 4DSNzT4T02z3D9n; Sat, 30 Jan 2021 06:07: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 8C2DC108A7; Sat, 30 Jan 2021 06:07: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 10U67ngT018699; Sat, 30 Jan 2021 06:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U67nV0018698; Sat, 30 Jan 2021 06:07:49 GMT (envelope-from git) Date: Sat, 30 Jan 2021 06:07:49 GMT Message-Id: <202101300607.10U67nV0018698@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: e948d980f78d - main - kerberos5: fix the WITH_OPENLDAP build 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: e948d980f78dd2789060b46d3d03ba0d96b23b59 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, 30 Jan 2021 06:07:49 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e948d980f78dd2789060b46d3d03ba0d96b23b59 commit e948d980f78dd2789060b46d3d03ba0d96b23b59 Author: Kyle Evans AuthorDate: 2021-01-30 06:07:17 +0000 Commit: Kyle Evans CommitDate: 2021-01-30 06:07:50 +0000 kerberos5: fix the WITH_OPENLDAP build Restore WARNS to its former glory prior to the global WARNS change to fix the build. MFC-after: 3 days --- kerberos5/lib/libhdb/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kerberos5/lib/libhdb/Makefile b/kerberos5/lib/libhdb/Makefile index 29ba7d2c58a2..fda622d6945a 100644 --- a/kerberos5/lib/libhdb/Makefile +++ b/kerberos5/lib/libhdb/Makefile @@ -7,6 +7,8 @@ LIBADD= asn1 com_err krb5 roken sqlite3 LDADD= ${LDAPLDADD} DPADD= ${LDAPDPADD} +WARNS?= 0 + MAN= HDB.3 hdb_entry_ex.3 MLINKS= HDB.3 hdb__del.3 \ From owner-dev-commits-src-main@freebsd.org Sat Jan 30 08:01: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 5BA544E1399; Sat, 30 Jan 2021 08:01:25 +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 4DSRVY2CRKz3K1G; Sat, 30 Jan 2021 08:01:25 +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 3E8EC1231D; Sat, 30 Jan 2021 08:01:25 +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 10U81PPI070233; Sat, 30 Jan 2021 08:01:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U81P8D070232; Sat, 30 Jan 2021 08:01:25 GMT (envelope-from git) Date: Sat, 30 Jan 2021 08:01:25 GMT Message-Id: <202101300801.10U81P8D070232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: a63eae65ff87 - main - Revert 2d4422e7991a, Eliminate lock order reversal in UFS ffs_unmount(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a63eae65ff8789994c40573a0aa65128022c8bf2 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, 30 Jan 2021 08:01:25 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=a63eae65ff8789994c40573a0aa65128022c8bf2 commit a63eae65ff8789994c40573a0aa65128022c8bf2 Author: Kirk McKusick AuthorDate: 2021-01-30 08:03:37 +0000 Commit: Kirk McKusick CommitDate: 2021-01-30 08:03:37 +0000 Revert 2d4422e7991a, Eliminate lock order reversal in UFS ffs_unmount(). After discussion with Chuck Silvers (chs@) we have decided that there is a better way to resolve this lock order reversal which will be committed separately. Sponsored by: Netflix --- sys/ufs/ffs/ffs_vfsops.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 415bb4614c1a..60d4dad57d03 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1547,14 +1547,7 @@ ffs_unmount(mp, mntflags) BO_UNLOCK(&ump->um_odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); mntfs_freevp(ump->um_devvp); - /* Avoid LOR in vrele by passing in locked vnode and using vput */ - if (vn_lock(ump->um_odevvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { - vput(ump->um_odevvp); - } else { - /* This should never happen, see commit message for details */ - printf("ffs_unmount: Unexpected LK_NOWAIT failure\n"); - vrele(ump->um_odevvp); - } + vrele(ump->um_odevvp); dev_rel(ump->um_dev); mtx_destroy(UFS_MTX(ump)); if (mp->mnt_gjprovider != NULL) { From owner-dev-commits-src-main@freebsd.org Sat Jan 30 13:36: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 52EB34ECE8A; Sat, 30 Jan 2021 13:36:17 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSZwt5zwsz4Yvq; Sat, 30 Jan 2021 13:36:14 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1612013766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jMLfJqB7gFIUqcGCm/y6KjOD1uByYoa4OjCvFNrPF+M=; b=kvVZqD/9f7R6xuG0vZaDrsCNAdaxE4IWXR09BBOQJA+ftIkoptje3lbP6PiUtGohLwVRNt zn2zLFB+UnTDsY0kX6uM4St1mCutUYn+p7hF+OL5bzxnILRcIt12ezMFG/EOY4fsgE3Hr9 zD7P7mShjCZlHk2VvSwYgu6xKMtTBjI= Received: from amy.home (lfbn-idf2-1-745-114.w86-247.abo.wanadoo.fr [86.247.192.114]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 3fb30c52 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 30 Jan 2021 13:36:06 +0000 (UTC) Date: Sat, 30 Jan 2021 14:36:06 +0100 From: Emmanuel Vadot To: Glen Barber Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-Id: <20210130143606.8076a6b3f566d6aaf67d0fec@bidouilliste.com> In-Reply-To: <20210129201845.GU77557@FreeBSD.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> <20210129160708.GR77557@FreeBSD.org> <20210129172829.a5508a3f415baf47acd2fe8c@bidouilliste.com> <20210129164025.GS77557@FreeBSD.org> <20210129210814.e2dba591fe1d309268673a29@bidouilliste.com> <20210129201845.GU77557@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DSZwt5zwsz4Yvq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=kvVZqD/9; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.49 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SPAMHAUS_ZRD(0.00)[212.83.155.74:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.991]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.83.155.74:from]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main,dev-commits-src-all] 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, 30 Jan 2021 13:36:17 -0000 On Fri, 29 Jan 2021 20:18:45 +0000 Glen Barber wrote: > On Fri, Jan 29, 2021 at 09:08:14PM +0100, Emmanuel Vadot wrote: > > On Fri, 29 Jan 2021 16:40:25 +0000 > > Glen Barber wrote: > > > > > On Fri, Jan 29, 2021 at 05:28:29PM +0100, Emmanuel Vadot wrote: > > > > On Fri, 29 Jan 2021 16:07:08 +0000 > > > > Glen Barber wrote: > > > > > > > > > On Fri, Jan 29, 2021 at 04:06:39PM +0100, Emmanuel Vadot wrote: > > > > > > > > > > > > Hi Glen, > > > > > > > > > > > > On Thu, 14 Jan 2021 00:02:01 GMT > > > > > > Glen Barber wrote: > > > > > > > > > > > > > The branch main has been updated by gjb: > > > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > > > > > > > > > > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > > > > Author: Glen Barber > > > > > > > AuthorDate: 2021-01-14 00:01:30 +0000 > > > > > > > Commit: Glen Barber > > > > > > > CommitDate: 2021-01-14 00:01:30 +0000 > > > > > > > > > > > > > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > > > > > > > > > > > > > Sponsored by: Rubicon Communications, LLC (netgate.com) > > > > > > > --- > > > > > > > sys/conf/newvers.sh | 2 +- > > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > > > > > > > index b8667844210b..2a0ace45f2f6 100644 > > > > > > > --- a/sys/conf/newvers.sh > > > > > > > +++ b/sys/conf/newvers.sh > > > > > > > @@ -54,7 +54,7 @@ > > > > > > > > > > > > > > TYPE="FreeBSD" > > > > > > > REVISION="13.0" > > > > > > > -BRANCH="CURRENT" > > > > > > > +BRANCH="ALPHA1" > > > > > > > if [ -n "${BRANCH_OVERRIDE}" ]; then > > > > > > > BRANCH=${BRANCH_OVERRIDE} > > > > > > > fi > > > > > > > > > > > > So since ALPHA1 we do not have new GCP images. > > > > > > Is that intended ? > > > > > > > > > > > > > > > > I see 13.0-ALPHA3 GCE images: > > > > > > > > > > NAME PROJECT FAMILY DEPRECATED STATUS > > > > > freebsd-13-0-alpha3-amd64 freebsd-org-cloud-dev freebsd-13-0 READY > > > > > > > > Ah sorry, no idea how I missed it. > > > > Anyhow when I try to use it in cirrus-ci I have : > > > > Failed to start an instance: INVALID_ARGUMENT: Not Found > > > > > > > > Tested with the full name freebsd-13-0-alpha3-amd64 and the small name > > > > freebsd-13-0. Any tips on that ? > > > > > > > > > > Hmm, I am not sure. I do not see any errors (i.e., from installing > > > ports or the like) in the log. > > > > > > > > > Also there is no 14.0 snapshot while there was some new 11/12 images > > > > > > and no 13-ALPHA3 too it seems. > > > > > > > > > > Right. We likely will not have 14-CURRENT builds until releng/13.0 is > > > > > branched. 13.0-ALPHA3 was built a day later so it is ready for Friday, > > > > > the same as is done for BETA* and RC* builds. > > > > > > > > Ok, I indeed see some alpha3 images on the ftp but I don't see any for > > > > armv7 or aarch64, was there any problems ? > > > > > > > > > > Yes, all arm builds failed because of a problem in the ports tree. > > > > > > -------------------------- begin quoted text --------------------------- > > > Installing gettext-tools-0.21... > > > ===> p5-Locale-gettext-1.07 depends on executable: msgfmt - found > > > ===> Returning to build of p5-Locale-gettext-1.07 > > > ===> p5-Locale-gettext-1.07 depends on package: perl5>=5.32.r0<5.33 - found > > > ===> p5-Locale-gettext-1.07 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so) > > > ===> Configuring for p5-Locale-gettext-1.07 > > > env: /usr/local/bin/perl5.32.1: No such file or directory > > > *** Error code 127 > > > --------------------------- end quoted text ---------------------------- > > > > > > Glen > > > > > > > Mhm ok, is there a place where we can see those errors or at least be > > aware of them ? > > > > Not exactly. I am happy to make the logs public on an as-needed basis, > but they contain environment information that potentially contains > sensitive data (i.e., API keys and such). When there is a specific > cause to a failure, I do ping those involved in the cause (i.e., a port > build failure, or a userland/kernel failure). > > In this case, the error is uninteresting. The failure is exactly as > what is included above. The odd thing though, is > /usr/local/bin/perl5.32.0 is installed in the chroot(8), not > /usr/local/bin/perl5.32.1, but I have not yet had luck tracking down > exactly why. > > Glen > Could it be a latest vs quarterly problem ? head have 5.32.1 and 2021Q1 was only updated on 25th of January to this version. When was the build started ? Also could we have some retry when such failure happens ? (this is especially important in those alpha/beta/rc phase). Cheers, -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Sat Jan 30 16:02: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 AE3B94F1257; Sat, 30 Jan 2021 16:02:12 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay115.isp.belgacom.be (mailrelay115.isp.belgacom.be [195.238.20.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign RSA OV SSL CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSf9H2xTnz4jlx; Sat, 30 Jan 2021 16:02:11 +0000 (UTC) (envelope-from tijl@freebsd.org) IronPort-SDR: RdszWPLMXbov0X8deXBASOhYH4fXt7JMWIVACGyuxmly5DlLToxL8KQU+1uTNep0BIeabJ+R5a p36KGsF+wwlH6SjzIv5X5DaIR3S0conSxQfVNQT0XV/i5pwNmyjcA0LIOPY69J8Jf3UPXY3A86 yJtIsGDmhZg/eTc/QaN3jb5Jw63I6TwL+j8wPFox5/r9Kb6kUWt1EL1jSlKmh3tzkG3mvS5wl2 6PTbNaBN0FQwrykJ1OhEEntPLdOuB0ApOuqpd149vh3vS5q16h4rxnmIbFdId3M3hw883iy1uU UKc= X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AhvNcDhERPcAQUi06dgj3A51GYnF86YWxBRYc79?= =?us-ascii?q?8ds5kLTJ76psi8bnLW6fgltlLVR4KTs6sC17OH9fu8EjJQqdbZ6TZeKcMKD0?= =?us-ascii?q?dEwewt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBw?= =?us-ascii?q?mtfVEtfre9FYHdldm42P6v8JPPfQpImCC9YbRvJxmqsAndrMYbjZZmJ6orxB?= =?us-ascii?q?bErXREduVVyGh1IV6fgwvw6t2/8ZJ+8Slcoe4t+9JFXa7nY6k2ULtUASg8PW?= =?us-ascii?q?so/sPrrx7DTQWO5nsYTGoblwdDDhbG4h/nQJr/qzP2ueVh1iaUO832Vq00Vi?= =?us-ascii?q?+576h3Uh/oiTwIOCA//WrKl8F/lqNboBampxxi347ZZZyeOfRicq/Be94RWH?= =?us-ascii?q?FMVdhNWSNfHoy8bpMPD+sfMuZes4n9vEYFoR+nCQWxGO/j1jpEi3nr1qM4zu?= =?us-ascii?q?shCxnL0gIgEdwQrXrar9f6NKkdXu+pw6fF1inDYvFM1Dvh9ITEbg4trPeRVr?= =?us-ascii?q?xwa8rRzkwvGhvbgFeVrYzuIi2Y1uMKs2iA8eVgUPigi2g8qwpspTWv2sYsio?= =?us-ascii?q?vNho8Oyl7E7zt2z5goKNOlRkB3e9mkEIFftyyDMYZ9X8wtTX1ytikg1r0GpY?= =?us-ascii?q?C0fDIMyJk/2RPSb+GKfoaM7x//V+ucLyt1iGx7db+8mhu+70ytx+n9W8SpzV?= =?us-ascii?q?tHsCRLn9bCu30J2BLe99SLRPR880q82DuB2Qbe4fxKL0AzkKrUMZ8hwrgom5?= =?us-ascii?q?odq0TMADH5l17tjKCLbEkk/fKo6+vhb777pZGcL5d5hwLjPqg0hMCyDvo0Ph?= =?us-ascii?q?ITU2WZ5+iwzrLu8EvkS7tQlPI2iLPWsJXCKMQeoa62HhFa35446xa6EzemyN?= =?us-ascii?q?MYnWQbLF5deBKIkYzpO1bWLfD7F/i/h1WskDJ1yPDcOb3tGInNLnnBkLflZ7?= =?us-ascii?q?py90lcyA0ozd9B4pJbELcBIOnpVk/2rtzYAQc1Mw2yw+n5FNVwzoATVX+VDq?= =?us-ascii?q?OHP67er0WE6v8tLuWSfoMYty7xK/0/6P7viX85l0Udfa6s3ZYPdHC4H/ZmI0?= =?us-ascii?q?GCbHrimNcOD3kFsRElTOP3klGCViRTZ3mqU6Im+j47EJ6mDZvERo21nbOOwj?= =?us-ascii?q?m7EoRKaWBBD1CMFHbod5mfW/sVcyKSONNuniUBVbe7So8h0wqjtAHgy7V5MO?= =?us-ascii?q?Xb4TYYuo/52Nhy/e3Tmgk49SZoAMSFz2GNU2Z0k3sVSDAowqBzuFByylCG0a?= =?us-ascii?q?h9gvxYCcdT6+pSUgcgKZHQ1vZ1C9T2Wg/acNeJUkipTcu9DjEqU9092dgOY1?= =?us-ascii?q?xyG9+6lBDMwzKqA6MJl7yMHJE06bjc0GToK8lhzHbG0awhj1g6QstTK2KmnL?= =?us-ascii?q?V/+hPdB47TjUqWib2ldb8B0yLX82eD12WOtllCUAFsSaXFQWwfZkzOoNvi50?= =?us-ascii?q?LPVLGuCa45PQRf0sGCMbZFZsfujVVcS/ewcOjZNiibmWC9HxDA7/XEXofncS?= =?us-ascii?q?9ViC/PIGYeng05xlrAMhIxUHSPuWXbWQCJERrEZET3/Ox3rmjzGlM1zQWiQV?= =?us-ascii?q?ds2pCO1lgSn/PKGKBb5a4NpCp082Y8J126xd+DToPY/wc=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2ADAAAMghVg/wSs8lFiGgEBAQEBAQE?= =?us-ascii?q?BAQEDAQEBARIBAQEBAgIBAQEBQAeBNAUBAQEBCwGDCxVWAUwYjGRghjsBghk?= =?us-ascii?q?3AYg9giiPKoF8CwEBAQEBAQEBAS4KBAEBhEoCgXkmNAkOAgMBAQEDAgUBAQY?= =?us-ascii?q?BAQEBAQEFBAGGGDkNgjgpAYMSAQU6PxALGC5XBhODJ4MKC7QqgTSFWYN5gQI?= =?us-ascii?q?GgTgBjT1BggCEKj6CRhcEF4c/BIQBnm+cNoMAiTKSNDGDHJ9ohieZJJg9ghF?= =?us-ascii?q?NMAiDJFAZDZcmhUVAAzALLAIGCgEBAwmMFQEB?= X-IPAS-Result: =?us-ascii?q?A2ADAAAMghVg/wSs8lFiGgEBAQEBAQEBAQEDAQEBARIBA?= =?us-ascii?q?QEBAgIBAQEBQAeBNAUBAQEBCwGDCxVWAUwYjGRghjsBghk3AYg9giiPKoF8C?= =?us-ascii?q?wEBAQEBAQEBAS4KBAEBhEoCgXkmNAkOAgMBAQEDAgUBAQYBAQEBAQEFBAGGG?= =?us-ascii?q?DkNgjgpAYMSAQU6PxALGC5XBhODJ4MKC7QqgTSFWYN5gQIGgTgBjT1BggCEK?= =?us-ascii?q?j6CRhcEF4c/BIQBnm+cNoMAiTKSNDGDHJ9ohieZJJg9ghFNMAiDJFAZDZcmh?= =?us-ascii?q?UVAAzALLAIGCgEBAwmMFQEB?= Received: from 4.172-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.172.4]) by relay.skynet.be with ESMTP; 30 Jan 2021 17:02:07 +0100 Received: from localhost (localhost [127.0.0.1]) by kalimero.tijl.coosemans.org (8.16.1/8.16.1) with ESMTP id 10UG272J001274; Sat, 30 Jan 2021 17:02:07 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sat, 30 Jan 2021 17:02:06 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: "Bjoern A. Zeeb" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a6c2507d1bae - main - LinuxKPI: add firmware loading support Message-ID: <20210130170206.76e1319a@FreeBSD.org> In-Reply-To: <202101281645.10SGjwmh088797@gitrepo.freebsd.org> References: <202101281645.10SGjwmh088797@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DSf9H2xTnz4jlx X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE]; local_wl_from(0.00)[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: Sat, 30 Jan 2021 16:02:12 -0000 On Thu, 28 Jan 2021 16:45:58 GMT "Bjoern A. Zeeb" wrote: > The branch main has been updated by bz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a6c2507d1baedb183268e31bc6b6f659a9529904 > > commit a6c2507d1baedb183268e31bc6b6f659a9529904 > Author: Bjoern A. Zeeb > AuthorDate: 2021-01-28 16:05:32 +0000 > Commit: Bjoern A. Zeeb > CommitDate: 2021-01-28 16:05:32 +0000 > > LinuxKPI: add firmware loading support The module fails to load now because it can't find firmware_get_flags. You need to add MODULE_DEPEND(linuxkpi, firmware, 1, 1, 1) in linux_kmod.c From owner-dev-commits-src-main@freebsd.org Sat Jan 30 16:08: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 2CBD54F1805; Sat, 30 Jan 2021 16:08:53 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSfK10ml8z4jl5; Sat, 30 Jan 2021 16:08:53 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612022933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Xoh8UZqv7yUOz6XryUUdRWJwQLwxHtCti3SUE7drqb4=; b=r0LLIq+58qUJo5osj4pg1nxT9sIchB7aKpnBZDp/xCIF7e/eCxadFs45yUCrppD6ufv6AF Oqm5KxDLIW2cdJMUhkvW9CEc6n2fJ0PzJTF4BK9W9zjRhrjpoigtHCaBBb8S+W7pZG4TpK +FjPW7cUpUHcOZPI052KdiO9J6gES0SBr39yx/8uaT/tDdeAhfxSVyTFI3jSbbSl/ydpE5 qFwSs7aw0uo3CZzSjCs187i1LggA43IeEgEmiU1L9bxNYYTijhy5RoNOqyZlyqqh2KP3zK Wuo7i4CBaOuHC4Lh8o0kV659KQlntpUfGBZ0VtCq0DIUSkBtc/b8NVj8UCqkCQ== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id A73111C917; Sat, 30 Jan 2021 16:08:52 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Sat, 30 Jan 2021 16:08:49 +0000 From: Glen Barber To: Emmanuel Vadot Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae27c2d6c4f - main - newvers.sh: set to ALPHA1 as part of the 13.0 cycle Message-ID: <20210130160849.GV77557@FreeBSD.org> References: <202101140002.10E0211m024446@gitrepo.freebsd.org> <20210129160639.bfdabc0df278ec8ee100d8e2@bidouilliste.com> <20210129160708.GR77557@FreeBSD.org> <20210129172829.a5508a3f415baf47acd2fe8c@bidouilliste.com> <20210129164025.GS77557@FreeBSD.org> <20210129210814.e2dba591fe1d309268673a29@bidouilliste.com> <20210129201845.GU77557@FreeBSD.org> <20210130143606.8076a6b3f566d6aaf67d0fec@bidouilliste.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MiMBASdxvnz+XAiL" Content-Disposition: inline In-Reply-To: <20210130143606.8076a6b3f566d6aaf67d0fec@bidouilliste.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612022933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Xoh8UZqv7yUOz6XryUUdRWJwQLwxHtCti3SUE7drqb4=; b=c9n2zVqOOhegbLYniUJ1iXmUAv46ZJoQ0gLWtIvRb1DCkkaxy0/KBvWz1gJNorF45jThvF McLwrUc1bECvFb3wur7sbs/umrynj3laWeQ4Rgzolulv0tdnlwc3ow6rHxtb54jFDipdho uSw8u7L7NYCp9WhrvzkgFRybcC/Hsl+Nd1NR0YMPJJM/hysPBw7tNBR5/62YZc5d0B55TO 9ADQlENqq9SAOHN+wGqYxn9IQYfvsdibQReRv5IGDjhhwkD3Egj+jBljNZx4IcCsYjLGCE 7mK+spNPyX+cJOMjvtET0zBvyoiQyyBOYwxv1Pie7EREGkEs0JNaBYE+jnceSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1612022933; a=rsa-sha256; cv=none; b=uZ4P4xZXneeQqS66lTIeItabY4vQZMP+/TDVzTDEbTnJBlclghHMbCfpGus67/G5jejRnL lUSUa8cgI1xqCKI02oUy5SsHCegpuO3bSasfj8fFB9an8VmPHGsi76Kz8oNzXJ73wTrBTh xn0ndKCuuwKENVKrdg0l895iiKZJbDNmFlQy9nhFTiOCpmLkh3jGLWLkFSnJdH2OYJfcVG 1A4DRvKmK4ZKbIlwZrclTgppu//8zgqHXT/+O3oV/XHB8486AcISP4zB4AJEbrmpp+V2Zm 8KItiVdiAcXnceLkilX7tkzsrEfQAsoh9IF38aNbTenMQsy3/tTNZLNul9r+cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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, 30 Jan 2021 16:08:53 -0000 --MiMBASdxvnz+XAiL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 30, 2021 at 02:36:06PM +0100, Emmanuel Vadot wrote: > On Fri, 29 Jan 2021 20:18:45 +0000 > Glen Barber wrote: >=20 > > On Fri, Jan 29, 2021 at 09:08:14PM +0100, Emmanuel Vadot wrote: > > > On Fri, 29 Jan 2021 16:40:25 +0000 > > > Glen Barber wrote: > > >=20 > > > > On Fri, Jan 29, 2021 at 05:28:29PM +0100, Emmanuel Vadot wrote: > > > > > On Fri, 29 Jan 2021 16:07:08 +0000 > > > > > Glen Barber wrote: > > > > >=20 > > > > > > On Fri, Jan 29, 2021 at 04:06:39PM +0100, Emmanuel Vadot wrote: > > > > > > >=20 > > > > > > > Hi Glen, > > > > > > >=20 > > > > > > > On Thu, 14 Jan 2021 00:02:01 GMT > > > > > > > Glen Barber wrote: > > > > > > >=20 > > > > > > > > The branch main has been updated by gjb: > > > > > > > >=20 > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7ae27c2d6c4f= e4f21e1219bb5d8a37cfc932337b > > > > > > > >=20 > > > > > > > > commit 7ae27c2d6c4fe4f21e1219bb5d8a37cfc932337b > > > > > > > > Author: Glen Barber > > > > > > > > AuthorDate: 2021-01-14 00:01:30 +0000 > > > > > > > > Commit: Glen Barber > > > > > > > > CommitDate: 2021-01-14 00:01:30 +0000 > > > > > > > >=20 > > > > > > > > newvers.sh: set to ALPHA1 as part of the 13.0 cycle > > > > > > > > =20 > > > > > > > > Sponsored by: Rubicon Communications, LLC (netgate.co= m) > > > > > > > > --- > > > > > > > > sys/conf/newvers.sh | 2 +- > > > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > >=20 > > > > > > > > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > > > > > > > > index b8667844210b..2a0ace45f2f6 100644 > > > > > > > > --- a/sys/conf/newvers.sh > > > > > > > > +++ b/sys/conf/newvers.sh > > > > > > > > @@ -54,7 +54,7 @@ > > > > > > > > =20 > > > > > > > > TYPE=3D"FreeBSD" > > > > > > > > REVISION=3D"13.0" > > > > > > > > -BRANCH=3D"CURRENT" > > > > > > > > +BRANCH=3D"ALPHA1" > > > > > > > > if [ -n "${BRANCH_OVERRIDE}" ]; then > > > > > > > > BRANCH=3D${BRANCH_OVERRIDE} > > > > > > > > fi > > > > > > >=20 > > > > > > > So since ALPHA1 we do not have new GCP images. > > > > > > > Is that intended ? > > > > > > >=20 > > > > > >=20 > > > > > > I see 13.0-ALPHA3 GCE images: > > > > > >=20 > > > > > > NAME PROJECT FAMILY = DEPRECATED STATUS > > > > > > freebsd-13-0-alpha3-amd64 freebsd-org-cloud-dev freebsd-13-0 = READY > > > > >=20 > > > > > Ah sorry, no idea how I missed it. > > > > > Anyhow when I try to use it in cirrus-ci I have : > > > > > Failed to start an instance: INVALID_ARGUMENT: Not Found > > > > >=20 > > > > > Tested with the full name freebsd-13-0-alpha3-amd64 and the smal= l name > > > > > freebsd-13-0. Any tips on that ? > > > > >=20 > > > >=20 > > > > Hmm, I am not sure. I do not see any errors (i.e., from installing > > > > ports or the like) in the log. > > > >=20 > > > > > > > Also there is no 14.0 snapshot while there was some new 11/1= 2 images > > > > > > > and no 13-ALPHA3 too it seems. > > > > > >=20 > > > > > > Right. We likely will not have 14-CURRENT builds until releng/= 13.0 is > > > > > > branched. 13.0-ALPHA3 was built a day later so it is ready for= Friday, > > > > > > the same as is done for BETA* and RC* builds. > > > > >=20 > > > > > Ok, I indeed see some alpha3 images on the ftp but I don't see a= ny for > > > > > armv7 or aarch64, was there any problems ? > > > > >=20 > > > >=20 > > > > Yes, all arm builds failed because of a problem in the ports tree. > > > >=20 > > > > -------------------------- begin quoted text ----------------------= ----- > > > > Installing gettext-tools-0.21... > > > > =3D=3D=3D> p5-Locale-gettext-1.07 depends on executable: msgfmt -= found > > > > =3D=3D=3D> Returning to build of p5-Locale-gettext-1.07 > > > > =3D=3D=3D> p5-Locale-gettext-1.07 depends on package: perl5>=3D5.= 32.r0<5.33 - found > > > > =3D=3D=3D> p5-Locale-gettext-1.07 depends on shared library: libi= ntl.so - found (/usr/local/lib/libintl.so) > > > > =3D=3D=3D> Configuring for p5-Locale-gettext-1.07 > > > > env: /usr/local/bin/perl5.32.1: No such file or directory > > > > *** Error code 127 > > > > --------------------------- end quoted text -----------------------= ----- > > > >=20 > > > > Glen > > > >=20 > > >=20 > > > Mhm ok, is there a place where we can see those errors or at least be > > > aware of them ? > > >=20 > >=20 > > Not exactly. I am happy to make the logs public on an as-needed basis, > > but they contain environment information that potentially contains > > sensitive data (i.e., API keys and such). When there is a specific > > cause to a failure, I do ping those involved in the cause (i.e., a port > > build failure, or a userland/kernel failure). > >=20 > > In this case, the error is uninteresting. The failure is exactly as > > what is included above. The odd thing though, is > > /usr/local/bin/perl5.32.0 is installed in the chroot(8), not > > /usr/local/bin/perl5.32.1, but I have not yet had luck tracking down > > exactly why. > >=20 > > Glen > >=20 >=20 > Could it be a latest vs quarterly problem ? No, the ports are built from the ports tree. > head have 5.32.1 and 2021Q1 was only updated on 25th of January to > this version. This is where I am confused, to be honest. The older binary is installed, but the ports version of the checkout has 5.32.1. > When was the build started ? >=20 00:00 UTC Friday. > Also could we have some retry when such failure happens ? (this is > especially important in those alpha/beta/rc phase). >=20 Well, in this case, a retry would not help. I am still investigating how the older version of perl5.32 got installed in the first place. This has not happened before. Glen --MiMBASdxvnz+XAiL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmAVhI0ACgkQAxRYpUeP 4pNsDw//dEKUVdI0vqoPbb9nLUS3hU1RRujCCY8M8k+g+P9JHxm/TG21uGTBPWf5 ybKwQjIPALT5x+mlgBmmbFifevTONbGU/Jwptkc1Q8C2dRgSbJEX5Gx8HNL13/WZ ckDN4kRW81BZMXWoo2P+KmEpTyeJA+pZ9CXrSAFaKVmxpw/HJV/nWv2leLSF/DuO ceeSubgTRT9g+lJfuIJKTaUYs57X/OrkhFbQlrntwePyfKnKXArzuXX95WmMti5x IzB1xEzWsB1UGy3DzGlUpTCpW8rBYgk/m8Jx/Fu7frKXp44UZH5qQXo/ahn9OTJq jiXT6S/cHri/og6NxJ0uNQ5DKZG08+heCeuEyttjcekJh25CatomBnyjQfQvTA7M 9SIxpHHo357g6R95Mu5Un4a0QIjaccHdBPoMrQjjARNY+anmVw55LXVChAAMowME dPWN0V11rYX0aICfEICetmlmhaO5n6FoIvzvUsR5OZTsa+G7XIOmWSYfgHy18tP6 TuhwEYWWUKgS6jmSn3+dQ+eV+VbPc7BrTcEvlKtZSB+axocKDJDul0En4z1AAa2N GcVcL+W77nkRXwt4qEX/LO/q+Dq+hFODFvhFM98IhcI87JsV6AO9OTm0ZJXbGdcu VdGNNlEbNlUzugHZ+lTrZS0mj07H+J4M0hOmiZCdQknJYM6zDqk= =8Zdp -----END PGP SIGNATURE----- --MiMBASdxvnz+XAiL-- From owner-dev-commits-src-main@freebsd.org Sat Jan 30 16:42: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 6DF494F21D1; Sat, 30 Jan 2021 16:42:07 +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 4DSg3M2lBKz4lyj; Sat, 30 Jan 2021 16:42:07 +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 5143B18DC3; Sat, 30 Jan 2021 16:42:07 +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 10UGg7mL049671; Sat, 30 Jan 2021 16:42:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UGg7H4049670; Sat, 30 Jan 2021 16:42:07 GMT (envelope-from git) Date: Sat, 30 Jan 2021 16:42:07 GMT Message-Id: <202101301642.10UGg7H4049670@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: 7587d9823a82 - main - build: options: mention ports in the WITH_OPENLDAP description 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: 7587d9823a8257b9a2d5b2e58c707026061058c6 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, 30 Jan 2021 16:42:07 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7587d9823a8257b9a2d5b2e58c707026061058c6 commit 7587d9823a8257b9a2d5b2e58c707026061058c6 Author: Kyle Evans AuthorDate: 2021-01-30 06:09:10 +0000 Commit: Kyle Evans CommitDate: 2021-01-30 16:41:52 +0000 build: options: mention ports in the WITH_OPENLDAP description There's a third party dependency on this option; currently, net/openldap24-{,sasl-}client. At least mention that an openldap from ports is needed for this option. PR: 252866 Reported-by: Build Option Survey via Michael Dexter MFC-after: 3 days --- share/man/man5/src.conf.5 | 4 ++-- tools/build/options/WITH_OPENLDAP | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index dee1ffb84e20..0e853db0d1bc 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 28, 2021 +.Dd January 30, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1254,7 +1254,7 @@ Set to build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack, mostly examples. .It Va WITH_OPENLDAP -Enable building openldap support for kerberos. +Enable building LDAP support for kerberos using an openldap client from ports. .It Va WITHOUT_OPENMP Set to not build LLVM's OpenMP runtime. .Pp diff --git a/tools/build/options/WITH_OPENLDAP b/tools/build/options/WITH_OPENLDAP index 75f96822eb8c..c815e6160726 100644 --- a/tools/build/options/WITH_OPENLDAP +++ b/tools/build/options/WITH_OPENLDAP @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Enable building openldap support for kerberos. +Enable building LDAP support for kerberos using an openldap client from ports. From owner-dev-commits-src-main@freebsd.org Sat Jan 30 17:30: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 46FF14F39EE; Sat, 30 Jan 2021 17:30: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 4DSh7T0yJGz4pj8; Sat, 30 Jan 2021 17:30: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 13B411972F; Sat, 30 Jan 2021 17:30: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 10UHUjnN013883; Sat, 30 Jan 2021 17:30:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UHUjEd013882; Sat, 30 Jan 2021 17:30:45 GMT (envelope-from git) Date: Sat, 30 Jan 2021 17:30:45 GMT Message-Id: <202101301730.10UHUjEd013882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 7436a63ba908 - main - g_provider_by_name(9): argument can be a geom name or fullpath MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7436a63ba908a52f1a11f202dbacd9f5eb5b9fee 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, 30 Jan 2021 17:30:45 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=7436a63ba908a52f1a11f202dbacd9f5eb5b9fee commit 7436a63ba908a52f1a11f202dbacd9f5eb5b9fee Author: Robert Wing AuthorDate: 2021-01-29 23:18:28 +0000 Commit: Robert Wing CommitDate: 2021-01-30 17:25:10 +0000 g_provider_by_name(9): argument can be a geom name or fullpath The argument passed to g_provider_by_name(9) can be a geom name or a fullpath. - g_provider_by_name() gained this functionality in 769afdc71ea6b0c09dae883ce49d913cbc8cff5b. Reviewed by: imp, kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D27566 --- share/man/man9/g_provider_by_name.9 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man9/g_provider_by_name.9 b/share/man/man9/g_provider_by_name.9 index 56dd303298b6..8293b15b8043 100644 --- a/share/man/man9/g_provider_by_name.9 +++ b/share/man/man9/g_provider_by_name.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd January 29, 2021 .Dt G_PROVIDER_BY_NAME 9 .Os .Sh NAME @@ -44,9 +44,9 @@ and returns the structure bound to it. Argument .Fa name -should be a name, not a full path (i.e., +can be a name or full path (i.e., .Dq Pa da0 , -instead of +or .Dq Pa /dev/da0 ) . .Sh RESTRICTIONS/CONDITIONS The topology lock has to be held. From owner-dev-commits-src-main@freebsd.org Sat Jan 30 17:48: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 5D1E84F3FD9; Sat, 30 Jan 2021 17:48: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 4DShWZ2FhBz4qyP; Sat, 30 Jan 2021 17:48: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 4028419ABA; Sat, 30 Jan 2021 17:48: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 10UHmA8x031787; Sat, 30 Jan 2021 17:48:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UHmA33031786; Sat, 30 Jan 2021 17:48:10 GMT (envelope-from git) Date: Sat, 30 Jan 2021 17:48:10 GMT Message-Id: <202101301748.10UHmA33031786@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: 69557375226a - main - Remove unused GNUCXX option descriptions 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: 69557375226a4ab26eadd47007c1230ce5ce9077 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, 30 Jan 2021 17:48:10 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=69557375226a4ab26eadd47007c1230ce5ce9077 commit 69557375226a4ab26eadd47007c1230ce5ce9077 Author: Ed Maste AuthorDate: 2021-01-30 17:43:42 +0000 Commit: Ed Maste CommitDate: 2021-01-30 17:47:33 +0000 Remove unused GNUCXX option descriptions Missed from 57f804675e65 Reported by: arhchardson in D27974 Sponsored by: The FreeBSD Foundation --- tools/build/options/WITHOUT_GNUCXX | 2 -- tools/build/options/WITH_GNUCXX | 4 ---- 2 files changed, 6 deletions(-) diff --git a/tools/build/options/WITHOUT_GNUCXX b/tools/build/options/WITHOUT_GNUCXX deleted file mode 100644 index b1391c9818a9..000000000000 --- a/tools/build/options/WITHOUT_GNUCXX +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Do not build the GNU C++ stack (g++, libstdc++). diff --git a/tools/build/options/WITH_GNUCXX b/tools/build/options/WITH_GNUCXX deleted file mode 100644 index 1eea8f9958ed..000000000000 --- a/tools/build/options/WITH_GNUCXX +++ /dev/null @@ -1,4 +0,0 @@ -.\" $FreeBSD$ -Build the GNU C++ stack (g++, libstdc++). -This option is deprecated and will be removed before -.Fx 13 . From owner-dev-commits-src-main@freebsd.org Sat Jan 30 18:03:08 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 384504F4832; Sat, 30 Jan 2021 18:03:08 +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 4DShrr15Y1z4rh0; Sat, 30 Jan 2021 18:03:08 +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 187611A20B; Sat, 30 Jan 2021 18:03:08 +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 10UI38Kr057521; Sat, 30 Jan 2021 18:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UI3831057520; Sat, 30 Jan 2021 18:03:08 GMT (envelope-from git) Date: Sat, 30 Jan 2021 18:03:08 GMT Message-Id: <202101301803.10UI3831057520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4a26380ba6dc - main - LinuxKPI: add module dependency on firmware(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a26380ba6dc487a7525d909ee29fbc710b558d1 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, 30 Jan 2021 18:03:08 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4a26380ba6dc487a7525d909ee29fbc710b558d1 commit 4a26380ba6dc487a7525d909ee29fbc710b558d1 Author: Bjoern A. Zeeb AuthorDate: 2021-01-30 17:50:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-01-30 17:50:26 +0000 LinuxKPI: add module dependency on firmware(9) In a6c2507d1baedb183268e31bc6b6f659a9529904 support for LinuxKPI firmware loading was added. Record the dependency on firmware(9) as otherwise (if built as module) linuxkpi will no longer load. Reported-by: tijl MFC after: 1 day X-MFC-with: a6c2507d1baedb183268e31bc6b6f659a9529904 Sponsored-by: The FreeBSD Foundation --- sys/compat/linuxkpi/common/src/linux_kmod.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/src/linux_kmod.c b/sys/compat/linuxkpi/common/src/linux_kmod.c index b9a916da650f..7fd73f0a7f45 100644 --- a/sys/compat/linuxkpi/common/src/linux_kmod.c +++ b/sys/compat/linuxkpi/common/src/linux_kmod.c @@ -31,5 +31,6 @@ __FBSDID("$FreeBSD$"); #include MODULE_VERSION(linuxkpi, 1); +MODULE_DEPEND(linuxkpi, firmware, 1, 1, 1); MODULE_DEPEND(linuxkpi, backlight, 1, 1, 1); MODULE_DEPEND(linuxkpi, pci, 1, 1, 1); From owner-dev-commits-src-main@freebsd.org Sat Jan 30 18:04: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 313154F47D9; Sat, 30 Jan 2021 18:04:13 +0000 (UTC) (envelope-from bz@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 4DSht50lpmz4sFM; Sat, 30 Jan 2021 18:04:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id E4EF129C1F; Sat, 30 Jan 2021 18:04:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 0A04E8D4A323; Sat, 30 Jan 2021 18:04:11 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 39A04E707CB; Sat, 30 Jan 2021 18:04:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id pIwzsjBqhBU2; Sat, 30 Jan 2021 18:04:09 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:ddc0:5fd7:79e3:c774]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E3DF2E707C2; Sat, 30 Jan 2021 18:04:08 +0000 (UTC) From: "Bjoern A. Zeeb" To: "=?utf-8?q?T=C4=B3l?= Coosemans" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a6c2507d1bae - main - LinuxKPI: add firmware loading support Date: Sat, 30 Jan 2021 18:04:08 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: <1EC4140C-506F-4F10-89B6-293340D07BA9@FreeBSD.org> In-Reply-To: <20210130170206.76e1319a@FreeBSD.org> References: <202101281645.10SGjwmh088797@gitrepo.freebsd.org> <20210130170206.76e1319a@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable 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, 30 Jan 2021 18:04:13 -0000 On 30 Jan 2021, at 16:02, T=C4=B3l Coosemans wrote: > On Thu, 28 Jan 2021 16:45:58 GMT "Bjoern A. Zeeb" = > wrote: >> The branch main has been updated by bz: >> >> URL: = >> https://cgit.FreeBSD.org/src/commit/?id=3Da6c2507d1baedb183268e31bc6b6= f659a9529904 >> >> commit a6c2507d1baedb183268e31bc6b6f659a9529904 >> Author: Bjoern A. Zeeb >> AuthorDate: 2021-01-28 16:05:32 +0000 >> Commit: Bjoern A. Zeeb >> CommitDate: 2021-01-28 16:05:32 +0000 >> >> LinuxKPI: add firmware loading support > > The module fails to load now because it can't find firmware_get_flags. > You need to add MODULE_DEPEND(linuxkpi, firmware, 1, 1, 1) in > linux_kmod.c Done in 4a26380ba6dc487a7525d909ee29fbc710b558d1. Thanks a lot for reporting! /bz From owner-dev-commits-src-main@freebsd.org Sat Jan 30 19:20: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 0DF4D4F68B7; Sat, 30 Jan 2021 19:20: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 4DSkZd71Zmz3CrB; Sat, 30 Jan 2021 19:20: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 E43441AE4B; Sat, 30 Jan 2021 19:20: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 10UJKv1K057873; Sat, 30 Jan 2021 19:20:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UJKva7057872; Sat, 30 Jan 2021 19:20:57 GMT (envelope-from git) Date: Sat, 30 Jan 2021 19:20:57 GMT Message-Id: <202101301920.10UJKva7057872@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: d51cc252a062 - main - userboot: provide stub gfx functions 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: d51cc252a062411a1656960eb5d47e954c6c835d 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, 30 Jan 2021 19:20:58 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=d51cc252a062411a1656960eb5d47e954c6c835d commit d51cc252a062411a1656960eb5d47e954c6c835d Author: Toomas Soome AuthorDate: 2021-01-30 19:16:20 +0000 Commit: Toomas Soome CommitDate: 2021-01-30 19:20:27 +0000 userboot: provide stub gfx functions Make sure we have needed functions present, to avoi getting undefined symbols error(s). PR: 253088 Reported by: John Kennedy --- stand/userboot/userboot/Makefile | 3 +- stand/userboot/userboot/gfx_fb.c | 78 +++++++++++++++++++++++++++++++++ stand/userboot/userboot/userboot_cons.c | 4 -- 3 files changed, 80 insertions(+), 5 deletions(-) diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile index 49026375328e..767840101200 100644 --- a/stand/userboot/userboot/Makefile +++ b/stand/userboot/userboot/Makefile @@ -29,13 +29,14 @@ SRCS+= main.c SRCS+= userboot_cons.c SRCS+= userboot_disk.c SRCS+= vers.c +SRCS+= gfx_fb.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot CFLAGS.main.c+= -I${BOOTSRC}/libsa/zfs CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs -CFLAGS.userboot_cons.c+= -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.gfx_fb.c+= -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite CWARNFLAGS.main.c += -Wno-implicit-function-declaration LDFLAGS+= -nostdlib -Wl,-Bsymbolic diff --git a/stand/userboot/userboot/gfx_fb.c b/stand/userboot/userboot/gfx_fb.c new file mode 100644 index 000000000000..aef61814569a --- /dev/null +++ b/stand/userboot/userboot/gfx_fb.c @@ -0,0 +1,78 @@ +/*- + * Copyright 2021 Toomas Soome + * 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * userboot-specific gfx stubs. + */ + +#include +#include +#include "bootstrap.h" +#include "gfx_fb.h" + +font_list_t fonts = STAILQ_HEAD_INITIALIZER(fonts); +teken_gfx_t gfx_state = { 0 }; + +void +gfx_fb_setpixel(uint32_t x __unused, uint32_t y __unused) +{ +} + +void +gfx_fb_drawrect(uint32_t x1 __unused, uint32_t y1 __unused, + uint32_t x2 __unused, uint32_t y2 __unused, uint32_t fill __unused) +{ +} + +void +gfx_term_drawrect(uint32_t x1 __unused, uint32_t y1 __unused, + uint32_t x2 __unused, uint32_t y2 __unused) +{ +} + +void +gfx_fb_line(uint32_t x0 __unused, uint32_t y0 __unused, + uint32_t x1 __unused, uint32_t y1 __unused, uint32_t w __unused) +{ +} + +void +gfx_fb_bezier(uint32_t x0 __unused, uint32_t y0 __unused, + uint32_t x1 __unused, uint32_t y1 __unused, uint32_t x2 __unused, + uint32_t y2 __unused, uint32_t w __unused) +{ +} + +int +gfx_fb_putimage(png_t *png __unused, uint32_t ux1 __unused, + uint32_t uy1 __unused, uint32_t ux2 __unused, uint32_t uy2 __unused, + uint32_t flags __unused) +{ + return (1); +} diff --git a/stand/userboot/userboot/userboot_cons.c b/stand/userboot/userboot/userboot_cons.c index 528f9ac40af9..89c1e70b116f 100644 --- a/stand/userboot/userboot/userboot_cons.c +++ b/stand/userboot/userboot/userboot_cons.c @@ -29,13 +29,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include "gfx_fb.h" #include "bootstrap.h" #include "libuserboot.h" -font_list_t fonts = STAILQ_HEAD_INITIALIZER(fonts); -teken_gfx_t gfx_state = { 0 }; - int console; static struct console *userboot_comconsp; From owner-dev-commits-src-main@freebsd.org Sat Jan 30 23:28: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 5FE3F4FC724; Sat, 30 Jan 2021 23:28: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 4DSr3p2BMpz3RJf; Sat, 30 Jan 2021 23:28: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 39E121E135; Sat, 30 Jan 2021 23:28: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 10UNS6Ua074893; Sat, 30 Jan 2021 23:28:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UNS6Y7074892; Sat, 30 Jan 2021 23:28:06 GMT (envelope-from git) Date: Sat, 30 Jan 2021 23:28:06 GMT Message-Id: <202101302328.10UNS6Y7074892@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: 91f2c69ec206 - main - Fix unused-function waring when compiling with FIB_ALGO. 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: 91f2c69ec206c2993722bfd818a8888f8237fa7e 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, 30 Jan 2021 23:28:06 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=91f2c69ec206c2993722bfd818a8888f8237fa7e commit 91f2c69ec206c2993722bfd818a8888f8237fa7e Author: Alexander V. Chernikov AuthorDate: 2021-01-30 23:24:26 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-30 23:25:56 +0000 Fix unused-function waring when compiling with FIB_ALGO. MFC after: 3 days --- sys/netinet6/in6_fib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet6/in6_fib.c b/sys/netinet6/in6_fib.c index 3fbddbc28e3d..614f8111409a 100644 --- a/sys/netinet6/in6_fib.c +++ b/sys/netinet6/in6_fib.c @@ -218,6 +218,7 @@ check_urpf(struct nhop_object *nh, uint32_t flags, return (check_urpf_nhop(nh, flags, src_if)); } +#ifndef FIB_ALGO static struct nhop_object * lookup_nhop(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid) @@ -251,6 +252,7 @@ lookup_nhop(uint32_t fibnum, const struct in6_addr *dst6, return (nh); } +#endif /* * Performs reverse path forwarding lookup. From owner-dev-commits-src-main@freebsd.org Sat Jan 30 23:28: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 777CA4FC5D2; Sat, 30 Jan 2021 23:28:07 +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 4DSr3q31SNz3Qv2; Sat, 30 Jan 2021 23:28:07 +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 5AE011DF67; Sat, 30 Jan 2021 23:28:07 +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 10UNS7Mr074911; Sat, 30 Jan 2021 23:28:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UNS7eI074910; Sat, 30 Jan 2021 23:28:07 GMT (envelope-from git) Date: Sat, 30 Jan 2021 23:28:07 GMT Message-Id: <202101302328.10UNS7eI074910@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: f8b7ebea4905 - main - Improve fib_algo debug messages. 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: f8b7ebea4905d84032f3195f86f6c27842e7a286 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, 30 Jan 2021 23:28:07 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f8b7ebea4905d84032f3195f86f6c27842e7a286 commit f8b7ebea4905d84032f3195f86f6c27842e7a286 Author: Alexander V. Chernikov AuthorDate: 2021-01-30 22:06:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-30 23:25:56 +0000 Improve fib_algo debug messages. * Move per-prefix debug lines under LOG_DEBUG2 * Create fib instance counter to distingush log messages between instances * Add more messages on rebuild reason. MFC after: 3 days --- sys/net/route/fib_algo.c | 62 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index b84217034e16..1f040ad259c5 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -118,6 +118,9 @@ SYSCTL_NODE(_net_route_algo, OID_AUTO, inet, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IPv4 longest prefix match lookups"); #endif +/* Fib instance counter */ +static uint32_t fib_gen = 0; + struct nhop_ref_table { uint32_t count; int32_t refcnt[0]; @@ -137,7 +140,7 @@ struct fib_data { uint8_t fd_family; /* family */ uint32_t fd_fibnum; /* fibnum */ uint32_t fd_failed_rebuilds; /* stat: failed rebuilds */ - uint32_t fd_algo_mask; /* bitmask for algo data */ + uint32_t fd_gen; /* instance gen# */ struct callout fd_callout; /* rebuild callout */ void *fd_algo_data; /* algorithm data */ struct nhop_object **nh_idx; /* nhop idx->ptr array */ @@ -191,12 +194,15 @@ static int flm_debug_level = LOG_NOTICE; SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, &flm_debug_level, 0, "debuglevel"); #define FLM_MAX_DEBUG_LEVEL LOG_DEBUG +#ifndef LOG_DEBUG2 +#define LOG_DEBUG2 8 +#endif #define _PASS_MSG(_l) (flm_debug_level >= (_l)) #define ALGO_PRINTF(_fmt, ...) printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__) -#define _ALGO_PRINTF(_fib, _fam, _aname, _func, _fmt, ...) \ - printf("[fib_algo] %s.%u (%s) %s: " _fmt "\n",\ - print_family(_fam), _fib, _aname, _func, ## __VA_ARGS__) +#define _ALGO_PRINTF(_fib, _fam, _aname, _gen, _func, _fmt, ...) \ + printf("[fib_algo] %s.%u (%s#%u) %s: " _fmt "\n",\ + print_family(_fam), _fib, _aname, _gen, _func, ## __VA_ARGS__) #define _RH_PRINTF(_fib, _fam, _func, _fmt, ...) \ printf("[fib_algo] %s.%u %s: " _fmt "\n", print_family(_fam), _fib, _func, ## __VA_ARGS__) #define RH_PRINTF(_l, _rh, _fmt, ...) if (_PASS_MSG(_l)) { \ @@ -205,8 +211,13 @@ SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, #define FD_PRINTF(_l, _fd, _fmt, ...) FD_PRINTF_##_l(_l, _fd, _fmt, ## __VA_ARGS__) #define _FD_PRINTF(_l, _fd, _fmt, ...) if (_PASS_MSG(_l)) { \ _ALGO_PRINTF(_fd->fd_fibnum, _fd->fd_family, _fd->fd_flm->flm_name, \ - __func__, _fmt, ## __VA_ARGS__); \ + _fd->fd_gen, __func__, _fmt, ## __VA_ARGS__); \ } +#if FLM_MAX_DEBUG_LEVEL>=LOG_DEBUG2 +#define FD_PRINTF_LOG_DEBUG2 _FD_PRINTF +#else +#define FD_PRINTF_LOG_DEBUG2(_l, _fd, _fmt, ...) +#endif #if FLM_MAX_DEBUG_LEVEL>=LOG_DEBUG #define FD_PRINTF_LOG_DEBUG _FD_PRINTF #else @@ -371,7 +382,7 @@ fib_printf(int level, struct fib_data *fd, const char *func, char *fmt, ...) va_end(ap); _ALGO_PRINTF(fd->fd_fibnum, fd->fd_family, fd->fd_flm->flm_name, - func, "%s", buf); + fd->fd_gen, func, "%s", buf); } /* @@ -450,7 +461,7 @@ schedule_callout(struct fib_data *fd, int delay_ms) } static void -schedule_fd_rebuild(struct fib_data *fd) +schedule_fd_rebuild(struct fib_data *fd, const char *reason) { FIB_MOD_LOCK(); @@ -461,7 +472,8 @@ schedule_fd_rebuild(struct fib_data *fd) * Potentially re-schedules pending callout * initiated by schedule_algo_eval. */ - FD_PRINTF(LOG_INFO, fd, "Scheduling rebuilt"); + FD_PRINTF(LOG_INFO, fd, "Scheduling rebuild: %s (failures=%d)", + reason, fd->fd_failed_rebuilds); schedule_callout(fd, callout_calc_delay_ms(fd)); } FIB_MOD_UNLOCK(); @@ -527,7 +539,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, if (rc->rc_nh_new != NULL) { if (fib_ref_nhop(fd, rc->rc_nh_new) == 0) { /* ran out of indexes */ - schedule_fd_rebuild(fd); + schedule_fd_rebuild(fd, "ran out of nhop indexes"); return; } } @@ -546,7 +558,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, * Algo is not able to apply the update. * Schedule algo rebuild. */ - schedule_fd_rebuild(fd); + schedule_fd_rebuild(fd, "algo requested rebuild"); break; case FLM_ERROR: @@ -558,7 +570,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, FD_PRINTF(LOG_ERR, fd, "algo reported non-recoverable error"); if (!flm_error_add(fd->fd_flm, fd->fd_fibnum)) FD_PRINTF(LOG_ERR, fd, "failed to ban algo"); - schedule_fd_rebuild(fd); + schedule_fd_rebuild(fd, "algo reported non-recoverable error"); } } @@ -667,8 +679,9 @@ sync_algo(struct fib_data *fd) rib_walk_ext_internal(fd->fd_rh, true, sync_algo_cb, sync_algo_end_cb, &w); - FD_PRINTF(LOG_INFO, fd, "initial dump completed, result: %s", - print_op_result(w.result)); + FD_PRINTF(LOG_INFO, fd, + "initial dump completed (rtable version: %d), result: %s", + fd->fd_rh->rnh_gen, print_op_result(w.result)); return (w.result); } @@ -794,7 +807,7 @@ destroy_fd_instance(struct fib_data *fd) if ((fd->nh_idx != NULL) && (fd->nh_ref_table != NULL)) { for (int i = 0; i < fd->number_nhops; i++) { if (!is_idx_free(fd, i)) { - FD_PRINTF(LOG_DEBUG, fd, " FREE nhop %d %p", + FD_PRINTF(LOG_DEBUG2, fd, " FREE nhop %d %p", i, fd->nh_idx[i]); nhop_free_any(fd->nh_idx[i]); } @@ -845,6 +858,7 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, fd = malloc(sizeof(struct fib_data), M_RTABLE, M_NOWAIT | M_ZERO); if (fd == NULL) { *pfd = NULL; + RH_PRINTF(LOG_INFO, rh, "Unable to allocate fib_data structure"); return (FLM_REBUILD); } *pfd = fd; @@ -852,12 +866,15 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, estimate_nhop_scale(old_fd, fd); fd->fd_rh = rh; + fd->fd_gen = ++fib_gen; fd->fd_family = rh->rib_family; fd->fd_fibnum = rh->rib_fibnum; callout_init(&fd->fd_callout, 1); fd->fd_vnet = curvnet; fd->fd_flm = flm; + FD_PRINTF(LOG_DEBUG, fd, "allocated fd %p", fd); + FIB_MOD_LOCK(); flm->flm_refcount++; FIB_MOD_UNLOCK(); @@ -883,21 +900,27 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, /* Okay, we're ready for algo init */ void *old_algo_data = (old_fd != NULL) ? old_fd->fd_algo_data : NULL; result = flm->flm_init_cb(fd->fd_fibnum, fd, old_algo_data, &fd->fd_algo_data); - if (result != FLM_SUCCESS) + if (result != FLM_SUCCESS) { + FD_PRINTF(LOG_INFO, fd, "%s algo init failed", flm->flm_name); return (result); + } /* Try to subscribe */ if (flm->flm_change_rib_item_cb != NULL) { fd->fd_rs = rib_subscribe_internal(fd->fd_rh, handle_rtable_change_cb, fd, RIB_NOTIFY_IMMEDIATE, 0); - if (fd->fd_rs == NULL) + if (fd->fd_rs == NULL) { + FD_PRINTF(LOG_INFO, fd, "failed to subscribe to the rib changes"); return (FLM_REBUILD); + } } /* Dump */ result = sync_algo(fd); - if (result != FLM_SUCCESS) + if (result != FLM_SUCCESS) { + FD_PRINTF(LOG_INFO, fd, "rib sync failed"); return (result); + } FD_PRINTF(LOG_INFO, fd, "DUMP completed successfully."); FIB_MOD_LOCK(); @@ -953,6 +976,9 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, } if (result != FLM_SUCCESS) { + RH_PRINTF(LOG_WARNING, rh, + "%s algo instance setup failed, failures=%d", flm->flm_name, + orig_fd ? orig_fd->fd_failed_rebuilds + 1 : 0); /* update failure count */ FIB_MOD_LOCK(); if (orig_fd != NULL) @@ -1370,7 +1396,7 @@ fib_ref_nhop(struct fib_data *fd, struct nhop_object *nh) nhop_ref_any(nh); fd->nh_idx[idx] = nh; fd->nh_ref_table->count++; - FD_PRINTF(LOG_DEBUG, fd, " REF nhop %u %p", idx, fd->nh_idx[idx]); + FD_PRINTF(LOG_DEBUG2, fd, " REF nhop %u %p", idx, fd->nh_idx[idx]); } fd->nh_ref_table->refcnt[idx]++; From owner-dev-commits-src-main@freebsd.org Sat Jan 30 23:28:08 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 99AD04FC826; Sat, 30 Jan 2021 23:28:08 +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 4DSr3r3wSpz3R7t; Sat, 30 Jan 2021 23:28:08 +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 6AAC71DF68; Sat, 30 Jan 2021 23:28:08 +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 10UNS86C074934; Sat, 30 Jan 2021 23:28:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UNS8Nf074933; Sat, 30 Jan 2021 23:28:08 GMT (envelope-from git) Date: Sat, 30 Jan 2021 23:28:08 GMT Message-Id: <202101302328.10UNS8Nf074933@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: ab6d9aaed76e - main - Move business logic from rebuild_fd_callout() into rebuild_fd(). 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: ab6d9aaed76ed9f86fd0d938ebb6ea81f5ad6a82 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, 30 Jan 2021 23:28:08 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=ab6d9aaed76ed9f86fd0d938ebb6ea81f5ad6a82 commit ab6d9aaed76ed9f86fd0d938ebb6ea81f5ad6a82 Author: Alexander V. Chernikov AuthorDate: 2021-01-30 22:32:42 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-30 23:25:57 +0000 Move business logic from rebuild_fd_callout() into rebuild_fd(). This simplifies code a bit and allows for future non-callout callers to request rebuild. MFC after: 3 days --- sys/net/route/fib_algo.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 1f040ad259c5..f7a8b3f82431 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -155,6 +155,7 @@ struct fib_data { TAILQ_ENTRY(fib_data) entries; /* list of all fds in vnet */ }; +static bool rebuild_fd(struct fib_data *fd); static void rebuild_fd_callout(void *_data); static void destroy_fd_instance_epoch(epoch_context_t ctx); static enum flm_op_result attach_datapath(struct fib_data *fd); @@ -1011,13 +1012,28 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, static void rebuild_fd_callout(void *_data) { - struct fib_data *fd, *fd_new, *fd_tmp; + struct fib_data *fd = (struct fib_data *)_data; + + FD_PRINTF(LOG_INFO, fd, "running callout rebuild"); + + CURVNET_SET(fd->fd_vnet); + rebuild_fd(fd); + CURVNET_RESTORE(); +} + +/* + * Tries to create new algo instance based on @fd data. + * Returns true on success. + */ +static bool +rebuild_fd(struct fib_data *fd) +{ + struct fib_data *fd_new, *fd_tmp; struct fib_lookup_module *flm_new = NULL; struct epoch_tracker et; enum flm_op_result result; bool need_rebuild = false; - fd = (struct fib_data *)_data; FIB_MOD_LOCK(); need_rebuild = fd->fd_need_rebuild; @@ -1026,15 +1042,12 @@ rebuild_fd_callout(void *_data) fd->fd_num_changes = 0; FIB_MOD_UNLOCK(); - CURVNET_SET(fd->fd_vnet); - /* First, check if we're still OK to use this algo */ if (!is_algo_fixed(fd->fd_rh)) flm_new = fib_check_best_algo(fd->fd_rh, fd->fd_flm); if ((flm_new == NULL) && (!need_rebuild)) { /* Keep existing algo, no need to rebuild. */ - CURVNET_RESTORE(); - return; + return (true); } if (flm_new == NULL) { @@ -1051,19 +1064,16 @@ rebuild_fd_callout(void *_data) } if (result != FLM_SUCCESS) { FD_PRINTF(LOG_NOTICE, fd, "table rebuild failed"); - CURVNET_RESTORE(); - return; + return (false); } FD_PRINTF(LOG_INFO, fd_new, "switched to new instance"); - /* Remove old instance removal */ - if (fd != NULL) { - NET_EPOCH_ENTER(et); - schedule_destroy_fd_instance(fd, true); - NET_EPOCH_EXIT(et); - } + /* Remove old instance */ + NET_EPOCH_ENTER(et); + schedule_destroy_fd_instance(fd, true); + NET_EPOCH_EXIT(et); - CURVNET_RESTORE(); + return (true); } /* From owner-dev-commits-src-main@freebsd.org Sat Jan 30 23:28: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 304904FCA88; Sat, 30 Jan 2021 23:28: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 4DSr3s570cz3RGq; Sat, 30 Jan 2021 23:28:09 +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 8CC871E384; Sat, 30 Jan 2021 23:28:09 +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 10UNS9GJ074956; Sat, 30 Jan 2021 23:28:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UNS9J6074955; Sat, 30 Jan 2021 23:28:09 GMT (envelope-from git) Date: Sat, 30 Jan 2021 23:28:09 GMT Message-Id: <202101302328.10UNS9J6074955@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: dd9163003cb1 - main - Add rib_subscribe_locked() and rib_unsubsribe_locked() to support subscriptions during RIB modifications. Add new subscriptions to the beginning of the lists instead of the end. This fixes the situation when new subscription is created int the callback for the existing subscription, leading to the subscription notification handler pick it. 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: dd9163003cb1be494609d904521e8dae7737caa7 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, 30 Jan 2021 23:28:10 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=dd9163003cb1be494609d904521e8dae7737caa7 commit dd9163003cb1be494609d904521e8dae7737caa7 Author: Alexander V. Chernikov AuthorDate: 2021-01-30 21:52:44 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-30 23:25:57 +0000 Add rib_subscribe_locked() and rib_unsubsribe_locked() to support subscriptions during RIB modifications. Add new subscriptions to the beginning of the lists instead of the end. This fixes the situation when new subscription is created int the callback for the existing subscription, leading to the subscription notification handler pick it. MFC after: 3 days --- sys/net/route/route_ctl.c | 34 +++++++++++++++++++++++++++++++++- sys/net/route/route_ctl.h | 3 +++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 230d23845c64..c46d0430a164 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -1407,13 +1407,31 @@ rib_subscribe_internal(struct rib_head *rnh, rib_subscription_cb_t *f, void *arg NET_EPOCH_ENTER(et); RIB_WLOCK(rnh); - CK_STAILQ_INSERT_TAIL(&rnh->rnh_subscribers, rs, next); + CK_STAILQ_INSERT_HEAD(&rnh->rnh_subscribers, rs, next); RIB_WUNLOCK(rnh); NET_EPOCH_EXIT(et); return (rs); } +struct rib_subscription * +rib_subscribe_locked(struct rib_head *rnh, rib_subscription_cb_t *f, void *arg, + enum rib_subscription_type type) +{ + struct rib_subscription *rs; + + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(rnh); + + if ((rs = allocate_subscription(f, arg, type, false)) == NULL) + return (NULL); + rs->rnh = rnh; + + CK_STAILQ_INSERT_HEAD(&rnh->rnh_subscribers, rs, next); + + return (rs); +} + /* * Remove rtable subscription @rs from the routing table. * Needs to be run in network epoch. @@ -1433,6 +1451,20 @@ rib_unsibscribe(struct rib_subscription *rs) &rs->epoch_ctx); } +void +rib_unsibscribe_locked(struct rib_subscription *rs) +{ + struct rib_head *rnh = rs->rnh; + + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(rnh); + + CK_STAILQ_REMOVE(&rnh->rnh_subscribers, rs, rib_subscription, next); + + epoch_call(net_epoch_preempt, destroy_subscription_epoch, + &rs->epoch_ctx); +} + /* * Epoch callback indicating subscription is safe to destroy */ diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index ecbc9ee91dc0..bd256e9f0834 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -144,6 +144,9 @@ struct rib_subscription *rib_subscribe(uint32_t fibnum, int family, struct rib_subscription *rib_subscribe_internal(struct rib_head *rnh, rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type, bool waitok); +struct rib_subscription *rib_subscribe_locked(struct rib_head *rnh, + rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type); void rib_unsibscribe(struct rib_subscription *rs); +void rib_unsibscribe_locked(struct rib_subscription *rs); #endif From owner-dev-commits-src-main@freebsd.org Sat Jan 30 23:28: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 848674FCA8D; Sat, 30 Jan 2021 23:28: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 4DSr3v0CQDz3RJp; Sat, 30 Jan 2021 23:28: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 BC1181E136; Sat, 30 Jan 2021 23:28: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 10UNSAYM074974; Sat, 30 Jan 2021 23:28:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UNSADm074973; Sat, 30 Jan 2021 23:28:10 GMT (envelope-from git) Date: Sat, 30 Jan 2021 23:28:10 GMT Message-Id: <202101302328.10UNSADm074973@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: 151ec796a230 - main - Fix the design problem with delayed algorithm sync. 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: 151ec796a23098279531eaebbf30d08a0877ee4e 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, 30 Jan 2021 23:28:13 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=151ec796a23098279531eaebbf30d08a0877ee4e commit 151ec796a23098279531eaebbf30d08a0877ee4e Author: Alexander V. Chernikov AuthorDate: 2021-01-30 22:45:46 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-30 23:25:57 +0000 Fix the design problem with delayed algorithm sync. Currently, if the immutable algorithm like bsearch or radix_lockless receives rtable update notification, it schedules algorithm rebuild. This rebuild is executed by the callout after ~50 milliseconds. It is possible that a script adding an interface address and than route with the gateway bound to that address will fail. It can happen due to the fact that fib is not updated by the time the route addition request arrives. Fix this by allowing synchronous algorithm rebuilds based on certain conditions. By default, these conditions assume: 1) less than net.route.algo.fib_sync_limit=100 routes 2) routes without gateway. * Move algo instance build entirely under rib WLOCK. Rib lock is only used for control plane (except radix algo, but there are no rebuilds). * Add rib_walk_ext_locked() function to allow RIB iteration with rib lock already held. * Fix rare potential callout use-after-free for fds by binding fd callout to the relevant rib rmlock. In that case, callout_stop() under rib WLOCK guarantees no callout will be executed afterwards. MFC after: 3 days --- sys/net/route/fib_algo.c | 110 ++++++++++++++++++++++++++++-------------- sys/net/route/route_ctl.h | 2 + sys/net/route/route_helpers.c | 17 +++++-- 3 files changed, 87 insertions(+), 42 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index f7a8b3f82431..21b6ba924069 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -105,6 +105,11 @@ SYSCTL_DECL(_net_route); SYSCTL_NODE(_net_route, OID_AUTO, algo, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Fib algorithm lookups"); +VNET_DEFINE(int, fib_sync_limit) = 100; +#define V_fib_sync_limit VNET(fib_sync_limit) +SYSCTL_INT(_net_route_algo, OID_AUTO, fib_sync_limit, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(fib_sync_limit), 0, "Guarantee synchronous fib till route limit"); + #ifdef INET6 VNET_DEFINE_STATIC(bool, algo_fixed_inet6) = false; #define V_algo_fixed_inet6 VNET(algo_fixed_inet6) @@ -465,7 +470,8 @@ static void schedule_fd_rebuild(struct fib_data *fd, const char *reason) { - FIB_MOD_LOCK(); + RIB_WLOCK_ASSERT(fd->fd_rh); + if (!fd->fd_need_rebuild) { fd->fd_need_rebuild = true; @@ -477,30 +483,52 @@ schedule_fd_rebuild(struct fib_data *fd, const char *reason) reason, fd->fd_failed_rebuilds); schedule_callout(fd, callout_calc_delay_ms(fd)); } - FIB_MOD_UNLOCK(); } static void schedule_algo_eval(struct fib_data *fd) { + RIB_WLOCK_ASSERT(fd->fd_rh); + if (fd->fd_num_changes++ == 0) { /* Start callout to consider switch */ - FIB_MOD_LOCK(); if (!callout_pending(&fd->fd_callout)) schedule_callout(fd, ALGO_EVAL_DELAY_MS); - FIB_MOD_UNLOCK(); } else if (fd->fd_num_changes > ALGO_EVAL_NUM_ROUTES && !fd->fd_force_eval) { /* Reset callout to exec immediately */ - FIB_MOD_LOCK(); if (!fd->fd_need_rebuild) { fd->fd_force_eval = true; schedule_callout(fd, 1); } - FIB_MOD_UNLOCK(); } } +static bool +need_immediate_rebuild(struct fib_data *fd, struct rib_cmd_info *rc) +{ + struct nhop_object *nh; + + if ((V_fib_sync_limit == 0) || (fd->fd_rh->rnh_prefixes <= V_fib_sync_limit)) + return (true); + + /* Sync addition/removal of interface routes */ + switch (rc->rc_cmd) { + case RTM_ADD: + nh = rc->rc_nh_new; + if (!NH_IS_NHGRP(nh) && (!(nh->nh_flags & NHF_GATEWAY))) + return (true); + break; + case RTM_DELETE: + nh = rc->rc_nh_old; + if (!NH_IS_NHGRP(nh) && (!(nh->nh_flags & NHF_GATEWAY))) + return (true); + break; + } + + return (false); +} + /* * Rib subscription handler. Checks if the algorithm is ready to * receive updates, handles nexthop refcounting and passes change @@ -559,7 +587,15 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, * Algo is not able to apply the update. * Schedule algo rebuild. */ - schedule_fd_rebuild(fd, "algo requested rebuild"); + if (!need_immediate_rebuild(fd, rc)) { + schedule_fd_rebuild(fd, "algo requested rebuild"); + break; + } + + fd->fd_need_rebuild = true; + FD_PRINTF(LOG_INFO, fd, "running sync rebuild"); + if (!rebuild_fd(fd)) + schedule_fd_rebuild(fd, "sync rebuild failed"); break; case FLM_ERROR: @@ -678,7 +714,7 @@ sync_algo(struct fib_data *fd) .result = FLM_SUCCESS, }; - rib_walk_ext_internal(fd->fd_rh, true, sync_algo_cb, sync_algo_end_cb, &w); + rib_walk_ext_locked(fd->fd_rh, sync_algo_cb, sync_algo_end_cb, &w); FD_PRINTF(LOG_INFO, fd, "initial dump completed (rtable version: %d), result: %s", @@ -702,6 +738,7 @@ schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout) bool is_dead; NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(fd->fd_rh); FIB_MOD_LOCK(); is_dead = fd->fd_dead; @@ -718,27 +755,13 @@ schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout) FD_PRINTF(LOG_INFO, fd, "DETACH"); if (fd->fd_rs != NULL) - rib_unsibscribe(fd->fd_rs); + rib_unsibscribe_locked(fd->fd_rs); /* * After rib_unsubscribe() no _new_ handle_rtable_change_cb() calls * will be executed, hence no _new_ callout schedules will happen. - * - * There can be 2 possible scenarious here: - * 1) we're running inside a callout when we're deleting ourselves - * due to migration to a newer fd - * 2) we're running from rt_table_destroy() and callout is scheduled - * for execution OR is executing - * - * For (2) we need to wait for the callout termination, as the routing table - * will be destroyed after this function returns. - * For (1) we cannot call drain, but can ensure that this is the last invocation. */ - - if (in_callout) - callout_stop(&fd->fd_callout); - else - callout_drain(&fd->fd_callout); + callout_stop(&fd->fd_callout); epoch_call(net_epoch_preempt, destroy_fd_instance_epoch, &fd->fd_epoch_ctx); @@ -774,7 +797,11 @@ fib_cleanup_algo(struct rib_head *rh, bool keep_first, bool in_callout) /* Pass 2: remove each entry */ NET_EPOCH_ENTER(et); TAILQ_FOREACH_SAFE(fd, &tmp_head, entries, fd_tmp) { + if (!in_callout) + RIB_WLOCK(fd->fd_rh); schedule_destroy_fd_instance(fd, in_callout); + if (!in_callout) + RIB_WUNLOCK(fd->fd_rh); } NET_EPOCH_EXIT(et); } @@ -870,7 +897,7 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, fd->fd_gen = ++fib_gen; fd->fd_family = rh->rib_family; fd->fd_fibnum = rh->rib_fibnum; - callout_init(&fd->fd_callout, 1); + callout_init_rm(&fd->fd_callout, &rh->rib_lock, 0); fd->fd_vnet = curvnet; fd->fd_flm = flm; @@ -908,8 +935,8 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, /* Try to subscribe */ if (flm->flm_change_rib_item_cb != NULL) { - fd->fd_rs = rib_subscribe_internal(fd->fd_rh, - handle_rtable_change_cb, fd, RIB_NOTIFY_IMMEDIATE, 0); + fd->fd_rs = rib_subscribe_locked(fd->fd_rh, + handle_rtable_change_cb, fd, RIB_NOTIFY_IMMEDIATE); if (fd->fd_rs == NULL) { FD_PRINTF(LOG_INFO, fd, "failed to subscribe to the rib changes"); return (FLM_REBUILD); @@ -946,13 +973,14 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, struct fib_data *orig_fd, struct fib_data **pfd, bool attach) { struct fib_data *prev_fd, *new_fd; - struct epoch_tracker et; enum flm_op_result result; + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(rh); + prev_fd = orig_fd; new_fd = NULL; for (int i = 0; i < FIB_MAX_TRIES; i++) { - NET_EPOCH_ENTER(et); result = try_setup_fd_instance(flm, rh, prev_fd, &new_fd); if ((result == FLM_SUCCESS) && attach) @@ -962,7 +990,6 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, schedule_destroy_fd_instance(prev_fd, false); prev_fd = NULL; } - NET_EPOCH_EXIT(et); RH_PRINTF(LOG_INFO, rh, "try %d: fib algo result: %s", i, print_op_result(result)); @@ -990,14 +1017,12 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, if (result == FLM_ERROR) flm_error_add(flm, rh->rib_fibnum); - NET_EPOCH_ENTER(et); if ((prev_fd != NULL) && (prev_fd != orig_fd)) schedule_destroy_fd_instance(prev_fd, false); if (new_fd != NULL) { schedule_destroy_fd_instance(new_fd, false); new_fd = NULL; } - NET_EPOCH_EXIT(et); } *pfd = new_fd; @@ -1013,12 +1038,15 @@ static void rebuild_fd_callout(void *_data) { struct fib_data *fd = (struct fib_data *)_data; + struct epoch_tracker et; FD_PRINTF(LOG_INFO, fd, "running callout rebuild"); + NET_EPOCH_ENTER(et); CURVNET_SET(fd->fd_vnet); rebuild_fd(fd); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); } /* @@ -1030,17 +1058,16 @@ rebuild_fd(struct fib_data *fd) { struct fib_data *fd_new, *fd_tmp; struct fib_lookup_module *flm_new = NULL; - struct epoch_tracker et; enum flm_op_result result; bool need_rebuild = false; + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(fd->fd_rh); - FIB_MOD_LOCK(); need_rebuild = fd->fd_need_rebuild; fd->fd_need_rebuild = false; fd->fd_force_eval = false; fd->fd_num_changes = 0; - FIB_MOD_UNLOCK(); /* First, check if we're still OK to use this algo */ if (!is_algo_fixed(fd->fd_rh)) @@ -1069,9 +1096,7 @@ rebuild_fd(struct fib_data *fd) FD_PRINTF(LOG_INFO, fd_new, "switched to new instance"); /* Remove old instance */ - NET_EPOCH_ENTER(et); schedule_destroy_fd_instance(fd, true); - NET_EPOCH_EXIT(et); return (true); } @@ -1116,6 +1141,7 @@ set_fib_algo(uint32_t fibnum, int family, struct sysctl_oid *oidp, struct sysctl char old_algo_name[32], algo_name[32]; struct rib_head *rh = NULL; enum flm_op_result result; + struct epoch_tracker et; int error; /* Fetch current algo/rib for af/family */ @@ -1149,7 +1175,11 @@ set_fib_algo(uint32_t fibnum, int family, struct sysctl_oid *oidp, struct sysctl } fd = NULL; + NET_EPOCH_ENTER(et); + RIB_WLOCK(rh); result = setup_fd_instance(flm, rh, NULL, &fd, true); + RIB_WUNLOCK(rh); + NET_EPOCH_EXIT(et); fib_unref_algo(flm); if (result != FLM_SUCCESS) return (EINVAL); @@ -1558,6 +1588,7 @@ fib_select_algo_initial(struct rib_head *rh) struct fib_lookup_module *flm; struct fib_data *fd = NULL; enum flm_op_result result; + struct epoch_tracker et; int error = 0; flm = fib_check_best_algo(rh, NULL); @@ -1567,7 +1598,12 @@ fib_select_algo_initial(struct rib_head *rh) } RH_PRINTF(LOG_INFO, rh, "selected algo %s", flm->flm_name); + NET_EPOCH_ENTER(et); + RIB_WLOCK(rh); result = setup_fd_instance(flm, rh, NULL, &fd, false); + RIB_WUNLOCK(rh); + NET_EPOCH_EXIT(et); + RH_PRINTF(LOG_DEBUG, rh, "result=%d fd=%p", result, fd); if (result == FLM_SUCCESS) { diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index bd256e9f0834..46dba759f8df 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -75,6 +75,8 @@ void rib_walk_ext(uint32_t fibnum, int af, bool wlock, rib_walktree_f_t *wa_f, rib_walk_hook_f_t *hook_f, void *arg); void rib_walk_ext_internal(struct rib_head *rnh, bool wlock, rib_walktree_f_t *wa_f, rib_walk_hook_f_t *hook_f, void *arg); +void rib_walk_ext_locked(struct rib_head *rnh, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg); void rib_walk_del(u_int fibnum, int family, rib_filter_f_t *filter_f, void *arg, bool report); diff --git a/sys/net/route/route_helpers.c b/sys/net/route/route_helpers.c index 88733fff419b..782e160ca51b 100644 --- a/sys/net/route/route_helpers.c +++ b/sys/net/route/route_helpers.c @@ -67,6 +67,17 @@ __FBSDID("$FreeBSD$"); * RIB helper functions. */ +void +rib_walk_ext_locked(struct rib_head *rnh, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg) +{ + if (hook_f != NULL) + hook_f(rnh, RIB_WALK_HOOK_PRE, arg); + rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f, arg); + if (hook_f != NULL) + hook_f(rnh, RIB_WALK_HOOK_POST, arg); +} + /* * Calls @wa_f with @arg for each entry in the table specified by * @af and @fibnum. @@ -86,11 +97,7 @@ rib_walk_ext_internal(struct rib_head *rnh, bool wlock, rib_walktree_f_t *wa_f, RIB_WLOCK(rnh); else RIB_RLOCK(rnh); - if (hook_f != NULL) - hook_f(rnh, RIB_WALK_HOOK_PRE, arg); - rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f, arg); - if (hook_f != NULL) - hook_f(rnh, RIB_WALK_HOOK_POST, arg); + rib_walk_ext_locked(rnh, wa_f, hook_f, arg); if (wlock) RIB_WUNLOCK(rnh); else From owner-dev-commits-src-main@freebsd.org Sun Jan 31 10:00: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 A2B5C4EAAFE; Sun, 31 Jan 2021 10:00: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 4DT65r4GJGz4qZN; Sun, 31 Jan 2021 10:00: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 85A4D26073; Sun, 31 Jan 2021 10:00: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 10VA0mTi004910; Sun, 31 Jan 2021 10:00:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VA0mws004909; Sun, 31 Jan 2021 10:00:48 GMT (envelope-from git) Date: Sun, 31 Jan 2021 10:00:48 GMT Message-Id: <202101311000.10VA0mws004909@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: 8dc6a1edca6d - main - sctp: fix a locking issue for old unordered data 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: 8dc6a1edca6de0c64f6c082f69097746d1346592 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, 31 Jan 2021 10:00:48 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8dc6a1edca6de0c64f6c082f69097746d1346592 commit 8dc6a1edca6de0c64f6c082f69097746d1346592 Author: Michael Tuexen AuthorDate: 2021-01-31 09:46:23 +0000 Commit: Michael Tuexen CommitDate: 2021-01-31 09:46:23 +0000 sctp: fix a locking issue for old unordered data Thanks to Anatoly Korniltsev for reporting the issue for the userland stack. MFC after: 3 days --- sys/netinet/sctp_indata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 08af27c934fb..6997a0099c88 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -803,7 +803,7 @@ restart: } memset(nc, 0, sizeof(struct sctp_queued_to_read)); TAILQ_REMOVE(&control->reasm, chk, sctp_next); - sctp_add_chk_to_control(control, strm, stcb, asoc, chk, SCTP_READ_LOCK_NOT_HELD); + sctp_add_chk_to_control(control, strm, stcb, asoc, chk, inp_read_lock_held); fsn++; cnt_added++; chk = NULL; From owner-dev-commits-src-main@freebsd.org Sun Jan 31 10:50: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 CA90E4EF49C; Sun, 31 Jan 2021 10:50: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 4DT7CN5SHGz4tZZ; Sun, 31 Jan 2021 10:50: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 ACF4D26F60; Sun, 31 Jan 2021 10:50: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 10VAoeDR069601; Sun, 31 Jan 2021 10:50:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VAoepc069600; Sun, 31 Jan 2021 10:50:40 GMT (envelope-from git) Date: Sun, 31 Jan 2021 10:50:40 GMT Message-Id: <202101311050.10VAoepc069600@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: 78c93a172114 - main - Use process fib for inet/inet6 fib_algo sysctls. 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: 78c93a1721143db656e277f7827ec4d57826044c 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, 31 Jan 2021 10:50:40 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=78c93a1721143db656e277f7827ec4d57826044c commit 78c93a1721143db656e277f7827ec4d57826044c Author: Alexander V. Chernikov AuthorDate: 2021-01-31 10:48:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-01-31 10:50:08 +0000 Use process fib for inet/inet6 fib_algo sysctls. This allows to set/query fib algo for non-default fibs. MFC after: 3 days --- sys/net/route/fib_algo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 21b6ba924069..b2aa2de087de 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1202,7 +1202,7 @@ static int set_algo_inet_sysctl_handler(SYSCTL_HANDLER_ARGS) { - return (set_fib_algo(RT_DEFAULT_FIB, AF_INET, oidp, req)); + return (set_fib_algo(curthread->td_proc->p_fibnum, AF_INET, oidp, req)); } SYSCTL_PROC(_net_route_algo_inet, OID_AUTO, algo, CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, @@ -1214,7 +1214,7 @@ static int set_algo_inet6_sysctl_handler(SYSCTL_HANDLER_ARGS) { - return (set_fib_algo(RT_DEFAULT_FIB, AF_INET6, oidp, req)); + return (set_fib_algo(curthread->td_proc->p_fibnum, AF_INET6, oidp, req)); } SYSCTL_PROC(_net_route_algo_inet6, OID_AUTO, algo, CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, From owner-dev-commits-src-main@freebsd.org Sun Jan 31 11:10: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 2E1874EFEF6; Sun, 31 Jan 2021 11:10:04 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 4DT7dl1Hfbz3Bm6; Sun, 31 Jan 2021 11:10:02 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x430.google.com with SMTP id z6so13380247wrq.10; Sun, 31 Jan 2021 03:10:02 -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=qW50Gnpriujo77QhQloeI+X9KA3PDbyLtJ/7+49VudU=; b=d54AMtSCBBEisnqpmud15dhxChj+A7cHGYQI1aCtAi7fPzIHtbCyBqMnRAmYv6hXh/ qrqUjoLJw3R6AuyqjRrWvqsThy/1dt+4akRKO/49L06ZxUFVdZO2W9uBhwco4HDc379X ZCHero06OhVOiZCfE7qxRFrmZ6+8Uxuckfii5ZFkojVdxxz1cdqjw1A1fBIH6kXnUczt pqPV3IHsFUjB0hrVY/EgpfIMj0YnkB0yNa3BANnaeUeMsgqY2Rm7FDxEbejpXuAgnOkA WoP8dZsLpKgYomrRdyvis+zFeUf9cbKpb6kP/qGkNn/T4a3Bcm1Fkv+Txz9Z8WEtrieL QfKQ== 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=qW50Gnpriujo77QhQloeI+X9KA3PDbyLtJ/7+49VudU=; b=r6vve6bIMSNU0H5wytI5mabzXprThohv3xwrtuDHe3ZNTSOGQl/NEnioCfiCU2eqEA BFOlzke3ZW6vxoMEMhTmSXYHDh9p6xg+NjkgsURv4FFnnp/KKeP3zHlHhM5jMuwvkaZ2 Qe1ye4wJD2MiDu8fDE5wRTqKp8bNjIkAzJhGOXt6pEsmfp61UnZpQxT6vPQYVKXClQpu mdQMFgg4AA0W1D1hmKN9qk/AF514heHOHa17tGlGH+dKCzFWqs28HtFQjZRcLWsIecfs HsPChEps0NtqEYyaJAFjnGE+gRguoi4/6uJw7228zoIr6pGauT+byL4s4kg+7VpK17kk uutg== X-Gm-Message-State: AOAM530b+2Qgstdg/Yn2nQvZroMHFW0niwEv8zTiyfdfgdKKs75pd8/S cywj7zWUmjECAexLXet5ziGAK89XGwF0MPgpeQRwCMj791g= X-Google-Smtp-Source: ABdhPJzND3aht6HaArHkelKZ7AQSo7PhK541u53QQpVgVTuycRL0sizrhAqM6u/WpCCW1Vg615INB3zQw0Lqv4dwoFk= X-Received: by 2002:adf:e511:: with SMTP id j17mr13217926wrm.17.1612091400198; Sun, 31 Jan 2021 03:10:00 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Sun, 31 Jan 2021 03:09:58 -0800 (PST) In-Reply-To: References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 31 Jan 2021 12:09:58 +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: Randall Stewart 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: 4DT7dl1Hfbz3Bm6 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=d54AMtSC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::430 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-1.95 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; LONG_SUBJ(2.05)[273]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-0.996]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::430:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; 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]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::430:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::430:from]; RCVD_COUNT_TWO(0.00)[2]; 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: Sun, 31 Jan 2021 11:10:04 -0000 ping? I'm going to revert this on Tuesday to unbreak the build On 1/29/21, Mateusz Guzik wrote: > This breaks tinderbox: > arm LINT kernel failed, check _.arm.LINT for details > i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details > i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details > i386 LINT kernel failed, check _.i386.LINT for details > amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details > > > On 1/28/21, Randall Stewart wrote: >> The branch main has been updated by rrs: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=1a714ff204193b9eb810426048e03f5d76e9730e >> >> commit 1a714ff204193b9eb810426048e03f5d76e9730e >> Author: Randall Stewart >> AuthorDate: 2021-01-26 16:54:42 +0000 >> Commit: Randall Stewart >> CommitDate: 2021-01-28 16:53:05 +0000 >> >> 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. >> >> Sponsored by: Netflix Inc. >> Differential Revision: https://reviews.freebsd.org/D28357 >> --- >> sys/net/if_lagg.c | 11 + >> sys/net/if_var.h | 2 + >> sys/net/if_vlan.c | 30 +++ >> sys/netinet/in_pcb.c | 9 + >> sys/netinet/tcp_log_buf.h | 2 +- >> sys/netinet/tcp_ratelimit.c | 584 >> +++++++++++++++++++++++++++--------------- >> sys/netinet/tcp_ratelimit.h | 24 +- >> sys/netinet/tcp_stacks/bbr.c | 4 +- >> sys/netinet/tcp_stacks/rack.c | 14 +- >> 9 files changed, 464 insertions(+), 216 deletions(-) >> >> diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c >> index 3144f86901b2..9a3c22789fa5 100644 >> --- a/sys/net/if_lagg.c >> +++ b/sys/net/if_lagg.c >> @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct m_snd_tag *, >> static int lagg_snd_tag_query(struct m_snd_tag *, >> union if_snd_tag_query_params *); >> static void lagg_snd_tag_free(struct m_snd_tag *); >> +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); >> static void lagg_ratelimit_query(struct ifnet *, >> struct if_ratelimit_query_results *); >> #endif >> @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, >> caddr_t params) >> ifp->if_snd_tag_modify = lagg_snd_tag_modify; >> ifp->if_snd_tag_query = lagg_snd_tag_query; >> ifp->if_snd_tag_free = lagg_snd_tag_free; >> + ifp->if_next_snd_tag = lagg_next_snd_tag; >> ifp->if_ratelimit_query = lagg_ratelimit_query; >> #endif >> ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; >> @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, >> return (0); >> } >> >> +static struct m_snd_tag * >> +lagg_next_snd_tag(struct m_snd_tag *mst) >> +{ >> + struct lagg_snd_tag *lst; >> + >> + lst = mst_to_lst(mst); >> + return (lst->tag); >> +} >> + >> static int >> lagg_snd_tag_modify(struct m_snd_tag *mst, >> union if_snd_tag_modify_params *params) >> diff --git a/sys/net/if_var.h b/sys/net/if_var.h >> index beb9596895ee..9ecdfb684296 100644 >> --- a/sys/net/if_var.h >> +++ b/sys/net/if_var.h >> @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, >> union >> if_snd_tag_alloc_params * >> typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union >> if_snd_tag_modify_params *); >> typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union >> if_snd_tag_query_params *); >> typedef void (if_snd_tag_free_t)(struct m_snd_tag *); >> +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); >> typedef void (if_ratelimit_query_t)(struct ifnet *, >> struct if_ratelimit_query_results *); >> typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t); >> @@ -422,6 +423,7 @@ struct ifnet { >> if_snd_tag_modify_t *if_snd_tag_modify; >> if_snd_tag_query_t *if_snd_tag_query; >> if_snd_tag_free_t *if_snd_tag_free; >> + if_next_send_tag_t *if_next_snd_tag; >> if_ratelimit_query_t *if_ratelimit_query; >> if_ratelimit_setup_t *if_ratelimit_setup; >> >> diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c >> index 9358724844cb..9703e5e7753f 100644 >> --- a/sys/net/if_vlan.c >> +++ b/sys/net/if_vlan.c >> @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag *, >> static int vlan_snd_tag_query(struct m_snd_tag *, >> union if_snd_tag_query_params *); >> static void vlan_snd_tag_free(struct m_snd_tag *); >> +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); >> +static void vlan_ratelimit_query(struct ifnet *, >> + struct if_ratelimit_query_results *); >> #endif >> static void vlan_qflush(struct ifnet *ifp); >> static int vlan_setflag(struct ifnet *ifp, int flag, int status, >> @@ -1071,6 +1074,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, >> size_t len, caddr_t params) >> ifp->if_snd_tag_modify = vlan_snd_tag_modify; >> ifp->if_snd_tag_query = vlan_snd_tag_query; >> ifp->if_snd_tag_free = vlan_snd_tag_free; >> + ifp->if_next_snd_tag = vlan_next_snd_tag; >> + ifp->if_ratelimit_query = vlan_ratelimit_query; >> #endif >> ifp->if_flags = VLAN_IFFLAGS; >> ether_ifattach(ifp, eaddr); >> @@ -2073,6 +2078,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, >> return (0); >> } >> >> +static struct m_snd_tag * >> +vlan_next_snd_tag(struct m_snd_tag *mst) >> +{ >> + struct vlan_snd_tag *vst; >> + >> + vst = mst_to_vst(mst); >> + return (vst->tag); >> +} >> + >> static int >> vlan_snd_tag_modify(struct m_snd_tag *mst, >> union if_snd_tag_modify_params *params) >> @@ -2102,4 +2116,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) >> m_snd_tag_rele(vst->tag); >> free(vst, M_VLAN); >> } >> + >> +static void >> +vlan_ratelimit_query(struct ifnet *ifp __unused, struct >> if_ratelimit_query_results *q) >> +{ >> + /* >> + * For vlan, we have an indirect >> + * interface. The caller needs to >> + * get a ratelimit tag on the actual >> + * interface the flow will go on. >> + */ >> + q->rate_table = NULL; >> + q->flags = RT_IS_INDIRECT; >> + q->max_flows = 0; >> + q->number_of_rates = 0; >> +} >> + >> #endif >> diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c >> index 59695ee3715d..40a0b4c0676e 100644 >> --- a/sys/netinet/in_pcb.c >> +++ b/sys/netinet/in_pcb.c >> @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, >> randomtime, >> "allocation before switching to a random one"); >> >> #ifdef RATELIMIT >> +counter_u64_t rate_limit_new; >> +counter_u64_t rate_limit_chg; >> counter_u64_t rate_limit_active; >> counter_u64_t rate_limit_alloc_fail; >> counter_u64_t rate_limit_set_ok; >> @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, >> alloc_fail, CTLFLAG_RD, >> &rate_limit_alloc_fail, "Rate limited connection failures"); >> SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, >> &rate_limit_set_ok, "Rate limited setting succeeded"); >> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, >> + &rate_limit_new, "Total Rate limit new attempts"); >> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, >> + &rate_limit_chg, "Total Rate limited change attempts"); >> + >> #endif /* RATELIMIT */ >> >> #endif /* INET */ >> @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) >> static void >> rl_init(void *st) >> { >> + rate_limit_new = counter_u64_alloc(M_WAITOK); >> + rate_limit_chg = counter_u64_alloc(M_WAITOK); >> rate_limit_active = counter_u64_alloc(M_WAITOK); >> rate_limit_alloc_fail = counter_u64_alloc(M_WAITOK); >> rate_limit_set_ok = counter_u64_alloc(M_WAITOK); >> diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h >> index 0d9b14a08f53..436383124dce 100644 >> --- a/sys/netinet/tcp_log_buf.h >> +++ b/sys/netinet/tcp_log_buf.h >> @@ -221,7 +221,7 @@ enum tcp_log_events { >> BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ >> BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 */ >> TCP_LOG_REASS, /* Reassembly buffer logging 50 */ >> - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 */ >> + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this) 51 >> */ >> BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ >> BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 */ >> TCP_LOG_CONNEND, /* End of connection 54 */ >> diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c >> index 97f066be69e0..aeb1ed6906b5 100644 >> --- a/sys/netinet/tcp_ratelimit.c >> +++ b/sys/netinet/tcp_ratelimit.c >> @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); >> #ifdef INET6 >> #include >> #endif >> +#include >> +#include >> #include >> #ifndef USECS_IN_SECOND >> #define USECS_IN_SECOND 1000000 >> @@ -154,108 +156,77 @@ const uint64_t desired_rates[] = { >> 180500, /* 1.44Mpbs - rate 2 common rate */ >> 375000, /* 3Mbps - rate 3 */ >> 625000, /* 5Mbps - rate 4 */ >> - 875000, /* 7Mbps - rate 5 */ >> - 1125000, /* 9Mbps - rate 6 */ >> - 1375000, /* 11Mbps - rate 7 */ >> - 1625000, /* 13Mbps - rate 8 */ >> - 2625000, /* 21Mbps - rate 9 */ >> - 3875000, /* 31Mbps - rate 10 */ >> - 5125000, /* 41Meg - rate 11 */ >> - 12500000, /* 100Mbps - rate 12 */ >> - 25000000, /* 200Mbps - rate 13 */ >> - 50000000, /* 400Mbps - rate 14 */ >> - 63750000, /* 51Mbps - rate 15 */ >> + 1250000, /* 10Mbps - rate 5 */ >> + 1875000, /* 15Mbps - rate 6 */ >> + 2500000, /* 20Mbps - rate 7 */ >> + 3125000, /* 25Mbps - rate 8 */ >> + 3750000, /* 30Mbps - rate 9 */ >> + 4375000, /* 35Mbps - rate 10 */ >> + 5000000, /* 40Meg - rate 11 */ >> + 6250000, /* 50Mbps - rate 12 */ >> + 12500000, /* 100Mbps - rate 13 */ >> + 25000000, /* 200Mbps - rate 14 */ >> + 50000000, /* 400Mbps - rate 15 */ >> 100000000, /* 800Mbps - rate 16 */ >> - 1875000, /* 15Mbps - rate 17 */ >> - 2125000, /* 17Mbps - rate 18 */ >> - 2375000, /* 19Mbps - rate 19 */ >> - 2875000, /* 23Mbps - rate 20 */ >> - 3125000, /* 25Mbps - rate 21 */ >> - 3375000, /* 27Mbps - rate 22 */ >> - 3625000, /* 29Mbps - rate 23 */ >> - 4125000, /* 33Mbps - rate 24 */ >> - 4375000, /* 35Mbps - rate 25 */ >> - 4625000, /* 37Mbps - rate 26 */ >> - 4875000, /* 39Mbps - rate 27 */ >> - 5375000, /* 43Mbps - rate 28 */ >> - 5625000, /* 45Mbps - rate 29 */ >> - 5875000, /* 47Mbps - rate 30 */ >> - 6125000, /* 49Mbps - rate 31 */ >> - 6625000, /* 53Mbps - rate 32 */ >> - 6875000, /* 55Mbps - rate 33 */ >> - 7125000, /* 57Mbps - rate 34 */ >> - 7375000, /* 59Mbps - rate 35 */ >> - 7625000, /* 61Mbps - rate 36 */ >> - 7875000, /* 63Mbps - rate 37 */ >> - 8125000, /* 65Mbps - rate 38 */ >> - 8375000, /* 67Mbps - rate 39 */ >> - 8625000, /* 69Mbps - rate 40 */ >> - 8875000, /* 71Mbps - rate 41 */ >> - 9125000, /* 73Mbps - rate 42 */ >> - 9375000, /* 75Mbps - rate 43 */ >> - 9625000, /* 77Mbps - rate 44 */ >> - 9875000, /* 79Mbps - rate 45 */ >> - 10125000, /* 81Mbps - rate 46 */ >> - 10375000, /* 83Mbps - rate 47 */ >> - 10625000, /* 85Mbps - rate 48 */ >> - 10875000, /* 87Mbps - rate 49 */ >> - 11125000, /* 89Mbps - rate 50 */ >> - 11375000, /* 91Mbps - rate 51 */ >> - 11625000, /* 93Mbps - rate 52 */ >> - 11875000, /* 95Mbps - rate 53 */ >> - 13125000, /* 105Mbps - rate 54 */ >> - 13750000, /* 110Mbps - rate 55 */ >> - 14375000, /* 115Mbps - rate 56 */ >> - 15000000, /* 120Mbps - rate 57 */ >> - 15625000, /* 125Mbps - rate 58 */ >> - 16250000, /* 130Mbps - rate 59 */ >> - 16875000, /* 135Mbps - rate 60 */ >> - 17500000, /* 140Mbps - rate 61 */ >> - 18125000, /* 145Mbps - rate 62 */ >> - 18750000, /* 150Mbps - rate 64 */ >> - 20000000, /* 160Mbps - rate 65 */ >> - 21250000, /* 170Mbps - rate 66 */ >> - 22500000, /* 180Mbps - rate 67 */ >> - 23750000, /* 190Mbps - rate 68 */ >> - 26250000, /* 210Mbps - rate 69 */ >> - 27500000, /* 220Mbps - rate 70 */ >> - 28750000, /* 230Mbps - rate 71 */ >> - 30000000, /* 240Mbps - rate 72 */ >> - 31250000, /* 250Mbps - rate 73 */ >> - 34375000, /* 275Mbps - rate 74 */ >> - 37500000, /* 300Mbps - rate 75 */ >> - 40625000, /* 325Mbps - rate 76 */ >> - 43750000, /* 350Mbps - rate 77 */ >> - 46875000, /* 375Mbps - rate 78 */ >> - 53125000, /* 425Mbps - rate 79 */ >> - 56250000, /* 450Mbps - rate 80 */ >> - 59375000, /* 475Mbps - rate 81 */ >> - 62500000, /* 500Mbps - rate 82 */ >> - 68750000, /* 550Mbps - rate 83 */ >> - 75000000, /* 600Mbps - rate 84 */ >> - 81250000, /* 650Mbps - rate 85 */ >> - 87500000, /* 700Mbps - rate 86 */ >> - 93750000, /* 750Mbps - rate 87 */ >> - 106250000, /* 850Mbps - rate 88 */ >> - 112500000, /* 900Mbps - rate 89 */ >> - 125000000, /* 1Gbps - rate 90 */ >> - 156250000, /* 1.25Gps - rate 91 */ >> - 187500000, /* 1.5Gps - rate 92 */ >> - 218750000, /* 1.75Gps - rate 93 */ >> - 250000000, /* 2Gbps - rate 94 */ >> - 281250000, /* 2.25Gps - rate 95 */ >> - 312500000, /* 2.5Gbps - rate 96 */ >> - 343750000, /* 2.75Gbps - rate 97 */ >> - 375000000, /* 3Gbps - rate 98 */ >> - 500000000, /* 4Gbps - rate 99 */ >> - 625000000, /* 5Gbps - rate 100 */ >> - 750000000, /* 6Gbps - rate 101 */ >> - 875000000, /* 7Gbps - rate 102 */ >> - 1000000000, /* 8Gbps - rate 103 */ >> - 1125000000, /* 9Gbps - rate 104 */ >> - 1250000000, /* 10Gbps - rate 105 */ >> - 1875000000, /* 15Gbps - rate 106 */ >> - 2500000000 /* 20Gbps - rate 107 */ >> + 5625000, /* 45Mbps - rate 17 */ >> + 6875000, /* 55Mbps - rate 19 */ >> + 7500000, /* 60Mbps - rate 20 */ >> + 8125000, /* 65Mbps - rate 21 */ >> + 8750000, /* 70Mbps - rate 22 */ >> + 9375000, /* 75Mbps - rate 23 */ >> + 10000000, /* 80Mbps - rate 24 */ >> + 10625000, /* 85Mbps - rate 25 */ >> + 11250000, /* 90Mbps - rate 26 */ >> + 11875000, /* 95Mbps - rate 27 */ >> + 12500000, /* 100Mbps - rate 28 */ >> + 13750000, /* 110Mbps - rate 29 */ >> + 15000000, /* 120Mbps - rate 30 */ >> + 16250000, /* 130Mbps - rate 31 */ >> + 17500000, /* 140Mbps - rate 32 */ >> + 18750000, /* 150Mbps - rate 33 */ >> + 20000000, /* 160Mbps - rate 34 */ >> + 21250000, /* 170Mbps - rate 35 */ >> + 22500000, /* 180Mbps - rate 36 */ >> + 23750000, /* 190Mbps - rate 37 */ >> + 26250000, /* 210Mbps - rate 38 */ >> + 27500000, /* 220Mbps - rate 39 */ >> + 28750000, /* 230Mbps - rate 40 */ >> + 30000000, /* 240Mbps - rate 41 */ >> + 31250000, /* 250Mbps - rate 42 */ >> + 34375000, /* 275Mbps - rate 43 */ >> + 37500000, /* 300Mbps - rate 44 */ >> + 40625000, /* 325Mbps - rate 45 */ >> + 43750000, /* 350Mbps - rate 46 */ >> + 46875000, /* 375Mbps - rate 47 */ >> + 53125000, /* 425Mbps - rate 48 */ >> + 56250000, /* 450Mbps - rate 49 */ >> + 59375000, /* 475Mbps - rate 50 */ >> + 62500000, /* 500Mbps - rate 51 */ >> + 68750000, /* 550Mbps - rate 52 */ >> + 75000000, /* 600Mbps - rate 53 */ >> + 81250000, /* 650Mbps - rate 54 */ >> + 87500000, /* 700Mbps - rate 55 */ >> + 93750000, /* 750Mbps - rate 56 */ >> + 106250000, /* 850Mbps - rate 57 */ >> + 112500000, /* 900Mbps - rate 58 */ >> + 125000000, /* 1Gbps - rate 59 */ >> + 156250000, /* 1.25Gps - rate 60 */ >> + 187500000, /* 1.5Gps - rate 61 */ >> + 218750000, /* 1.75Gps - rate 62 */ >> + 250000000, /* 2Gbps - rate 63 */ >> + 281250000, /* 2.25Gps - rate 64 */ >> + 312500000, /* 2.5Gbps - rate 65 */ >> + 343750000, /* 2.75Gbps - rate 66 */ >> + 375000000, /* 3Gbps - rate 67 */ >> + 500000000, /* 4Gbps - rate 68 */ >> + 625000000, /* 5Gbps - rate 69 */ >> + 750000000, /* 6Gbps - rate 70 */ >> + 875000000, /* 7Gbps - rate 71 */ >> + 1000000000, /* 8Gbps - rate 72 */ >> + 1125000000, /* 9Gbps - rate 73 */ >> + 1250000000, /* 10Gbps - rate 74 */ >> + 1875000000, /* 15Gbps - rate 75 */ >> + 2500000000 /* 20Gbps - rate 76 */ >> }; >> >> #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) >> @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; >> static struct mtx rs_mtx; >> uint32_t rs_number_alive; >> uint32_t rs_number_dead; >> +static uint32_t rs_floor_mss = 0; >> +static uint32_t wait_time_floor = 8000; /* 8 ms */ >> +static uint32_t rs_hw_floor_mss = 16; >> +static uint32_t num_of_waits_allowed = 1; /* How many time blocks are we >> willing to wait */ >> >> SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >> "TCP Ratelimit stats"); >> @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, >> CTLFLAG_RW, >> SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, >> &rs_number_dead, 0, >> "Number of interfaces departing from ratelimiting"); >> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, >> + &rs_floor_mss, 0, >> + "Number of MSS that will override the normal minimums (0 means don't >> enforce)"); >> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, >> + &wait_time_floor, 2000, >> + "Has b/w increases what is the wait floor we are willing to wait at >> the >> end?"); >> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, >> + &num_of_waits_allowed, 1, >> + "How many time blocks on the end should software pacing be willing >> to >> wait?"); >> + >> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, >> + &rs_hw_floor_mss, 16, >> + "Number of mss that are a minum for hardware pacing?"); >> + >> >> static void >> rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct >> tcp_rate_set >> *rs) >> @@ -383,6 +372,17 @@ 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 >> @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) >> } >> >> #ifdef INET >> +extern counter_u64_t rate_limit_new; >> +extern counter_u64_t rate_limit_chg; >> extern counter_u64_t rate_limit_set_ok; >> extern counter_u64_t rate_limit_active; >> extern counter_u64_t rate_limit_alloc_fail; >> @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >> int i; >> struct if_ratelimit_query_results rl; >> struct sysctl_oid *rl_sysctl_root; >> + struct epoch_tracker et; >> /* >> * We expect to enter with the >> * mutex locked. >> @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >> ""); >> rl_add_syctl_entries(rl_sysctl_root, rs); >> + NET_EPOCH_ENTER(et); >> mtx_lock(&rs_mtx); >> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >> mtx_unlock(&rs_mtx); >> + NET_EPOCH_EXIT(et); >> return (rs); >> } else if ((rl.flags & RT_IS_INDIRECT) == RT_IS_INDIRECT) { >> memset(rs, 0, sizeof(struct tcp_rate_set)); >> @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >> ""); >> rl_add_syctl_entries(rl_sysctl_root, rs); >> + NET_EPOCH_ENTER(et); >> mtx_lock(&rs_mtx); >> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >> mtx_unlock(&rs_mtx); >> + NET_EPOCH_EXIT(et); >> return (rs); >> } else if ((rl.flags & RT_IS_FIXED_TABLE) == RT_IS_FIXED_TABLE) { >> /* Mellanox C4 likely */ >> @@ -671,6 +678,8 @@ 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. >> */ >> @@ -741,18 +750,24 @@ handle_err: >> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >> ""); >> rl_add_syctl_entries(rl_sysctl_root, rs); >> + NET_EPOCH_ENTER(et); >> mtx_lock(&rs_mtx); >> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >> mtx_unlock(&rs_mtx); >> + NET_EPOCH_EXIT(et); >> return (rs); >> } >> >> +/* >> + * For an explanation of why the argument is volatile please >> + * look at the comments around rt_setup_rate(). >> + */ >> static const struct tcp_hwrate_limit_table * >> -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, >> - uint64_t bytes_per_sec, uint32_t flags) >> +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, >> + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) >> { >> struct tcp_hwrate_limit_table *arte = NULL, *rte = NULL; >> - uint64_t mbits_per_sec, ind_calc; >> + uint64_t mbits_per_sec, ind_calc, previous_rate = 0; >> int i; >> >> mbits_per_sec = (bytes_per_sec * 8); >> @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set >> *rs, >> * Smaller than 1Meg, only >> * 3 entries can match it. >> */ >> + previous_rate = 0; >> for(i = rs->rs_lowest_valid; i < 3; i++) { >> if (bytes_per_sec <= rs->rs_rlt[i].rate) { >> rte = &rs->rs_rlt[i]; >> @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set >> *rs, >> } else if (rs->rs_rlt[i].flags & HDWRPACE_INITED) { >> arte = &rs->rs_rlt[i]; >> } >> + previous_rate = rs->rs_rlt[i].rate; >> } >> goto done; >> } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && >> @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set >> *rs, >> rte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >> else >> arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >> + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; >> goto done; >> } >> /* >> @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set >> *rs, >> ind_calc = ALL_HARDWARE_RATES-1; >> } >> if ((ind_calc >= rs->rs_lowest_valid) && >> - (ind_calc <= rs->rs_highest_valid)) >> - rte = &rs->rs_rlt[ind_calc]; >> + (ind_calc <= rs->rs_highest_valid)) { >> + rte = &rs->rs_rlt[ind_calc]; >> + if (ind_calc >= 1) >> + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; >> + } >> } else if (flags & RS_PACING_EXACT_MATCH) { >> if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && >> (rs->rs_lowest_valid <= 2)){ >> @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct >> tcp_rate_set >> *rs, >> for (i=2; i>=rs->rs_lowest_valid; i--) { >> if (bytes_per_sec < rs->rs_rlt[i].rate) { >> rte = &rs->rs_rlt[i]; >> + if (i >= 1) { >> + previous_rate = rs->rs_rlt[(i-1)].rate; >> + } >> break; >> } else if ((flags & RS_PACING_GEQ) && >> (bytes_per_sec == rs->rs_rlt[i].rate)) { >> rte = &rs->rs_rlt[i]; >> + if (i >= 1) { >> + previous_rate = rs->rs_rlt[(i-1)].rate; >> + } >> break; >> } else { >> arte = &rs->rs_rlt[i]; /* new alternate */ >> @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set >> *rs, >> /* The top rate is an alternative */ >> arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >> } >> + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; >> } else { >> /* Its in our range 1Meg - 1Gig */ >> if (flags & RS_PACING_GEQ) { >> @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set >> *rs, >> ind_calc = (ALL_HARDWARE_RATES-1); >> } >> rte = &rs->rs_rlt[ind_calc]; >> + if (ind_calc >= 1) >> + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; >> } >> goto done; >> } >> @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set >> *rs, >> /* This should not happen */ >> ind_calc = ALL_HARDWARE_RATES-1; >> } >> - if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) >> + if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) { >> rte = &rs->rs_rlt[ind_calc]; >> + if (ind_calc >= 1) >> + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; >> + } >> } >> } >> done: >> @@ -893,11 +926,17 @@ done: >> /* We can use the substitute */ >> rte = arte; >> } >> + if (lower_rate) >> + *lower_rate = previous_rate; >> return (rte); >> } >> >> +/* >> + * For an explanation of why the argument is volatile please >> + * look at the comments around rt_setup_rate(). >> + */ >> static const struct tcp_hwrate_limit_table * >> -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t >> bytes_per_sec, uint32_t flags) >> +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, uint64_t >> bytes_per_sec, uint32_t flags, uint64_t *lower_rate) >> { >> /** >> * Hunt the rate table with the restrictions in flags and find a >> @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, >> uint64_t bytes_per_sec, ui >> */ >> int i, matched; >> struct tcp_hwrate_limit_table *rte = NULL; >> + uint64_t previous_rate = 0; >> >> if ((rs->rs_flags & RS_INT_TBL) && >> (rs->rs_rate_cnt >= ALL_HARDWARE_RATES)) { >> @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, >> uint64_t bytes_per_sec, ui >> * from 1Meg - 1000Meg in 1Meg increments. >> * Use an alternate method to "lookup". >> */ >> - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags)); >> + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags, >> lower_rate)); >> } >> if ((flags & RS_PACING_LT) || >> (flags & RS_PACING_EXACT_MATCH)) { >> @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct tcp_rate_set >> *rs, >> uint64_t bytes_per_sec, ui >> (bytes_per_sec == rs->rs_rlt[i].rate)) { >> rte = &rs->rs_rlt[i]; >> matched = 1; >> + if (lower_rate != NULL) >> + *lower_rate = previous_rate; >> break; >> } else if ((flags & RS_PACING_LT) && >> (bytes_per_sec <= rs->rs_rlt[i].rate)) { >> rte = &rs->rs_rlt[i]; >> matched = 1; >> + if (lower_rate != NULL) >> + *lower_rate = previous_rate; >> break; >> } >> + previous_rate = rs->rs_rlt[i].rate; >> if (bytes_per_sec > rs->rs_rlt[i].rate) >> break; >> } >> @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct tcp_rate_set >> *rs, >> uint64_t bytes_per_sec, ui >> * We found a table entry that is smaller, >> * stop there will be none greater or equal. >> */ >> + if (lower_rate != NULL) >> + *lower_rate = rs->rs_rlt[i].rate; >> break; >> } >> } >> @@ -995,10 +1042,10 @@ static struct ifnet * >> rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) >> { >> struct ifnet *tifp; >> - struct m_snd_tag *tag; >> + struct m_snd_tag *tag, *ntag; >> union if_snd_tag_alloc_params params = { >> .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, >> - .rate_limit.hdr.flowid = 1, >> + .rate_limit.hdr.flowid = inp->inp_flowid, >> .rate_limit.hdr.numa_domain = inp->inp_numa_domain, >> .rate_limit.max_rate = COMMON_RATE, >> .rate_limit.flags = M_NOWAIT, >> @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, struct >> inpcb *inp, int *error) >> *error = err; >> return (NULL); >> } >> - tifp = tag->ifp; >> + ntag = tag; >> + while(ntag->ifp->if_next_snd_tag != NULL) { >> + ntag = ntag->ifp->if_next_snd_tag(ntag); >> + } >> + tifp = ntag->ifp; >> m_snd_tag_rele(tag); >> return (tifp); >> } >> >> +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); >> +} >> + >> +/* >> + * Do NOT take the __noinline out of the >> + * find_rs_for_ifp() function. If you do the inline >> + * of it for the rt_setup_rate() will show you a >> + * compiler bug. For some reason the compiler thinks >> + * the list can never be empty. The consequence of >> + * this will be a crash when we dereference NULL >> + * if an ifp is removed just has a hw rate limit >> + * is attempted. If you are working on the compiler >> + * and want to "test" this go ahead and take the noinline >> + * out otherwise let sleeping dogs ly until such time >> + * as we get a compiler fix 10/2/20 -- RRS >> + */ >> +static __noinline struct tcp_rate_set * >> +find_rs_for_ifp(struct ifnet *ifp) >> +{ >> + struct tcp_rate_set *rs; >> + >> + CK_LIST_FOREACH(rs, &int_rs, next) { >> + if ((rs->rs_ifp == ifp) && >> + (rs->rs_if_dunit == ifp->if_dunit)) { >> + /* Ok we found it */ >> + return (rs); >> + } >> + } >> + return (NULL); >> +} >> + >> + >> static const struct tcp_hwrate_limit_table * >> rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t >> bytes_per_sec, >> - uint32_t flags, int *error) >> + uint32_t flags, int *error, uint64_t *lower_rate) >> { >> /* First lets find the interface if it exists */ >> const struct tcp_hwrate_limit_table *rte; >> - struct tcp_rate_set *rs; >> + /* >> + * So why is rs volatile? This is to defeat a >> + * compiler bug where in the compiler is convinced >> + * that rs can never be NULL (which is not true). Because >> + * of its conviction it nicely optimizes out the if ((rs == NULL >> + * below which means if you get a NULL back you dereference it. >> + */ >> + volatile struct tcp_rate_set *rs; >> struct epoch_tracker et; >> + struct ifnet *oifp = ifp; >> int err; >> >> NET_EPOCH_ENTER(et); >> use_real_interface: >> - CK_LIST_FOREACH(rs, &int_rs, next) { >> - /* >> - * Note we don't look with the lock since we either see a >> - * new entry or will get one when we try to add it. >> - */ >> - if (rs->rs_flags & RS_IS_DEAD) { >> - /* The dead are not looked at */ >> - continue; >> - } >> - if ((rs->rs_ifp == ifp) && >> - (rs->rs_if_dunit == ifp->if_dunit)) { >> - /* Ok we found it */ >> - break; >> - } >> - } >> + rs = find_rs_for_ifp(ifp); >> if ((rs == NULL) || >> (rs->rs_flags & RS_INTF_NO_SUP) || >> (rs->rs_flags & RS_IS_DEAD)) { >> @@ -1063,14 +1164,14 @@ use_real_interface: >> * might be arguable, but its impossible >> * to tell from the departing case. >> */ >> - if (rs->rs_disable && error) >> + if (error) >> *error = ENODEV; >> NET_EPOCH_EXIT(et); >> return (NULL); >> } >> >> if ((rs == NULL) || (rs->rs_disable != 0)) { >> - if (rs->rs_disable && error) >> + if (error) >> *error = ENOSPC; >> NET_EPOCH_EXIT(et); >> return (NULL); >> @@ -1086,6 +1187,10 @@ use_real_interface: >> NET_EPOCH_EXIT(et); >> return (NULL); >> } >> + KASSERT((tifp != ifp), >> + ("Lookup failure ifp:%p inp:%p rt_find_real_interface() returns the >> same >> interface tifp:%p?\n", >> + ifp, inp, tifp)); >> + ifp = tifp; >> goto use_real_interface; >> } >> if (rs->rs_flow_limit && >> @@ -1095,9 +1200,9 @@ use_real_interface: >> NET_EPOCH_EXIT(et); >> return (NULL); >> } >> - rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags); >> + rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate); >> if (rte) { >> - err = in_pcbattach_txrtlmt(inp, rs->rs_ifp, >> + err = in_pcbattach_txrtlmt(inp, oifp, >> inp->inp_flowtype, >> inp->inp_flowid, >> rte->rate, >> @@ -1107,6 +1212,11 @@ use_real_interface: >> if (error) >> *error = err; >> 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)); >> + counter_u64_add(rate_limit_new, 1); >> } >> } >> if (rte) { >> @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet >> *ifp, int link_state) >> { >> int error; >> struct tcp_rate_set *rs; >> + struct epoch_tracker et; >> >> if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || >> (link_state != LINK_STATE_UP)) { >> @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct >> ifnet >> *ifp, int link_state) >> */ >> return; >> } >> + NET_EPOCH_ENTER(et); >> mtx_lock(&rs_mtx); >> - CK_LIST_FOREACH(rs, &int_rs, next) { >> - if ((rs->rs_ifp == ifp) && >> - (rs->rs_if_dunit == ifp->if_dunit)) { >> - /* We already have initialized this guy */ >> - mtx_unlock(&rs_mtx); >> - return; >> - } >> + rs = find_rs_for_ifp(ifp); >> + if (rs) { >> + /* We already have initialized this guy */ >> + mtx_unlock(&rs_mtx); >> + NET_EPOCH_EXIT(et); >> + return; >> } >> mtx_unlock(&rs_mtx); >> + NET_EPOCH_EXIT(et); >> rt_setup_new_rs(ifp, &error); >> } >> >> static void >> tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) >> { >> - struct tcp_rate_set *rs, *nrs; >> + struct tcp_rate_set *rs; >> + struct epoch_tracker et; >> int i; >> >> + NET_EPOCH_ENTER(et); >> mtx_lock(&rs_mtx); >> - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { >> - if ((rs->rs_ifp == ifp) && >> - (rs->rs_if_dunit == ifp->if_dunit)) { >> - CK_LIST_REMOVE(rs, next); >> - rs_number_alive--; >> - rs->rs_flags |= RS_IS_DEAD; >> - for (i = 0; i < rs->rs_rate_cnt; i++) { >> - if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { >> - in_pcbdetach_tag(rs->rs_rlt[i].tag); >> - rs->rs_rlt[i].tag = NULL; >> - } >> - rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; >> + rs = find_rs_for_ifp(ifp); >> + if (rs) { >> + CK_LIST_REMOVE(rs, next); >> + rs_number_alive--; >> + rs->rs_flags |= RS_IS_DEAD; >> + for (i = 0; i < rs->rs_rate_cnt; i++) { >> + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { >> + in_pcbdetach_tag(rs->rs_rlt[i].tag); >> + rs->rs_rlt[i].tag = NULL; >> } >> - if (rs->rs_flows_using == 0) >> - rs_defer_destroy(rs); >> - break; >> + rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; >> } >> + if (rs->rs_flows_using == 0) >> + rs_defer_destroy(rs); >> } >> mtx_unlock(&rs_mtx); >> + NET_EPOCH_EXIT(et); >> } >> >> static void >> tcp_rl_shutdown(void *arg __unused, int howto __unused) >> { >> struct tcp_rate_set *rs, *nrs; >> + struct epoch_tracker et; >> int i; >> >> + NET_EPOCH_ENTER(et); >> mtx_lock(&rs_mtx); >> CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { >> CK_LIST_REMOVE(rs, next); >> @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int howto >> __unused) >> rs_defer_destroy(rs); >> } >> mtx_unlock(&rs_mtx); >> + NET_EPOCH_EXIT(et); >> } >> >> const struct tcp_hwrate_limit_table * >> tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, >> - uint64_t bytes_per_sec, int flags, int *error) >> + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) >> { >> const struct tcp_hwrate_limit_table *rte; >> #ifdef KERN_TLS >> @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet >> *ifp, >> } >> } >> #endif >> - rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error); >> + rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error, >> lower_rate); >> + if (rte) >> + rl_increment_using(rte); >> #ifdef KERN_TLS >> if (rte != NULL && tls != NULL && tls->snd_tag != NULL) { >> /* >> @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct >> ifnet >> *ifp, >> *error = EINVAL; >> rte = NULL; >> } >> - tp->t_pacing_rate = rte->rate; >> - *error = 0; >> + if (rte != NULL) { >> + tp->t_pacing_rate = rte->rate; >> + *error = 0; >> + } >> return (rte); >> } >> >> const struct tcp_hwrate_limit_table * >> tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, >> struct tcpcb *tp, struct ifnet *ifp, >> - uint64_t bytes_per_sec, int flags, int *error) >> + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) >> { >> const struct tcp_hwrate_limit_table *nrte; >> const struct tcp_rate_set *rs; >> #ifdef KERN_TLS >> struct ktls_session *tls = NULL; >> #endif >> - int is_indirect = 0; >> int err; >> >> INP_WLOCK_ASSERT(tp->t_inpcb); >> @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct >> tcp_hwrate_limit_table *crte, >> if ((rs->rs_flags & RS_IS_DEAD) || >> (crte->flags & HDWRPACE_IFPDEPARTED)) { >> /* Release the rate, and try anew */ >> -re_rate: >> + >> tcp_rel_pacing_rate(crte, tp); >> nrte = tcp_set_pacing_rate(tp, ifp, >> - bytes_per_sec, flags, error); >> *** 386 LINES SKIPPED *** >> _______________________________________________ >> 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 > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Sun Jan 31 12:03: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 434A24F2D96; Sun, 31 Jan 2021 12:03: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 4DT8qj1VVqz3GSY; Sun, 31 Jan 2021 12:03: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 2630027E21; Sun, 31 Jan 2021 12:03: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 10VC3jrv067736; Sun, 31 Jan 2021 12:03:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VC3jT9067735; Sun, 31 Jan 2021 12:03:45 GMT (envelope-from git) Date: Sun, 31 Jan 2021 12:03:45 GMT Message-Id: <202101311203.10VC3jT9067735@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: 8cbd164a179c - main - cache: handle NOFOLLOW requests for symlinks 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: 8cbd164a179c182e8fd4a71f366bc48fe840eafb 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, 31 Jan 2021 12:03:45 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8cbd164a179c182e8fd4a71f366bc48fe840eafb commit 8cbd164a179c182e8fd4a71f366bc48fe840eafb Author: Mateusz Guzik AuthorDate: 2021-01-26 22:14:49 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-31 12:02:46 +0000 cache: handle NOFOLLOW requests for symlinks Tested by: pho --- sys/kern/vfs_cache.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ff8aad14001b..b8b876657211 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4307,11 +4307,22 @@ cache_fplookup_final_modifying(struct cache_fpl *fpl) } /* - * Check if the target is either a symlink or a mount point. - * Since we expect this to be the terminal vnode it should - * almost never be true. + * If they want the symlink itself we are fine, but if they want to + * follow it regular lookup has to be engaged. */ - if (__predict_false(tvp->v_type == VLNK || cache_fplookup_is_mp(fpl))) { + if (tvp->v_type == VLNK) { + if ((cnp->cn_flags & FOLLOW) != 0) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + } + + /* + * Since we expect this to be the terminal vnode it should almost never + * be a mount point. + */ + if (__predict_false(cache_fplookup_is_mp(fpl))) { vput(dvp); vput(tvp); return (cache_fpl_aborted(fpl)); @@ -4614,7 +4625,15 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fpl_handled(fpl)); } - if (__predict_false(tvp->v_type == VLNK || cache_fplookup_is_mp(fpl))) { + if (tvp->v_type == VLNK) { + if ((cnp->cn_flags & FOLLOW) != 0) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + } + + if (__predict_false(cache_fplookup_is_mp(fpl))) { vput(dvp); vput(tvp); return (cache_fpl_aborted(fpl)); From owner-dev-commits-src-main@freebsd.org Sun Jan 31 12:03: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 D03864F2F92; Sun, 31 Jan 2021 12:03: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 4DT8qk4J7Zz3GYH; Sun, 31 Jan 2021 12:03: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 67FA627E22; Sun, 31 Jan 2021 12:03: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 10VC3ki9067759; Sun, 31 Jan 2021 12:03:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VC3kbc067758; Sun, 31 Jan 2021 12:03:46 GMT (envelope-from git) Date: Sun, 31 Jan 2021 12:03:46 GMT Message-Id: <202101311203.10VC3kbc067758@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: e027e24bfac7 - main - cache: add trailing slash 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: e027e24bfac7dd311ddacaec73d6c42102069511 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, 31 Jan 2021 12:03:47 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e027e24bfac7dd311ddacaec73d6c42102069511 commit e027e24bfac7dd311ddacaec73d6c42102069511 Author: Mateusz Guzik AuthorDate: 2021-01-26 00:38:21 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-31 12:02:46 +0000 cache: add trailing slash support Tested by: pho --- sys/kern/vfs_cache.c | 227 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 184 insertions(+), 43 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index b8b876657211..1780e8235dd3 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3714,6 +3714,7 @@ static bool cache_fplookup_is_mp(struct cache_fpl *fpl); 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); @@ -3971,6 +3972,13 @@ cache_fpl_islastcn(struct nameidata *ndp) return (*ndp->ni_next == 0); } +static bool +cache_fpl_istrailingslash(struct cache_fpl *fpl) +{ + + return (*(fpl->nulchar - 1) == '/'); +} + static bool cache_fpl_isdotdot(struct componentname *cnp) { @@ -4201,6 +4209,15 @@ cache_fplookup_final_modifying(struct cache_fpl *fpl) if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) docache = false; + /* + * Regular lookup nulifies the slash, which we don't do here. + * Don't take chances with filesystem routines seeing it for + * the last entry. + */ + if (cache_fpl_istrailingslash(fpl)) { + return (cache_fpl_partial(fpl)); + } + mp = atomic_load_ptr(&dvp->v_mount); if (__predict_false(mp == NULL)) { return (cache_fpl_aborted(fpl)); @@ -4533,7 +4550,6 @@ cache_fplookup_noentry(struct cache_fpl *fpl) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; - MPASS(*(cnp->cn_nameptr) != '/'); MPASS((cnp->cn_flags & MAKEENTRY) == 0); MPASS((cnp->cn_flags & ISDOTDOT) == 0); MPASS(!cache_fpl_isdotdot(cnp)); @@ -4546,6 +4562,14 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fpl_handled_error(fpl, ENAMETOOLONG)); } + if (cnp->cn_nameptr[0] == '/') { + return (cache_fplookup_skip_slashes(fpl)); + } + + if (cnp->cn_nameptr[0] == '\0') { + return (cache_fplookup_trailingslash(fpl)); + } + if (cnp->cn_nameiop != LOOKUP) { fpl->tvp = NULL; return (cache_fplookup_modifying(fpl)); @@ -4562,6 +4586,15 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fpl_partial(fpl)); } + /* + * Regular lookup nulifies the slash, which we don't do here. + * Don't take chances with filesystem routines seeing it for + * the last entry. + */ + if (cache_fpl_istrailingslash(fpl)) { + return (cache_fpl_partial(fpl)); + } + /* * Secure access to dvp; check cache_fplookup_partial_setup for * reasoning. @@ -4792,6 +4825,7 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) { struct nameidata *ndp; struct componentname *cnp; + size_t adjust; ndp = fpl->ndp; cnp = fpl->cnp; @@ -4800,6 +4834,12 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) return (ENOENT); } + if (__predict_false(len > MAXPATHLEN - 2)) { + if (cache_fpl_istrailingslash(fpl)) { + return (EAGAIN); + } + } + ndp->ni_pathlen = fpl->nulchar - cnp->cn_nameptr - cnp->cn_namelen + 1; #ifdef INVARIANTS if (ndp->ni_pathlen != fpl->debug.ni_pathlen) { @@ -4817,15 +4857,22 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) return (ELOOP); } + adjust = len; if (ndp->ni_pathlen > 1) { bcopy(ndp->ni_next, cnp->cn_pnbuf + len, ndp->ni_pathlen); } else { - cnp->cn_pnbuf[len] = '\0'; + if (cache_fpl_istrailingslash(fpl)) { + adjust = len + 1; + cnp->cn_pnbuf[len] = '/'; + cnp->cn_pnbuf[len + 1] = '\0'; + } else { + cnp->cn_pnbuf[len] = '\0'; + } } bcopy(string, cnp->cn_pnbuf, len); - ndp->ni_pathlen += len; - cache_fpl_pathlen_add(fpl, len); + ndp->ni_pathlen += adjust; + cache_fpl_pathlen_add(fpl, adjust); cnp->cn_nameptr = cnp->cn_pnbuf; fpl->nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; @@ -4925,9 +4972,6 @@ cache_fplookup_next(struct cache_fpl *fpl) } if (__predict_false(ncp == NULL)) { - if (cnp->cn_nameptr[0] == '/') { - return (cache_fplookup_skip_slashes(fpl)); - } return (cache_fplookup_noentry(fpl)); } @@ -5194,21 +5238,6 @@ cache_fplookup_preparse(struct cache_fpl *fpl) ("%s: mismatch on string (%p != %p) [%s]\n", __func__, &cnp->cn_nameptr[fpl->debug.ni_pathlen - 2], fpl->nulchar - 1, cnp->cn_pnbuf)); - if (__predict_false(*(fpl->nulchar - 1) == '/')) { - /* - * TODO - * Regular lookup performs the following: - * *ndp->ni_next = '\0'; - * cnp->cn_flags |= TRAILINGSLASH; - * - * Which is problematic since it modifies data read - * from userspace. Then if fast path lookup was to - * abort we would have to either restore it or convey - * the flag. Since this is a corner case just ignore - * it for simplicity. - */ - return (cache_fpl_aborted(fpl)); - } return (0); } @@ -5254,27 +5283,6 @@ cache_fplookup_parse(struct cache_fpl *fpl) * then it could not have been too long to begin with. */ ndp->ni_next = cp; - -#ifdef INVARIANTS - /* - * Code below is only here to assure compatibility with regular lookup. - * It covers handling of trailing slashes and names like "/", both of - * which of can be taken care of upfront which lockless lookup does - * in cache_fplookup_preparse. Regular lookup performs these for each - * path component. - */ - while (*cp == '/' && (cp[1] == '/' || cp[1] == '\0')) { - cp++; - if (*cp == '\0') { - panic("%s: ran into TRAILINGSLASH handling from [%s]\n", - __func__, cnp->cn_pnbuf); - } - } - - if (cnp->cn_nameptr[0] == '\0') { - panic("%s: ran into degenerate name from [%s]\n", __func__, cnp->cn_pnbuf); - } -#endif } static void @@ -5339,6 +5347,139 @@ cache_fplookup_skip_slashes(struct cache_fpl *fpl) return (0); } +/* + * Handle trailing slashes (e.g., "foo/"). + * + * If a trailing slash is found the terminal vnode must be a directory. + * Regular lookup shortens the path by nulifying the first trailing slash and + * sets the TRAILINGSLASH flag to denote this took place. There are several + * checks on it performed later. + * + * Similarly to spurious slashes, lockless lookup handles this in a speculative + * manner relying on an invariant that a non-directory vnode will get a miss. + * In this case cn_nameptr[0] == '\0' and cn_namelen == 0. + * + * Thus for a path like "foo/bar/" the code unwinds the state back to 'bar/' + * and denotes this is the last path component, which avoids looping back. + * + * Only plain lookups are supported for now to restrict corner cases to handle. + */ +static int __noinline +cache_fplookup_trailingslash(struct cache_fpl *fpl) +{ +#ifdef INVARIANTS + size_t ni_pathlen; +#endif + struct nameidata *ndp; + struct componentname *cnp; + struct namecache *ncp; + struct vnode *tvp; + char *cn_nameptr_orig, *cn_nameptr_slash; + seqc_t tvp_seqc; + u_char nc_flag; + + ndp = fpl->ndp; + cnp = fpl->cnp; + tvp = fpl->tvp; + tvp_seqc = fpl->tvp_seqc; + + MPASS(fpl->dvp == fpl->tvp); + KASSERT(cache_fpl_istrailingslash(fpl), + ("%s: expected trailing slash at %p; string [%s]\n", __func__, fpl->nulchar - 1, + cnp->cn_pnbuf)); + KASSERT(cnp->cn_nameptr[0] == '\0', + ("%s: expected nul char at %p; string [%s]\n", __func__, &cnp->cn_nameptr[0], + cnp->cn_pnbuf)); + KASSERT(cnp->cn_namelen == 0, + ("%s: namelen 0 but got %ld; string [%s]\n", __func__, cnp->cn_namelen, + cnp->cn_pnbuf)); + MPASS(cnp->cn_nameptr > cnp->cn_pnbuf); + + if (cnp->cn_nameiop != LOOKUP) { + return (cache_fpl_aborted(fpl)); + } + + if (__predict_false(tvp->v_type != VDIR)) { + if (!vn_seqc_consistent(tvp, tvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled_error(fpl, ENOTDIR)); + } + + /* + * Denote the last component. + */ + ndp->ni_next = &cnp->cn_nameptr[0]; + MPASS(cache_fpl_islastcn(ndp)); + + /* + * Unwind trailing slashes. + */ + cn_nameptr_orig = cnp->cn_nameptr; + while (cnp->cn_nameptr >= cnp->cn_pnbuf) { + cnp->cn_nameptr--; + if (cnp->cn_nameptr[0] != '/') { + break; + } + } + + /* + * Unwind to the beginning of the path component. + * + * Note the path may or may not have started with a slash. + */ + cn_nameptr_slash = cnp->cn_nameptr; + while (cnp->cn_nameptr > cnp->cn_pnbuf) { + cnp->cn_nameptr--; + if (cnp->cn_nameptr[0] == '/') { + break; + } + } + if (cnp->cn_nameptr[0] == '/') { + cnp->cn_nameptr++; + } + + cnp->cn_namelen = cn_nameptr_slash - cnp->cn_nameptr + 1; + cache_fpl_pathlen_add(fpl, cn_nameptr_orig - cnp->cn_nameptr); + cache_fpl_checkpoint(fpl); + +#ifdef INVARIANTS + ni_pathlen = fpl->nulchar - cnp->cn_nameptr + 1; + if (ni_pathlen != fpl->debug.ni_pathlen) { + panic("%s: mismatch (%zu != %zu) nulchar %p nameptr %p [%s] ; full string [%s]\n", + __func__, ni_pathlen, fpl->debug.ni_pathlen, fpl->nulchar, + cnp->cn_nameptr, cnp->cn_nameptr, cnp->cn_pnbuf); + } +#endif + + /* + * The previous directory is this one. + */ + if (cnp->cn_nameptr[0] == '.' && cnp->cn_namelen == 1) { + return (0); + } + + /* + * The previous directory is something else. + */ + tvp = fpl->tvp; + ncp = atomic_load_consume_ptr(&tvp->v_cache_dd); + if (__predict_false(ncp == NULL)) { + return (cache_fpl_aborted(fpl)); + } + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) != 0) { + return (cache_fpl_aborted(fpl)); + } + fpl->dvp = ncp->nc_dvp; + fpl->dvp_seqc = vn_seqc_read_any(fpl->dvp); + if (seqc_in_modify(fpl->dvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + return (0); +} + /* * See the API contract for VOP_FPLOOKUP_VEXEC. */ From owner-dev-commits-src-main@freebsd.org Sun Jan 31 13:30: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 2AC364F6054; Sun, 31 Jan 2021 13:30:32 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTBlq70jRz3LBV; Sun, 31 Jan 2021 13:30:31 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2a02:8109:1140:c3d:39b6:f451:52bd:81a] (unknown [IPv6:2a02:8109:1140:c3d:39b6:f451:52bd:81a]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id CB28D7220B813; Sun, 31 Jan 2021 14:30:25 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) 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. From: Michael Tuexen In-Reply-To: Date: Sun, 31 Jan 2021 14:30:24 +0100 Cc: Randall Stewart , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> To: Mateusz Guzik , Randall Stewart X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4DTBlq70jRz3LBV 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, 31 Jan 2021 13:30:32 -0000 > On 31. Jan 2021, at 12:09, Mateusz Guzik wrote: >=20 > ping? I'm going to revert this on Tuesday to unbreak the build >=20 > On 1/29/21, Mateusz Guzik wrote: >> This breaks tinderbox: >> arm LINT kernel failed, check _.arm.LINT for details >> i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details >> i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for = details >> i386 LINT kernel failed, check _.i386.LINT for details >> amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for = details Hi Mateusz, where can the logfiles be accessed? I don't see anything red at https://ci.freebsd.org/tinderbox/ Best regards Michael >>=20 >>=20 >> On 1/28/21, Randall Stewart wrote: >>> The branch main has been updated by rrs: >>>=20 >>> URL: >>> = https://cgit.FreeBSD.org/src/commit/?id=3D1a714ff204193b9eb810426048e03f5d= 76e9730e >>>=20 >>> commit 1a714ff204193b9eb810426048e03f5d76e9730e >>> Author: Randall Stewart >>> AuthorDate: 2021-01-26 16:54:42 +0000 >>> Commit: Randall Stewart >>> CommitDate: 2021-01-28 16:53:05 +0000 >>>=20 >>> 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. >>>=20 >>> Sponsored by: Netflix Inc. >>> Differential Revision: https://reviews.freebsd.org/D28357 >>> --- >>> sys/net/if_lagg.c | 11 + >>> sys/net/if_var.h | 2 + >>> sys/net/if_vlan.c | 30 +++ >>> sys/netinet/in_pcb.c | 9 + >>> sys/netinet/tcp_log_buf.h | 2 +- >>> sys/netinet/tcp_ratelimit.c | 584 >>> +++++++++++++++++++++++++++--------------- >>> sys/netinet/tcp_ratelimit.h | 24 +- >>> sys/netinet/tcp_stacks/bbr.c | 4 +- >>> sys/netinet/tcp_stacks/rack.c | 14 +- >>> 9 files changed, 464 insertions(+), 216 deletions(-) >>>=20 >>> diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c >>> index 3144f86901b2..9a3c22789fa5 100644 >>> --- a/sys/net/if_lagg.c >>> +++ b/sys/net/if_lagg.c >>> @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct = m_snd_tag *, >>> static int lagg_snd_tag_query(struct m_snd_tag *, >>> union if_snd_tag_query_params *); >>> static void lagg_snd_tag_free(struct m_snd_tag *); >>> +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); >>> static void lagg_ratelimit_query(struct ifnet *, >>> struct if_ratelimit_query_results *); >>> #endif >>> @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int = unit, >>> caddr_t params) >>> ifp->if_snd_tag_modify =3D lagg_snd_tag_modify; >>> ifp->if_snd_tag_query =3D lagg_snd_tag_query; >>> ifp->if_snd_tag_free =3D lagg_snd_tag_free; >>> + ifp->if_next_snd_tag =3D lagg_next_snd_tag; >>> ifp->if_ratelimit_query =3D lagg_ratelimit_query; >>> #endif >>> ifp->if_capenable =3D ifp->if_capabilities =3D IFCAP_HWSTATS; >>> @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, >>> return (0); >>> } >>>=20 >>> +static struct m_snd_tag * >>> +lagg_next_snd_tag(struct m_snd_tag *mst) >>> +{ >>> + struct lagg_snd_tag *lst; >>> + >>> + lst =3D mst_to_lst(mst); >>> + return (lst->tag); >>> +} >>> + >>> static int >>> lagg_snd_tag_modify(struct m_snd_tag *mst, >>> union if_snd_tag_modify_params *params) >>> diff --git a/sys/net/if_var.h b/sys/net/if_var.h >>> index beb9596895ee..9ecdfb684296 100644 >>> --- a/sys/net/if_var.h >>> +++ b/sys/net/if_var.h >>> @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, >>> union >>> if_snd_tag_alloc_params * >>> typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union >>> if_snd_tag_modify_params *); >>> typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union >>> if_snd_tag_query_params *); >>> typedef void (if_snd_tag_free_t)(struct m_snd_tag *); >>> +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); >>> typedef void (if_ratelimit_query_t)(struct ifnet *, >>> struct if_ratelimit_query_results *); >>> typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, = uint32_t); >>> @@ -422,6 +423,7 @@ struct ifnet { >>> if_snd_tag_modify_t *if_snd_tag_modify; >>> if_snd_tag_query_t *if_snd_tag_query; >>> if_snd_tag_free_t *if_snd_tag_free; >>> + if_next_send_tag_t *if_next_snd_tag; >>> if_ratelimit_query_t *if_ratelimit_query; >>> if_ratelimit_setup_t *if_ratelimit_setup; >>>=20 >>> diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c >>> index 9358724844cb..9703e5e7753f 100644 >>> --- a/sys/net/if_vlan.c >>> +++ b/sys/net/if_vlan.c >>> @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag = *, >>> static int vlan_snd_tag_query(struct m_snd_tag *, >>> union if_snd_tag_query_params *); >>> static void vlan_snd_tag_free(struct m_snd_tag *); >>> +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); >>> +static void vlan_ratelimit_query(struct ifnet *, >>> + struct if_ratelimit_query_results *); >>> #endif >>> static void vlan_qflush(struct ifnet *ifp); >>> static int vlan_setflag(struct ifnet *ifp, int flag, int = status, >>> @@ -1071,6 +1074,8 @@ vlan_clone_create(struct if_clone *ifc, char = *name, >>> size_t len, caddr_t params) >>> ifp->if_snd_tag_modify =3D vlan_snd_tag_modify; >>> ifp->if_snd_tag_query =3D vlan_snd_tag_query; >>> ifp->if_snd_tag_free =3D vlan_snd_tag_free; >>> + ifp->if_next_snd_tag =3D vlan_next_snd_tag; >>> + ifp->if_ratelimit_query =3D vlan_ratelimit_query; >>> #endif >>> ifp->if_flags =3D VLAN_IFFLAGS; >>> ether_ifattach(ifp, eaddr); >>> @@ -2073,6 +2078,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, >>> return (0); >>> } >>>=20 >>> +static struct m_snd_tag * >>> +vlan_next_snd_tag(struct m_snd_tag *mst) >>> +{ >>> + struct vlan_snd_tag *vst; >>> + >>> + vst =3D mst_to_vst(mst); >>> + return (vst->tag); >>> +} >>> + >>> static int >>> vlan_snd_tag_modify(struct m_snd_tag *mst, >>> union if_snd_tag_modify_params *params) >>> @@ -2102,4 +2116,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) >>> m_snd_tag_rele(vst->tag); >>> free(vst, M_VLAN); >>> } >>> + >>> +static void >>> +vlan_ratelimit_query(struct ifnet *ifp __unused, struct >>> if_ratelimit_query_results *q) >>> +{ >>> + /* >>> + * For vlan, we have an indirect >>> + * interface. The caller needs to >>> + * get a ratelimit tag on the actual >>> + * interface the flow will go on. >>> + */ >>> + q->rate_table =3D NULL; >>> + q->flags =3D RT_IS_INDIRECT; >>> + q->max_flows =3D 0; >>> + q->number_of_rates =3D 0; >>> +} >>> + >>> #endif >>> diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c >>> index 59695ee3715d..40a0b4c0676e 100644 >>> --- a/sys/netinet/in_pcb.c >>> +++ b/sys/netinet/in_pcb.c >>> @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, >>> randomtime, >>> "allocation before switching to a random one"); >>>=20 >>> #ifdef RATELIMIT >>> +counter_u64_t rate_limit_new; >>> +counter_u64_t rate_limit_chg; >>> counter_u64_t rate_limit_active; >>> counter_u64_t rate_limit_alloc_fail; >>> counter_u64_t rate_limit_set_ok; >>> @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, >>> alloc_fail, CTLFLAG_RD, >>> &rate_limit_alloc_fail, "Rate limited connection failures"); >>> SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, >>> &rate_limit_set_ok, "Rate limited setting succeeded"); >>> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, >>> + &rate_limit_new, "Total Rate limit new attempts"); >>> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, >>> + &rate_limit_chg, "Total Rate limited change attempts"); >>> + >>> #endif /* RATELIMIT */ >>>=20 >>> #endif /* INET */ >>> @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) >>> static void >>> rl_init(void *st) >>> { >>> + rate_limit_new =3D counter_u64_alloc(M_WAITOK); >>> + rate_limit_chg =3D counter_u64_alloc(M_WAITOK); >>> rate_limit_active =3D counter_u64_alloc(M_WAITOK); >>> rate_limit_alloc_fail =3D counter_u64_alloc(M_WAITOK); >>> rate_limit_set_ok =3D counter_u64_alloc(M_WAITOK); >>> diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h >>> index 0d9b14a08f53..436383124dce 100644 >>> --- a/sys/netinet/tcp_log_buf.h >>> +++ b/sys/netinet/tcp_log_buf.h >>> @@ -221,7 +221,7 @@ enum tcp_log_events { >>> BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 = */ >>> BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 = */ >>> TCP_LOG_REASS, /* Reassembly buffer logging 50 = */ >>> - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 = */ >>> + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack = uses this) 51 >>> */ >>> BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 = */ >>> BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 = */ >>> TCP_LOG_CONNEND, /* End of connection 54 = */ >>> diff --git a/sys/netinet/tcp_ratelimit.c = b/sys/netinet/tcp_ratelimit.c >>> index 97f066be69e0..aeb1ed6906b5 100644 >>> --- a/sys/netinet/tcp_ratelimit.c >>> +++ b/sys/netinet/tcp_ratelimit.c >>> @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); >>> #ifdef INET6 >>> #include >>> #endif >>> +#include >>> +#include >>> #include >>> #ifndef USECS_IN_SECOND >>> #define USECS_IN_SECOND 1000000 >>> @@ -154,108 +156,77 @@ const uint64_t desired_rates[] =3D { >>> 180500, /* 1.44Mpbs - rate 2 common rate */ >>> 375000, /* 3Mbps - rate 3 */ >>> 625000, /* 5Mbps - rate 4 */ >>> - 875000, /* 7Mbps - rate 5 */ >>> - 1125000, /* 9Mbps - rate 6 */ >>> - 1375000, /* 11Mbps - rate 7 */ >>> - 1625000, /* 13Mbps - rate 8 */ >>> - 2625000, /* 21Mbps - rate 9 */ >>> - 3875000, /* 31Mbps - rate 10 */ >>> - 5125000, /* 41Meg - rate 11 */ >>> - 12500000, /* 100Mbps - rate 12 */ >>> - 25000000, /* 200Mbps - rate 13 */ >>> - 50000000, /* 400Mbps - rate 14 */ >>> - 63750000, /* 51Mbps - rate 15 */ >>> + 1250000, /* 10Mbps - rate 5 */ >>> + 1875000, /* 15Mbps - rate 6 */ >>> + 2500000, /* 20Mbps - rate 7 */ >>> + 3125000, /* 25Mbps - rate 8 */ >>> + 3750000, /* 30Mbps - rate 9 */ >>> + 4375000, /* 35Mbps - rate 10 */ >>> + 5000000, /* 40Meg - rate 11 */ >>> + 6250000, /* 50Mbps - rate 12 */ >>> + 12500000, /* 100Mbps - rate 13 */ >>> + 25000000, /* 200Mbps - rate 14 */ >>> + 50000000, /* 400Mbps - rate 15 */ >>> 100000000, /* 800Mbps - rate 16 */ >>> - 1875000, /* 15Mbps - rate 17 */ >>> - 2125000, /* 17Mbps - rate 18 */ >>> - 2375000, /* 19Mbps - rate 19 */ >>> - 2875000, /* 23Mbps - rate 20 */ >>> - 3125000, /* 25Mbps - rate 21 */ >>> - 3375000, /* 27Mbps - rate 22 */ >>> - 3625000, /* 29Mbps - rate 23 */ >>> - 4125000, /* 33Mbps - rate 24 */ >>> - 4375000, /* 35Mbps - rate 25 */ >>> - 4625000, /* 37Mbps - rate 26 */ >>> - 4875000, /* 39Mbps - rate 27 */ >>> - 5375000, /* 43Mbps - rate 28 */ >>> - 5625000, /* 45Mbps - rate 29 */ >>> - 5875000, /* 47Mbps - rate 30 */ >>> - 6125000, /* 49Mbps - rate 31 */ >>> - 6625000, /* 53Mbps - rate 32 */ >>> - 6875000, /* 55Mbps - rate 33 */ >>> - 7125000, /* 57Mbps - rate 34 */ >>> - 7375000, /* 59Mbps - rate 35 */ >>> - 7625000, /* 61Mbps - rate 36 */ >>> - 7875000, /* 63Mbps - rate 37 */ >>> - 8125000, /* 65Mbps - rate 38 */ >>> - 8375000, /* 67Mbps - rate 39 */ >>> - 8625000, /* 69Mbps - rate 40 */ >>> - 8875000, /* 71Mbps - rate 41 */ >>> - 9125000, /* 73Mbps - rate 42 */ >>> - 9375000, /* 75Mbps - rate 43 */ >>> - 9625000, /* 77Mbps - rate 44 */ >>> - 9875000, /* 79Mbps - rate 45 */ >>> - 10125000, /* 81Mbps - rate 46 */ >>> - 10375000, /* 83Mbps - rate 47 */ >>> - 10625000, /* 85Mbps - rate 48 */ >>> - 10875000, /* 87Mbps - rate 49 */ >>> - 11125000, /* 89Mbps - rate 50 */ >>> - 11375000, /* 91Mbps - rate 51 */ >>> - 11625000, /* 93Mbps - rate 52 */ >>> - 11875000, /* 95Mbps - rate 53 */ >>> - 13125000, /* 105Mbps - rate 54 */ >>> - 13750000, /* 110Mbps - rate 55 */ >>> - 14375000, /* 115Mbps - rate 56 */ >>> - 15000000, /* 120Mbps - rate 57 */ >>> - 15625000, /* 125Mbps - rate 58 */ >>> - 16250000, /* 130Mbps - rate 59 */ >>> - 16875000, /* 135Mbps - rate 60 */ >>> - 17500000, /* 140Mbps - rate 61 */ >>> - 18125000, /* 145Mbps - rate 62 */ >>> - 18750000, /* 150Mbps - rate 64 */ >>> - 20000000, /* 160Mbps - rate 65 */ >>> - 21250000, /* 170Mbps - rate 66 */ >>> - 22500000, /* 180Mbps - rate 67 */ >>> - 23750000, /* 190Mbps - rate 68 */ >>> - 26250000, /* 210Mbps - rate 69 */ >>> - 27500000, /* 220Mbps - rate 70 */ >>> - 28750000, /* 230Mbps - rate 71 */ >>> - 30000000, /* 240Mbps - rate 72 */ >>> - 31250000, /* 250Mbps - rate 73 */ >>> - 34375000, /* 275Mbps - rate 74 */ >>> - 37500000, /* 300Mbps - rate 75 */ >>> - 40625000, /* 325Mbps - rate 76 */ >>> - 43750000, /* 350Mbps - rate 77 */ >>> - 46875000, /* 375Mbps - rate 78 */ >>> - 53125000, /* 425Mbps - rate 79 */ >>> - 56250000, /* 450Mbps - rate 80 */ >>> - 59375000, /* 475Mbps - rate 81 */ >>> - 62500000, /* 500Mbps - rate 82 */ >>> - 68750000, /* 550Mbps - rate 83 */ >>> - 75000000, /* 600Mbps - rate 84 */ >>> - 81250000, /* 650Mbps - rate 85 */ >>> - 87500000, /* 700Mbps - rate 86 */ >>> - 93750000, /* 750Mbps - rate 87 */ >>> - 106250000, /* 850Mbps - rate 88 */ >>> - 112500000, /* 900Mbps - rate 89 */ >>> - 125000000, /* 1Gbps - rate 90 */ >>> - 156250000, /* 1.25Gps - rate 91 */ >>> - 187500000, /* 1.5Gps - rate 92 */ >>> - 218750000, /* 1.75Gps - rate 93 */ >>> - 250000000, /* 2Gbps - rate 94 */ >>> - 281250000, /* 2.25Gps - rate 95 */ >>> - 312500000, /* 2.5Gbps - rate 96 */ >>> - 343750000, /* 2.75Gbps - rate 97 */ >>> - 375000000, /* 3Gbps - rate 98 */ >>> - 500000000, /* 4Gbps - rate 99 */ >>> - 625000000, /* 5Gbps - rate 100 */ >>> - 750000000, /* 6Gbps - rate 101 */ >>> - 875000000, /* 7Gbps - rate 102 */ >>> - 1000000000, /* 8Gbps - rate 103 */ >>> - 1125000000, /* 9Gbps - rate 104 */ >>> - 1250000000, /* 10Gbps - rate 105 */ >>> - 1875000000, /* 15Gbps - rate 106 */ >>> - 2500000000 /* 20Gbps - rate 107 */ >>> + 5625000, /* 45Mbps - rate 17 */ >>> + 6875000, /* 55Mbps - rate 19 */ >>> + 7500000, /* 60Mbps - rate 20 */ >>> + 8125000, /* 65Mbps - rate 21 */ >>> + 8750000, /* 70Mbps - rate 22 */ >>> + 9375000, /* 75Mbps - rate 23 */ >>> + 10000000, /* 80Mbps - rate 24 */ >>> + 10625000, /* 85Mbps - rate 25 */ >>> + 11250000, /* 90Mbps - rate 26 */ >>> + 11875000, /* 95Mbps - rate 27 */ >>> + 12500000, /* 100Mbps - rate 28 */ >>> + 13750000, /* 110Mbps - rate 29 */ >>> + 15000000, /* 120Mbps - rate 30 */ >>> + 16250000, /* 130Mbps - rate 31 */ >>> + 17500000, /* 140Mbps - rate 32 */ >>> + 18750000, /* 150Mbps - rate 33 */ >>> + 20000000, /* 160Mbps - rate 34 */ >>> + 21250000, /* 170Mbps - rate 35 */ >>> + 22500000, /* 180Mbps - rate 36 */ >>> + 23750000, /* 190Mbps - rate 37 */ >>> + 26250000, /* 210Mbps - rate 38 */ >>> + 27500000, /* 220Mbps - rate 39 */ >>> + 28750000, /* 230Mbps - rate 40 */ >>> + 30000000, /* 240Mbps - rate 41 */ >>> + 31250000, /* 250Mbps - rate 42 */ >>> + 34375000, /* 275Mbps - rate 43 */ >>> + 37500000, /* 300Mbps - rate 44 */ >>> + 40625000, /* 325Mbps - rate 45 */ >>> + 43750000, /* 350Mbps - rate 46 */ >>> + 46875000, /* 375Mbps - rate 47 */ >>> + 53125000, /* 425Mbps - rate 48 */ >>> + 56250000, /* 450Mbps - rate 49 */ >>> + 59375000, /* 475Mbps - rate 50 */ >>> + 62500000, /* 500Mbps - rate 51 */ >>> + 68750000, /* 550Mbps - rate 52 */ >>> + 75000000, /* 600Mbps - rate 53 */ >>> + 81250000, /* 650Mbps - rate 54 */ >>> + 87500000, /* 700Mbps - rate 55 */ >>> + 93750000, /* 750Mbps - rate 56 */ >>> + 106250000, /* 850Mbps - rate 57 */ >>> + 112500000, /* 900Mbps - rate 58 */ >>> + 125000000, /* 1Gbps - rate 59 */ >>> + 156250000, /* 1.25Gps - rate 60 */ >>> + 187500000, /* 1.5Gps - rate 61 */ >>> + 218750000, /* 1.75Gps - rate 62 */ >>> + 250000000, /* 2Gbps - rate 63 */ >>> + 281250000, /* 2.25Gps - rate 64 */ >>> + 312500000, /* 2.5Gbps - rate 65 */ >>> + 343750000, /* 2.75Gbps - rate 66 */ >>> + 375000000, /* 3Gbps - rate 67 */ >>> + 500000000, /* 4Gbps - rate 68 */ >>> + 625000000, /* 5Gbps - rate 69 */ >>> + 750000000, /* 6Gbps - rate 70 */ >>> + 875000000, /* 7Gbps - rate 71 */ >>> + 1000000000, /* 8Gbps - rate 72 */ >>> + 1125000000, /* 9Gbps - rate 73 */ >>> + 1250000000, /* 10Gbps - rate 74 */ >>> + 1875000000, /* 15Gbps - rate 75 */ >>> + 2500000000 /* 20Gbps - rate 76 */ >>> }; >>>=20 >>> #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) >>> @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; >>> static struct mtx rs_mtx; >>> uint32_t rs_number_alive; >>> uint32_t rs_number_dead; >>> +static uint32_t rs_floor_mss =3D 0; >>> +static uint32_t wait_time_floor =3D 8000; /* 8 ms */ >>> +static uint32_t rs_hw_floor_mss =3D 16; >>> +static uint32_t num_of_waits_allowed =3D 1; /* How many time blocks = are we >>> willing to wait */ >>>=20 >>> SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | = CTLFLAG_MPSAFE, 0, >>> "TCP Ratelimit stats"); >>> @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, >>> CTLFLAG_RW, >>> SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, >>> &rs_number_dead, 0, >>> "Number of interfaces departing from ratelimiting"); >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, >>> + &rs_floor_mss, 0, >>> + "Number of MSS that will override the normal minimums (0 means = don't >>> enforce)"); >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, >>> + &wait_time_floor, 2000, >>> + "Has b/w increases what is the wait floor we are willing to = wait at >>> the >>> end?"); >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, >>> + &num_of_waits_allowed, 1, >>> + "How many time blocks on the end should software pacing be = willing >>> to >>> wait?"); >>> + >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, >>> + &rs_hw_floor_mss, 16, >>> + "Number of mss that are a minum for hardware pacing?"); >>> + >>>=20 >>> static void >>> rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct >>> tcp_rate_set >>> *rs) >>> @@ -383,6 +372,17 @@ 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 >>> @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) >>> } >>>=20 >>> #ifdef INET >>> +extern counter_u64_t rate_limit_new; >>> +extern counter_u64_t rate_limit_chg; >>> extern counter_u64_t rate_limit_set_ok; >>> extern counter_u64_t rate_limit_active; >>> extern counter_u64_t rate_limit_alloc_fail; >>> @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >>> int i; >>> struct if_ratelimit_query_results rl; >>> struct sysctl_oid *rl_sysctl_root; >>> + struct epoch_tracker et; >>> /* >>> * We expect to enter with the >>> * mutex locked. >>> @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >>> ""); >>> rl_add_syctl_entries(rl_sysctl_root, rs); >>> + NET_EPOCH_ENTER(et); >>> mtx_lock(&rs_mtx); >>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >>> mtx_unlock(&rs_mtx); >>> + NET_EPOCH_EXIT(et); >>> return (rs); >>> } else if ((rl.flags & RT_IS_INDIRECT) =3D=3D RT_IS_INDIRECT) { >>> memset(rs, 0, sizeof(struct tcp_rate_set)); >>> @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >>> ""); >>> rl_add_syctl_entries(rl_sysctl_root, rs); >>> + NET_EPOCH_ENTER(et); >>> mtx_lock(&rs_mtx); >>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >>> mtx_unlock(&rs_mtx); >>> + NET_EPOCH_EXIT(et); >>> return (rs); >>> } else if ((rl.flags & RT_IS_FIXED_TABLE) =3D=3D = RT_IS_FIXED_TABLE) { >>> /* Mellanox C4 likely */ >>> @@ -671,6 +678,8 @@ bail: >>> */ >>> rs->rs_rlt[i].ptbl =3D rs; >>> rs->rs_rlt[i].tag =3D NULL; >>> + rs->rs_rlt[i].using =3D 0; >>> + rs->rs_rlt[i].rs_num_enobufs =3D 0; >>> /* >>> * Calculate the time between. >>> */ >>> @@ -741,18 +750,24 @@ handle_err: >>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >>> ""); >>> rl_add_syctl_entries(rl_sysctl_root, rs); >>> + NET_EPOCH_ENTER(et); >>> mtx_lock(&rs_mtx); >>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >>> mtx_unlock(&rs_mtx); >>> + NET_EPOCH_EXIT(et); >>> return (rs); >>> } >>>=20 >>> +/* >>> + * For an explanation of why the argument is volatile please >>> + * look at the comments around rt_setup_rate(). >>> + */ >>> static const struct tcp_hwrate_limit_table * >>> -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, >>> - uint64_t bytes_per_sec, uint32_t flags) >>> +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, >>> + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) >>> { >>> struct tcp_hwrate_limit_table *arte =3D NULL, *rte =3D NULL; >>> - uint64_t mbits_per_sec, ind_calc; >>> + uint64_t mbits_per_sec, ind_calc, previous_rate =3D 0; >>> int i; >>>=20 >>> mbits_per_sec =3D (bytes_per_sec * 8); >>> @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> * Smaller than 1Meg, only >>> * 3 entries can match it. >>> */ >>> + previous_rate =3D 0; >>> for(i =3D rs->rs_lowest_valid; i < 3; i++) { >>> if (bytes_per_sec <=3D = rs->rs_rlt[i].rate) { >>> rte =3D &rs->rs_rlt[i]; >>> @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> } else if (rs->rs_rlt[i].flags & = HDWRPACE_INITED) { >>> arte =3D &rs->rs_rlt[i]; >>> } >>> + previous_rate =3D rs->rs_rlt[i].rate; >>> } >>> goto done; >>> } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && >>> @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> rte =3D = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >>> else >>> arte =3D = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >>> + previous_rate =3D = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; >>> goto done; >>> } >>> /* >>> @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> ind_calc =3D ALL_HARDWARE_RATES-1; >>> } >>> if ((ind_calc >=3D rs->rs_lowest_valid) && >>> - (ind_calc <=3D rs->rs_highest_valid)) >>> - rte =3D &rs->rs_rlt[ind_calc]; >>> + (ind_calc <=3D rs->rs_highest_valid)) { >>> + rte =3D &rs->rs_rlt[ind_calc]; >>> + if (ind_calc >=3D 1) >>> + previous_rate =3D = rs->rs_rlt[(ind_calc-1)].rate; >>> + } >>> } else if (flags & RS_PACING_EXACT_MATCH) { >>> if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && >>> (rs->rs_lowest_valid <=3D 2)){ >>> @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct >>> tcp_rate_set >>> *rs, >>> for (i=3D2; i>=3Drs->rs_lowest_valid; i--) { >>> if (bytes_per_sec < rs->rs_rlt[i].rate) = { >>> rte =3D &rs->rs_rlt[i]; >>> + if (i >=3D 1) { >>> + previous_rate =3D = rs->rs_rlt[(i-1)].rate; >>> + } >>> break; >>> } else if ((flags & RS_PACING_GEQ) && >>> (bytes_per_sec =3D=3D = rs->rs_rlt[i].rate)) { >>> rte =3D &rs->rs_rlt[i]; >>> + if (i >=3D 1) { >>> + previous_rate =3D = rs->rs_rlt[(i-1)].rate; >>> + } >>> break; >>> } else { >>> arte =3D &rs->rs_rlt[i]; /* new = alternate */ >>> @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> /* The top rate is an alternative */ >>> arte =3D = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >>> } >>> + previous_rate =3D = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; >>> } else { >>> /* Its in our range 1Meg - 1Gig */ >>> if (flags & RS_PACING_GEQ) { >>> @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> ind_calc =3D = (ALL_HARDWARE_RATES-1); >>> } >>> rte =3D &rs->rs_rlt[ind_calc]; >>> + if (ind_calc >=3D 1) >>> + previous_rate =3D = rs->rs_rlt[(ind_calc-1)].rate; >>> } >>> goto done; >>> } >>> @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> /* This should not happen */ >>> ind_calc =3D ALL_HARDWARE_RATES-1; >>> } >>> - if (rs->rs_rlt[ind_calc].flags & = HDWRPACE_INITED) >>> + if (rs->rs_rlt[ind_calc].flags & = HDWRPACE_INITED) { >>> rte =3D &rs->rs_rlt[ind_calc]; >>> + if (ind_calc >=3D 1) >>> + previous_rate =3D = rs->rs_rlt[(ind_calc-1)].rate; >>> + } >>> } >>> } >>> done: >>> @@ -893,11 +926,17 @@ done: >>> /* We can use the substitute */ >>> rte =3D arte; >>> } >>> + if (lower_rate) >>> + *lower_rate =3D previous_rate; >>> return (rte); >>> } >>>=20 >>> +/* >>> + * For an explanation of why the argument is volatile please >>> + * look at the comments around rt_setup_rate(). >>> + */ >>> static const struct tcp_hwrate_limit_table * >>> -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t >>> bytes_per_sec, uint32_t flags) >>> +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, = uint64_t >>> bytes_per_sec, uint32_t flags, uint64_t *lower_rate) >>> { >>> /** >>> * Hunt the rate table with the restrictions in flags and find a >>> @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set = *rs, >>> uint64_t bytes_per_sec, ui >>> */ >>> int i, matched; >>> struct tcp_hwrate_limit_table *rte =3D NULL; >>> + uint64_t previous_rate =3D 0; >>>=20 >>> if ((rs->rs_flags & RS_INT_TBL) && >>> (rs->rs_rate_cnt >=3D ALL_HARDWARE_RATES)) { >>> @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set = *rs, >>> uint64_t bytes_per_sec, ui >>> * from 1Meg - 1000Meg in 1Meg increments. >>> * Use an alternate method to "lookup". >>> */ >>> - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, = flags)); >>> + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, = flags, >>> lower_rate)); >>> } >>> if ((flags & RS_PACING_LT) || >>> (flags & RS_PACING_EXACT_MATCH)) { >>> @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> uint64_t bytes_per_sec, ui >>> (bytes_per_sec =3D=3D rs->rs_rlt[i].rate)) { >>> rte =3D &rs->rs_rlt[i]; >>> matched =3D 1; >>> + if (lower_rate !=3D NULL) >>> + *lower_rate =3D previous_rate; >>> break; >>> } else if ((flags & RS_PACING_LT) && >>> (bytes_per_sec <=3D rs->rs_rlt[i].rate)) { >>> rte =3D &rs->rs_rlt[i]; >>> matched =3D 1; >>> + if (lower_rate !=3D NULL) >>> + *lower_rate =3D previous_rate; >>> break; >>> } >>> + previous_rate =3D rs->rs_rlt[i].rate; >>> if (bytes_per_sec > rs->rs_rlt[i].rate) >>> break; >>> } >>> @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct = tcp_rate_set >>> *rs, >>> uint64_t bytes_per_sec, ui >>> * We found a table entry that is = smaller, >>> * stop there will be none greater or = equal. >>> */ >>> + if (lower_rate !=3D NULL) >>> + *lower_rate =3D = rs->rs_rlt[i].rate; >>> break; >>> } >>> } >>> @@ -995,10 +1042,10 @@ static struct ifnet * >>> rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int = *error) >>> { >>> struct ifnet *tifp; >>> - struct m_snd_tag *tag; >>> + struct m_snd_tag *tag, *ntag; >>> union if_snd_tag_alloc_params params =3D { >>> .rate_limit.hdr.type =3D IF_SND_TAG_TYPE_RATE_LIMIT, >>> - .rate_limit.hdr.flowid =3D 1, >>> + .rate_limit.hdr.flowid =3D inp->inp_flowid, >>> .rate_limit.hdr.numa_domain =3D inp->inp_numa_domain, >>> .rate_limit.max_rate =3D COMMON_RATE, >>> .rate_limit.flags =3D M_NOWAIT, >>> @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, = struct >>> inpcb *inp, int *error) >>> *error =3D err; >>> return (NULL); >>> } >>> - tifp =3D tag->ifp; >>> + ntag =3D tag; >>> + while(ntag->ifp->if_next_snd_tag !=3D NULL) { >>> + ntag =3D ntag->ifp->if_next_snd_tag(ntag); >>> + } >>> + tifp =3D ntag->ifp; >>> m_snd_tag_rele(tag); >>> return (tifp); >>> } >>>=20 >>> +static void >>> +rl_increment_using(const struct tcp_hwrate_limit_table *rte) >>> +{ >>> + struct tcp_hwrate_limit_table *decon_rte; >>> + >>> + decon_rte =3D __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 =3D __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 =3D __DECONST(struct tcp_hwrate_limit_table *, rte); >>> + atomic_add_long(&decon_rte->rs_num_enobufs, 1); >>> +} >>> + >>> +/* >>> + * Do NOT take the __noinline out of the >>> + * find_rs_for_ifp() function. If you do the inline >>> + * of it for the rt_setup_rate() will show you a >>> + * compiler bug. For some reason the compiler thinks >>> + * the list can never be empty. The consequence of >>> + * this will be a crash when we dereference NULL >>> + * if an ifp is removed just has a hw rate limit >>> + * is attempted. If you are working on the compiler >>> + * and want to "test" this go ahead and take the noinline >>> + * out otherwise let sleeping dogs ly until such time >>> + * as we get a compiler fix 10/2/20 -- RRS >>> + */ >>> +static __noinline struct tcp_rate_set * >>> +find_rs_for_ifp(struct ifnet *ifp) >>> +{ >>> + struct tcp_rate_set *rs; >>> + >>> + CK_LIST_FOREACH(rs, &int_rs, next) { >>> + if ((rs->rs_ifp =3D=3D ifp) && >>> + (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { >>> + /* Ok we found it */ >>> + return (rs); >>> + } >>> + } >>> + return (NULL); >>> +} >>> + >>> + >>> static const struct tcp_hwrate_limit_table * >>> rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t >>> bytes_per_sec, >>> - uint32_t flags, int *error) >>> + uint32_t flags, int *error, uint64_t *lower_rate) >>> { >>> /* First lets find the interface if it exists */ >>> const struct tcp_hwrate_limit_table *rte; >>> - struct tcp_rate_set *rs; >>> + /* >>> + * So why is rs volatile? This is to defeat a >>> + * compiler bug where in the compiler is convinced >>> + * that rs can never be NULL (which is not true). Because >>> + * of its conviction it nicely optimizes out the if ((rs =3D=3D = NULL >>> + * below which means if you get a NULL back you dereference it. >>> + */ >>> + volatile struct tcp_rate_set *rs; >>> struct epoch_tracker et; >>> + struct ifnet *oifp =3D ifp; >>> int err; >>>=20 >>> NET_EPOCH_ENTER(et); >>> use_real_interface: >>> - CK_LIST_FOREACH(rs, &int_rs, next) { >>> - /* >>> - * Note we don't look with the lock since we either see = a >>> - * new entry or will get one when we try to add it. >>> - */ >>> - if (rs->rs_flags & RS_IS_DEAD) { >>> - /* The dead are not looked at */ >>> - continue; >>> - } >>> - if ((rs->rs_ifp =3D=3D ifp) && >>> - (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { >>> - /* Ok we found it */ >>> - break; >>> - } >>> - } >>> + rs =3D find_rs_for_ifp(ifp); >>> if ((rs =3D=3D NULL) || >>> (rs->rs_flags & RS_INTF_NO_SUP) || >>> (rs->rs_flags & RS_IS_DEAD)) { >>> @@ -1063,14 +1164,14 @@ use_real_interface: >>> * might be arguable, but its impossible >>> * to tell from the departing case. >>> */ >>> - if (rs->rs_disable && error) >>> + if (error) >>> *error =3D ENODEV; >>> NET_EPOCH_EXIT(et); >>> return (NULL); >>> } >>>=20 >>> if ((rs =3D=3D NULL) || (rs->rs_disable !=3D 0)) { >>> - if (rs->rs_disable && error) >>> + if (error) >>> *error =3D ENOSPC; >>> NET_EPOCH_EXIT(et); >>> return (NULL); >>> @@ -1086,6 +1187,10 @@ use_real_interface: >>> NET_EPOCH_EXIT(et); >>> return (NULL); >>> } >>> + KASSERT((tifp !=3D ifp), >>> + ("Lookup failure ifp:%p inp:%p = rt_find_real_interface() returns the >>> same >>> interface tifp:%p?\n", >>> + ifp, inp, tifp)); >>> + ifp =3D tifp; >>> goto use_real_interface; >>> } >>> if (rs->rs_flow_limit && >>> @@ -1095,9 +1200,9 @@ use_real_interface: >>> NET_EPOCH_EXIT(et); >>> return (NULL); >>> } >>> - rte =3D tcp_find_suitable_rate(rs, bytes_per_sec, flags); >>> + rte =3D tcp_find_suitable_rate(rs, bytes_per_sec, flags, = lower_rate); >>> if (rte) { >>> - err =3D in_pcbattach_txrtlmt(inp, rs->rs_ifp, >>> + err =3D in_pcbattach_txrtlmt(inp, oifp, >>> inp->inp_flowtype, >>> inp->inp_flowid, >>> rte->rate, >>> @@ -1107,6 +1212,11 @@ use_real_interface: >>> if (error) >>> *error =3D err; >>> rte =3D NULL; >>> + } else { >>> + KASSERT((inp->inp_snd_tag !=3D NULL) , >>> + ("Setup rate has no snd_tag inp:%p = rte:%p rate:%lu rs:%p", >>> + inp, rte, rte->rate, rs)); >>> + counter_u64_add(rate_limit_new, 1); >>> } >>> } >>> if (rte) { >>> @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct = ifnet >>> *ifp, int link_state) >>> { >>> int error; >>> struct tcp_rate_set *rs; >>> + struct epoch_tracker et; >>>=20 >>> if (((ifp->if_capenable & IFCAP_TXRTLMT) =3D=3D 0) || >>> (link_state !=3D LINK_STATE_UP)) { >>> @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct >>> ifnet >>> *ifp, int link_state) >>> */ >>> return; >>> } >>> + NET_EPOCH_ENTER(et); >>> mtx_lock(&rs_mtx); >>> - CK_LIST_FOREACH(rs, &int_rs, next) { >>> - if ((rs->rs_ifp =3D=3D ifp) && >>> - (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { >>> - /* We already have initialized this guy */ >>> - mtx_unlock(&rs_mtx); >>> - return; >>> - } >>> + rs =3D find_rs_for_ifp(ifp); >>> + if (rs) { >>> + /* We already have initialized this guy */ >>> + mtx_unlock(&rs_mtx); >>> + NET_EPOCH_EXIT(et); >>> + return; >>> } >>> mtx_unlock(&rs_mtx); >>> + NET_EPOCH_EXIT(et); >>> rt_setup_new_rs(ifp, &error); >>> } >>>=20 >>> static void >>> tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) >>> { >>> - struct tcp_rate_set *rs, *nrs; >>> + struct tcp_rate_set *rs; >>> + struct epoch_tracker et; >>> int i; >>>=20 >>> + NET_EPOCH_ENTER(et); >>> mtx_lock(&rs_mtx); >>> - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { >>> - if ((rs->rs_ifp =3D=3D ifp) && >>> - (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { >>> - CK_LIST_REMOVE(rs, next); >>> - rs_number_alive--; >>> - rs->rs_flags |=3D RS_IS_DEAD; >>> - for (i =3D 0; i < rs->rs_rate_cnt; i++) { >>> - if (rs->rs_rlt[i].flags & = HDWRPACE_TAGPRESENT) { >>> - = in_pcbdetach_tag(rs->rs_rlt[i].tag); >>> - rs->rs_rlt[i].tag =3D NULL; >>> - } >>> - rs->rs_rlt[i].flags =3D = HDWRPACE_IFPDEPARTED; >>> + rs =3D find_rs_for_ifp(ifp); >>> + if (rs) { >>> + CK_LIST_REMOVE(rs, next); >>> + rs_number_alive--; >>> + rs->rs_flags |=3D RS_IS_DEAD; >>> + for (i =3D 0; i < rs->rs_rate_cnt; i++) { >>> + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { >>> + in_pcbdetach_tag(rs->rs_rlt[i].tag); >>> + rs->rs_rlt[i].tag =3D NULL; >>> } >>> - if (rs->rs_flows_using =3D=3D 0) >>> - rs_defer_destroy(rs); >>> - break; >>> + rs->rs_rlt[i].flags =3D HDWRPACE_IFPDEPARTED; >>> } >>> + if (rs->rs_flows_using =3D=3D 0) >>> + rs_defer_destroy(rs); >>> } >>> mtx_unlock(&rs_mtx); >>> + NET_EPOCH_EXIT(et); >>> } >>>=20 >>> static void >>> tcp_rl_shutdown(void *arg __unused, int howto __unused) >>> { >>> struct tcp_rate_set *rs, *nrs; >>> + struct epoch_tracker et; >>> int i; >>>=20 >>> + NET_EPOCH_ENTER(et); >>> mtx_lock(&rs_mtx); >>> CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { >>> CK_LIST_REMOVE(rs, next); >>> @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int = howto >>> __unused) >>> rs_defer_destroy(rs); >>> } >>> mtx_unlock(&rs_mtx); >>> + NET_EPOCH_EXIT(et); >>> } >>>=20 >>> const struct tcp_hwrate_limit_table * >>> tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, >>> - uint64_t bytes_per_sec, int flags, int *error) >>> + uint64_t bytes_per_sec, int flags, int *error, uint64_t = *lower_rate) >>> { >>> const struct tcp_hwrate_limit_table *rte; >>> #ifdef KERN_TLS >>> @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct = ifnet >>> *ifp, >>> } >>> } >>> #endif >>> - rte =3D rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, = flags, error); >>> + rte =3D rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, = flags, error, >>> lower_rate); >>> + if (rte) >>> + rl_increment_using(rte); >>> #ifdef KERN_TLS >>> if (rte !=3D NULL && tls !=3D NULL && tls->snd_tag !=3D = NULL) { >>> /* >>> @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct >>> ifnet >>> *ifp, >>> *error =3D EINVAL; >>> rte =3D NULL; >>> } >>> - tp->t_pacing_rate =3D rte->rate; >>> - *error =3D 0; >>> + if (rte !=3D NULL) { >>> + tp->t_pacing_rate =3D rte->rate; >>> + *error =3D 0; >>> + } >>> return (rte); >>> } >>>=20 >>> const struct tcp_hwrate_limit_table * >>> tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, >>> struct tcpcb *tp, struct ifnet *ifp, >>> - uint64_t bytes_per_sec, int flags, int *error) >>> + uint64_t bytes_per_sec, int flags, int *error, uint64_t = *lower_rate) >>> { >>> const struct tcp_hwrate_limit_table *nrte; >>> const struct tcp_rate_set *rs; >>> #ifdef KERN_TLS >>> struct ktls_session *tls =3D NULL; >>> #endif >>> - int is_indirect =3D 0; >>> int err; >>>=20 >>> INP_WLOCK_ASSERT(tp->t_inpcb); >>> @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct >>> tcp_hwrate_limit_table *crte, >>> if ((rs->rs_flags & RS_IS_DEAD) || >>> (crte->flags & HDWRPACE_IFPDEPARTED)) { >>> /* Release the rate, and try anew */ >>> -re_rate: >>> + >>> tcp_rel_pacing_rate(crte, tp); >>> nrte =3D tcp_set_pacing_rate(tp, ifp, >>> - bytes_per_sec, flags, error); >>> *** 386 LINES SKIPPED *** >>> _______________________________________________ >>> 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" >>>=20 >>=20 >>=20 >> -- >> Mateusz Guzik >>=20 >=20 >=20 > --=20 > Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Sun Jan 31 13:50: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 1DE104F6F9E; Sun, 31 Jan 2021 13:50:03 +0000 (UTC) (envelope-from gbe@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 4DTCBM0GfSz3MKF; Sun, 31 Jan 2021 13:50:03 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p200300d5d70b555a3422dcd332ac35d6.dip0.t-ipconnect.de [IPv6:2003:d5:d70b:555a:3422:dcd3:32ac:35d6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 2C0522C59; Sun, 31 Jan 2021 13:50:02 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Sun, 31 Jan 2021 14:49:59 +0100 From: Gordon Bergling To: Michael Tuexen Cc: Mateusz Guzik , Randall Stewart , Randall Stewart , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org 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. Message-ID: References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EB6sWAVXHCNbq2EJ" Content-Disposition: inline In-Reply-To: X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 2:47PM up 18 days, 3:09, 4 users, load averages: 0.19, 0.23, 0.19 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, 31 Jan 2021 13:50:03 -0000 --EB6sWAVXHCNbq2EJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 31, 2021 at 02:30:24PM +0100, Michael Tuexen wrote: > > On 31. Jan 2021, at 12:09, Mateusz Guzik wrote: > >=20 > > ping? I'm going to revert this on Tuesday to unbreak the build > >=20 > > On 1/29/21, Mateusz Guzik wrote: > >> This breaks tinderbox: > >> arm LINT kernel failed, check _.arm.LINT for details > >> i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details > >> i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details > >> i386 LINT kernel failed, check _.i386.LINT for details > >> amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details > Hi Mateusz, >=20 > where can the logfiles be accessed? > I don't see anything red at https://ci.freebsd.org/tinderbox/ >=20 > Best regards > Michael Besides of the reported build issues, this should be an excellent MFC candidate for the upcoming 13.0-RELEASE. --Gordon > >> On 1/28/21, Randall Stewart wrote: > >>> The branch main has been updated by rrs: > >>>=20 > >>> URL: > >>> https://cgit.FreeBSD.org/src/commit/?id=3D1a714ff204193b9eb810426048e= 03f5d76e9730e > >>>=20 > >>> commit 1a714ff204193b9eb810426048e03f5d76e9730e > >>> Author: Randall Stewart > >>> AuthorDate: 2021-01-26 16:54:42 +0000 > >>> Commit: Randall Stewart > >>> CommitDate: 2021-01-28 16:53:05 +0000 > >>>=20 > >>> 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. > >>>=20 > >>> Sponsored by: Netflix Inc. > >>> Differential Revision: https://reviews.freebsd.org/D28357 > >>> --- > >>> sys/net/if_lagg.c | 11 + > >>> sys/net/if_var.h | 2 + > >>> sys/net/if_vlan.c | 30 +++ > >>> sys/netinet/in_pcb.c | 9 + > >>> sys/netinet/tcp_log_buf.h | 2 +- > >>> sys/netinet/tcp_ratelimit.c | 584 > >>> +++++++++++++++++++++++++++--------------- > >>> sys/netinet/tcp_ratelimit.h | 24 +- > >>> sys/netinet/tcp_stacks/bbr.c | 4 +- > >>> sys/netinet/tcp_stacks/rack.c | 14 +- > >>> 9 files changed, 464 insertions(+), 216 deletions(-) > >>>=20 > >>> diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c > >>> index 3144f86901b2..9a3c22789fa5 100644 > >>> --- a/sys/net/if_lagg.c > >>> +++ b/sys/net/if_lagg.c > >>> @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct m_snd_tag *, > >>> static int lagg_snd_tag_query(struct m_snd_tag *, > >>> union if_snd_tag_query_params *); > >>> static void lagg_snd_tag_free(struct m_snd_tag *); > >>> +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); > >>> static void lagg_ratelimit_query(struct ifnet *, > >>> struct if_ratelimit_query_results *); > >>> #endif > >>> @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, > >>> caddr_t params) > >>> ifp->if_snd_tag_modify =3D lagg_snd_tag_modify; > >>> ifp->if_snd_tag_query =3D lagg_snd_tag_query; > >>> ifp->if_snd_tag_free =3D lagg_snd_tag_free; > >>> + ifp->if_next_snd_tag =3D lagg_next_snd_tag; > >>> ifp->if_ratelimit_query =3D lagg_ratelimit_query; > >>> #endif > >>> ifp->if_capenable =3D ifp->if_capabilities =3D IFCAP_HWSTATS; > >>> @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, > >>> return (0); > >>> } > >>>=20 > >>> +static struct m_snd_tag * > >>> +lagg_next_snd_tag(struct m_snd_tag *mst) > >>> +{ > >>> + struct lagg_snd_tag *lst; > >>> + > >>> + lst =3D mst_to_lst(mst); > >>> + return (lst->tag); > >>> +} > >>> + > >>> static int > >>> lagg_snd_tag_modify(struct m_snd_tag *mst, > >>> union if_snd_tag_modify_params *params) > >>> diff --git a/sys/net/if_var.h b/sys/net/if_var.h > >>> index beb9596895ee..9ecdfb684296 100644 > >>> --- a/sys/net/if_var.h > >>> +++ b/sys/net/if_var.h > >>> @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, > >>> union > >>> if_snd_tag_alloc_params * > >>> typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union > >>> if_snd_tag_modify_params *); > >>> typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union > >>> if_snd_tag_query_params *); > >>> typedef void (if_snd_tag_free_t)(struct m_snd_tag *); > >>> +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); > >>> typedef void (if_ratelimit_query_t)(struct ifnet *, > >>> struct if_ratelimit_query_results *); > >>> typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t= ); > >>> @@ -422,6 +423,7 @@ struct ifnet { > >>> if_snd_tag_modify_t *if_snd_tag_modify; > >>> if_snd_tag_query_t *if_snd_tag_query; > >>> if_snd_tag_free_t *if_snd_tag_free; > >>> + if_next_send_tag_t *if_next_snd_tag; > >>> if_ratelimit_query_t *if_ratelimit_query; > >>> if_ratelimit_setup_t *if_ratelimit_setup; > >>>=20 > >>> diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c > >>> index 9358724844cb..9703e5e7753f 100644 > >>> --- a/sys/net/if_vlan.c > >>> +++ b/sys/net/if_vlan.c > >>> @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag *, > >>> static int vlan_snd_tag_query(struct m_snd_tag *, > >>> union if_snd_tag_query_params *); > >>> static void vlan_snd_tag_free(struct m_snd_tag *); > >>> +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); > >>> +static void vlan_ratelimit_query(struct ifnet *, > >>> + struct if_ratelimit_query_results *); > >>> #endif > >>> static void vlan_qflush(struct ifnet *ifp); > >>> static int vlan_setflag(struct ifnet *ifp, int flag, int status, > >>> @@ -1071,6 +1074,8 @@ vlan_clone_create(struct if_clone *ifc, char *n= ame, > >>> size_t len, caddr_t params) > >>> ifp->if_snd_tag_modify =3D vlan_snd_tag_modify; > >>> ifp->if_snd_tag_query =3D vlan_snd_tag_query; > >>> ifp->if_snd_tag_free =3D vlan_snd_tag_free; > >>> + ifp->if_next_snd_tag =3D vlan_next_snd_tag; > >>> + ifp->if_ratelimit_query =3D vlan_ratelimit_query; > >>> #endif > >>> ifp->if_flags =3D VLAN_IFFLAGS; > >>> ether_ifattach(ifp, eaddr); > >>> @@ -2073,6 +2078,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, > >>> return (0); > >>> } > >>>=20 > >>> +static struct m_snd_tag * > >>> +vlan_next_snd_tag(struct m_snd_tag *mst) > >>> +{ > >>> + struct vlan_snd_tag *vst; > >>> + > >>> + vst =3D mst_to_vst(mst); > >>> + return (vst->tag); > >>> +} > >>> + > >>> static int > >>> vlan_snd_tag_modify(struct m_snd_tag *mst, > >>> union if_snd_tag_modify_params *params) > >>> @@ -2102,4 +2116,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) > >>> m_snd_tag_rele(vst->tag); > >>> free(vst, M_VLAN); > >>> } > >>> + > >>> +static void > >>> +vlan_ratelimit_query(struct ifnet *ifp __unused, struct > >>> if_ratelimit_query_results *q) > >>> +{ > >>> + /* > >>> + * For vlan, we have an indirect > >>> + * interface. The caller needs to > >>> + * get a ratelimit tag on the actual > >>> + * interface the flow will go on. > >>> + */ > >>> + q->rate_table =3D NULL; > >>> + q->flags =3D RT_IS_INDIRECT; > >>> + q->max_flows =3D 0; > >>> + q->number_of_rates =3D 0; > >>> +} > >>> + > >>> #endif > >>> diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c > >>> index 59695ee3715d..40a0b4c0676e 100644 > >>> --- a/sys/netinet/in_pcb.c > >>> +++ b/sys/netinet/in_pcb.c > >>> @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, > >>> randomtime, > >>> "allocation before switching to a random one"); > >>>=20 > >>> #ifdef RATELIMIT > >>> +counter_u64_t rate_limit_new; > >>> +counter_u64_t rate_limit_chg; > >>> counter_u64_t rate_limit_active; > >>> counter_u64_t rate_limit_alloc_fail; > >>> counter_u64_t rate_limit_set_ok; > >>> @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, > >>> alloc_fail, CTLFLAG_RD, > >>> &rate_limit_alloc_fail, "Rate limited connection failures"); > >>> SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, > >>> &rate_limit_set_ok, "Rate limited setting succeeded"); > >>> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, > >>> + &rate_limit_new, "Total Rate limit new attempts"); > >>> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, > >>> + &rate_limit_chg, "Total Rate limited change attempts"); > >>> + > >>> #endif /* RATELIMIT */ > >>>=20 > >>> #endif /* INET */ > >>> @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) > >>> static void > >>> rl_init(void *st) > >>> { > >>> + rate_limit_new =3D counter_u64_alloc(M_WAITOK); > >>> + rate_limit_chg =3D counter_u64_alloc(M_WAITOK); > >>> rate_limit_active =3D counter_u64_alloc(M_WAITOK); > >>> rate_limit_alloc_fail =3D counter_u64_alloc(M_WAITOK); > >>> rate_limit_set_ok =3D counter_u64_alloc(M_WAITOK); > >>> diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h > >>> index 0d9b14a08f53..436383124dce 100644 > >>> --- a/sys/netinet/tcp_log_buf.h > >>> +++ b/sys/netinet/tcp_log_buf.h > >>> @@ -221,7 +221,7 @@ enum tcp_log_events { > >>> BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ > >>> BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 */ > >>> TCP_LOG_REASS, /* Reassembly buffer logging 50 */ > >>> - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 */ > >>> + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this)= 51 > >>> */ > >>> BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ > >>> BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 */ > >>> TCP_LOG_CONNEND, /* End of connection 54 */ > >>> diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c > >>> index 97f066be69e0..aeb1ed6906b5 100644 > >>> --- a/sys/netinet/tcp_ratelimit.c > >>> +++ b/sys/netinet/tcp_ratelimit.c > >>> @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); > >>> #ifdef INET6 > >>> #include > >>> #endif > >>> +#include > >>> +#include > >>> #include > >>> #ifndef USECS_IN_SECOND > >>> #define USECS_IN_SECOND 1000000 > >>> @@ -154,108 +156,77 @@ const uint64_t desired_rates[] =3D { > >>> 180500, /* 1.44Mpbs - rate 2 common rate */ > >>> 375000, /* 3Mbps - rate 3 */ > >>> 625000, /* 5Mbps - rate 4 */ > >>> - 875000, /* 7Mbps - rate 5 */ > >>> - 1125000, /* 9Mbps - rate 6 */ > >>> - 1375000, /* 11Mbps - rate 7 */ > >>> - 1625000, /* 13Mbps - rate 8 */ > >>> - 2625000, /* 21Mbps - rate 9 */ > >>> - 3875000, /* 31Mbps - rate 10 */ > >>> - 5125000, /* 41Meg - rate 11 */ > >>> - 12500000, /* 100Mbps - rate 12 */ > >>> - 25000000, /* 200Mbps - rate 13 */ > >>> - 50000000, /* 400Mbps - rate 14 */ > >>> - 63750000, /* 51Mbps - rate 15 */ > >>> + 1250000, /* 10Mbps - rate 5 */ > >>> + 1875000, /* 15Mbps - rate 6 */ > >>> + 2500000, /* 20Mbps - rate 7 */ > >>> + 3125000, /* 25Mbps - rate 8 */ > >>> + 3750000, /* 30Mbps - rate 9 */ > >>> + 4375000, /* 35Mbps - rate 10 */ > >>> + 5000000, /* 40Meg - rate 11 */ > >>> + 6250000, /* 50Mbps - rate 12 */ > >>> + 12500000, /* 100Mbps - rate 13 */ > >>> + 25000000, /* 200Mbps - rate 14 */ > >>> + 50000000, /* 400Mbps - rate 15 */ > >>> 100000000, /* 800Mbps - rate 16 */ > >>> - 1875000, /* 15Mbps - rate 17 */ > >>> - 2125000, /* 17Mbps - rate 18 */ > >>> - 2375000, /* 19Mbps - rate 19 */ > >>> - 2875000, /* 23Mbps - rate 20 */ > >>> - 3125000, /* 25Mbps - rate 21 */ > >>> - 3375000, /* 27Mbps - rate 22 */ > >>> - 3625000, /* 29Mbps - rate 23 */ > >>> - 4125000, /* 33Mbps - rate 24 */ > >>> - 4375000, /* 35Mbps - rate 25 */ > >>> - 4625000, /* 37Mbps - rate 26 */ > >>> - 4875000, /* 39Mbps - rate 27 */ > >>> - 5375000, /* 43Mbps - rate 28 */ > >>> - 5625000, /* 45Mbps - rate 29 */ > >>> - 5875000, /* 47Mbps - rate 30 */ > >>> - 6125000, /* 49Mbps - rate 31 */ > >>> - 6625000, /* 53Mbps - rate 32 */ > >>> - 6875000, /* 55Mbps - rate 33 */ > >>> - 7125000, /* 57Mbps - rate 34 */ > >>> - 7375000, /* 59Mbps - rate 35 */ > >>> - 7625000, /* 61Mbps - rate 36 */ > >>> - 7875000, /* 63Mbps - rate 37 */ > >>> - 8125000, /* 65Mbps - rate 38 */ > >>> - 8375000, /* 67Mbps - rate 39 */ > >>> - 8625000, /* 69Mbps - rate 40 */ > >>> - 8875000, /* 71Mbps - rate 41 */ > >>> - 9125000, /* 73Mbps - rate 42 */ > >>> - 9375000, /* 75Mbps - rate 43 */ > >>> - 9625000, /* 77Mbps - rate 44 */ > >>> - 9875000, /* 79Mbps - rate 45 */ > >>> - 10125000, /* 81Mbps - rate 46 */ > >>> - 10375000, /* 83Mbps - rate 47 */ > >>> - 10625000, /* 85Mbps - rate 48 */ > >>> - 10875000, /* 87Mbps - rate 49 */ > >>> - 11125000, /* 89Mbps - rate 50 */ > >>> - 11375000, /* 91Mbps - rate 51 */ > >>> - 11625000, /* 93Mbps - rate 52 */ > >>> - 11875000, /* 95Mbps - rate 53 */ > >>> - 13125000, /* 105Mbps - rate 54 */ > >>> - 13750000, /* 110Mbps - rate 55 */ > >>> - 14375000, /* 115Mbps - rate 56 */ > >>> - 15000000, /* 120Mbps - rate 57 */ > >>> - 15625000, /* 125Mbps - rate 58 */ > >>> - 16250000, /* 130Mbps - rate 59 */ > >>> - 16875000, /* 135Mbps - rate 60 */ > >>> - 17500000, /* 140Mbps - rate 61 */ > >>> - 18125000, /* 145Mbps - rate 62 */ > >>> - 18750000, /* 150Mbps - rate 64 */ > >>> - 20000000, /* 160Mbps - rate 65 */ > >>> - 21250000, /* 170Mbps - rate 66 */ > >>> - 22500000, /* 180Mbps - rate 67 */ > >>> - 23750000, /* 190Mbps - rate 68 */ > >>> - 26250000, /* 210Mbps - rate 69 */ > >>> - 27500000, /* 220Mbps - rate 70 */ > >>> - 28750000, /* 230Mbps - rate 71 */ > >>> - 30000000, /* 240Mbps - rate 72 */ > >>> - 31250000, /* 250Mbps - rate 73 */ > >>> - 34375000, /* 275Mbps - rate 74 */ > >>> - 37500000, /* 300Mbps - rate 75 */ > >>> - 40625000, /* 325Mbps - rate 76 */ > >>> - 43750000, /* 350Mbps - rate 77 */ > >>> - 46875000, /* 375Mbps - rate 78 */ > >>> - 53125000, /* 425Mbps - rate 79 */ > >>> - 56250000, /* 450Mbps - rate 80 */ > >>> - 59375000, /* 475Mbps - rate 81 */ > >>> - 62500000, /* 500Mbps - rate 82 */ > >>> - 68750000, /* 550Mbps - rate 83 */ > >>> - 75000000, /* 600Mbps - rate 84 */ > >>> - 81250000, /* 650Mbps - rate 85 */ > >>> - 87500000, /* 700Mbps - rate 86 */ > >>> - 93750000, /* 750Mbps - rate 87 */ > >>> - 106250000, /* 850Mbps - rate 88 */ > >>> - 112500000, /* 900Mbps - rate 89 */ > >>> - 125000000, /* 1Gbps - rate 90 */ > >>> - 156250000, /* 1.25Gps - rate 91 */ > >>> - 187500000, /* 1.5Gps - rate 92 */ > >>> - 218750000, /* 1.75Gps - rate 93 */ > >>> - 250000000, /* 2Gbps - rate 94 */ > >>> - 281250000, /* 2.25Gps - rate 95 */ > >>> - 312500000, /* 2.5Gbps - rate 96 */ > >>> - 343750000, /* 2.75Gbps - rate 97 */ > >>> - 375000000, /* 3Gbps - rate 98 */ > >>> - 500000000, /* 4Gbps - rate 99 */ > >>> - 625000000, /* 5Gbps - rate 100 */ > >>> - 750000000, /* 6Gbps - rate 101 */ > >>> - 875000000, /* 7Gbps - rate 102 */ > >>> - 1000000000, /* 8Gbps - rate 103 */ > >>> - 1125000000, /* 9Gbps - rate 104 */ > >>> - 1250000000, /* 10Gbps - rate 105 */ > >>> - 1875000000, /* 15Gbps - rate 106 */ > >>> - 2500000000 /* 20Gbps - rate 107 */ > >>> + 5625000, /* 45Mbps - rate 17 */ > >>> + 6875000, /* 55Mbps - rate 19 */ > >>> + 7500000, /* 60Mbps - rate 20 */ > >>> + 8125000, /* 65Mbps - rate 21 */ > >>> + 8750000, /* 70Mbps - rate 22 */ > >>> + 9375000, /* 75Mbps - rate 23 */ > >>> + 10000000, /* 80Mbps - rate 24 */ > >>> + 10625000, /* 85Mbps - rate 25 */ > >>> + 11250000, /* 90Mbps - rate 26 */ > >>> + 11875000, /* 95Mbps - rate 27 */ > >>> + 12500000, /* 100Mbps - rate 28 */ > >>> + 13750000, /* 110Mbps - rate 29 */ > >>> + 15000000, /* 120Mbps - rate 30 */ > >>> + 16250000, /* 130Mbps - rate 31 */ > >>> + 17500000, /* 140Mbps - rate 32 */ > >>> + 18750000, /* 150Mbps - rate 33 */ > >>> + 20000000, /* 160Mbps - rate 34 */ > >>> + 21250000, /* 170Mbps - rate 35 */ > >>> + 22500000, /* 180Mbps - rate 36 */ > >>> + 23750000, /* 190Mbps - rate 37 */ > >>> + 26250000, /* 210Mbps - rate 38 */ > >>> + 27500000, /* 220Mbps - rate 39 */ > >>> + 28750000, /* 230Mbps - rate 40 */ > >>> + 30000000, /* 240Mbps - rate 41 */ > >>> + 31250000, /* 250Mbps - rate 42 */ > >>> + 34375000, /* 275Mbps - rate 43 */ > >>> + 37500000, /* 300Mbps - rate 44 */ > >>> + 40625000, /* 325Mbps - rate 45 */ > >>> + 43750000, /* 350Mbps - rate 46 */ > >>> + 46875000, /* 375Mbps - rate 47 */ > >>> + 53125000, /* 425Mbps - rate 48 */ > >>> + 56250000, /* 450Mbps - rate 49 */ > >>> + 59375000, /* 475Mbps - rate 50 */ > >>> + 62500000, /* 500Mbps - rate 51 */ > >>> + 68750000, /* 550Mbps - rate 52 */ > >>> + 75000000, /* 600Mbps - rate 53 */ > >>> + 81250000, /* 650Mbps - rate 54 */ > >>> + 87500000, /* 700Mbps - rate 55 */ > >>> + 93750000, /* 750Mbps - rate 56 */ > >>> + 106250000, /* 850Mbps - rate 57 */ > >>> + 112500000, /* 900Mbps - rate 58 */ > >>> + 125000000, /* 1Gbps - rate 59 */ > >>> + 156250000, /* 1.25Gps - rate 60 */ > >>> + 187500000, /* 1.5Gps - rate 61 */ > >>> + 218750000, /* 1.75Gps - rate 62 */ > >>> + 250000000, /* 2Gbps - rate 63 */ > >>> + 281250000, /* 2.25Gps - rate 64 */ > >>> + 312500000, /* 2.5Gbps - rate 65 */ > >>> + 343750000, /* 2.75Gbps - rate 66 */ > >>> + 375000000, /* 3Gbps - rate 67 */ > >>> + 500000000, /* 4Gbps - rate 68 */ > >>> + 625000000, /* 5Gbps - rate 69 */ > >>> + 750000000, /* 6Gbps - rate 70 */ > >>> + 875000000, /* 7Gbps - rate 71 */ > >>> + 1000000000, /* 8Gbps - rate 72 */ > >>> + 1125000000, /* 9Gbps - rate 73 */ > >>> + 1250000000, /* 10Gbps - rate 74 */ > >>> + 1875000000, /* 15Gbps - rate 75 */ > >>> + 2500000000 /* 20Gbps - rate 76 */ > >>> }; > >>>=20 > >>> #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) > >>> @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; > >>> static struct mtx rs_mtx; > >>> uint32_t rs_number_alive; > >>> uint32_t rs_number_dead; > >>> +static uint32_t rs_floor_mss =3D 0; > >>> +static uint32_t wait_time_floor =3D 8000; /* 8 ms */ > >>> +static uint32_t rs_hw_floor_mss =3D 16; > >>> +static uint32_t num_of_waits_allowed =3D 1; /* How many time blocks = are we > >>> willing to wait */ > >>>=20 > >>> SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE,= 0, > >>> "TCP Ratelimit stats"); > >>> @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, > >>> CTLFLAG_RW, > >>> SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, > >>> &rs_number_dead, 0, > >>> "Number of interfaces departing from ratelimiting"); > >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, > >>> + &rs_floor_mss, 0, > >>> + "Number of MSS that will override the normal minimums (0 means d= on't > >>> enforce)"); > >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, > >>> + &wait_time_floor, 2000, > >>> + "Has b/w increases what is the wait floor we are willing to wait= at > >>> the > >>> end?"); > >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, > >>> + &num_of_waits_allowed, 1, > >>> + "How many time blocks on the end should software pacing be willi= ng > >>> to > >>> wait?"); > >>> + > >>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, > >>> + &rs_hw_floor_mss, 16, > >>> + "Number of mss that are a minum for hardware pacing?"); > >>> + > >>>=20 > >>> static void > >>> rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct > >>> tcp_rate_set > >>> *rs) > >>> @@ -383,6 +372,17 @@ 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 > >>> @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) > >>> } > >>>=20 > >>> #ifdef INET > >>> +extern counter_u64_t rate_limit_new; > >>> +extern counter_u64_t rate_limit_chg; > >>> extern counter_u64_t rate_limit_set_ok; > >>> extern counter_u64_t rate_limit_active; > >>> extern counter_u64_t rate_limit_alloc_fail; > >>> @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) > >>> int i; > >>> struct if_ratelimit_query_results rl; > >>> struct sysctl_oid *rl_sysctl_root; > >>> + struct epoch_tracker et; > >>> /* > >>> * We expect to enter with the > >>> * mutex locked. > >>> @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) > >>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, > >>> ""); > >>> rl_add_syctl_entries(rl_sysctl_root, rs); > >>> + NET_EPOCH_ENTER(et); > >>> mtx_lock(&rs_mtx); > >>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); > >>> mtx_unlock(&rs_mtx); > >>> + NET_EPOCH_EXIT(et); > >>> return (rs); > >>> } else if ((rl.flags & RT_IS_INDIRECT) =3D=3D RT_IS_INDIRECT) { > >>> memset(rs, 0, sizeof(struct tcp_rate_set)); > >>> @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) > >>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, > >>> ""); > >>> rl_add_syctl_entries(rl_sysctl_root, rs); > >>> + NET_EPOCH_ENTER(et); > >>> mtx_lock(&rs_mtx); > >>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); > >>> mtx_unlock(&rs_mtx); > >>> + NET_EPOCH_EXIT(et); > >>> return (rs); > >>> } else if ((rl.flags & RT_IS_FIXED_TABLE) =3D=3D RT_IS_FIXED_TABLE) { > >>> /* Mellanox C4 likely */ > >>> @@ -671,6 +678,8 @@ bail: > >>> */ > >>> rs->rs_rlt[i].ptbl =3D rs; > >>> rs->rs_rlt[i].tag =3D NULL; > >>> + rs->rs_rlt[i].using =3D 0; > >>> + rs->rs_rlt[i].rs_num_enobufs =3D 0; > >>> /* > >>> * Calculate the time between. > >>> */ > >>> @@ -741,18 +750,24 @@ handle_err: > >>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, > >>> ""); > >>> rl_add_syctl_entries(rl_sysctl_root, rs); > >>> + NET_EPOCH_ENTER(et); > >>> mtx_lock(&rs_mtx); > >>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); > >>> mtx_unlock(&rs_mtx); > >>> + NET_EPOCH_EXIT(et); > >>> return (rs); > >>> } > >>>=20 > >>> +/* > >>> + * For an explanation of why the argument is volatile please > >>> + * look at the comments around rt_setup_rate(). > >>> + */ > >>> static const struct tcp_hwrate_limit_table * > >>> -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, > >>> - uint64_t bytes_per_sec, uint32_t flags) > >>> +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, > >>> + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) > >>> { > >>> struct tcp_hwrate_limit_table *arte =3D NULL, *rte =3D NULL; > >>> - uint64_t mbits_per_sec, ind_calc; > >>> + uint64_t mbits_per_sec, ind_calc, previous_rate =3D 0; > >>> int i; > >>>=20 > >>> mbits_per_sec =3D (bytes_per_sec * 8); > >>> @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_= set > >>> *rs, > >>> * Smaller than 1Meg, only > >>> * 3 entries can match it. > >>> */ > >>> + previous_rate =3D 0; > >>> for(i =3D rs->rs_lowest_valid; i < 3; i++) { > >>> if (bytes_per_sec <=3D rs->rs_rlt[i].rate) { > >>> rte =3D &rs->rs_rlt[i]; > >>> @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_= set > >>> *rs, > >>> } else if (rs->rs_rlt[i].flags & HDWRPACE_INITED) { > >>> arte =3D &rs->rs_rlt[i]; > >>> } > >>> + previous_rate =3D rs->rs_rlt[i].rate; > >>> } > >>> goto done; > >>> } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && > >>> @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_= set > >>> *rs, > >>> rte =3D &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; > >>> else > >>> arte =3D &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; > >>> + previous_rate =3D rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; > >>> goto done; > >>> } > >>> /* > >>> @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate= _set > >>> *rs, > >>> ind_calc =3D ALL_HARDWARE_RATES-1; > >>> } > >>> if ((ind_calc >=3D rs->rs_lowest_valid) && > >>> - (ind_calc <=3D rs->rs_highest_valid)) > >>> - rte =3D &rs->rs_rlt[ind_calc]; > >>> + (ind_calc <=3D rs->rs_highest_valid)) { > >>> + rte =3D &rs->rs_rlt[ind_calc]; > >>> + if (ind_calc >=3D 1) > >>> + previous_rate =3D rs->rs_rlt[(ind_calc-1)].rate; > >>> + } > >>> } else if (flags & RS_PACING_EXACT_MATCH) { > >>> if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && > >>> (rs->rs_lowest_valid <=3D 2)){ > >>> @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct > >>> tcp_rate_set > >>> *rs, > >>> for (i=3D2; i>=3Drs->rs_lowest_valid; i--) { > >>> if (bytes_per_sec < rs->rs_rlt[i].rate) { > >>> rte =3D &rs->rs_rlt[i]; > >>> + if (i >=3D 1) { > >>> + previous_rate =3D rs->rs_rlt[(i-1)].rate; > >>> + } > >>> break; > >>> } else if ((flags & RS_PACING_GEQ) && > >>> (bytes_per_sec =3D=3D rs->rs_rlt[i].rate)) { > >>> rte =3D &rs->rs_rlt[i]; > >>> + if (i >=3D 1) { > >>> + previous_rate =3D rs->rs_rlt[(i-1)].rate; > >>> + } > >>> break; > >>> } else { > >>> arte =3D &rs->rs_rlt[i]; /* new alternate */ > >>> @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_= set > >>> *rs, > >>> /* The top rate is an alternative */ > >>> arte =3D &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; > >>> } > >>> + previous_rate =3D rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; > >>> } else { > >>> /* Its in our range 1Meg - 1Gig */ > >>> if (flags & RS_PACING_GEQ) { > >>> @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct tcp_rate_= set > >>> *rs, > >>> ind_calc =3D (ALL_HARDWARE_RATES-1); > >>> } > >>> rte =3D &rs->rs_rlt[ind_calc]; > >>> + if (ind_calc >=3D 1) > >>> + previous_rate =3D rs->rs_rlt[(ind_calc-1)].rate; > >>> } > >>> goto done; > >>> } > >>> @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate= _set > >>> *rs, > >>> /* This should not happen */ > >>> ind_calc =3D ALL_HARDWARE_RATES-1; > >>> } > >>> - if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) > >>> + if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) { > >>> rte =3D &rs->rs_rlt[ind_calc]; > >>> + if (ind_calc >=3D 1) > >>> + previous_rate =3D rs->rs_rlt[(ind_calc-1)].rate; > >>> + } > >>> } > >>> } > >>> done: > >>> @@ -893,11 +926,17 @@ done: > >>> /* We can use the substitute */ > >>> rte =3D arte; > >>> } > >>> + if (lower_rate) > >>> + *lower_rate =3D previous_rate; > >>> return (rte); > >>> } > >>>=20 > >>> +/* > >>> + * For an explanation of why the argument is volatile please > >>> + * look at the comments around rt_setup_rate(). > >>> + */ > >>> static const struct tcp_hwrate_limit_table * > >>> -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t > >>> bytes_per_sec, uint32_t flags) > >>> +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, uint6= 4_t > >>> bytes_per_sec, uint32_t flags, uint64_t *lower_rate) > >>> { > >>> /** > >>> * Hunt the rate table with the restrictions in flags and find a > >>> @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set = *rs, > >>> uint64_t bytes_per_sec, ui > >>> */ > >>> int i, matched; > >>> struct tcp_hwrate_limit_table *rte =3D NULL; > >>> + uint64_t previous_rate =3D 0; > >>>=20 > >>> if ((rs->rs_flags & RS_INT_TBL) && > >>> (rs->rs_rate_cnt >=3D ALL_HARDWARE_RATES)) { > >>> @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set = *rs, > >>> uint64_t bytes_per_sec, ui > >>> * from 1Meg - 1000Meg in 1Meg increments. > >>> * Use an alternate method to "lookup". > >>> */ > >>> - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags)); > >>> + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags, > >>> lower_rate)); > >>> } > >>> if ((flags & RS_PACING_LT) || > >>> (flags & RS_PACING_EXACT_MATCH)) { > >>> @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct tcp_rate_set > >>> *rs, > >>> uint64_t bytes_per_sec, ui > >>> (bytes_per_sec =3D=3D rs->rs_rlt[i].rate)) { > >>> rte =3D &rs->rs_rlt[i]; > >>> matched =3D 1; > >>> + if (lower_rate !=3D NULL) > >>> + *lower_rate =3D previous_rate; > >>> break; > >>> } else if ((flags & RS_PACING_LT) && > >>> (bytes_per_sec <=3D rs->rs_rlt[i].rate)) { > >>> rte =3D &rs->rs_rlt[i]; > >>> matched =3D 1; > >>> + if (lower_rate !=3D NULL) > >>> + *lower_rate =3D previous_rate; > >>> break; > >>> } > >>> + previous_rate =3D rs->rs_rlt[i].rate; > >>> if (bytes_per_sec > rs->rs_rlt[i].rate) > >>> break; > >>> } > >>> @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct tcp_rate_set > >>> *rs, > >>> uint64_t bytes_per_sec, ui > >>> * We found a table entry that is smaller, > >>> * stop there will be none greater or equal. > >>> */ > >>> + if (lower_rate !=3D NULL) > >>> + *lower_rate =3D rs->rs_rlt[i].rate; > >>> break; > >>> } > >>> } > >>> @@ -995,10 +1042,10 @@ static struct ifnet * > >>> rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *err= or) > >>> { > >>> struct ifnet *tifp; > >>> - struct m_snd_tag *tag; > >>> + struct m_snd_tag *tag, *ntag; > >>> union if_snd_tag_alloc_params params =3D { > >>> .rate_limit.hdr.type =3D IF_SND_TAG_TYPE_RATE_LIMIT, > >>> - .rate_limit.hdr.flowid =3D 1, > >>> + .rate_limit.hdr.flowid =3D inp->inp_flowid, > >>> .rate_limit.hdr.numa_domain =3D inp->inp_numa_domain, > >>> .rate_limit.max_rate =3D COMMON_RATE, > >>> .rate_limit.flags =3D M_NOWAIT, > >>> @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, str= uct > >>> inpcb *inp, int *error) > >>> *error =3D err; > >>> return (NULL); > >>> } > >>> - tifp =3D tag->ifp; > >>> + ntag =3D tag; > >>> + while(ntag->ifp->if_next_snd_tag !=3D NULL) { > >>> + ntag =3D ntag->ifp->if_next_snd_tag(ntag); > >>> + } > >>> + tifp =3D ntag->ifp; > >>> m_snd_tag_rele(tag); > >>> return (tifp); > >>> } > >>>=20 > >>> +static void > >>> +rl_increment_using(const struct tcp_hwrate_limit_table *rte) > >>> +{ > >>> + struct tcp_hwrate_limit_table *decon_rte; > >>> + > >>> + decon_rte =3D __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 =3D __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 =3D __DECONST(struct tcp_hwrate_limit_table *, rte); > >>> + atomic_add_long(&decon_rte->rs_num_enobufs, 1); > >>> +} > >>> + > >>> +/* > >>> + * Do NOT take the __noinline out of the > >>> + * find_rs_for_ifp() function. If you do the inline > >>> + * of it for the rt_setup_rate() will show you a > >>> + * compiler bug. For some reason the compiler thinks > >>> + * the list can never be empty. The consequence of > >>> + * this will be a crash when we dereference NULL > >>> + * if an ifp is removed just has a hw rate limit > >>> + * is attempted. If you are working on the compiler > >>> + * and want to "test" this go ahead and take the noinline > >>> + * out otherwise let sleeping dogs ly until such time > >>> + * as we get a compiler fix 10/2/20 -- RRS > >>> + */ > >>> +static __noinline struct tcp_rate_set * > >>> +find_rs_for_ifp(struct ifnet *ifp) > >>> +{ > >>> + struct tcp_rate_set *rs; > >>> + > >>> + CK_LIST_FOREACH(rs, &int_rs, next) { > >>> + if ((rs->rs_ifp =3D=3D ifp) && > >>> + (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { > >>> + /* Ok we found it */ > >>> + return (rs); > >>> + } > >>> + } > >>> + return (NULL); > >>> +} > >>> + > >>> + > >>> static const struct tcp_hwrate_limit_table * > >>> rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t > >>> bytes_per_sec, > >>> - uint32_t flags, int *error) > >>> + uint32_t flags, int *error, uint64_t *lower_rate) > >>> { > >>> /* First lets find the interface if it exists */ > >>> const struct tcp_hwrate_limit_table *rte; > >>> - struct tcp_rate_set *rs; > >>> + /* > >>> + * So why is rs volatile? This is to defeat a > >>> + * compiler bug where in the compiler is convinced > >>> + * that rs can never be NULL (which is not true). Because > >>> + * of its conviction it nicely optimizes out the if ((rs =3D=3D NULL > >>> + * below which means if you get a NULL back you dereference it. > >>> + */ > >>> + volatile struct tcp_rate_set *rs; > >>> struct epoch_tracker et; > >>> + struct ifnet *oifp =3D ifp; > >>> int err; > >>>=20 > >>> NET_EPOCH_ENTER(et); > >>> use_real_interface: > >>> - CK_LIST_FOREACH(rs, &int_rs, next) { > >>> - /* > >>> - * Note we don't look with the lock since we either see a > >>> - * new entry or will get one when we try to add it. > >>> - */ > >>> - if (rs->rs_flags & RS_IS_DEAD) { > >>> - /* The dead are not looked at */ > >>> - continue; > >>> - } > >>> - if ((rs->rs_ifp =3D=3D ifp) && > >>> - (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { > >>> - /* Ok we found it */ > >>> - break; > >>> - } > >>> - } > >>> + rs =3D find_rs_for_ifp(ifp); > >>> if ((rs =3D=3D NULL) || > >>> (rs->rs_flags & RS_INTF_NO_SUP) || > >>> (rs->rs_flags & RS_IS_DEAD)) { > >>> @@ -1063,14 +1164,14 @@ use_real_interface: > >>> * might be arguable, but its impossible > >>> * to tell from the departing case. > >>> */ > >>> - if (rs->rs_disable && error) > >>> + if (error) > >>> *error =3D ENODEV; > >>> NET_EPOCH_EXIT(et); > >>> return (NULL); > >>> } > >>>=20 > >>> if ((rs =3D=3D NULL) || (rs->rs_disable !=3D 0)) { > >>> - if (rs->rs_disable && error) > >>> + if (error) > >>> *error =3D ENOSPC; > >>> NET_EPOCH_EXIT(et); > >>> return (NULL); > >>> @@ -1086,6 +1187,10 @@ use_real_interface: > >>> NET_EPOCH_EXIT(et); > >>> return (NULL); > >>> } > >>> + KASSERT((tifp !=3D ifp), > >>> + ("Lookup failure ifp:%p inp:%p rt_find_real_interface() returns t= he > >>> same > >>> interface tifp:%p?\n", > >>> + ifp, inp, tifp)); > >>> + ifp =3D tifp; > >>> goto use_real_interface; > >>> } > >>> if (rs->rs_flow_limit && > >>> @@ -1095,9 +1200,9 @@ use_real_interface: > >>> NET_EPOCH_EXIT(et); > >>> return (NULL); > >>> } > >>> - rte =3D tcp_find_suitable_rate(rs, bytes_per_sec, flags); > >>> + rte =3D tcp_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate= ); > >>> if (rte) { > >>> - err =3D in_pcbattach_txrtlmt(inp, rs->rs_ifp, > >>> + err =3D in_pcbattach_txrtlmt(inp, oifp, > >>> inp->inp_flowtype, > >>> inp->inp_flowid, > >>> rte->rate, > >>> @@ -1107,6 +1212,11 @@ use_real_interface: > >>> if (error) > >>> *error =3D err; > >>> rte =3D NULL; > >>> + } else { > >>> + KASSERT((inp->inp_snd_tag !=3D NULL) , > >>> + ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", > >>> + inp, rte, rte->rate, rs)); > >>> + counter_u64_add(rate_limit_new, 1); > >>> } > >>> } > >>> if (rte) { > >>> @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct if= net > >>> *ifp, int link_state) > >>> { > >>> int error; > >>> struct tcp_rate_set *rs; > >>> + struct epoch_tracker et; > >>>=20 > >>> if (((ifp->if_capenable & IFCAP_TXRTLMT) =3D=3D 0) || > >>> (link_state !=3D LINK_STATE_UP)) { > >>> @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct > >>> ifnet > >>> *ifp, int link_state) > >>> */ > >>> return; > >>> } > >>> + NET_EPOCH_ENTER(et); > >>> mtx_lock(&rs_mtx); > >>> - CK_LIST_FOREACH(rs, &int_rs, next) { > >>> - if ((rs->rs_ifp =3D=3D ifp) && > >>> - (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { > >>> - /* We already have initialized this guy */ > >>> - mtx_unlock(&rs_mtx); > >>> - return; > >>> - } > >>> + rs =3D find_rs_for_ifp(ifp); > >>> + if (rs) { > >>> + /* We already have initialized this guy */ > >>> + mtx_unlock(&rs_mtx); > >>> + NET_EPOCH_EXIT(et); > >>> + return; > >>> } > >>> mtx_unlock(&rs_mtx); > >>> + NET_EPOCH_EXIT(et); > >>> rt_setup_new_rs(ifp, &error); > >>> } > >>>=20 > >>> static void > >>> tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) > >>> { > >>> - struct tcp_rate_set *rs, *nrs; > >>> + struct tcp_rate_set *rs; > >>> + struct epoch_tracker et; > >>> int i; > >>>=20 > >>> + NET_EPOCH_ENTER(et); > >>> mtx_lock(&rs_mtx); > >>> - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { > >>> - if ((rs->rs_ifp =3D=3D ifp) && > >>> - (rs->rs_if_dunit =3D=3D ifp->if_dunit)) { > >>> - CK_LIST_REMOVE(rs, next); > >>> - rs_number_alive--; > >>> - rs->rs_flags |=3D RS_IS_DEAD; > >>> - for (i =3D 0; i < rs->rs_rate_cnt; i++) { > >>> - if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { > >>> - in_pcbdetach_tag(rs->rs_rlt[i].tag); > >>> - rs->rs_rlt[i].tag =3D NULL; > >>> - } > >>> - rs->rs_rlt[i].flags =3D HDWRPACE_IFPDEPARTED; > >>> + rs =3D find_rs_for_ifp(ifp); > >>> + if (rs) { > >>> + CK_LIST_REMOVE(rs, next); > >>> + rs_number_alive--; > >>> + rs->rs_flags |=3D RS_IS_DEAD; > >>> + for (i =3D 0; i < rs->rs_rate_cnt; i++) { > >>> + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { > >>> + in_pcbdetach_tag(rs->rs_rlt[i].tag); > >>> + rs->rs_rlt[i].tag =3D NULL; > >>> } > >>> - if (rs->rs_flows_using =3D=3D 0) > >>> - rs_defer_destroy(rs); > >>> - break; > >>> + rs->rs_rlt[i].flags =3D HDWRPACE_IFPDEPARTED; > >>> } > >>> + if (rs->rs_flows_using =3D=3D 0) > >>> + rs_defer_destroy(rs); > >>> } > >>> mtx_unlock(&rs_mtx); > >>> + NET_EPOCH_EXIT(et); > >>> } > >>>=20 > >>> static void > >>> tcp_rl_shutdown(void *arg __unused, int howto __unused) > >>> { > >>> struct tcp_rate_set *rs, *nrs; > >>> + struct epoch_tracker et; > >>> int i; > >>>=20 > >>> + NET_EPOCH_ENTER(et); > >>> mtx_lock(&rs_mtx); > >>> CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { > >>> CK_LIST_REMOVE(rs, next); > >>> @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int howto > >>> __unused) > >>> rs_defer_destroy(rs); > >>> } > >>> mtx_unlock(&rs_mtx); > >>> + NET_EPOCH_EXIT(et); > >>> } > >>>=20 > >>> const struct tcp_hwrate_limit_table * > >>> tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, > >>> - uint64_t bytes_per_sec, int flags, int *error) > >>> + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_r= ate) > >>> { > >>> const struct tcp_hwrate_limit_table *rte; > >>> #ifdef KERN_TLS > >>> @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct if= net > >>> *ifp, > >>> } > >>> } > >>> #endif > >>> - rte =3D rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, erro= r); > >>> + rte =3D rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, erro= r, > >>> lower_rate); > >>> + if (rte) > >>> + rl_increment_using(rte); > >>> #ifdef KERN_TLS > >>> if (rte !=3D NULL && tls !=3D NULL && tls->snd_tag !=3D NULL) { > >>> /* > >>> @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct > >>> ifnet > >>> *ifp, > >>> *error =3D EINVAL; > >>> rte =3D NULL; > >>> } > >>> - tp->t_pacing_rate =3D rte->rate; > >>> - *error =3D 0; > >>> + if (rte !=3D NULL) { > >>> + tp->t_pacing_rate =3D rte->rate; > >>> + *error =3D 0; > >>> + } > >>> return (rte); > >>> } > >>>=20 > >>> const struct tcp_hwrate_limit_table * > >>> tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, > >>> struct tcpcb *tp, struct ifnet *ifp, > >>> - uint64_t bytes_per_sec, int flags, int *error) > >>> + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_r= ate) > >>> { > >>> const struct tcp_hwrate_limit_table *nrte; > >>> const struct tcp_rate_set *rs; > >>> #ifdef KERN_TLS > >>> struct ktls_session *tls =3D NULL; > >>> #endif > >>> - int is_indirect =3D 0; > >>> int err; > >>>=20 > >>> INP_WLOCK_ASSERT(tp->t_inpcb); > >>> @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct > >>> tcp_hwrate_limit_table *crte, > >>> if ((rs->rs_flags & RS_IS_DEAD) || > >>> (crte->flags & HDWRPACE_IFPDEPARTED)) { > >>> /* Release the rate, and try anew */ > >>> -re_rate: > >>> + > >>> tcp_rel_pacing_rate(crte, tp); > >>> nrte =3D tcp_set_pacing_rate(tp, ifp, > >>> - bytes_per_sec, flags, error); > >>> *** 386 LINES SKIPPED *** > >>> _______________________________________________ > >>> 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" > >>>=20 > >>=20 > >>=20 > >> -- > >> Mateusz Guzik > >>=20 > >=20 > >=20 > > --=20 > > Mateusz Guzik >=20 > _______________________________________________ > 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@freebs= d.org" --=20 --EB6sWAVXHCNbq2EJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAmAWtYdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYx QjU4OEQwQTYzOTVGQkM4N0ZDNUNCODM5MDVGNjU3Q0FDRkQzREMACgkQOQX2V8rP 09yBsggA6Bz/ekU783kfCFO7K2M5IsZxgl9HSzReBAVueYpGWtHhs5X8pnVAaf2s r6ap43+8AjfVK/4VgtuBRYmXh32vL1fiGosm69R3GTsHqzWpkeWxOZ0cda1P+hHO 8N3k/MoCe/GF+ZnDPmprWrcJFY1gcd24Cvi9N9ZTcCIQBWPrfMQLBHRxKG5Nq8fp rIUHZc6zOdjLq9dYxx6zQe2VTzUniwPpUY14a3CG+Vz8JibJbvFRCykWBsxtNnWT NAfbEmAjieEoCXBmWB2lCE9FpVId1BBxt2rJZvBXG4CoA/2XgWpRQrH3HzZZMGK2 RGLwCPyY/7ZYG/2qezSFcR0hKEvfDw== =cVfZ -----END PGP SIGNATURE----- --EB6sWAVXHCNbq2EJ-- From owner-dev-commits-src-main@freebsd.org Sun Jan 31 13:57: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 1C5E24F73CF; Sun, 31 Jan 2021 13:57:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 4DTCLm00DQz3N1G; Sun, 31 Jan 2021 13:57:19 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x331.google.com with SMTP id o10so9781575wmc.1; Sun, 31 Jan 2021 05:57:19 -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=+9omWVHS+QZrPt9aXYEe8D5Ap4Drvntln3b1SE/mWt4=; b=gtQ8dLU1qp98LSsJyA9JBaCcMvDp8/+TdLk8iWGOw9Kptu4ZLRcfo5G6PFIO1LbzSm iX418bneCp1ETZcqXLVfeA8FaNksYTLm6aZBQw2cIH+P/3sGWK9mdIDnYhNiZTEp7YWb SgXhaNY79aPulbAHHt8pFoSKfZfAtoEH24xtBNRSz0cnLejQqtZYOYR7+XBEqYG0eKGd KIhXI6RD4R8hCgt0k9UG6OF31a41Y5QAAJLTB39UwtzkwVFm7CyW8OhLrCWWnUsGO9JA RsNJhm/EgfH38KB85zxON5Ad6VgdAoDNPDv+TbK44TwyOZjHjKsL/4EdUaQ/lJKNTep0 YNLg== 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=+9omWVHS+QZrPt9aXYEe8D5Ap4Drvntln3b1SE/mWt4=; b=lIt76NSPNJdUoCxGq/qGEm9hs4Y3fj5FZGxDF9Ve+dnTwtjcOXtFzUjxzg9V17mTNe uVlN8Ium3qoJi1OGK+b64WUBegX3PYSjV+S8u9ycoA29rAnRje4YaL/L760DXrrRgSJF tDMFeZCX9K+xgchYVRiTuXUIJ9Wy0NLjjXDMkwpjD5g7yI1HDMoMNp/BNmOtWuux9C0y +ehebIN2SHJ98lBrUJ9JaYJIL0njJj5Z6Jgn3JKvYwc87ZjigjsmSkmfjQq6ZvnthoA0 QVlL5sYXI9c2dXEwizipMy11XowgrSMI54Lvmm7HlIUPWzqDtjQi/ad5rgp8OknsMgYg hrKw== X-Gm-Message-State: AOAM533EB0a8qrPwrMeKH81pz+AcByVjonSlWg4HvCqU+MRK7OiyVuP8 C6dsuNxem94IxoLMqig4NVpRNlMoeUIwApVJVlc= X-Google-Smtp-Source: ABdhPJwJqcJVP7x589ie71Xv1FwRN7XOwQ4ph/jdsQuwVdWLkuj/n9ha2faiXAGVj0p2rhja0A+Jv0/nFMMLGAocw+Q= X-Received: by 2002:a1c:7d53:: with SMTP id y80mr2042190wmc.187.1612101437570; Sun, 31 Jan 2021 05:57:17 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Sun, 31 Jan 2021 05:57:16 -0800 (PST) In-Reply-To: References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 31 Jan 2021 14:57:16 +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: Michael Tuexen Cc: 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: 4DTCLm00DQz3N1G 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, 31 Jan 2021 13:57:20 -0000 On 1/31/21, Michael Tuexen wrote: > > >> On 31. Jan 2021, at 12:09, Mateusz Guzik wrote: >> >> ping? I'm going to revert this on Tuesday to unbreak the build >> >> On 1/29/21, Mateusz Guzik wrote: >>> This breaks tinderbox: >>> arm LINT kernel failed, check _.arm.LINT for details >>> i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details >>> i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details >>> i386 LINT kernel failed, check _.i386.LINT for details >>> amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details > Hi Mateusz, > > where can the logfiles be accessed? > I don't see anything red at https://ci.freebsd.org/tinderbox/ > CI is down, you have to build them yourself. I don't have the logs handy. > Best regards > Michael >>> >>> >>> On 1/28/21, Randall Stewart wrote: >>>> The branch main has been updated by rrs: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=1a714ff204193b9eb810426048e03f5d76e9730e >>>> >>>> commit 1a714ff204193b9eb810426048e03f5d76e9730e >>>> Author: Randall Stewart >>>> AuthorDate: 2021-01-26 16:54:42 +0000 >>>> Commit: Randall Stewart >>>> CommitDate: 2021-01-28 16:53:05 +0000 >>>> >>>> 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. >>>> >>>> Sponsored by: Netflix Inc. >>>> Differential Revision: https://reviews.freebsd.org/D28357 >>>> --- >>>> sys/net/if_lagg.c | 11 + >>>> sys/net/if_var.h | 2 + >>>> sys/net/if_vlan.c | 30 +++ >>>> sys/netinet/in_pcb.c | 9 + >>>> sys/netinet/tcp_log_buf.h | 2 +- >>>> sys/netinet/tcp_ratelimit.c | 584 >>>> +++++++++++++++++++++++++++--------------- >>>> sys/netinet/tcp_ratelimit.h | 24 +- >>>> sys/netinet/tcp_stacks/bbr.c | 4 +- >>>> sys/netinet/tcp_stacks/rack.c | 14 +- >>>> 9 files changed, 464 insertions(+), 216 deletions(-) >>>> >>>> diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c >>>> index 3144f86901b2..9a3c22789fa5 100644 >>>> --- a/sys/net/if_lagg.c >>>> +++ b/sys/net/if_lagg.c >>>> @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct m_snd_tag *, >>>> static int lagg_snd_tag_query(struct m_snd_tag *, >>>> union if_snd_tag_query_params *); >>>> static void lagg_snd_tag_free(struct m_snd_tag *); >>>> +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); >>>> static void lagg_ratelimit_query(struct ifnet *, >>>> struct if_ratelimit_query_results *); >>>> #endif >>>> @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, >>>> caddr_t params) >>>> ifp->if_snd_tag_modify = lagg_snd_tag_modify; >>>> ifp->if_snd_tag_query = lagg_snd_tag_query; >>>> ifp->if_snd_tag_free = lagg_snd_tag_free; >>>> + ifp->if_next_snd_tag = lagg_next_snd_tag; >>>> ifp->if_ratelimit_query = lagg_ratelimit_query; >>>> #endif >>>> ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; >>>> @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, >>>> return (0); >>>> } >>>> >>>> +static struct m_snd_tag * >>>> +lagg_next_snd_tag(struct m_snd_tag *mst) >>>> +{ >>>> + struct lagg_snd_tag *lst; >>>> + >>>> + lst = mst_to_lst(mst); >>>> + return (lst->tag); >>>> +} >>>> + >>>> static int >>>> lagg_snd_tag_modify(struct m_snd_tag *mst, >>>> union if_snd_tag_modify_params *params) >>>> diff --git a/sys/net/if_var.h b/sys/net/if_var.h >>>> index beb9596895ee..9ecdfb684296 100644 >>>> --- a/sys/net/if_var.h >>>> +++ b/sys/net/if_var.h >>>> @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, >>>> union >>>> if_snd_tag_alloc_params * >>>> typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union >>>> if_snd_tag_modify_params *); >>>> typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union >>>> if_snd_tag_query_params *); >>>> typedef void (if_snd_tag_free_t)(struct m_snd_tag *); >>>> +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); >>>> typedef void (if_ratelimit_query_t)(struct ifnet *, >>>> struct if_ratelimit_query_results *); >>>> typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t); >>>> @@ -422,6 +423,7 @@ struct ifnet { >>>> if_snd_tag_modify_t *if_snd_tag_modify; >>>> if_snd_tag_query_t *if_snd_tag_query; >>>> if_snd_tag_free_t *if_snd_tag_free; >>>> + if_next_send_tag_t *if_next_snd_tag; >>>> if_ratelimit_query_t *if_ratelimit_query; >>>> if_ratelimit_setup_t *if_ratelimit_setup; >>>> >>>> diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c >>>> index 9358724844cb..9703e5e7753f 100644 >>>> --- a/sys/net/if_vlan.c >>>> +++ b/sys/net/if_vlan.c >>>> @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag *, >>>> static int vlan_snd_tag_query(struct m_snd_tag *, >>>> union if_snd_tag_query_params *); >>>> static void vlan_snd_tag_free(struct m_snd_tag *); >>>> +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); >>>> +static void vlan_ratelimit_query(struct ifnet *, >>>> + struct if_ratelimit_query_results *); >>>> #endif >>>> static void vlan_qflush(struct ifnet *ifp); >>>> static int vlan_setflag(struct ifnet *ifp, int flag, int status, >>>> @@ -1071,6 +1074,8 @@ vlan_clone_create(struct if_clone *ifc, char >>>> *name, >>>> size_t len, caddr_t params) >>>> ifp->if_snd_tag_modify = vlan_snd_tag_modify; >>>> ifp->if_snd_tag_query = vlan_snd_tag_query; >>>> ifp->if_snd_tag_free = vlan_snd_tag_free; >>>> + ifp->if_next_snd_tag = vlan_next_snd_tag; >>>> + ifp->if_ratelimit_query = vlan_ratelimit_query; >>>> #endif >>>> ifp->if_flags = VLAN_IFFLAGS; >>>> ether_ifattach(ifp, eaddr); >>>> @@ -2073,6 +2078,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, >>>> return (0); >>>> } >>>> >>>> +static struct m_snd_tag * >>>> +vlan_next_snd_tag(struct m_snd_tag *mst) >>>> +{ >>>> + struct vlan_snd_tag *vst; >>>> + >>>> + vst = mst_to_vst(mst); >>>> + return (vst->tag); >>>> +} >>>> + >>>> static int >>>> vlan_snd_tag_modify(struct m_snd_tag *mst, >>>> union if_snd_tag_modify_params *params) >>>> @@ -2102,4 +2116,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) >>>> m_snd_tag_rele(vst->tag); >>>> free(vst, M_VLAN); >>>> } >>>> + >>>> +static void >>>> +vlan_ratelimit_query(struct ifnet *ifp __unused, struct >>>> if_ratelimit_query_results *q) >>>> +{ >>>> + /* >>>> + * For vlan, we have an indirect >>>> + * interface. The caller needs to >>>> + * get a ratelimit tag on the actual >>>> + * interface the flow will go on. >>>> + */ >>>> + q->rate_table = NULL; >>>> + q->flags = RT_IS_INDIRECT; >>>> + q->max_flows = 0; >>>> + q->number_of_rates = 0; >>>> +} >>>> + >>>> #endif >>>> diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c >>>> index 59695ee3715d..40a0b4c0676e 100644 >>>> --- a/sys/netinet/in_pcb.c >>>> +++ b/sys/netinet/in_pcb.c >>>> @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, >>>> randomtime, >>>> "allocation before switching to a random one"); >>>> >>>> #ifdef RATELIMIT >>>> +counter_u64_t rate_limit_new; >>>> +counter_u64_t rate_limit_chg; >>>> counter_u64_t rate_limit_active; >>>> counter_u64_t rate_limit_alloc_fail; >>>> counter_u64_t rate_limit_set_ok; >>>> @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, >>>> alloc_fail, CTLFLAG_RD, >>>> &rate_limit_alloc_fail, "Rate limited connection failures"); >>>> SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, >>>> &rate_limit_set_ok, "Rate limited setting succeeded"); >>>> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, >>>> + &rate_limit_new, "Total Rate limit new attempts"); >>>> +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, >>>> + &rate_limit_chg, "Total Rate limited change attempts"); >>>> + >>>> #endif /* RATELIMIT */ >>>> >>>> #endif /* INET */ >>>> @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) >>>> static void >>>> rl_init(void *st) >>>> { >>>> + rate_limit_new = counter_u64_alloc(M_WAITOK); >>>> + rate_limit_chg = counter_u64_alloc(M_WAITOK); >>>> rate_limit_active = counter_u64_alloc(M_WAITOK); >>>> rate_limit_alloc_fail = counter_u64_alloc(M_WAITOK); >>>> rate_limit_set_ok = counter_u64_alloc(M_WAITOK); >>>> diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h >>>> index 0d9b14a08f53..436383124dce 100644 >>>> --- a/sys/netinet/tcp_log_buf.h >>>> +++ b/sys/netinet/tcp_log_buf.h >>>> @@ -221,7 +221,7 @@ enum tcp_log_events { >>>> BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ >>>> BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 */ >>>> TCP_LOG_REASS, /* Reassembly buffer logging 50 */ >>>> - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 */ >>>> + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this) >>>> 51 >>>> */ >>>> BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ >>>> BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 */ >>>> TCP_LOG_CONNEND, /* End of connection 54 */ >>>> diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c >>>> index 97f066be69e0..aeb1ed6906b5 100644 >>>> --- a/sys/netinet/tcp_ratelimit.c >>>> +++ b/sys/netinet/tcp_ratelimit.c >>>> @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); >>>> #ifdef INET6 >>>> #include >>>> #endif >>>> +#include >>>> +#include >>>> #include >>>> #ifndef USECS_IN_SECOND >>>> #define USECS_IN_SECOND 1000000 >>>> @@ -154,108 +156,77 @@ const uint64_t desired_rates[] = { >>>> 180500, /* 1.44Mpbs - rate 2 common rate */ >>>> 375000, /* 3Mbps - rate 3 */ >>>> 625000, /* 5Mbps - rate 4 */ >>>> - 875000, /* 7Mbps - rate 5 */ >>>> - 1125000, /* 9Mbps - rate 6 */ >>>> - 1375000, /* 11Mbps - rate 7 */ >>>> - 1625000, /* 13Mbps - rate 8 */ >>>> - 2625000, /* 21Mbps - rate 9 */ >>>> - 3875000, /* 31Mbps - rate 10 */ >>>> - 5125000, /* 41Meg - rate 11 */ >>>> - 12500000, /* 100Mbps - rate 12 */ >>>> - 25000000, /* 200Mbps - rate 13 */ >>>> - 50000000, /* 400Mbps - rate 14 */ >>>> - 63750000, /* 51Mbps - rate 15 */ >>>> + 1250000, /* 10Mbps - rate 5 */ >>>> + 1875000, /* 15Mbps - rate 6 */ >>>> + 2500000, /* 20Mbps - rate 7 */ >>>> + 3125000, /* 25Mbps - rate 8 */ >>>> + 3750000, /* 30Mbps - rate 9 */ >>>> + 4375000, /* 35Mbps - rate 10 */ >>>> + 5000000, /* 40Meg - rate 11 */ >>>> + 6250000, /* 50Mbps - rate 12 */ >>>> + 12500000, /* 100Mbps - rate 13 */ >>>> + 25000000, /* 200Mbps - rate 14 */ >>>> + 50000000, /* 400Mbps - rate 15 */ >>>> 100000000, /* 800Mbps - rate 16 */ >>>> - 1875000, /* 15Mbps - rate 17 */ >>>> - 2125000, /* 17Mbps - rate 18 */ >>>> - 2375000, /* 19Mbps - rate 19 */ >>>> - 2875000, /* 23Mbps - rate 20 */ >>>> - 3125000, /* 25Mbps - rate 21 */ >>>> - 3375000, /* 27Mbps - rate 22 */ >>>> - 3625000, /* 29Mbps - rate 23 */ >>>> - 4125000, /* 33Mbps - rate 24 */ >>>> - 4375000, /* 35Mbps - rate 25 */ >>>> - 4625000, /* 37Mbps - rate 26 */ >>>> - 4875000, /* 39Mbps - rate 27 */ >>>> - 5375000, /* 43Mbps - rate 28 */ >>>> - 5625000, /* 45Mbps - rate 29 */ >>>> - 5875000, /* 47Mbps - rate 30 */ >>>> - 6125000, /* 49Mbps - rate 31 */ >>>> - 6625000, /* 53Mbps - rate 32 */ >>>> - 6875000, /* 55Mbps - rate 33 */ >>>> - 7125000, /* 57Mbps - rate 34 */ >>>> - 7375000, /* 59Mbps - rate 35 */ >>>> - 7625000, /* 61Mbps - rate 36 */ >>>> - 7875000, /* 63Mbps - rate 37 */ >>>> - 8125000, /* 65Mbps - rate 38 */ >>>> - 8375000, /* 67Mbps - rate 39 */ >>>> - 8625000, /* 69Mbps - rate 40 */ >>>> - 8875000, /* 71Mbps - rate 41 */ >>>> - 9125000, /* 73Mbps - rate 42 */ >>>> - 9375000, /* 75Mbps - rate 43 */ >>>> - 9625000, /* 77Mbps - rate 44 */ >>>> - 9875000, /* 79Mbps - rate 45 */ >>>> - 10125000, /* 81Mbps - rate 46 */ >>>> - 10375000, /* 83Mbps - rate 47 */ >>>> - 10625000, /* 85Mbps - rate 48 */ >>>> - 10875000, /* 87Mbps - rate 49 */ >>>> - 11125000, /* 89Mbps - rate 50 */ >>>> - 11375000, /* 91Mbps - rate 51 */ >>>> - 11625000, /* 93Mbps - rate 52 */ >>>> - 11875000, /* 95Mbps - rate 53 */ >>>> - 13125000, /* 105Mbps - rate 54 */ >>>> - 13750000, /* 110Mbps - rate 55 */ >>>> - 14375000, /* 115Mbps - rate 56 */ >>>> - 15000000, /* 120Mbps - rate 57 */ >>>> - 15625000, /* 125Mbps - rate 58 */ >>>> - 16250000, /* 130Mbps - rate 59 */ >>>> - 16875000, /* 135Mbps - rate 60 */ >>>> - 17500000, /* 140Mbps - rate 61 */ >>>> - 18125000, /* 145Mbps - rate 62 */ >>>> - 18750000, /* 150Mbps - rate 64 */ >>>> - 20000000, /* 160Mbps - rate 65 */ >>>> - 21250000, /* 170Mbps - rate 66 */ >>>> - 22500000, /* 180Mbps - rate 67 */ >>>> - 23750000, /* 190Mbps - rate 68 */ >>>> - 26250000, /* 210Mbps - rate 69 */ >>>> - 27500000, /* 220Mbps - rate 70 */ >>>> - 28750000, /* 230Mbps - rate 71 */ >>>> - 30000000, /* 240Mbps - rate 72 */ >>>> - 31250000, /* 250Mbps - rate 73 */ >>>> - 34375000, /* 275Mbps - rate 74 */ >>>> - 37500000, /* 300Mbps - rate 75 */ >>>> - 40625000, /* 325Mbps - rate 76 */ >>>> - 43750000, /* 350Mbps - rate 77 */ >>>> - 46875000, /* 375Mbps - rate 78 */ >>>> - 53125000, /* 425Mbps - rate 79 */ >>>> - 56250000, /* 450Mbps - rate 80 */ >>>> - 59375000, /* 475Mbps - rate 81 */ >>>> - 62500000, /* 500Mbps - rate 82 */ >>>> - 68750000, /* 550Mbps - rate 83 */ >>>> - 75000000, /* 600Mbps - rate 84 */ >>>> - 81250000, /* 650Mbps - rate 85 */ >>>> - 87500000, /* 700Mbps - rate 86 */ >>>> - 93750000, /* 750Mbps - rate 87 */ >>>> - 106250000, /* 850Mbps - rate 88 */ >>>> - 112500000, /* 900Mbps - rate 89 */ >>>> - 125000000, /* 1Gbps - rate 90 */ >>>> - 156250000, /* 1.25Gps - rate 91 */ >>>> - 187500000, /* 1.5Gps - rate 92 */ >>>> - 218750000, /* 1.75Gps - rate 93 */ >>>> - 250000000, /* 2Gbps - rate 94 */ >>>> - 281250000, /* 2.25Gps - rate 95 */ >>>> - 312500000, /* 2.5Gbps - rate 96 */ >>>> - 343750000, /* 2.75Gbps - rate 97 */ >>>> - 375000000, /* 3Gbps - rate 98 */ >>>> - 500000000, /* 4Gbps - rate 99 */ >>>> - 625000000, /* 5Gbps - rate 100 */ >>>> - 750000000, /* 6Gbps - rate 101 */ >>>> - 875000000, /* 7Gbps - rate 102 */ >>>> - 1000000000, /* 8Gbps - rate 103 */ >>>> - 1125000000, /* 9Gbps - rate 104 */ >>>> - 1250000000, /* 10Gbps - rate 105 */ >>>> - 1875000000, /* 15Gbps - rate 106 */ >>>> - 2500000000 /* 20Gbps - rate 107 */ >>>> + 5625000, /* 45Mbps - rate 17 */ >>>> + 6875000, /* 55Mbps - rate 19 */ >>>> + 7500000, /* 60Mbps - rate 20 */ >>>> + 8125000, /* 65Mbps - rate 21 */ >>>> + 8750000, /* 70Mbps - rate 22 */ >>>> + 9375000, /* 75Mbps - rate 23 */ >>>> + 10000000, /* 80Mbps - rate 24 */ >>>> + 10625000, /* 85Mbps - rate 25 */ >>>> + 11250000, /* 90Mbps - rate 26 */ >>>> + 11875000, /* 95Mbps - rate 27 */ >>>> + 12500000, /* 100Mbps - rate 28 */ >>>> + 13750000, /* 110Mbps - rate 29 */ >>>> + 15000000, /* 120Mbps - rate 30 */ >>>> + 16250000, /* 130Mbps - rate 31 */ >>>> + 17500000, /* 140Mbps - rate 32 */ >>>> + 18750000, /* 150Mbps - rate 33 */ >>>> + 20000000, /* 160Mbps - rate 34 */ >>>> + 21250000, /* 170Mbps - rate 35 */ >>>> + 22500000, /* 180Mbps - rate 36 */ >>>> + 23750000, /* 190Mbps - rate 37 */ >>>> + 26250000, /* 210Mbps - rate 38 */ >>>> + 27500000, /* 220Mbps - rate 39 */ >>>> + 28750000, /* 230Mbps - rate 40 */ >>>> + 30000000, /* 240Mbps - rate 41 */ >>>> + 31250000, /* 250Mbps - rate 42 */ >>>> + 34375000, /* 275Mbps - rate 43 */ >>>> + 37500000, /* 300Mbps - rate 44 */ >>>> + 40625000, /* 325Mbps - rate 45 */ >>>> + 43750000, /* 350Mbps - rate 46 */ >>>> + 46875000, /* 375Mbps - rate 47 */ >>>> + 53125000, /* 425Mbps - rate 48 */ >>>> + 56250000, /* 450Mbps - rate 49 */ >>>> + 59375000, /* 475Mbps - rate 50 */ >>>> + 62500000, /* 500Mbps - rate 51 */ >>>> + 68750000, /* 550Mbps - rate 52 */ >>>> + 75000000, /* 600Mbps - rate 53 */ >>>> + 81250000, /* 650Mbps - rate 54 */ >>>> + 87500000, /* 700Mbps - rate 55 */ >>>> + 93750000, /* 750Mbps - rate 56 */ >>>> + 106250000, /* 850Mbps - rate 57 */ >>>> + 112500000, /* 900Mbps - rate 58 */ >>>> + 125000000, /* 1Gbps - rate 59 */ >>>> + 156250000, /* 1.25Gps - rate 60 */ >>>> + 187500000, /* 1.5Gps - rate 61 */ >>>> + 218750000, /* 1.75Gps - rate 62 */ >>>> + 250000000, /* 2Gbps - rate 63 */ >>>> + 281250000, /* 2.25Gps - rate 64 */ >>>> + 312500000, /* 2.5Gbps - rate 65 */ >>>> + 343750000, /* 2.75Gbps - rate 66 */ >>>> + 375000000, /* 3Gbps - rate 67 */ >>>> + 500000000, /* 4Gbps - rate 68 */ >>>> + 625000000, /* 5Gbps - rate 69 */ >>>> + 750000000, /* 6Gbps - rate 70 */ >>>> + 875000000, /* 7Gbps - rate 71 */ >>>> + 1000000000, /* 8Gbps - rate 72 */ >>>> + 1125000000, /* 9Gbps - rate 73 */ >>>> + 1250000000, /* 10Gbps - rate 74 */ >>>> + 1875000000, /* 15Gbps - rate 75 */ >>>> + 2500000000 /* 20Gbps - rate 76 */ >>>> }; >>>> >>>> #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) >>>> @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; >>>> static struct mtx rs_mtx; >>>> uint32_t rs_number_alive; >>>> uint32_t rs_number_dead; >>>> +static uint32_t rs_floor_mss = 0; >>>> +static uint32_t wait_time_floor = 8000; /* 8 ms */ >>>> +static uint32_t rs_hw_floor_mss = 16; >>>> +static uint32_t num_of_waits_allowed = 1; /* How many time blocks are >>>> we >>>> willing to wait */ >>>> >>>> SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE, >>>> 0, >>>> "TCP Ratelimit stats"); >>>> @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, >>>> CTLFLAG_RW, >>>> SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, >>>> &rs_number_dead, 0, >>>> "Number of interfaces departing from ratelimiting"); >>>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, >>>> + &rs_floor_mss, 0, >>>> + "Number of MSS that will override the normal minimums (0 means >>>> don't >>>> enforce)"); >>>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, >>>> + &wait_time_floor, 2000, >>>> + "Has b/w increases what is the wait floor we are willing to wait >>>> at >>>> the >>>> end?"); >>>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, >>>> + &num_of_waits_allowed, 1, >>>> + "How many time blocks on the end should software pacing be willing >>>> to >>>> wait?"); >>>> + >>>> +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, >>>> + &rs_hw_floor_mss, 16, >>>> + "Number of mss that are a minum for hardware pacing?"); >>>> + >>>> >>>> static void >>>> rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct >>>> tcp_rate_set >>>> *rs) >>>> @@ -383,6 +372,17 @@ 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 >>>> @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) >>>> } >>>> >>>> #ifdef INET >>>> +extern counter_u64_t rate_limit_new; >>>> +extern counter_u64_t rate_limit_chg; >>>> extern counter_u64_t rate_limit_set_ok; >>>> extern counter_u64_t rate_limit_active; >>>> extern counter_u64_t rate_limit_alloc_fail; >>>> @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >>>> int i; >>>> struct if_ratelimit_query_results rl; >>>> struct sysctl_oid *rl_sysctl_root; >>>> + struct epoch_tracker et; >>>> /* >>>> * We expect to enter with the >>>> * mutex locked. >>>> @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >>>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >>>> ""); >>>> rl_add_syctl_entries(rl_sysctl_root, rs); >>>> + NET_EPOCH_ENTER(et); >>>> mtx_lock(&rs_mtx); >>>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >>>> mtx_unlock(&rs_mtx); >>>> + NET_EPOCH_EXIT(et); >>>> return (rs); >>>> } else if ((rl.flags & RT_IS_INDIRECT) == RT_IS_INDIRECT) { >>>> memset(rs, 0, sizeof(struct tcp_rate_set)); >>>> @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) >>>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >>>> ""); >>>> rl_add_syctl_entries(rl_sysctl_root, rs); >>>> + NET_EPOCH_ENTER(et); >>>> mtx_lock(&rs_mtx); >>>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >>>> mtx_unlock(&rs_mtx); >>>> + NET_EPOCH_EXIT(et); >>>> return (rs); >>>> } else if ((rl.flags & RT_IS_FIXED_TABLE) == RT_IS_FIXED_TABLE) { >>>> /* Mellanox C4 likely */ >>>> @@ -671,6 +678,8 @@ 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. >>>> */ >>>> @@ -741,18 +750,24 @@ handle_err: >>>> CTLFLAG_RW | CTLFLAG_MPSAFE, 0, >>>> ""); >>>> rl_add_syctl_entries(rl_sysctl_root, rs); >>>> + NET_EPOCH_ENTER(et); >>>> mtx_lock(&rs_mtx); >>>> CK_LIST_INSERT_HEAD(&int_rs, rs, next); >>>> mtx_unlock(&rs_mtx); >>>> + NET_EPOCH_EXIT(et); >>>> return (rs); >>>> } >>>> >>>> +/* >>>> + * For an explanation of why the argument is volatile please >>>> + * look at the comments around rt_setup_rate(). >>>> + */ >>>> static const struct tcp_hwrate_limit_table * >>>> -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, >>>> - uint64_t bytes_per_sec, uint32_t flags) >>>> +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, >>>> + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) >>>> { >>>> struct tcp_hwrate_limit_table *arte = NULL, *rte = NULL; >>>> - uint64_t mbits_per_sec, ind_calc; >>>> + uint64_t mbits_per_sec, ind_calc, previous_rate = 0; >>>> int i; >>>> >>>> mbits_per_sec = (bytes_per_sec * 8); >>>> @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> * Smaller than 1Meg, only >>>> * 3 entries can match it. >>>> */ >>>> + previous_rate = 0; >>>> for(i = rs->rs_lowest_valid; i < 3; i++) { >>>> if (bytes_per_sec <= rs->rs_rlt[i].rate) { >>>> rte = &rs->rs_rlt[i]; >>>> @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> } else if (rs->rs_rlt[i].flags & HDWRPACE_INITED) { >>>> arte = &rs->rs_rlt[i]; >>>> } >>>> + previous_rate = rs->rs_rlt[i].rate; >>>> } >>>> goto done; >>>> } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && >>>> @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> rte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >>>> else >>>> arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >>>> + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; >>>> goto done; >>>> } >>>> /* >>>> @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> ind_calc = ALL_HARDWARE_RATES-1; >>>> } >>>> if ((ind_calc >= rs->rs_lowest_valid) && >>>> - (ind_calc <= rs->rs_highest_valid)) >>>> - rte = &rs->rs_rlt[ind_calc]; >>>> + (ind_calc <= rs->rs_highest_valid)) { >>>> + rte = &rs->rs_rlt[ind_calc]; >>>> + if (ind_calc >= 1) >>>> + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; >>>> + } >>>> } else if (flags & RS_PACING_EXACT_MATCH) { >>>> if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && >>>> (rs->rs_lowest_valid <= 2)){ >>>> @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> for (i=2; i>=rs->rs_lowest_valid; i--) { >>>> if (bytes_per_sec < rs->rs_rlt[i].rate) { >>>> rte = &rs->rs_rlt[i]; >>>> + if (i >= 1) { >>>> + previous_rate = rs->rs_rlt[(i-1)].rate; >>>> + } >>>> break; >>>> } else if ((flags & RS_PACING_GEQ) && >>>> (bytes_per_sec == rs->rs_rlt[i].rate)) { >>>> rte = &rs->rs_rlt[i]; >>>> + if (i >= 1) { >>>> + previous_rate = rs->rs_rlt[(i-1)].rate; >>>> + } >>>> break; >>>> } else { >>>> arte = &rs->rs_rlt[i]; /* new alternate */ >>>> @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> /* The top rate is an alternative */ >>>> arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; >>>> } >>>> + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; >>>> } else { >>>> /* Its in our range 1Meg - 1Gig */ >>>> if (flags & RS_PACING_GEQ) { >>>> @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> ind_calc = (ALL_HARDWARE_RATES-1); >>>> } >>>> rte = &rs->rs_rlt[ind_calc]; >>>> + if (ind_calc >= 1) >>>> + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; >>>> } >>>> goto done; >>>> } >>>> @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct >>>> tcp_rate_set >>>> *rs, >>>> /* This should not happen */ >>>> ind_calc = ALL_HARDWARE_RATES-1; >>>> } >>>> - if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) >>>> + if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) { >>>> rte = &rs->rs_rlt[ind_calc]; >>>> + if (ind_calc >= 1) >>>> + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; >>>> + } >>>> } >>>> } >>>> done: >>>> @@ -893,11 +926,17 @@ done: >>>> /* We can use the substitute */ >>>> rte = arte; >>>> } >>>> + if (lower_rate) >>>> + *lower_rate = previous_rate; >>>> return (rte); >>>> } >>>> >>>> +/* >>>> + * For an explanation of why the argument is volatile please >>>> + * look at the comments around rt_setup_rate(). >>>> + */ >>>> static const struct tcp_hwrate_limit_table * >>>> -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t >>>> bytes_per_sec, uint32_t flags) >>>> +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, >>>> uint64_t >>>> bytes_per_sec, uint32_t flags, uint64_t *lower_rate) >>>> { >>>> /** >>>> * Hunt the rate table with the restrictions in flags and find a >>>> @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set >>>> *rs, >>>> uint64_t bytes_per_sec, ui >>>> */ >>>> int i, matched; >>>> struct tcp_hwrate_limit_table *rte = NULL; >>>> + uint64_t previous_rate = 0; >>>> >>>> if ((rs->rs_flags & RS_INT_TBL) && >>>> (rs->rs_rate_cnt >= ALL_HARDWARE_RATES)) { >>>> @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set >>>> *rs, >>>> uint64_t bytes_per_sec, ui >>>> * from 1Meg - 1000Meg in 1Meg increments. >>>> * Use an alternate method to "lookup". >>>> */ >>>> - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags)); >>>> + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags, >>>> lower_rate)); >>>> } >>>> if ((flags & RS_PACING_LT) || >>>> (flags & RS_PACING_EXACT_MATCH)) { >>>> @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct tcp_rate_set >>>> *rs, >>>> uint64_t bytes_per_sec, ui >>>> (bytes_per_sec == rs->rs_rlt[i].rate)) { >>>> rte = &rs->rs_rlt[i]; >>>> matched = 1; >>>> + if (lower_rate != NULL) >>>> + *lower_rate = previous_rate; >>>> break; >>>> } else if ((flags & RS_PACING_LT) && >>>> (bytes_per_sec <= rs->rs_rlt[i].rate)) { >>>> rte = &rs->rs_rlt[i]; >>>> matched = 1; >>>> + if (lower_rate != NULL) >>>> + *lower_rate = previous_rate; >>>> break; >>>> } >>>> + previous_rate = rs->rs_rlt[i].rate; >>>> if (bytes_per_sec > rs->rs_rlt[i].rate) >>>> break; >>>> } >>>> @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct tcp_rate_set >>>> *rs, >>>> uint64_t bytes_per_sec, ui >>>> * We found a table entry that is smaller, >>>> * stop there will be none greater or equal. >>>> */ >>>> + if (lower_rate != NULL) >>>> + *lower_rate = rs->rs_rlt[i].rate; >>>> break; >>>> } >>>> } >>>> @@ -995,10 +1042,10 @@ static struct ifnet * >>>> rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int >>>> *error) >>>> { >>>> struct ifnet *tifp; >>>> - struct m_snd_tag *tag; >>>> + struct m_snd_tag *tag, *ntag; >>>> union if_snd_tag_alloc_params params = { >>>> .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, >>>> - .rate_limit.hdr.flowid = 1, >>>> + .rate_limit.hdr.flowid = inp->inp_flowid, >>>> .rate_limit.hdr.numa_domain = inp->inp_numa_domain, >>>> .rate_limit.max_rate = COMMON_RATE, >>>> .rate_limit.flags = M_NOWAIT, >>>> @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, >>>> struct >>>> inpcb *inp, int *error) >>>> *error = err; >>>> return (NULL); >>>> } >>>> - tifp = tag->ifp; >>>> + ntag = tag; >>>> + while(ntag->ifp->if_next_snd_tag != NULL) { >>>> + ntag = ntag->ifp->if_next_snd_tag(ntag); >>>> + } >>>> + tifp = ntag->ifp; >>>> m_snd_tag_rele(tag); >>>> return (tifp); >>>> } >>>> >>>> +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); >>>> +} >>>> + >>>> +/* >>>> + * Do NOT take the __noinline out of the >>>> + * find_rs_for_ifp() function. If you do the inline >>>> + * of it for the rt_setup_rate() will show you a >>>> + * compiler bug. For some reason the compiler thinks >>>> + * the list can never be empty. The consequence of >>>> + * this will be a crash when we dereference NULL >>>> + * if an ifp is removed just has a hw rate limit >>>> + * is attempted. If you are working on the compiler >>>> + * and want to "test" this go ahead and take the noinline >>>> + * out otherwise let sleeping dogs ly until such time >>>> + * as we get a compiler fix 10/2/20 -- RRS >>>> + */ >>>> +static __noinline struct tcp_rate_set * >>>> +find_rs_for_ifp(struct ifnet *ifp) >>>> +{ >>>> + struct tcp_rate_set *rs; >>>> + >>>> + CK_LIST_FOREACH(rs, &int_rs, next) { >>>> + if ((rs->rs_ifp == ifp) && >>>> + (rs->rs_if_dunit == ifp->if_dunit)) { >>>> + /* Ok we found it */ >>>> + return (rs); >>>> + } >>>> + } >>>> + return (NULL); >>>> +} >>>> + >>>> + >>>> static const struct tcp_hwrate_limit_table * >>>> rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t >>>> bytes_per_sec, >>>> - uint32_t flags, int *error) >>>> + uint32_t flags, int *error, uint64_t *lower_rate) >>>> { >>>> /* First lets find the interface if it exists */ >>>> const struct tcp_hwrate_limit_table *rte; >>>> - struct tcp_rate_set *rs; >>>> + /* >>>> + * So why is rs volatile? This is to defeat a >>>> + * compiler bug where in the compiler is convinced >>>> + * that rs can never be NULL (which is not true). Because >>>> + * of its conviction it nicely optimizes out the if ((rs == NULL >>>> + * below which means if you get a NULL back you dereference it. >>>> + */ >>>> + volatile struct tcp_rate_set *rs; >>>> struct epoch_tracker et; >>>> + struct ifnet *oifp = ifp; >>>> int err; >>>> >>>> NET_EPOCH_ENTER(et); >>>> use_real_interface: >>>> - CK_LIST_FOREACH(rs, &int_rs, next) { >>>> - /* >>>> - * Note we don't look with the lock since we either see a >>>> - * new entry or will get one when we try to add it. >>>> - */ >>>> - if (rs->rs_flags & RS_IS_DEAD) { >>>> - /* The dead are not looked at */ >>>> - continue; >>>> - } >>>> - if ((rs->rs_ifp == ifp) && >>>> - (rs->rs_if_dunit == ifp->if_dunit)) { >>>> - /* Ok we found it */ >>>> - break; >>>> - } >>>> - } >>>> + rs = find_rs_for_ifp(ifp); >>>> if ((rs == NULL) || >>>> (rs->rs_flags & RS_INTF_NO_SUP) || >>>> (rs->rs_flags & RS_IS_DEAD)) { >>>> @@ -1063,14 +1164,14 @@ use_real_interface: >>>> * might be arguable, but its impossible >>>> * to tell from the departing case. >>>> */ >>>> - if (rs->rs_disable && error) >>>> + if (error) >>>> *error = ENODEV; >>>> NET_EPOCH_EXIT(et); >>>> return (NULL); >>>> } >>>> >>>> if ((rs == NULL) || (rs->rs_disable != 0)) { >>>> - if (rs->rs_disable && error) >>>> + if (error) >>>> *error = ENOSPC; >>>> NET_EPOCH_EXIT(et); >>>> return (NULL); >>>> @@ -1086,6 +1187,10 @@ use_real_interface: >>>> NET_EPOCH_EXIT(et); >>>> return (NULL); >>>> } >>>> + KASSERT((tifp != ifp), >>>> + ("Lookup failure ifp:%p inp:%p rt_find_real_interface() returns the >>>> same >>>> interface tifp:%p?\n", >>>> + ifp, inp, tifp)); >>>> + ifp = tifp; >>>> goto use_real_interface; >>>> } >>>> if (rs->rs_flow_limit && >>>> @@ -1095,9 +1200,9 @@ use_real_interface: >>>> NET_EPOCH_EXIT(et); >>>> return (NULL); >>>> } >>>> - rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags); >>>> + rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate); >>>> if (rte) { >>>> - err = in_pcbattach_txrtlmt(inp, rs->rs_ifp, >>>> + err = in_pcbattach_txrtlmt(inp, oifp, >>>> inp->inp_flowtype, >>>> inp->inp_flowid, >>>> rte->rate, >>>> @@ -1107,6 +1212,11 @@ use_real_interface: >>>> if (error) >>>> *error = err; >>>> 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)); >>>> + counter_u64_add(rate_limit_new, 1); >>>> } >>>> } >>>> if (rte) { >>>> @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct >>>> ifnet >>>> *ifp, int link_state) >>>> { >>>> int error; >>>> struct tcp_rate_set *rs; >>>> + struct epoch_tracker et; >>>> >>>> if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || >>>> (link_state != LINK_STATE_UP)) { >>>> @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct >>>> ifnet >>>> *ifp, int link_state) >>>> */ >>>> return; >>>> } >>>> + NET_EPOCH_ENTER(et); >>>> mtx_lock(&rs_mtx); >>>> - CK_LIST_FOREACH(rs, &int_rs, next) { >>>> - if ((rs->rs_ifp == ifp) && >>>> - (rs->rs_if_dunit == ifp->if_dunit)) { >>>> - /* We already have initialized this guy */ >>>> - mtx_unlock(&rs_mtx); >>>> - return; >>>> - } >>>> + rs = find_rs_for_ifp(ifp); >>>> + if (rs) { >>>> + /* We already have initialized this guy */ >>>> + mtx_unlock(&rs_mtx); >>>> + NET_EPOCH_EXIT(et); >>>> + return; >>>> } >>>> mtx_unlock(&rs_mtx); >>>> + NET_EPOCH_EXIT(et); >>>> rt_setup_new_rs(ifp, &error); >>>> } >>>> >>>> static void >>>> tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) >>>> { >>>> - struct tcp_rate_set *rs, *nrs; >>>> + struct tcp_rate_set *rs; >>>> + struct epoch_tracker et; >>>> int i; >>>> >>>> + NET_EPOCH_ENTER(et); >>>> mtx_lock(&rs_mtx); >>>> - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { >>>> - if ((rs->rs_ifp == ifp) && >>>> - (rs->rs_if_dunit == ifp->if_dunit)) { >>>> - CK_LIST_REMOVE(rs, next); >>>> - rs_number_alive--; >>>> - rs->rs_flags |= RS_IS_DEAD; >>>> - for (i = 0; i < rs->rs_rate_cnt; i++) { >>>> - if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { >>>> - in_pcbdetach_tag(rs->rs_rlt[i].tag); >>>> - rs->rs_rlt[i].tag = NULL; >>>> - } >>>> - rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; >>>> + rs = find_rs_for_ifp(ifp); >>>> + if (rs) { >>>> + CK_LIST_REMOVE(rs, next); >>>> + rs_number_alive--; >>>> + rs->rs_flags |= RS_IS_DEAD; >>>> + for (i = 0; i < rs->rs_rate_cnt; i++) { >>>> + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { >>>> + in_pcbdetach_tag(rs->rs_rlt[i].tag); >>>> + rs->rs_rlt[i].tag = NULL; >>>> } >>>> - if (rs->rs_flows_using == 0) >>>> - rs_defer_destroy(rs); >>>> - break; >>>> + rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; >>>> } >>>> + if (rs->rs_flows_using == 0) >>>> + rs_defer_destroy(rs); >>>> } >>>> mtx_unlock(&rs_mtx); >>>> + NET_EPOCH_EXIT(et); >>>> } >>>> >>>> static void >>>> tcp_rl_shutdown(void *arg __unused, int howto __unused) >>>> { >>>> struct tcp_rate_set *rs, *nrs; >>>> + struct epoch_tracker et; >>>> int i; >>>> >>>> + NET_EPOCH_ENTER(et); >>>> mtx_lock(&rs_mtx); >>>> CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { >>>> CK_LIST_REMOVE(rs, next); >>>> @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int howto >>>> __unused) >>>> rs_defer_destroy(rs); >>>> } >>>> mtx_unlock(&rs_mtx); >>>> + NET_EPOCH_EXIT(et); >>>> } >>>> >>>> const struct tcp_hwrate_limit_table * >>>> tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, >>>> - uint64_t bytes_per_sec, int flags, int *error) >>>> + uint64_t bytes_per_sec, int flags, int *error, uint64_t >>>> *lower_rate) >>>> { >>>> const struct tcp_hwrate_limit_table *rte; >>>> #ifdef KERN_TLS >>>> @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct >>>> ifnet >>>> *ifp, >>>> } >>>> } >>>> #endif >>>> - rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error); >>>> + rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error, >>>> lower_rate); >>>> + if (rte) >>>> + rl_increment_using(rte); >>>> #ifdef KERN_TLS >>>> if (rte != NULL && tls != NULL && tls->snd_tag != NULL) { >>>> /* >>>> @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct >>>> ifnet >>>> *ifp, >>>> *error = EINVAL; >>>> rte = NULL; >>>> } >>>> - tp->t_pacing_rate = rte->rate; >>>> - *error = 0; >>>> + if (rte != NULL) { >>>> + tp->t_pacing_rate = rte->rate; >>>> + *error = 0; >>>> + } >>>> return (rte); >>>> } >>>> >>>> const struct tcp_hwrate_limit_table * >>>> tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, >>>> struct tcpcb *tp, struct ifnet *ifp, >>>> - uint64_t bytes_per_sec, int flags, int *error) >>>> + uint64_t bytes_per_sec, int flags, int *error, uint64_t >>>> *lower_rate) >>>> { >>>> const struct tcp_hwrate_limit_table *nrte; >>>> const struct tcp_rate_set *rs; >>>> #ifdef KERN_TLS >>>> struct ktls_session *tls = NULL; >>>> #endif >>>> - int is_indirect = 0; >>>> int err; >>>> >>>> INP_WLOCK_ASSERT(tp->t_inpcb); >>>> @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct >>>> tcp_hwrate_limit_table *crte, >>>> if ((rs->rs_flags & RS_IS_DEAD) || >>>> (crte->flags & HDWRPACE_IFPDEPARTED)) { >>>> /* Release the rate, and try anew */ >>>> -re_rate: >>>> + >>>> tcp_rel_pacing_rate(crte, tp); >>>> nrte = tcp_set_pacing_rate(tp, ifp, >>>> - bytes_per_sec, flags, error); >>>> *** 386 LINES SKIPPED *** >>>> _______________________________________________ >>>> 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 >>> >> >> >> -- >> Mateusz Guzik > > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Sun Jan 31 14:30: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 3FFF24F7E3D; Sun, 31 Jan 2021 14:30:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 4DTD530j2Xz3Pv1; Sun, 31 Jan 2021 14:30:30 +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) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6DDDA26051C; Sun, 31 Jan 2021 15:30:22 +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 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: Date: Sun, 31 Jan 2021 15:30:09 +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: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DTD530j2Xz3Pv1 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, 31 Jan 2021 14:30:31 -0000 Hi, If Randall doesn't fix this by end of Monday, I'll step up and fix it. It is just a matter of adding some #ifdef's in there :-) --HPS From owner-dev-commits-src-main@freebsd.org Sun Jan 31 15:58: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 CA22D4FAED3; Sun, 31 Jan 2021 15:58:11 +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 4DTG2C5MTNz3lVf; Sun, 31 Jan 2021 15:58:11 +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 AB2312F87; Sun, 31 Jan 2021 15:58:11 +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 10VFwBvM067970; Sun, 31 Jan 2021 15:58:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VFwBYQ067969; Sun, 31 Jan 2021 15:58:11 GMT (envelope-from git) Date: Sun, 31 Jan 2021 15:58:11 GMT Message-Id: <202101311558.10VFwBYQ067969@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: b24872cf7b13 - main - lualoader: position hyphens at the beginning of character classes 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: b24872cf7b13314669ed2136c0262bb2eb007695 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, 31 Jan 2021 15:58:11 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b24872cf7b13314669ed2136c0262bb2eb007695 commit b24872cf7b13314669ed2136c0262bb2eb007695 Author: Kyle Evans AuthorDate: 2021-01-31 15:51:39 +0000 Commit: Kyle Evans CommitDate: 2021-01-31 15:57:59 +0000 lualoader: position hyphens at the beginning of character classes According to the Lua 5.4 manual section 6.4.1 ("Patterns"), the interaction between ranges and classes is not defined and hyphens must be specified at either the beginning or the end of a set if they are not escaped. Move all such occurrences to the beginning. Reported-by: _parv (twitter) MFC-after: 3 days --- stand/lua/config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/lua/config.lua b/stand/lua/config.lua index f569b2e00b76..9ef7c0796f46 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -62,10 +62,10 @@ local MSG_FAILSYN_EOLESC = "Stray escape at end of line" local MSG_FAILSYN_EOLVAR = "Unescaped $ at end of line" local MSG_FAILSYN_BADVAR = "Malformed variable expression at position '%d'" -local MODULEEXPR = '([%w-_]+)' +local MODULEEXPR = '([-%w_]+)' local QVALEXPR = '"(.*)"' local QVALREPL = QVALEXPR:gsub('%%', '%%%%') -local WORDEXPR = "([%w%d-][%w%d-_.]*)" +local WORDEXPR = "([-%w%d][-%w%d_.]*)" local WORDREPL = WORDEXPR:gsub('%%', '%%%%') -- Entries that should never make it into the environment; each one should have @@ -182,7 +182,7 @@ local function processEnvVar(value) -- Skip the $ vinit = i + 1 vdelim = nil - vpat = "^([%w][%w%d-_.]*)" + vpat = "^([%w][-%w%d_.]*)" end local name = value:match(vpat, vinit) @@ -346,7 +346,7 @@ local function getBlacklist() return blacklist end - for mod in blacklist_str:gmatch("[;, ]?([%w-_]+)[;, ]?") do + for mod in blacklist_str:gmatch("[;, ]?([-%w_]+)[;, ]?") do blacklist[mod] = true end return blacklist From owner-dev-commits-src-main@freebsd.org Sun Jan 31 16:07: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 221144FB60D; Sun, 31 Jan 2021 16:07: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 4DTGDx0QM6z3m8B; Sun, 31 Jan 2021 16:07: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 010072F71; Sun, 31 Jan 2021 16:07: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 10VG7S1t081341; Sun, 31 Jan 2021 16:07:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VG7Sr3081340; Sun, 31 Jan 2021 16:07:28 GMT (envelope-from git) Date: Sun, 31 Jan 2021 16:07:28 GMT Message-Id: <202101311607.10VG7Sr3081340@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: 46f168bc665a - main - Drop temporary compat in setproctitle 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: 46f168bc665a1aee79d91bd102aef7d4754e7917 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, 31 Jan 2021 16:07:29 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=46f168bc665a1aee79d91bd102aef7d4754e7917 commit 46f168bc665a1aee79d91bd102aef7d4754e7917 Author: Mateusz Guzik AuthorDate: 2021-01-31 12:23:42 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-31 16:07:19 +0000 Drop temporary compat in setproctitle --- lib/libc/gen/setproctitle.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c index 991af38565cd..3f858952255c 100644 --- a/lib/libc/gen/setproctitle.c +++ b/lib/libc/gen/setproctitle.c @@ -185,17 +185,7 @@ setproctitle_fast(const char *fmt, ...) oid[1] = KERN_PROC; oid[2] = KERN_PROC_ARGS; oid[3] = -1; - if (sysctl(oid, 4, 0, 0, "", 0) != 0) { - /* - * Temporary compat for kernels which don't support - * passing -1. - */ - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; - oid[3] = getpid(); - sysctl(oid, 4, 0, 0, "", 0); - } + sysctl(oid, 4, 0, 0, "", 0); fast_update = 1; } } @@ -217,17 +207,7 @@ setproctitle(const char *fmt, ...) oid[1] = KERN_PROC; oid[2] = KERN_PROC_ARGS; oid[3] = -1; - if (sysctl(oid, 4, 0, 0, buf, strlen(buf) + 1) != 0) { - /* - * Temporary compat for kernels which don't support - * passing -1. - */ - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; - oid[3] = getpid(); - sysctl(oid, 4, 0, 0, buf, strlen(buf) + 1); - } + sysctl(oid, 4, 0, 0, buf, strlen(buf) + 1); fast_update = 0; } } From owner-dev-commits-src-main@freebsd.org Sun Jan 31 16:07: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 3FCE24FB367; Sun, 31 Jan 2021 16:07:30 +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 4DTGDy1NfMz3lxk; Sun, 31 Jan 2021 16:07:30 +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 2248C2F72; Sun, 31 Jan 2021 16:07:30 +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 10VG7UBG081359; Sun, 31 Jan 2021 16:07:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VG7UGC081358; Sun, 31 Jan 2021 16:07:30 GMT (envelope-from git) Date: Sun, 31 Jan 2021 16:07:30 GMT Message-Id: <202101311607.10VG7UGC081358@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: 0db6aef407f3 - main - amd64: add a note about simd to libc memset, memmove and memcmp 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: 0db6aef407f30c138982b8cde43189aad098b337 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, 31 Jan 2021 16:07:30 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0db6aef407f30c138982b8cde43189aad098b337 commit 0db6aef407f30c138982b8cde43189aad098b337 Author: Mateusz Guzik AuthorDate: 2021-01-31 15:50:34 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-31 16:07:19 +0000 amd64: add a note about simd to libc memset, memmove and memcmp --- lib/libc/amd64/string/memcmp.S | 6 ++++++ lib/libc/amd64/string/memmove.S | 6 ++++++ lib/libc/amd64/string/memset.S | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/lib/libc/amd64/string/memcmp.S b/lib/libc/amd64/string/memcmp.S index 231ab2175804..67c7df280679 100644 --- a/lib/libc/amd64/string/memcmp.S +++ b/lib/libc/amd64/string/memcmp.S @@ -31,6 +31,12 @@ #include __FBSDID("$FreeBSD$"); +/* + * Note: this routine was written with kernel use in mind (read: no simd), + * it is only present in userspace as a temporary measure until something + * better gets imported. + */ + #define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ ENTRY(memcmp) diff --git a/lib/libc/amd64/string/memmove.S b/lib/libc/amd64/string/memmove.S index 4797140a1c16..3d75ff45c798 100644 --- a/lib/libc/amd64/string/memmove.S +++ b/lib/libc/amd64/string/memmove.S @@ -29,6 +29,12 @@ #include __FBSDID("$FreeBSD$"); +/* + * Note: this routine was written with kernel use in mind (read: no simd), + * it is only present in userspace as a temporary measure until something + * better gets imported. + */ + #define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ /* diff --git a/lib/libc/amd64/string/memset.S b/lib/libc/amd64/string/memset.S index 0639573a4a3e..050711302354 100644 --- a/lib/libc/amd64/string/memset.S +++ b/lib/libc/amd64/string/memset.S @@ -31,6 +31,12 @@ #include __FBSDID("$FreeBSD$"); +/* + * Note: this routine was written with kernel use in mind (read: no simd), + * it is only present in userspace as a temporary measure until something + * better gets imported. + */ + #define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ .macro MEMSET erms From owner-dev-commits-src-main@freebsd.org Sun Jan 31 16:07: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 80E404FB3E7; Sun, 31 Jan 2021 16:07: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 4DTGDz2l99z3m8D; Sun, 31 Jan 2021 16:07: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 4E61231A7; Sun, 31 Jan 2021 16:07: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 10VG7VDa081382; Sun, 31 Jan 2021 16:07:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VG7VZ8081381; Sun, 31 Jan 2021 16:07:31 GMT (envelope-from git) Date: Sun, 31 Jan 2021 16:07:31 GMT Message-Id: <202101311607.10VG7VZ8081381@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: f1be262ec11c - main - amd64: move memcmp checks upfront 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: f1be262ec11c1c35e6485f432415b5b52adb505d 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, 31 Jan 2021 16:07:31 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f1be262ec11c1c35e6485f432415b5b52adb505d commit f1be262ec11c1c35e6485f432415b5b52adb505d Author: Mateusz Guzik AuthorDate: 2021-01-31 15:46:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-01-31 16:07:20 +0000 amd64: move memcmp checks upfront This is a tradeoff which saves jumps for smaller sizes while making the 8-16 range slower (roughly in line with the other cases). Tested with glibc test suite. For example size 3 (most common with vfs namecache) (ops/s): before: 407086026 after: 461391995 The regressed range of 8-16 (with 8 as example): before: 540850489 after: 461671032 --- lib/libc/amd64/string/memcmp.S | 50 ++++++++++++++++++++++------------------ sys/amd64/amd64/support.S | 52 +++++++++++++++++++++++------------------- 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/lib/libc/amd64/string/memcmp.S b/lib/libc/amd64/string/memcmp.S index 67c7df280679..0c8121f9d885 100644 --- a/lib/libc/amd64/string/memcmp.S +++ b/lib/libc/amd64/string/memcmp.S @@ -45,9 +45,25 @@ ENTRY(memcmp) cmpq $16,%rdx ja 101632f -100816: cmpb $8,%dl - jl 100408f + jg 100816f + + cmpb $4,%dl + jg 100408f + + cmpb $2,%dl + jge 100204f + + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax +100000: + ret + + ALIGN_TEXT +100816: movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 @@ -57,9 +73,8 @@ ENTRY(memcmp) cmpq %r8,%r9 jne 10081608f ret + ALIGN_TEXT 100408: - cmpb $4,%dl - jl 100204f movl (%rdi),%r8d movl (%rsi),%r9d cmpl %r8d,%r9d @@ -69,9 +84,8 @@ ENTRY(memcmp) cmpl %r8d,%r9d jne 10040804f ret + ALIGN_TEXT 100204: - cmpb $2,%dl - jl 100001f movzwl (%rdi),%r8d movzwl (%rsi),%r9d cmpl %r8d,%r9d @@ -81,15 +95,7 @@ ENTRY(memcmp) cmpl %r8d,%r9d jne 1f ret -100001: - cmpb $1,%dl - jl 100000f - movzbl (%rdi),%eax - movzbl (%rsi),%r8d - subl %r8d,%eax -100000: - ret -ALIGN_TEXT + ALIGN_TEXT 101632: cmpq $32,%rdx ja 103200f @@ -110,7 +116,7 @@ ALIGN_TEXT cmpq %r8,%r9 jne 10163224f ret -ALIGN_TEXT + ALIGN_TEXT 103200: movq (%rdi),%r8 movq 8(%rdi),%r9 @@ -140,7 +146,7 @@ ALIGN_TEXT * * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). */ -ALIGN_TEXT + ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi @@ -152,29 +158,29 @@ ALIGN_TEXT leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163208: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10040804: leaq -4(%rdi,%rdx),%rdi leaq -4(%rsi,%rdx),%rsi jmp 1f -ALIGN_TEXT + ALIGN_TEXT 80: movl (%rdi),%r8d movl (%rsi),%r9d diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 49baa50ac294..b623fba277db 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -93,9 +93,26 @@ ENTRY(memcmp) cmpq $16,%rdx ja 101632f -100816: cmpb $8,%dl - jl 100408f + jg 100816f + + cmpb $4,%dl + jg 100408f + + cmpb $2,%dl + jge 100204f + + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax +100000: + POP_FRAME_POINTER + ret + + ALIGN_TEXT +100816: movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 @@ -106,9 +123,8 @@ ENTRY(memcmp) jne 10081608f POP_FRAME_POINTER ret + ALIGN_TEXT 100408: - cmpb $4,%dl - jl 100204f movl (%rdi),%r8d movl (%rsi),%r9d cmpl %r8d,%r9d @@ -119,9 +135,8 @@ ENTRY(memcmp) jne 10040804f POP_FRAME_POINTER ret + ALIGN_TEXT 100204: - cmpb $2,%dl - jl 100001f movzwl (%rdi),%r8d movzwl (%rsi),%r9d cmpl %r8d,%r9d @@ -132,16 +147,7 @@ ENTRY(memcmp) jne 1f POP_FRAME_POINTER ret -100001: - cmpb $1,%dl - jl 100000f - movzbl (%rdi),%eax - movzbl (%rsi),%r8d - subl %r8d,%eax -100000: - POP_FRAME_POINTER - ret -ALIGN_TEXT + ALIGN_TEXT 101632: cmpq $32,%rdx ja 103200f @@ -163,7 +169,7 @@ ALIGN_TEXT jne 10163224f POP_FRAME_POINTER ret -ALIGN_TEXT + ALIGN_TEXT 103200: movq (%rdi),%r8 movq 8(%rdi),%r9 @@ -194,7 +200,7 @@ ALIGN_TEXT * * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). */ -ALIGN_TEXT + ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi @@ -206,29 +212,29 @@ ALIGN_TEXT leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163208: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10040804: leaq -4(%rdi,%rdx),%rdi leaq -4(%rsi,%rdx),%rsi jmp 1f -ALIGN_TEXT + ALIGN_TEXT 80: movl (%rdi),%r8d movl (%rsi),%r9d From owner-dev-commits-src-main@freebsd.org Sun Jan 31 16:11: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 CC3694FB732; Sun, 31 Jan 2021 16:11: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 4DTGL25Tc0z3mT7; Sun, 31 Jan 2021 16:11: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 AF349338D; Sun, 31 Jan 2021 16:11: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 10VGBstP091851; Sun, 31 Jan 2021 16:11:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VGBsIi091850; Sun, 31 Jan 2021 16:11:54 GMT (envelope-from git) Date: Sun, 31 Jan 2021 16:11:54 GMT Message-Id: <202101311611.10VGBsIi091850@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: 8eeeee38f4c5 - main - tools: boot: use four jobs for building stand 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: 8eeeee38f4c5b2b48d03f3c5a3fa678962e8c9ed 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, 31 Jan 2021 16:11:54 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8eeeee38f4c5b2b48d03f3c5a3fa678962e8c9ed commit 8eeeee38f4c5b2b48d03f3c5a3fa678962e8c9ed Author: Kyle Evans AuthorDate: 2021-01-31 16:07:31 +0000 Commit: Kyle Evans CommitDate: 2021-01-31 16:11:41 +0000 tools: boot: use four jobs for building stand Parallel builds of stand should be assumed both possible and safe as of 7012461c9bf6, so let's start using some jobs to speed up lualoader test harness builds. --- tools/boot/lua-img.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/boot/lua-img.sh b/tools/boot/lua-img.sh index 9693c726501d..85e4cfc304d9 100755 --- a/tools/boot/lua-img.sh +++ b/tools/boot/lua-img.sh @@ -21,6 +21,6 @@ mkdir -p ${dir} mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir} mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr cd stand -make all install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes +make -j4 all install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes mkdir -p ${dir}/boot/kernel cp /boot/kernel/kernel ${dir}/boot/kernel From owner-dev-commits-src-main@freebsd.org Sun Jan 31 17:55: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 4C5774FEC31; Sun, 31 Jan 2021 17:55: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 4DTJdW1hgyz3tjd; Sun, 31 Jan 2021 17:55: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 2CC7C45DD; Sun, 31 Jan 2021 17:55: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 10VHtRBi024679; Sun, 31 Jan 2021 17:55:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VHtRfr024678; Sun, 31 Jan 2021 17:55:27 GMT (envelope-from git) Date: Sun, 31 Jan 2021 17:55:27 GMT Message-Id: <202101311755.10VHtRfr024678@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: 9dc7c250b8bd - main - cxgb(4): Remove assumption of physically contiguous mbufs. 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: 9dc7c250b8bd2d5e669c7633e189a700a02c0571 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, 31 Jan 2021 17:55:27 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9dc7c250b8bd2d5e669c7633e189a700a02c0571 commit 9dc7c250b8bd2d5e669c7633e189a700a02c0571 Author: Alexander Motin AuthorDate: 2021-01-31 17:46:57 +0000 Commit: Alexander Motin CommitDate: 2021-01-31 17:55:06 +0000 cxgb(4): Remove assumption of physically contiguous mbufs. Investigation of iSCSI target data corruption reports brought me to discovery that cxgb(4) expects mbufs to be physically contiguous, that is not true after I've started using m_extaddref() in software iSCSI for large zero-copy transmissions. In case of fragmented memory the driver transmitted garbage from pages following the first one due to simple use of pmap_kextract() for the first pointer instead of proper bus_dmamap_load_mbuf_sg(). Seems like it was done as some optimization many years ago, and at very least it is wrong in a world of IOMMUs. This patch just removes that optimization, plus limits packet coalescing for mbufs crossing page boundary, also depending on assumption of one segment per packet. MFC after: 3 days Sponsored by: iXsystems, Inc. Reviewed by: mmacy, np Differential revision: https://reviews.freebsd.org/D28428 --- sys/dev/cxgb/cxgb_sge.c | 3 ++- sys/dev/cxgb/sys/mvec.h | 14 -------------- sys/dev/cxgb/sys/uipc_mvec.c | 24 +++--------------------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 7f456ccff4ca..491d1a751f4a 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -322,7 +322,8 @@ coalesce_check(struct mbuf *m, void *arg) int *nbytes = &ci->nbytes; if ((*nbytes == 0) || ((*nbytes + m->m_len <= 10500) && - (*count < 7) && (m->m_next == NULL))) { + (*count < 7) && (m->m_next == NULL) && + ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE))) { *count += 1; *nbytes += m->m_len; return (1); diff --git a/sys/dev/cxgb/sys/mvec.h b/sys/dev/cxgb/sys/mvec.h index bdd0b55c5489..4989bff29ec4 100644 --- a/sys/dev/cxgb/sys/mvec.h +++ b/sys/dev/cxgb/sys/mvec.h @@ -33,20 +33,6 @@ #define _MVEC_H_ #include -static __inline void -busdma_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map, - struct mbuf *m, bus_dma_segment_t *seg) -{ -#if defined(__i386__) || defined(__amd64__) - seg->ds_addr = pmap_kextract(mtod(m, vm_offset_t)); - seg->ds_len = m->m_len; -#else - int nsegstmp; - - bus_dmamap_load_mbuf_sg(tag, map, m, seg, &nsegstmp, 0); -#endif -} - int busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf **m, bus_dma_segment_t *segs, int *nsegs); void busdma_map_sg_vec(bus_dma_tag_t tag, bus_dmamap_t map, diff --git a/sys/dev/cxgb/sys/uipc_mvec.c b/sys/dev/cxgb/sys/uipc_mvec.c index ca31cf1897c7..02f437079468 100644 --- a/sys/dev/cxgb/sys/uipc_mvec.c +++ b/sys/dev/cxgb/sys/uipc_mvec.c @@ -65,26 +65,7 @@ busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, retry: psegs = segs; seg_count = 0; - if (n->m_next == NULL) { - busdma_map_mbuf_fast(tag, map, n, segs); - *nsegs = 1; - return (0); - } -#if defined(__i386__) || defined(__amd64__) - while (n && seg_count < TX_MAX_SEGS) { - /* - * firmware doesn't like empty segments - */ - if (__predict_true(n->m_len != 0)) { - seg_count++; - busdma_map_mbuf_fast(tag, map, n, psegs); - psegs++; - } - n = n->m_next; - } -#else err = bus_dmamap_load_mbuf_sg(tag, map, *m, segs, &seg_count, 0); -#endif if (seg_count == 0) { if (cxgb_debug) printf("empty segment chain\n"); @@ -117,8 +98,9 @@ void busdma_map_sg_vec(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf *m, bus_dma_segment_t *segs, int *nsegs) { + int n = 0; - for (*nsegs = 0; m != NULL ; segs++, *nsegs += 1, m = m->m_nextpkt) - busdma_map_mbuf_fast(tag, map, m, segs); + for (*nsegs = 0; m != NULL; segs += n, *nsegs += n, m = m->m_nextpkt) + bus_dmamap_load_mbuf_sg(tag, map, m, segs, &n, 0); } From owner-dev-commits-src-main@freebsd.org Sun Jan 31 18:41: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 1FFCC522855; Sun, 31 Jan 2021 18:41:19 +0000 (UTC) (envelope-from madpilot@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 4DTKfR0VX5z4SHn; Sun, 31 Jan 2021 18:41:19 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from ubik.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 73661497F; Sun, 31 Jan 2021 18:41:18 +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 References: <202101281825.10SIPTGJ021104@gitrepo.freebsd.org> From: Guido Falsi Message-ID: <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> Date: Sun, 31 Jan 2021 19:41:16 +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: <202101281825.10SIPTGJ021104@gitrepo.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: Sun, 31 Jan 2021 18:41:19 -0000 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 -- Guido Falsi From owner-dev-commits-src-main@freebsd.org Sun Jan 31 19:12: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 30DC8523A87; Sun, 31 Jan 2021 19:12:55 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 4DTLLt0WJ4z4W5J; Sun, 31 Jan 2021 19:12:53 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-ed1-f42.google.com with SMTP id n6so16399151edt.10; Sun, 31 Jan 2021 11:12:53 -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=YQvOybyGQtf5tTdd7cM49kh3e96lYO4jDEdFbwOKXE0=; b=SV+SU6MWC584DFsFbdG951nwOlVdpPv3+rUo4LcTyLzm6H7t9OPbE/uEO3tKwjuI26 zel+IbrMomUlW6V4DtwaTpbpu3QDKKdTLZQF7Yama06AUxEMWBa5AIKwJ8m47somu5Li qx1iTVPW4tlF0CfzVSfSmh7EoEsTZZdoxMWvYN3CO/pG4FVdQXSFJfST5nAY9GJjUHKS s963ma2orpGArZSrlYkPHmLl6XprZHY/l2EPJuYD9oV3UhaAnJ+LMGXPx7awYI6rK9Qi NM7c9JTAs+CKKw1MbxvkF+64GshGqHuZclWlxKUFgvwu1xkIFRZ3YplFMcbYHOJexE+4 /Zew== X-Gm-Message-State: AOAM533wuzt8M12S+IzAIkbEH5XKrmob+RJrCI4gE3cMUnUbEGhm7Zq7 zf2WU0q22QNFGi3+dDXqtWx7xmVMTg2w4cIBQhw1pknA X-Google-Smtp-Source: ABdhPJyRwRZ6VlXgqMWurE+Znh/GOTExy0TKU5PPGDlBuY2zQ/EoXIdfTw7PqhGH6crHbiWtq6ZmnTH2BAjBj+SBcfY= X-Received: by 2002:aa7:c390:: with SMTP id k16mr15135962edq.280.1612120372594; Sun, 31 Jan 2021 11:12:52 -0800 (PST) MIME-Version: 1.0 References: <202101071105.107B5tUX011254@gitrepo.freebsd.org> <20210110121242.1d9809ff@coosemans.org> In-Reply-To: <20210110121242.1d9809ff@coosemans.org> From: Antoine Brodin Date: Sun, 31 Jan 2021 20:12:42 +0100 Message-ID: Subject: Re: git: 7fa2f2a62f04 - main - Rename NO_WERROR -> MK_WERROR=no To: Alex Richardson 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: 4DTLLt0WJ4z4W5J X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of antoinebrodinfreebsd@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=antoinebrodinfreebsd@gmail.com X-Spamd-Result: default: False [-1.00 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.208.42:from]; RCPT_COUNT_FIVE(0.00)[5]; SPAMHAUS_ZRD(0.00)[209.85.208.42:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.42:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.42:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; 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: Sun, 31 Jan 2021 19:12:55 -0000 On Sun, Jan 10, 2021 at 12:12 PM T=C4=B3l Coosemans wr= ote: > > 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=3D7fa2f2a62f04f095e1e27ad5= 5aa22a8f59b1df8f > > > > 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 and > > MK_WERROR.gcc=3Dno to support the existing NO_WERROR. use= s. > > > > 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}=3Dn= o 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/mk > should always go through a ports exp-run IMHO. Ping Alex Richardson? Antoine (with hat: portmgr) From owner-dev-commits-src-main@freebsd.org Sun Jan 31 20:08: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 5777B5251EA; Sun, 31 Jan 2021 20:08: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 4DTMZy22ghz4Zxg; Sun, 31 Jan 2021 20:08: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 38B5F6593; Sun, 31 Jan 2021 20:08: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 10VK8Q9G095391; Sun, 31 Jan 2021 20:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VK8P2x095390; Sun, 31 Jan 2021 20:08:25 GMT (envelope-from git) Date: Sun, 31 Jan 2021 20:08:25 GMT Message-Id: <202101312008.10VK8P2x095390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: 10328f8b1123 - main - Merge commit '47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10328f8b112381e25e324688c8603caf4cee94ac 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, 31 Jan 2021 20:08:26 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=10328f8b112381e25e324688c8603caf4cee94ac commit 10328f8b112381e25e324688c8603caf4cee94ac Merge: 9dc7c250b8bd 47a52dc4d48f Author: Stefan Eßer AuthorDate: 2021-01-31 20:07:42 +0000 Commit: Stefan Eßer CommitDate: 2021-01-31 20:07:42 +0000 Merge commit '47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc' Update to version 3.2.6 MFC after: 3 days contrib/bc/.gitignore | 9 + contrib/bc/LICENSE.md | 52 ++- contrib/bc/Makefile.in | 122 ++++-- contrib/bc/NEWS.md | 35 ++ contrib/bc/NOTICE.md | 2 +- contrib/bc/README.md | 1 + contrib/bc/configure.sh | 348 +++++++++++++++--- contrib/bc/exec-install.sh | 2 +- contrib/bc/functions.sh | 90 +++-- contrib/bc/gen/bc_help.txt | 2 +- contrib/bc/gen/dc_help.txt | 2 +- contrib/bc/gen/lib.bc | 2 +- contrib/bc/gen/lib2.bc | 2 +- contrib/bc/gen/strgen.c | 4 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/args.h | 2 +- contrib/bc/include/bc.h | 2 +- contrib/bc/include/bcl.h | 2 +- contrib/bc/include/dc.h | 2 +- contrib/bc/include/file.h | 2 +- contrib/bc/include/history.h | 2 +- contrib/bc/include/lang.h | 2 +- contrib/bc/include/lex.h | 2 +- contrib/bc/include/library.h | 2 +- contrib/bc/include/num.h | 4 +- contrib/bc/include/opt.h | 2 +- contrib/bc/include/parse.h | 2 +- contrib/bc/include/program.h | 2 +- contrib/bc/include/rand.h | 31 +- contrib/bc/include/read.h | 2 +- contrib/bc/include/status.h | 14 +- contrib/bc/include/vector.h | 3 +- contrib/bc/include/vm.h | 19 +- contrib/bc/karatsuba.py | 2 +- contrib/bc/link.sh | 2 +- contrib/bc/locale_install.sh | 2 +- contrib/bc/locale_uninstall.sh | 2 +- contrib/bc/locales/de_DE.ISO8859-1.msg | 2 +- contrib/bc/locales/de_DE.UTF-8.msg | 2 +- contrib/bc/locales/en_US.msg | 2 +- contrib/bc/locales/es_ES.ISO8859-1.msg | 2 +- contrib/bc/locales/es_ES.UTF-8.msg | 2 +- contrib/bc/locales/fr_FR.ISO8859-1.msg | 2 +- contrib/bc/locales/fr_FR.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.eucJP.msg | 2 +- contrib/bc/locales/nl_NL.ISO8859-1.msg | 2 +- contrib/bc/locales/nl_NL.UTF-8.msg | 2 +- contrib/bc/locales/pl_PL.ISO8859-2.msg | 2 +- contrib/bc/locales/pl_PL.UTF-8.msg | 2 +- contrib/bc/locales/pt_PT.ISO8859-1.msg | 2 +- contrib/bc/locales/pt_PT.UTF-8.msg | 2 +- contrib/bc/locales/ru_RU.CP1251.msg | 2 +- contrib/bc/locales/ru_RU.CP866.msg | 2 +- contrib/bc/locales/ru_RU.ISO8859-5.msg | 2 +- contrib/bc/locales/ru_RU.KOI8-R.msg | 2 +- contrib/bc/locales/ru_RU.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.GB18030.msg | 2 +- contrib/bc/locales/zh_CN.GB2312.msg | 2 +- contrib/bc/locales/zh_CN.GBK.msg | 2 +- contrib/bc/locales/zh_CN.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.eucCN.msg | 2 +- contrib/bc/manpage.sh | 2 +- contrib/bc/manuals/bc.1.md.in | 7 +- contrib/bc/manuals/bc/A.1 | 8 +- contrib/bc/manuals/bc/A.1.md | 7 +- contrib/bc/manuals/bc/E.1 | 4 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 4 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 4 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EHNP.1 | 4 +- contrib/bc/manuals/bc/EHNP.1.md | 2 +- contrib/bc/manuals/bc/EHP.1 | 4 +- contrib/bc/manuals/bc/EHP.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 4 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/ENP.1 | 4 +- contrib/bc/manuals/bc/ENP.1.md | 2 +- contrib/bc/manuals/bc/EP.1 | 4 +- contrib/bc/manuals/bc/EP.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 8 +- contrib/bc/manuals/bc/H.1.md | 7 +- contrib/bc/manuals/bc/HN.1 | 8 +- contrib/bc/manuals/bc/HN.1.md | 7 +- contrib/bc/manuals/bc/HNP.1 | 8 +- contrib/bc/manuals/bc/HNP.1.md | 7 +- contrib/bc/manuals/bc/HP.1 | 8 +- contrib/bc/manuals/bc/HP.1.md | 7 +- contrib/bc/manuals/bc/N.1 | 8 +- contrib/bc/manuals/bc/N.1.md | 7 +- contrib/bc/manuals/bc/NP.1 | 8 +- contrib/bc/manuals/bc/NP.1.md | 7 +- contrib/bc/manuals/bc/P.1 | 8 +- contrib/bc/manuals/bc/P.1.md | 7 +- contrib/bc/manuals/bcl.3 | 4 +- contrib/bc/manuals/bcl.3.md | 2 +- contrib/bc/manuals/dc.1.md.in | 7 +- contrib/bc/manuals/dc/A.1 | 10 +- contrib/bc/manuals/dc/A.1.md | 7 +- contrib/bc/manuals/dc/E.1 | 4 +- contrib/bc/manuals/dc/E.1.md | 2 +- contrib/bc/manuals/dc/EH.1 | 4 +- contrib/bc/manuals/dc/EH.1.md | 2 +- contrib/bc/manuals/dc/EHN.1 | 4 +- contrib/bc/manuals/dc/EHN.1.md | 2 +- contrib/bc/manuals/dc/EHNP.1 | 4 +- contrib/bc/manuals/dc/EHNP.1.md | 2 +- contrib/bc/manuals/dc/EHP.1 | 4 +- contrib/bc/manuals/dc/EHP.1.md | 2 +- contrib/bc/manuals/dc/EN.1 | 4 +- contrib/bc/manuals/dc/EN.1.md | 2 +- contrib/bc/manuals/dc/ENP.1 | 4 +- contrib/bc/manuals/dc/ENP.1.md | 2 +- contrib/bc/manuals/dc/EP.1 | 4 +- contrib/bc/manuals/dc/EP.1.md | 2 +- contrib/bc/manuals/dc/H.1 | 10 +- contrib/bc/manuals/dc/H.1.md | 7 +- contrib/bc/manuals/dc/HN.1 | 10 +- contrib/bc/manuals/dc/HN.1.md | 7 +- contrib/bc/manuals/dc/HNP.1 | 10 +- contrib/bc/manuals/dc/HNP.1.md | 7 +- contrib/bc/manuals/dc/HP.1 | 10 +- contrib/bc/manuals/dc/HP.1.md | 7 +- contrib/bc/manuals/dc/N.1 | 10 +- contrib/bc/manuals/dc/N.1.md | 7 +- contrib/bc/manuals/dc/NP.1 | 10 +- contrib/bc/manuals/dc/NP.1.md | 7 +- contrib/bc/manuals/dc/P.1 | 10 +- contrib/bc/manuals/dc/P.1.md | 7 +- contrib/bc/manuals/header.txt | 2 +- contrib/bc/manuals/header_bc.txt | 2 +- contrib/bc/manuals/header_bcl.txt | 2 +- contrib/bc/manuals/header_dc.txt | 2 +- contrib/bc/release.sh | 18 +- contrib/bc/src/args.c | 2 +- contrib/bc/src/bc.c | 2 +- contrib/bc/src/bc_lex.c | 2 +- contrib/bc/src/bc_parse.c | 2 +- contrib/bc/src/data.c | 4 +- contrib/bc/src/dc.c | 2 +- contrib/bc/src/dc_lex.c | 6 +- contrib/bc/src/dc_parse.c | 2 +- contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 15 +- contrib/bc/src/lang.c | 14 +- contrib/bc/src/lex.c | 4 +- contrib/bc/src/library.c | 12 +- contrib/bc/src/main.c | 13 +- contrib/bc/src/num.c | 10 +- contrib/bc/src/opt.c | 2 +- contrib/bc/src/parse.c | 8 +- contrib/bc/src/program.c | 31 +- contrib/bc/src/rand.c | 42 +-- contrib/bc/src/read.c | 6 +- contrib/bc/src/vector.c | 8 +- contrib/bc/src/vm.c | 86 ++++- contrib/bc/tests/afl.py | 22 +- contrib/bc/tests/all.sh | 191 +--------- contrib/bc/tests/bc/all.txt | 6 +- contrib/bc/tests/bc/scripts/all.txt | 15 + contrib/bc/tests/bc/timeconst.sh | 9 +- contrib/bc/tests/bcl.c | 2 +- contrib/bc/tests/dc/errors/30.txt | 1 + contrib/bc/tests/dc/errors/31.txt | 1 + contrib/bc/tests/dc/scripts/all.txt | 9 + contrib/bc/tests/diff.sh | 51 +++ contrib/bc/tests/errors.sh | 20 +- contrib/bc/tests/extra_required.txt | 7 + contrib/bc/tests/fuzzing/bc.dict | 68 ++++ contrib/bc/tests/fuzzing/bc_inputs1/abs.txt | 7 + contrib/bc/tests/fuzzing/bc_inputs1/add.txt | 146 ++++++++ contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt | 26 ++ contrib/bc/tests/fuzzing/bc_inputs1/array.bc | 60 +++ contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt | 10 + .../bc/tests/fuzzing/bc_inputs1/assignments.txt | 122 ++++++ contrib/bc/tests/fuzzing/bc_inputs1/basic.txt | 7 + contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt | 184 ++++++++++ contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt | 44 +++ contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt | 35 ++ contrib/bc/tests/fuzzing/bc_inputs1/divide.txt | 31 ++ .../bc/tests/fuzzing/bc_inputs1/engineering.txt | 19 + contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt | 22 ++ contrib/bc/tests/fuzzing/bc_inputs1/functions.bc | 7 + contrib/bc/tests/fuzzing/bc_inputs1/functions.txt | 13 + contrib/bc/tests/fuzzing/bc_inputs1/globals.txt | 21 ++ contrib/bc/tests/fuzzing/bc_inputs1/len.bc | 48 +++ contrib/bc/tests/fuzzing/bc_inputs1/length.txt | 59 +++ contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt | 15 + contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt | 6 + contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt | 10 + contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt | 5 + contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/log.txt | 22 ++ contrib/bc/tests/fuzzing/bc_inputs2/misc.txt | 13 + contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt | 76 ++++ contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt | 110 ++++++ contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt | 69 ++++ contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt | 40 ++ contrib/bc/tests/fuzzing/bc_inputs2/pi.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs2/places.txt | 19 + contrib/bc/tests/fuzzing/bc_inputs2/power.txt | 44 +++ contrib/bc/tests/fuzzing/bc_inputs2/print2.txt | 194 ++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/references.bc | 408 +++++++++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/scale.txt | 57 +++ contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt | 51 +++ contrib/bc/tests/fuzzing/bc_inputs2/shift.txt | 281 ++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/sine.txt | 207 +++++++++++ contrib/bc/tests/fuzzing/bc_inputs3/01.txt | 339 +++++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs3/02.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/03.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/04.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/05.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/06.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/07.txt | 8 + contrib/bc/tests/fuzzing/bc_inputs3/08.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/09.txt | 11 + contrib/bc/tests/fuzzing/bc_inputs3/10.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/11.txt | 99 +++++ contrib/bc/tests/fuzzing/bc_inputs3/12.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/13.txt | 56 +++ contrib/bc/tests/fuzzing/bc_inputs3/14.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/15.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/16.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/17.txt | 11 + contrib/bc/tests/fuzzing/bc_inputs3/18.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/19.txt | 5 + contrib/bc/tests/fuzzing/bc_inputs3/20.txt | 51 +++ contrib/bc/tests/fuzzing/bc_inputs3/21.txt | 10 + contrib/bc/tests/fuzzing/bc_inputs3/22.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/23.txt | Bin 0 -> 1024 bytes contrib/bc/tests/fuzzing/bc_inputs3/24.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt | 14 + contrib/bc/tests/fuzzing/bc_inputs3/strings.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt | 153 ++++++++ contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt | 15 + contrib/bc/tests/fuzzing/bc_inputs3/void.txt | 20 + contrib/bc/tests/fuzzing/dc_inputs/01.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/02.txt | 5 + contrib/bc/tests/fuzzing/dc_inputs/03.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/04.txt | 9 + contrib/bc/tests/fuzzing/dc_inputs/05.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/06.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/07.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/08.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/09.txt | 9 + contrib/bc/tests/fuzzing/dc_inputs/10.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/11.txt | 4 + contrib/bc/tests/fuzzing/dc_inputs/12.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/13.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/14.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/15.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/16.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/17.txt | 20 + contrib/bc/tests/fuzzing/dc_inputs/18.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/19.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/20.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/21.txt | 5 + contrib/bc/tests/fuzzing/dc_inputs/22.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/23.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/24.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/25.txt | 6 + contrib/bc/tests/fuzzing/dc_inputs/26.txt | 155 ++++++++ contrib/bc/tests/fuzzing/dc_inputs/27.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/28.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/29.txt | 13 + contrib/bc/tests/fuzzing/dc_inputs/30.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/31.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/abs.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/add.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/array.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/boolean.txt | 80 ++++ contrib/bc/tests/fuzzing/dc_inputs/decimal.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/divide.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/divmod.txt | 64 ++++ contrib/bc/tests/fuzzing/dc_inputs/else.dc | 4 + contrib/bc/tests/fuzzing/dc_inputs/engineering.txt | 19 + contrib/bc/tests/fuzzing/dc_inputs/loop.dc | 3 + contrib/bc/tests/fuzzing/dc_inputs/misc.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/modexp.txt | 103 ++++++ contrib/bc/tests/fuzzing/dc_inputs/modulus.txt | 70 ++++ contrib/bc/tests/fuzzing/dc_inputs/multiply.txt | 42 +++ contrib/bc/tests/fuzzing/dc_inputs/places.txt | 14 + contrib/bc/tests/fuzzing/dc_inputs/power.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/quit.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/scientific.txt | 51 +++ contrib/bc/tests/fuzzing/dc_inputs/shift.txt | 42 +++ contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt | 14 + contrib/bc/tests/fuzzing/dc_inputs/stdin.txt | 205 +++++++++++ contrib/bc/tests/fuzzing/dc_inputs/stream.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/strings.txt | 50 +++ contrib/bc/tests/fuzzing/dc_inputs/subtract.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/trunc.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/vars.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/weird.dc | 2 + contrib/bc/tests/other.sh | 271 ++++++++++++++ contrib/bc/tests/radamsa.sh | 2 +- contrib/bc/tests/randmath.py | 2 +- contrib/bc/tests/read.sh | 23 +- contrib/bc/tests/script.sh | 26 +- contrib/bc/tests/scripts.sh | 9 +- contrib/bc/tests/stdin.sh | 23 +- contrib/bc/tests/test.sh | 32 +- 320 files changed, 6246 insertions(+), 712 deletions(-) diff --cc contrib/bc/.gitignore index fb9bc5ab6aa2,000000000000..5c2bbae866c0 mode 100644,000000..100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@@ -1,61 -1,0 +1,70 @@@ +*.config +*.creator +*.files +*.includes +*.creator.user* +*.cflags +*.cxxflags +bin/*bc +bin/*bc.exe +bin/*dc +bin/*dc.exe +bin/bcl +bc.old +*.o +*.a +.log_*.txt +.test.txt +.math.txt +.results.txt +.ops.txt +manuals/bc.1 +manuals/bc.1.ronn +manuals/bc.1.md +manuals/dc.1 +manuals/dc.1.ronn +manuals/dc.1.md +gen/strgen +lib.c +lib2.c +lib3.c +bc_help.c +dc_help.c +config.mak +timeconst.bc +Makefile + ++tests/fuzzing/bc_outputs1/* ++tests/fuzzing/bc_outputs2/* ++tests/fuzzing/bc_outputs3/* ++tests/fuzzing/dc_outputs/* ++tests/bc_outputs/* ++tests/dc_outputs/* ++ +.gdb_history + +# Ignore the generated test files +parse.txt +parse_results.txt +print.txt +print_results.txt +bessel.txt +bessel_results.txt +prime.txt +stream.txt +tests/bc/scripts/add.txt +tests/bc/scripts/divide.txt +tests/bc/scripts/multiply.txt +tests/bc/scripts/subtract.txt +perf.data +perf.data.old +*.gcda +*.gcno +*.gcov +*.html +*.profraw + ++core.* ++ +cscope*.out +tags diff --cc contrib/bc/README.md index 6f3c3f252cbc,000000000000..beda88d23f90 mode 100644,000000..100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@@ -1,347 -1,0 +1,348 @@@ +# `bc` + +[![Coverity Scan Build Status][17]][18] + +***WARNING: This project has moved to [https://git.yzena.com/][20] for [these +reasons][21], though GitHub will remain a mirror.*** + +This is an implementation of the [POSIX `bc` calculator][12] that implements +[GNU `bc`][1] extensions, as well as the period (`.`) extension for the BSD +flavor of `bc`. + +For more information, see this `bc`'s full manual. + +This `bc` also includes an implementation of `dc` in the same binary, accessible +via a symbolic link, which implements all FreeBSD and GNU extensions. (If a +standalone `dc` binary is desired, `bc` can be copied and renamed to `dc`.) The +`!` command is omitted; I believe this poses security concerns and that such +functionality is unnecessary. + +For more information, see the `dc`'s full manual. + +This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD +2-clause License. Full license text may be found in the [`LICENSE.md`][4] file. + +## Prerequisites + +This `bc` only requires a C99-compatible compiler and a (mostly) POSIX +2008-compatible system with the XSI (X/Open System Interfaces) option group. + +Since POSIX 2008 with XSI requires the existence of a C99 compiler as `c99`, any +POSIX and XSI-compatible system will have everything needed. + +Systems that are known to work: + +* Linux +* FreeBSD +* OpenBSD +* NetBSD +* Mac OSX +* Solaris* (as long as the Solaris version supports POSIX 2008) +* AIX ++* HP-UX* (except for history) + +Please submit bug reports if this `bc` does not build out of the box on any +system besides Windows. If Windows binaries are needed, they can be found at +[xstatic][6]. + +## Build + +This `bc` should build unmodified on any POSIX-compliant system. + +For more complex build requirements than the ones below, see the +[build manual][5]. + +### Pre-built Binaries + +It is possible to download pre-compiled binaries for a wide list of platforms, +including Linux- and Windows-based systems, from [xstatic][6]. This link always +points to the latest release of `bc`. + +### Default + +For the default build with optimization, use the following commands in the root +directory: + +``` +./configure.sh -O3 +make +``` + +### One Calculator + +To only build `bc`, use the following commands: + +``` +./configure.sh --disable-dc +make +``` + +To only build `dc`, use the following commands: + +``` +./configure.sh --disable-bc +make +``` + +### Debug + +For debug builds, use the following commands in the root directory: + +``` +./configure.sh -g +make +``` + +### Install + +To install, use the following command: + +``` +make install +``` + +By default, `bc` and `dc` will be installed in `/usr/local`. For installing in +other locations, use the `PREFIX` environment variable when running +`configure.sh` or pass the `--prefix=` option to `configure.sh`. See the +[build manual][5], or run `./configure.sh --help`, for more details. + +### Library + +This `bc` does provide a way to build a math library with C bindings. This is +done by the `-a` or `--library` options to `configure.sh`: + +``` +./configure.sh -a +``` + +When building the library, the executables are not built. For more information, +see the [build manual][5]. + +The library API can be found in [`manuals/bcl.3.md`][26] or `man bcl` once the +library is installed. + +The library is built as `bin/libbcl.a`. + +### Package and Distro Maintainers + +#### Recommended Compiler + +When I ran benchmarks with my `bc` compiled under `clang`, it performed much +better than when compiled under `gcc`. I recommend compiling this `bc` with +`clang`. + +I also recommend building this `bc` with C11 if you can because `bc` will detect +a C11 compiler and add `_Noreturn` to any relevant function(s). + +#### Recommended Optimizations + +I wrote this `bc` with Separation of Concerns, which means that there are many +small functions that could be inlined. However, they are often called across +file boundaries, and the default optimizer can only look at the current file, +which means that they are not inlined. + +Thus, because of the way this `bc` is built, it will automatically be slower +than other `bc` implementations when running scripts with no math. (My `bc`'s +math is *much* faster, so any non-trivial script should run faster in my `bc`.) + +Some, or all, of the difference can be made up with the right optimizations. The +optimizations I recommend are: + +1. `-O3` +2. `-flto` (link-time optimization) + +in that order. + +Link-time optimization, in particular, speeds up the `bc` a lot. This is because +when link-time optimization is turned on, the optimizer can look across files +and inline *much* more heavily. + +However, I recommend ***NOT*** using `-march=native`. Doing so will reduce this +`bc`'s performance, at least when building with link-time optimization. See the +[benchmarks][19] for more details. + +#### Stripping Binaries + +By default, non-debug binaries are stripped, but stripping can be disabled with +the `-T` option to `configure.sh`. + +#### Using This `bc` as an Alternative + +If this `bc` is packaged as an alternative to an already existing `bc` package, +it is possible to rename it in the build to prevent name collision. To prepend +to the name, just run the following: + +``` +EXECPREFIX= ./configure.sh +``` + +To append to the name, just run the following: + +``` +EXECSUFFIX= ./configure.sh +``` + +If a package maintainer wishes to add both a prefix and a suffix, that is +allowed. + +**Note**: The suggested name (and package name) when `bc` is not available is +`bc-gh`. + +#### Karatsuba Number + +Package and distro maintainers have one tool at their disposal to build this +`bc` in the optimal configuration: `karatsuba.py`. + +This script is not a compile-time or runtime prerequisite; it is for package and +distro maintainers to run once when a package is being created. It finds the +optimal Karatsuba number (see the [algorithms manual][7] for more information) +for the machine that it is running on. + +The easiest way to run this script is with `make karatsuba`. + +If desired, maintainers can also skip running this script because there is a +sane default for the Karatsuba number. + +## Status + +This `bc` is robust. + +It is well-tested, fuzzed, and fully standards-compliant (though not certified) +with POSIX `bc`. The math has been tested with 40+ million random problems, so +it is as correct as I can make it. + +This `bc` can be used as a drop-in replacement for any existing `bc`. This `bc` +is also compatible with MinGW toolchains, though history is not supported on +Windows. + +In addition, this `bc` is considered complete; i.e., there will be no more +releases with additional features. However, it *is* actively maintained, so if +any bugs are found, they will be fixed in new releases. Also, additional +translations will also be added as they are provided. + +## Comparison to GNU `bc` + +This `bc` compares favorably to GNU `bc`. + +* It has more extensions, which make this `bc` more useful for scripting. +* This `bc` is a bit more POSIX compliant. +* It has a much less buggy parser. The GNU `bc` will give parse errors for what + is actually valid `bc` code, or should be. For example, putting an `else` on + a new line after a brace can cause GNU `bc` to give a parse error. +* This `bc` has fewer crashes. +* GNU `bc` calculates the wrong number of significant digits for `length(x)`. +* GNU `bc` will sometimes print numbers incorrectly. For example, when running + it on the file `tests/bc/power.txt` in this repo, GNU `bc` gets all the right + answers, but it fails to wrap the numbers at the proper place when outputting + to a file. +* This `bc` is faster. (See [Performance](#performance).) + +### Performance + +Because this `bc` packs more than `1` decimal digit per hardware integer, this +`bc` is faster than GNU `bc` and can be *much* faster. Full benchmarks can be +found at [manuals/benchmarks.md][19]. + +There is one instance where this `bc` is slower: if scripts are light on math. +This is because this `bc`'s intepreter is slightly slower than GNU `bc`, but +that is because it is more robust. See the [benchmarks][19]. + +## Algorithms + +To see what algorithms this `bc` uses, see the [algorithms manual][7]. + +## Locales + +Currently, this `bc` only has support for English (and US English), French, +German, Portuguese, Dutch, Polish, Russian, Japanese, and Chinese locales. +Patches are welcome for translations; use the existing `*.msg` files in +`locales/` as a starting point. + +In addition, patches for improvements are welcome; the last two messages in +Portuguese were made with Google Translate, and the Dutch, Polish, Russian, +Japanese, and Chinese locales were all generated with [DeepL][22]. + +The message files provided assume that locales apply to all regions where a +language is used, but this might not be true for, e.g., `fr_CA` and `fr_CH`. +Any corrections or a confirmation that the current texts are acceptable for +those regions would be appreciated, too. + +## Other Projects + +Other projects based on this bc are: + +* [busybox `bc`][8]. The busybox maintainers have made their own changes, so any + bugs in the busybox `bc` should be reported to them. + +* [toybox `bc`][9]. The maintainer has also made his own changes, so bugs in the + toybox `bc` should be reported there. + +* [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better + to [report bugs there][24], as well as [submit patches][25], and the + maintainers of the package will contact me if necessary. + +## Language + +This `bc` is written in pure ISO C99, using POSIX 2008 APIs. + +## Commit Messages + +This `bc` uses the commit message guidelines laid out in [this blog post][10]. + +## Semantic Versioning + +This `bc` uses [semantic versioning][11]. + +## Contents + +Items labeled with `(maintainer use only)` are not included in release source +tarballs. + +Files: + + .gitignore The git ignore file (maintainer use only). + configure A symlink to configure.sh to make packaging easier. + configure.sh The configure script. + functions.sh A script with functions used by other scripts. + install.sh Install script. + karatsuba.py Script to find the optimal Karatsuba number. + LICENSE.md A Markdown form of the BSD 2-clause License. + link.sh A script to link dc to bc. + locale_install.sh A script to install locales, if desired. + locale_uninstall.sh A script to uninstall locales. + Makefile.in The Makefile template. + manpage.sh Script to generate man pages from markdown files. + NOTICE.md List of contributors and copyright owners. + RELEASE.md A checklist for making a release (maintainer use only). + release.sh A script to test for release (maintainer use only). + safe-install.sh Safe install script from musl libc. + +Folders: + + gen The bc math library, help texts, and code to generate C source. + include All header files. + locales Locale files, in .msg format. Patches welcome for translations. + manuals Manuals for both programs. + src All source code. + tests All tests. + +[1]: https://www.gnu.org/software/bc/ +[4]: ./LICENSE.md +[5]: ./manuals/build.md +[6]: https://pkg.musl.cc/bc/ +[7]: ./manuals/algorithms.md +[8]: https://git.busybox.net/busybox/tree/miscutils/bc.c +[9]: https://github.com/landley/toybox/blob/master/toys/pending/bc.c +[10]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +[11]: http://semver.org/ +[12]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html +[17]: https://img.shields.io/coverity/scan/16609.svg +[18]: https://scan.coverity.com/projects/gavinhoward-bc +[19]: ./manuals/benchmarks.md +[20]: https://git.yzena.com/gavin/bc +[21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ +[22]: https://www.deepl.com/translator +[23]: https://svnweb.freebsd.org/base/head/contrib/bc/ +[24]: https://bugs.freebsd.org/ +[25]: https://reviews.freebsd.org/ +[26]: ./manuals/bcl.3.md diff --cc contrib/bc/tests/bc/scripts/all.txt index 000000000000,16f067c13b79..16f067c13b79 mode 000000,100644..100644 --- a/contrib/bc/tests/bc/scripts/all.txt +++ b/contrib/bc/tests/bc/scripts/all.txt diff --cc contrib/bc/tests/dc/errors/30.txt index 000000000000,e072e71617d8..e072e71617d8 mode 000000,100644..100644 --- a/contrib/bc/tests/dc/errors/30.txt +++ b/contrib/bc/tests/dc/errors/30.txt diff --cc contrib/bc/tests/dc/errors/31.txt index 000000000000,9bada9d07d0e..9bada9d07d0e mode 000000,100644..100644 --- a/contrib/bc/tests/dc/errors/31.txt +++ b/contrib/bc/tests/dc/errors/31.txt diff --cc contrib/bc/tests/dc/scripts/all.txt index 000000000000,e15dae5e15ff..e15dae5e15ff mode 000000,100644..100644 --- a/contrib/bc/tests/dc/scripts/all.txt +++ b/contrib/bc/tests/dc/scripts/all.txt diff --cc contrib/bc/tests/diff.sh index 000000000000,6d664a8a81b8..6d664a8a81b8 mode 000000,100755..100755 --- a/contrib/bc/tests/diff.sh +++ b/contrib/bc/tests/diff.sh diff --cc contrib/bc/tests/extra_required.txt index 000000000000,a87a9a0aacf2..a87a9a0aacf2 mode 000000,100644..100644 --- a/contrib/bc/tests/extra_required.txt +++ b/contrib/bc/tests/extra_required.txt diff --cc contrib/bc/tests/fuzzing/bc.dict index 000000000000,f4dc965844e1..f4dc965844e1 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc.dict +++ b/contrib/bc/tests/fuzzing/bc.dict diff --cc contrib/bc/tests/fuzzing/bc_inputs1/abs.txt index 000000000000,ffb7aba65c3b..ffb7aba65c3b mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/abs.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/abs.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/add.txt index 000000000000,647781732c63..647781732c63 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/add.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/add.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt index 000000000000,f665ea90b728..f665ea90b728 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/array.bc index 000000000000,dac232804914..dac232804914 mode 000000,100755..100755 --- a/contrib/bc/tests/fuzzing/bc_inputs1/array.bc +++ b/contrib/bc/tests/fuzzing/bc_inputs1/array.bc diff --cc contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt index 000000000000,26a284b8d814..26a284b8d814 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/assignments.txt index 000000000000,6a776e7840ec..6a776e7840ec mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/assignments.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/assignments.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/basic.txt index 000000000000,f3d957a26635..f3d957a26635 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/basic.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/basic.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt index 000000000000,e26ded34bd1d..e26ded34bd1d mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt index 000000000000,9e67df4c6f69..9e67df4c6f69 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt index 000000000000,5c6bd327c1a8..5c6bd327c1a8 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/divide.txt index 000000000000,4d0caddc9b52..4d0caddc9b52 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/divide.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/divide.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/engineering.txt index 000000000000,cf9c0c1b0117..cf9c0c1b0117 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/engineering.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/engineering.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt index 000000000000,40bcf3c5a585..40bcf3c5a585 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/functions.bc index 000000000000,80d6d1623d8d..80d6d1623d8d mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/functions.bc +++ b/contrib/bc/tests/fuzzing/bc_inputs1/functions.bc diff --cc contrib/bc/tests/fuzzing/bc_inputs1/functions.txt index 000000000000,5e540ed66a11..5e540ed66a11 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/functions.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/functions.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/globals.txt index 000000000000,4b20f5725864..4b20f5725864 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/globals.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/globals.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/len.bc index 000000000000,ec931f2386a5..ec931f2386a5 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/len.bc +++ b/contrib/bc/tests/fuzzing/bc_inputs1/len.bc diff --cc contrib/bc/tests/fuzzing/bc_inputs1/length.txt index 000000000000,48f83c95cf55..48f83c95cf55 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/length.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/length.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt index 000000000000,7aa3fda19cc7..7aa3fda19cc7 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt index 000000000000,5bb262bd2668..5bb262bd2668 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt index 000000000000,7d70e1ccdd5e..7d70e1ccdd5e mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt index 000000000000,f345bd1669cb..f345bd1669cb mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt index 000000000000,1da42385ea44..1da42385ea44 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt index 000000000000,9f5323375d30..9f5323375d30 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt index 000000000000,c69a49167292..c69a49167292 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt index 000000000000,260e159f9fb6..260e159f9fb6 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt index 000000000000,edd66a40e83a..edd66a40e83a mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt index 000000000000,a4cc720c4754..a4cc720c4754 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt index 000000000000,f7957ddc81fb..f7957ddc81fb mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt index 000000000000,a07d4730c269..a07d4730c269 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt index 000000000000,13be33145ba3..13be33145ba3 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt index 000000000000,de8dff5e7fee..de8dff5e7fee mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt index 000000000000,95fdd40264fa..95fdd40264fa mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt index 000000000000,8872f9b5f8e1..8872f9b5f8e1 mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt index 000000000000,82693695945d..82693695945d mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt index 000000000000,438575ef5b7c..438575ef5b7c mode 000000,100644..100644 --- a/contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt diff --cc contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt index 000000000000,df3d64009e79..df3d64009e79 mode 000000,100644..100644 *** 526 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sun Jan 31 21:36: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 D4BC14E84C6; Sun, 31 Jan 2021 21:36: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 4DTPXs5flvz4jN9; Sun, 31 Jan 2021 21:36: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 B4F6C7820; Sun, 31 Jan 2021 21:36: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 10VLajW9012788; Sun, 31 Jan 2021 21:36:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VLajMA012787; Sun, 31 Jan 2021 21:36:45 GMT (envelope-from git) Date: Sun, 31 Jan 2021 21:36:45 GMT Message-Id: <202101312136.10VLajMA012787@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: cb6962124959 - main - msdosfs: fix double unlock if the source file disappears 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: cb696212495995c8374d9fe12fbae340614af45c 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, 31 Jan 2021 21:36:45 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=cb696212495995c8374d9fe12fbae340614af45c commit cb696212495995c8374d9fe12fbae340614af45c Author: Edward Tomasz Napierala AuthorDate: 2021-01-31 21:07:02 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-01-31 21:35:34 +0000 msdosfs: fix double unlock if the source file disappears We would unlock fvp here, only to unlock it again below, just before "bad". Reviewed By: kib Tested by: pho Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27339 --- sys/fs/msdosfs/msdosfs_vnops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index b940633e0cfd..e1e679d92146 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1139,7 +1139,6 @@ abortit: if (xp != ip) { if (doingdirectory) panic("rename: lost dir entry"); - VOP_UNLOCK(fvp); if (newparent) VOP_UNLOCK(fdvp); vrele(ap->a_fvp); From owner-dev-commits-src-main@freebsd.org Sun Jan 31 21:41: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 139D24E852E; Sun, 31 Jan 2021 21:41: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 4DTPdq06N7z4jTF; Sun, 31 Jan 2021 21:41: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 EAEAE76E2; Sun, 31 Jan 2021 21:41: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 10VLf2Ad021847; Sun, 31 Jan 2021 21:41:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VLf2D0021846; Sun, 31 Jan 2021 21:41:02 GMT (envelope-from git) Date: Sun, 31 Jan 2021 21:41:02 GMT Message-Id: <202101312141.10VLf2D0021846@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: b8073b3c7434 - main - msdosfs: fix vnode leak with msdosfs_rename() 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: b8073b3c74342113398f36a1c68f442ae9e092e6 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, 31 Jan 2021 21:41:03 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=b8073b3c74342113398f36a1c68f442ae9e092e6 commit b8073b3c74342113398f36a1c68f442ae9e092e6 Author: Edward Tomasz Napierala AuthorDate: 2021-01-31 21:37:41 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-01-31 21:37:44 +0000 msdosfs: fix vnode leak with msdosfs_rename() This could happen when failing due to disappearing source file. Reviewed By: kib Tested by: pho Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27338 --- sys/fs/msdosfs/msdosfs_vnops.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index e1e679d92146..8885ac856588 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1122,6 +1122,14 @@ abortit: VOP_UNLOCK(tdvp); vrele(tdvp); vrele(ap->a_fvp); + /* + * fdvp may be locked and has a reference. We need to + * release the lock and reference, unless to and from + * directories are the same. In that case it is already + * unlocked. + */ + if (tdvp != fdvp) + vput(fdvp); return 0; } xp = VTODE(fvp); From owner-dev-commits-src-main@freebsd.org Sun Jan 31 21:43: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 126314E89C2; Sun, 31 Jan 2021 21:43: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 4DTPht02tqz4jXn; Sun, 31 Jan 2021 21:43: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 E8ACE7C86; Sun, 31 Jan 2021 21:43: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 10VLhfhs025432; Sun, 31 Jan 2021 21:43:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VLhfV5025431; Sun, 31 Jan 2021 21:43:41 GMT (envelope-from git) Date: Sun, 31 Jan 2021 21:43:41 GMT Message-Id: <202101312143.10VLhfV5025431@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: 5299d64b2b9f - main - libc: fix buffer overrun in getrpcport(3) 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: 5299d64b2b9f7a25e423ef1785d9402a0ef198d3 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, 31 Jan 2021 21:43:42 -0000 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, From owner-dev-commits-src-main@freebsd.org Sun Jan 31 21:44: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 E570D4E8A03; Sun, 31 Jan 2021 21:44: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 4DTPkL6Cr1z4jhB; Sun, 31 Jan 2021 21:44: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 C8A817C89; Sun, 31 Jan 2021 21:44: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 10VLiwqo025788; Sun, 31 Jan 2021 21:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VLiwhn025787; Sun, 31 Jan 2021 21:44:58 GMT (envelope-from git) Date: Sun, 31 Jan 2021 21:44:58 GMT Message-Id: <202101312144.10VLiwhn025787@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: e0a0a3efcb09 - main - mips: fix early kernel panic when setting up interrupt counters 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: e0a0a3efcb09a10ad1de29aca622ea580b2663d2 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, 31 Jan 2021 21:44:59 -0000 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 From owner-dev-commits-src-main@freebsd.org Sun Jan 31 21:55: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 18B7F4E9225 for ; Sun, 31 Jan 2021 21:55:59 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 4DTPz26QMkz4kjk for ; Sun, 31 Jan 2021 21:55:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82e.google.com with SMTP id h16so9832730qth.11 for ; Sun, 31 Jan 2021 13:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vAWpVGcIgfLQ5Bz9hHmMZl6TD56Y1KPlsa0+PO1sPzE=; b=TEi2FlsnpZpRMw9wX06ntvskpDTWn8ZL1r9+3kBjwMrgCs0vWaOI2L4ap9iFR8yOlO p51La7C61mVa5JuzK/7b79g35EHRox3lCjd+PvtGvMPrzicMixAFF5B8IGcgVQkyUZcn dx6Sq7wR135RVYjxaxZz1MbRQjdE0ywEwgGPEt5VGs56KxNAjSyrbX/s47ksYUX+Jsn8 x1kGRxuIe0UGdFiZ3NOcshm7OnIs7KZvYg8u2Y/Yej2QxuDAQyR/0hhZacjSv5v+X6tM aH4cHQlXWHm2GiOTqJ3DbJVNVfPZXuwDwmVCbeIpZ/6DLSymRspX+ywm1mvG+mBbu/wY 4ZjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vAWpVGcIgfLQ5Bz9hHmMZl6TD56Y1KPlsa0+PO1sPzE=; b=o42sHmmoIrv7ya6jECCi5pBzWUywC5LJpjWkI5qIoJL7Zvxhqn27XG4ATYtDGrqhMu 8bXXL9jzZY8yOPBYKlMu6DImbBXO8TSPMDcuohUSm39ilIbdBiFkwrO7tKdJshYbrM4i Hm+HeaR9HKdhEUmTr5XZatkPFkrEV02zMXCoCLCSjwOPdVYibml4xWlnIwGO83WXhvzH ylaB4h8oHYLfv22M61W1xEyZV5unsnu7AM017xJ5wzLocy+4nniRatpUS6ftD6HE1Ooy sp3QhQPoS3yU8xh8zlMRVMKs1WhNSSNmcSPH3rNpGuk70mWaIROS4i6cPMmWfeENTwX4 DPPg== X-Gm-Message-State: AOAM531wGcAUqeZxk0coAUNlHpVGAeCWir0ulsZLxyhgC0CKVoEhuJk1 mWH1oLzoUsWmzqpuWanzELaL/g== X-Google-Smtp-Source: ABdhPJy7HxOrQvU87OH3rC58rwlTn2mUElzNKUc2qhEKu9w/K5EaYIUXKTrFxtJSJI+GVOcf9Ra3sw== X-Received: by 2002:ac8:59cb:: with SMTP id f11mr12791591qtf.70.1612130158030; Sun, 31 Jan 2021 13:55:58 -0800 (PST) Received: from mutt-hbsd (pool-100-16-222-53.bltmmd.fios.verizon.net. [100.16.222.53]) by smtp.gmail.com with ESMTPSA id x72sm12557256qka.51.2021.01.31.13.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 13:55:57 -0800 (PST) Date: Sun, 31 Jan 2021 16:55:56 -0500 From: Shawn Webb To: Edward Tomasz Napierala 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: <20210131215556.eautrr6esynyic6f@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA References: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b3ey7svlnh3emv3f" Content-Disposition: inline In-Reply-To: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4DTPz26QMkz4kjk 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, 31 Jan 2021 21:55:59 -0000 --b3ey7svlnh3emv3f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 31, 2021 at 09:43:41PM +0000, Edward Tomasz Napierala wrote: > The branch main has been updated by trasz: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5299d64b2b9f7a25e423ef1785= d9402a0ef198d3 >=20 > 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 >=20 > libc: fix buffer overrun in getrpcport(3) > =20 > 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(-) >=20 > 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) > =20 > assert(host !=3D NULL); > =20 > - if ((hp =3D gethostbyname(host)) =3D=3D NULL) > + if ((hp =3D gethostbyname2(host, AF_INET)) =3D=3D NULL) > return (0); > memset(&addr, 0, sizeof(addr)); > addr.sin_len =3D sizeof(struct sockaddr_in); > addr.sin_family =3D AF_INET; > addr.sin_port =3D 0; > - if (hp->h_length > addr.sin_len) > - hp->h_length =3D addr.sin_len; > + if (hp->h_length > sizeof(addr.sin_addr.s_addr)) > + hp->h_length =3D 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,=20 Does a fix like this need to get a security advisory report? Also, any plans to MFC? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sha= wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --b3ey7svlnh3emv3f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmAXJ2oACgkQ/y5nonf4 4fqAnQ//Uq4QsTUWHsP4aIGXH49HsRNCRJuoe38tzDoVUlLgaqM1PfITAlehNCoe n/ZVHSMH6bby2CbgsQCGBpx1QqDpyle3N6BDjHzBhL+N8GLxzxuYLbpJ+Fmb7E1R QFxZ9dtQlQvSKJzt5+mvksxBHfPxUayOF7ObX88rHq+i+o3Ho7jfVu65T17DOBYa gj6E/P3MgB7zinGdk72AqH/c4Y47J6zUSdD3CK6Hgo1fg5pBWJHON7AV08P2TkUN Nuj70tFQlUtIu3WMR3X5IZs2O2PSmjFLNOa4KCkqAn/AnMcs0RyGEflpoCmvN462 Vx/7tHJiKzPa583/+2Z6LNc8GVQLUTZH8IVYKenWtELHhA/S8E9F0yFX5Cs0TAQs 7hdfNFn+tVhZpeE1jp1x1+E1B8vET0uzJaOWacDdKkyQZ/BoS/J/HeUTctawWmWs JZo9xB09M9kUD0ZFL3kP4l7JI7w7LV78epGCs58Q8TTvECVkSLE9KPzt4zaXqQzq pLZe/sM5CGdr2gI85Na3ya2stKc5gnFAdgfOKCZn+FV9yjU60GmBxFYWv+YuLxVS Ep9nJSMbAgGTbALFjFd2yHFXAhW1v3do5E5W6HqYSta8ouu9MgcvsHdoKmvYLt3e DcJOSxs32qTDsI9/1LIa6qw+C8DsZM2+gDo1AYDdfispYVBpcAw= =sI5R -----END PGP SIGNATURE----- --b3ey7svlnh3emv3f-- From owner-dev-commits-src-main@freebsd.org Sun Jan 31 22:47: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 CD1D74EA7B2; Sun, 31 Jan 2021 22:47: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 4DTR5x53tqz4nVF; Sun, 31 Jan 2021 22:47: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 A0B6410938; Sun, 31 Jan 2021 22:47: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 10VMl1Eo004556; Sun, 31 Jan 2021 22:47:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VMl1Gx004555; Sun, 31 Jan 2021 22:47:01 GMT (envelope-from git) Date: Sun, 31 Jan 2021 22:47:01 GMT Message-Id: <202101312247.10VMl1Gx004555@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: af885c57d65d - main - sctp: improve input validation 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: af885c57d65d33c0306e91d3e090e76772a0d012 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, 31 Jan 2021 22:47:01 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=af885c57d65d33c0306e91d3e090e76772a0d012 commit af885c57d65d33c0306e91d3e090e76772a0d012 Author: Michael Tuexen AuthorDate: 2021-01-31 22:43:15 +0000 Commit: Michael Tuexen CommitDate: 2021-01-31 22:46:53 +0000 sctp: improve input validation Improve the handling of INIT chunks in specific szenarios and report and appropriate error cause. Thanks to Anatoly Korniltsev for reporting the issue for the userland stack. MFC after: 3 days --- sys/netinet/sctp_output.c | 100 ++++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 38 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index d58ebf785238..0f7ade931e61 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5232,31 +5232,33 @@ invalid_size: return (op_err); } -static int +/* + * Given a INIT chunk, look through the parameters to verify that there + * are no new addresses. + * Return true, if there is a new address or there is a problem parsing + the parameters. Provide an optional error cause used when sending an ABORT. + * Return false, if there are no new addresses and there is no problem in + parameter processing. + */ +static bool sctp_are_there_new_addresses(struct sctp_association *asoc, - struct mbuf *in_initpkt, int offset, struct sockaddr *src) + struct mbuf *in_initpkt, int offset, int limit, struct sockaddr *src, + struct mbuf **op_err) { - /* - * Given a INIT packet, look through the packet to verify that there - * are NO new addresses. As we go through the parameters add reports - * of any un-understood parameters that require an error. Also we - * must return (1) to drop the packet if we see a un-understood - * parameter that tells us to drop the chunk. - */ struct sockaddr *sa_touse; struct sockaddr *sa; struct sctp_paramhdr *phdr, params; - uint16_t ptype, plen; - uint8_t fnd; struct sctp_nets *net; - int check_src; #ifdef INET struct sockaddr_in sin4, *sa4; #endif #ifdef INET6 struct sockaddr_in6 sin6, *sa6; #endif + uint16_t ptype, plen; + bool fnd, check_src; + *op_err = NULL; #ifdef INET memset(&sin4, 0, sizeof(sin4)); sin4.sin_family = AF_INET; @@ -5268,19 +5270,19 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sin6.sin6_len = sizeof(sin6); #endif /* First what about the src address of the pkt ? */ - check_src = 0; + check_src = false; switch (src->sa_family) { #ifdef INET case AF_INET: if (asoc->scope.ipv4_addr_legal) { - check_src = 1; + check_src = true; } break; #endif #ifdef INET6 case AF_INET6: if (asoc->scope.ipv6_addr_legal) { - check_src = 1; + check_src = true; } break; #endif @@ -5289,7 +5291,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, break; } if (check_src) { - fnd = 0; + fnd = false; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sa = (struct sockaddr *)&net->ro._l_addr; if (sa->sa_family == src->sa_family) { @@ -5300,7 +5302,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa4 = (struct sockaddr_in *)sa; src4 = (struct sockaddr_in *)src; if (sa4->sin_addr.s_addr == src4->sin_addr.s_addr) { - fnd = 1; + fnd = true; break; } } @@ -5312,16 +5314,22 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa6 = (struct sockaddr_in6 *)sa; src6 = (struct sockaddr_in6 *)src; if (SCTP6_ARE_ADDR_EQUAL(sa6, src6)) { - fnd = 1; + fnd = true; break; } } #endif } } - if (fnd == 0) { - /* New address added! no need to look further. */ - return (1); + if (!fnd) { + /* + * If sending an ABORT in case of an additional + * address, don't use the new address error cause. + * This looks no different than if no listener was + * present. + */ + *op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); + return (true); } } /* Ok so far lets munge through the rest of the packet */ @@ -5331,6 +5339,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa_touse = NULL; ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); + if (offset + plen > limit) { + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Partial parameter"); + return (true); + } + if (plen < sizeof(struct sctp_paramhdr)) { + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length too small"); + return (true); + } switch (ptype) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -5338,12 +5354,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, struct sctp_ipv4addr_param *p4, p4_buf; if (plen != sizeof(struct sctp_ipv4addr_param)) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length illegal"); + return (true); } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p4_buf, sizeof(p4_buf)); if (phdr == NULL) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); + return (true); } if (asoc->scope.ipv4_addr_legal) { p4 = (struct sctp_ipv4addr_param *)phdr; @@ -5359,12 +5377,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, struct sctp_ipv6addr_param *p6, p6_buf; if (plen != sizeof(struct sctp_ipv6addr_param)) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length illegal"); + return (true); } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p6_buf, sizeof(p6_buf)); if (phdr == NULL) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); + return (true); } if (asoc->scope.ipv6_addr_legal) { p6 = (struct sctp_ipv6addr_param *)phdr; @@ -5381,7 +5401,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, } if (sa_touse) { /* ok, sa_touse points to one to check */ - fnd = 0; + fnd = false; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sa = (struct sockaddr *)&net->ro._l_addr; if (sa->sa_family != sa_touse->sa_family) { @@ -5392,7 +5412,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa4 = (struct sockaddr_in *)sa; if (sa4->sin_addr.s_addr == sin4.sin_addr.s_addr) { - fnd = 1; + fnd = true; break; } } @@ -5402,21 +5422,31 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa6 = (struct sockaddr_in6 *)sa; if (SCTP6_ARE_ADDR_EQUAL( sa6, &sin6)) { - fnd = 1; + fnd = true; break; } } #endif } if (!fnd) { - /* New addr added! no need to look further */ - return (1); + /* + * If sending an ABORT in case of an + * additional address, don't use the new + * address error cause. This looks no + * different than if no listener was + * present. + */ + *op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); + return (true); } } offset += SCTP_SIZE32(plen); + if (offset >= limit) { + break; + } phdr = sctp_get_next_param(in_initpkt, offset, ¶ms, sizeof(params)); } - return (0); + return (false); } /* @@ -5472,17 +5502,11 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, } if ((asoc != NULL) && (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT)) { - if (sctp_are_there_new_addresses(asoc, init_pkt, offset, src)) { + if (sctp_are_there_new_addresses(asoc, init_pkt, offset, offset + ntohs(init_chk->ch.chunk_length), src, &op_err)) { /* * new addresses, out of here in non-cookie-wait * states - * - * Send an ABORT, without the new address error - * cause. This looks no different than if no - * listener was present. */ - op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), - "Address added"); sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err, mflowtype, mflowid, inp->fibnum, vrf_id, port);