From owner-svn-src-stable@freebsd.org Sun Aug 6 08:14:48 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3234ADCABF5; Sun, 6 Aug 2017 08:14:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 EF0397C3CD; Sun, 6 Aug 2017 08:14:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v768Elwx097195; Sun, 6 Aug 2017 08:14:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v768El16097194; Sun, 6 Aug 2017 08:14:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708060814.v768El16097194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 6 Aug 2017 08:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322115 - stable/11/sys/dev/ichwd X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ichwd X-SVN-Commit-Revision: 322115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 08:14:48 -0000 Author: mav Date: Sun Aug 6 08:14:46 2017 New Revision: 322115 URL: https://svnweb.freebsd.org/changeset/base/322115 Log: MFC r321720, r321856: Attach ichwd(4) only to ISA bus of the LPC bridge. Resource allocation for parent device does not look good by itself, but attempt to allocate them for unrelated device just does not end up good. On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI this reported to cause kernel panic on shutdown due to messed resources: https://bugs.freenas.org/issues/25237. Modified: stable/11/sys/dev/ichwd/ichwd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/11/sys/dev/ichwd/ichwd.c Sun Aug 6 06:46:44 2017 (r322114) +++ stable/11/sys/dev/ichwd/ichwd.c Sun Aug 6 08:14:46 2017 (r322115) @@ -527,23 +527,29 @@ ichwd_event(void *arg, unsigned int cmd, int *error) } static device_t -ichwd_find_ich_lpc_bridge(struct ichwd_device **id_p) +ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_device **id_p) { struct ichwd_device *id; - device_t ich = NULL; + device_t isab, pci; + uint16_t devid; - /* look for an ICH LPC interface bridge */ - for (id = ichwd_devices; id->desc != NULL; ++id) - if ((ich = pci_find_device(VENDORID_INTEL, id->device)) != NULL) - break; - - if (ich == NULL) + /* Check whether parent ISA bridge looks familiar. */ + isab = device_get_parent(isa); + pci = device_get_parent(isab); + if (pci == NULL || device_get_devclass(pci) != devclass_find("pci")) return (NULL); + if (pci_get_vendor(isab) != VENDORID_INTEL) + return (NULL); + devid = pci_get_device(isab); + for (id = ichwd_devices; id->desc != NULL; ++id) { + if (devid == id->device) { + if (id_p != NULL) + *id_p = id; + return (isab); + } + } - if (id_p) - *id_p = id; - - return (ich); + return (NULL); } /* @@ -559,7 +565,7 @@ ichwd_identify(driver_t *driver, device_t parent) uint32_t base_address; int rc; - ich = ichwd_find_ich_lpc_bridge(&id_p); + ich = ichwd_find_ich_lpc_bridge(parent, &id_p); if (ich == NULL) return; @@ -612,7 +618,7 @@ ichwd_probe(device_t dev) if (isa_get_logicalid(dev) != 0) return (ENXIO); - if (ichwd_find_ich_lpc_bridge(&id_p) == NULL) + if (ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p) == NULL) return (ENXIO); device_set_desc_copy(dev, id_p->desc); @@ -630,7 +636,7 @@ ichwd_attach(device_t dev) sc = device_get_softc(dev); sc->device = dev; - ich = ichwd_find_ich_lpc_bridge(&id_p); + ich = ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p); if (ich == NULL) { device_printf(sc->device, "Can not find ICH device.\n"); goto fail; @@ -720,7 +726,6 @@ static int ichwd_detach(device_t dev) { struct ichwd_softc *sc; - device_t ich = NULL; sc = device_get_softc(dev); @@ -745,9 +750,8 @@ ichwd_detach(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, sc->smi_rid, sc->smi_res); /* deallocate memory resource */ - ich = ichwd_find_ich_lpc_bridge(NULL); - if (sc->gcs_res && ich) - bus_release_resource(ich, SYS_RES_MEMORY, sc->gcs_rid, + if (sc->gcs_res) + bus_release_resource(sc->ich, SYS_RES_MEMORY, sc->gcs_rid, sc->gcs_res); return (0); From owner-svn-src-stable@freebsd.org Sun Aug 6 08:15:22 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B72DCACA1; Sun, 6 Aug 2017 08:15:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 4935B7C4F7; Sun, 6 Aug 2017 08:15:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v768FLZI097279; Sun, 6 Aug 2017 08:15:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v768FLDn097278; Sun, 6 Aug 2017 08:15:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708060815.v768FLDn097278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 6 Aug 2017 08:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322116 - stable/10/sys/dev/ichwd X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/sys/dev/ichwd X-SVN-Commit-Revision: 322116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 08:15:22 -0000 Author: mav Date: Sun Aug 6 08:15:21 2017 New Revision: 322116 URL: https://svnweb.freebsd.org/changeset/base/322116 Log: MFC r321720, r321856: Attach ichwd(4) only to ISA bus of the LPC bridge. Resource allocation for parent device does not look good by itself, but attempt to allocate them for unrelated device just does not end up good. On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI this reported to cause kernel panic on shutdown due to messed resources: https://bugs.freenas.org/issues/25237. Modified: stable/10/sys/dev/ichwd/ichwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/10/sys/dev/ichwd/ichwd.c Sun Aug 6 08:14:46 2017 (r322115) +++ stable/10/sys/dev/ichwd/ichwd.c Sun Aug 6 08:15:21 2017 (r322116) @@ -527,23 +527,29 @@ ichwd_event(void *arg, unsigned int cmd, int *error) } static device_t -ichwd_find_ich_lpc_bridge(struct ichwd_device **id_p) +ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_device **id_p) { struct ichwd_device *id; - device_t ich = NULL; + device_t isab, pci; + uint16_t devid; - /* look for an ICH LPC interface bridge */ - for (id = ichwd_devices; id->desc != NULL; ++id) - if ((ich = pci_find_device(VENDORID_INTEL, id->device)) != NULL) - break; - - if (ich == NULL) + /* Check whether parent ISA bridge looks familiar. */ + isab = device_get_parent(isa); + pci = device_get_parent(isab); + if (pci == NULL || device_get_devclass(pci) != devclass_find("pci")) return (NULL); + if (pci_get_vendor(isab) != VENDORID_INTEL) + return (NULL); + devid = pci_get_device(isab); + for (id = ichwd_devices; id->desc != NULL; ++id) { + if (devid == id->device) { + if (id_p != NULL) + *id_p = id; + return (isab); + } + } - if (id_p) - *id_p = id; - - return (ich); + return (NULL); } /* @@ -559,7 +565,7 @@ ichwd_identify(driver_t *driver, device_t parent) uint32_t base_address; int rc; - ich = ichwd_find_ich_lpc_bridge(&id_p); + ich = ichwd_find_ich_lpc_bridge(parent, &id_p); if (ich == NULL) return; @@ -612,7 +618,7 @@ ichwd_probe(device_t dev) if (isa_get_logicalid(dev) != 0) return (ENXIO); - if (ichwd_find_ich_lpc_bridge(&id_p) == NULL) + if (ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p) == NULL) return (ENXIO); device_set_desc_copy(dev, id_p->desc); @@ -630,7 +636,7 @@ ichwd_attach(device_t dev) sc = device_get_softc(dev); sc->device = dev; - ich = ichwd_find_ich_lpc_bridge(&id_p); + ich = ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p); if (ich == NULL) { device_printf(sc->device, "Can not find ICH device.\n"); goto fail; @@ -720,7 +726,6 @@ static int ichwd_detach(device_t dev) { struct ichwd_softc *sc; - device_t ich = NULL; sc = device_get_softc(dev); @@ -745,9 +750,8 @@ ichwd_detach(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, sc->smi_rid, sc->smi_res); /* deallocate memory resource */ - ich = ichwd_find_ich_lpc_bridge(NULL); - if (sc->gcs_res && ich) - bus_release_resource(ich, SYS_RES_MEMORY, sc->gcs_rid, + if (sc->gcs_res) + bus_release_resource(sc->ich, SYS_RES_MEMORY, sc->gcs_rid, sc->gcs_res); return (0); From owner-svn-src-stable@freebsd.org Sun Aug 6 10:07:27 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D605DD0459; Sun, 6 Aug 2017 10:07:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 DF0F07FEBB; Sun, 6 Aug 2017 10:07:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v76A7PEk042113; Sun, 6 Aug 2017 10:07:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v76A7Pf0042111; Sun, 6 Aug 2017 10:07:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708061007.v76A7Pf0042111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 6 Aug 2017 10:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322117 - in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 322117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 10:07:27 -0000 Author: kib Date: Sun Aug 6 10:07:25 2017 New Revision: 322117 URL: https://svnweb.freebsd.org/changeset/base/322117 Log: MFC r321730: Remove unused symbols. Modified: stable/11/sys/amd64/amd64/genassym.c stable/11/sys/i386/i386/genassym.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/genassym.c ============================================================================== --- stable/11/sys/amd64/amd64/genassym.c Sun Aug 6 08:15:21 2017 (r322116) +++ stable/11/sys/amd64/amd64/genassym.c Sun Aug 6 10:07:25 2017 (r322117) @@ -111,12 +111,10 @@ ASSYM(PML4SHIFT, PML4SHIFT); ASSYM(val_KPDPI, KPDPI); ASSYM(val_KPML4I, KPML4I); ASSYM(val_PML4PML4I, PML4PML4I); -ASSYM(USRSTACK, USRSTACK); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(KERNBASE, KERNBASE); ASSYM(DMAP_MIN_ADDRESS, DMAP_MIN_ADDRESS); ASSYM(DMAP_MAX_ADDRESS, DMAP_MAX_ADDRESS); -ASSYM(MCLBYTES, MCLBYTES); ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15)); ASSYM(PCB_R14, offsetof(struct pcb, pcb_r14)); Modified: stable/11/sys/i386/i386/genassym.c ============================================================================== --- stable/11/sys/i386/i386/genassym.c Sun Aug 6 08:15:21 2017 (r322116) +++ stable/11/sys/i386/i386/genassym.c Sun Aug 6 10:07:25 2017 (r322117) @@ -115,11 +115,9 @@ ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_MASK, PAGE_MASK); ASSYM(PDRSHIFT, PDRSHIFT); ASSYM(PDRMASK, PDRMASK); -ASSYM(USRSTACK, USRSTACK); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(KERNBASE, KERNBASE); ASSYM(KERNLOAD, KERNLOAD); -ASSYM(MCLBYTES, MCLBYTES); ASSYM(PCB_CR0, offsetof(struct pcb, pcb_cr0)); ASSYM(PCB_CR2, offsetof(struct pcb, pcb_cr2)); ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3)); From owner-svn-src-stable@freebsd.org Sun Aug 6 16:07:26 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4A61DB7BBB; Sun, 6 Aug 2017 16:07:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 467A764C86; Sun, 6 Aug 2017 16:07:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v76G7PqZ087655; Sun, 6 Aug 2017 16:07:25 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v76G7PYp087652; Sun, 6 Aug 2017 16:07:25 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708061607.v76G7PYp087652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 6 Aug 2017 16:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322119 - in stable/11/sys/dev: mmc sdhci X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/11/sys/dev: mmc sdhci X-SVN-Commit-Revision: 322119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 16:07:27 -0000 Author: marius Date: Sun Aug 6 16:07:25 2017 New Revision: 322119 URL: https://svnweb.freebsd.org/changeset/base/322119 Log: MFC: r319350, r321385, r321490, r321588, r321948 o Use SDHCI_CAN_DRIVE_TYPE_{A,C,D} to check for driver type support in SDHCI_CAPABILITIES2 instead of SDHCI_CTRL2_DRIVER_TYPE_{A,C,D} which are meant for setting the driver type in SDHCI_HOST_CONTROL2. o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to sdhci(4), mmc(4) and mmcsd(4). On the system where the addition of DDR52 support increased the read throughput to ~80 MB/s (from ~45 MB/s at high speed), HS200 yields ~154 MB/s and HS400 ~187 MB/s, i. e. performance now has more than quadrupled compared to pre-r315598 (pre-r318494 in stable/11). However, in fact this isn't a feature-only change; there are boards based on Intel Bay Trail where DDR52 is problematic and the suggested workaround is to use HS200 mode instead. So far exact details are unknown, however, i. e. whether that's due to a defect in these SoCs or on the boards. Moreover, due to the above changes requiring to be aware of possible MMC siblings in the fast path of mmc(4), corresponding information now is cached in mmc_softc. As a side-effect, mmc_calculate_clock(), now longer will trigger a panic in low memory situations and all of mmc(4) operate on the same set of child devices. o Fix a bug in the failure reporting of mmcsd_delete() that could lead to a panic. o Fix 2 bugs on resume, one in mmcsd(4) that could lead to a panic and another one in mmc(4) that could lead to devices no longer working. o Fix a memory leak in mmcsd_ioctl() in case copyin(9) fails. [1] o Fix missing variable initialization in mmc_switch_status(). [2] o Fix R1_SWITCH_ERROR detection in mmc_switch_status(). [3] o Handle the case of device_add_child(9) failing, for example due to a memory shortage, gracefully in mmc(4) and sdhci(4), including not leaking memory for the instance variables in case of mmc(4), also fixing [4]. o Correctly use the size of a pointer rather than that of a pointer to a pointer (this bug was present in head r321385 only, i. e. not in a stable branch). [5] o Handle the case of an unknown SD CSD version in mmc_decode_csd_sd() gracefully instead of calling panic(9). o Again, check and handle the return values of some additional function calls in mmc(4) instead of assuming that everything went right or mark non-fatal errors by casting the return value to void. o Correct a typo in the Linux IOCTL compatibility; it should have been MMC_IOC_MULTI_CMD rather than MMC_IOC_CMD_MULTI. o Now that we are reaching ever faster speeds (more improvement in this regard is to be expected when adding ADMA support to sdhci(4)), apply a few micro-optimizations to mmc(4), mmcsd(4) and sdhci(4). o Correct confusing and error prone mix-ups between "br" or "bridge" in mmc(4) and mmcsd(4) where - according to the terminology outlined in comments of bridge.h and mmcbr_if.m around since their addition in r163516 - the bus is meant and used instead. o Remove comment lines from bridge.h incorrectly suggesting that there would be a MMC bridge base class driver. o Update comments in bridge.h regarding the star topology of SD and SDIO; since version 3.00 of the SDHCI specification, for eSD and eSDIO bus topologies are actually possible in form of so called "shared buses" (in some subcontext later on renamed to "embedded" buses). Reported by: Coverity CID: 1372612 [1], 1372624 [2], 1372594 [3], 1007069 [4], 1378432 [5] Modified: stable/11/sys/dev/mmc/bridge.h stable/11/sys/dev/mmc/mmc.c stable/11/sys/dev/mmc/mmc_ioctl.h stable/11/sys/dev/mmc/mmc_private.h stable/11/sys/dev/mmc/mmc_subr.c stable/11/sys/dev/mmc/mmc_subr.h stable/11/sys/dev/mmc/mmcbr_if.m stable/11/sys/dev/mmc/mmcbrvar.h stable/11/sys/dev/mmc/mmcbus_if.m stable/11/sys/dev/mmc/mmcreg.h stable/11/sys/dev/mmc/mmcsd.c stable/11/sys/dev/sdhci/sdhci.c stable/11/sys/dev/sdhci/sdhci.h stable/11/sys/dev/sdhci/sdhci_acpi.c stable/11/sys/dev/sdhci/sdhci_if.m stable/11/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mmc/bridge.h ============================================================================== --- stable/11/sys/dev/mmc/bridge.h Sun Aug 6 12:27:20 2017 (r322118) +++ stable/11/sys/dev/mmc/bridge.h Sun Aug 6 16:07:25 2017 (r322119) @@ -65,12 +65,10 @@ * linux/mmc/host.h file. * * A mmc bridge is a chipset that can have one or more mmc and/or sd - * cards attached to it. mmc cards are attached on a bus topology, - * while sd and sdio cards are attached using a star topology (meaning - * in practice each sd card has its own, independent slot). Each - * mmcbr is assumed to be derived from the mmcbr. This is done to - * allow for easier addition of bridges (as each bridge does not need - * to be added to the mmcbus file). + * cards attached to it. mmc devices are attached on a bus topology, + * while sd and sdio cards usually are attached using a star topology + * (meaning in practice each sd card has its own, independent slot). + * Since SDHCI v3.00, buses for esd and esdio are possible, though. * * Attached to the mmc bridge is an mmcbus. The mmcbus is described * in dev/mmc/mmcbus_if.m. @@ -137,6 +135,10 @@ enum mmc_card_mode { mode_mmc, mode_sd }; +enum mmc_retune_req { + retune_req_none = 0, retune_req_normal, retune_req_reset +}; + struct mmc_host { int f_min; int f_max; @@ -177,7 +179,7 @@ struct mmc_host { extern driver_t mmc_driver; extern devclass_t mmc_devclass; -#define MMC_VERSION 3 +#define MMC_VERSION 4 #define MMC_DECLARE_BRIDGE(name) \ DRIVER_MODULE(mmc, name, mmc_driver, mmc_devclass, NULL, NULL); \ Modified: stable/11/sys/dev/mmc/mmc.c ============================================================================== --- stable/11/sys/dev/mmc/mmc.c Sun Aug 6 12:27:20 2017 (r322118) +++ stable/11/sys/dev/mmc/mmc.c Sun Aug 6 16:07:25 2017 (r322119) @@ -88,14 +88,14 @@ struct mmc_ivars { uint8_t raw_ext_csd[MMC_EXTCSD_SIZE]; /* Raw bits of the EXT_CSD */ uint32_t raw_sd_status[16]; /* Raw bits of the SD_STATUS */ uint16_t rca; + u_char read_only; /* True when the device is read-only */ + u_char high_cap; /* High Capacity device (block addressed) */ enum mmc_card_mode mode; + enum mmc_bus_width bus_width; /* Bus width to use */ struct mmc_cid cid; /* cid decoded */ struct mmc_csd csd; /* csd decoded */ struct mmc_scr scr; /* scr decoded */ struct mmc_sd_status sd_status; /* SD_STATUS decoded */ - u_char read_only; /* True when the device is read-only */ - u_char bus_width; /* Bus width to use */ - u_char high_cap; /* High Capacity card (block addressed) */ uint32_t sec_count; /* Card capacity in 512byte blocks */ uint32_t timings; /* Mask of bus timings supported */ uint32_t vccq_120; /* Mask of bus timings at VCCQ of 1.2 V */ @@ -127,8 +127,10 @@ static int mmc_read_ivar(device_t bus, device_t child, uintptr_t *result); static int mmc_release_bus(device_t busdev, device_t dev); static int mmc_resume(device_t dev); +static void mmc_retune_pause(device_t busdev, device_t dev, bool retune); +static void mmc_retune_unpause(device_t busdev, device_t dev); static int mmc_suspend(device_t dev); -static int mmc_wait_for_request(device_t brdev, device_t reqdev, +static int mmc_wait_for_request(device_t busdev, device_t dev, struct mmc_request *req); static int mmc_write_ivar(device_t bus, device_t child, int which, uintptr_t value); @@ -155,21 +157,23 @@ static void mmc_decode_cid_mmc(uint32_t *raw_cid, stru bool is_4_41p); static void mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid); static void mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd); -static void mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); +static int mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); static void mmc_delayed_attach(void *xsc); -static int mmc_delete_cards(struct mmc_softc *sc); +static int mmc_delete_cards(struct mmc_softc *sc, bool final); static void mmc_discover_cards(struct mmc_softc *sc); static void mmc_format_card_id_string(struct mmc_ivars *ivar); static void mmc_go_discovery(struct mmc_softc *sc); static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start, int size); static int mmc_highest_voltage(uint32_t ocr); +static bool mmc_host_timing(device_t dev, enum mmc_bus_timing timing); static void mmc_idle_cards(struct mmc_softc *sc); static void mmc_ms_delay(int ms); static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard); static void mmc_power_down(struct mmc_softc *sc); static void mmc_power_up(struct mmc_softc *sc); static void mmc_rescan_cards(struct mmc_softc *sc); +static int mmc_retune(device_t busdev, device_t dev, bool reset); static void mmc_scan(struct mmc_softc *sc); static int mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp, uint8_t value, uint8_t *res); @@ -183,15 +187,23 @@ static int mmc_send_op_cond(struct mmc_softc *sc, uint uint32_t *rocr); static int mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp); static int mmc_set_blocklen(struct mmc_softc *sc, uint32_t len); -static int mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar); +static int mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing); static int mmc_set_power_class(struct mmc_softc *sc, struct mmc_ivars *ivar); static int mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp); static int mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars *ivar, enum mmc_bus_timing timing); +static int mmc_set_vccq(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing); +static int mmc_switch_to_hs200(struct mmc_softc *sc, struct mmc_ivars *ivar, + uint32_t clock); +static int mmc_switch_to_hs400(struct mmc_softc *sc, struct mmc_ivars *ivar, + uint32_t max_dtr, enum mmc_bus_timing max_timing); static int mmc_test_bus_width(struct mmc_softc *sc); static uint32_t mmc_timing_to_dtr(struct mmc_ivars *ivar, enum mmc_bus_timing timing); static const char *mmc_timing_to_string(enum mmc_bus_timing timing); +static void mmc_update_child_list(struct mmc_softc *sc); static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode, uint32_t arg, uint32_t flags, uint32_t *resp, int retries); static int mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req); @@ -235,7 +247,8 @@ mmc_detach(device_t dev) struct mmc_softc *sc = device_get_softc(dev); int err; - if ((err = mmc_delete_cards(sc)) != 0) + err = mmc_delete_cards(sc, true); + if (err != 0) return (err); mmc_power_down(sc); MMC_LOCK_DESTROY(sc); @@ -250,10 +263,21 @@ mmc_suspend(device_t dev) int err; err = bus_generic_suspend(dev); - if (err) + if (err != 0) return (err); + /* + * We power down with the bus acquired here, mainly so that no device + * is selected any longer and sc->last_rca gets set to 0. Otherwise, + * the deselect as part of the bus acquisition in mmc_scan() may fail + * during resume, as the bus isn't powered up again before later in + * mmc_go_discovery(). + */ + err = mmc_acquire_bus(dev, dev); + if (err != 0) + return (err); mmc_power_down(sc); - return (0); + err = mmc_release_bus(dev, dev); + return (err); } static int @@ -270,7 +294,8 @@ mmc_acquire_bus(device_t busdev, device_t dev) { struct mmc_softc *sc; struct mmc_ivars *ivar; - int err, rca; + int err; + uint16_t rca; enum mmc_bus_timing timing; err = MMCBR_ACQUIRE_HOST(device_get_parent(busdev), busdev); @@ -294,12 +319,27 @@ mmc_acquire_bus(device_t busdev, device_t dev) rca = ivar->rca; if (sc->last_rca != rca) { if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to select.\n", rca); + device_printf(busdev, "Card at relative " + "address %d failed to select\n", rca); return (ENXIO); } sc->last_rca = rca; timing = mmcbr_get_timing(busdev); + /* + * For eMMC modes, setting/updating bus width and VCCQ + * only really is necessary if there actually is more + * than one device on the bus as generally that already + * had to be done by mmc_calculate_clock() or one of + * its calees. Moreover, setting the bus width anew + * can trigger re-tuning (via a CRC error on the next + * CMD), even if not switching between devices an the + * previously selected one is still tuned. Obviously, + * we need to re-tune the host controller if devices + * are actually switched, though. + */ + if (timing >= bus_timing_mmc_ddr52 && + sc->child_count == 1) + return (0); /* Prepare bus width for the new card. */ if (bootverbose || mmc_debug) { device_printf(busdev, @@ -308,38 +348,34 @@ mmc_acquire_bus(device_t busdev, device_t dev) (ivar->bus_width == bus_width_8) ? 8 : 1, mmc_timing_to_string(timing)); } - if (mmc_set_card_bus_width(sc, ivar) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to set bus width.\n", + if (mmc_set_card_bus_width(sc, ivar, timing) != + MMC_ERR_NONE) { + device_printf(busdev, "Card at relative " + "address %d failed to set bus width\n", rca); return (ENXIO); } - if (isset(&ivar->vccq_120, timing)) - mmcbr_set_vccq(busdev, vccq_120); - else if (isset(&ivar->vccq_180, timing)) - mmcbr_set_vccq(busdev, vccq_180); - else - mmcbr_set_vccq(busdev, vccq_330); - if (mmcbr_switch_vccq(busdev) != 0) { - device_printf(sc->dev, "Failed to set VCCQ " - "for card at relative address %d.\n", rca); + mmcbr_set_bus_width(busdev, ivar->bus_width); + mmcbr_update_ios(busdev); + if (mmc_set_vccq(sc, ivar, timing) != MMC_ERR_NONE) { + device_printf(busdev, "Failed to set VCCQ " + "for card at relative address %d\n", rca); return (ENXIO); } - if (mmc_set_power_class(sc, ivar) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to set power class.\n", - rca); + if (timing >= bus_timing_mmc_hs200 && + mmc_retune(busdev, dev, true) != 0) { + device_printf(busdev, "Card at relative " + "address %d failed to re-tune\n", rca); return (ENXIO); } - mmcbr_set_bus_width(busdev, ivar->bus_width); - mmcbr_update_ios(busdev); } } else { /* * If there's a card selected, stand down. */ if (sc->last_rca != 0) { - mmc_select_card(sc, 0); + if (mmc_select_card(sc, 0) != MMC_ERR_NONE) + return (ENXIO); sc->last_rca = 0; } } @@ -407,7 +443,7 @@ mmc_wait_for_req(struct mmc_softc *sc, struct mmc_requ req->done = mmc_wakeup; req->done_data = sc; - if (mmc_debug > 1) { + if (__predict_false(mmc_debug > 1)) { device_printf(sc->dev, "REQUEST: CMD%d arg %#x flags %#x", req->cmd->opcode, req->cmd->arg, req->cmd->flags); if (req->cmd->data) { @@ -420,18 +456,66 @@ mmc_wait_for_req(struct mmc_softc *sc, struct mmc_requ while ((req->flags & MMC_REQ_DONE) == 0) msleep(req, &sc->sc_mtx, 0, "mmcreq", 0); MMC_UNLOCK(sc); - if (mmc_debug > 2 || (mmc_debug > 0 && req->cmd->error != MMC_ERR_NONE)) + if (__predict_false(mmc_debug > 2 || (mmc_debug > 0 && + req->cmd->error != MMC_ERR_NONE))) device_printf(sc->dev, "CMD%d RESULT: %d\n", req->cmd->opcode, req->cmd->error); return (0); } static int -mmc_wait_for_request(device_t brdev, device_t reqdev __unused, - struct mmc_request *req) +mmc_wait_for_request(device_t busdev, device_t dev, struct mmc_request *req) { - struct mmc_softc *sc = device_get_softc(brdev); + struct mmc_softc *sc; + struct mmc_ivars *ivar; + int err, i; + enum mmc_retune_req retune_req; + sc = device_get_softc(busdev); + KASSERT(sc->owner != NULL, + ("%s: Request from %s without bus being acquired.", __func__, + device_get_nameunit(dev))); + + /* + * Unless no device is selected or re-tuning is already ongoing, + * execute re-tuning if a) the bridge is requesting to do so and + * re-tuning hasn't been otherwise paused, or b) if a child asked + * to be re-tuned prior to pausing (see also mmc_retune_pause()). + */ + if (__predict_false(sc->last_rca != 0 && sc->retune_ongoing == 0 && + (((retune_req = mmcbr_get_retune_req(busdev)) != retune_req_none && + sc->retune_paused == 0) || sc->retune_needed == 1))) { + if (__predict_false(mmc_debug > 1)) { + device_printf(busdev, + "Re-tuning with%s circuit reset required\n", + retune_req == retune_req_reset ? "" : "out"); + } + if (device_get_parent(dev) == busdev) + ivar = device_get_ivars(dev); + else { + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); + if (ivar->rca == sc->last_rca) + break; + } + if (ivar->rca != sc->last_rca) + return (EINVAL); + } + sc->retune_ongoing = 1; + err = mmc_retune(busdev, dev, retune_req == retune_req_reset); + sc->retune_ongoing = 0; + switch (err) { + case MMC_ERR_NONE: + case MMC_ERR_FAILED: /* Re-tune error but still might work */ + break; + case MMC_ERR_BADCRC: /* Switch failure on HS400 recovery */ + return (ENXIO); + case MMC_ERR_INVALID: /* Driver implementation b0rken */ + default: /* Unknown error, should not happen */ + return (EINVAL); + } + sc->retune_needed = 0; + } return (mmc_wait_for_req(sc, req)); } @@ -599,11 +683,14 @@ mmc_power_down(struct mmc_softc *sc) static int mmc_select_card(struct mmc_softc *sc, uint16_t rca) { - int flags; + int err, flags; flags = (rca ? MMC_RSP_R1B : MMC_RSP_NONE) | MMC_CMD_AC; - return (mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16, - flags, NULL, CMD_RETRIES)); + sc->retune_paused++; + err = mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16, + flags, NULL, CMD_RETRIES); + sc->retune_paused--; + return (err); } static int @@ -635,7 +722,8 @@ mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint } static int -mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar) +mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing) { struct mmc_command cmd; int err; @@ -668,28 +756,33 @@ mmc_set_card_bus_width(struct mmc_softc *sc, struct mm } else { switch (ivar->bus_width) { case bus_width_1: + if (timing == bus_timing_mmc_hs400 || + timing == bus_timing_mmc_hs400es) + return (MMC_ERR_INVALID); value = EXT_CSD_BUS_WIDTH_1; break; case bus_width_4: - switch (mmcbr_get_timing(sc->dev)) { + switch (timing) { case bus_timing_mmc_ddr52: - case bus_timing_mmc_hs200: - case bus_timing_mmc_hs400: - case bus_timing_mmc_hs400es: value = EXT_CSD_BUS_WIDTH_4_DDR; break; + case bus_timing_mmc_hs400: + case bus_timing_mmc_hs400es: + return (MMC_ERR_INVALID); default: value = EXT_CSD_BUS_WIDTH_4; break; } break; case bus_width_8: - switch (mmcbr_get_timing(sc->dev)) { + value = 0; + switch (timing) { + case bus_timing_mmc_hs400es: + value = EXT_CSD_BUS_WIDTH_ES; + /* FALLTHROUGH */ case bus_timing_mmc_ddr52: - case bus_timing_mmc_hs200: case bus_timing_mmc_hs400: - case bus_timing_mmc_hs400es: - value = EXT_CSD_BUS_WIDTH_8_DDR; + value |= EXT_CSD_BUS_WIDTH_8_DDR; break; default: value = EXT_CSD_BUS_WIDTH_8; @@ -814,6 +907,13 @@ mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars case bus_timing_mmc_ddr52: value = EXT_CSD_HS_TIMING_HS; break; + case bus_timing_mmc_hs200: + value = EXT_CSD_HS_TIMING_HS200; + break; + case bus_timing_mmc_hs400: + case bus_timing_mmc_hs400es: + value = EXT_CSD_HS_TIMING_HS400; + break; default: return (MMC_ERR_INVALID); } @@ -830,6 +930,23 @@ mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars return (err); } +static int +mmc_set_vccq(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing) +{ + + if (isset(&ivar->vccq_120, timing)) + mmcbr_set_vccq(sc->dev, vccq_120); + else if (isset(&ivar->vccq_180, timing)) + mmcbr_set_vccq(sc->dev, vccq_180); + else + mmcbr_set_vccq(sc->dev, vccq_330); + if (mmcbr_switch_vccq(sc->dev) != 0) + return (MMC_ERR_INVALID); + else + return (MMC_ERR_NONE); +} + static const uint8_t p8[8] = { 0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -1037,7 +1154,7 @@ static const int cur_max[8] = { 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 }; -static void +static int mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) { int v; @@ -1078,6 +1195,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *c csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); + return (MMC_ERR_NONE); } else if (v == 1) { m = mmc_get_bits(raw_csd, 128, 115, 4); e = mmc_get_bits(raw_csd, 128, 112, 3); @@ -1101,8 +1219,9 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *c csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); - } else - panic("unknown SD CSD version"); + return (MMC_ERR_NONE); + } + return (MMC_ERR_INVALID); } static void @@ -1366,6 +1485,53 @@ mmc_timing_to_string(enum mmc_bus_timing timing) return (""); } +static bool +mmc_host_timing(device_t dev, enum mmc_bus_timing timing) +{ + int host_caps; + + host_caps = mmcbr_get_caps(dev); + +#define HOST_TIMING_CAP(host_caps, cap) ({ \ + bool retval; \ + if (((host_caps) & (cap)) == (cap)) \ + retval = true; \ + else \ + retval = false; \ + retval; \ +}) + + switch (timing) { + case bus_timing_normal: + return (true); + case bus_timing_hs: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_HSPEED)); + case bus_timing_uhs_sdr12: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR12)); + case bus_timing_uhs_sdr25: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR25)); + case bus_timing_uhs_ddr50: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_DDR50)); + case bus_timing_uhs_sdr50: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR50)); + case bus_timing_uhs_sdr104: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR104)); + case bus_timing_mmc_ddr52: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_DDR52)); + case bus_timing_mmc_hs200: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS200)); + case bus_timing_mmc_hs400: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400)); + case bus_timing_mmc_hs400es: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400 | + MMC_CAP_MMC_ENH_STROBE)); + } + +#undef HOST_TIMING_CAP + + return (false); +} + static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard) { @@ -1397,9 +1563,8 @@ mmc_discover_cards(struct mmc_softc *sc) u_char switch_res[64]; uint32_t raw_cid[4]; struct mmc_ivars *ivar = NULL; - device_t *devlist; device_t child; - int devcount, err, host_caps, i, newcard; + int err, host_caps, i, newcard; uint32_t resp, sec_count, status; uint16_t rca = 2; @@ -1407,6 +1572,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (bootverbose || mmc_debug) device_printf(sc->dev, "Probing cards\n"); while (1) { + child = NULL; sc->squelched++; /* Errors are expected, squelch reporting. */ err = mmc_all_send_cid(sc, raw_cid); sc->squelched--; @@ -1417,18 +1583,14 @@ mmc_discover_cards(struct mmc_softc *sc) break; } newcard = 1; - if ((err = device_get_children(sc->dev, &devlist, - &devcount)) != 0) - return; - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (memcmp(ivar->raw_cid, raw_cid, sizeof(raw_cid)) == 0) { newcard = 0; break; } } - free(devlist, M_TEMP); if (bootverbose || mmc_debug) { device_printf(sc->dev, "%sard detected (CID %08x%08x%08x%08x)\n", @@ -1451,7 +1613,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting RCA %d\n", err); - break; + goto free_ivar; } ivar->rca = resp >> 16; /* Get card CSD. */ @@ -1459,7 +1621,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting CSD %d\n", err); - break; + goto free_ivar; } if (bootverbose || mmc_debug) device_printf(sc->dev, @@ -1467,7 +1629,11 @@ mmc_discover_cards(struct mmc_softc *sc) newcard ? "New c" : "C", ivar->raw_csd[0], ivar->raw_csd[1], ivar->raw_csd[2], ivar->raw_csd[3]); - mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); + err = mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); + if (err != MMC_ERR_NONE) { + device_printf(sc->dev, "Error decoding CSD\n"); + goto free_ivar; + } ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; @@ -1480,12 +1646,12 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading card status %d\n", err); - break; + goto free_ivar; } if ((status & R1_CARD_IS_LOCKED) != 0) { device_printf(sc->dev, - "Card is password protected, skipping.\n"); - break; + "Card is password protected, skipping\n"); + goto free_ivar; } /* Get card SCR. Card must be selected to fetch it. */ @@ -1493,13 +1659,13 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error selecting card %d\n", err); - break; + goto free_ivar; } err = mmc_app_send_scr(sc, ivar->rca, ivar->raw_scr); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading SCR %d\n", err); - break; + goto free_ivar; } mmc_app_decode_scr(ivar->raw_scr, &ivar->scr); /* Get card switch capabilities (command class 10). */ @@ -1527,7 +1693,7 @@ mmc_discover_cards(struct mmc_softc *sc) * use from the sd_status is the erase sector size, but * it is still nice to get that right. */ - mmc_select_card(sc, 0); + (void)mmc_select_card(sc, 0); (void)mmc_select_card(sc, ivar->rca); (void)mmc_app_sd_status(sc, ivar->rca, ivar->raw_sd_status); @@ -1537,47 +1703,24 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->erase_sector = 16 << ivar->sd_status.au_size; } - /* Find max supported bus width. */ + /* Find maximum supported bus width. */ if ((host_caps & MMC_CAP_4_BIT_DATA) && (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) ivar->bus_width = bus_width_4; - /* - * Some cards that report maximum I/O block sizes - * greater than 512 require the block length to be - * set to 512, even though that is supposed to be - * the default. Example: - * - * Transcend 2GB SDSC card, CID: - * mid=0x1b oid=0x534d pnm="00000" prv=1.0 mdt=00.2000 - */ - if (ivar->csd.read_bl_len != MMC_SECTOR_SIZE || - ivar->csd.write_bl_len != MMC_SECTOR_SIZE) - mmc_set_blocklen(sc, MMC_SECTOR_SIZE); - - mmc_format_card_id_string(ivar); - - if (bootverbose || mmc_debug) - mmc_log_card(sc->dev, ivar, newcard); - if (newcard) { - /* Add device. */ - child = device_add_child(sc->dev, NULL, -1); - device_set_ivars(child, ivar); - } - mmc_select_card(sc, 0); - return; + goto child_common; } ivar->rca = rca++; err = mmc_set_relative_addr(sc, ivar->rca); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error setting RCA %d\n", err); - break; + goto free_ivar; } /* Get card CSD. */ err = mmc_send_csd(sc, ivar->rca, ivar->raw_csd); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting CSD %d\n", err); - break; + goto free_ivar; } if (bootverbose || mmc_debug) device_printf(sc->dev, @@ -1596,19 +1739,19 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading card status %d\n", err); - break; + goto free_ivar; } if ((status & R1_CARD_IS_LOCKED) != 0) { device_printf(sc->dev, - "Card is password protected, skipping.\n"); - break; + "Card is password protected, skipping\n"); + goto free_ivar; } err = mmc_select_card(sc, ivar->rca); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error selecting card %d\n", err); - break; + goto free_ivar; } /* Only MMC >= 4.x devices support EXT_CSD. */ @@ -1618,7 +1761,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading EXT_CSD %d\n", err); - break; + goto free_ivar; } /* Handle extended capacity from EXT_CSD */ sec_count = ivar->raw_ext_csd[EXT_CSD_SEC_CNT] + @@ -1629,6 +1772,8 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->sec_count = sec_count; ivar->high_cap = 1; } + /* Find maximum supported bus width. */ + ivar->bus_width = mmc_test_bus_width(sc); /* Get device speeds beyond normal mode. */ if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_HS_52) != 0) { @@ -1651,6 +1796,50 @@ mmc_discover_cards(struct mmc_softc *sc) setbit(&ivar->timings, bus_timing_mmc_ddr52); setbit(&ivar->vccq_180, bus_timing_mmc_ddr52); } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS200_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0) { + setbit(&ivar->timings, bus_timing_mmc_hs200); + setbit(&ivar->vccq_120, bus_timing_mmc_hs200); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS200_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0) { + setbit(&ivar->timings, bus_timing_mmc_hs200); + setbit(&ivar->vccq_180, bus_timing_mmc_hs200); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400); + setbit(&ivar->vccq_120, bus_timing_mmc_hs400); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400); + setbit(&ivar->vccq_180, bus_timing_mmc_hs400); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_2V) != 0 && + (ivar->raw_ext_csd[EXT_CSD_STROBE_SUPPORT] & + EXT_CSD_STROBE_SUPPORT_EN) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400es); + setbit(&ivar->vccq_120, bus_timing_mmc_hs400es); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_8V) != 0 && + (ivar->raw_ext_csd[EXT_CSD_STROBE_SUPPORT] & + EXT_CSD_STROBE_SUPPORT_EN) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400es); + setbit(&ivar->vccq_180, bus_timing_mmc_hs400es); + } /* * Determine generic switch timeout (provided in * units of 10 ms), defaulting to 500 ms. @@ -1659,8 +1848,6 @@ mmc_discover_cards(struct mmc_softc *sc) if (ivar->csd.spec_vers >= 6) ivar->cmd6_time = 10 * ivar->raw_ext_csd[EXT_CSD_GEN_CMD6_TIME]; - /* Find max supported bus width. */ - ivar->bus_width = mmc_test_bus_width(sc); /* Handle HC erase sector size. */ if (ivar->raw_ext_csd[EXT_CSD_ERASE_GRP_SIZE] != 0) { ivar->erase_sector = 1024 * @@ -1674,11 +1861,15 @@ mmc_discover_cards(struct mmc_softc *sc) device_printf(sc->dev, "Error setting erase group %d\n", err); - break; + goto free_ivar; } } } + mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, + ivar->raw_ext_csd[EXT_CSD_REV] >= 5); + +child_common: /* * Some cards that report maximum I/O block sizes greater * than 512 require the block length to be set to 512, even @@ -1691,8 +1882,6 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->csd.write_bl_len != MMC_SECTOR_SIZE) mmc_set_blocklen(sc, MMC_SECTOR_SIZE); - mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, - ivar->raw_ext_csd[EXT_CSD_REV] >= 5); mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) @@ -1700,56 +1889,111 @@ mmc_discover_cards(struct mmc_softc *sc) if (newcard) { /* Add device. */ child = device_add_child(sc->dev, NULL, -1); - device_set_ivars(child, ivar); + if (child != NULL) { + device_set_ivars(child, ivar); + sc->child_list = realloc(sc->child_list, + sizeof(device_t) * sc->child_count + 1, + M_DEVBUF, M_WAITOK); + sc->child_list[sc->child_count++] = child; + } else + device_printf(sc->dev, "Error adding child\n"); } - mmc_select_card(sc, 0); + +free_ivar: + if (newcard && child == NULL) + free(ivar, M_DEVBUF); + (void)mmc_select_card(sc, 0); + /* + * Not returning here when one MMC device could no be added + * potentially would mean looping forever when that device + * is broken (in which case it also may impact the remainder + * of the bus anyway, though). + */ + if ((newcard && child == NULL) || + mmcbr_get_mode(sc->dev) == mode_sd) + return; } } static void +mmc_update_child_list(struct mmc_softc *sc) +{ + device_t child; + int i, j; + + if (sc->child_count == 0) { + free(sc->child_list, M_DEVBUF); + return; + } + for (i = j = 0; i < sc->child_count; i++) { + for (;;) { + child = sc->child_list[j++]; + if (child != NULL) + break; + } + if (i != j) + sc->child_list[i] = child; + } + sc->child_list = realloc(sc->child_list, sizeof(device_t) * + sc->child_count, M_DEVBUF, M_WAITOK); +} + +static void mmc_rescan_cards(struct mmc_softc *sc) { struct mmc_ivars *ivar; - device_t *devlist; - int err, i, devcount; + int err, i, j; - if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) - return; - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + for (i = j = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (mmc_select_card(sc, ivar->rca) != MMC_ERR_NONE) { if (bootverbose || mmc_debug) device_printf(sc->dev, - "Card at relative address %d lost.\n", + "Card at relative address %d lost\n", ivar->rca); - device_delete_child(sc->dev, devlist[i]); + err = device_delete_child(sc->dev, sc->child_list[i]); + if (err != 0) { + j++; + continue; + } free(ivar, M_DEVBUF); - } + } else + j++; } - free(devlist, M_TEMP); - mmc_select_card(sc, 0); + if (sc->child_count == j) + goto out; + sc->child_count = j; + mmc_update_child_list(sc); +out: + (void)mmc_select_card(sc, 0); } static int -mmc_delete_cards(struct mmc_softc *sc) +mmc_delete_cards(struct mmc_softc *sc, bool final) { struct mmc_ivars *ivar; - device_t *devlist; - int err, i, devcount; + int err, i, j; - if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) - return (err); - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + err = 0; + for (i = j = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (bootverbose || mmc_debug) device_printf(sc->dev, - "Card at relative address %d deleted.\n", + "Card at relative address %d deleted\n", ivar->rca); - device_delete_child(sc->dev, devlist[i]); + err = device_delete_child(sc->dev, sc->child_list[i]); + if (err != 0) { + j++; + if (final == false) + continue; + else + break; + } free(ivar, M_DEVBUF); } - free(devlist, M_TEMP); - return (0); + sc->child_count = j; + mmc_update_child_list(sc); + return (err); } static void @@ -1813,7 +2057,7 @@ mmc_go_discovery(struct mmc_softc *sc) mmcbr_get_ocr(dev)); if (mmcbr_get_ocr(dev) == 0) { device_printf(sc->dev, "No compatible cards found on bus\n"); - mmc_delete_cards(sc); + (void)mmc_delete_cards(sc, false); mmc_power_down(sc); return; } @@ -1837,31 +2081,27 @@ mmc_go_discovery(struct mmc_softc *sc) static int mmc_calculate_clock(struct mmc_softc *sc) { - device_t *kids; + device_t dev; struct mmc_ivars *ivar; - int host_caps, i, nkid; + int i; uint32_t dtr, max_dtr; + uint16_t rca; enum mmc_bus_timing max_timing, timing; - bool changed; + bool changed, hs400; - max_dtr = mmcbr_get_f_max(sc->dev); - host_caps = mmcbr_get_caps(sc->dev); - if ((host_caps & MMC_CAP_MMC_DDR52) != 0) - max_timing = bus_timing_mmc_ddr52; - else if ((host_caps & MMC_CAP_HSPEED) != 0) - max_timing = bus_timing_hs; - else - max_timing = bus_timing_normal; - if (device_get_children(sc->dev, &kids, &nkid) != 0) - panic("can't get children"); + dev = sc->dev; + max_dtr = mmcbr_get_f_max(dev); + max_timing = bus_timing_max; do { changed = false; - for (i = 0; i < nkid; i++) { - ivar = device_get_ivars(kids[i]); - if (isclr(&ivar->timings, max_timing)) { - for (timing = max_timing; timing >= + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); + if (isclr(&ivar->timings, max_timing) || + !mmc_host_timing(dev, max_timing)) { + for (timing = max_timing - 1; timing >= bus_timing_normal; timing--) { - if (isset(&ivar->timings, timing)) { + if (isset(&ivar->timings, timing) && *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Aug 6 16:07:36 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D0C2DB7C0F; Sun, 6 Aug 2017 16:07:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D611364CD4; Sun, 6 Aug 2017 16:07:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v76G7Z2V087707; Sun, 6 Aug 2017 16:07:35 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v76G7ZsZ087704; Sun, 6 Aug 2017 16:07:35 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708061607.v76G7ZsZ087704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 6 Aug 2017 16:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322120 - in stable/10/sys/dev: mmc sdhci X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10/sys/dev: mmc sdhci X-SVN-Commit-Revision: 322120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 16:07:36 -0000 Author: marius Date: Sun Aug 6 16:07:34 2017 New Revision: 322120 URL: https://svnweb.freebsd.org/changeset/base/322120 Log: MFC: r319350, r320620, r321385, r321490, r321588, r321948 o Use SDHCI_CAN_DRIVE_TYPE_{A,C,D} to check for driver type support in SDHCI_CAPABILITIES2 instead of SDHCI_CTRL2_DRIVER_TYPE_{A,C,D} which are meant for setting the driver type in SDHCI_HOST_CONTROL2. o Correct a typo in the comment part of r320577 (MFCed to stable/10 in r320899). o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to sdhci(4), mmc(4) and mmcsd(4). On the system where the addition of DDR52 support increased the read throughput to ~80 MB/s (from ~45 MB/s at high speed), HS200 yields ~154 MB/s and HS400 ~187 MB/s, i. e. performance now has more than quadrupled compared to pre-r315598 (pre-r318495 in stable/10). However, in fact this isn't a feature-only change; there are boards based on Intel Bay Trail where DDR52 is problematic and the suggested workaround is to use HS200 mode instead. So far exact details are unknown, however, i. e. whether that's due to a defect in these SoCs or on the boards. Moreover, due to the above changes requiring to be aware of possible MMC siblings in the fast path of mmc(4), corresponding information now is cached in mmc_softc. As a side-effect, mmc_calculate_clock(), now longer will trigger a panic in low memory situations and all of mmc(4) operate on the same set of child devices. o Fix a bug in the failure reporting of mmcsd_delete() that could lead to a panic. o Fix 2 bugs on resume, one in mmcsd(4) that could lead to a panic and another one in mmc(4) that could lead to devices no longer working. o Fix a memory leak in mmcsd_ioctl() in case copyin(9) fails. [1] o Fix missing variable initialization in mmc_switch_status(). [2] o Fix R1_SWITCH_ERROR detection in mmc_switch_status(). [3] o Handle the case of device_add_child(9) failing, for example due to a memory shortage, gracefully in mmc(4) and sdhci(4), including not leaking memory for the instance variables in case of mmc(4), also fixing [4]. o Correctly use the size of a pointer rather than that of a pointer to a pointer (this bug was present in head r321385 only, i. e. not in a stable branch). [5] o Handle the case of an unknown SD CSD version in mmc_decode_csd_sd() gracefully instead of calling panic(9). o Again, check and handle the return values of some additional function calls in mmc(4) instead of assuming that everything went right or mark non-fatal errors by casting the return value to void. o Correct a typo in the Linux IOCTL compatibility; it should have been MMC_IOC_MULTI_CMD rather than MMC_IOC_CMD_MULTI. o Now that we are reaching ever faster speeds (more improvement in this regard is to be expected when adding ADMA support to sdhci(4)), apply a few micro-optimizations to mmc(4), mmcsd(4) and sdhci(4). o Correct confusing and error prone mix-ups between "br" or "bridge" in mmc(4) and mmcsd(4) where - according to the terminology outlined in comments of bridge.h and mmcbr_if.m around since their addition in r163516 - the bus is meant and used instead. o Remove comment lines from bridge.h incorrectly suggesting that there would be a MMC bridge base class driver. o Update comments in bridge.h regarding the star topology of SD and SDIO; since version 3.00 of the SDHCI specification, for eSD and eSDIO bus topologies are actually possible in form of so called "shared buses" (in some subcontext later on renamed to "embedded" buses). Reported by: Coverity CID: 1372612 [1], 1372624 [2], 1372594 [3], 1007069 [4], 1378432 [5] Modified: stable/10/sys/dev/mmc/bridge.h stable/10/sys/dev/mmc/mmc.c stable/10/sys/dev/mmc/mmc_ioctl.h stable/10/sys/dev/mmc/mmc_private.h stable/10/sys/dev/mmc/mmc_subr.c stable/10/sys/dev/mmc/mmc_subr.h stable/10/sys/dev/mmc/mmcbr_if.m stable/10/sys/dev/mmc/mmcbrvar.h stable/10/sys/dev/mmc/mmcbus_if.m stable/10/sys/dev/mmc/mmcreg.h stable/10/sys/dev/mmc/mmcsd.c stable/10/sys/dev/sdhci/sdhci.c stable/10/sys/dev/sdhci/sdhci.h stable/10/sys/dev/sdhci/sdhci_acpi.c stable/10/sys/dev/sdhci/sdhci_if.m stable/10/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mmc/bridge.h ============================================================================== --- stable/10/sys/dev/mmc/bridge.h Sun Aug 6 16:07:25 2017 (r322119) +++ stable/10/sys/dev/mmc/bridge.h Sun Aug 6 16:07:34 2017 (r322120) @@ -65,12 +65,10 @@ * linux/mmc/host.h file. * * A mmc bridge is a chipset that can have one or more mmc and/or sd - * cards attached to it. mmc cards are attached on a bus topology, - * while sd and sdio cards are attached using a star topology (meaning - * in practice each sd card has its own, independent slot). Each - * mmcbr is assumed to be derived from the mmcbr. This is done to - * allow for easier addition of bridges (as each bridge does not need - * to be added to the mmcbus file). + * cards attached to it. mmc devices are attached on a bus topology, + * while sd and sdio cards usually are attached using a star topology + * (meaning in practice each sd card has its own, independent slot). + * Since SDHCI v3.00, buses for esd and esdio are possible, though. * * Attached to the mmc bridge is an mmcbus. The mmcbus is described * in dev/mmc/mmcbus_if.m. @@ -137,6 +135,10 @@ enum mmc_card_mode { mode_mmc, mode_sd }; +enum mmc_retune_req { + retune_req_none = 0, retune_req_normal, retune_req_reset +}; + struct mmc_host { int f_min; int f_max; @@ -177,7 +179,7 @@ struct mmc_host { extern driver_t mmc_driver; extern devclass_t mmc_devclass; -#define MMC_VERSION 3 +#define MMC_VERSION 4 #define MMC_DECLARE_BRIDGE(name) \ DRIVER_MODULE(mmc, name, mmc_driver, mmc_devclass, NULL, NULL); \ Modified: stable/10/sys/dev/mmc/mmc.c ============================================================================== --- stable/10/sys/dev/mmc/mmc.c Sun Aug 6 16:07:25 2017 (r322119) +++ stable/10/sys/dev/mmc/mmc.c Sun Aug 6 16:07:34 2017 (r322120) @@ -88,14 +88,14 @@ struct mmc_ivars { uint8_t raw_ext_csd[MMC_EXTCSD_SIZE]; /* Raw bits of the EXT_CSD */ uint32_t raw_sd_status[16]; /* Raw bits of the SD_STATUS */ uint16_t rca; + u_char read_only; /* True when the device is read-only */ + u_char high_cap; /* High Capacity device (block addressed) */ enum mmc_card_mode mode; + enum mmc_bus_width bus_width; /* Bus width to use */ struct mmc_cid cid; /* cid decoded */ struct mmc_csd csd; /* csd decoded */ struct mmc_scr scr; /* scr decoded */ struct mmc_sd_status sd_status; /* SD_STATUS decoded */ - u_char read_only; /* True when the device is read-only */ - u_char bus_width; /* Bus width to use */ - u_char high_cap; /* High Capacity card (block addressed) */ uint32_t sec_count; /* Card capacity in 512byte blocks */ uint32_t timings; /* Mask of bus timings supported */ uint32_t vccq_120; /* Mask of bus timings at VCCQ of 1.2 V */ @@ -128,8 +128,10 @@ static int mmc_read_ivar(device_t bus, device_t child, uintptr_t *result); static int mmc_release_bus(device_t busdev, device_t dev); static int mmc_resume(device_t dev); +static void mmc_retune_pause(device_t busdev, device_t dev, bool retune); +static void mmc_retune_unpause(device_t busdev, device_t dev); static int mmc_suspend(device_t dev); -static int mmc_wait_for_request(device_t brdev, device_t reqdev, +static int mmc_wait_for_request(device_t busdev, device_t dev, struct mmc_request *req); static int mmc_write_ivar(device_t bus, device_t child, int which, uintptr_t value); @@ -156,21 +158,23 @@ static void mmc_decode_cid_mmc(uint32_t *raw_cid, stru bool is_4_41p); static void mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid); static void mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd); -static void mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); +static int mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); static void mmc_delayed_attach(void *xsc); -static int mmc_delete_cards(struct mmc_softc *sc); +static int mmc_delete_cards(struct mmc_softc *sc, bool final); static void mmc_discover_cards(struct mmc_softc *sc); static void mmc_format_card_id_string(struct mmc_ivars *ivar); static void mmc_go_discovery(struct mmc_softc *sc); static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start, int size); static int mmc_highest_voltage(uint32_t ocr); +static bool mmc_host_timing(device_t dev, enum mmc_bus_timing timing); static void mmc_idle_cards(struct mmc_softc *sc); static void mmc_ms_delay(int ms); static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard); static void mmc_power_down(struct mmc_softc *sc); static void mmc_power_up(struct mmc_softc *sc); static void mmc_rescan_cards(struct mmc_softc *sc); +static int mmc_retune(device_t busdev, device_t dev, bool reset); static void mmc_scan(struct mmc_softc *sc); static int mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp, uint8_t value, uint8_t *res); @@ -184,15 +188,23 @@ static int mmc_send_op_cond(struct mmc_softc *sc, uint uint32_t *rocr); static int mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp); static int mmc_set_blocklen(struct mmc_softc *sc, uint32_t len); -static int mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar); +static int mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing); static int mmc_set_power_class(struct mmc_softc *sc, struct mmc_ivars *ivar); static int mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp); static int mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars *ivar, enum mmc_bus_timing timing); +static int mmc_set_vccq(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing); +static int mmc_switch_to_hs200(struct mmc_softc *sc, struct mmc_ivars *ivar, + uint32_t clock); +static int mmc_switch_to_hs400(struct mmc_softc *sc, struct mmc_ivars *ivar, + uint32_t max_dtr, enum mmc_bus_timing max_timing); static int mmc_test_bus_width(struct mmc_softc *sc); static uint32_t mmc_timing_to_dtr(struct mmc_ivars *ivar, enum mmc_bus_timing timing); static const char *mmc_timing_to_string(enum mmc_bus_timing timing); +static void mmc_update_child_list(struct mmc_softc *sc); static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode, uint32_t arg, uint32_t flags, uint32_t *resp, int retries); static int mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req); @@ -236,7 +248,8 @@ mmc_detach(device_t dev) struct mmc_softc *sc = device_get_softc(dev); int err; - if ((err = mmc_delete_cards(sc)) != 0) + err = mmc_delete_cards(sc, true); + if (err != 0) return (err); mmc_power_down(sc); MMC_LOCK_DESTROY(sc); @@ -251,10 +264,21 @@ mmc_suspend(device_t dev) int err; err = bus_generic_suspend(dev); - if (err) + if (err != 0) return (err); + /* + * We power down with the bus acquired here, mainly so that no device + * is selected any longer and sc->last_rca gets set to 0. Otherwise, + * the deselect as part of the bus acquisition in mmc_scan() may fail + * during resume, as the bus isn't powered up again before later in + * mmc_go_discovery(). + */ + err = mmc_acquire_bus(dev, dev); + if (err != 0) + return (err); mmc_power_down(sc); - return (0); + err = mmc_release_bus(dev, dev); + return (err); } static int @@ -271,7 +295,8 @@ mmc_acquire_bus(device_t busdev, device_t dev) { struct mmc_softc *sc; struct mmc_ivars *ivar; - int err, rca; + int err; + uint16_t rca; enum mmc_bus_timing timing; err = MMCBR_ACQUIRE_HOST(device_get_parent(busdev), busdev); @@ -295,12 +320,27 @@ mmc_acquire_bus(device_t busdev, device_t dev) rca = ivar->rca; if (sc->last_rca != rca) { if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to select.\n", rca); + device_printf(busdev, "Card at relative " + "address %d failed to select\n", rca); return (ENXIO); } sc->last_rca = rca; timing = mmcbr_get_timing(busdev); + /* + * For eMMC modes, setting/updating bus width and VCCQ + * only really is necessary if there actually is more + * than one device on the bus as generally that already + * had to be done by mmc_calculate_clock() or one of + * its calees. Moreover, setting the bus width anew + * can trigger re-tuning (via a CRC error on the next + * CMD), even if not switching between devices an the + * previously selected one is still tuned. Obviously, + * we need to re-tune the host controller if devices + * are actually switched, though. + */ + if (timing >= bus_timing_mmc_ddr52 && + sc->child_count == 1) + return (0); /* Prepare bus width for the new card. */ if (bootverbose || mmc_debug) { device_printf(busdev, @@ -309,38 +349,34 @@ mmc_acquire_bus(device_t busdev, device_t dev) (ivar->bus_width == bus_width_8) ? 8 : 1, mmc_timing_to_string(timing)); } - if (mmc_set_card_bus_width(sc, ivar) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to set bus width.\n", + if (mmc_set_card_bus_width(sc, ivar, timing) != + MMC_ERR_NONE) { + device_printf(busdev, "Card at relative " + "address %d failed to set bus width\n", rca); return (ENXIO); } - if (isset(&ivar->vccq_120, timing)) - mmcbr_set_vccq(busdev, vccq_120); - else if (isset(&ivar->vccq_180, timing)) - mmcbr_set_vccq(busdev, vccq_180); - else - mmcbr_set_vccq(busdev, vccq_330); - if (mmcbr_switch_vccq(busdev) != 0) { - device_printf(sc->dev, "Failed to set VCCQ " - "for card at relative address %d.\n", rca); + mmcbr_set_bus_width(busdev, ivar->bus_width); + mmcbr_update_ios(busdev); + if (mmc_set_vccq(sc, ivar, timing) != MMC_ERR_NONE) { + device_printf(busdev, "Failed to set VCCQ " + "for card at relative address %d\n", rca); return (ENXIO); } - if (mmc_set_power_class(sc, ivar) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to set power class.\n", - rca); + if (timing >= bus_timing_mmc_hs200 && + mmc_retune(busdev, dev, true) != 0) { + device_printf(busdev, "Card at relative " + "address %d failed to re-tune\n", rca); return (ENXIO); } - mmcbr_set_bus_width(busdev, ivar->bus_width); - mmcbr_update_ios(busdev); } } else { /* * If there's a card selected, stand down. */ if (sc->last_rca != 0) { - mmc_select_card(sc, 0); + if (mmc_select_card(sc, 0) != MMC_ERR_NONE) + return (ENXIO); sc->last_rca = 0; } } @@ -408,7 +444,7 @@ mmc_wait_for_req(struct mmc_softc *sc, struct mmc_requ req->done = mmc_wakeup; req->done_data = sc; - if (mmc_debug > 1) { + if (__predict_false(mmc_debug > 1)) { device_printf(sc->dev, "REQUEST: CMD%d arg %#x flags %#x", req->cmd->opcode, req->cmd->arg, req->cmd->flags); if (req->cmd->data) { @@ -421,18 +457,66 @@ mmc_wait_for_req(struct mmc_softc *sc, struct mmc_requ while ((req->flags & MMC_REQ_DONE) == 0) msleep(req, &sc->sc_mtx, 0, "mmcreq", 0); MMC_UNLOCK(sc); - if (mmc_debug > 2 || (mmc_debug > 0 && req->cmd->error != MMC_ERR_NONE)) + if (__predict_false(mmc_debug > 2 || (mmc_debug > 0 && + req->cmd->error != MMC_ERR_NONE))) device_printf(sc->dev, "CMD%d RESULT: %d\n", req->cmd->opcode, req->cmd->error); return (0); } static int -mmc_wait_for_request(device_t brdev, device_t reqdev __unused, - struct mmc_request *req) +mmc_wait_for_request(device_t busdev, device_t dev, struct mmc_request *req) { - struct mmc_softc *sc = device_get_softc(brdev); + struct mmc_softc *sc; + struct mmc_ivars *ivar; + int err, i; + enum mmc_retune_req retune_req; + sc = device_get_softc(busdev); + KASSERT(sc->owner != NULL, + ("%s: Request from %s without bus being acquired.", __func__, + device_get_nameunit(dev))); + + /* + * Unless no device is selected or re-tuning is already ongoing, + * execute re-tuning if a) the bridge is requesting to do so and + * re-tuning hasn't been otherwise paused, or b) if a child asked + * to be re-tuned prior to pausing (see also mmc_retune_pause()). + */ + if (__predict_false(sc->last_rca != 0 && sc->retune_ongoing == 0 && + (((retune_req = mmcbr_get_retune_req(busdev)) != retune_req_none && + sc->retune_paused == 0) || sc->retune_needed == 1))) { + if (__predict_false(mmc_debug > 1)) { + device_printf(busdev, + "Re-tuning with%s circuit reset required\n", + retune_req == retune_req_reset ? "" : "out"); + } + if (device_get_parent(dev) == busdev) + ivar = device_get_ivars(dev); + else { + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); + if (ivar->rca == sc->last_rca) + break; + } + if (ivar->rca != sc->last_rca) + return (EINVAL); + } + sc->retune_ongoing = 1; + err = mmc_retune(busdev, dev, retune_req == retune_req_reset); + sc->retune_ongoing = 0; + switch (err) { + case MMC_ERR_NONE: + case MMC_ERR_FAILED: /* Re-tune error but still might work */ + break; + case MMC_ERR_BADCRC: /* Switch failure on HS400 recovery */ + return (ENXIO); + case MMC_ERR_INVALID: /* Driver implementation b0rken */ + default: /* Unknown error, should not happen */ + return (EINVAL); + } + sc->retune_needed = 0; + } return (mmc_wait_for_req(sc, req)); } @@ -600,11 +684,14 @@ mmc_power_down(struct mmc_softc *sc) static int mmc_select_card(struct mmc_softc *sc, uint16_t rca) { - int flags; + int err, flags; flags = (rca ? MMC_RSP_R1B : MMC_RSP_NONE) | MMC_CMD_AC; - return (mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16, - flags, NULL, CMD_RETRIES)); + sc->retune_paused++; + err = mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16, + flags, NULL, CMD_RETRIES); + sc->retune_paused--; + return (err); } static int @@ -636,7 +723,8 @@ mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint } static int -mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar) +mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing) { struct mmc_command cmd; int err; @@ -669,28 +757,33 @@ mmc_set_card_bus_width(struct mmc_softc *sc, struct mm } else { switch (ivar->bus_width) { case bus_width_1: + if (timing == bus_timing_mmc_hs400 || + timing == bus_timing_mmc_hs400es) + return (MMC_ERR_INVALID); value = EXT_CSD_BUS_WIDTH_1; break; case bus_width_4: - switch (mmcbr_get_timing(sc->dev)) { + switch (timing) { case bus_timing_mmc_ddr52: - case bus_timing_mmc_hs200: - case bus_timing_mmc_hs400: - case bus_timing_mmc_hs400es: value = EXT_CSD_BUS_WIDTH_4_DDR; break; + case bus_timing_mmc_hs400: + case bus_timing_mmc_hs400es: + return (MMC_ERR_INVALID); default: value = EXT_CSD_BUS_WIDTH_4; break; } break; case bus_width_8: - switch (mmcbr_get_timing(sc->dev)) { + value = 0; + switch (timing) { + case bus_timing_mmc_hs400es: + value = EXT_CSD_BUS_WIDTH_ES; + /* FALLTHROUGH */ case bus_timing_mmc_ddr52: - case bus_timing_mmc_hs200: case bus_timing_mmc_hs400: - case bus_timing_mmc_hs400es: - value = EXT_CSD_BUS_WIDTH_8_DDR; + value |= EXT_CSD_BUS_WIDTH_8_DDR; break; default: value = EXT_CSD_BUS_WIDTH_8; @@ -815,6 +908,13 @@ mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars case bus_timing_mmc_ddr52: value = EXT_CSD_HS_TIMING_HS; break; + case bus_timing_mmc_hs200: + value = EXT_CSD_HS_TIMING_HS200; + break; + case bus_timing_mmc_hs400: + case bus_timing_mmc_hs400es: + value = EXT_CSD_HS_TIMING_HS400; + break; default: return (MMC_ERR_INVALID); } @@ -831,6 +931,23 @@ mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars return (err); } +static int +mmc_set_vccq(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing) +{ + + if (isset(&ivar->vccq_120, timing)) + mmcbr_set_vccq(sc->dev, vccq_120); + else if (isset(&ivar->vccq_180, timing)) + mmcbr_set_vccq(sc->dev, vccq_180); + else + mmcbr_set_vccq(sc->dev, vccq_330); + if (mmcbr_switch_vccq(sc->dev) != 0) + return (MMC_ERR_INVALID); + else + return (MMC_ERR_NONE); +} + static const uint8_t p8[8] = { 0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -1038,7 +1155,7 @@ static const int cur_max[8] = { 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 }; -static void +static int mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) { int v; @@ -1079,6 +1196,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *c csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); + return (MMC_ERR_NONE); } else if (v == 1) { m = mmc_get_bits(raw_csd, 128, 115, 4); e = mmc_get_bits(raw_csd, 128, 112, 3); @@ -1102,8 +1220,9 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *c csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); - } else - panic("unknown SD CSD version"); + return (MMC_ERR_NONE); + } + return (MMC_ERR_INVALID); } static void @@ -1367,6 +1486,53 @@ mmc_timing_to_string(enum mmc_bus_timing timing) return (""); } +static bool +mmc_host_timing(device_t dev, enum mmc_bus_timing timing) +{ + int host_caps; + + host_caps = mmcbr_get_caps(dev); + +#define HOST_TIMING_CAP(host_caps, cap) ({ \ + bool retval; \ + if (((host_caps) & (cap)) == (cap)) \ + retval = true; \ + else \ + retval = false; \ + retval; \ +}) + + switch (timing) { + case bus_timing_normal: + return (true); + case bus_timing_hs: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_HSPEED)); + case bus_timing_uhs_sdr12: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR12)); + case bus_timing_uhs_sdr25: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR25)); + case bus_timing_uhs_ddr50: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_DDR50)); + case bus_timing_uhs_sdr50: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR50)); + case bus_timing_uhs_sdr104: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR104)); + case bus_timing_mmc_ddr52: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_DDR52)); + case bus_timing_mmc_hs200: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS200)); + case bus_timing_mmc_hs400: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400)); + case bus_timing_mmc_hs400es: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400 | + MMC_CAP_MMC_ENH_STROBE)); + } + +#undef HOST_TIMING_CAP + + return (false); +} + static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard) { @@ -1398,9 +1564,8 @@ mmc_discover_cards(struct mmc_softc *sc) u_char switch_res[64]; uint32_t raw_cid[4]; struct mmc_ivars *ivar = NULL; - device_t *devlist; device_t child; - int devcount, err, host_caps, i, newcard; + int err, host_caps, i, newcard; uint32_t resp, sec_count, status; uint16_t rca = 2; @@ -1408,6 +1573,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (bootverbose || mmc_debug) device_printf(sc->dev, "Probing cards\n"); while (1) { + child = NULL; sc->squelched++; /* Errors are expected, squelch reporting. */ err = mmc_all_send_cid(sc, raw_cid); sc->squelched--; @@ -1418,18 +1584,14 @@ mmc_discover_cards(struct mmc_softc *sc) break; } newcard = 1; - if ((err = device_get_children(sc->dev, &devlist, - &devcount)) != 0) - return; - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (memcmp(ivar->raw_cid, raw_cid, sizeof(raw_cid)) == 0) { newcard = 0; break; } } - free(devlist, M_TEMP); if (bootverbose || mmc_debug) { device_printf(sc->dev, "%sard detected (CID %08x%08x%08x%08x)\n", @@ -1452,7 +1614,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting RCA %d\n", err); - break; + goto free_ivar; } ivar->rca = resp >> 16; /* Get card CSD. */ @@ -1460,7 +1622,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting CSD %d\n", err); - break; + goto free_ivar; } if (bootverbose || mmc_debug) device_printf(sc->dev, @@ -1468,7 +1630,11 @@ mmc_discover_cards(struct mmc_softc *sc) newcard ? "New c" : "C", ivar->raw_csd[0], ivar->raw_csd[1], ivar->raw_csd[2], ivar->raw_csd[3]); - mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); + err = mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); + if (err != MMC_ERR_NONE) { + device_printf(sc->dev, "Error decoding CSD\n"); + goto free_ivar; + } ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; @@ -1481,12 +1647,12 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading card status %d\n", err); - break; + goto free_ivar; } if ((status & R1_CARD_IS_LOCKED) != 0) { device_printf(sc->dev, - "Card is password protected, skipping.\n"); - break; + "Card is password protected, skipping\n"); + goto free_ivar; } /* Get card SCR. Card must be selected to fetch it. */ @@ -1494,13 +1660,13 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error selecting card %d\n", err); - break; + goto free_ivar; } err = mmc_app_send_scr(sc, ivar->rca, ivar->raw_scr); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading SCR %d\n", err); - break; + goto free_ivar; } mmc_app_decode_scr(ivar->raw_scr, &ivar->scr); /* Get card switch capabilities (command class 10). */ @@ -1528,7 +1694,7 @@ mmc_discover_cards(struct mmc_softc *sc) * use from the sd_status is the erase sector size, but * it is still nice to get that right. */ - mmc_select_card(sc, 0); + (void)mmc_select_card(sc, 0); (void)mmc_select_card(sc, ivar->rca); (void)mmc_app_sd_status(sc, ivar->rca, ivar->raw_sd_status); @@ -1538,47 +1704,24 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->erase_sector = 16 << ivar->sd_status.au_size; } - /* Find max supported bus width. */ + /* Find maximum supported bus width. */ if ((host_caps & MMC_CAP_4_BIT_DATA) && (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) ivar->bus_width = bus_width_4; - /* - * Some cards that report maximum I/O block sizes - * greater than 512 require the block length to be - * set to 512, even though that is supposed to be - * the default. Example: - * - * Transcend 2GB SDSC card, CID: - * mid=0x1b oid=0x534d pnm="00000" prv=1.0 mdt=00.2000 - */ - if (ivar->csd.read_bl_len != MMC_SECTOR_SIZE || - ivar->csd.write_bl_len != MMC_SECTOR_SIZE) - mmc_set_blocklen(sc, MMC_SECTOR_SIZE); - - mmc_format_card_id_string(ivar); - - if (bootverbose || mmc_debug) - mmc_log_card(sc->dev, ivar, newcard); - if (newcard) { - /* Add device. */ - child = device_add_child(sc->dev, NULL, -1); - device_set_ivars(child, ivar); - } - mmc_select_card(sc, 0); - return; + goto child_common; } ivar->rca = rca++; err = mmc_set_relative_addr(sc, ivar->rca); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error setting RCA %d\n", err); - break; + goto free_ivar; } /* Get card CSD. */ err = mmc_send_csd(sc, ivar->rca, ivar->raw_csd); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting CSD %d\n", err); - break; + goto free_ivar; } if (bootverbose || mmc_debug) device_printf(sc->dev, @@ -1597,19 +1740,19 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading card status %d\n", err); - break; + goto free_ivar; } if ((status & R1_CARD_IS_LOCKED) != 0) { device_printf(sc->dev, - "Card is password protected, skipping.\n"); - break; + "Card is password protected, skipping\n"); + goto free_ivar; } err = mmc_select_card(sc, ivar->rca); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error selecting card %d\n", err); - break; + goto free_ivar; } /* Only MMC >= 4.x devices support EXT_CSD. */ @@ -1619,7 +1762,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading EXT_CSD %d\n", err); - break; + goto free_ivar; } /* Handle extended capacity from EXT_CSD */ sec_count = ivar->raw_ext_csd[EXT_CSD_SEC_CNT] + @@ -1630,6 +1773,8 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->sec_count = sec_count; ivar->high_cap = 1; } + /* Find maximum supported bus width. */ + ivar->bus_width = mmc_test_bus_width(sc); /* Get device speeds beyond normal mode. */ if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_HS_52) != 0) { @@ -1652,6 +1797,50 @@ mmc_discover_cards(struct mmc_softc *sc) setbit(&ivar->timings, bus_timing_mmc_ddr52); setbit(&ivar->vccq_180, bus_timing_mmc_ddr52); } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS200_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0) { + setbit(&ivar->timings, bus_timing_mmc_hs200); + setbit(&ivar->vccq_120, bus_timing_mmc_hs200); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS200_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0) { + setbit(&ivar->timings, bus_timing_mmc_hs200); + setbit(&ivar->vccq_180, bus_timing_mmc_hs200); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400); + setbit(&ivar->vccq_120, bus_timing_mmc_hs400); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400); + setbit(&ivar->vccq_180, bus_timing_mmc_hs400); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_2V) != 0 && + (ivar->raw_ext_csd[EXT_CSD_STROBE_SUPPORT] & + EXT_CSD_STROBE_SUPPORT_EN) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400es); + setbit(&ivar->vccq_120, bus_timing_mmc_hs400es); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_8V) != 0 && + (ivar->raw_ext_csd[EXT_CSD_STROBE_SUPPORT] & + EXT_CSD_STROBE_SUPPORT_EN) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400es); + setbit(&ivar->vccq_180, bus_timing_mmc_hs400es); + } /* * Determine generic switch timeout (provided in * units of 10 ms), defaulting to 500 ms. @@ -1660,8 +1849,6 @@ mmc_discover_cards(struct mmc_softc *sc) if (ivar->csd.spec_vers >= 6) ivar->cmd6_time = 10 * ivar->raw_ext_csd[EXT_CSD_GEN_CMD6_TIME]; - /* Find max supported bus width. */ - ivar->bus_width = mmc_test_bus_width(sc); /* Handle HC erase sector size. */ if (ivar->raw_ext_csd[EXT_CSD_ERASE_GRP_SIZE] != 0) { ivar->erase_sector = 1024 * @@ -1675,11 +1862,15 @@ mmc_discover_cards(struct mmc_softc *sc) device_printf(sc->dev, "Error setting erase group %d\n", err); - break; + goto free_ivar; } } } + mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, + ivar->raw_ext_csd[EXT_CSD_REV] >= 5); + +child_common: /* * Some cards that report maximum I/O block sizes greater * than 512 require the block length to be set to 512, even @@ -1692,8 +1883,6 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->csd.write_bl_len != MMC_SECTOR_SIZE) mmc_set_blocklen(sc, MMC_SECTOR_SIZE); - mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, - ivar->raw_ext_csd[EXT_CSD_REV] >= 5); mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) @@ -1701,56 +1890,111 @@ mmc_discover_cards(struct mmc_softc *sc) if (newcard) { /* Add device. */ child = device_add_child(sc->dev, NULL, -1); - device_set_ivars(child, ivar); + if (child != NULL) { + device_set_ivars(child, ivar); + sc->child_list = realloc(sc->child_list, + sizeof(device_t) * sc->child_count + 1, + M_DEVBUF, M_WAITOK); + sc->child_list[sc->child_count++] = child; + } else + device_printf(sc->dev, "Error adding child\n"); } - mmc_select_card(sc, 0); + +free_ivar: + if (newcard && child == NULL) + free(ivar, M_DEVBUF); + (void)mmc_select_card(sc, 0); + /* + * Not returning here when one MMC device could no be added + * potentially would mean looping forever when that device + * is broken (in which case it also may impact the remainder + * of the bus anyway, though). + */ + if ((newcard && child == NULL) || + mmcbr_get_mode(sc->dev) == mode_sd) + return; } } static void +mmc_update_child_list(struct mmc_softc *sc) +{ + device_t child; + int i, j; + + if (sc->child_count == 0) { + free(sc->child_list, M_DEVBUF); + return; + } + for (i = j = 0; i < sc->child_count; i++) { + for (;;) { + child = sc->child_list[j++]; + if (child != NULL) + break; + } + if (i != j) + sc->child_list[i] = child; + } + sc->child_list = realloc(sc->child_list, sizeof(device_t) * + sc->child_count, M_DEVBUF, M_WAITOK); +} + +static void mmc_rescan_cards(struct mmc_softc *sc) { struct mmc_ivars *ivar; - device_t *devlist; - int err, i, devcount; + int err, i, j; - if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) - return; - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + for (i = j = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (mmc_select_card(sc, ivar->rca) != MMC_ERR_NONE) { if (bootverbose || mmc_debug) device_printf(sc->dev, - "Card at relative address %d lost.\n", + "Card at relative address %d lost\n", ivar->rca); - device_delete_child(sc->dev, devlist[i]); + err = device_delete_child(sc->dev, sc->child_list[i]); + if (err != 0) { + j++; + continue; + } free(ivar, M_DEVBUF); - } + } else + j++; } - free(devlist, M_TEMP); - mmc_select_card(sc, 0); + if (sc->child_count == j) + goto out; + sc->child_count = j; + mmc_update_child_list(sc); +out: + (void)mmc_select_card(sc, 0); } static int -mmc_delete_cards(struct mmc_softc *sc) +mmc_delete_cards(struct mmc_softc *sc, bool final) { struct mmc_ivars *ivar; - device_t *devlist; - int err, i, devcount; + int err, i, j; - if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) - return (err); - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + err = 0; + for (i = j = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (bootverbose || mmc_debug) device_printf(sc->dev, - "Card at relative address %d deleted.\n", + "Card at relative address %d deleted\n", ivar->rca); - device_delete_child(sc->dev, devlist[i]); + err = device_delete_child(sc->dev, sc->child_list[i]); + if (err != 0) { + j++; + if (final == false) + continue; + else + break; + } free(ivar, M_DEVBUF); } - free(devlist, M_TEMP); - return (0); + sc->child_count = j; + mmc_update_child_list(sc); + return (err); } static void @@ -1814,7 +2058,7 @@ mmc_go_discovery(struct mmc_softc *sc) mmcbr_get_ocr(dev)); if (mmcbr_get_ocr(dev) == 0) { device_printf(sc->dev, "No compatible cards found on bus\n"); - mmc_delete_cards(sc); + (void)mmc_delete_cards(sc, false); mmc_power_down(sc); return; } @@ -1838,31 +2082,27 @@ mmc_go_discovery(struct mmc_softc *sc) static int mmc_calculate_clock(struct mmc_softc *sc) { - device_t *kids; + device_t dev; struct mmc_ivars *ivar; - int host_caps, i, nkid; + int i; uint32_t dtr, max_dtr; + uint16_t rca; enum mmc_bus_timing max_timing, timing; - bool changed; + bool changed, hs400; - max_dtr = mmcbr_get_f_max(sc->dev); - host_caps = mmcbr_get_caps(sc->dev); - if ((host_caps & MMC_CAP_MMC_DDR52) != 0) - max_timing = bus_timing_mmc_ddr52; - else if ((host_caps & MMC_CAP_HSPEED) != 0) - max_timing = bus_timing_hs; - else - max_timing = bus_timing_normal; - if (device_get_children(sc->dev, &kids, &nkid) != 0) - panic("can't get children"); + dev = sc->dev; + max_dtr = mmcbr_get_f_max(dev); + max_timing = bus_timing_max; do { changed = false; - for (i = 0; i < nkid; i++) { - ivar = device_get_ivars(kids[i]); - if (isclr(&ivar->timings, max_timing)) { - for (timing = max_timing; timing >= + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); + if (isclr(&ivar->timings, max_timing) || + !mmc_host_timing(dev, max_timing)) { + for (timing = max_timing - 1; timing >= bus_timing_normal; timing--) { - if (isset(&ivar->timings, timing)) { + if (isset(&ivar->timings, timing) && *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Aug 6 16:12:47 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BCAEDBC291; Sun, 6 Aug 2017 16:12:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 77B5365338; Sun, 6 Aug 2017 16:12:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v76GCkum091691; Sun, 6 Aug 2017 16:12:46 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v76GCkPw091687; Sun, 6 Aug 2017 16:12:46 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708061612.v76GCkPw091687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 6 Aug 2017 16:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322121 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/sdhci X-SVN-Commit-Revision: 322121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 16:12:47 -0000 Author: marius Date: Sun Aug 6 16:12:46 2017 New Revision: 322121 URL: https://svnweb.freebsd.org/changeset/base/322121 Log: MFC: r321589 - Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE} for embedded slots. Fail in the sdhci(4) initialization for slot type shared, which is completely unsupported by this driver at the moment. [1] For Intel eMMC controllers, taking the embedded slot type into account obsoltes setting SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE so remove these quirk entries. - Hide the 1.8 V VDD capability when the slot is detected as non-embedded, as the SDHCI specification explicitly states that 1.8 V VDD is applicable to embedded slots only. [2] - Define some easy bits of the SDHCI specification v4.20. [3] - Don't leak bus_dma(9) resources in failure paths of sdhci_init_slot(). Obtained from: DragonFlyBSD 65704a46 [1], 7ba10b88 [2], 0df14648 [3] Modified: stable/11/sys/dev/sdhci/sdhci.c stable/11/sys/dev/sdhci/sdhci.h stable/11/sys/dev/sdhci/sdhci_acpi.c stable/11/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.c Sun Aug 6 16:07:34 2017 (r322120) +++ stable/11/sys/dev/sdhci/sdhci.c Sun Aug 6 16:12:46 2017 (r322121) @@ -657,6 +657,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, BUS_DMA_NOWAIT, &slot->dmamap); if (err != 0) { device_printf(dev, "Can't alloc DMA memory\n"); + bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); return (err); } @@ -666,6 +667,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, sdhci_getaddr, &slot->paddr, 0); if (err != 0 || slot->paddr == 0) { device_printf(dev, "Can't load DMA memory\n"); + bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); if (err) return (err); @@ -685,6 +688,22 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, else caps2 = 0; } + if (slot->version >= SDHCI_SPEC_300) { + if ((caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_REMOVABLE && + (caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_EMBEDDED) { + device_printf(dev, + "Driver doesn't support shared bus slots\n"); + bus_dmamap_unload(slot->dmatag, slot->dmamap); + bus_dmamem_free(slot->dmatag, slot->dmamem, + slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); + SDHCI_LOCK_DESTROY(slot); + return (ENXIO); + } else if ((caps & SDHCI_SLOTTYPE_MASK) == + SDHCI_SLOTTYPE_EMBEDDED) { + slot->opt |= SDHCI_SLOT_EMBEDDED | SDHCI_NON_REMOVABLE; + } + } /* Calculate base clock frequency. */ if (slot->version >= SDHCI_SPEC_300) freq = (caps & SDHCI_CLOCK_V3_BASE_MASK) >> @@ -734,7 +753,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340; if (caps & SDHCI_CAN_VDD_300) slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; - if (caps & SDHCI_CAN_VDD_180) + /* 1.8V VDD is not supposed to be used for removable cards. */ + if ((caps & SDHCI_CAN_VDD_180) && (slot->opt & SDHCI_SLOT_EMBEDDED)) slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; if (slot->host.host_ocr == 0) { device_printf(dev, "Hardware doesn't report any " @@ -881,20 +901,24 @@ no_tuning: if (bootverbose || sdhci_debug) { slot_printf(slot, - "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s\n", + "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s %s\n", slot->max_clk / 1000000, (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", (host_caps & MMC_CAP_8_BIT_DATA) ? "8bits" : ((host_caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", - (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", + ((caps & SDHCI_CAN_VDD_180) && + (slot->opt & SDHCI_SLOT_EMBEDDED)) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_180) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_120) ? " 1.2V" : "", (host_caps & MMC_CAP_DRIVER_TYPE_A) ? "A" : "", (host_caps & MMC_CAP_DRIVER_TYPE_C) ? "C" : "", (host_caps & MMC_CAP_DRIVER_TYPE_D) ? "D" : "", - (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); + (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO", + (slot->opt & SDHCI_SLOT_EMBEDDED) ? "embedded" : + (slot->opt & SDHCI_NON_REMOVABLE) ? "non-removable" : + "removable"); if (host_caps & (MMC_CAP_MMC_DDR52 | MMC_CAP_MMC_HS200 | MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) slot_printf(slot, "eMMC:%s%s%s%s\n", Modified: stable/11/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.h Sun Aug 6 16:07:34 2017 (r322120) +++ stable/11/sys/dev/sdhci/sdhci.h Sun Aug 6 16:12:46 2017 (r322121) @@ -233,6 +233,11 @@ #define SDHCI_HOST_CONTROL2 0x3E #define SDHCI_CTRL2_PRESET_VALUE 0x8000 #define SDHCI_CTRL2_ASYNC_INTR 0x4000 +#define SDHCI_CTRL2_64BIT_ENABLE 0x2000 +#define SDHCI_CTRL2_HOST_V4_ENABLE 0x1000 +#define SDHCI_CTRL2_CMD23_ENABLE 0x0800 +#define SDHCI_CTRL2_ADMA2_LENGTH_MODE 0x0400 +#define SDHCI_CTRL2_UHS2_IFACE_ENABLE 0x0100 #define SDHCI_CTRL2_SAMPLING_CLOCK 0x0080 #define SDHCI_CTRL2_EXEC_TUNING 0x0040 #define SDHCI_CTRL2_DRIVER_TYPE_MASK 0x0030 @@ -317,6 +322,8 @@ #define SDHCI_SPEC_200 1 #define SDHCI_SPEC_300 2 #define SDHCI_SPEC_400 3 +#define SDHCI_SPEC_410 4 +#define SDHCI_SPEC_420 5 SYSCTL_DECL(_hw_sdhci); @@ -338,6 +345,7 @@ struct sdhci_slot { #define SDHCI_TUNING_SUPPORTED 0x08 #define SDHCI_TUNING_ENABLED 0x10 #define SDHCI_SDR50_NEEDS_TUNING 0x20 +#define SDHCI_SLOT_EMBEDDED 0x40 u_char version; int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ Modified: stable/11/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_acpi.c Sun Aug 6 16:07:34 2017 (r322120) +++ stable/11/sys/dev/sdhci/sdhci_acpi.c Sun Aug 6 16:12:46 2017 (r322121) @@ -58,7 +58,6 @@ static const struct sdhci_acpi_device { u_int quirks; } sdhci_acpi_devices[] = { { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | @@ -76,7 +75,6 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "80865ACC", 0, "Intel Apollo Lake eMMC 5.0 Controller", SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | Modified: stable/11/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_pci.c Sun Aug 6 16:07:34 2017 (r322120) +++ stable/11/sys/dev/sdhci/sdhci_pci.c Sun Aug 6 16:12:46 2017 (r322121) @@ -104,7 +104,6 @@ static const struct sdhci_device { { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | @@ -114,14 +113,12 @@ static const struct sdhci_device { SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | @@ -137,7 +134,6 @@ static const struct sdhci_device { SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | From owner-svn-src-stable@freebsd.org Sun Aug 6 16:12:58 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41CC8DBC307; Sun, 6 Aug 2017 16:12:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 15223653A7; Sun, 6 Aug 2017 16:12:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v76GCvG0091744; Sun, 6 Aug 2017 16:12:57 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v76GCu4B091740; Sun, 6 Aug 2017 16:12:56 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708061612.v76GCu4B091740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 6 Aug 2017 16:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322122 - stable/10/sys/dev/sdhci X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/dev/sdhci X-SVN-Commit-Revision: 322122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 16:12:58 -0000 Author: marius Date: Sun Aug 6 16:12:56 2017 New Revision: 322122 URL: https://svnweb.freebsd.org/changeset/base/322122 Log: MFC: r321589 - Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE} for embedded slots. Fail in the sdhci(4) initialization for slot type shared, which is completely unsupported by this driver at the moment. [1] For Intel eMMC controllers, taking the embedded slot type into account obsoltes setting SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE so remove these quirk entries. - Hide the 1.8 V VDD capability when the slot is detected as non-embedded, as the SDHCI specification explicitly states that 1.8 V VDD is applicable to embedded slots only. [2] - Define some easy bits of the SDHCI specification v4.20. [3] - Don't leak bus_dma(9) resources in failure paths of sdhci_init_slot(). Obtained from: DragonFlyBSD 65704a46 [1], 7ba10b88 [2], 0df14648 [3] Modified: stable/10/sys/dev/sdhci/sdhci.c stable/10/sys/dev/sdhci/sdhci.h stable/10/sys/dev/sdhci/sdhci_acpi.c stable/10/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.c Sun Aug 6 16:12:46 2017 (r322121) +++ stable/10/sys/dev/sdhci/sdhci.c Sun Aug 6 16:12:56 2017 (r322122) @@ -658,6 +658,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, BUS_DMA_NOWAIT, &slot->dmamap); if (err != 0) { device_printf(dev, "Can't alloc DMA memory\n"); + bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); return (err); } @@ -667,6 +668,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, sdhci_getaddr, &slot->paddr, 0); if (err != 0 || slot->paddr == 0) { device_printf(dev, "Can't load DMA memory\n"); + bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); if (err) return (err); @@ -686,6 +689,22 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, else caps2 = 0; } + if (slot->version >= SDHCI_SPEC_300) { + if ((caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_REMOVABLE && + (caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_EMBEDDED) { + device_printf(dev, + "Driver doesn't support shared bus slots\n"); + bus_dmamap_unload(slot->dmatag, slot->dmamap); + bus_dmamem_free(slot->dmatag, slot->dmamem, + slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); + SDHCI_LOCK_DESTROY(slot); + return (ENXIO); + } else if ((caps & SDHCI_SLOTTYPE_MASK) == + SDHCI_SLOTTYPE_EMBEDDED) { + slot->opt |= SDHCI_SLOT_EMBEDDED | SDHCI_NON_REMOVABLE; + } + } /* Calculate base clock frequency. */ if (slot->version >= SDHCI_SPEC_300) freq = (caps & SDHCI_CLOCK_V3_BASE_MASK) >> @@ -735,7 +754,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340; if (caps & SDHCI_CAN_VDD_300) slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; - if (caps & SDHCI_CAN_VDD_180) + /* 1.8V VDD is not supposed to be used for removable cards. */ + if ((caps & SDHCI_CAN_VDD_180) && (slot->opt & SDHCI_SLOT_EMBEDDED)) slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; if (slot->host.host_ocr == 0) { device_printf(dev, "Hardware doesn't report any " @@ -882,20 +902,24 @@ no_tuning: if (bootverbose || sdhci_debug) { slot_printf(slot, - "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s\n", + "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s %s\n", slot->max_clk / 1000000, (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", (host_caps & MMC_CAP_8_BIT_DATA) ? "8bits" : ((host_caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", - (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", + ((caps & SDHCI_CAN_VDD_180) && + (slot->opt & SDHCI_SLOT_EMBEDDED)) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_180) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_120) ? " 1.2V" : "", (host_caps & MMC_CAP_DRIVER_TYPE_A) ? "A" : "", (host_caps & MMC_CAP_DRIVER_TYPE_C) ? "C" : "", (host_caps & MMC_CAP_DRIVER_TYPE_D) ? "D" : "", - (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); + (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO", + (slot->opt & SDHCI_SLOT_EMBEDDED) ? "embedded" : + (slot->opt & SDHCI_NON_REMOVABLE) ? "non-removable" : + "removable"); if (host_caps & (MMC_CAP_MMC_DDR52 | MMC_CAP_MMC_HS200 | MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) slot_printf(slot, "eMMC:%s%s%s%s\n", Modified: stable/10/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.h Sun Aug 6 16:12:46 2017 (r322121) +++ stable/10/sys/dev/sdhci/sdhci.h Sun Aug 6 16:12:56 2017 (r322122) @@ -233,6 +233,11 @@ #define SDHCI_HOST_CONTROL2 0x3E #define SDHCI_CTRL2_PRESET_VALUE 0x8000 #define SDHCI_CTRL2_ASYNC_INTR 0x4000 +#define SDHCI_CTRL2_64BIT_ENABLE 0x2000 +#define SDHCI_CTRL2_HOST_V4_ENABLE 0x1000 +#define SDHCI_CTRL2_CMD23_ENABLE 0x0800 +#define SDHCI_CTRL2_ADMA2_LENGTH_MODE 0x0400 +#define SDHCI_CTRL2_UHS2_IFACE_ENABLE 0x0100 #define SDHCI_CTRL2_SAMPLING_CLOCK 0x0080 #define SDHCI_CTRL2_EXEC_TUNING 0x0040 #define SDHCI_CTRL2_DRIVER_TYPE_MASK 0x0030 @@ -317,6 +322,8 @@ #define SDHCI_SPEC_200 1 #define SDHCI_SPEC_300 2 #define SDHCI_SPEC_400 3 +#define SDHCI_SPEC_410 4 +#define SDHCI_SPEC_420 5 SYSCTL_DECL(_hw_sdhci); @@ -338,6 +345,7 @@ struct sdhci_slot { #define SDHCI_TUNING_SUPPORTED 0x08 #define SDHCI_TUNING_ENABLED 0x10 #define SDHCI_SDR50_NEEDS_TUNING 0x20 +#define SDHCI_SLOT_EMBEDDED 0x40 u_char version; int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ Modified: stable/10/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_acpi.c Sun Aug 6 16:12:46 2017 (r322121) +++ stable/10/sys/dev/sdhci/sdhci_acpi.c Sun Aug 6 16:12:56 2017 (r322122) @@ -58,7 +58,6 @@ static const struct sdhci_acpi_device { u_int quirks; } sdhci_acpi_devices[] = { { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | @@ -76,7 +75,6 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "80865ACC", 0, "Intel Apollo Lake eMMC 5.0 Controller", SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | Modified: stable/10/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_pci.c Sun Aug 6 16:12:46 2017 (r322121) +++ stable/10/sys/dev/sdhci/sdhci_pci.c Sun Aug 6 16:12:56 2017 (r322122) @@ -104,7 +104,6 @@ static const struct sdhci_device { { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | @@ -114,14 +113,12 @@ static const struct sdhci_device { SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | @@ -137,7 +134,6 @@ static const struct sdhci_device { SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | From owner-svn-src-stable@freebsd.org Mon Aug 7 02:15:15 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D82DDD7BBB; Mon, 7 Aug 2017 02:15:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2BFCE76665; Mon, 7 Aug 2017 02:15:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v772FEow034565; Mon, 7 Aug 2017 02:15:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v772FEos034561; Mon, 7 Aug 2017 02:15:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708070215.v772FEos034561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 7 Aug 2017 02:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322129 - in stable/10: contrib/hyperv/tools/scripts etc/devd libexec/hyperv X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in stable/10: contrib/hyperv/tools/scripts etc/devd libexec/hyperv X-SVN-Commit-Revision: 322129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 02:15:15 -0000 Author: sephe Date: Mon Aug 7 02:15:13 2017 New Revision: 322129 URL: https://svnweb.freebsd.org/changeset/base/322129 Log: MFC 321762 hyperv: Add VF bringup scripts and devd rules. How network VF works with hn(4) on Hyper-V in non-transparent mode: - Each network VF has a cooresponding hn(4). - The network VF and the it's cooresponding hn(4) have the same hardware address. - Once the network VF is up, e.g. ifconfig VF up: o All of the transmission should go through the network VF. o Most of the reception goes through the network VF. o Small amount of reception may go through the cooresponding hn(4). This reception will happen, even if the the cooresponding hn(4) is down. The cooresponding hn(4) will change the reception interface to the network VF, so that network layer and application layer will be tricked into thinking that these packets were received by the network VF. o The cooresponding hn(4) pretends the physical link is down. - Once the network VF is down or detached: o All of the transmission should go through the cooresponding hn(4). o All of the reception goes through the cooresponding hn(4). o The cooresponding hn(4) fallbacks to the original physical link detection logic. All these features are mainly used to help live migration, during which the network VF will be detached, while the network communication to the VM must not be cut off. In order to reach this level of live migration transparency, we use failover mode lagg(4) with the network VF and the cooresponding hn(4) attached to it. To ease user configuration for both network VF and non-network VF, the lagg(4) will be created by the following rules, and the configuration of the cooresponding hn(4) will be applied to the lagg(4) automatically. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11635 Added: stable/10/contrib/hyperv/tools/scripts/hyperv_vfattach - copied unchanged from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfattach stable/10/contrib/hyperv/tools/scripts/hyperv_vfup - copied unchanged from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfup Modified: stable/10/etc/devd/hyperv.conf stable/10/libexec/hyperv/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/hyperv/tools/scripts/hyperv_vfattach (from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfattach) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/hyperv/tools/scripts/hyperv_vfattach Mon Aug 7 02:15:13 2017 (r322129, copy of r321762, head/contrib/hyperv/tools/scripts/hyperv_vfattach) @@ -0,0 +1,79 @@ +#!/bin/sh + +# +# If transparent VF is enabled, don't do anything. +# + +sysctl -n hw.hn.vf_transparent > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Old kernel; no transparent VF. + vf_transparent=0 +else + vf_transparent=`sysctl -n hw.hn.vf_transparent` +fi + +if [ $vf_transparent -ne 0 ] +then + # Transparent VF; done! + exit 0 +fi + +iface=$1 +delay=$2 + +if [ $delay -gt 0 ] +then + # + # Delayed VF up. + # + sleep $delay + ifconfig $iface up + # Done! + exit $? +fi + +# +# Check to see whether $iface is a VF or not. +# If $iface is a VF, bring it up now. +# + +# for hyperv_vf_delay +. /etc/rc.conf + +sysctl -n hw.hn.vflist > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Old kernel; nothing could be done properly. + exit 0 +fi +vf_list=`sysctl -n hw.hn.vflist` + +for vf in $vf_list +do + if [ $vf = $iface ] + then + # + # Linger a little bit (at least 2 seconds) mainly to + # make sure that $iface is fully attached. + # + # NOTE: + # In Azure hyperv_vf_delay should be configured to a + # large value, e.g. 120 seconds, to avoid racing cloud + # agent goofs. + # + test $hyperv_vf_delay -ge 2 > /dev/null 2>&1 + if [ $? -ne 0 ] + then + hyperv_vf_delay=2 + fi + # + # NOTE: + # "(sleep ..; ifconfig .. up) > /dev/null 2>&1 &" + # does _not_ work. + # + daemon -f /usr/libexec/hyperv/hyperv_vfattach \ + $iface $hyperv_vf_delay + break + fi +done Copied: stable/10/contrib/hyperv/tools/scripts/hyperv_vfup (from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfup) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/hyperv/tools/scripts/hyperv_vfup Mon Aug 7 02:15:13 2017 (r322129, copy of r321762, head/contrib/hyperv/tools/scripts/hyperv_vfup) @@ -0,0 +1,119 @@ +#!/bin/sh + +. /etc/rc.subr +. /etc/network.subr + +load_rc_config netif + +# +# Customized per-interface setup, e.g. hyperv_vfup.hn1 +# +# NOTE-CUSTOMIZE: +# Comment this out, if this script is used as template +# for the customized per-interface setup. +# +if [ -f /usr/libexec/hyperv/hyperv_vfup.$1 ] +then + /usr/libexec/hyperv/hyperv_vfup.$1 + exit $? +fi + +# NOTE-CUSTOMIZE: +#hn=${0##*.} +hn=$1 +hn_unit=`echo $hn | sed 's/[^0-9]*//g'` + +vf=`sysctl -n dev.hn.$hn_unit.vf` +if [ ! $vf ] +then + # Race happened; VF was removed, before we ran. + echo "$hn: VF was detached" + exit 0 +fi + +# +# Create laggX for hnX. +# Add VF and hnX to laggX. +# + +lagg=lagg$hn_unit + +ifconfig $lagg > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # + # No laggX, create it now. + # + ifconfig $lagg create > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "$lagg creation failed" + exit 1 + fi + + # + # Configure laggX (failover), add hnX and VF to it. + # + ifconfig $lagg laggproto failover laggport $hn laggport $vf + ifconfig $lagg inet6 no_dad + + # + # Stop dhclient on hnX, if any. + # + pidfile=/var/run/dhclient.$hn.pid + if [ -f $pidfile ] + then + kill -TERM `cat $pidfile` + fi + + # + # Remove all configured IPv4 addresses on hnX, e.g. + # configured by dhclient. laggX will take over the + # network operations. + # + while true + do + ifconfig $hn -alias > /dev/null 2>&1 + if [ $? -ne 0 ] + then + break + fi + done + + # TODO: Remove IPv6 addresses on hnX + + # + # Use hnX's configuration for laggX + # + # NOTE-CUSTOMIZE: + # If this script is used as template for the customized + # per-interface setup, replace this with whatever you + # want to do with the laggX. + # + if dhcpif $hn; + then + ifconfig $lagg up + if syncdhcpif $hn; + then + dhclient $lagg + else + dhclient -b $lagg + fi + else + ifconfig_args=`ifconfig_getargs $hn` + if [ -n "$ifconfig_args" ] + then + ifconfig $lagg $ifconfig_args + fi + fi +else + # + # laggX exists. Check whether VF was there or not. + # If VF was not added to laggX, add it now. + # + ifconfig $lagg | grep "laggport: $vf" > /dev/null 2>&1 + if [ $? -ne 0 ] + then + ifconfig $lagg laggport $vf + fi +fi Modified: stable/10/etc/devd/hyperv.conf ============================================================================== --- stable/10/etc/devd/hyperv.conf Mon Aug 7 01:09:33 2017 (r322128) +++ stable/10/etc/devd/hyperv.conf Mon Aug 7 02:15:13 2017 (r322129) @@ -33,3 +33,76 @@ notify 11 { match "cdev" "hv_fsvss_dev"; action "pkill -x hv_vss_daemon"; }; + +# +# Rules for non-transparent network VF. +# +# How network VF works with hn(4) on Hyper-V in non-transparent mode: +# +# - Each network VF has a cooresponding hn(4). +# - The network VF and the it's cooresponding hn(4) have the same hardware +# address. +# - Once the network VF is up, e.g. ifconfig VF up: +# o All of the transmission should go through the network VF. +# o Most of the reception goes through the network VF. +# o Small amount of reception may go through the cooresponding hn(4). +# This reception will happen, even if the the cooresponding hn(4) is +# down. The cooresponding hn(4) will change the reception interface +# to the network VF, so that network layer and application layer will +# be tricked into thinking that these packets were received by the +# network VF. +# o The cooresponding hn(4) pretends the physical link is down. +# - Once the network VF is down or detached: +# o All of the transmission should go through the cooresponding hn(4). +# o All of the reception goes through the cooresponding hn(4). +# o The cooresponding hn(4) fallbacks to the original physical link +# detection logic. +# +# All these features are mainly used to help live migration, during which +# the network VF will be detached, while the network communication to the +# VM must not be cut off. In order to reach this level of live migration +# transparency, we use failover mode lagg(4) with the network VF and the +# cooresponding hn(4) attached to it. +# +# To ease user configuration for both network VF and non-network VF, the +# lagg(4) will be created by the following rules, and the configuration +# of the cooresponding hn(4) will be applied to the lagg(4) automatically. +# +# NOTE: +# If live migration is not needed at all, the following rules could be +# commented out, and the network VF interface could be used exclusively. +# Most often the cooresponding hn(4) could be completely ignored. +# +# +# Default workflow for the network VF bringup: +# 1) ETHERNET/IFATTACH -> VF interface up (delayed by rc.conf hyperv_vf_delay +# seconds). This operation will trigger HYPERV_NIC_VF/VF_UP. +# 2) HYPERV_NIC_VF/VF_UP: +# a) Create laggX coresponding to hnX. +# b) Add hnX and VF to laggX. +# c) Whack all previous network configuration on hnX, including stopping +# dhclient. +# d) Apply rc.conf ifconfig_hnX to laggX; i.e. including starting dhclient. +# +# NOTE: +# HYPERV_NIC_VF/VF_UP action script could be customized per-interface by +# adding /usr/libexec/hyperv/hyperv_vfup.hnX script. +# /usr/libexec/hyperv/hyperv_vfup could be used as the template for the +# customized per-interface script. +# +# NOTE: +# For transparent network VF, hyperv_vfattach does nothing and +# HYPERV_NIC_VF/VF_UP will not be triggered at all. +# + +notify 10 { + match "system" "HYPERV_NIC_VF"; + match "type" "VF_UP"; + action "/usr/libexec/hyperv/hyperv_vfup $subsystem"; +}; + +notify 10 { + match "system" "ETHERNET"; + match "type" "IFATTACH"; + action "/usr/libexec/hyperv/hyperv_vfattach $subsystem 0"; +}; Modified: stable/10/libexec/hyperv/Makefile ============================================================================== --- stable/10/libexec/hyperv/Makefile Mon Aug 7 01:09:33 2017 (r322128) +++ stable/10/libexec/hyperv/Makefile Mon Aug 7 02:15:13 2017 (r322129) @@ -5,6 +5,7 @@ BINDIR= ${LIBEXECDIR}/hyperv SCRIPTS= hv_set_ifconfig hv_get_dns_info hv_get_dhcp_info +SCRIPTS+= hyperv_vfattach hyperv_vfup NO_OBJ= .include From owner-svn-src-stable@freebsd.org Mon Aug 7 02:17:16 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E864FDD7D9A; Mon, 7 Aug 2017 02:17:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B4F16767D3; Mon, 7 Aug 2017 02:17:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v772HFlW034685; Mon, 7 Aug 2017 02:17:15 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v772HFHG034684; Mon, 7 Aug 2017 02:17:15 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201708070217.v772HFHG034684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 7 Aug 2017 02:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322130 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 322130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 02:17:17 -0000 Author: mckusick Date: Mon Aug 7 02:17:15 2017 New Revision: 322130 URL: https://svnweb.freebsd.org/changeset/base/322130 Log: MFC r321816: Avoid reading a snapshot block when it is already in the cache. Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Mon Aug 7 02:15:13 2017 (r322129) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Mon Aug 7 02:17:15 2017 (r322130) @@ -1403,7 +1403,7 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rl */ bp = getblk(cancelvp, lbn, fs->fs_bsize, 0, 0, 0); bp->b_blkno = fsbtodb(fs, blkno); - if ((bp->b_flags & (B_DONE | B_DELWRI)) == 0 && + if ((bp->b_flags & B_CACHE) == 0 && (error = readblock(cancelvp, bp, fragstoblks(fs, blkno)))) { brelse(bp); return (error); From owner-svn-src-stable@freebsd.org Mon Aug 7 02:23:35 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D084DD8394; Mon, 7 Aug 2017 02:23:35 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 46D4176C02; Mon, 7 Aug 2017 02:23:35 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v772NYHC038472; Mon, 7 Aug 2017 02:23:34 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v772NYUV038470; Mon, 7 Aug 2017 02:23:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708070223.v772NYUV038470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 7 Aug 2017 02:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322131 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 322131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 02:23:35 -0000 Author: sephe Date: Mon Aug 7 02:23:34 2017 New Revision: 322131 URL: https://svnweb.freebsd.org/changeset/base/322131 Log: MFC 321836,321837 321836 hyperv/hn: Renaming and minor cleanup This prepares for the upcoming transparent VF support. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11708 321837 hyperv/hn: Add comment about ether_ifattach event subscription. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11710 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 7 02:17:15 2017 (r322130) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 7 02:23:34 2017 (r322131) @@ -217,9 +217,9 @@ struct hn_rxinfo { uint32_t hash_value; }; -struct hn_update_vf { +struct hn_rxvf_setarg { struct hn_rx_ring *rxr; - struct ifnet *vf; + struct ifnet *vf_ifp; }; #define HN_RXINFO_VLAN 0x0001 @@ -259,6 +259,13 @@ static void hn_ifaddr_event(void *, struct ifnet *); static void hn_ifnet_attevent(void *, struct ifnet *); static void hn_ifnet_detevent(void *, struct ifnet *); +static bool hn_ismyvf(const struct hn_softc *, + const struct ifnet *); +static void hn_rxvf_change(struct hn_softc *, + struct ifnet *, bool); +static void hn_rxvf_set(struct hn_softc *, struct ifnet *); +static void hn_rxvf_set_task(void *, int); + static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); static void hn_rndis_rx_data(struct hn_rx_ring *, @@ -790,7 +797,7 @@ hn_rxfilter_config(struct hn_softc *sc) HN_LOCK_ASSERT(sc); if ((ifp->if_flags & IFF_PROMISC) || - (sc->hn_flags & HN_FLAG_VF)) { + (sc->hn_flags & HN_FLAG_RXVF)) { filter = NDIS_PACKET_TYPE_PROMISCUOUS; } else { filter = NDIS_PACKET_TYPE_DIRECTED; @@ -978,39 +985,39 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *i } static void -hn_update_vf_task(void *arg, int pending __unused) +hn_rxvf_set_task(void *xarg, int pending __unused) { - struct hn_update_vf *uv = arg; + struct hn_rxvf_setarg *arg = xarg; - uv->rxr->hn_rxvf_ifp = uv->vf; + arg->rxr->hn_rxvf_ifp = arg->vf_ifp; } static void -hn_update_vf(struct hn_softc *sc, struct ifnet *vf) +hn_rxvf_set(struct hn_softc *sc, struct ifnet *vf_ifp) { struct hn_rx_ring *rxr; - struct hn_update_vf uv; + struct hn_rxvf_setarg arg; struct task task; int i; HN_LOCK_ASSERT(sc); - TASK_INIT(&task, 0, hn_update_vf_task, &uv); + TASK_INIT(&task, 0, hn_rxvf_set_task, &arg); for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; if (i < sc->hn_rx_ring_inuse) { - uv.rxr = rxr; - uv.vf = vf; + arg.rxr = rxr; + arg.vf_ifp = vf_ifp; vmbus_chan_run_task(rxr->hn_chan, &task); } else { - rxr->hn_rxvf_ifp = vf; + rxr->hn_rxvf_ifp = vf_ifp; } } } -static __inline bool +static bool hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp) { const struct ifnet *hn_ifp; @@ -1035,7 +1042,7 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne } static void -hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +hn_rxvf_change(struct hn_softc *sc, struct ifnet *ifp, bool rxvf) { struct ifnet *hn_ifp; @@ -1046,21 +1053,19 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool if (!hn_ismyvf(sc, ifp)) goto out; - hn_ifp = sc->hn_ifp; - /* Now we're sure 'ifp' is a real VF device. */ - if (vf) { - if (sc->hn_flags & HN_FLAG_VF) + if (rxvf) { + if (sc->hn_flags & HN_FLAG_RXVF) goto out; - sc->hn_flags |= HN_FLAG_VF; + sc->hn_flags |= HN_FLAG_RXVF; hn_rxfilter_config(sc); } else { - if (!(sc->hn_flags & HN_FLAG_VF)) + if (!(sc->hn_flags & HN_FLAG_RXVF)) goto out; - sc->hn_flags &= ~HN_FLAG_VF; + sc->hn_flags &= ~HN_FLAG_RXVF; if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_rxfilter_config(sc); else @@ -1068,11 +1073,11 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool } hn_nvs_set_datapath(sc, - vf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); + rxvf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); - hn_update_vf(sc, vf ? ifp : NULL); + hn_rxvf_set(sc, rxvf ? ifp : NULL); - if (vf) { + if (rxvf) { hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); @@ -1081,12 +1086,13 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool hn_resume_mgmt(sc); } - devctl_notify("HYPERV_NIC_VF", if_name(hn_ifp), - vf ? "VF_UP" : "VF_DOWN", NULL); + devctl_notify("HYPERV_NIC_VF", hn_ifp->if_xname, + rxvf ? "VF_UP" : "VF_DOWN", NULL); - if (bootverbose) - if_printf(hn_ifp, "Data path is switched %s %s\n", - vf ? "to" : "from", if_name(ifp)); + if (bootverbose) { + if_printf(hn_ifp, "datapath is switched %s %s\n", + rxvf ? "to" : "from", ifp->if_xname); + } out: HN_UNLOCK(sc); } @@ -1094,16 +1100,17 @@ out: static void hn_ifnet_event(void *arg, struct ifnet *ifp, int event) { + if (event != IFNET_EVENT_UP && event != IFNET_EVENT_DOWN) return; - - hn_set_vf(arg, ifp, event == IFNET_EVENT_UP); + hn_rxvf_change(arg, ifp, event == IFNET_EVENT_UP); } static void hn_ifaddr_event(void *arg, struct ifnet *ifp) { - hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); + + hn_rxvf_change(arg, ifp, ifp->if_flags & IFF_UP); } static void @@ -1517,6 +1524,12 @@ hn_attach(device_t dev) sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + /* + * NOTE: + * Subscribe ether_ifattach event, instead of ifnet_arrival event, + * since interface's LLADDR is needed; interface LLADDR is not + * available when ifnet_arrival event is triggered. + */ sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event, hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY); sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event, @@ -2889,7 +2902,7 @@ hn_stop(struct hn_softc *sc, bool detaching) * If the VF is active, make sure the filter is not 0, even if * the synthetic NIC is down. */ - if (!detaching && (sc->hn_flags & HN_FLAG_VF)) + if (!detaching && (sc->hn_flags & HN_FLAG_RXVF)) hn_rxfilter_config(sc); } @@ -3421,13 +3434,13 @@ hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; char vf_name[IFNAMSIZ + 1]; - struct ifnet *vf; + struct ifnet *vf_ifp; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_vf_ifp; - if (vf != NULL) - snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + vf_ifp = sc->hn_vf_ifp; + if (vf_ifp != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", vf_ifp->if_xname); HN_UNLOCK(sc); return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); } @@ -3437,13 +3450,13 @@ hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; char vf_name[IFNAMSIZ + 1]; - struct ifnet *vf; + struct ifnet *vf_ifp; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_rx_ring[0].hn_rxvf_ifp; - if (vf != NULL) - snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + vf_ifp = sc->hn_rx_ring[0].hn_rxvf_ifp; + if (vf_ifp != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", vf_ifp->if_xname); HN_UNLOCK(sc); return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); } @@ -5397,7 +5410,7 @@ hn_suspend(struct hn_softc *sc) hn_polling(sc, 0); if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || - (sc->hn_flags & HN_FLAG_VF)) + (sc->hn_flags & HN_FLAG_RXVF)) hn_suspend_data(sc); hn_suspend_mgmt(sc); } @@ -5487,16 +5500,16 @@ hn_resume(struct hn_softc *sc) { if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || - (sc->hn_flags & HN_FLAG_VF)) + (sc->hn_flags & HN_FLAG_RXVF)) hn_resume_data(sc); /* * When the VF is activated, the synthetic interface is changed - * to DOWN in hn_set_vf(). Here, if the VF is still active, we - * don't call hn_resume_mgmt() until the VF is deactivated in - * hn_set_vf(). + * to DOWN in hn_rxvf_change(). Here, if the VF is still active, + * we don't call hn_resume_mgmt() until the VF is deactivated in + * hn_rxvf_change(). */ - if (!(sc->hn_flags & HN_FLAG_VF)) + if (!(sc->hn_flags & HN_FLAG_RXVF)) hn_resume_mgmt(sc); /* Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 7 02:17:15 2017 (r322130) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 7 02:23:34 2017 (r322131) @@ -252,7 +252,7 @@ struct hn_softc { #define HN_FLAG_NO_SLEEPING 0x0020 #define HN_FLAG_RXBUF_REF 0x0040 #define HN_FLAG_CHIM_REF 0x0080 -#define HN_FLAG_VF 0x0100 +#define HN_FLAG_RXVF 0x0100 #define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) From owner-svn-src-stable@freebsd.org Mon Aug 7 02:29:11 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4089ADD876A; Mon, 7 Aug 2017 02:29:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0A75176E40; Mon, 7 Aug 2017 02:29:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v772TAwO038759; Mon, 7 Aug 2017 02:29:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v772TAJY038758; Mon, 7 Aug 2017 02:29:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201708070229.v772TAJY038758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 7 Aug 2017 02:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322132 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/10/sys/ufs/ffs X-SVN-Commit-Revision: 322132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 02:29:11 -0000 Author: mckusick Date: Mon Aug 7 02:29:09 2017 New Revision: 322132 URL: https://svnweb.freebsd.org/changeset/base/322132 Log: MFC r321816: Avoid reading a snapshot block when it is already in the cache. Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Mon Aug 7 02:23:34 2017 (r322131) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Mon Aug 7 02:29:09 2017 (r322132) @@ -1403,7 +1403,7 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rl */ bp = getblk(cancelvp, lbn, fs->fs_bsize, 0, 0, 0); bp->b_blkno = fsbtodb(fs, blkno); - if ((bp->b_flags & (B_DONE | B_DELWRI)) == 0 && + if ((bp->b_flags & B_CACHE) == 0 && (error = readblock(cancelvp, bp, fragstoblks(fs, blkno)))) { brelse(bp); return (error); From owner-svn-src-stable@freebsd.org Mon Aug 7 02:33:23 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67409DD8AAF; Mon, 7 Aug 2017 02:33:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 33E6E77201; Mon, 7 Aug 2017 02:33:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v772XMip042595; Mon, 7 Aug 2017 02:33:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v772XM9e042594; Mon, 7 Aug 2017 02:33:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708070233.v772XM9e042594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 7 Aug 2017 02:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322133 - stable/10/sys/dev/hyperv/utilities X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/utilities X-SVN-Commit-Revision: 322133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 02:33:23 -0000 Author: sephe Date: Mon Aug 7 02:33:22 2017 New Revision: 322133 URL: https://svnweb.freebsd.org/changeset/base/322133 Log: MFC 321965 hyperv/kvp: Use proper size macro for adapter id. Submitted by: Christopher Ertl Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 7 02:29:09 2017 (r322132) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 7 02:33:22 2017 (r322133) @@ -253,7 +253,7 @@ hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg UNUSED_FLAG, &err_dns); utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, - MAX_IP_ADDR_SIZE, + MAX_ADAPTER_ID_SIZE, (char *)umsg->body.kvp_ip_val.adapter_id, strlen((char *)umsg->body.kvp_ip_val.adapter_id), UNUSED_FLAG, From owner-svn-src-stable@freebsd.org Mon Aug 7 02:49:27 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC362DD93A3; Mon, 7 Aug 2017 02:49:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 99EA0777D0; Mon, 7 Aug 2017 02:49:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v772nQYc047057; Mon, 7 Aug 2017 02:49:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v772nQba047053; Mon, 7 Aug 2017 02:49:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708070249.v772nQba047053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 7 Aug 2017 02:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322134 - in stable/11: contrib/hyperv/tools/scripts etc/devd libexec/hyperv X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in stable/11: contrib/hyperv/tools/scripts etc/devd libexec/hyperv X-SVN-Commit-Revision: 322134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 02:49:27 -0000 Author: sephe Date: Mon Aug 7 02:49:26 2017 New Revision: 322134 URL: https://svnweb.freebsd.org/changeset/base/322134 Log: MFC 321762 hyperv: Add VF bringup scripts and devd rules. How network VF works with hn(4) on Hyper-V in non-transparent mode: - Each network VF has a cooresponding hn(4). - The network VF and the it's cooresponding hn(4) have the same hardware address. - Once the network VF is up, e.g. ifconfig VF up: o All of the transmission should go through the network VF. o Most of the reception goes through the network VF. o Small amount of reception may go through the cooresponding hn(4). This reception will happen, even if the the cooresponding hn(4) is down. The cooresponding hn(4) will change the reception interface to the network VF, so that network layer and application layer will be tricked into thinking that these packets were received by the network VF. o The cooresponding hn(4) pretends the physical link is down. - Once the network VF is down or detached: o All of the transmission should go through the cooresponding hn(4). o All of the reception goes through the cooresponding hn(4). o The cooresponding hn(4) fallbacks to the original physical link detection logic. All these features are mainly used to help live migration, during which the network VF will be detached, while the network communication to the VM must not be cut off. In order to reach this level of live migration transparency, we use failover mode lagg(4) with the network VF and the cooresponding hn(4) attached to it. To ease user configuration for both network VF and non-network VF, the lagg(4) will be created by the following rules, and the configuration of the cooresponding hn(4) will be applied to the lagg(4) automatically. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11635 Added: stable/11/contrib/hyperv/tools/scripts/hyperv_vfattach - copied unchanged from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfattach stable/11/contrib/hyperv/tools/scripts/hyperv_vfup - copied unchanged from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfup Modified: stable/11/etc/devd/hyperv.conf stable/11/libexec/hyperv/Makefile Directory Properties: stable/11/ (props changed) Copied: stable/11/contrib/hyperv/tools/scripts/hyperv_vfattach (from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfattach) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/hyperv/tools/scripts/hyperv_vfattach Mon Aug 7 02:49:26 2017 (r322134, copy of r321762, head/contrib/hyperv/tools/scripts/hyperv_vfattach) @@ -0,0 +1,79 @@ +#!/bin/sh + +# +# If transparent VF is enabled, don't do anything. +# + +sysctl -n hw.hn.vf_transparent > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Old kernel; no transparent VF. + vf_transparent=0 +else + vf_transparent=`sysctl -n hw.hn.vf_transparent` +fi + +if [ $vf_transparent -ne 0 ] +then + # Transparent VF; done! + exit 0 +fi + +iface=$1 +delay=$2 + +if [ $delay -gt 0 ] +then + # + # Delayed VF up. + # + sleep $delay + ifconfig $iface up + # Done! + exit $? +fi + +# +# Check to see whether $iface is a VF or not. +# If $iface is a VF, bring it up now. +# + +# for hyperv_vf_delay +. /etc/rc.conf + +sysctl -n hw.hn.vflist > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Old kernel; nothing could be done properly. + exit 0 +fi +vf_list=`sysctl -n hw.hn.vflist` + +for vf in $vf_list +do + if [ $vf = $iface ] + then + # + # Linger a little bit (at least 2 seconds) mainly to + # make sure that $iface is fully attached. + # + # NOTE: + # In Azure hyperv_vf_delay should be configured to a + # large value, e.g. 120 seconds, to avoid racing cloud + # agent goofs. + # + test $hyperv_vf_delay -ge 2 > /dev/null 2>&1 + if [ $? -ne 0 ] + then + hyperv_vf_delay=2 + fi + # + # NOTE: + # "(sleep ..; ifconfig .. up) > /dev/null 2>&1 &" + # does _not_ work. + # + daemon -f /usr/libexec/hyperv/hyperv_vfattach \ + $iface $hyperv_vf_delay + break + fi +done Copied: stable/11/contrib/hyperv/tools/scripts/hyperv_vfup (from r321762, head/contrib/hyperv/tools/scripts/hyperv_vfup) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/hyperv/tools/scripts/hyperv_vfup Mon Aug 7 02:49:26 2017 (r322134, copy of r321762, head/contrib/hyperv/tools/scripts/hyperv_vfup) @@ -0,0 +1,119 @@ +#!/bin/sh + +. /etc/rc.subr +. /etc/network.subr + +load_rc_config netif + +# +# Customized per-interface setup, e.g. hyperv_vfup.hn1 +# +# NOTE-CUSTOMIZE: +# Comment this out, if this script is used as template +# for the customized per-interface setup. +# +if [ -f /usr/libexec/hyperv/hyperv_vfup.$1 ] +then + /usr/libexec/hyperv/hyperv_vfup.$1 + exit $? +fi + +# NOTE-CUSTOMIZE: +#hn=${0##*.} +hn=$1 +hn_unit=`echo $hn | sed 's/[^0-9]*//g'` + +vf=`sysctl -n dev.hn.$hn_unit.vf` +if [ ! $vf ] +then + # Race happened; VF was removed, before we ran. + echo "$hn: VF was detached" + exit 0 +fi + +# +# Create laggX for hnX. +# Add VF and hnX to laggX. +# + +lagg=lagg$hn_unit + +ifconfig $lagg > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # + # No laggX, create it now. + # + ifconfig $lagg create > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "$lagg creation failed" + exit 1 + fi + + # + # Configure laggX (failover), add hnX and VF to it. + # + ifconfig $lagg laggproto failover laggport $hn laggport $vf + ifconfig $lagg inet6 no_dad + + # + # Stop dhclient on hnX, if any. + # + pidfile=/var/run/dhclient.$hn.pid + if [ -f $pidfile ] + then + kill -TERM `cat $pidfile` + fi + + # + # Remove all configured IPv4 addresses on hnX, e.g. + # configured by dhclient. laggX will take over the + # network operations. + # + while true + do + ifconfig $hn -alias > /dev/null 2>&1 + if [ $? -ne 0 ] + then + break + fi + done + + # TODO: Remove IPv6 addresses on hnX + + # + # Use hnX's configuration for laggX + # + # NOTE-CUSTOMIZE: + # If this script is used as template for the customized + # per-interface setup, replace this with whatever you + # want to do with the laggX. + # + if dhcpif $hn; + then + ifconfig $lagg up + if syncdhcpif $hn; + then + dhclient $lagg + else + dhclient -b $lagg + fi + else + ifconfig_args=`ifconfig_getargs $hn` + if [ -n "$ifconfig_args" ] + then + ifconfig $lagg $ifconfig_args + fi + fi +else + # + # laggX exists. Check whether VF was there or not. + # If VF was not added to laggX, add it now. + # + ifconfig $lagg | grep "laggport: $vf" > /dev/null 2>&1 + if [ $? -ne 0 ] + then + ifconfig $lagg laggport $vf + fi +fi Modified: stable/11/etc/devd/hyperv.conf ============================================================================== --- stable/11/etc/devd/hyperv.conf Mon Aug 7 02:33:22 2017 (r322133) +++ stable/11/etc/devd/hyperv.conf Mon Aug 7 02:49:26 2017 (r322134) @@ -33,3 +33,76 @@ notify 11 { match "cdev" "hv_fsvss_dev"; action "pkill -x hv_vss_daemon"; }; + +# +# Rules for non-transparent network VF. +# +# How network VF works with hn(4) on Hyper-V in non-transparent mode: +# +# - Each network VF has a cooresponding hn(4). +# - The network VF and the it's cooresponding hn(4) have the same hardware +# address. +# - Once the network VF is up, e.g. ifconfig VF up: +# o All of the transmission should go through the network VF. +# o Most of the reception goes through the network VF. +# o Small amount of reception may go through the cooresponding hn(4). +# This reception will happen, even if the the cooresponding hn(4) is +# down. The cooresponding hn(4) will change the reception interface +# to the network VF, so that network layer and application layer will +# be tricked into thinking that these packets were received by the +# network VF. +# o The cooresponding hn(4) pretends the physical link is down. +# - Once the network VF is down or detached: +# o All of the transmission should go through the cooresponding hn(4). +# o All of the reception goes through the cooresponding hn(4). +# o The cooresponding hn(4) fallbacks to the original physical link +# detection logic. +# +# All these features are mainly used to help live migration, during which +# the network VF will be detached, while the network communication to the +# VM must not be cut off. In order to reach this level of live migration +# transparency, we use failover mode lagg(4) with the network VF and the +# cooresponding hn(4) attached to it. +# +# To ease user configuration for both network VF and non-network VF, the +# lagg(4) will be created by the following rules, and the configuration +# of the cooresponding hn(4) will be applied to the lagg(4) automatically. +# +# NOTE: +# If live migration is not needed at all, the following rules could be +# commented out, and the network VF interface could be used exclusively. +# Most often the cooresponding hn(4) could be completely ignored. +# +# +# Default workflow for the network VF bringup: +# 1) ETHERNET/IFATTACH -> VF interface up (delayed by rc.conf hyperv_vf_delay +# seconds). This operation will trigger HYPERV_NIC_VF/VF_UP. +# 2) HYPERV_NIC_VF/VF_UP: +# a) Create laggX coresponding to hnX. +# b) Add hnX and VF to laggX. +# c) Whack all previous network configuration on hnX, including stopping +# dhclient. +# d) Apply rc.conf ifconfig_hnX to laggX; i.e. including starting dhclient. +# +# NOTE: +# HYPERV_NIC_VF/VF_UP action script could be customized per-interface by +# adding /usr/libexec/hyperv/hyperv_vfup.hnX script. +# /usr/libexec/hyperv/hyperv_vfup could be used as the template for the +# customized per-interface script. +# +# NOTE: +# For transparent network VF, hyperv_vfattach does nothing and +# HYPERV_NIC_VF/VF_UP will not be triggered at all. +# + +notify 10 { + match "system" "HYPERV_NIC_VF"; + match "type" "VF_UP"; + action "/usr/libexec/hyperv/hyperv_vfup $subsystem"; +}; + +notify 10 { + match "system" "ETHERNET"; + match "type" "IFATTACH"; + action "/usr/libexec/hyperv/hyperv_vfattach $subsystem 0"; +}; Modified: stable/11/libexec/hyperv/Makefile ============================================================================== --- stable/11/libexec/hyperv/Makefile Mon Aug 7 02:33:22 2017 (r322133) +++ stable/11/libexec/hyperv/Makefile Mon Aug 7 02:49:26 2017 (r322134) @@ -5,5 +5,6 @@ BINDIR= ${LIBEXECDIR}/hyperv SCRIPTS= hv_set_ifconfig hv_get_dns_info hv_get_dhcp_info +SCRIPTS+= hyperv_vfattach hyperv_vfup .include From owner-svn-src-stable@freebsd.org Mon Aug 7 03:03:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 310C9DD9D3C; Mon, 7 Aug 2017 03:03:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0BAB47C38D; Mon, 7 Aug 2017 03:03:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7733efc055752; Mon, 7 Aug 2017 03:03:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7733egA055750; Mon, 7 Aug 2017 03:03:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708070303.v7733egA055750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 7 Aug 2017 03:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322135 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 322135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 03:03:42 -0000 Author: sephe Date: Mon Aug 7 03:03:40 2017 New Revision: 322135 URL: https://svnweb.freebsd.org/changeset/base/322135 Log: MFC 321836,321837 321836 hyperv/hn: Renaming and minor cleanup This prepares for the upcoming transparent VF support. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11708 321837 hyperv/hn: Add comment about ether_ifattach event subscription. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11710 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 7 02:49:26 2017 (r322134) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 7 03:03:40 2017 (r322135) @@ -222,9 +222,9 @@ struct hn_rxinfo { uint32_t hash_value; }; -struct hn_update_vf { +struct hn_rxvf_setarg { struct hn_rx_ring *rxr; - struct ifnet *vf; + struct ifnet *vf_ifp; }; #define HN_RXINFO_VLAN 0x0001 @@ -264,6 +264,13 @@ static void hn_ifaddr_event(void *, struct ifnet *); static void hn_ifnet_attevent(void *, struct ifnet *); static void hn_ifnet_detevent(void *, struct ifnet *); +static bool hn_ismyvf(const struct hn_softc *, + const struct ifnet *); +static void hn_rxvf_change(struct hn_softc *, + struct ifnet *, bool); +static void hn_rxvf_set(struct hn_softc *, struct ifnet *); +static void hn_rxvf_set_task(void *, int); + static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); static void hn_rndis_rx_data(struct hn_rx_ring *, @@ -801,7 +808,7 @@ hn_rxfilter_config(struct hn_softc *sc) HN_LOCK_ASSERT(sc); if ((ifp->if_flags & IFF_PROMISC) || - (sc->hn_flags & HN_FLAG_VF)) { + (sc->hn_flags & HN_FLAG_RXVF)) { filter = NDIS_PACKET_TYPE_PROMISCUOUS; } else { filter = NDIS_PACKET_TYPE_DIRECTED; @@ -991,39 +998,39 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *i } static void -hn_update_vf_task(void *arg, int pending __unused) +hn_rxvf_set_task(void *xarg, int pending __unused) { - struct hn_update_vf *uv = arg; + struct hn_rxvf_setarg *arg = xarg; - uv->rxr->hn_rxvf_ifp = uv->vf; + arg->rxr->hn_rxvf_ifp = arg->vf_ifp; } static void -hn_update_vf(struct hn_softc *sc, struct ifnet *vf) +hn_rxvf_set(struct hn_softc *sc, struct ifnet *vf_ifp) { struct hn_rx_ring *rxr; - struct hn_update_vf uv; + struct hn_rxvf_setarg arg; struct task task; int i; HN_LOCK_ASSERT(sc); - TASK_INIT(&task, 0, hn_update_vf_task, &uv); + TASK_INIT(&task, 0, hn_rxvf_set_task, &arg); for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; if (i < sc->hn_rx_ring_inuse) { - uv.rxr = rxr; - uv.vf = vf; + arg.rxr = rxr; + arg.vf_ifp = vf_ifp; vmbus_chan_run_task(rxr->hn_chan, &task); } else { - rxr->hn_rxvf_ifp = vf; + rxr->hn_rxvf_ifp = vf_ifp; } } } -static __inline bool +static bool hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp) { const struct ifnet *hn_ifp; @@ -1048,7 +1055,7 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne } static void -hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +hn_rxvf_change(struct hn_softc *sc, struct ifnet *ifp, bool rxvf) { struct ifnet *hn_ifp; @@ -1059,21 +1066,19 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool if (!hn_ismyvf(sc, ifp)) goto out; - hn_ifp = sc->hn_ifp; - /* Now we're sure 'ifp' is a real VF device. */ - if (vf) { - if (sc->hn_flags & HN_FLAG_VF) + if (rxvf) { + if (sc->hn_flags & HN_FLAG_RXVF) goto out; - sc->hn_flags |= HN_FLAG_VF; + sc->hn_flags |= HN_FLAG_RXVF; hn_rxfilter_config(sc); } else { - if (!(sc->hn_flags & HN_FLAG_VF)) + if (!(sc->hn_flags & HN_FLAG_RXVF)) goto out; - sc->hn_flags &= ~HN_FLAG_VF; + sc->hn_flags &= ~HN_FLAG_RXVF; if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_rxfilter_config(sc); else @@ -1081,11 +1086,11 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool } hn_nvs_set_datapath(sc, - vf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); + rxvf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); - hn_update_vf(sc, vf ? ifp : NULL); + hn_rxvf_set(sc, rxvf ? ifp : NULL); - if (vf) { + if (rxvf) { hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); @@ -1094,12 +1099,13 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool hn_resume_mgmt(sc); } - devctl_notify("HYPERV_NIC_VF", if_name(hn_ifp), - vf ? "VF_UP" : "VF_DOWN", NULL); + devctl_notify("HYPERV_NIC_VF", hn_ifp->if_xname, + rxvf ? "VF_UP" : "VF_DOWN", NULL); - if (bootverbose) - if_printf(hn_ifp, "Data path is switched %s %s\n", - vf ? "to" : "from", if_name(ifp)); + if (bootverbose) { + if_printf(hn_ifp, "datapath is switched %s %s\n", + rxvf ? "to" : "from", ifp->if_xname); + } out: HN_UNLOCK(sc); } @@ -1107,16 +1113,17 @@ out: static void hn_ifnet_event(void *arg, struct ifnet *ifp, int event) { + if (event != IFNET_EVENT_UP && event != IFNET_EVENT_DOWN) return; - - hn_set_vf(arg, ifp, event == IFNET_EVENT_UP); + hn_rxvf_change(arg, ifp, event == IFNET_EVENT_UP); } static void hn_ifaddr_event(void *arg, struct ifnet *ifp) { - hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); + + hn_rxvf_change(arg, ifp, ifp->if_flags & IFF_UP); } static void @@ -1534,6 +1541,12 @@ hn_attach(device_t dev) sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + /* + * NOTE: + * Subscribe ether_ifattach event, instead of ifnet_arrival event, + * since interface's LLADDR is needed; interface LLADDR is not + * available when ifnet_arrival event is triggered. + */ sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event, hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY); sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event, @@ -2902,7 +2915,7 @@ hn_stop(struct hn_softc *sc, bool detaching) * If the VF is active, make sure the filter is not 0, even if * the synthetic NIC is down. */ - if (!detaching && (sc->hn_flags & HN_FLAG_VF)) + if (!detaching && (sc->hn_flags & HN_FLAG_RXVF)) hn_rxfilter_config(sc); } @@ -3438,13 +3451,13 @@ hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; char vf_name[IFNAMSIZ + 1]; - struct ifnet *vf; + struct ifnet *vf_ifp; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_vf_ifp; - if (vf != NULL) - snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + vf_ifp = sc->hn_vf_ifp; + if (vf_ifp != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", vf_ifp->if_xname); HN_UNLOCK(sc); return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); } @@ -3454,13 +3467,13 @@ hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; char vf_name[IFNAMSIZ + 1]; - struct ifnet *vf; + struct ifnet *vf_ifp; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_rx_ring[0].hn_rxvf_ifp; - if (vf != NULL) - snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + vf_ifp = sc->hn_rx_ring[0].hn_rxvf_ifp; + if (vf_ifp != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", vf_ifp->if_xname); HN_UNLOCK(sc); return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); } @@ -5445,7 +5458,7 @@ hn_suspend(struct hn_softc *sc) hn_polling(sc, 0); if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || - (sc->hn_flags & HN_FLAG_VF)) + (sc->hn_flags & HN_FLAG_RXVF)) hn_suspend_data(sc); hn_suspend_mgmt(sc); } @@ -5535,16 +5548,16 @@ hn_resume(struct hn_softc *sc) { if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || - (sc->hn_flags & HN_FLAG_VF)) + (sc->hn_flags & HN_FLAG_RXVF)) hn_resume_data(sc); /* * When the VF is activated, the synthetic interface is changed - * to DOWN in hn_set_vf(). Here, if the VF is still active, we - * don't call hn_resume_mgmt() until the VF is deactivated in - * hn_set_vf(). + * to DOWN in hn_rxvf_change(). Here, if the VF is still active, + * we don't call hn_resume_mgmt() until the VF is deactivated in + * hn_rxvf_change(). */ - if (!(sc->hn_flags & HN_FLAG_VF)) + if (!(sc->hn_flags & HN_FLAG_RXVF)) hn_resume_mgmt(sc); /* Modified: stable/11/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 7 02:49:26 2017 (r322134) +++ stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 7 03:03:40 2017 (r322135) @@ -251,7 +251,7 @@ struct hn_softc { #define HN_FLAG_NO_SLEEPING 0x0020 #define HN_FLAG_RXBUF_REF 0x0040 #define HN_FLAG_CHIM_REF 0x0080 -#define HN_FLAG_VF 0x0100 +#define HN_FLAG_RXVF 0x0100 #define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) From owner-svn-src-stable@freebsd.org Mon Aug 7 03:14:46 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53419DAB64D; Mon, 7 Aug 2017 03:14:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 20B027C954; Mon, 7 Aug 2017 03:14:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v773EjSC059694; Mon, 7 Aug 2017 03:14:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v773EjWX059693; Mon, 7 Aug 2017 03:14:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708070314.v773EjWX059693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 7 Aug 2017 03:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322136 - stable/11/sys/dev/hyperv/utilities X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/utilities X-SVN-Commit-Revision: 322136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 03:14:46 -0000 Author: sephe Date: Mon Aug 7 03:14:45 2017 New Revision: 322136 URL: https://svnweb.freebsd.org/changeset/base/322136 Log: MFC 321965 hyperv/kvp: Use proper size macro for adapter id. Submitted by: Christopher Ertl Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/utilities/hv_kvp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/11/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 7 03:03:40 2017 (r322135) +++ stable/11/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 7 03:14:45 2017 (r322136) @@ -253,7 +253,7 @@ hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg UNUSED_FLAG, &err_dns); utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, - MAX_IP_ADDR_SIZE, + MAX_ADAPTER_ID_SIZE, (char *)umsg->body.kvp_ip_val.adapter_id, strlen((char *)umsg->body.kvp_ip_val.adapter_id), UNUSED_FLAG, From owner-svn-src-stable@freebsd.org Mon Aug 7 07:02:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A1CDBF770; Mon, 7 Aug 2017 07:02:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BD049822DB; Mon, 7 Aug 2017 07:02:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7772pg6052289; Mon, 7 Aug 2017 07:02:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7772pap052286; Mon, 7 Aug 2017 07:02:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708070702.v7772pap052286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 7 Aug 2017 07:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322137 - in stable/11/sys: fs/nfsserver nfs X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys: fs/nfsserver nfs X-SVN-Commit-Revision: 322137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 07:02:53 -0000 Author: mav Date: Mon Aug 7 07:02:51 2017 New Revision: 322137 URL: https://svnweb.freebsd.org/changeset/base/322137 Log: MFC r321794: Improve FHA locality control for NFS read/write requests. This change adds two new tunables, allowing to control serialization for read and write NFS requests separately. It does not change the default behavior since there are too many factors to consider, but gives additional space for further experiments and tuning. The main motivation for this change is very low write speed in case of ZFS with sync=always or when NFS clients requests sychronous operation, when every separate request has to be written/flushed to ZIL, and requests are processed one at a time. Setting vfs.nfsd.fha.write=0 in that case allows to increase ZIL throughput by several times by coalescing writes and cache flushes. There is a worry that doing it may increase data fragmentation on disks, but I suppose it should not happen for pool with SLOG. Sponsored by: iXsystems, Inc. Modified: stable/11/sys/fs/nfsserver/nfs_fha_new.c stable/11/sys/nfs/nfs_fha.c stable/11/sys/nfs/nfs_fha.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_fha_new.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_fha_new.c Mon Aug 7 03:14:45 2017 (r322136) +++ stable/11/sys/fs/nfsserver/nfs_fha_new.c Mon Aug 7 07:02:51 2017 (r322137) @@ -93,7 +93,7 @@ fhanew_init(void *foo) sysctl_ctx_init(&softc->sysctl_ctx); softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", CTLFLAG_RD, - 0, "fha node"); + 0, "NFS File Handle Affinity (FHA)"); if (softc->sysctl_tree == NULL) { printf("%s: unable to allocate sysctl tree\n", __func__); return; Modified: stable/11/sys/nfs/nfs_fha.c ============================================================================== --- stable/11/sys/nfs/nfs_fha.c Mon Aug 7 03:14:45 2017 (r322136) +++ stable/11/sys/nfs/nfs_fha.c Mon Aug 7 07:02:51 2017 (r322137) @@ -51,7 +51,6 @@ static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA", "NFS FHA"); void fha_init(struct fha_params *softc) { - char tmpstr[128]; int i; for (i = 0; i < FHA_HASH_SIZE; i++) @@ -61,47 +60,38 @@ fha_init(struct fha_params *softc) * Set the default tuning parameters. */ softc->ctls.enable = FHA_DEF_ENABLE; + softc->ctls.read = FHA_DEF_READ; + softc->ctls.write = FHA_DEF_WRITE; softc->ctls.bin_shift = FHA_DEF_BIN_SHIFT; softc->ctls.max_nfsds_per_fh = FHA_DEF_MAX_NFSDS_PER_FH; softc->ctls.max_reqs_per_nfsd = FHA_DEF_MAX_REQS_PER_NFSD; /* - * Allow the user to override the defaults at boot time with - * tunables. + * Add sysctls so the user can change the tuning parameters. */ - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.enable", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.enable); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.bin_shift", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.bin_shift); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_nfsds_per_fh", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_nfsds_per_fh); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_reqs_per_nfsd", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_reqs_per_nfsd); - - /* - * Add sysctls so the user can change the tuning parameters at - * runtime. - */ SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "enable", CTLFLAG_RW, + OID_AUTO, "enable", CTLFLAG_RWTUN, &softc->ctls.enable, 0, "Enable NFS File Handle Affinity (FHA)"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "bin_shift", CTLFLAG_RW, - &softc->ctls.bin_shift, 0, "For FHA reads, no two requests will " - "contend if they're 2^(bin_shift) bytes apart"); + OID_AUTO, "read", CTLFLAG_RWTUN, + &softc->ctls.read, 0, "Enable NFS FHA read locality"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RW, + OID_AUTO, "write", CTLFLAG_RWTUN, + &softc->ctls.write, 0, "Enable NFS FHA write locality"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "bin_shift", CTLFLAG_RWTUN, + &softc->ctls.bin_shift, 0, "Maximum locality distance 2^(bin_shift) bytes"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RWTUN, &softc->ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that " "should be working on requests for the same file handle"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RW, + OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RWTUN, &softc->ctls.max_reqs_per_nfsd, 0, "Maximum requests that " "single nfsd thread should be working on at any time"); @@ -144,6 +134,7 @@ fha_extract_info(struct svc_req *req, struct fha_info i->fh = ++random_fh; i->offset = 0; i->locktype = LK_EXCLUSIVE; + i->read = i->write = 0; /* * Extract the procnum and convert to v3 form if necessary, @@ -169,6 +160,9 @@ fha_extract_info(struct svc_req *req, struct fha_info if (cb->no_offset(procnum)) goto out; + i->read = cb->is_read(procnum); + i->write = cb->is_write(procnum); + error = cb->realign(&req->rq_args, M_NOWAIT); if (error) goto out; @@ -181,7 +175,7 @@ fha_extract_info(struct svc_req *req, struct fha_info goto out; /* Content ourselves with zero offset for all but reads. */ - if (cb->is_read(procnum) || cb->is_write(procnum)) + if (i->read || i->write) cb->get_offset(&md, &dpos, v3, i); out: @@ -311,8 +305,13 @@ fha_hash_entry_choose_thread(struct fha_params *softc, return (thread); } + /* Check whether we should consider locality. */ + if ((i->read && !softc->ctls.read) || + (i->write && !softc->ctls.write)) + goto noloc; + /* - * Check for read locality, making sure that we won't + * Check for locality, making sure that we won't * exceed our per-thread load limit in the process. */ offset1 = i->offset; @@ -332,6 +331,7 @@ fha_hash_entry_choose_thread(struct fha_params *softc, } } +noloc: /* * We don't have a locality match, so skip this thread, * but keep track of the most attractive thread in case Modified: stable/11/sys/nfs/nfs_fha.h ============================================================================== --- stable/11/sys/nfs/nfs_fha.h Mon Aug 7 03:14:45 2017 (r322136) +++ stable/11/sys/nfs/nfs_fha.h Mon Aug 7 07:02:51 2017 (r322137) @@ -31,6 +31,8 @@ /* Sysctl defaults. */ #define FHA_DEF_ENABLE 1 +#define FHA_DEF_READ 1 +#define FHA_DEF_WRITE 1 #define FHA_DEF_BIN_SHIFT 22 /* 4MB */ #define FHA_DEF_MAX_NFSDS_PER_FH 8 #define FHA_DEF_MAX_REQS_PER_NFSD 0 /* Unlimited */ @@ -39,6 +41,8 @@ struct fha_ctls { int enable; + int read; + int write; uint32_t bin_shift; uint32_t max_nfsds_per_fh; uint32_t max_reqs_per_nfsd; @@ -79,6 +83,8 @@ struct fha_info { u_int64_t fh; off_t offset; int locktype; + int read; + int write; }; struct fha_callbacks { From owner-svn-src-stable@freebsd.org Mon Aug 7 07:40:02 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26A54DC1153; Mon, 7 Aug 2017 07:40:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 EEF2683138; Mon, 7 Aug 2017 07:40:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v777e1EU064777; Mon, 7 Aug 2017 07:40:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v777e0Ck064774; Mon, 7 Aug 2017 07:40:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708070740.v777e0Ck064774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 7 Aug 2017 07:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322138 - in stable/10/sys: fs/nfsserver nfs X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/10/sys: fs/nfsserver nfs X-SVN-Commit-Revision: 322138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 07:40:02 -0000 Author: mav Date: Mon Aug 7 07:40:00 2017 New Revision: 322138 URL: https://svnweb.freebsd.org/changeset/base/322138 Log: MFC r321794: Improve FHA locality control for NFS read/write requests. This change adds two new tunables, allowing to control serialization for read and write NFS requests separately. It does not change the default behavior since there are too many factors to consider, but gives additional space for further experiments and tuning. The main motivation for this change is very low write speed in case of ZFS with sync=always or when NFS clients requests sychronous operation, when every separate request has to be written/flushed to ZIL, and requests are processed one at a time. Setting vfs.nfsd.fha.write=0 in that case allows to increase ZIL throughput by several times by coalescing writes and cache flushes. There is a worry that doing it may increase data fragmentation on disks, but I suppose it should not happen for pool with SLOG. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/fs/nfsserver/nfs_fha_new.c stable/10/sys/nfs/nfs_fha.c stable/10/sys/nfs/nfs_fha.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_fha_new.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_fha_new.c Mon Aug 7 07:02:51 2017 (r322137) +++ stable/10/sys/fs/nfsserver/nfs_fha_new.c Mon Aug 7 07:40:00 2017 (r322138) @@ -93,7 +93,7 @@ fhanew_init(void *foo) sysctl_ctx_init(&softc->sysctl_ctx); softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", CTLFLAG_RD, - 0, "fha node"); + 0, "NFS File Handle Affinity (FHA)"); if (softc->sysctl_tree == NULL) { printf("%s: unable to allocate sysctl tree\n", __func__); return; Modified: stable/10/sys/nfs/nfs_fha.c ============================================================================== --- stable/10/sys/nfs/nfs_fha.c Mon Aug 7 07:02:51 2017 (r322137) +++ stable/10/sys/nfs/nfs_fha.c Mon Aug 7 07:40:00 2017 (r322138) @@ -51,7 +51,6 @@ static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA", "NFS FHA"); void fha_init(struct fha_params *softc) { - char tmpstr[128]; int i; for (i = 0; i < FHA_HASH_SIZE; i++) @@ -61,47 +60,38 @@ fha_init(struct fha_params *softc) * Set the default tuning parameters. */ softc->ctls.enable = FHA_DEF_ENABLE; + softc->ctls.read = FHA_DEF_READ; + softc->ctls.write = FHA_DEF_WRITE; softc->ctls.bin_shift = FHA_DEF_BIN_SHIFT; softc->ctls.max_nfsds_per_fh = FHA_DEF_MAX_NFSDS_PER_FH; softc->ctls.max_reqs_per_nfsd = FHA_DEF_MAX_REQS_PER_NFSD; /* - * Allow the user to override the defaults at boot time with - * tunables. + * Add sysctls so the user can change the tuning parameters. */ - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.enable", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.enable); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.bin_shift", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.bin_shift); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_nfsds_per_fh", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_nfsds_per_fh); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_reqs_per_nfsd", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_reqs_per_nfsd); - - /* - * Add sysctls so the user can change the tuning parameters at - * runtime. - */ SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "enable", CTLFLAG_RW, + OID_AUTO, "enable", CTLFLAG_RWTUN, &softc->ctls.enable, 0, "Enable NFS File Handle Affinity (FHA)"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "bin_shift", CTLFLAG_RW, - &softc->ctls.bin_shift, 0, "For FHA reads, no two requests will " - "contend if they're 2^(bin_shift) bytes apart"); + OID_AUTO, "read", CTLFLAG_RWTUN, + &softc->ctls.read, 0, "Enable NFS FHA read locality"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RW, + OID_AUTO, "write", CTLFLAG_RWTUN, + &softc->ctls.write, 0, "Enable NFS FHA write locality"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "bin_shift", CTLFLAG_RWTUN, + &softc->ctls.bin_shift, 0, "Maximum locality distance 2^(bin_shift) bytes"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RWTUN, &softc->ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that " "should be working on requests for the same file handle"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RW, + OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RWTUN, &softc->ctls.max_reqs_per_nfsd, 0, "Maximum requests that " "single nfsd thread should be working on at any time"); @@ -144,6 +134,7 @@ fha_extract_info(struct svc_req *req, struct fha_info i->fh = ++random_fh; i->offset = 0; i->locktype = LK_EXCLUSIVE; + i->read = i->write = 0; /* * Extract the procnum and convert to v3 form if necessary, @@ -169,6 +160,9 @@ fha_extract_info(struct svc_req *req, struct fha_info if (cb->no_offset(procnum)) goto out; + i->read = cb->is_read(procnum); + i->write = cb->is_write(procnum); + error = cb->realign(&req->rq_args, M_NOWAIT); if (error) goto out; @@ -181,7 +175,7 @@ fha_extract_info(struct svc_req *req, struct fha_info goto out; /* Content ourselves with zero offset for all but reads. */ - if (cb->is_read(procnum) || cb->is_write(procnum)) + if (i->read || i->write) cb->get_offset(&md, &dpos, v3, i); out: @@ -311,8 +305,13 @@ fha_hash_entry_choose_thread(struct fha_params *softc, return (thread); } + /* Check whether we should consider locality. */ + if ((i->read && !softc->ctls.read) || + (i->write && !softc->ctls.write)) + goto noloc; + /* - * Check for read locality, making sure that we won't + * Check for locality, making sure that we won't * exceed our per-thread load limit in the process. */ offset1 = i->offset; @@ -332,6 +331,7 @@ fha_hash_entry_choose_thread(struct fha_params *softc, } } +noloc: /* * We don't have a locality match, so skip this thread, * but keep track of the most attractive thread in case Modified: stable/10/sys/nfs/nfs_fha.h ============================================================================== --- stable/10/sys/nfs/nfs_fha.h Mon Aug 7 07:02:51 2017 (r322137) +++ stable/10/sys/nfs/nfs_fha.h Mon Aug 7 07:40:00 2017 (r322138) @@ -31,6 +31,8 @@ /* Sysctl defaults. */ #define FHA_DEF_ENABLE 1 +#define FHA_DEF_READ 1 +#define FHA_DEF_WRITE 1 #define FHA_DEF_BIN_SHIFT 22 /* 4MB */ #define FHA_DEF_MAX_NFSDS_PER_FH 8 #define FHA_DEF_MAX_REQS_PER_NFSD 0 /* Unlimited */ @@ -39,6 +41,8 @@ struct fha_ctls { int enable; + int read; + int write; uint32_t bin_shift; uint32_t max_nfsds_per_fh; uint32_t max_reqs_per_nfsd; @@ -79,6 +83,8 @@ struct fha_info { u_int64_t fh; off_t offset; int locktype; + int read; + int write; }; struct fha_callbacks { From owner-svn-src-stable@freebsd.org Mon Aug 7 12:28:00 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E5BFDD008D; Mon, 7 Aug 2017 12:28:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 75C3B683DC; Mon, 7 Aug 2017 12:28:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CRx8n081990; Mon, 7 Aug 2017 12:27:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CRxcc081989; Mon, 7 Aug 2017 12:27:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071227.v77CRxcc081989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322140 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 322140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:28:00 -0000 Author: hselasky Date: Mon Aug 7 12:27:59 2017 New Revision: 322140 URL: https://svnweb.freebsd.org/changeset/base/322140 Log: MFC r312877 and r312878: Minor code refactor as a preparation step for suprise removal of CX-4 PCI device(s), changes: - alloc_entry() now clears bit for page slot entry aswell - update of cmd->ent_arr[] is now under cmd->alloc_lock - complete command if alloc_entry() fails Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 08:45:08 2017 (r322139) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:27:59 2017 (r322140) @@ -39,6 +39,11 @@ #include "mlx5_core.h" +static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size); +static void mlx5_free_cmd_msg(struct mlx5_core_dev *dev, + struct mlx5_cmd_msg *msg); +static void free_msg(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *msg); + enum { CMD_IF_REV = 5, }; @@ -110,18 +115,27 @@ static u8 alloc_token(struct mlx5_cmd *cmd) return token; } -static int alloc_ent(struct mlx5_cmd *cmd) +static int alloc_ent(struct mlx5_cmd_work_ent *ent) { unsigned long flags; - int ret; + struct mlx5_cmd *cmd = ent->cmd; + int ret = cmd->max_reg_cmds; spin_lock_irqsave(&cmd->alloc_lock, flags); - ret = find_first_bit(&cmd->bitmask, cmd->max_reg_cmds); - if (ret < cmd->max_reg_cmds) - clear_bit(ret, &cmd->bitmask); + if (!ent->page_queue) { + ret = find_first_bit(&cmd->bitmask, cmd->max_reg_cmds); + if (ret >= cmd->max_reg_cmds) + ret = -1; + } + + if (ret != -1) { + ent->idx = ret; + clear_bit(ent->idx, &cmd->bitmask); + cmd->ent_arr[ent->idx] = ent; + } spin_unlock_irqrestore(&cmd->alloc_lock, flags); - return ret < cmd->max_reg_cmds ? ret : -1; + return ret; } static void free_ent(struct mlx5_cmd *cmd, int idx) @@ -704,6 +718,54 @@ static void dump_command(struct mlx5_core_dev *dev, pr_debug("\n"); } +static void complete_command(struct mlx5_cmd_work_ent *ent) +{ + struct mlx5_cmd *cmd = ent->cmd; + struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev, + cmd); + mlx5_cmd_cbk_t callback; + void *context; + + s64 ds; + struct mlx5_cmd_stats *stats; + unsigned long flags; + int err; + struct semaphore *sem; + + if (ent->page_queue) + sem = &cmd->pages_sem; + else + sem = &cmd->sem; + + if (ent->callback) { + ds = ent->ts2 - ent->ts1; + if (ent->op < ARRAY_SIZE(cmd->stats)) { + stats = &cmd->stats[ent->op]; + spin_lock_irqsave(&stats->lock, flags); + stats->sum += ds; + ++stats->n; + spin_unlock_irqrestore(&stats->lock, flags); + } + + callback = ent->callback; + context = ent->context; + err = ent->ret; + if (!err) + err = mlx5_copy_from_msg(ent->uout, + ent->out, + ent->uout_size); + + mlx5_free_cmd_msg(dev, ent->out); + free_msg(dev, ent->in); + + free_cmd(ent); + callback(err, context); + } else { + complete(&ent->done); + } + up(sem); +} + static void cmd_work_handler(struct work_struct *work) { struct mlx5_cmd_work_ent *ent = container_of(work, struct mlx5_cmd_work_ent, work); @@ -719,19 +781,13 @@ static void cmd_work_handler(struct work_struct *work) } down(sem); - if (!ent->page_queue) { - ent->idx = alloc_ent(cmd); - if (ent->idx < 0) { - mlx5_core_err(dev, "failed to allocate command entry\n"); - up(sem); - return; - } - } else { - ent->idx = cmd->max_reg_cmds; + + if (alloc_ent(ent) < 0) { + complete_command(ent); + return; } ent->token = alloc_token(cmd); - cmd->ent_arr[ent->idx] = ent; lay = get_inst(cmd, ent->idx); ent->lay = lay; memset(lay, 0, sizeof(*lay)); @@ -1108,23 +1164,12 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, { struct mlx5_cmd *cmd = &dev->cmd; struct mlx5_cmd_work_ent *ent; - mlx5_cmd_cbk_t callback; - void *context; - int err; int i; - struct semaphore *sem; - s64 ds; - struct mlx5_cmd_stats *stats; - unsigned long flags; while (vector != 0) { i = ffs(vector) - 1; vector &= ~(1U << i); ent = cmd->ent_arr[i]; - if (ent->page_queue) - sem = &cmd->pages_sem; - else - sem = &cmd->sem; ent->ts2 = ktime_get_ns(); memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); @@ -1142,33 +1187,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, ent->status); } free_ent(cmd, ent->idx); - if (ent->callback) { - ds = ent->ts2 - ent->ts1; - if (ent->op < ARRAY_SIZE(cmd->stats)) { - stats = &cmd->stats[ent->op]; - spin_lock_irqsave(&stats->lock, flags); - stats->sum += ds; - ++stats->n; - spin_unlock_irqrestore(&stats->lock, flags); - } - - callback = ent->callback; - context = ent->context; - err = ent->ret; - if (!err) - err = mlx5_copy_from_msg(ent->uout, - ent->out, - ent->uout_size); - - mlx5_free_cmd_msg(dev, ent->out); - free_msg(dev, ent->in); - - free_cmd(ent); - callback(err, context); - } else { - complete(&ent->done); - } - up(sem); + complete_command(ent); } } EXPORT_SYMBOL(mlx5_cmd_comp_handler); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:29:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAD0DDD01D1; Mon, 7 Aug 2017 12:29:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A626C68547; Mon, 7 Aug 2017 12:29:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CTfx9082108; Mon, 7 Aug 2017 12:29:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CTf8f082107; Mon, 7 Aug 2017 12:29:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071229.v77CTf8f082107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322141 - stable/10/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 322141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:29:42 -0000 Author: hselasky Date: Mon Aug 7 12:29:41 2017 New Revision: 322141 URL: https://svnweb.freebsd.org/changeset/base/322141 Log: MFC r312877 and r312878: Minor code refactor as a preparation step for suprise removal of CX-4 PCI device(s), changes: - alloc_entry() now clears bit for page slot entry aswell - update of cmd->ent_arr[] is now under cmd->alloc_lock - complete command if alloc_entry() fails Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:27:59 2017 (r322140) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:29:41 2017 (r322141) @@ -39,6 +39,11 @@ #include "mlx5_core.h" +static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size); +static void mlx5_free_cmd_msg(struct mlx5_core_dev *dev, + struct mlx5_cmd_msg *msg); +static void free_msg(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *msg); + enum { CMD_IF_REV = 5, }; @@ -110,18 +115,27 @@ static u8 alloc_token(struct mlx5_cmd *cmd) return token; } -static int alloc_ent(struct mlx5_cmd *cmd) +static int alloc_ent(struct mlx5_cmd_work_ent *ent) { unsigned long flags; - int ret; + struct mlx5_cmd *cmd = ent->cmd; + int ret = cmd->max_reg_cmds; spin_lock_irqsave(&cmd->alloc_lock, flags); - ret = find_first_bit(&cmd->bitmask, cmd->max_reg_cmds); - if (ret < cmd->max_reg_cmds) - clear_bit(ret, &cmd->bitmask); + if (!ent->page_queue) { + ret = find_first_bit(&cmd->bitmask, cmd->max_reg_cmds); + if (ret >= cmd->max_reg_cmds) + ret = -1; + } + + if (ret != -1) { + ent->idx = ret; + clear_bit(ent->idx, &cmd->bitmask); + cmd->ent_arr[ent->idx] = ent; + } spin_unlock_irqrestore(&cmd->alloc_lock, flags); - return ret < cmd->max_reg_cmds ? ret : -1; + return ret; } static void free_ent(struct mlx5_cmd *cmd, int idx) @@ -704,6 +718,54 @@ static void dump_command(struct mlx5_core_dev *dev, pr_debug("\n"); } +static void complete_command(struct mlx5_cmd_work_ent *ent) +{ + struct mlx5_cmd *cmd = ent->cmd; + struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev, + cmd); + mlx5_cmd_cbk_t callback; + void *context; + + s64 ds; + struct mlx5_cmd_stats *stats; + unsigned long flags; + int err; + struct semaphore *sem; + + if (ent->page_queue) + sem = &cmd->pages_sem; + else + sem = &cmd->sem; + + if (ent->callback) { + ds = ent->ts2 - ent->ts1; + if (ent->op < ARRAY_SIZE(cmd->stats)) { + stats = &cmd->stats[ent->op]; + spin_lock_irqsave(&stats->lock, flags); + stats->sum += ds; + ++stats->n; + spin_unlock_irqrestore(&stats->lock, flags); + } + + callback = ent->callback; + context = ent->context; + err = ent->ret; + if (!err) + err = mlx5_copy_from_msg(ent->uout, + ent->out, + ent->uout_size); + + mlx5_free_cmd_msg(dev, ent->out); + free_msg(dev, ent->in); + + free_cmd(ent); + callback(err, context); + } else { + complete(&ent->done); + } + up(sem); +} + static void cmd_work_handler(struct work_struct *work) { struct mlx5_cmd_work_ent *ent = container_of(work, struct mlx5_cmd_work_ent, work); @@ -719,19 +781,13 @@ static void cmd_work_handler(struct work_struct *work) } down(sem); - if (!ent->page_queue) { - ent->idx = alloc_ent(cmd); - if (ent->idx < 0) { - mlx5_core_err(dev, "failed to allocate command entry\n"); - up(sem); - return; - } - } else { - ent->idx = cmd->max_reg_cmds; + + if (alloc_ent(ent) < 0) { + complete_command(ent); + return; } ent->token = alloc_token(cmd); - cmd->ent_arr[ent->idx] = ent; lay = get_inst(cmd, ent->idx); ent->lay = lay; memset(lay, 0, sizeof(*lay)); @@ -1108,23 +1164,12 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, { struct mlx5_cmd *cmd = &dev->cmd; struct mlx5_cmd_work_ent *ent; - mlx5_cmd_cbk_t callback; - void *context; - int err; int i; - struct semaphore *sem; - s64 ds; - struct mlx5_cmd_stats *stats; - unsigned long flags; while (vector != 0) { i = ffs(vector) - 1; vector &= ~(1U << i); ent = cmd->ent_arr[i]; - if (ent->page_queue) - sem = &cmd->pages_sem; - else - sem = &cmd->sem; ent->ts2 = ktime_get_ns(); memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); @@ -1142,33 +1187,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, ent->status); } free_ent(cmd, ent->idx); - if (ent->callback) { - ds = ent->ts2 - ent->ts1; - if (ent->op < ARRAY_SIZE(cmd->stats)) { - stats = &cmd->stats[ent->op]; - spin_lock_irqsave(&stats->lock, flags); - stats->sum += ds; - ++stats->n; - spin_unlock_irqrestore(&stats->lock, flags); - } - - callback = ent->callback; - context = ent->context; - err = ent->ret; - if (!err) - err = mlx5_copy_from_msg(ent->uout, - ent->out, - ent->uout_size); - - mlx5_free_cmd_msg(dev, ent->out); - free_msg(dev, ent->in); - - free_cmd(ent); - callback(err, context); - } else { - complete(&ent->done); - } - up(sem); + complete_command(ent); } } EXPORT_SYMBOL(mlx5_cmd_comp_handler); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:33:16 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ABAFDD0581; Mon, 7 Aug 2017 12:33:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 46C0D68932; Mon, 7 Aug 2017 12:33:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CXFkq085922; Mon, 7 Aug 2017 12:33:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CXFjF085921; Mon, 7 Aug 2017 12:33:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071233.v77CXFjF085921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322142 - stable/11/sys/dev/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5 X-SVN-Commit-Revision: 322142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:33:16 -0000 Author: hselasky Date: Mon Aug 7 12:33:15 2017 New Revision: 322142 URL: https://svnweb.freebsd.org/changeset/base/322142 Log: MFC r312875: Make fw_pages statistics counter 64-bit to avoid overflow. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:29:41 2017 (r322141) +++ stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:33:15 2017 (r322142) @@ -518,7 +518,7 @@ struct mlx5_priv { /* pages stuff */ struct workqueue_struct *pg_wq; struct rb_root page_root; - int fw_pages; + s64 fw_pages; atomic_t reg_pages; struct list_head free_list; From owner-svn-src-stable@freebsd.org Mon Aug 7 12:34:35 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7D07DD07B8; Mon, 7 Aug 2017 12:34:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 71C0568BDA; Mon, 7 Aug 2017 12:34:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CYYod086018; Mon, 7 Aug 2017 12:34:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CYYdb086017; Mon, 7 Aug 2017 12:34:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071234.v77CYYdb086017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322143 - stable/10/sys/dev/mlx5 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5 X-SVN-Commit-Revision: 322143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:34:35 -0000 Author: hselasky Date: Mon Aug 7 12:34:34 2017 New Revision: 322143 URL: https://svnweb.freebsd.org/changeset/base/322143 Log: MFC r312875: Make fw_pages statistics counter 64-bit to avoid overflow. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/driver.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:33:15 2017 (r322142) +++ stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:34:34 2017 (r322143) @@ -518,7 +518,7 @@ struct mlx5_priv { /* pages stuff */ struct workqueue_struct *pg_wq; struct rb_root page_root; - int fw_pages; + s64 fw_pages; atomic_t reg_pages; struct list_head free_list; From owner-svn-src-stable@freebsd.org Mon Aug 7 12:36:50 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D5ADD0978; Mon, 7 Aug 2017 12:36:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 4F01368D7C; Mon, 7 Aug 2017 12:36:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77Cansi086147; Mon, 7 Aug 2017 12:36:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77Canxu086144; Mon, 7 Aug 2017 12:36:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071236.v77Canxu086144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322144 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:36:50 -0000 Author: hselasky Date: Mon Aug 7 12:36:48 2017 New Revision: 322144 URL: https://svnweb.freebsd.org/changeset/base/322144 Log: MFC r312880: Wait for all VFs pages to be reclaimed before closing EQ pages. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:34:34 2017 (r322143) +++ stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:36:48 2017 (r322144) @@ -43,6 +43,7 @@ #include #define MLX5_QCOUNTER_SETS_NETDEV 64 +#define MLX5_MAX_NUMBER_OF_VFS 128 enum { MLX5_BOARD_ID_LEN = 64, @@ -521,7 +522,7 @@ struct mlx5_priv { s64 fw_pages; atomic_t reg_pages; struct list_head free_list; - + s64 pages_per_func[MLX5_MAX_NUMBER_OF_VFS]; struct mlx5_core_health health; struct mlx5_srq_table srq_table; @@ -850,6 +851,7 @@ void mlx5_core_req_pages_handler(struct mlx5_core_dev s32 npages); int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot); int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev); +s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev); void mlx5_register_debugfs(void); void mlx5_unregister_debugfs(void); int mlx5_eq_init(struct mlx5_core_dev *dev); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:34:34 2017 (r322143) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:36:48 2017 (r322144) @@ -853,6 +853,7 @@ static void mlx5_dev_cleanup(struct mlx5_core_dev *dev mlx5_cleanup_qp_table(dev); mlx5_cleanup_cq_table(dev); unmap_bf_area(dev); + mlx5_wait_for_reclaim_vfs_pages(dev); free_comp_eqs(dev); mlx5_stop_eqs(dev); mlx5_free_uuars(dev, &priv->uuari); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:34:34 2017 (r322143) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:36:48 2017 (r322144) @@ -27,6 +27,7 @@ #include #include +#include #include #include "mlx5_core.h" @@ -282,6 +283,7 @@ retry: goto out_alloc; } dev->priv.fw_pages += npages; + dev->priv.pages_per_func[func_id] += npages; if (out.hdr.status) { err = mlx5_cmd_status_to_err(&out.hdr); @@ -355,7 +357,7 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u3 *nclaimed = num_claimed; dev->priv.fw_pages -= num_claimed; - + dev->priv.pages_per_func[func_id] -= num_claimed; for (i = 0; i < num_claimed; i++) { addr = be64_to_cpu(out->pas[i]); free_4k(dev, addr); @@ -422,6 +424,31 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *d enum { MLX5_BLKS_FOR_RECLAIM_PAGES = 12 }; + +s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev) +{ + int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); + s64 prevpages = 0; + s64 npages = 0; + + while (!time_after(jiffies, end)) { + /* exclude own function, VFs only */ + npages = dev->priv.fw_pages - dev->priv.pages_per_func[0]; + if (!npages) + break; + + if (npages != prevpages) + end = end + msecs_to_jiffies(100); + + prevpages = npages; + msleep(1); + } + + if (npages) + mlx5_core_warn(dev, "FW did not return all VFs pages, will cause to memory leak\n"); + + return -npages; +} static int optimal_reclaimed_pages(void) { From owner-svn-src-stable@freebsd.org Mon Aug 7 12:38:06 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2446EDD0AA7; Mon, 7 Aug 2017 12:38:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 001D668EDC; Mon, 7 Aug 2017 12:38:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77Cc5Ei086242; Mon, 7 Aug 2017 12:38:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77Cc5Aa086239; Mon, 7 Aug 2017 12:38:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071238.v77Cc5Aa086239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322145 - in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:38:06 -0000 Author: hselasky Date: Mon Aug 7 12:38:04 2017 New Revision: 322145 URL: https://svnweb.freebsd.org/changeset/base/322145 Log: MFC r312880: Wait for all VFs pages to be reclaimed before closing EQ pages. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:36:48 2017 (r322144) +++ stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:38:04 2017 (r322145) @@ -43,6 +43,7 @@ #include #define MLX5_QCOUNTER_SETS_NETDEV 64 +#define MLX5_MAX_NUMBER_OF_VFS 128 enum { MLX5_BOARD_ID_LEN = 64, @@ -521,7 +522,7 @@ struct mlx5_priv { s64 fw_pages; atomic_t reg_pages; struct list_head free_list; - + s64 pages_per_func[MLX5_MAX_NUMBER_OF_VFS]; struct mlx5_core_health health; struct mlx5_srq_table srq_table; @@ -850,6 +851,7 @@ void mlx5_core_req_pages_handler(struct mlx5_core_dev s32 npages); int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot); int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev); +s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev); void mlx5_register_debugfs(void); void mlx5_unregister_debugfs(void); int mlx5_eq_init(struct mlx5_core_dev *dev); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:36:48 2017 (r322144) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:38:04 2017 (r322145) @@ -851,6 +851,7 @@ static void mlx5_dev_cleanup(struct mlx5_core_dev *dev mlx5_cleanup_qp_table(dev); mlx5_cleanup_cq_table(dev); unmap_bf_area(dev); + mlx5_wait_for_reclaim_vfs_pages(dev); free_comp_eqs(dev); mlx5_stop_eqs(dev); mlx5_free_uuars(dev, &priv->uuari); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:36:48 2017 (r322144) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:38:04 2017 (r322145) @@ -27,6 +27,7 @@ #include #include +#include #include #include "mlx5_core.h" @@ -282,6 +283,7 @@ retry: goto out_alloc; } dev->priv.fw_pages += npages; + dev->priv.pages_per_func[func_id] += npages; if (out.hdr.status) { err = mlx5_cmd_status_to_err(&out.hdr); @@ -355,7 +357,7 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u3 *nclaimed = num_claimed; dev->priv.fw_pages -= num_claimed; - + dev->priv.pages_per_func[func_id] -= num_claimed; for (i = 0; i < num_claimed; i++) { addr = be64_to_cpu(out->pas[i]); free_4k(dev, addr); @@ -422,6 +424,31 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *d enum { MLX5_BLKS_FOR_RECLAIM_PAGES = 12 }; + +s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev) +{ + int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); + s64 prevpages = 0; + s64 npages = 0; + + while (!time_after(jiffies, end)) { + /* exclude own function, VFs only */ + npages = dev->priv.fw_pages - dev->priv.pages_per_func[0]; + if (!npages) + break; + + if (npages != prevpages) + end = end + msecs_to_jiffies(100); + + prevpages = npages; + msleep(1); + } + + if (npages) + mlx5_core_warn(dev, "FW did not return all VFs pages, will cause to memory leak\n"); + + return -npages; +} static int optimal_reclaimed_pages(void) { From owner-svn-src-stable@freebsd.org Mon Aug 7 12:41:07 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BD8DD0E26; Mon, 7 Aug 2017 12:41:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2D3D1692A2; Mon, 7 Aug 2017 12:41:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77Cf6tw087289; Mon, 7 Aug 2017 12:41:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77Cf6nH087288; Mon, 7 Aug 2017 12:41:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071241.v77Cf6nH087288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322146 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 322146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:41:07 -0000 Author: hselasky Date: Mon Aug 7 12:41:06 2017 New Revision: 322146 URL: https://svnweb.freebsd.org/changeset/base/322146 Log: MFC r312879: Rename struct fw_page into struct mlx5_fw_page as a preparation step for adding busdma support. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:38:04 2017 (r322145) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:41:06 2017 (r322146) @@ -38,7 +38,7 @@ struct mlx5_pages_req { struct work_struct work; }; -struct fw_page { +struct mlx5_fw_page { struct rb_node rb_node; u64 addr; struct page *page; @@ -77,13 +77,13 @@ static int insert_page(struct mlx5_core_dev *dev, u64 struct rb_root *root = &dev->priv.page_root; struct rb_node **new = &root->rb_node; struct rb_node *parent = NULL; - struct fw_page *nfp; - struct fw_page *tfp; + struct mlx5_fw_page *nfp; + struct mlx5_fw_page *tfp; int i; while (*new) { parent = *new; - tfp = rb_entry(parent, struct fw_page, rb_node); + tfp = rb_entry(parent, struct mlx5_fw_page, rb_node); if (tfp->addr < addr) new = &parent->rb_left; else if (tfp->addr > addr) @@ -108,15 +108,15 @@ static int insert_page(struct mlx5_core_dev *dev, u64 return 0; } -static struct fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr) +static struct mlx5_fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr) { struct rb_root *root = &dev->priv.page_root; struct rb_node *tmp = root->rb_node; - struct fw_page *result = NULL; - struct fw_page *tfp; + struct mlx5_fw_page *result = NULL; + struct mlx5_fw_page *tfp; while (tmp) { - tfp = rb_entry(tmp, struct fw_page, rb_node); + tfp = rb_entry(tmp, struct mlx5_fw_page, rb_node); if (tfp->addr < addr) { tmp = tmp->rb_left; } else if (tfp->addr > addr) { @@ -156,13 +156,13 @@ static int mlx5_cmd_query_pages(struct mlx5_core_dev * static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr) { - struct fw_page *fp; + struct mlx5_fw_page *fp; unsigned n; if (list_empty(&dev->priv.free_list)) return -ENOMEM; - fp = list_entry(dev->priv.free_list.next, struct fw_page, list); + fp = list_entry(dev->priv.free_list.next, struct mlx5_fw_page, list); n = find_first_bit(&fp->bitmask, 8 * sizeof(fp->bitmask)); if (n >= MLX5_NUM_4K_IN_PAGE) { mlx5_core_warn(dev, "alloc 4k bug\n"); @@ -180,7 +180,7 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *ad static void free_4k(struct mlx5_core_dev *dev, u64 addr) { - struct fw_page *fwp; + struct mlx5_fw_page *fwp; int n; fwp = find_fw_page(dev, addr & PAGE_MASK); @@ -466,7 +466,7 @@ static int optimal_reclaimed_pages(void) int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) { int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); - struct fw_page *fwp; + struct mlx5_fw_page *fwp; struct rb_node *p; int nclaimed = 0; int err; @@ -474,7 +474,7 @@ int mlx5_reclaim_startup_pages(struct mlx5_core_dev *d do { p = rb_first(&dev->priv.page_root); if (p) { - fwp = rb_entry(p, struct fw_page, rb_node); + fwp = rb_entry(p, struct mlx5_fw_page, rb_node); err = reclaim_pages(dev, fwp->func_id, optimal_reclaimed_pages(), &nclaimed); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:42:30 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50BECDD0F04; Mon, 7 Aug 2017 12:42:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E9DC9694E5; Mon, 7 Aug 2017 12:42:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CgTvC090228; Mon, 7 Aug 2017 12:42:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CgTkd090227; Mon, 7 Aug 2017 12:42:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071242.v77CgTkd090227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322147 - stable/10/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 322147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:42:30 -0000 Author: hselasky Date: Mon Aug 7 12:42:28 2017 New Revision: 322147 URL: https://svnweb.freebsd.org/changeset/base/322147 Log: MFC r312879: Rename struct fw_page into struct mlx5_fw_page as a preparation step for adding busdma support. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:41:06 2017 (r322146) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:42:28 2017 (r322147) @@ -38,7 +38,7 @@ struct mlx5_pages_req { struct work_struct work; }; -struct fw_page { +struct mlx5_fw_page { struct rb_node rb_node; u64 addr; struct page *page; @@ -77,13 +77,13 @@ static int insert_page(struct mlx5_core_dev *dev, u64 struct rb_root *root = &dev->priv.page_root; struct rb_node **new = &root->rb_node; struct rb_node *parent = NULL; - struct fw_page *nfp; - struct fw_page *tfp; + struct mlx5_fw_page *nfp; + struct mlx5_fw_page *tfp; int i; while (*new) { parent = *new; - tfp = rb_entry(parent, struct fw_page, rb_node); + tfp = rb_entry(parent, struct mlx5_fw_page, rb_node); if (tfp->addr < addr) new = &parent->rb_left; else if (tfp->addr > addr) @@ -108,15 +108,15 @@ static int insert_page(struct mlx5_core_dev *dev, u64 return 0; } -static struct fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr) +static struct mlx5_fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr) { struct rb_root *root = &dev->priv.page_root; struct rb_node *tmp = root->rb_node; - struct fw_page *result = NULL; - struct fw_page *tfp; + struct mlx5_fw_page *result = NULL; + struct mlx5_fw_page *tfp; while (tmp) { - tfp = rb_entry(tmp, struct fw_page, rb_node); + tfp = rb_entry(tmp, struct mlx5_fw_page, rb_node); if (tfp->addr < addr) { tmp = tmp->rb_left; } else if (tfp->addr > addr) { @@ -156,13 +156,13 @@ static int mlx5_cmd_query_pages(struct mlx5_core_dev * static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr) { - struct fw_page *fp; + struct mlx5_fw_page *fp; unsigned n; if (list_empty(&dev->priv.free_list)) return -ENOMEM; - fp = list_entry(dev->priv.free_list.next, struct fw_page, list); + fp = list_entry(dev->priv.free_list.next, struct mlx5_fw_page, list); n = find_first_bit(&fp->bitmask, 8 * sizeof(fp->bitmask)); if (n >= MLX5_NUM_4K_IN_PAGE) { mlx5_core_warn(dev, "alloc 4k bug\n"); @@ -180,7 +180,7 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *ad static void free_4k(struct mlx5_core_dev *dev, u64 addr) { - struct fw_page *fwp; + struct mlx5_fw_page *fwp; int n; fwp = find_fw_page(dev, addr & PAGE_MASK); @@ -466,7 +466,7 @@ static int optimal_reclaimed_pages(void) int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) { int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); - struct fw_page *fwp; + struct mlx5_fw_page *fwp; struct rb_node *p; int nclaimed = 0; int err; @@ -474,7 +474,7 @@ int mlx5_reclaim_startup_pages(struct mlx5_core_dev *d do { p = rb_first(&dev->priv.page_root); if (p) { - fwp = rb_entry(p, struct fw_page, rb_node); + fwp = rb_entry(p, struct mlx5_fw_page, rb_node); err = reclaim_pages(dev, fwp->func_id, optimal_reclaimed_pages(), &nclaimed); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:44:20 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B4CCDD1025; Mon, 7 Aug 2017 12:44:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 385DE69660; Mon, 7 Aug 2017 12:44:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CiJpE090360; Mon, 7 Aug 2017 12:44:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CiIkn090354; Mon, 7 Aug 2017 12:44:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071244.v77CiIkn090354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322148 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:44:20 -0000 Author: hselasky Date: Mon Aug 7 12:44:18 2017 New Revision: 322148 URL: https://svnweb.freebsd.org/changeset/base/322148 Log: MFC r312881: Add support for device surprise removal and other PCI errors. - When device disappears from PCI indicate error device state and: 1) Trigger command completion for all pending commands 2) Prevent new commands from executing and return: - success for modify and remove/cleanup commands - failure for create/query commands 3) When reclaiming pages for a device in error state don't ask FW to return all given pages, just release the allocated memory Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:42:28 2017 (r322147) +++ stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:44:18 2017 (r322148) @@ -713,6 +713,7 @@ struct mlx5_cmd_work_ent { u64 ts1; u64 ts2; u16 op; + u8 busy; }; struct mlx5_pas { @@ -791,6 +792,7 @@ static inline void *mlx5_vmalloc(unsigned long size) return rtn; } +void mlx5_enter_error_state(struct mlx5_core_dev *dev); int mlx5_cmd_init(struct mlx5_core_dev *dev); void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); void mlx5_cmd_use_events(struct mlx5_core_dev *dev); @@ -862,6 +864,7 @@ void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); +void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:42:28 2017 (r322147) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:44:18 2017 (r322148) @@ -119,6 +119,8 @@ static int alloc_ent(struct mlx5_cmd_work_ent *ent) { unsigned long flags; struct mlx5_cmd *cmd = ent->cmd; + struct mlx5_core_dev *dev = + container_of(cmd, struct mlx5_core_dev, cmd); int ret = cmd->max_reg_cmds; spin_lock_irqsave(&cmd->alloc_lock, flags); @@ -128,7 +130,11 @@ static int alloc_ent(struct mlx5_cmd_work_ent *ent) ret = -1; } + if (dev->state != MLX5_DEVICE_STATE_UP) + ret = -1; + if (ret != -1) { + ent->busy = 1; ent->idx = ret; clear_bit(ent->idx, &cmd->bitmask); cmd->ent_arr[ent->idx] = ent; @@ -205,12 +211,16 @@ static void set_signature(struct mlx5_cmd_work_ent *en static void poll_timeout(struct mlx5_cmd_work_ent *ent) { - int poll_end = jiffies + msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000); + struct mlx5_core_dev *dev = container_of(ent->cmd, + struct mlx5_core_dev, cmd); + int poll_end = jiffies + + msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000); u8 own; do { own = ent->lay->status_own; - if (!(own & CMD_OWNER_HW)) { + if (!(own & CMD_OWNER_HW) || + dev->state != MLX5_DEVICE_STATE_UP) { ent->ret = 0; return; } @@ -718,6 +728,173 @@ static void dump_command(struct mlx5_core_dev *dev, pr_debug("\n"); } +static int set_internal_err_outbox(struct mlx5_core_dev *dev, u16 opcode, + struct mlx5_outbox_hdr *hdr) +{ + hdr->status = 0; + hdr->syndrome = 0; + + switch (opcode) { + case MLX5_CMD_OP_TEARDOWN_HCA: + case MLX5_CMD_OP_DISABLE_HCA: + case MLX5_CMD_OP_MANAGE_PAGES: + case MLX5_CMD_OP_DESTROY_MKEY: + case MLX5_CMD_OP_DESTROY_EQ: + case MLX5_CMD_OP_DESTROY_CQ: + case MLX5_CMD_OP_DESTROY_QP: + case MLX5_CMD_OP_DESTROY_PSV: + case MLX5_CMD_OP_DESTROY_SRQ: + case MLX5_CMD_OP_DESTROY_XRC_SRQ: + case MLX5_CMD_OP_DESTROY_DCT: + case MLX5_CMD_OP_DEALLOC_Q_COUNTER: + case MLX5_CMD_OP_DEALLOC_PD: + case MLX5_CMD_OP_DEALLOC_UAR: + case MLX5_CMD_OP_DETACH_FROM_MCG: + case MLX5_CMD_OP_DEALLOC_XRCD: + case MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN: + case MLX5_CMD_OP_DELETE_VXLAN_UDP_DPORT: + case MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY: + case MLX5_CMD_OP_DESTROY_LAG: + case MLX5_CMD_OP_DESTROY_VPORT_LAG: + case MLX5_CMD_OP_DESTROY_TIR: + case MLX5_CMD_OP_DESTROY_SQ: + case MLX5_CMD_OP_DESTROY_RQ: + case MLX5_CMD_OP_DESTROY_RMP: + case MLX5_CMD_OP_DESTROY_TIS: + case MLX5_CMD_OP_DESTROY_RQT: + case MLX5_CMD_OP_DESTROY_FLOW_TABLE: + case MLX5_CMD_OP_DESTROY_FLOW_GROUP: + case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_DEALLOC_FLOW_COUNTER: + case MLX5_CMD_OP_2ERR_QP: + case MLX5_CMD_OP_2RST_QP: + case MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_FLOW_TABLE: + case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_SET_FLOW_TABLE_ROOT: + case MLX5_CMD_OP_DEALLOC_ENCAP_HEADER: + case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT: + case MLX5_CMD_OP_MODIFY_VPORT_STATE: + case MLX5_CMD_OP_MODIFY_SQ: + case MLX5_CMD_OP_MODIFY_RQ: + case MLX5_CMD_OP_MODIFY_TIS: + case MLX5_CMD_OP_MODIFY_LAG: + case MLX5_CMD_OP_MODIFY_TIR: + case MLX5_CMD_OP_MODIFY_RMP: + case MLX5_CMD_OP_MODIFY_RQT: + case MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_MODIFY_CONG_PARAMS: + case MLX5_CMD_OP_MODIFY_CONG_STATUS: + case MLX5_CMD_OP_MODIFY_CQ: + case MLX5_CMD_OP_MODIFY_ESW_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_HCA_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP: + case MLX5_CMD_OP_ACCESS_REG: + case MLX5_CMD_OP_DRAIN_DCT: + return 0; + + case MLX5_CMD_OP_ADD_VXLAN_UDP_DPORT: + case MLX5_CMD_OP_ALLOC_ENCAP_HEADER: + case MLX5_CMD_OP_ALLOC_FLOW_COUNTER: + case MLX5_CMD_OP_ALLOC_PD: + case MLX5_CMD_OP_ALLOC_Q_COUNTER: + case MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN: + case MLX5_CMD_OP_ALLOC_UAR: + case MLX5_CMD_OP_ALLOC_XRCD: + case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: + case MLX5_CMD_OP_ARM_RQ: + case MLX5_CMD_OP_ARM_XRC_SRQ: + case MLX5_CMD_OP_ATTACH_TO_MCG: + case MLX5_CMD_OP_CONFIG_INT_MODERATION: + case MLX5_CMD_OP_CREATE_CQ: + case MLX5_CMD_OP_CREATE_DCT: + case MLX5_CMD_OP_CREATE_EQ: + case MLX5_CMD_OP_CREATE_FLOW_GROUP: + case MLX5_CMD_OP_CREATE_FLOW_TABLE: + case MLX5_CMD_OP_CREATE_LAG: + case MLX5_CMD_OP_CREATE_MKEY: + case MLX5_CMD_OP_CREATE_PSV: + case MLX5_CMD_OP_CREATE_QOS_PARA_VPORT: + case MLX5_CMD_OP_CREATE_QP: + case MLX5_CMD_OP_CREATE_RMP: + case MLX5_CMD_OP_CREATE_RQ: + case MLX5_CMD_OP_CREATE_RQT: + case MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_CREATE_SQ: + case MLX5_CMD_OP_CREATE_SRQ: + case MLX5_CMD_OP_CREATE_TIR: + case MLX5_CMD_OP_CREATE_TIS: + case MLX5_CMD_OP_CREATE_VPORT_LAG: + case MLX5_CMD_OP_CREATE_XRC_SRQ: + case MLX5_CMD_OP_ENABLE_HCA: + case MLX5_CMD_OP_GEN_EQE: + case MLX5_CMD_OP_GET_DROPPED_PACKET_LOG: + case MLX5_CMD_OP_INIT2INIT_QP: + case MLX5_CMD_OP_INIT2RTR_QP: + case MLX5_CMD_OP_INIT_HCA: + case MLX5_CMD_OP_MAD_IFC: + case MLX5_CMD_OP_NOP: + case MLX5_CMD_OP_PAGE_FAULT_RESUME: + case MLX5_CMD_OP_QUERY_ADAPTER: + case MLX5_CMD_OP_QUERY_CONG_PARAMS: + case MLX5_CMD_OP_QUERY_CONG_STATISTICS: + case MLX5_CMD_OP_QUERY_CONG_STATUS: + case MLX5_CMD_OP_QUERY_CQ: + case MLX5_CMD_OP_QUERY_DCT: + case MLX5_CMD_OP_QUERY_EQ: + case MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_FLOW_COUNTER: + case MLX5_CMD_OP_QUERY_FLOW_GROUP: + case MLX5_CMD_OP_QUERY_FLOW_TABLE: + case MLX5_CMD_OP_QUERY_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_QUERY_HCA_CAP: + case MLX5_CMD_OP_QUERY_HCA_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_HCA_VPORT_GID: + case MLX5_CMD_OP_QUERY_HCA_VPORT_PKEY: + case MLX5_CMD_OP_QUERY_ISSI: + case MLX5_CMD_OP_QUERY_L2_TABLE_ENTRY: + case MLX5_CMD_OP_QUERY_LAG: + case MLX5_CMD_OP_QUERY_MAD_DEMUX: + case MLX5_CMD_OP_QUERY_MKEY: + case MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_OTHER_HCA_CAP: + case MLX5_CMD_OP_QUERY_PAGES: + case MLX5_CMD_OP_QUERY_QP: + case MLX5_CMD_OP_QUERY_Q_COUNTER: + case MLX5_CMD_OP_QUERY_RMP: + case MLX5_CMD_OP_QUERY_ROCE_ADDRESS: + case MLX5_CMD_OP_QUERY_RQ: + case MLX5_CMD_OP_QUERY_RQT: + case MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS: + case MLX5_CMD_OP_QUERY_SQ: + case MLX5_CMD_OP_QUERY_SRQ: + case MLX5_CMD_OP_QUERY_TIR: + case MLX5_CMD_OP_QUERY_TIS: + case MLX5_CMD_OP_QUERY_VPORT_COUNTER: + case MLX5_CMD_OP_QUERY_VPORT_STATE: + case MLX5_CMD_OP_QUERY_XRC_SRQ: + case MLX5_CMD_OP_RST2INIT_QP: + case MLX5_CMD_OP_RTR2RTS_QP: + case MLX5_CMD_OP_RTS2RTS_QP: + case MLX5_CMD_OP_SET_DC_CNAK_TRACE: + case MLX5_CMD_OP_SET_HCA_CAP: + case MLX5_CMD_OP_SET_ISSI: + case MLX5_CMD_OP_SET_L2_TABLE_ENTRY: + case MLX5_CMD_OP_SET_MAD_DEMUX: + case MLX5_CMD_OP_SET_ROCE_ADDRESS: + case MLX5_CMD_OP_SQD_RTS_QP: + case MLX5_CMD_OP_SQERR2RTS_QP: + hdr->status = MLX5_CMD_STAT_INT_ERR; + hdr->syndrome = 0xFFFFFFFF; + return -ECANCELED; + default: + mlx5_core_err(dev, "Unknown FW command (%d)\n", opcode); + return -EINVAL; + } +} + static void complete_command(struct mlx5_cmd_work_ent *ent) { struct mlx5_cmd *cmd = ent->cmd; @@ -737,6 +914,18 @@ static void complete_command(struct mlx5_cmd_work_ent else sem = &cmd->sem; + if (dev->state != MLX5_DEVICE_STATE_UP) { + struct mlx5_outbox_hdr *out_hdr = + (struct mlx5_outbox_hdr *)ent->out; + struct mlx5_inbox_hdr *in_hdr = + (struct mlx5_inbox_hdr *)(ent->in->first.data); + u16 opcode = be16_to_cpu(in_hdr->opcode); + + ent->ret = set_internal_err_outbox(dev, + opcode, + out_hdr); + } + if (ent->callback) { ds = ent->ts2 - ent->ts1; if (ent->op < ARRAY_SIZE(cmd->stats)) { @@ -805,7 +994,7 @@ static void cmd_work_handler(struct work_struct *work) set_signature(ent, !cmd->checksum_disabled); dump_command(dev, ent, 1); ent->ts1 = ktime_get_ns(); - + ent->busy = 0; /* ring doorbell after the descriptor is valid */ mlx5_core_dbg(dev, "writing 0x%x to command doorbell\n", 1 << ent->idx); wmb(); @@ -872,6 +1061,7 @@ static int wait_func(struct mlx5_core_dev *dev, struct else err = 0; } + if (err == -ETIMEDOUT) { mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n", mlx5_command_str(msg_to_opcode(ent->in)), @@ -1180,6 +1370,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, else ent->ret = 0; ent->status = ent->lay->status_own >> 1; + mlx5_core_dbg(dev, "FW command ret 0x%x, status %s(0x%x)\n", ent->ret, @@ -1192,6 +1383,33 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, } EXPORT_SYMBOL(mlx5_cmd_comp_handler); +void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev) +{ + unsigned long vector; + int i = 0; + unsigned long flags; + synchronize_irq(dev->priv.eq_table.cmd_eq.irqn); + spin_lock_irqsave(&dev->cmd.alloc_lock, flags); + vector = ~dev->cmd.bitmask & ((1ul << (1 << dev->cmd.log_sz)) - 1); + spin_unlock_irqrestore(&dev->cmd.alloc_lock, flags); + + if (!vector) + return; + + for (i = 0; i < (1 << dev->cmd.log_sz); i++) { + struct mlx5_cmd_work_ent *ent = dev->cmd.ent_arr[i]; + + if (!test_bit(i, &vector)) + continue; + + while (ent->busy) + usleep_range(1000, 1100); + free_ent(&dev->cmd, i); + complete_command(ent); + } +} +EXPORT_SYMBOL(mlx5_trigger_cmd_completions); + static int status_to_err(u8 status) { return status ? -1 : 0; /* TBD more meaningful codes */ @@ -1234,8 +1452,10 @@ static int is_manage_pages(struct mlx5_inbox_hdr *in) return be16_to_cpu(in->opcode) == MLX5_CMD_OP_MANAGE_PAGES; } -static int cmd_exec_helper(struct mlx5_core_dev *dev, void *in, int in_size, void *out, - int out_size, mlx5_cmd_cbk_t callback, void *context) +static int cmd_exec_helper(struct mlx5_core_dev *dev, + void *in, int in_size, + void *out, int out_size, + mlx5_cmd_cbk_t callback, void *context) { struct mlx5_cmd_msg *inb; struct mlx5_cmd_msg *outb; @@ -1603,3 +1823,4 @@ int mlx5_cmd_status_to_err_v2(void *ptr) return cmd_status_to_err_helper(status); } + Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Mon Aug 7 12:42:28 2017 (r322147) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Mon Aug 7 12:44:18 2017 (r322148) @@ -122,6 +122,9 @@ static void poll_health(unsigned long data) int next; u32 count; + if (dev->state != MLX5_DEVICE_STATE_UP) + return; + count = ioread32be(health->health_counter); if (count == health->prev) ++health->miss_counter; Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:42:28 2017 (r322147) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:44:18 2017 (r322148) @@ -1140,3 +1140,13 @@ static void __exit cleanup(void) module_init(init); module_exit(cleanup); + +void mlx5_enter_error_state(struct mlx5_core_dev *dev) +{ + if (dev->state != MLX5_DEVICE_STATE_UP) + return; + + dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; + mlx5_trigger_cmd_completions(dev); +} +EXPORT_SYMBOL(mlx5_enter_error_state); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:42:28 2017 (r322147) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:44:18 2017 (r322148) @@ -475,14 +475,21 @@ int mlx5_reclaim_startup_pages(struct mlx5_core_dev *d p = rb_first(&dev->priv.page_root); if (p) { fwp = rb_entry(p, struct mlx5_fw_page, rb_node); - err = reclaim_pages(dev, fwp->func_id, - optimal_reclaimed_pages(), - &nclaimed); - if (err) { - mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", - err); - return err; + if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { + --dev->priv.fw_pages; + free_4k(dev, fwp->addr); + nclaimed = 1; + } else { + err = reclaim_pages(dev, fwp->func_id, + optimal_reclaimed_pages(), + &nclaimed); + if (err) { + mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", + err); + return err; + } } + if (nclaimed) end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); } From owner-svn-src-stable@freebsd.org Mon Aug 7 12:45:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C53F7DD1142; Mon, 7 Aug 2017 12:45:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8E032697BA; Mon, 7 Aug 2017 12:45:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CjRJC090462; Mon, 7 Aug 2017 12:45:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CjRk3090457; Mon, 7 Aug 2017 12:45:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071245.v77CjRk3090457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322149 - in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:45:28 -0000 Author: hselasky Date: Mon Aug 7 12:45:26 2017 New Revision: 322149 URL: https://svnweb.freebsd.org/changeset/base/322149 Log: MFC r312881: Add support for device surprise removal and other PCI errors. - When device disappears from PCI indicate error device state and: 1) Trigger command completion for all pending commands 2) Prevent new commands from executing and return: - success for modify and remove/cleanup commands - failure for create/query commands 3) When reclaiming pages for a device in error state don't ask FW to return all given pages, just release the allocated memory Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:44:18 2017 (r322148) +++ stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:45:26 2017 (r322149) @@ -713,6 +713,7 @@ struct mlx5_cmd_work_ent { u64 ts1; u64 ts2; u16 op; + u8 busy; }; struct mlx5_pas { @@ -791,6 +792,7 @@ static inline void *mlx5_vmalloc(unsigned long size) return rtn; } +void mlx5_enter_error_state(struct mlx5_core_dev *dev); int mlx5_cmd_init(struct mlx5_core_dev *dev); void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); void mlx5_cmd_use_events(struct mlx5_core_dev *dev); @@ -862,6 +864,7 @@ void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); +void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:44:18 2017 (r322148) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:45:26 2017 (r322149) @@ -119,6 +119,8 @@ static int alloc_ent(struct mlx5_cmd_work_ent *ent) { unsigned long flags; struct mlx5_cmd *cmd = ent->cmd; + struct mlx5_core_dev *dev = + container_of(cmd, struct mlx5_core_dev, cmd); int ret = cmd->max_reg_cmds; spin_lock_irqsave(&cmd->alloc_lock, flags); @@ -128,7 +130,11 @@ static int alloc_ent(struct mlx5_cmd_work_ent *ent) ret = -1; } + if (dev->state != MLX5_DEVICE_STATE_UP) + ret = -1; + if (ret != -1) { + ent->busy = 1; ent->idx = ret; clear_bit(ent->idx, &cmd->bitmask); cmd->ent_arr[ent->idx] = ent; @@ -205,12 +211,16 @@ static void set_signature(struct mlx5_cmd_work_ent *en static void poll_timeout(struct mlx5_cmd_work_ent *ent) { - int poll_end = jiffies + msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000); + struct mlx5_core_dev *dev = container_of(ent->cmd, + struct mlx5_core_dev, cmd); + int poll_end = jiffies + + msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000); u8 own; do { own = ent->lay->status_own; - if (!(own & CMD_OWNER_HW)) { + if (!(own & CMD_OWNER_HW) || + dev->state != MLX5_DEVICE_STATE_UP) { ent->ret = 0; return; } @@ -718,6 +728,173 @@ static void dump_command(struct mlx5_core_dev *dev, pr_debug("\n"); } +static int set_internal_err_outbox(struct mlx5_core_dev *dev, u16 opcode, + struct mlx5_outbox_hdr *hdr) +{ + hdr->status = 0; + hdr->syndrome = 0; + + switch (opcode) { + case MLX5_CMD_OP_TEARDOWN_HCA: + case MLX5_CMD_OP_DISABLE_HCA: + case MLX5_CMD_OP_MANAGE_PAGES: + case MLX5_CMD_OP_DESTROY_MKEY: + case MLX5_CMD_OP_DESTROY_EQ: + case MLX5_CMD_OP_DESTROY_CQ: + case MLX5_CMD_OP_DESTROY_QP: + case MLX5_CMD_OP_DESTROY_PSV: + case MLX5_CMD_OP_DESTROY_SRQ: + case MLX5_CMD_OP_DESTROY_XRC_SRQ: + case MLX5_CMD_OP_DESTROY_DCT: + case MLX5_CMD_OP_DEALLOC_Q_COUNTER: + case MLX5_CMD_OP_DEALLOC_PD: + case MLX5_CMD_OP_DEALLOC_UAR: + case MLX5_CMD_OP_DETACH_FROM_MCG: + case MLX5_CMD_OP_DEALLOC_XRCD: + case MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN: + case MLX5_CMD_OP_DELETE_VXLAN_UDP_DPORT: + case MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY: + case MLX5_CMD_OP_DESTROY_LAG: + case MLX5_CMD_OP_DESTROY_VPORT_LAG: + case MLX5_CMD_OP_DESTROY_TIR: + case MLX5_CMD_OP_DESTROY_SQ: + case MLX5_CMD_OP_DESTROY_RQ: + case MLX5_CMD_OP_DESTROY_RMP: + case MLX5_CMD_OP_DESTROY_TIS: + case MLX5_CMD_OP_DESTROY_RQT: + case MLX5_CMD_OP_DESTROY_FLOW_TABLE: + case MLX5_CMD_OP_DESTROY_FLOW_GROUP: + case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_DEALLOC_FLOW_COUNTER: + case MLX5_CMD_OP_2ERR_QP: + case MLX5_CMD_OP_2RST_QP: + case MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_FLOW_TABLE: + case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_SET_FLOW_TABLE_ROOT: + case MLX5_CMD_OP_DEALLOC_ENCAP_HEADER: + case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT: + case MLX5_CMD_OP_MODIFY_VPORT_STATE: + case MLX5_CMD_OP_MODIFY_SQ: + case MLX5_CMD_OP_MODIFY_RQ: + case MLX5_CMD_OP_MODIFY_TIS: + case MLX5_CMD_OP_MODIFY_LAG: + case MLX5_CMD_OP_MODIFY_TIR: + case MLX5_CMD_OP_MODIFY_RMP: + case MLX5_CMD_OP_MODIFY_RQT: + case MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_MODIFY_CONG_PARAMS: + case MLX5_CMD_OP_MODIFY_CONG_STATUS: + case MLX5_CMD_OP_MODIFY_CQ: + case MLX5_CMD_OP_MODIFY_ESW_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_HCA_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP: + case MLX5_CMD_OP_ACCESS_REG: + case MLX5_CMD_OP_DRAIN_DCT: + return 0; + + case MLX5_CMD_OP_ADD_VXLAN_UDP_DPORT: + case MLX5_CMD_OP_ALLOC_ENCAP_HEADER: + case MLX5_CMD_OP_ALLOC_FLOW_COUNTER: + case MLX5_CMD_OP_ALLOC_PD: + case MLX5_CMD_OP_ALLOC_Q_COUNTER: + case MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN: + case MLX5_CMD_OP_ALLOC_UAR: + case MLX5_CMD_OP_ALLOC_XRCD: + case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: + case MLX5_CMD_OP_ARM_RQ: + case MLX5_CMD_OP_ARM_XRC_SRQ: + case MLX5_CMD_OP_ATTACH_TO_MCG: + case MLX5_CMD_OP_CONFIG_INT_MODERATION: + case MLX5_CMD_OP_CREATE_CQ: + case MLX5_CMD_OP_CREATE_DCT: + case MLX5_CMD_OP_CREATE_EQ: + case MLX5_CMD_OP_CREATE_FLOW_GROUP: + case MLX5_CMD_OP_CREATE_FLOW_TABLE: + case MLX5_CMD_OP_CREATE_LAG: + case MLX5_CMD_OP_CREATE_MKEY: + case MLX5_CMD_OP_CREATE_PSV: + case MLX5_CMD_OP_CREATE_QOS_PARA_VPORT: + case MLX5_CMD_OP_CREATE_QP: + case MLX5_CMD_OP_CREATE_RMP: + case MLX5_CMD_OP_CREATE_RQ: + case MLX5_CMD_OP_CREATE_RQT: + case MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_CREATE_SQ: + case MLX5_CMD_OP_CREATE_SRQ: + case MLX5_CMD_OP_CREATE_TIR: + case MLX5_CMD_OP_CREATE_TIS: + case MLX5_CMD_OP_CREATE_VPORT_LAG: + case MLX5_CMD_OP_CREATE_XRC_SRQ: + case MLX5_CMD_OP_ENABLE_HCA: + case MLX5_CMD_OP_GEN_EQE: + case MLX5_CMD_OP_GET_DROPPED_PACKET_LOG: + case MLX5_CMD_OP_INIT2INIT_QP: + case MLX5_CMD_OP_INIT2RTR_QP: + case MLX5_CMD_OP_INIT_HCA: + case MLX5_CMD_OP_MAD_IFC: + case MLX5_CMD_OP_NOP: + case MLX5_CMD_OP_PAGE_FAULT_RESUME: + case MLX5_CMD_OP_QUERY_ADAPTER: + case MLX5_CMD_OP_QUERY_CONG_PARAMS: + case MLX5_CMD_OP_QUERY_CONG_STATISTICS: + case MLX5_CMD_OP_QUERY_CONG_STATUS: + case MLX5_CMD_OP_QUERY_CQ: + case MLX5_CMD_OP_QUERY_DCT: + case MLX5_CMD_OP_QUERY_EQ: + case MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_FLOW_COUNTER: + case MLX5_CMD_OP_QUERY_FLOW_GROUP: + case MLX5_CMD_OP_QUERY_FLOW_TABLE: + case MLX5_CMD_OP_QUERY_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_QUERY_HCA_CAP: + case MLX5_CMD_OP_QUERY_HCA_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_HCA_VPORT_GID: + case MLX5_CMD_OP_QUERY_HCA_VPORT_PKEY: + case MLX5_CMD_OP_QUERY_ISSI: + case MLX5_CMD_OP_QUERY_L2_TABLE_ENTRY: + case MLX5_CMD_OP_QUERY_LAG: + case MLX5_CMD_OP_QUERY_MAD_DEMUX: + case MLX5_CMD_OP_QUERY_MKEY: + case MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_OTHER_HCA_CAP: + case MLX5_CMD_OP_QUERY_PAGES: + case MLX5_CMD_OP_QUERY_QP: + case MLX5_CMD_OP_QUERY_Q_COUNTER: + case MLX5_CMD_OP_QUERY_RMP: + case MLX5_CMD_OP_QUERY_ROCE_ADDRESS: + case MLX5_CMD_OP_QUERY_RQ: + case MLX5_CMD_OP_QUERY_RQT: + case MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT: + case MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS: + case MLX5_CMD_OP_QUERY_SQ: + case MLX5_CMD_OP_QUERY_SRQ: + case MLX5_CMD_OP_QUERY_TIR: + case MLX5_CMD_OP_QUERY_TIS: + case MLX5_CMD_OP_QUERY_VPORT_COUNTER: + case MLX5_CMD_OP_QUERY_VPORT_STATE: + case MLX5_CMD_OP_QUERY_XRC_SRQ: + case MLX5_CMD_OP_RST2INIT_QP: + case MLX5_CMD_OP_RTR2RTS_QP: + case MLX5_CMD_OP_RTS2RTS_QP: + case MLX5_CMD_OP_SET_DC_CNAK_TRACE: + case MLX5_CMD_OP_SET_HCA_CAP: + case MLX5_CMD_OP_SET_ISSI: + case MLX5_CMD_OP_SET_L2_TABLE_ENTRY: + case MLX5_CMD_OP_SET_MAD_DEMUX: + case MLX5_CMD_OP_SET_ROCE_ADDRESS: + case MLX5_CMD_OP_SQD_RTS_QP: + case MLX5_CMD_OP_SQERR2RTS_QP: + hdr->status = MLX5_CMD_STAT_INT_ERR; + hdr->syndrome = 0xFFFFFFFF; + return -ECANCELED; + default: + mlx5_core_err(dev, "Unknown FW command (%d)\n", opcode); + return -EINVAL; + } +} + static void complete_command(struct mlx5_cmd_work_ent *ent) { struct mlx5_cmd *cmd = ent->cmd; @@ -737,6 +914,18 @@ static void complete_command(struct mlx5_cmd_work_ent else sem = &cmd->sem; + if (dev->state != MLX5_DEVICE_STATE_UP) { + struct mlx5_outbox_hdr *out_hdr = + (struct mlx5_outbox_hdr *)ent->out; + struct mlx5_inbox_hdr *in_hdr = + (struct mlx5_inbox_hdr *)(ent->in->first.data); + u16 opcode = be16_to_cpu(in_hdr->opcode); + + ent->ret = set_internal_err_outbox(dev, + opcode, + out_hdr); + } + if (ent->callback) { ds = ent->ts2 - ent->ts1; if (ent->op < ARRAY_SIZE(cmd->stats)) { @@ -805,7 +994,7 @@ static void cmd_work_handler(struct work_struct *work) set_signature(ent, !cmd->checksum_disabled); dump_command(dev, ent, 1); ent->ts1 = ktime_get_ns(); - + ent->busy = 0; /* ring doorbell after the descriptor is valid */ mlx5_core_dbg(dev, "writing 0x%x to command doorbell\n", 1 << ent->idx); wmb(); @@ -872,6 +1061,7 @@ static int wait_func(struct mlx5_core_dev *dev, struct else err = 0; } + if (err == -ETIMEDOUT) { mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n", mlx5_command_str(msg_to_opcode(ent->in)), @@ -1180,6 +1370,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, else ent->ret = 0; ent->status = ent->lay->status_own >> 1; + mlx5_core_dbg(dev, "FW command ret 0x%x, status %s(0x%x)\n", ent->ret, @@ -1192,6 +1383,33 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, } EXPORT_SYMBOL(mlx5_cmd_comp_handler); +void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev) +{ + unsigned long vector; + int i = 0; + unsigned long flags; + synchronize_irq(dev->priv.eq_table.cmd_eq.irqn); + spin_lock_irqsave(&dev->cmd.alloc_lock, flags); + vector = ~dev->cmd.bitmask & ((1ul << (1 << dev->cmd.log_sz)) - 1); + spin_unlock_irqrestore(&dev->cmd.alloc_lock, flags); + + if (!vector) + return; + + for (i = 0; i < (1 << dev->cmd.log_sz); i++) { + struct mlx5_cmd_work_ent *ent = dev->cmd.ent_arr[i]; + + if (!test_bit(i, &vector)) + continue; + + while (ent->busy) + usleep_range(1000, 1100); + free_ent(&dev->cmd, i); + complete_command(ent); + } +} +EXPORT_SYMBOL(mlx5_trigger_cmd_completions); + static int status_to_err(u8 status) { return status ? -1 : 0; /* TBD more meaningful codes */ @@ -1234,8 +1452,10 @@ static int is_manage_pages(struct mlx5_inbox_hdr *in) return be16_to_cpu(in->opcode) == MLX5_CMD_OP_MANAGE_PAGES; } -static int cmd_exec_helper(struct mlx5_core_dev *dev, void *in, int in_size, void *out, - int out_size, mlx5_cmd_cbk_t callback, void *context) +static int cmd_exec_helper(struct mlx5_core_dev *dev, + void *in, int in_size, + void *out, int out_size, + mlx5_cmd_cbk_t callback, void *context) { struct mlx5_cmd_msg *inb; struct mlx5_cmd_msg *outb; @@ -1603,3 +1823,4 @@ int mlx5_cmd_status_to_err_v2(void *ptr) return cmd_status_to_err_helper(status); } + Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c Mon Aug 7 12:44:18 2017 (r322148) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c Mon Aug 7 12:45:26 2017 (r322149) @@ -122,6 +122,9 @@ static void poll_health(unsigned long data) int next; u32 count; + if (dev->state != MLX5_DEVICE_STATE_UP) + return; + count = ioread32be(health->health_counter); if (count == health->prev) ++health->miss_counter; Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:44:18 2017 (r322148) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Aug 7 12:45:26 2017 (r322149) @@ -1138,3 +1138,13 @@ static void __exit cleanup(void) module_init(init); module_exit(cleanup); + +void mlx5_enter_error_state(struct mlx5_core_dev *dev) +{ + if (dev->state != MLX5_DEVICE_STATE_UP) + return; + + dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; + mlx5_trigger_cmd_completions(dev); +} +EXPORT_SYMBOL(mlx5_enter_error_state); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:44:18 2017 (r322148) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:45:26 2017 (r322149) @@ -475,14 +475,21 @@ int mlx5_reclaim_startup_pages(struct mlx5_core_dev *d p = rb_first(&dev->priv.page_root); if (p) { fwp = rb_entry(p, struct mlx5_fw_page, rb_node); - err = reclaim_pages(dev, fwp->func_id, - optimal_reclaimed_pages(), - &nclaimed); - if (err) { - mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", - err); - return err; + if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { + --dev->priv.fw_pages; + free_4k(dev, fwp->addr); + nclaimed = 1; + } else { + err = reclaim_pages(dev, fwp->func_id, + optimal_reclaimed_pages(), + &nclaimed); + if (err) { + mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", + err); + return err; + } } + if (nclaimed) end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); } From owner-svn-src-stable@freebsd.org Mon Aug 7 12:48:15 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CC0DDD136A; Mon, 7 Aug 2017 12:48:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 C0A3A699BC; Mon, 7 Aug 2017 12:48:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CmD7d090611; Mon, 7 Aug 2017 12:48:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CmDvi090606; Mon, 7 Aug 2017 12:48:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071248.v77CmDvi090606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322150 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:48:15 -0000 Author: hselasky Date: Mon Aug 7 12:48:13 2017 New Revision: 322150 URL: https://svnweb.freebsd.org/changeset/base/322150 Log: MFC r312882, r321983 and r321984: Use the busdma API to allocate all DMA-able memory. The MLX5 driver has four different types of DMA allocations which are now allocated using busdma: 1) The 4K firmware DMA-able blocks. One busdma object per 4K allocation. 2) Data for firmware commands use the 4K firmware blocks split into four 1K blocks. 3) The 4K firmware blocks are also used for doorbell pages. 4) The RQ-, SQ- and CQ- DMA rings. One busdma object per allocation. After this patch the mlx5en driver can be used with DMAR enabled in the FreeBSD kernel. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_alloc.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Mon Aug 7 12:45:26 2017 (r322149) +++ stable/11/sys/dev/mlx5/device.h Mon Aug 7 12:48:13 2017 (r322150) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -103,6 +103,7 @@ __mlx5_mask(typ, fld)) enum { MLX5_MAX_COMMANDS = 32, MLX5_CMD_DATA_BLOCK_SIZE = 512, + MLX5_CMD_MBOX_SIZE = 1024, MLX5_PCI_CMD_XPORT = 7, MLX5_MKEY_BSF_OCTO_SIZE = 4, MLX5_MAX_PSVS = 4, @@ -522,6 +523,11 @@ struct mlx5_cmd_prot_block { u8 ctrl_sig; u8 sig; }; + +#define MLX5_NUM_CMDS_IN_ADAPTER_PAGE \ + (MLX5_ADAPTER_PAGE_SIZE / MLX5_CMD_MBOX_SIZE) +CTASSERT(MLX5_CMD_MBOX_SIZE >= sizeof(struct mlx5_cmd_prot_block)); +CTASSERT(MLX5_CMD_MBOX_SIZE <= MLX5_ADAPTER_PAGE_SIZE); enum { MLX5_CQE_SYND_FLUSHED_IN_ERROR = 5, Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:45:26 2017 (r322149) +++ stable/11/sys/dev/mlx5/driver.h Mon Aug 7 12:48:13 2017 (r322150) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -258,13 +258,26 @@ struct mlx5_cmd_first { __be32 data[4]; }; -struct mlx5_cmd_msg { - struct list_head list; - struct cache_ent *cache; - u32 len; - struct mlx5_cmd_first first; - struct mlx5_cmd_mailbox *next; +struct cache_ent; +struct mlx5_fw_page { + union { + struct rb_node rb_node; + struct list_head list; + }; + struct mlx5_cmd_first first; + struct mlx5_core_dev *dev; + bus_dmamap_t dma_map; + bus_addr_t dma_addr; + void *virt_addr; + struct cache_ent *cache; + u32 numpages; + u16 load_done; +#define MLX5_LOAD_ST_NONE 0 +#define MLX5_LOAD_ST_SUCCESS 1 +#define MLX5_LOAD_ST_FAILURE 2 + u16 func_id; }; +#define mlx5_cmd_msg mlx5_fw_page struct mlx5_cmd_debug { struct dentry *dbg_root; @@ -304,9 +317,16 @@ struct mlx5_cmd_stats { }; struct mlx5_cmd { - void *cmd_alloc_buf; - dma_addr_t alloc_dma; - int alloc_size; + struct mlx5_fw_page *cmd_page; + bus_dma_tag_t dma_tag; + struct sx dma_sx; + struct mtx dma_mtx; +#define MLX5_DMA_OWNED(dev) mtx_owned(&(dev)->cmd.dma_mtx) +#define MLX5_DMA_LOCK(dev) mtx_lock(&(dev)->cmd.dma_mtx) +#define MLX5_DMA_UNLOCK(dev) mtx_unlock(&(dev)->cmd.dma_mtx) + struct cv dma_cv; +#define MLX5_DMA_DONE(dev) cv_broadcast(&(dev)->cmd.dma_cv) +#define MLX5_DMA_WAIT(dev) cv_wait(&(dev)->cmd.dma_cv, &(dev)->cmd.dma_mtx) void *cmd_buf; dma_addr_t dma; u16 cmdif_rev; @@ -331,7 +351,6 @@ struct mlx5_cmd { struct semaphore pages_sem; int mode; struct mlx5_cmd_work_ent *ent_arr[MLX5_MAX_COMMANDS]; - struct pci_pool *pool; struct mlx5_cmd_debug dbg; struct cmd_msg_cache cache; int checksum_disabled; @@ -345,24 +364,18 @@ struct mlx5_port_caps { u8 ext_port_cap; }; -struct mlx5_cmd_mailbox { - void *buf; - dma_addr_t dma; - struct mlx5_cmd_mailbox *next; -}; - -struct mlx5_buf_list { - void *buf; - dma_addr_t map; -}; - struct mlx5_buf { - struct mlx5_buf_list direct; - struct mlx5_buf_list *page_list; - int nbufs; + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; + struct mlx5_core_dev *dev; + struct { + void *buf; + } direct; + u64 *page_list; int npages; int size; u8 page_shift; + u8 load_done; }; struct mlx5_eq { @@ -521,7 +534,6 @@ struct mlx5_priv { struct rb_root page_root; s64 fw_pages; atomic_t reg_pages; - struct list_head free_list; s64 pages_per_func[MLX5_MAX_NUMBER_OF_VFS]; struct mlx5_core_health health; @@ -664,7 +676,7 @@ struct mlx5_vport_counters { }; enum { - MLX5_DB_PER_PAGE = PAGE_SIZE / L1_CACHE_BYTES, + MLX5_DB_PER_PAGE = MLX5_ADAPTER_PAGE_SIZE / L1_CACHE_BYTES, }; struct mlx5_core_dct { @@ -688,6 +700,7 @@ enum { struct mlx5_db_pgdir { struct list_head list; DECLARE_BITMAP(bitmap, MLX5_DB_PER_PAGE); + struct mlx5_fw_page *fw_page; __be32 *db_page; dma_addr_t db_dma; }; @@ -697,6 +710,7 @@ typedef void (*mlx5_cmd_cbk_t)(int status, void *conte struct mlx5_cmd_work_ent { struct mlx5_cmd_msg *in; struct mlx5_cmd_msg *out; + int uin_size; void *uout; int uout_size; mlx5_cmd_cbk_t callback; @@ -721,13 +735,10 @@ struct mlx5_pas { u8 log_sz; }; -static inline void *mlx5_buf_offset(struct mlx5_buf *buf, int offset) +static inline void * +mlx5_buf_offset(struct mlx5_buf *buf, int offset) { - if (likely(BITS_PER_LONG == 64 || buf->nbufs == 1)) - return buf->direct.buf + offset; - else - return buf->page_list[offset >> PAGE_SHIFT].buf + - (offset & (PAGE_SIZE - 1)); + return ((char *)buf->direct.buf + offset); } @@ -816,8 +827,9 @@ void mlx5_health_cleanup(void); void __init mlx5_health_init(void); void mlx5_start_health_poll(struct mlx5_core_dev *dev); void mlx5_stop_health_poll(struct mlx5_core_dev *dev); -int mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size, int max_direct, - struct mlx5_buf *buf, int node); + +#define mlx5_buf_alloc_node(dev, size, direct, buf, node) \ + mlx5_buf_alloc(dev, size, direct, buf) int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, int max_direct, struct mlx5_buf *buf); void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf); @@ -845,6 +857,12 @@ int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, u16 opmod, u8 port); +void mlx5_fwp_flush(struct mlx5_fw_page *fwp); +void mlx5_fwp_invalidate(struct mlx5_fw_page *fwp); +struct mlx5_fw_page *mlx5_fwp_alloc(struct mlx5_core_dev *dev, gfp_t flags, unsigned num); +void mlx5_fwp_free(struct mlx5_fw_page *fwp); +u64 mlx5_fwp_get_dma(struct mlx5_fw_page *fwp, size_t offset); +void *mlx5_fwp_get_virt(struct mlx5_fw_page *fwp, size_t offset); void mlx5_pagealloc_init(struct mlx5_core_dev *dev); void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev); int mlx5_pagealloc_start(struct mlx5_core_dev *dev); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_alloc.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_alloc.c Mon Aug 7 12:45:26 2017 (r322149) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_alloc.c Mon Aug 7 12:48:13 2017 (r322150) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,106 +40,110 @@ * multiple pages, so we don't require too much contiguous memory. */ -static void *mlx5_dma_zalloc_coherent_node(struct mlx5_core_dev *dev, - size_t size, dma_addr_t *dma_handle, - int node) +static void +mlx5_buf_load_mem_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - void *cpu_handle; + struct mlx5_buf *buf; + uint8_t owned; + int x; - cpu_handle = dma_zalloc_coherent(&dev->pdev->dev, size, - dma_handle, GFP_KERNEL); - return cpu_handle; + buf = (struct mlx5_buf *)arg; + owned = MLX5_DMA_OWNED(buf->dev); + + if (!owned) + MLX5_DMA_LOCK(buf->dev); + + if (error == 0) { + for (x = 0; x != nseg; x++) { + buf->page_list[x] = segs[x].ds_addr; + KASSERT(segs[x].ds_len == PAGE_SIZE, ("Invalid segment size")); + } + buf->load_done = MLX5_LOAD_ST_SUCCESS; + } else { + buf->load_done = MLX5_LOAD_ST_FAILURE; + } + MLX5_DMA_DONE(buf->dev); + + if (!owned) + MLX5_DMA_UNLOCK(buf->dev); } -int mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size, int max_direct, - struct mlx5_buf *buf, int node) +int +mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, + int max_direct, struct mlx5_buf *buf) { - dma_addr_t t; + int err; - buf->size = size; - if (size <= max_direct) { - buf->nbufs = 1; - buf->npages = 1; - buf->page_shift = (u8)get_order(size) + PAGE_SHIFT; - buf->direct.buf = mlx5_dma_zalloc_coherent_node(dev, size, - &t, node); - if (!buf->direct.buf) - return -ENOMEM; + buf->npages = howmany(size, PAGE_SIZE); + buf->page_shift = PAGE_SHIFT; + buf->load_done = MLX5_LOAD_ST_NONE; + buf->dev = dev; + buf->page_list = kcalloc(buf->npages, sizeof(*buf->page_list), + GFP_KERNEL); - buf->direct.map = t; + err = -bus_dma_tag_create( + bus_get_dma_tag(dev->pdev->dev.bsddev), + PAGE_SIZE, /* alignment */ + 0, /* no boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + PAGE_SIZE * buf->npages, /* maxsize */ + buf->npages, /* nsegments */ + PAGE_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &buf->dma_tag); - while (t & ((1 << buf->page_shift) - 1)) { - --buf->page_shift; - buf->npages *= 2; - } - } else { - int i; + if (err != 0) + goto err_dma_tag; - buf->direct.buf = NULL; - buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE; - buf->npages = buf->nbufs; - buf->page_shift = PAGE_SHIFT; - buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list), - GFP_KERNEL); + /* allocate memory */ + err = -bus_dmamem_alloc(buf->dma_tag, &buf->direct.buf, + BUS_DMA_WAITOK | BUS_DMA_COHERENT, &buf->dma_map); + if (err != 0) + goto err_dma_alloc; - for (i = 0; i < buf->nbufs; i++) { - buf->page_list[i].buf = - mlx5_dma_zalloc_coherent_node(dev, PAGE_SIZE, - &t, node); + /* load memory into DMA */ + MLX5_DMA_LOCK(dev); + err = bus_dmamap_load( + buf->dma_tag, buf->dma_map, buf->direct.buf, + PAGE_SIZE * buf->npages, &mlx5_buf_load_mem_cb, + buf, BUS_DMA_WAITOK | BUS_DMA_COHERENT); - buf->page_list[i].map = t; - } + while (buf->load_done == MLX5_LOAD_ST_NONE) + MLX5_DMA_WAIT(dev); + MLX5_DMA_UNLOCK(dev); - if (BITS_PER_LONG == 64) { - struct page **pages; - - pages = kmalloc(sizeof(*pages) * (buf->nbufs + 1), - GFP_KERNEL); - for (i = 0; i < buf->nbufs; i++) - pages[i] = virt_to_page(buf->page_list[i].buf); - pages[buf->nbufs] = pages[0]; - buf->direct.buf = vmap(pages, buf->nbufs + 1, VM_MAP, - PAGE_KERNEL); - kfree(pages); - if (!buf->direct.buf) - goto err_free; - } + /* check for error */ + if (buf->load_done != MLX5_LOAD_ST_SUCCESS) { + err = -ENOMEM; + goto err_dma_load; } - return 0; + /* clean memory */ + memset(buf->direct.buf, 0, PAGE_SIZE * buf->npages); -err_free: - mlx5_buf_free(dev, buf); + /* flush memory to RAM */ + bus_dmamap_sync(buf->dev->cmd.dma_tag, buf->dma_map, BUS_DMASYNC_PREWRITE); + return (0); - return -ENOMEM; +err_dma_load: + bus_dmamem_free(buf->dma_tag, buf->direct.buf, buf->dma_map); +err_dma_alloc: + bus_dma_tag_destroy(buf->dma_tag); +err_dma_tag: + kfree(buf->page_list); + return (err); } -int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, int max_direct, - struct mlx5_buf *buf) -{ - return mlx5_buf_alloc_node(dev, size, max_direct, - buf, dev->priv.numa_node); -} -EXPORT_SYMBOL_GPL(mlx5_buf_alloc); - - void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf) { - if (buf->nbufs == 1) - dma_free_coherent(&dev->pdev->dev, buf->size, buf->direct.buf, - buf->direct.map); - else { - int i; - if (BITS_PER_LONG == 64 && buf->direct.buf) - vunmap(buf->direct.buf); - for (i = 0; i < buf->nbufs; i++) - if (buf->page_list[i].buf) - dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, - buf->page_list[i].buf, - buf->page_list[i].map); - kfree(buf->page_list); - } + bus_dmamap_unload(buf->dma_tag, buf->dma_map); + bus_dmamem_free(buf->dma_tag, buf->direct.buf, buf->dma_map); + bus_dma_tag_destroy(buf->dma_tag); + kfree(buf->page_list); } EXPORT_SYMBOL_GPL(mlx5_buf_free); @@ -152,8 +156,17 @@ static struct mlx5_db_pgdir *mlx5_alloc_db_pgdir(struc bitmap_fill(pgdir->bitmap, MLX5_DB_PER_PAGE); - pgdir->db_page = mlx5_dma_zalloc_coherent_node(dev, PAGE_SIZE, - &pgdir->db_dma, node); + pgdir->fw_page = mlx5_fwp_alloc(dev, GFP_KERNEL, 1); + if (pgdir->fw_page != NULL) { + pgdir->db_page = pgdir->fw_page->virt_addr; + pgdir->db_dma = pgdir->fw_page->dma_addr; + + /* clean allocated memory */ + memset(pgdir->db_page, 0, MLX5_ADAPTER_PAGE_SIZE); + + /* flush memory to RAM */ + mlx5_fwp_flush(pgdir->fw_page); + } if (!pgdir->db_page) { kfree(pgdir); return NULL; @@ -228,8 +241,7 @@ void mlx5_db_free(struct mlx5_core_dev *dev, struct ml __set_bit(db->index, db->u.pgdir->bitmap); if (bitmap_full(db->u.pgdir->bitmap, MLX5_DB_PER_PAGE)) { - dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, - db->u.pgdir->db_page, db->u.pgdir->db_dma); + mlx5_fwp_free(db->u.pgdir->fw_page); list_del(&db->u.pgdir->list); kfree(db->u.pgdir); } @@ -238,19 +250,12 @@ void mlx5_db_free(struct mlx5_core_dev *dev, struct ml } EXPORT_SYMBOL_GPL(mlx5_db_free); - -void mlx5_fill_page_array(struct mlx5_buf *buf, __be64 *pas) +void +mlx5_fill_page_array(struct mlx5_buf *buf, __be64 *pas) { - u64 addr; int i; - for (i = 0; i < buf->npages; i++) { - if (buf->nbufs == 1) - addr = buf->direct.map + ((u64)i << buf->page_shift); - else - addr = buf->page_list[i].map; - - pas[i] = cpu_to_be64(addr); - } + for (i = 0; i != buf->npages; i++) + pas[i] = cpu_to_be64(buf->page_list[i]); } EXPORT_SYMBOL_GPL(mlx5_fill_page_array); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:45:26 2017 (r322149) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:48:13 2017 (r322150) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,6 +77,7 @@ enum { static struct mlx5_cmd_work_ent *alloc_cmd(struct mlx5_cmd *cmd, struct mlx5_cmd_msg *in, + int uin_size, struct mlx5_cmd_msg *out, void *uout, int uout_size, mlx5_cmd_cbk_t cbk, @@ -90,6 +91,7 @@ static struct mlx5_cmd_work_ent *alloc_cmd(struct mlx5 return ERR_PTR(-ENOMEM); ent->in = in; + ent->uin_size = uin_size; ent->out = out; ent->uout = uout; ent->uout_size = uout_size; @@ -192,14 +194,26 @@ static void calc_block_sig(struct mlx5_cmd_prot_block } } -static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum) +static void +calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum) { - struct mlx5_cmd_mailbox *next = msg->next; + size_t i; - while (next) { - calc_block_sig(next->buf, token, csum); - next = next->next; + for (i = 0; i != (msg->numpages * MLX5_NUM_CMDS_IN_ADAPTER_PAGE); i++) { + struct mlx5_cmd_prot_block *block; + + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); + + /* compute signature */ + calc_block_sig(block, token, csum); + + /* check for last block */ + if (block->next == 0) + break; } + + /* make sure data gets written to RAM */ + mlx5_fwp_flush(msg); } static void set_signature(struct mlx5_cmd_work_ent *ent, int csum) @@ -235,10 +249,11 @@ static void free_cmd(struct mlx5_cmd_work_ent *ent) kfree(ent); } - -static int verify_signature(struct mlx5_cmd_work_ent *ent) +static int +verify_signature(struct mlx5_cmd_work_ent *ent) { - struct mlx5_cmd_mailbox *next = ent->out->next; + struct mlx5_cmd_msg *msg = ent->out; + size_t i; int err; u8 sig; @@ -246,15 +261,21 @@ static int verify_signature(struct mlx5_cmd_work_ent * if (sig != 0xff) return -EINVAL; - while (next) { - err = verify_block_sig(next->buf); - if (err) - return err; + for (i = 0; i != (msg->numpages * MLX5_NUM_CMDS_IN_ADAPTER_PAGE); i++) { + struct mlx5_cmd_prot_block *block; - next = next->next; - } + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); - return 0; + /* compute signature */ + err = verify_block_sig(block); + if (err != 0) + return (err); + + /* check for last block */ + if (block->next == 0) + break; + } + return (0); } static void dump_buf(void *buf, int size, int data_only, int offset) @@ -681,9 +702,10 @@ static void dump_command(struct mlx5_core_dev *dev, { u16 op = be16_to_cpu(((struct mlx5_inbox_hdr *)(ent->lay->in))->opcode); struct mlx5_cmd_msg *msg = input ? ent->in : ent->out; - struct mlx5_cmd_mailbox *next = msg->next; + size_t i; int data_only; - u32 offset = 0; + int offset = 0; + int msg_len = input ? ent->uin_size : ent->uout_size; int dump_len; data_only = !!(mlx5_core_debug_mask & (1 << MLX5_CMD_DATA)); @@ -711,17 +733,28 @@ static void dump_command(struct mlx5_core_dev *dev, offset += sizeof(*ent->lay); } - while (next && offset < msg->len) { + for (i = 0; i != (msg->numpages * MLX5_NUM_CMDS_IN_ADAPTER_PAGE); i++) { + struct mlx5_cmd_prot_block *block; + + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); + if (data_only) { - dump_len = min_t(int, MLX5_CMD_DATA_BLOCK_SIZE, msg->len - offset); - dump_buf(next->buf, dump_len, 1, offset); + if (offset >= msg_len) + break; + dump_len = min_t(int, + MLX5_CMD_DATA_BLOCK_SIZE, msg_len - offset); + + dump_buf(block->data, dump_len, 1, offset); offset += MLX5_CMD_DATA_BLOCK_SIZE; } else { mlx5_core_dbg(dev, "command block:\n"); - dump_buf(next->buf, sizeof(struct mlx5_cmd_prot_block), 0, offset); - offset += sizeof(struct mlx5_cmd_prot_block); + dump_buf(block, sizeof(*block), 0, offset); + offset += sizeof(*block); } - next = next->next; + + /* check for last block */ + if (block->next == 0) + break; } if (data_only) @@ -982,12 +1015,12 @@ static void cmd_work_handler(struct work_struct *work) memset(lay, 0, sizeof(*lay)); memcpy(lay->in, ent->in->first.data, sizeof(lay->in)); ent->op = be32_to_cpu(lay->in[0]) >> 16; - if (ent->in->next) - lay->in_ptr = cpu_to_be64(ent->in->next->dma); - lay->inlen = cpu_to_be32(ent->in->len); - if (ent->out->next) - lay->out_ptr = cpu_to_be64(ent->out->next->dma); - lay->outlen = cpu_to_be32(ent->out->len); + if (ent->in->numpages != 0) + lay->in_ptr = cpu_to_be64(mlx5_fwp_get_dma(ent->in, 0)); + if (ent->out->numpages != 0) + lay->out_ptr = cpu_to_be64(mlx5_fwp_get_dma(ent->out, 0)); + lay->inlen = cpu_to_be32(ent->uin_size); + lay->outlen = cpu_to_be32(ent->uout_size); lay->type = MLX5_PCI_CMD_XPORT; lay->token = ent->token; lay->status_own = CMD_OWNER_HW; @@ -997,14 +1030,14 @@ static void cmd_work_handler(struct work_struct *work) ent->busy = 0; /* ring doorbell after the descriptor is valid */ mlx5_core_dbg(dev, "writing 0x%x to command doorbell\n", 1 << ent->idx); - wmb(); + /* make sure data is written to RAM */ + mlx5_fwp_flush(cmd->cmd_page); iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell); mmiowb(); /* if not in polling don't use ent after this point*/ if (cmd->mode == CMD_MODE_POLLING) { poll_timeout(ent); /* make sure we read the descriptor after ownership is SW */ - rmb(); mlx5_cmd_comp_handler(dev, 1U << ent->idx); } } @@ -1078,6 +1111,7 @@ static int wait_func(struct mlx5_core_dev *dev, struct * 2. page queue commands do not support asynchrous completion */ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in, + int uin_size, struct mlx5_cmd_msg *out, void *uout, int uout_size, mlx5_cmd_cbk_t callback, void *context, int page_queue, u8 *status) @@ -1092,8 +1126,8 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, if (callback && page_queue) return -EINVAL; - ent = alloc_cmd(cmd, in, out, uout, uout_size, callback, context, - page_queue); + ent = alloc_cmd(cmd, in, uin_size, out, uout, uout_size, callback, + context, page_queue); if (IS_ERR(ent)) return PTR_ERR(ent); @@ -1138,159 +1172,98 @@ out: return err; } -static int mlx5_copy_to_msg(struct mlx5_cmd_msg *to, void *from, int size) +static int mlx5_copy_to_msg(struct mlx5_cmd_msg *to, void *from, size_t size) { - struct mlx5_cmd_prot_block *block; - struct mlx5_cmd_mailbox *next; - int copy; + size_t delta; + size_t i; - if (!to || !from) - return -ENOMEM; + if (to == NULL || from == NULL) + return (-ENOMEM); - copy = min_t(int, size, sizeof(to->first.data)); - memcpy(to->first.data, from, copy); - size -= copy; - from += copy; + delta = min_t(size_t, size, sizeof(to->first.data)); + memcpy(to->first.data, from, delta); + from = (char *)from + delta; + size -= delta; - next = to->next; - while (size) { - if (!next) { - /* this is a BUG */ - return -ENOMEM; - } + for (i = 0; size != 0; i++) { + struct mlx5_cmd_prot_block *block; - copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); - block = next->buf; - memcpy(block->data, from, copy); - from += copy; - size -= copy; - next = next->next; - } + block = mlx5_fwp_get_virt(to, i * MLX5_CMD_MBOX_SIZE); - return 0; + delta = min_t(size_t, size, MLX5_CMD_DATA_BLOCK_SIZE); + memcpy(block->data, from, delta); + from = (char *)from + delta; + size -= delta; + } + return (0); } static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size) { - struct mlx5_cmd_prot_block *block; - struct mlx5_cmd_mailbox *next; - int copy; + size_t delta; + size_t i; - if (!to || !from) - return -ENOMEM; + if (to == NULL || from == NULL) + return (-ENOMEM); - copy = min_t(int, size, sizeof(from->first.data)); - memcpy(to, from->first.data, copy); - size -= copy; - to += copy; + delta = min_t(size_t, size, sizeof(from->first.data)); + memcpy(to, from->first.data, delta); + to = (char *)to + delta; + size -= delta; - next = from->next; - while (size) { - if (!next) { - /* this is a BUG */ - return -ENOMEM; - } + for (i = 0; size != 0; i++) { + struct mlx5_cmd_prot_block *block; - copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); - block = next->buf; + block = mlx5_fwp_get_virt(from, i * MLX5_CMD_MBOX_SIZE); - memcpy(to, block->data, copy); - to += copy; - size -= copy; - next = next->next; + delta = min_t(size_t, size, MLX5_CMD_DATA_BLOCK_SIZE); + memcpy(to, block->data, delta); + to = (char *)to + delta; + size -= delta; } - - return 0; + return (0); } -static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev, - gfp_t flags) +static struct mlx5_cmd_msg * +mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, gfp_t flags, size_t size) { - struct mlx5_cmd_mailbox *mailbox; + struct mlx5_cmd_msg *msg; + size_t blen; + size_t n; + size_t i; - mailbox = kmalloc(sizeof(*mailbox), flags); - if (!mailbox) - return ERR_PTR(-ENOMEM); + blen = size - min_t(size_t, sizeof(msg->first.data), size); + n = howmany(blen, MLX5_CMD_DATA_BLOCK_SIZE); - mailbox->buf = pci_pool_alloc(dev->cmd.pool, flags, - &mailbox->dma); - if (!mailbox->buf) { - mlx5_core_dbg(dev, "failed allocation\n"); - kfree(mailbox); - return ERR_PTR(-ENOMEM); - } - memset(mailbox->buf, 0, sizeof(struct mlx5_cmd_prot_block)); - mailbox->next = NULL; + msg = mlx5_fwp_alloc(dev, flags, howmany(n, MLX5_NUM_CMDS_IN_ADAPTER_PAGE)); + if (msg == NULL) + return (ERR_PTR(-ENOMEM)); - return mailbox; -} + for (i = 0; i != n; i++) { + struct mlx5_cmd_prot_block *block; -static void free_cmd_box(struct mlx5_core_dev *dev, - struct mlx5_cmd_mailbox *mailbox) -{ - pci_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma); - kfree(mailbox); -} + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); -static struct mlx5_cmd_msg *mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, - gfp_t flags, int size) -{ - struct mlx5_cmd_mailbox *tmp, *head = NULL; - struct mlx5_cmd_prot_block *block; - struct mlx5_cmd_msg *msg; - int blen; - int err; - int n; - int i; + memset(block, 0, MLX5_CMD_MBOX_SIZE); - msg = kzalloc(sizeof(*msg), flags); - if (!msg) - return ERR_PTR(-ENOMEM); - - blen = size - min_t(int, sizeof(msg->first.data), size); - n = (blen + MLX5_CMD_DATA_BLOCK_SIZE - 1) / MLX5_CMD_DATA_BLOCK_SIZE; - - for (i = 0; i < n; i++) { - tmp = alloc_cmd_box(dev, flags); - if (IS_ERR(tmp)) { - mlx5_core_warn(dev, "failed allocating block\n"); - err = PTR_ERR(tmp); - goto err_alloc; + if (i != (n - 1)) { + u64 dma = mlx5_fwp_get_dma(msg, (i + 1) * MLX5_CMD_MBOX_SIZE); + block->next = cpu_to_be64(dma); } - - block = tmp->buf; - tmp->next = head; - block->next = cpu_to_be64(tmp->next ? tmp->next->dma : 0); - block->block_num = cpu_to_be32(n - i - 1); - head = tmp; + block->block_num = cpu_to_be32(i); } - msg->next = head; - msg->len = size; - return msg; -err_alloc: - while (head) { - tmp = head->next; - free_cmd_box(dev, head); - head = tmp; - } - kfree(msg); + /* make sure initial data is written to RAM */ + mlx5_fwp_flush(msg); - return ERR_PTR(err); + return (msg); } -static void mlx5_free_cmd_msg(struct mlx5_core_dev *dev, - struct mlx5_cmd_msg *msg) +static void +mlx5_free_cmd_msg(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *msg) { - struct mlx5_cmd_mailbox *head = msg->next; - struct mlx5_cmd_mailbox *next; - while (head) { - next = head->next; - free_cmd_box(dev, head); - head = next; - } - kfree(msg); + mlx5_fwp_free(msg); } static void set_wqname(struct mlx5_core_dev *dev) @@ -1356,6 +1329,9 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent; int i; + /* make sure data gets read from RAM */ + mlx5_fwp_invalidate(cmd->cmd_page); + while (vector != 0) { i = ffs(vector) - 1; vector &= ~(1U << i); @@ -1363,6 +1339,8 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, ent->ts2 = ktime_get_ns(); memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); + /* make sure data gets read from RAM */ + mlx5_fwp_invalidate(ent->out); dump_command(dev, ent, 0); if (!ent->ret) { if (!cmd->checksum_disabled) @@ -1432,10 +1410,6 @@ static struct mlx5_cmd_msg *alloc_msg(struct mlx5_core if (!list_empty(&ent->head)) { msg = list_entry(ent->head.next, struct mlx5_cmd_msg, list); - /* For cached lists, we must explicitly state what is - * the real size - */ - msg->len = in_size; list_del(&msg->list); } spin_unlock_irq(&ent->lock); @@ -1460,12 +1434,11 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *inb; struct mlx5_cmd_msg *outb; int pages_queue; - gfp_t gfp; + const gfp_t gfp = GFP_KERNEL; int err; u8 status = 0; pages_queue = is_manage_pages(in); - gfp = callback ? GFP_ATOMIC : GFP_KERNEL; inb = alloc_msg(dev, in_size, gfp); if (IS_ERR(inb)) { @@ -1485,8 +1458,8 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, goto out_in; } - err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context, - pages_queue, &status); + err = mlx5_cmd_invoke(dev, inb, in_size, outb, out, out_size, callback, + context, pages_queue, &status); if (err) { if (err == -ETIMEDOUT) return err; @@ -1583,44 +1556,67 @@ ex_err: return err; } -static int alloc_cmd_page(struct mlx5_core_dev *dev, struct mlx5_cmd *cmd) +static int +alloc_cmd_page(struct mlx5_core_dev *dev, struct mlx5_cmd *cmd) { - struct device *ddev = &dev->pdev->dev; - cmd->cmd_alloc_buf = dma_zalloc_coherent(ddev, MLX5_ADAPTER_PAGE_SIZE, - &cmd->alloc_dma, GFP_KERNEL); - if (!cmd->cmd_alloc_buf) - return -ENOMEM; + int err; - /* make sure it is aligned to 4K */ - if (!((uintptr_t)cmd->cmd_alloc_buf & (MLX5_ADAPTER_PAGE_SIZE - 1))) { - cmd->cmd_buf = cmd->cmd_alloc_buf; - cmd->dma = cmd->alloc_dma; - cmd->alloc_size = MLX5_ADAPTER_PAGE_SIZE; - return 0; + sx_init(&cmd->dma_sx, "MLX5-DMA-SX"); + mtx_init(&cmd->dma_mtx, "MLX5-DMA-MTX", NULL, MTX_DEF); + cv_init(&cmd->dma_cv, "MLX5-DMA-CV"); + + /* + * Create global DMA descriptor tag for allocating + * 4K firmware pages: + */ + err = -bus_dma_tag_create( + bus_get_dma_tag(dev->pdev->dev.bsddev), + MLX5_ADAPTER_PAGE_SIZE, /* alignment */ + 0, /* no boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MLX5_ADAPTER_PAGE_SIZE, /* maxsize */ + 1, /* nsegments */ + MLX5_ADAPTER_PAGE_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &cmd->dma_tag); + if (err != 0) + goto failure_destroy_sx; + + cmd->cmd_page = mlx5_fwp_alloc(dev, GFP_KERNEL, 1); + if (cmd->cmd_page == NULL) { + err = -ENOMEM; + goto failure_alloc_page; } + cmd->dma = mlx5_fwp_get_dma(cmd->cmd_page, 0); + cmd->cmd_buf = mlx5_fwp_get_virt(cmd->cmd_page, 0); + return (0); - dma_free_coherent(ddev, MLX5_ADAPTER_PAGE_SIZE, cmd->cmd_alloc_buf, cmd->alloc_dma); - cmd->cmd_alloc_buf = dma_zalloc_coherent(ddev, 2 * MLX5_ADAPTER_PAGE_SIZE - 1, - &cmd->alloc_dma, GFP_KERNEL); - if (!cmd->cmd_alloc_buf) - return -ENOMEM; +failure_alloc_page: + bus_dma_tag_destroy(cmd->dma_tag); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Aug 7 12:49:32 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 630E9DD14EA; Mon, 7 Aug 2017 12:49:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2D9A569B1A; Mon, 7 Aug 2017 12:49:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CnVxo090716; Mon, 7 Aug 2017 12:49:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CnVvD090710; Mon, 7 Aug 2017 12:49:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071249.v77CnVvD090710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322151 - in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:49:32 -0000 Author: hselasky Date: Mon Aug 7 12:49:30 2017 New Revision: 322151 URL: https://svnweb.freebsd.org/changeset/base/322151 Log: MFC r312882, r321983 and r321984: Use the busdma API to allocate all DMA-able memory. The MLX5 driver has four different types of DMA allocations which are now allocated using busdma: 1) The 4K firmware DMA-able blocks. One busdma object per 4K allocation. 2) Data for firmware commands use the 4K firmware blocks split into four 1K blocks. 3) The 4K firmware blocks are also used for doorbell pages. 4) The RQ-, SQ- and CQ- DMA rings. One busdma object per allocation. After this patch the mlx5en driver can be used with DMAR enabled in the FreeBSD kernel. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_alloc.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Mon Aug 7 12:48:13 2017 (r322150) +++ stable/10/sys/dev/mlx5/device.h Mon Aug 7 12:49:30 2017 (r322151) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -103,6 +103,7 @@ __mlx5_mask(typ, fld)) enum { MLX5_MAX_COMMANDS = 32, MLX5_CMD_DATA_BLOCK_SIZE = 512, + MLX5_CMD_MBOX_SIZE = 1024, MLX5_PCI_CMD_XPORT = 7, MLX5_MKEY_BSF_OCTO_SIZE = 4, MLX5_MAX_PSVS = 4, @@ -522,6 +523,11 @@ struct mlx5_cmd_prot_block { u8 ctrl_sig; u8 sig; }; + +#define MLX5_NUM_CMDS_IN_ADAPTER_PAGE \ + (MLX5_ADAPTER_PAGE_SIZE / MLX5_CMD_MBOX_SIZE) +CTASSERT(MLX5_CMD_MBOX_SIZE >= sizeof(struct mlx5_cmd_prot_block)); +CTASSERT(MLX5_CMD_MBOX_SIZE <= MLX5_ADAPTER_PAGE_SIZE); enum { MLX5_CQE_SYND_FLUSHED_IN_ERROR = 5, Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:48:13 2017 (r322150) +++ stable/10/sys/dev/mlx5/driver.h Mon Aug 7 12:49:30 2017 (r322151) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -258,13 +258,26 @@ struct mlx5_cmd_first { __be32 data[4]; }; -struct mlx5_cmd_msg { - struct list_head list; - struct cache_ent *cache; - u32 len; - struct mlx5_cmd_first first; - struct mlx5_cmd_mailbox *next; +struct cache_ent; +struct mlx5_fw_page { + union { + struct rb_node rb_node; + struct list_head list; + }; + struct mlx5_cmd_first first; + struct mlx5_core_dev *dev; + bus_dmamap_t dma_map; + bus_addr_t dma_addr; + void *virt_addr; + struct cache_ent *cache; + u32 numpages; + u16 load_done; +#define MLX5_LOAD_ST_NONE 0 +#define MLX5_LOAD_ST_SUCCESS 1 +#define MLX5_LOAD_ST_FAILURE 2 + u16 func_id; }; +#define mlx5_cmd_msg mlx5_fw_page struct mlx5_cmd_debug { struct dentry *dbg_root; @@ -304,9 +317,16 @@ struct mlx5_cmd_stats { }; struct mlx5_cmd { - void *cmd_alloc_buf; - dma_addr_t alloc_dma; - int alloc_size; + struct mlx5_fw_page *cmd_page; + bus_dma_tag_t dma_tag; + struct sx dma_sx; + struct mtx dma_mtx; +#define MLX5_DMA_OWNED(dev) mtx_owned(&(dev)->cmd.dma_mtx) +#define MLX5_DMA_LOCK(dev) mtx_lock(&(dev)->cmd.dma_mtx) +#define MLX5_DMA_UNLOCK(dev) mtx_unlock(&(dev)->cmd.dma_mtx) + struct cv dma_cv; +#define MLX5_DMA_DONE(dev) cv_broadcast(&(dev)->cmd.dma_cv) +#define MLX5_DMA_WAIT(dev) cv_wait(&(dev)->cmd.dma_cv, &(dev)->cmd.dma_mtx) void *cmd_buf; dma_addr_t dma; u16 cmdif_rev; @@ -331,7 +351,6 @@ struct mlx5_cmd { struct semaphore pages_sem; int mode; struct mlx5_cmd_work_ent *ent_arr[MLX5_MAX_COMMANDS]; - struct pci_pool *pool; struct mlx5_cmd_debug dbg; struct cmd_msg_cache cache; int checksum_disabled; @@ -345,24 +364,18 @@ struct mlx5_port_caps { u8 ext_port_cap; }; -struct mlx5_cmd_mailbox { - void *buf; - dma_addr_t dma; - struct mlx5_cmd_mailbox *next; -}; - -struct mlx5_buf_list { - void *buf; - dma_addr_t map; -}; - struct mlx5_buf { - struct mlx5_buf_list direct; - struct mlx5_buf_list *page_list; - int nbufs; + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; + struct mlx5_core_dev *dev; + struct { + void *buf; + } direct; + u64 *page_list; int npages; int size; u8 page_shift; + u8 load_done; }; struct mlx5_eq { @@ -521,7 +534,6 @@ struct mlx5_priv { struct rb_root page_root; s64 fw_pages; atomic_t reg_pages; - struct list_head free_list; s64 pages_per_func[MLX5_MAX_NUMBER_OF_VFS]; struct mlx5_core_health health; @@ -664,7 +676,7 @@ struct mlx5_vport_counters { }; enum { - MLX5_DB_PER_PAGE = PAGE_SIZE / L1_CACHE_BYTES, + MLX5_DB_PER_PAGE = MLX5_ADAPTER_PAGE_SIZE / L1_CACHE_BYTES, }; struct mlx5_core_dct { @@ -688,6 +700,7 @@ enum { struct mlx5_db_pgdir { struct list_head list; DECLARE_BITMAP(bitmap, MLX5_DB_PER_PAGE); + struct mlx5_fw_page *fw_page; __be32 *db_page; dma_addr_t db_dma; }; @@ -697,6 +710,7 @@ typedef void (*mlx5_cmd_cbk_t)(int status, void *conte struct mlx5_cmd_work_ent { struct mlx5_cmd_msg *in; struct mlx5_cmd_msg *out; + int uin_size; void *uout; int uout_size; mlx5_cmd_cbk_t callback; @@ -721,13 +735,10 @@ struct mlx5_pas { u8 log_sz; }; -static inline void *mlx5_buf_offset(struct mlx5_buf *buf, int offset) +static inline void * +mlx5_buf_offset(struct mlx5_buf *buf, int offset) { - if (likely(BITS_PER_LONG == 64 || buf->nbufs == 1)) - return buf->direct.buf + offset; - else - return buf->page_list[offset >> PAGE_SHIFT].buf + - (offset & (PAGE_SIZE - 1)); + return ((char *)buf->direct.buf + offset); } @@ -816,8 +827,9 @@ void mlx5_health_cleanup(void); void __init mlx5_health_init(void); void mlx5_start_health_poll(struct mlx5_core_dev *dev); void mlx5_stop_health_poll(struct mlx5_core_dev *dev); -int mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size, int max_direct, - struct mlx5_buf *buf, int node); + +#define mlx5_buf_alloc_node(dev, size, direct, buf, node) \ + mlx5_buf_alloc(dev, size, direct, buf) int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, int max_direct, struct mlx5_buf *buf); void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf); @@ -845,6 +857,12 @@ int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, u16 opmod, u8 port); +void mlx5_fwp_flush(struct mlx5_fw_page *fwp); +void mlx5_fwp_invalidate(struct mlx5_fw_page *fwp); +struct mlx5_fw_page *mlx5_fwp_alloc(struct mlx5_core_dev *dev, gfp_t flags, unsigned num); +void mlx5_fwp_free(struct mlx5_fw_page *fwp); +u64 mlx5_fwp_get_dma(struct mlx5_fw_page *fwp, size_t offset); +void *mlx5_fwp_get_virt(struct mlx5_fw_page *fwp, size_t offset); void mlx5_pagealloc_init(struct mlx5_core_dev *dev); void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev); int mlx5_pagealloc_start(struct mlx5_core_dev *dev); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_alloc.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_alloc.c Mon Aug 7 12:48:13 2017 (r322150) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_alloc.c Mon Aug 7 12:49:30 2017 (r322151) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,106 +40,110 @@ * multiple pages, so we don't require too much contiguous memory. */ -static void *mlx5_dma_zalloc_coherent_node(struct mlx5_core_dev *dev, - size_t size, dma_addr_t *dma_handle, - int node) +static void +mlx5_buf_load_mem_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - void *cpu_handle; + struct mlx5_buf *buf; + uint8_t owned; + int x; - cpu_handle = dma_zalloc_coherent(&dev->pdev->dev, size, - dma_handle, GFP_KERNEL); - return cpu_handle; + buf = (struct mlx5_buf *)arg; + owned = MLX5_DMA_OWNED(buf->dev); + + if (!owned) + MLX5_DMA_LOCK(buf->dev); + + if (error == 0) { + for (x = 0; x != nseg; x++) { + buf->page_list[x] = segs[x].ds_addr; + KASSERT(segs[x].ds_len == PAGE_SIZE, ("Invalid segment size")); + } + buf->load_done = MLX5_LOAD_ST_SUCCESS; + } else { + buf->load_done = MLX5_LOAD_ST_FAILURE; + } + MLX5_DMA_DONE(buf->dev); + + if (!owned) + MLX5_DMA_UNLOCK(buf->dev); } -int mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size, int max_direct, - struct mlx5_buf *buf, int node) +int +mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, + int max_direct, struct mlx5_buf *buf) { - dma_addr_t t; + int err; - buf->size = size; - if (size <= max_direct) { - buf->nbufs = 1; - buf->npages = 1; - buf->page_shift = (u8)get_order(size) + PAGE_SHIFT; - buf->direct.buf = mlx5_dma_zalloc_coherent_node(dev, size, - &t, node); - if (!buf->direct.buf) - return -ENOMEM; + buf->npages = howmany(size, PAGE_SIZE); + buf->page_shift = PAGE_SHIFT; + buf->load_done = MLX5_LOAD_ST_NONE; + buf->dev = dev; + buf->page_list = kcalloc(buf->npages, sizeof(*buf->page_list), + GFP_KERNEL); - buf->direct.map = t; + err = -bus_dma_tag_create( + bus_get_dma_tag(dev->pdev->dev.bsddev), + PAGE_SIZE, /* alignment */ + 0, /* no boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + PAGE_SIZE * buf->npages, /* maxsize */ + buf->npages, /* nsegments */ + PAGE_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &buf->dma_tag); - while (t & ((1 << buf->page_shift) - 1)) { - --buf->page_shift; - buf->npages *= 2; - } - } else { - int i; + if (err != 0) + goto err_dma_tag; - buf->direct.buf = NULL; - buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE; - buf->npages = buf->nbufs; - buf->page_shift = PAGE_SHIFT; - buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list), - GFP_KERNEL); + /* allocate memory */ + err = -bus_dmamem_alloc(buf->dma_tag, &buf->direct.buf, + BUS_DMA_WAITOK | BUS_DMA_COHERENT, &buf->dma_map); + if (err != 0) + goto err_dma_alloc; - for (i = 0; i < buf->nbufs; i++) { - buf->page_list[i].buf = - mlx5_dma_zalloc_coherent_node(dev, PAGE_SIZE, - &t, node); + /* load memory into DMA */ + MLX5_DMA_LOCK(dev); + err = bus_dmamap_load( + buf->dma_tag, buf->dma_map, buf->direct.buf, + PAGE_SIZE * buf->npages, &mlx5_buf_load_mem_cb, + buf, BUS_DMA_WAITOK | BUS_DMA_COHERENT); - buf->page_list[i].map = t; - } + while (buf->load_done == MLX5_LOAD_ST_NONE) + MLX5_DMA_WAIT(dev); + MLX5_DMA_UNLOCK(dev); - if (BITS_PER_LONG == 64) { - struct page **pages; - - pages = kmalloc(sizeof(*pages) * (buf->nbufs + 1), - GFP_KERNEL); - for (i = 0; i < buf->nbufs; i++) - pages[i] = virt_to_page(buf->page_list[i].buf); - pages[buf->nbufs] = pages[0]; - buf->direct.buf = vmap(pages, buf->nbufs + 1, VM_MAP, - PAGE_KERNEL); - kfree(pages); - if (!buf->direct.buf) - goto err_free; - } + /* check for error */ + if (buf->load_done != MLX5_LOAD_ST_SUCCESS) { + err = -ENOMEM; + goto err_dma_load; } - return 0; + /* clean memory */ + memset(buf->direct.buf, 0, PAGE_SIZE * buf->npages); -err_free: - mlx5_buf_free(dev, buf); + /* flush memory to RAM */ + bus_dmamap_sync(buf->dev->cmd.dma_tag, buf->dma_map, BUS_DMASYNC_PREWRITE); + return (0); - return -ENOMEM; +err_dma_load: + bus_dmamem_free(buf->dma_tag, buf->direct.buf, buf->dma_map); +err_dma_alloc: + bus_dma_tag_destroy(buf->dma_tag); +err_dma_tag: + kfree(buf->page_list); + return (err); } -int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, int max_direct, - struct mlx5_buf *buf) -{ - return mlx5_buf_alloc_node(dev, size, max_direct, - buf, dev->priv.numa_node); -} -EXPORT_SYMBOL_GPL(mlx5_buf_alloc); - - void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf) { - if (buf->nbufs == 1) - dma_free_coherent(&dev->pdev->dev, buf->size, buf->direct.buf, - buf->direct.map); - else { - int i; - if (BITS_PER_LONG == 64 && buf->direct.buf) - vunmap(buf->direct.buf); - for (i = 0; i < buf->nbufs; i++) - if (buf->page_list[i].buf) - dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, - buf->page_list[i].buf, - buf->page_list[i].map); - kfree(buf->page_list); - } + bus_dmamap_unload(buf->dma_tag, buf->dma_map); + bus_dmamem_free(buf->dma_tag, buf->direct.buf, buf->dma_map); + bus_dma_tag_destroy(buf->dma_tag); + kfree(buf->page_list); } EXPORT_SYMBOL_GPL(mlx5_buf_free); @@ -152,8 +156,17 @@ static struct mlx5_db_pgdir *mlx5_alloc_db_pgdir(struc bitmap_fill(pgdir->bitmap, MLX5_DB_PER_PAGE); - pgdir->db_page = mlx5_dma_zalloc_coherent_node(dev, PAGE_SIZE, - &pgdir->db_dma, node); + pgdir->fw_page = mlx5_fwp_alloc(dev, GFP_KERNEL, 1); + if (pgdir->fw_page != NULL) { + pgdir->db_page = pgdir->fw_page->virt_addr; + pgdir->db_dma = pgdir->fw_page->dma_addr; + + /* clean allocated memory */ + memset(pgdir->db_page, 0, MLX5_ADAPTER_PAGE_SIZE); + + /* flush memory to RAM */ + mlx5_fwp_flush(pgdir->fw_page); + } if (!pgdir->db_page) { kfree(pgdir); return NULL; @@ -228,8 +241,7 @@ void mlx5_db_free(struct mlx5_core_dev *dev, struct ml __set_bit(db->index, db->u.pgdir->bitmap); if (bitmap_full(db->u.pgdir->bitmap, MLX5_DB_PER_PAGE)) { - dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, - db->u.pgdir->db_page, db->u.pgdir->db_dma); + mlx5_fwp_free(db->u.pgdir->fw_page); list_del(&db->u.pgdir->list); kfree(db->u.pgdir); } @@ -238,19 +250,12 @@ void mlx5_db_free(struct mlx5_core_dev *dev, struct ml } EXPORT_SYMBOL_GPL(mlx5_db_free); - -void mlx5_fill_page_array(struct mlx5_buf *buf, __be64 *pas) +void +mlx5_fill_page_array(struct mlx5_buf *buf, __be64 *pas) { - u64 addr; int i; - for (i = 0; i < buf->npages; i++) { - if (buf->nbufs == 1) - addr = buf->direct.map + ((u64)i << buf->page_shift); - else - addr = buf->page_list[i].map; - - pas[i] = cpu_to_be64(addr); - } + for (i = 0; i != buf->npages; i++) + pas[i] = cpu_to_be64(buf->page_list[i]); } EXPORT_SYMBOL_GPL(mlx5_fill_page_array); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:48:13 2017 (r322150) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Aug 7 12:49:30 2017 (r322151) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,6 +77,7 @@ enum { static struct mlx5_cmd_work_ent *alloc_cmd(struct mlx5_cmd *cmd, struct mlx5_cmd_msg *in, + int uin_size, struct mlx5_cmd_msg *out, void *uout, int uout_size, mlx5_cmd_cbk_t cbk, @@ -90,6 +91,7 @@ static struct mlx5_cmd_work_ent *alloc_cmd(struct mlx5 return ERR_PTR(-ENOMEM); ent->in = in; + ent->uin_size = uin_size; ent->out = out; ent->uout = uout; ent->uout_size = uout_size; @@ -192,14 +194,26 @@ static void calc_block_sig(struct mlx5_cmd_prot_block } } -static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum) +static void +calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum) { - struct mlx5_cmd_mailbox *next = msg->next; + size_t i; - while (next) { - calc_block_sig(next->buf, token, csum); - next = next->next; + for (i = 0; i != (msg->numpages * MLX5_NUM_CMDS_IN_ADAPTER_PAGE); i++) { + struct mlx5_cmd_prot_block *block; + + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); + + /* compute signature */ + calc_block_sig(block, token, csum); + + /* check for last block */ + if (block->next == 0) + break; } + + /* make sure data gets written to RAM */ + mlx5_fwp_flush(msg); } static void set_signature(struct mlx5_cmd_work_ent *ent, int csum) @@ -235,10 +249,11 @@ static void free_cmd(struct mlx5_cmd_work_ent *ent) kfree(ent); } - -static int verify_signature(struct mlx5_cmd_work_ent *ent) +static int +verify_signature(struct mlx5_cmd_work_ent *ent) { - struct mlx5_cmd_mailbox *next = ent->out->next; + struct mlx5_cmd_msg *msg = ent->out; + size_t i; int err; u8 sig; @@ -246,15 +261,21 @@ static int verify_signature(struct mlx5_cmd_work_ent * if (sig != 0xff) return -EINVAL; - while (next) { - err = verify_block_sig(next->buf); - if (err) - return err; + for (i = 0; i != (msg->numpages * MLX5_NUM_CMDS_IN_ADAPTER_PAGE); i++) { + struct mlx5_cmd_prot_block *block; - next = next->next; - } + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); - return 0; + /* compute signature */ + err = verify_block_sig(block); + if (err != 0) + return (err); + + /* check for last block */ + if (block->next == 0) + break; + } + return (0); } static void dump_buf(void *buf, int size, int data_only, int offset) @@ -681,9 +702,10 @@ static void dump_command(struct mlx5_core_dev *dev, { u16 op = be16_to_cpu(((struct mlx5_inbox_hdr *)(ent->lay->in))->opcode); struct mlx5_cmd_msg *msg = input ? ent->in : ent->out; - struct mlx5_cmd_mailbox *next = msg->next; + size_t i; int data_only; - u32 offset = 0; + int offset = 0; + int msg_len = input ? ent->uin_size : ent->uout_size; int dump_len; data_only = !!(mlx5_core_debug_mask & (1 << MLX5_CMD_DATA)); @@ -711,17 +733,28 @@ static void dump_command(struct mlx5_core_dev *dev, offset += sizeof(*ent->lay); } - while (next && offset < msg->len) { + for (i = 0; i != (msg->numpages * MLX5_NUM_CMDS_IN_ADAPTER_PAGE); i++) { + struct mlx5_cmd_prot_block *block; + + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); + if (data_only) { - dump_len = min_t(int, MLX5_CMD_DATA_BLOCK_SIZE, msg->len - offset); - dump_buf(next->buf, dump_len, 1, offset); + if (offset >= msg_len) + break; + dump_len = min_t(int, + MLX5_CMD_DATA_BLOCK_SIZE, msg_len - offset); + + dump_buf(block->data, dump_len, 1, offset); offset += MLX5_CMD_DATA_BLOCK_SIZE; } else { mlx5_core_dbg(dev, "command block:\n"); - dump_buf(next->buf, sizeof(struct mlx5_cmd_prot_block), 0, offset); - offset += sizeof(struct mlx5_cmd_prot_block); + dump_buf(block, sizeof(*block), 0, offset); + offset += sizeof(*block); } - next = next->next; + + /* check for last block */ + if (block->next == 0) + break; } if (data_only) @@ -982,12 +1015,12 @@ static void cmd_work_handler(struct work_struct *work) memset(lay, 0, sizeof(*lay)); memcpy(lay->in, ent->in->first.data, sizeof(lay->in)); ent->op = be32_to_cpu(lay->in[0]) >> 16; - if (ent->in->next) - lay->in_ptr = cpu_to_be64(ent->in->next->dma); - lay->inlen = cpu_to_be32(ent->in->len); - if (ent->out->next) - lay->out_ptr = cpu_to_be64(ent->out->next->dma); - lay->outlen = cpu_to_be32(ent->out->len); + if (ent->in->numpages != 0) + lay->in_ptr = cpu_to_be64(mlx5_fwp_get_dma(ent->in, 0)); + if (ent->out->numpages != 0) + lay->out_ptr = cpu_to_be64(mlx5_fwp_get_dma(ent->out, 0)); + lay->inlen = cpu_to_be32(ent->uin_size); + lay->outlen = cpu_to_be32(ent->uout_size); lay->type = MLX5_PCI_CMD_XPORT; lay->token = ent->token; lay->status_own = CMD_OWNER_HW; @@ -997,14 +1030,14 @@ static void cmd_work_handler(struct work_struct *work) ent->busy = 0; /* ring doorbell after the descriptor is valid */ mlx5_core_dbg(dev, "writing 0x%x to command doorbell\n", 1 << ent->idx); - wmb(); + /* make sure data is written to RAM */ + mlx5_fwp_flush(cmd->cmd_page); iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell); mmiowb(); /* if not in polling don't use ent after this point*/ if (cmd->mode == CMD_MODE_POLLING) { poll_timeout(ent); /* make sure we read the descriptor after ownership is SW */ - rmb(); mlx5_cmd_comp_handler(dev, 1U << ent->idx); } } @@ -1078,6 +1111,7 @@ static int wait_func(struct mlx5_core_dev *dev, struct * 2. page queue commands do not support asynchrous completion */ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in, + int uin_size, struct mlx5_cmd_msg *out, void *uout, int uout_size, mlx5_cmd_cbk_t callback, void *context, int page_queue, u8 *status) @@ -1092,8 +1126,8 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, if (callback && page_queue) return -EINVAL; - ent = alloc_cmd(cmd, in, out, uout, uout_size, callback, context, - page_queue); + ent = alloc_cmd(cmd, in, uin_size, out, uout, uout_size, callback, + context, page_queue); if (IS_ERR(ent)) return PTR_ERR(ent); @@ -1138,159 +1172,98 @@ out: return err; } -static int mlx5_copy_to_msg(struct mlx5_cmd_msg *to, void *from, int size) +static int mlx5_copy_to_msg(struct mlx5_cmd_msg *to, void *from, size_t size) { - struct mlx5_cmd_prot_block *block; - struct mlx5_cmd_mailbox *next; - int copy; + size_t delta; + size_t i; - if (!to || !from) - return -ENOMEM; + if (to == NULL || from == NULL) + return (-ENOMEM); - copy = min_t(int, size, sizeof(to->first.data)); - memcpy(to->first.data, from, copy); - size -= copy; - from += copy; + delta = min_t(size_t, size, sizeof(to->first.data)); + memcpy(to->first.data, from, delta); + from = (char *)from + delta; + size -= delta; - next = to->next; - while (size) { - if (!next) { - /* this is a BUG */ - return -ENOMEM; - } + for (i = 0; size != 0; i++) { + struct mlx5_cmd_prot_block *block; - copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); - block = next->buf; - memcpy(block->data, from, copy); - from += copy; - size -= copy; - next = next->next; - } + block = mlx5_fwp_get_virt(to, i * MLX5_CMD_MBOX_SIZE); - return 0; + delta = min_t(size_t, size, MLX5_CMD_DATA_BLOCK_SIZE); + memcpy(block->data, from, delta); + from = (char *)from + delta; + size -= delta; + } + return (0); } static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size) { - struct mlx5_cmd_prot_block *block; - struct mlx5_cmd_mailbox *next; - int copy; + size_t delta; + size_t i; - if (!to || !from) - return -ENOMEM; + if (to == NULL || from == NULL) + return (-ENOMEM); - copy = min_t(int, size, sizeof(from->first.data)); - memcpy(to, from->first.data, copy); - size -= copy; - to += copy; + delta = min_t(size_t, size, sizeof(from->first.data)); + memcpy(to, from->first.data, delta); + to = (char *)to + delta; + size -= delta; - next = from->next; - while (size) { - if (!next) { - /* this is a BUG */ - return -ENOMEM; - } + for (i = 0; size != 0; i++) { + struct mlx5_cmd_prot_block *block; - copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); - block = next->buf; + block = mlx5_fwp_get_virt(from, i * MLX5_CMD_MBOX_SIZE); - memcpy(to, block->data, copy); - to += copy; - size -= copy; - next = next->next; + delta = min_t(size_t, size, MLX5_CMD_DATA_BLOCK_SIZE); + memcpy(to, block->data, delta); + to = (char *)to + delta; + size -= delta; } - - return 0; + return (0); } -static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev, - gfp_t flags) +static struct mlx5_cmd_msg * +mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, gfp_t flags, size_t size) { - struct mlx5_cmd_mailbox *mailbox; + struct mlx5_cmd_msg *msg; + size_t blen; + size_t n; + size_t i; - mailbox = kmalloc(sizeof(*mailbox), flags); - if (!mailbox) - return ERR_PTR(-ENOMEM); + blen = size - min_t(size_t, sizeof(msg->first.data), size); + n = howmany(blen, MLX5_CMD_DATA_BLOCK_SIZE); - mailbox->buf = pci_pool_alloc(dev->cmd.pool, flags, - &mailbox->dma); - if (!mailbox->buf) { - mlx5_core_dbg(dev, "failed allocation\n"); - kfree(mailbox); - return ERR_PTR(-ENOMEM); - } - memset(mailbox->buf, 0, sizeof(struct mlx5_cmd_prot_block)); - mailbox->next = NULL; + msg = mlx5_fwp_alloc(dev, flags, howmany(n, MLX5_NUM_CMDS_IN_ADAPTER_PAGE)); + if (msg == NULL) + return (ERR_PTR(-ENOMEM)); - return mailbox; -} + for (i = 0; i != n; i++) { + struct mlx5_cmd_prot_block *block; -static void free_cmd_box(struct mlx5_core_dev *dev, - struct mlx5_cmd_mailbox *mailbox) -{ - pci_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma); - kfree(mailbox); -} + block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); -static struct mlx5_cmd_msg *mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, - gfp_t flags, int size) -{ - struct mlx5_cmd_mailbox *tmp, *head = NULL; - struct mlx5_cmd_prot_block *block; - struct mlx5_cmd_msg *msg; - int blen; - int err; - int n; - int i; + memset(block, 0, MLX5_CMD_MBOX_SIZE); - msg = kzalloc(sizeof(*msg), flags); - if (!msg) - return ERR_PTR(-ENOMEM); - - blen = size - min_t(int, sizeof(msg->first.data), size); - n = (blen + MLX5_CMD_DATA_BLOCK_SIZE - 1) / MLX5_CMD_DATA_BLOCK_SIZE; - - for (i = 0; i < n; i++) { - tmp = alloc_cmd_box(dev, flags); - if (IS_ERR(tmp)) { - mlx5_core_warn(dev, "failed allocating block\n"); - err = PTR_ERR(tmp); - goto err_alloc; + if (i != (n - 1)) { + u64 dma = mlx5_fwp_get_dma(msg, (i + 1) * MLX5_CMD_MBOX_SIZE); + block->next = cpu_to_be64(dma); } - - block = tmp->buf; - tmp->next = head; - block->next = cpu_to_be64(tmp->next ? tmp->next->dma : 0); - block->block_num = cpu_to_be32(n - i - 1); - head = tmp; + block->block_num = cpu_to_be32(i); } - msg->next = head; - msg->len = size; - return msg; -err_alloc: - while (head) { - tmp = head->next; - free_cmd_box(dev, head); - head = tmp; - } - kfree(msg); + /* make sure initial data is written to RAM */ + mlx5_fwp_flush(msg); - return ERR_PTR(err); + return (msg); } -static void mlx5_free_cmd_msg(struct mlx5_core_dev *dev, - struct mlx5_cmd_msg *msg) +static void +mlx5_free_cmd_msg(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *msg) { - struct mlx5_cmd_mailbox *head = msg->next; - struct mlx5_cmd_mailbox *next; - while (head) { - next = head->next; - free_cmd_box(dev, head); - head = next; - } - kfree(msg); + mlx5_fwp_free(msg); } static void set_wqname(struct mlx5_core_dev *dev) @@ -1356,6 +1329,9 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent; int i; + /* make sure data gets read from RAM */ + mlx5_fwp_invalidate(cmd->cmd_page); + while (vector != 0) { i = ffs(vector) - 1; vector &= ~(1U << i); @@ -1363,6 +1339,8 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, ent->ts2 = ktime_get_ns(); memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); + /* make sure data gets read from RAM */ + mlx5_fwp_invalidate(ent->out); dump_command(dev, ent, 0); if (!ent->ret) { if (!cmd->checksum_disabled) @@ -1432,10 +1410,6 @@ static struct mlx5_cmd_msg *alloc_msg(struct mlx5_core if (!list_empty(&ent->head)) { msg = list_entry(ent->head.next, struct mlx5_cmd_msg, list); - /* For cached lists, we must explicitly state what is - * the real size - */ - msg->len = in_size; list_del(&msg->list); } spin_unlock_irq(&ent->lock); @@ -1460,12 +1434,11 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *inb; struct mlx5_cmd_msg *outb; int pages_queue; - gfp_t gfp; + const gfp_t gfp = GFP_KERNEL; int err; u8 status = 0; pages_queue = is_manage_pages(in); - gfp = callback ? GFP_ATOMIC : GFP_KERNEL; inb = alloc_msg(dev, in_size, gfp); if (IS_ERR(inb)) { @@ -1485,8 +1458,8 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, goto out_in; } - err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context, - pages_queue, &status); + err = mlx5_cmd_invoke(dev, inb, in_size, outb, out, out_size, callback, + context, pages_queue, &status); if (err) { if (err == -ETIMEDOUT) return err; @@ -1583,44 +1556,67 @@ ex_err: return err; } -static int alloc_cmd_page(struct mlx5_core_dev *dev, struct mlx5_cmd *cmd) +static int +alloc_cmd_page(struct mlx5_core_dev *dev, struct mlx5_cmd *cmd) { - struct device *ddev = &dev->pdev->dev; - cmd->cmd_alloc_buf = dma_zalloc_coherent(ddev, MLX5_ADAPTER_PAGE_SIZE, - &cmd->alloc_dma, GFP_KERNEL); - if (!cmd->cmd_alloc_buf) - return -ENOMEM; + int err; - /* make sure it is aligned to 4K */ - if (!((uintptr_t)cmd->cmd_alloc_buf & (MLX5_ADAPTER_PAGE_SIZE - 1))) { - cmd->cmd_buf = cmd->cmd_alloc_buf; - cmd->dma = cmd->alloc_dma; - cmd->alloc_size = MLX5_ADAPTER_PAGE_SIZE; - return 0; + sx_init(&cmd->dma_sx, "MLX5-DMA-SX"); + mtx_init(&cmd->dma_mtx, "MLX5-DMA-MTX", NULL, MTX_DEF); + cv_init(&cmd->dma_cv, "MLX5-DMA-CV"); + + /* + * Create global DMA descriptor tag for allocating + * 4K firmware pages: + */ + err = -bus_dma_tag_create( + bus_get_dma_tag(dev->pdev->dev.bsddev), + MLX5_ADAPTER_PAGE_SIZE, /* alignment */ + 0, /* no boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MLX5_ADAPTER_PAGE_SIZE, /* maxsize */ + 1, /* nsegments */ + MLX5_ADAPTER_PAGE_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &cmd->dma_tag); + if (err != 0) + goto failure_destroy_sx; + + cmd->cmd_page = mlx5_fwp_alloc(dev, GFP_KERNEL, 1); + if (cmd->cmd_page == NULL) { + err = -ENOMEM; + goto failure_alloc_page; } + cmd->dma = mlx5_fwp_get_dma(cmd->cmd_page, 0); + cmd->cmd_buf = mlx5_fwp_get_virt(cmd->cmd_page, 0); + return (0); - dma_free_coherent(ddev, MLX5_ADAPTER_PAGE_SIZE, cmd->cmd_alloc_buf, cmd->alloc_dma); - cmd->cmd_alloc_buf = dma_zalloc_coherent(ddev, 2 * MLX5_ADAPTER_PAGE_SIZE - 1, - &cmd->alloc_dma, GFP_KERNEL); - if (!cmd->cmd_alloc_buf) - return -ENOMEM; +failure_alloc_page: + bus_dma_tag_destroy(cmd->dma_tag); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Aug 7 12:52:01 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EC61DD16DC; Mon, 7 Aug 2017 12:52:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2CDDF69D98; Mon, 7 Aug 2017 12:52:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77Cq00g094372; Mon, 7 Aug 2017 12:52:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77Cq0ff094371; Mon, 7 Aug 2017 12:52:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071252.v77Cq0ff094371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322152 - stable/11/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 322152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:52:01 -0000 Author: hselasky Date: Mon Aug 7 12:52:00 2017 New Revision: 322152 URL: https://svnweb.freebsd.org/changeset/base/322152 Log: MFC r321985: Ticks are 32-bit in FreeBSD. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/core/addr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 7 12:49:30 2017 (r322151) +++ stable/11/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 7 12:52:00 2017 (r322152) @@ -185,10 +185,10 @@ EXPORT_SYMBOL(rdma_translate_ip); static void set_timeout(unsigned long time) { - unsigned long delay; + int delay; /* under FreeBSD ticks are 32-bit */ delay = time - jiffies; - if ((long)delay <= 0) + if (delay <= 0) delay = 1; mod_delayed_work(addr_wq, &work, delay); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:53:11 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F3C6DD18E6; Mon, 7 Aug 2017 12:53:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6BA366A044; Mon, 7 Aug 2017 12:53:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CrAck094464; Mon, 7 Aug 2017 12:53:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CrAIJ094463; Mon, 7 Aug 2017 12:53:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071253.v77CrAIJ094463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322153 - stable/10/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 322153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:53:11 -0000 Author: hselasky Date: Mon Aug 7 12:53:10 2017 New Revision: 322153 URL: https://svnweb.freebsd.org/changeset/base/322153 Log: MFC r321985: Ticks are 32-bit in FreeBSD. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/core/addr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 7 12:52:00 2017 (r322152) +++ stable/10/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 7 12:53:10 2017 (r322153) @@ -192,10 +192,10 @@ EXPORT_SYMBOL(rdma_translate_ip); static void set_timeout(unsigned long time) { - unsigned long delay; + int delay; /* under FreeBSD ticks are 32-bit */ delay = time - jiffies; - if ((long)delay <= 0) + if (delay <= 0) delay = 1; mod_delayed_work(addr_wq, &work, delay); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:56:05 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37733DD1AA1; Mon, 7 Aug 2017 12:56:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 05D5A6A1B9; Mon, 7 Aug 2017 12:56:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77Cu4tF094632; Mon, 7 Aug 2017 12:56:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77Cu4J3094631; Mon, 7 Aug 2017 12:56:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071256.v77Cu4J3094631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r322154 - stable/9/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 322154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:56:05 -0000 Author: hselasky Date: Mon Aug 7 12:56:03 2017 New Revision: 322154 URL: https://svnweb.freebsd.org/changeset/base/322154 Log: MFC r321985: Ticks are 32-bit in FreeBSD. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/infiniband/core/addr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 7 12:53:10 2017 (r322153) +++ stable/9/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 7 12:56:03 2017 (r322154) @@ -192,10 +192,10 @@ EXPORT_SYMBOL(rdma_translate_ip); static void set_timeout(unsigned long time) { - unsigned long delay; + int delay; /* under FreeBSD ticks are 32-bit */ delay = time - jiffies; - if ((long)delay <= 0) + if (delay <= 0) delay = 1; mod_delayed_work(addr_wq, &work, delay); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:57:32 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41FB1DD1C44; Mon, 7 Aug 2017 12:57:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0E7616A36F; Mon, 7 Aug 2017 12:57:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CvVMO094741; Mon, 7 Aug 2017 12:57:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CvVut094740; Mon, 7 Aug 2017 12:57:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071257.v77CvVut094740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322155 - stable/11/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 322155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:57:32 -0000 Author: hselasky Date: Mon Aug 7 12:57:31 2017 New Revision: 322155 URL: https://svnweb.freebsd.org/changeset/base/322155 Log: MFC r321986: Change reject message type when destroying cm_id in ibore. This patch fixes an interopability issue between FreeBSD and non-FreeBSD systems when the connection establishment is aborted. Refer to the initial commit in Linux, drivers/infiniband/core/cm.c, for a more detailed description. Obtained from: Linux Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/core/cm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/cm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/cm.c Mon Aug 7 12:56:03 2017 (r322154) +++ stable/11/sys/ofed/drivers/infiniband/core/cm.c Mon Aug 7 12:57:31 2017 (r322155) @@ -889,6 +889,7 @@ retest: cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); break; case IB_CM_REQ_SENT: + case IB_CM_MRA_REQ_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); spin_unlock_irq(&cm_id_priv->lock); ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT, @@ -907,7 +908,6 @@ retest: NULL, 0, NULL, 0); } break; - case IB_CM_MRA_REQ_RCVD: case IB_CM_REP_SENT: case IB_CM_MRA_REP_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:58:33 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BC5CDD1D1E; Mon, 7 Aug 2017 12:58:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E8C2F6A4DB; Mon, 7 Aug 2017 12:58:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CwW9W094837; Mon, 7 Aug 2017 12:58:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CwWYh094836; Mon, 7 Aug 2017 12:58:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071258.v77CwWYh094836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322156 - stable/10/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 322156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:58:33 -0000 Author: hselasky Date: Mon Aug 7 12:58:31 2017 New Revision: 322156 URL: https://svnweb.freebsd.org/changeset/base/322156 Log: MFC r321986: Change reject message type when destroying cm_id in ibore. This patch fixes an interopability issue between FreeBSD and non-FreeBSD systems when the connection establishment is aborted. Refer to the initial commit in Linux, drivers/infiniband/core/cm.c, for a more detailed description. Obtained from: Linux Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/core/cm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/core/cm.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/cm.c Mon Aug 7 12:57:31 2017 (r322155) +++ stable/10/sys/ofed/drivers/infiniband/core/cm.c Mon Aug 7 12:58:31 2017 (r322156) @@ -870,6 +870,7 @@ retest: cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); break; case IB_CM_REQ_SENT: + case IB_CM_MRA_REQ_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); spin_unlock_irq(&cm_id_priv->lock); ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT, @@ -888,7 +889,6 @@ retest: NULL, 0, NULL, 0); } break; - case IB_CM_MRA_REQ_RCVD: case IB_CM_REP_SENT: case IB_CM_MRA_REP_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); From owner-svn-src-stable@freebsd.org Mon Aug 7 12:59:33 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 987D0DD1E45; Mon, 7 Aug 2017 12:59:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 62B096A624; Mon, 7 Aug 2017 12:59:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77CxWuH094931; Mon, 7 Aug 2017 12:59:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77CxWun094930; Mon, 7 Aug 2017 12:59:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071259.v77CxWun094930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 12:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r322157 - stable/9/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 322157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 12:59:33 -0000 Author: hselasky Date: Mon Aug 7 12:59:32 2017 New Revision: 322157 URL: https://svnweb.freebsd.org/changeset/base/322157 Log: MFC r321986: Change reject message type when destroying cm_id in ibore. This patch fixes an interopability issue between FreeBSD and non-FreeBSD systems when the connection establishment is aborted. Refer to the initial commit in Linux, drivers/infiniband/core/cm.c, for a more detailed description. Obtained from: Linux Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/infiniband/core/cm.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/core/cm.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/cm.c Mon Aug 7 12:58:31 2017 (r322156) +++ stable/9/sys/ofed/drivers/infiniband/core/cm.c Mon Aug 7 12:59:32 2017 (r322157) @@ -870,6 +870,7 @@ retest: cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); break; case IB_CM_REQ_SENT: + case IB_CM_MRA_REQ_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); spin_unlock_irq(&cm_id_priv->lock); ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT, @@ -888,7 +889,6 @@ retest: NULL, 0, NULL, 0); } break; - case IB_CM_MRA_REQ_RCVD: case IB_CM_REP_SENT: case IB_CM_MRA_REP_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); From owner-svn-src-stable@freebsd.org Mon Aug 7 13:03:53 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E962ADD24BD; Mon, 7 Aug 2017 13:03:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B508F6ACCA; Mon, 7 Aug 2017 13:03:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77D3q0d098851; Mon, 7 Aug 2017 13:03:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77D3qeC098850; Mon, 7 Aug 2017 13:03:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071303.v77D3qeC098850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322158 - stable/11/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Commit-Revision: 322158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:03:54 -0000 Author: hselasky Date: Mon Aug 7 13:03:52 2017 New Revision: 322158 URL: https://svnweb.freebsd.org/changeset/base/322158 Log: MFC r321780: Make sure on-stack buffer is properly aligned. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/hw/mlx4/mad.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Mon Aug 7 12:59:32 2017 (r322157) +++ stable/11/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Mon Aug 7 13:03:52 2017 (r322158) @@ -983,7 +983,7 @@ static int iboe_process_mad(struct ib_device *ibdev, i int err; u32 counter_index = dev->counters[port_num - 1].counter_index & 0xffff; u8 mode; - char counter_buf[MLX4_IF_STAT_SZ(1)]; + char counter_buf[MLX4_IF_STAT_SZ(1)] __aligned(8); union mlx4_counter *counter = (union mlx4_counter *) counter_buf; From owner-svn-src-stable@freebsd.org Mon Aug 7 13:06:04 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8FDDDD26B5; Mon, 7 Aug 2017 13:06:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7718F6AE72; Mon, 7 Aug 2017 13:06:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77D63i5098985; Mon, 7 Aug 2017 13:06:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77D63Bt098984; Mon, 7 Aug 2017 13:06:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071306.v77D63Bt098984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322159 - stable/10/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Commit-Revision: 322159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:06:04 -0000 Author: hselasky Date: Mon Aug 7 13:06:03 2017 New Revision: 322159 URL: https://svnweb.freebsd.org/changeset/base/322159 Log: MFC r321780: Make sure on-stack buffer is properly aligned. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mad.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Mon Aug 7 13:03:52 2017 (r322158) +++ stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Mon Aug 7 13:06:03 2017 (r322159) @@ -963,7 +963,7 @@ static int iboe_process_mad(struct ib_device *ibdev, i int err; u32 counter_index = dev->counters[port_num - 1] & 0xffff; u8 mode; - char counter_buf[MLX4_IF_STAT_SZ(1)]; + char counter_buf[MLX4_IF_STAT_SZ(1)] __aligned(8); union mlx4_counter *counter = (union mlx4_counter *) counter_buf; From owner-svn-src-stable@freebsd.org Mon Aug 7 13:08:00 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5816ADD285C; Mon, 7 Aug 2017 13:08:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 20CB46B00F; Mon, 7 Aug 2017 13:08:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77D7xrY099103; Mon, 7 Aug 2017 13:07:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77D7xP2099102; Mon, 7 Aug 2017 13:07:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071307.v77D7xP2099102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r322160 - stable/9/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Commit-Revision: 322160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:08:00 -0000 Author: hselasky Date: Mon Aug 7 13:07:58 2017 New Revision: 322160 URL: https://svnweb.freebsd.org/changeset/base/322160 Log: MFC r321780: Make sure on-stack buffer is properly aligned. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mad.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Mon Aug 7 13:06:03 2017 (r322159) +++ stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Mon Aug 7 13:07:58 2017 (r322160) @@ -963,7 +963,7 @@ static int iboe_process_mad(struct ib_device *ibdev, i int err; u32 counter_index = dev->counters[port_num - 1] & 0xffff; u8 mode; - char counter_buf[MLX4_IF_STAT_SZ(1)]; + char counter_buf[MLX4_IF_STAT_SZ(1)] __aligned(8); union mlx4_counter *counter = (union mlx4_counter *) counter_buf; From owner-svn-src-stable@freebsd.org Mon Aug 7 13:14:12 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46073DD2D16; Mon, 7 Aug 2017 13:14:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 217356B479; Mon, 7 Aug 2017 13:14:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77DEBL9003347; Mon, 7 Aug 2017 13:14:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77DEB6D003344; Mon, 7 Aug 2017 13:14:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071314.v77DEB6D003344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322161 - in stable/11/sys/ofed: drivers/infiniband/hw/mlx4 drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/ofed: drivers/infiniband/hw/mlx4 drivers/net/mlx4 include/linux/mlx4 X-SVN-Commit-Revision: 322161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:14:12 -0000 Author: hselasky Date: Mon Aug 7 13:14:10 2017 New Revision: 322161 URL: https://svnweb.freebsd.org/changeset/base/322161 Log: MFC r321772: Fix broken usage of the mlx4_read_clock() function: - return value has too small width - cycle_t is unsigned and cannot be less than zero Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c stable/11/sys/ofed/drivers/net/mlx4/main.c stable/11/sys/ofed/include/linux/mlx4/device.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c Mon Aug 7 13:07:58 2017 (r322160) +++ stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c Mon Aug 7 13:14:10 2017 (r322161) @@ -878,12 +878,12 @@ static int mlx4_ib_query_values(struct ib_device *devi struct ib_device_values *values) { struct mlx4_ib_dev *dev = to_mdev(device); - cycle_t cycles; + s64 cycles; values->values_mask = 0; if (q_values & IBV_VALUES_HW_CLOCK) { cycles = mlx4_read_clock(dev->dev); - if (cycles < 0) { + if (cycles >= 0) { values->hwclock = cycles & CORE_CLOCK_MASK; values->values_mask |= IBV_VALUES_HW_CLOCK; } Modified: stable/11/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/11/sys/ofed/drivers/net/mlx4/main.c Mon Aug 7 13:07:58 2017 (r322160) +++ stable/11/sys/ofed/drivers/net/mlx4/main.c Mon Aug 7 13:14:10 2017 (r322161) @@ -1793,10 +1793,10 @@ static void unmap_bf_area(struct mlx4_dev *dev) io_mapping_free(mlx4_priv(dev)->bf_mapping); } -int mlx4_read_clock(struct mlx4_dev *dev) +s64 mlx4_read_clock(struct mlx4_dev *dev) { u32 clockhi, clocklo, clockhi1; - cycle_t cycles; + s64 cycles; int i; struct mlx4_priv *priv = mlx4_priv(dev); @@ -1813,7 +1813,7 @@ int mlx4_read_clock(struct mlx4_dev *dev) cycles = (u64) clockhi << 32 | (u64) clocklo; - return cycles; + return cycles & CORE_CLOCK_MASK; } EXPORT_SYMBOL_GPL(mlx4_read_clock); Modified: stable/11/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/11/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:07:58 2017 (r322160) +++ stable/11/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:14:10 2017 (r322161) @@ -1337,7 +1337,7 @@ int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, u32 max_range_qpn); -int mlx4_read_clock(struct mlx4_dev *dev); +s64 mlx4_read_clock(struct mlx4_dev *dev); int mlx4_get_internal_clock_params(struct mlx4_dev *dev, struct mlx4_clock_params *params); From owner-svn-src-stable@freebsd.org Mon Aug 7 13:16:40 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30689DD2EDF; Mon, 7 Aug 2017 13:16:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 EFED66B64E; Mon, 7 Aug 2017 13:16:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77DGd4m003488; Mon, 7 Aug 2017 13:16:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77DGdxq003486; Mon, 7 Aug 2017 13:16:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071316.v77DGdxq003486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322162 - in stable/10/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Commit-Revision: 322162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:16:40 -0000 Author: hselasky Date: Mon Aug 7 13:16:38 2017 New Revision: 322162 URL: https://svnweb.freebsd.org/changeset/base/322162 Log: MFC r321772: Fix broken usage of the mlx4_read_clock() function: - return value has too small width - cycle_t is unsigned and cannot be less than zero Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c stable/10/sys/ofed/include/linux/mlx4/device.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/main.c Mon Aug 7 13:14:10 2017 (r322161) +++ stable/10/sys/ofed/drivers/net/mlx4/main.c Mon Aug 7 13:16:38 2017 (r322162) @@ -1795,10 +1795,10 @@ static void unmap_bf_area(struct mlx4_dev *dev) io_mapping_free(mlx4_priv(dev)->bf_mapping); } -int mlx4_read_clock(struct mlx4_dev *dev) +s64 mlx4_read_clock(struct mlx4_dev *dev) { u32 clockhi, clocklo, clockhi1; - cycle_t cycles; + s64 cycles; int i; struct mlx4_priv *priv = mlx4_priv(dev); @@ -1815,7 +1815,7 @@ int mlx4_read_clock(struct mlx4_dev *dev) cycles = (u64) clockhi << 32 | (u64) clocklo; - return cycles; + return cycles & CORE_CLOCK_MASK; } EXPORT_SYMBOL_GPL(mlx4_read_clock); Modified: stable/10/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/10/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:14:10 2017 (r322161) +++ stable/10/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:16:38 2017 (r322162) @@ -1337,7 +1337,7 @@ int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, u32 max_range_qpn); -int mlx4_read_clock(struct mlx4_dev *dev); +s64 mlx4_read_clock(struct mlx4_dev *dev); int mlx4_get_internal_clock_params(struct mlx4_dev *dev, struct mlx4_clock_params *params); From owner-svn-src-stable@freebsd.org Mon Aug 7 13:17:58 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 669FEDD3124; Mon, 7 Aug 2017 13:17:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 334976B8F6; Mon, 7 Aug 2017 13:17:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77DHvpU003588; Mon, 7 Aug 2017 13:17:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77DHvrn003586; Mon, 7 Aug 2017 13:17:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071317.v77DHvrn003586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r322163 - in stable/9/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/9/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Commit-Revision: 322163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:17:58 -0000 Author: hselasky Date: Mon Aug 7 13:17:57 2017 New Revision: 322163 URL: https://svnweb.freebsd.org/changeset/base/322163 Log: MFC r321772: Fix broken usage of the mlx4_read_clock() function: - return value has too small width - cycle_t is unsigned and cannot be less than zero Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c stable/9/sys/ofed/include/linux/mlx4/device.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/main.c Mon Aug 7 13:16:38 2017 (r322162) +++ stable/9/sys/ofed/drivers/net/mlx4/main.c Mon Aug 7 13:17:57 2017 (r322163) @@ -1795,10 +1795,10 @@ static void unmap_bf_area(struct mlx4_dev *dev) io_mapping_free(mlx4_priv(dev)->bf_mapping); } -int mlx4_read_clock(struct mlx4_dev *dev) +s64 mlx4_read_clock(struct mlx4_dev *dev) { u32 clockhi, clocklo, clockhi1; - cycle_t cycles; + s64 cycles; int i; struct mlx4_priv *priv = mlx4_priv(dev); @@ -1815,7 +1815,7 @@ int mlx4_read_clock(struct mlx4_dev *dev) cycles = (u64) clockhi << 32 | (u64) clocklo; - return cycles; + return cycles & CORE_CLOCK_MASK; } EXPORT_SYMBOL_GPL(mlx4_read_clock); Modified: stable/9/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/9/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:16:38 2017 (r322162) +++ stable/9/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:17:57 2017 (r322163) @@ -1337,7 +1337,7 @@ int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, u32 max_range_qpn); -int mlx4_read_clock(struct mlx4_dev *dev); +s64 mlx4_read_clock(struct mlx4_dev *dev); int mlx4_get_internal_clock_params(struct mlx4_dev *dev, struct mlx4_clock_params *params); From owner-svn-src-stable@freebsd.org Mon Aug 7 13:24:07 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35B73DD3768; Mon, 7 Aug 2017 13:24:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 1156C6BEE8; Mon, 7 Aug 2017 13:24:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77DO6Gk007405; Mon, 7 Aug 2017 13:24:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77DO5Jg007400; Mon, 7 Aug 2017 13:24:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071324.v77DO5Jg007400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322164 - in stable/11/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Commit-Revision: 322164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:24:07 -0000 Author: hselasky Date: Mon Aug 7 13:24:05 2017 New Revision: 322164 URL: https://svnweb.freebsd.org/changeset/base/322164 Log: MFC r321782: Remove some dead statistics related code and a structure field from the mlx4en driver which is used by its Linux counterpart, but not under FreeBSD. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/net/mlx4/en_netdev.c stable/11/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/11/sys/ofed/drivers/net/mlx4/mlx4_stats.h stable/11/sys/ofed/drivers/net/mlx4/port.c stable/11/sys/ofed/include/linux/mlx4/device.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/11/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Aug 7 13:17:57 2017 (r322163) +++ stable/11/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Aug 7 13:24:05 2017 (r322164) @@ -1377,8 +1377,6 @@ int mlx4_en_start_port(struct net_device *dev) /* Schedule multicast task to populate multicast list */ queue_work(mdev->workqueue, &priv->rx_mode_task); - mlx4_set_stats_bitmap(mdev->dev, priv->stats_bitmap); - priv->port_up = true; /* Enable the queues. */ @@ -2731,28 +2729,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", CTLFLAG_RD, &priv->pkstats.rx_gt_1548_bytes_packets, "RX Greater Then 1548 bytes Packets"); - -struct mlx4_en_pkt_stats { - unsigned long tx_packets; - unsigned long tx_bytes; - unsigned long tx_multicast_packets; - unsigned long tx_broadcast_packets; - unsigned long tx_errors; - unsigned long tx_dropped; - unsigned long tx_lt_64_bytes_packets; - unsigned long tx_127_bytes_packets; - unsigned long tx_255_bytes_packets; - unsigned long tx_511_bytes_packets; - unsigned long tx_1023_bytes_packets; - unsigned long tx_1518_bytes_packets; - unsigned long tx_1522_bytes_packets; - unsigned long tx_1548_bytes_packets; - unsigned long tx_gt_1548_bytes_packets; - unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; - unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 -}; - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &priv->pkstats.tx_packets, "TX packets"); Modified: stable/11/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- stable/11/sys/ofed/drivers/net/mlx4/mlx4_en.h Mon Aug 7 13:17:57 2017 (r322163) +++ stable/11/sys/ofed/drivers/net/mlx4/mlx4_en.h Mon Aug 7 13:24:05 2017 (r322164) @@ -572,7 +572,6 @@ struct mlx4_en_priv { struct mlx4_en_port_stats port_stats; struct mlx4_en_vport_stats vport_stats; struct mlx4_en_vf_stats vf_stats; - DECLARE_BITMAP(stats_bitmap, NUM_ALL_STATS); struct list_head mc_list; struct list_head curr_list; u64 broadcast_id; Modified: stable/11/sys/ofed/drivers/net/mlx4/mlx4_stats.h ============================================================================== --- stable/11/sys/ofed/drivers/net/mlx4/mlx4_stats.h Mon Aug 7 13:17:57 2017 (r322163) +++ stable/11/sys/ofed/drivers/net/mlx4/mlx4_stats.h Mon Aug 7 13:24:05 2017 (r322164) @@ -82,7 +82,6 @@ struct mlx4_en_pkt_stats { unsigned long tx_gt_1548_bytes_packets; unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 }; struct mlx4_en_vf_stats { @@ -97,7 +96,6 @@ struct mlx4_en_vf_stats { unsigned long tx_multicast_packets; unsigned long tx_broadcast_packets; unsigned long tx_errors; -#define NUM_VF_STATS 11 }; struct mlx4_en_vport_stats { @@ -116,7 +114,6 @@ struct mlx4_en_vport_stats { unsigned long tx_broadcast_packets; unsigned long tx_broadcast_bytes; unsigned long tx_errors; -#define NUM_VPORT_STATS 15 }; struct mlx4_en_port_stats { @@ -129,7 +126,6 @@ struct mlx4_en_port_stats { unsigned long rx_chksum_good; unsigned long rx_chksum_none; unsigned long tx_chksum_offload; -#define NUM_PORT_STATS 8 }; struct mlx4_en_perf_stats { @@ -139,7 +135,6 @@ struct mlx4_en_perf_stats { u16 tx_coal_avg; u16 rx_coal_avg; u32 napi_quota; -#define NUM_PERF_COUNTERS 6 }; struct mlx4_en_flow_stats { @@ -151,8 +146,6 @@ struct mlx4_en_flow_stats { u64 tx_pause_transition; }; #define MLX4_NUM_PRIORITIES 8 -#define NUM_FLOW_PRIORITY_STATS 6 -#define NUM_FLOW_STATS (NUM_FLOW_PRIORITY_STATS*MLX4_NUM_PRIORITIES) struct mlx4_en_stat_out_flow_control_mbox { @@ -180,6 +173,4 @@ int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, struct mlx4_en_vport_stats *vport_stats, int reset); -#define NUM_ALL_STATS (NUM_PKT_STATS + NUM_FLOW_STATS + NUM_VPORT_STATS + \ - NUM_VF_STATS + NUM_PORT_STATS + NUM_PERF_STATS) #endif Modified: stable/11/sys/ofed/drivers/net/mlx4/port.c ============================================================================== --- stable/11/sys/ofed/drivers/net/mlx4/port.c Mon Aug 7 13:17:57 2017 (r322163) +++ stable/11/sys/ofed/drivers/net/mlx4/port.c Mon Aug 7 13:24:05 2017 (r322164) @@ -982,38 +982,6 @@ int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, return 0; } -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap) -{ - int last_i = 0; - - bitmap_zero(stats_bitmap, NUM_ALL_STATS); - - if (mlx4_is_slave(dev)) { - last_i = dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN ? - NUM_PKT_STATS + NUM_FLOW_STATS : NUM_PKT_STATS; - } else { - bitmap_set(stats_bitmap, last_i, NUM_PKT_STATS); - last_i = NUM_PKT_STATS; - - if (dev->caps.flags2 & - MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) { - bitmap_set(stats_bitmap, last_i, NUM_FLOW_STATS); - last_i += NUM_FLOW_STATS; - } - } - - if (mlx4_is_slave(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VF_STATS); - last_i += NUM_VF_STATS; - - if (mlx4_is_master(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VPORT_STATS); - last_i += NUM_VPORT_STATS; - - bitmap_set(stats_bitmap, last_i, NUM_PORT_STATS); -} -EXPORT_SYMBOL(mlx4_set_stats_bitmap); - int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int *slave_id) { struct mlx4_priv *priv = mlx4_priv(dev); Modified: stable/11/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/11/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:17:57 2017 (r322163) +++ stable/11/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:24:05 2017 (r322164) @@ -1273,7 +1273,6 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port); int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap); int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, From owner-svn-src-stable@freebsd.org Mon Aug 7 13:25:59 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CAF9DD38DC; Mon, 7 Aug 2017 13:25:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 16D456C05D; Mon, 7 Aug 2017 13:25:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77DPwkB007529; Mon, 7 Aug 2017 13:25:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77DPvQU007524; Mon, 7 Aug 2017 13:25:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071325.v77DPvQU007524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322165 - in stable/10/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Commit-Revision: 322165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:25:59 -0000 Author: hselasky Date: Mon Aug 7 13:25:57 2017 New Revision: 322165 URL: https://svnweb.freebsd.org/changeset/base/322165 Log: MFC r321782: Remove some dead statistics related code and a structure field from the mlx4en driver which is used by its Linux counterpart, but not under FreeBSD. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/10/sys/ofed/drivers/net/mlx4/mlx4_stats.h stable/10/sys/ofed/drivers/net/mlx4/port.c stable/10/sys/ofed/include/linux/mlx4/device.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Aug 7 13:24:05 2017 (r322164) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Aug 7 13:25:57 2017 (r322165) @@ -1378,8 +1378,6 @@ int mlx4_en_start_port(struct net_device *dev) /* Schedule multicast task to populate multicast list */ queue_work(mdev->workqueue, &priv->rx_mode_task); - mlx4_set_stats_bitmap(mdev->dev, priv->stats_bitmap); - priv->port_up = true; /* Enable the queues. */ @@ -2730,28 +2728,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", CTLFLAG_RD, &priv->pkstats.rx_gt_1548_bytes_packets, "RX Greater Then 1548 bytes Packets"); - -struct mlx4_en_pkt_stats { - unsigned long tx_packets; - unsigned long tx_bytes; - unsigned long tx_multicast_packets; - unsigned long tx_broadcast_packets; - unsigned long tx_errors; - unsigned long tx_dropped; - unsigned long tx_lt_64_bytes_packets; - unsigned long tx_127_bytes_packets; - unsigned long tx_255_bytes_packets; - unsigned long tx_511_bytes_packets; - unsigned long tx_1023_bytes_packets; - unsigned long tx_1518_bytes_packets; - unsigned long tx_1522_bytes_packets; - unsigned long tx_1548_bytes_packets; - unsigned long tx_gt_1548_bytes_packets; - unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; - unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 -}; - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &priv->pkstats.tx_packets, "TX packets"); Modified: stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h Mon Aug 7 13:24:05 2017 (r322164) +++ stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h Mon Aug 7 13:25:57 2017 (r322165) @@ -571,7 +571,6 @@ struct mlx4_en_priv { struct mlx4_en_port_stats port_stats; struct mlx4_en_vport_stats vport_stats; struct mlx4_en_vf_stats vf_stats; - DECLARE_BITMAP(stats_bitmap, NUM_ALL_STATS); struct list_head mc_list; struct list_head curr_list; u64 broadcast_id; Modified: stable/10/sys/ofed/drivers/net/mlx4/mlx4_stats.h ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/mlx4_stats.h Mon Aug 7 13:24:05 2017 (r322164) +++ stable/10/sys/ofed/drivers/net/mlx4/mlx4_stats.h Mon Aug 7 13:25:57 2017 (r322165) @@ -82,7 +82,6 @@ struct mlx4_en_pkt_stats { unsigned long tx_gt_1548_bytes_packets; unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 }; struct mlx4_en_vf_stats { @@ -97,7 +96,6 @@ struct mlx4_en_vf_stats { unsigned long tx_multicast_packets; unsigned long tx_broadcast_packets; unsigned long tx_errors; -#define NUM_VF_STATS 11 }; struct mlx4_en_vport_stats { @@ -116,7 +114,6 @@ struct mlx4_en_vport_stats { unsigned long tx_broadcast_packets; unsigned long tx_broadcast_bytes; unsigned long tx_errors; -#define NUM_VPORT_STATS 15 }; struct mlx4_en_port_stats { @@ -129,7 +126,6 @@ struct mlx4_en_port_stats { unsigned long rx_chksum_good; unsigned long rx_chksum_none; unsigned long tx_chksum_offload; -#define NUM_PORT_STATS 8 }; struct mlx4_en_perf_stats { @@ -139,7 +135,6 @@ struct mlx4_en_perf_stats { u16 tx_coal_avg; u16 rx_coal_avg; u32 napi_quota; -#define NUM_PERF_COUNTERS 6 }; struct mlx4_en_flow_stats { @@ -151,8 +146,6 @@ struct mlx4_en_flow_stats { u64 tx_pause_transition; }; #define MLX4_NUM_PRIORITIES 8 -#define NUM_FLOW_PRIORITY_STATS 6 -#define NUM_FLOW_STATS (NUM_FLOW_PRIORITY_STATS*MLX4_NUM_PRIORITIES) struct mlx4_en_stat_out_flow_control_mbox { @@ -180,6 +173,4 @@ int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, struct mlx4_en_vport_stats *vport_stats, int reset); -#define NUM_ALL_STATS (NUM_PKT_STATS + NUM_FLOW_STATS + NUM_VPORT_STATS + \ - NUM_VF_STATS + NUM_PORT_STATS + NUM_PERF_STATS) #endif Modified: stable/10/sys/ofed/drivers/net/mlx4/port.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/port.c Mon Aug 7 13:24:05 2017 (r322164) +++ stable/10/sys/ofed/drivers/net/mlx4/port.c Mon Aug 7 13:25:57 2017 (r322165) @@ -980,38 +980,6 @@ int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, return 0; } -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap) -{ - int last_i = 0; - - bitmap_zero(stats_bitmap, NUM_ALL_STATS); - - if (mlx4_is_slave(dev)) { - last_i = dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN ? - NUM_PKT_STATS + NUM_FLOW_STATS : NUM_PKT_STATS; - } else { - bitmap_set(stats_bitmap, last_i, NUM_PKT_STATS); - last_i = NUM_PKT_STATS; - - if (dev->caps.flags2 & - MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) { - bitmap_set(stats_bitmap, last_i, NUM_FLOW_STATS); - last_i += NUM_FLOW_STATS; - } - } - - if (mlx4_is_slave(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VF_STATS); - last_i += NUM_VF_STATS; - - if (mlx4_is_master(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VPORT_STATS); - last_i += NUM_VPORT_STATS; - - bitmap_set(stats_bitmap, last_i, NUM_PORT_STATS); -} -EXPORT_SYMBOL(mlx4_set_stats_bitmap); - int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int *slave_id) { struct mlx4_priv *priv = mlx4_priv(dev); Modified: stable/10/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/10/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:24:05 2017 (r322164) +++ stable/10/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:25:57 2017 (r322165) @@ -1273,7 +1273,6 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port); int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap); int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, From owner-svn-src-stable@freebsd.org Mon Aug 7 13:27:37 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0C06DD3A7B; Mon, 7 Aug 2017 13:27:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7C31A6C230; Mon, 7 Aug 2017 13:27:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77DRaIp007687; Mon, 7 Aug 2017 13:27:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77DRata007682; Mon, 7 Aug 2017 13:27:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708071327.v77DRata007682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Aug 2017 13:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r322166 - in stable/9/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/9/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Commit-Revision: 322166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 13:27:37 -0000 Author: hselasky Date: Mon Aug 7 13:27:35 2017 New Revision: 322166 URL: https://svnweb.freebsd.org/changeset/base/322166 Log: MFC r321782: Remove some dead statistics related code and a structure field from the mlx4en driver which is used by its Linux counterpart, but not under FreeBSD. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/9/sys/ofed/drivers/net/mlx4/mlx4_stats.h stable/9/sys/ofed/drivers/net/mlx4/port.c stable/9/sys/ofed/include/linux/mlx4/device.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Aug 7 13:25:57 2017 (r322165) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Aug 7 13:27:35 2017 (r322166) @@ -1378,8 +1378,6 @@ int mlx4_en_start_port(struct net_device *dev) /* Schedule multicast task to populate multicast list */ queue_work(mdev->workqueue, &priv->rx_mode_task); - mlx4_set_stats_bitmap(mdev->dev, priv->stats_bitmap); - priv->port_up = true; /* Enable the queues. */ @@ -2731,28 +2729,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", CTLFLAG_RD, &priv->pkstats.rx_gt_1548_bytes_packets, "RX Greater Then 1548 bytes Packets"); - -struct mlx4_en_pkt_stats { - unsigned long tx_packets; - unsigned long tx_bytes; - unsigned long tx_multicast_packets; - unsigned long tx_broadcast_packets; - unsigned long tx_errors; - unsigned long tx_dropped; - unsigned long tx_lt_64_bytes_packets; - unsigned long tx_127_bytes_packets; - unsigned long tx_255_bytes_packets; - unsigned long tx_511_bytes_packets; - unsigned long tx_1023_bytes_packets; - unsigned long tx_1518_bytes_packets; - unsigned long tx_1522_bytes_packets; - unsigned long tx_1548_bytes_packets; - unsigned long tx_gt_1548_bytes_packets; - unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; - unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 -}; - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &priv->pkstats.tx_packets, "TX packets"); Modified: stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h Mon Aug 7 13:25:57 2017 (r322165) +++ stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h Mon Aug 7 13:27:35 2017 (r322166) @@ -571,7 +571,6 @@ struct mlx4_en_priv { struct mlx4_en_port_stats port_stats; struct mlx4_en_vport_stats vport_stats; struct mlx4_en_vf_stats vf_stats; - DECLARE_BITMAP(stats_bitmap, NUM_ALL_STATS); struct list_head mc_list; struct list_head curr_list; u64 broadcast_id; Modified: stable/9/sys/ofed/drivers/net/mlx4/mlx4_stats.h ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/mlx4_stats.h Mon Aug 7 13:25:57 2017 (r322165) +++ stable/9/sys/ofed/drivers/net/mlx4/mlx4_stats.h Mon Aug 7 13:27:35 2017 (r322166) @@ -82,7 +82,6 @@ struct mlx4_en_pkt_stats { unsigned long tx_gt_1548_bytes_packets; unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 }; struct mlx4_en_vf_stats { @@ -97,7 +96,6 @@ struct mlx4_en_vf_stats { unsigned long tx_multicast_packets; unsigned long tx_broadcast_packets; unsigned long tx_errors; -#define NUM_VF_STATS 11 }; struct mlx4_en_vport_stats { @@ -116,7 +114,6 @@ struct mlx4_en_vport_stats { unsigned long tx_broadcast_packets; unsigned long tx_broadcast_bytes; unsigned long tx_errors; -#define NUM_VPORT_STATS 15 }; struct mlx4_en_port_stats { @@ -129,7 +126,6 @@ struct mlx4_en_port_stats { unsigned long rx_chksum_good; unsigned long rx_chksum_none; unsigned long tx_chksum_offload; -#define NUM_PORT_STATS 8 }; struct mlx4_en_perf_stats { @@ -139,7 +135,6 @@ struct mlx4_en_perf_stats { u16 tx_coal_avg; u16 rx_coal_avg; u32 napi_quota; -#define NUM_PERF_COUNTERS 6 }; struct mlx4_en_flow_stats { @@ -151,8 +146,6 @@ struct mlx4_en_flow_stats { u64 tx_pause_transition; }; #define MLX4_NUM_PRIORITIES 8 -#define NUM_FLOW_PRIORITY_STATS 6 -#define NUM_FLOW_STATS (NUM_FLOW_PRIORITY_STATS*MLX4_NUM_PRIORITIES) struct mlx4_en_stat_out_flow_control_mbox { @@ -180,6 +173,4 @@ int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, struct mlx4_en_vport_stats *vport_stats, int reset); -#define NUM_ALL_STATS (NUM_PKT_STATS + NUM_FLOW_STATS + NUM_VPORT_STATS + \ - NUM_VF_STATS + NUM_PORT_STATS + NUM_PERF_STATS) #endif Modified: stable/9/sys/ofed/drivers/net/mlx4/port.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/port.c Mon Aug 7 13:25:57 2017 (r322165) +++ stable/9/sys/ofed/drivers/net/mlx4/port.c Mon Aug 7 13:27:35 2017 (r322166) @@ -980,38 +980,6 @@ int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, return 0; } -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap) -{ - int last_i = 0; - - bitmap_zero(stats_bitmap, NUM_ALL_STATS); - - if (mlx4_is_slave(dev)) { - last_i = dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN ? - NUM_PKT_STATS + NUM_FLOW_STATS : NUM_PKT_STATS; - } else { - bitmap_set(stats_bitmap, last_i, NUM_PKT_STATS); - last_i = NUM_PKT_STATS; - - if (dev->caps.flags2 & - MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) { - bitmap_set(stats_bitmap, last_i, NUM_FLOW_STATS); - last_i += NUM_FLOW_STATS; - } - } - - if (mlx4_is_slave(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VF_STATS); - last_i += NUM_VF_STATS; - - if (mlx4_is_master(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VPORT_STATS); - last_i += NUM_VPORT_STATS; - - bitmap_set(stats_bitmap, last_i, NUM_PORT_STATS); -} -EXPORT_SYMBOL(mlx4_set_stats_bitmap); - int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int *slave_id) { struct mlx4_priv *priv = mlx4_priv(dev); Modified: stable/9/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/9/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:25:57 2017 (r322165) +++ stable/9/sys/ofed/include/linux/mlx4/device.h Mon Aug 7 13:27:35 2017 (r322166) @@ -1273,7 +1273,6 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port); int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap); int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, From owner-svn-src-stable@freebsd.org Mon Aug 7 17:23:46 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78047DBC77F; Mon, 7 Aug 2017 17:23:46 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 1B234759C5; Mon, 7 Aug 2017 17:23:46 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77HNjFu005378; Mon, 7 Aug 2017 17:23:45 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77HNihZ005373; Mon, 7 Aug 2017 17:23:44 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201708071723.v77HNihZ005373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Mon, 7 Aug 2017 17:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322172 - in stable/11: contrib/libxo contrib/libxo/doc contrib/libxo/encoder/cbor contrib/libxo/encoder/test contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved... X-SVN-Group: stable-11 X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in stable/11: contrib/libxo contrib/libxo/doc contrib/libxo/encoder/cbor contrib/libxo/encoder/test contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/tests/gett... X-SVN-Commit-Revision: 322172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 17:23:46 -0000 Author: phil Date: Mon Aug 7 17:23:44 2017 New Revision: 322172 URL: https://svnweb.freebsd.org/changeset/base/322172 Log: Import libxo-0.8.4 from HEAD into stable/11 Submitted by: phil Added: stable/11/contrib/libxo/libxo/xo_options.7 - copied, changed from r318364, head/contrib/libxo/libxo/xo_options.7 Modified: stable/11/contrib/libxo/Makefile.am stable/11/contrib/libxo/configure.ac stable/11/contrib/libxo/doc/Makefile.am stable/11/contrib/libxo/doc/libxo-manual.html stable/11/contrib/libxo/doc/libxo.txt stable/11/contrib/libxo/encoder/cbor/enc_cbor.c stable/11/contrib/libxo/encoder/test/enc_test.c stable/11/contrib/libxo/libxo/Makefile.am stable/11/contrib/libxo/libxo/libxo.3 stable/11/contrib/libxo/libxo/libxo.c stable/11/contrib/libxo/libxo/xo.h stable/11/contrib/libxo/libxo/xo_attr.3 stable/11/contrib/libxo/libxo/xo_buf.h stable/11/contrib/libxo/libxo/xo_create.3 stable/11/contrib/libxo/libxo/xo_emit.3 stable/11/contrib/libxo/libxo/xo_emit_err.3 stable/11/contrib/libxo/libxo/xo_emit_f.3 stable/11/contrib/libxo/libxo/xo_encoder.c stable/11/contrib/libxo/libxo/xo_encoder.h stable/11/contrib/libxo/libxo/xo_err.3 stable/11/contrib/libxo/libxo/xo_error.3 stable/11/contrib/libxo/libxo/xo_finish.3 stable/11/contrib/libxo/libxo/xo_flush.3 stable/11/contrib/libxo/libxo/xo_format.5 stable/11/contrib/libxo/libxo/xo_message.3 stable/11/contrib/libxo/libxo/xo_no_setlocale.3 stable/11/contrib/libxo/libxo/xo_open_container.3 stable/11/contrib/libxo/libxo/xo_open_list.3 stable/11/contrib/libxo/libxo/xo_open_marker.3 stable/11/contrib/libxo/libxo/xo_parse_args.3 stable/11/contrib/libxo/libxo/xo_set_allocator.3 stable/11/contrib/libxo/libxo/xo_set_flags.3 stable/11/contrib/libxo/libxo/xo_set_info.3 stable/11/contrib/libxo/libxo/xo_set_options.3 stable/11/contrib/libxo/libxo/xo_set_style.3 stable/11/contrib/libxo/libxo/xo_set_syslog_enterprise_id.3 stable/11/contrib/libxo/libxo/xo_set_version.3 stable/11/contrib/libxo/libxo/xo_set_writer.3 stable/11/contrib/libxo/libxo/xo_syslog.3 stable/11/contrib/libxo/libxo/xo_syslog.c stable/11/contrib/libxo/tests/core/Makefile.am stable/11/contrib/libxo/tests/core/saved/test_01.E.out stable/11/contrib/libxo/tests/core/saved/test_01.H.out stable/11/contrib/libxo/tests/core/saved/test_01.HIPx.out stable/11/contrib/libxo/tests/core/saved/test_01.HP.out stable/11/contrib/libxo/tests/core/saved/test_01.J.out stable/11/contrib/libxo/tests/core/saved/test_01.JP.out stable/11/contrib/libxo/tests/core/saved/test_01.T.out stable/11/contrib/libxo/tests/core/saved/test_01.X.out stable/11/contrib/libxo/tests/core/saved/test_01.XP.out stable/11/contrib/libxo/tests/core/saved/test_02.E.out stable/11/contrib/libxo/tests/core/saved/test_02.J.out stable/11/contrib/libxo/tests/core/saved/test_02.JP.out stable/11/contrib/libxo/tests/core/saved/test_02.X.out stable/11/contrib/libxo/tests/core/saved/test_02.XP.out stable/11/contrib/libxo/tests/core/saved/test_03.E.out stable/11/contrib/libxo/tests/core/saved/test_04.E.out stable/11/contrib/libxo/tests/core/saved/test_05.E.out stable/11/contrib/libxo/tests/core/saved/test_06.E.out stable/11/contrib/libxo/tests/core/saved/test_07.E.out stable/11/contrib/libxo/tests/core/saved/test_08.E.out stable/11/contrib/libxo/tests/core/saved/test_09.E.out stable/11/contrib/libxo/tests/core/saved/test_10.E.out stable/11/contrib/libxo/tests/core/saved/test_10.X.out stable/11/contrib/libxo/tests/core/saved/test_10.XP.out stable/11/contrib/libxo/tests/core/saved/test_11.E.out stable/11/contrib/libxo/tests/core/saved/test_11.HIPx.out stable/11/contrib/libxo/tests/core/saved/test_11.X.out stable/11/contrib/libxo/tests/core/saved/test_11.XP.out stable/11/contrib/libxo/tests/core/saved/test_12.E.out stable/11/contrib/libxo/tests/core/saved/test_12.H.out stable/11/contrib/libxo/tests/core/saved/test_12.HIPx.out stable/11/contrib/libxo/tests/core/saved/test_12.HP.out stable/11/contrib/libxo/tests/core/saved/test_12.J.out stable/11/contrib/libxo/tests/core/saved/test_12.JP.out stable/11/contrib/libxo/tests/core/saved/test_12.T.out stable/11/contrib/libxo/tests/core/saved/test_12.X.out stable/11/contrib/libxo/tests/core/saved/test_12.XP.out stable/11/contrib/libxo/tests/core/test_01.c stable/11/contrib/libxo/tests/core/test_12.c stable/11/contrib/libxo/tests/gettext/Makefile.am stable/11/contrib/libxo/tests/gettext/saved/gt_01.J.out stable/11/contrib/libxo/tests/gettext/saved/gt_01.JP.out stable/11/contrib/libxo/tests/xo/Makefile.am stable/11/contrib/libxo/tests/xo/saved/xo_01.H.out stable/11/contrib/libxo/tests/xo/saved/xo_01.HIPx.out stable/11/contrib/libxo/tests/xo/saved/xo_01.HP.out stable/11/contrib/libxo/tests/xo/saved/xo_01.J.out stable/11/contrib/libxo/tests/xo/saved/xo_01.JP.out stable/11/contrib/libxo/tests/xo/saved/xo_01.T.out stable/11/contrib/libxo/tests/xo/saved/xo_01.X.out stable/11/contrib/libxo/tests/xo/saved/xo_01.XP.out stable/11/contrib/libxo/tests/xo/xo_01.sh stable/11/contrib/libxo/xo/xo.1 stable/11/contrib/libxo/xo/xo.c stable/11/contrib/libxo/xohtml/xohtml.1 stable/11/contrib/libxo/xohtml/xohtml.css stable/11/contrib/libxo/xohtml/xohtml.sh.in stable/11/contrib/libxo/xolint/xolint.1 stable/11/contrib/libxo/xopo/xopo.1 stable/11/contrib/libxo/xopo/xopo.c stable/11/lib/libxo/Makefile stable/11/lib/libxo/add.man stable/11/lib/libxo/tests/functional_test.sh stable/11/lib/libxo/xo_config.h stable/11/usr.bin/xo/Makefile stable/11/usr.bin/xo/tests/functional_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libxo/Makefile.am ============================================================================== --- stable/11/contrib/libxo/Makefile.am Mon Aug 7 17:23:10 2017 (r322171) +++ stable/11/contrib/libxo/Makefile.am Mon Aug 7 17:23:44 2017 (r322172) @@ -38,7 +38,14 @@ GH_PAGES_DIR = gh-pages/ GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz -upload: dist upload-docs +XOHTML_FILES = \ + ${top_srcdir}/xohtml/xohtml.css \ + ${top_srcdir}/xohtml/xohtml.js \ + ${top_srcdir}/xohtml/external/jquery.js \ + ${top_srcdir}/xohtml/external/jquery.qtip.css \ + ${top_srcdir}/xohtml/external/jquery.qtip.js + +upload: dist upload-docs upload-xohtml-files @echo "Remember to run:" @echo " gt tag ${PACKAGE_VERSION}" @@ -56,6 +63,18 @@ upload-docs: docs libxo-manual.html ${PACKAGE_VERSION} \ && git push origin gh-pages ) ; true +upload-xohtml-files: + @echo "Uploading xohtml files ... " + @-[ -d ${GH_PAGES_DIR} ] \ + && echo "Updating xohtml files on gh-pages ..." \ + && mkdir -p ${GH_PAGES_DIR_VER}/xohtml \ + && cp ${XOHTML_FILES} ${GH_PAGES_DIR_VER}/xohtml \ + && (cd ${GH_PAGES_DIR} \ + && git add ${PACKAGE_VERSION}/xohtml \ + && git commit -m 'new xohtml files' \ + ${PACKAGE_VERSION}/xohtml \ + && git push origin gh-pages ) ; true + pkgconfigdir=$(libdir)/pkgconfig pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc @@ -100,4 +119,25 @@ ANALYZE_DIR = ~/trash/libxo ANALYZE_CMD = scan-build-mp-3.6 analyze: + ${MAKE} clean ${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE} + +SANIFLAGS=-fno-omit-frame-pointer -g -O2 + +sanitize-address: + ${MAKE} clean + ${MAKE} CFLAGS="-fsanitize=address ${SANIFLAGS}" + ${MAKE} install + ${MAKE} test + +sanitize-undefined: + ${MAKE} clean + ${MAKE} CFLAGS="-fsanitize=undefined ${SANIFLAGS}" + ${MAKE} install + ${MAKE} test + +sanitize-memory: + ${MAKE} clean + ${MAKE} CFLAGS="-fsanitize=memory ${SANIFLAGS}" + ${MAKE} install + ${MAKE} test Modified: stable/11/contrib/libxo/configure.ac ============================================================================== --- stable/11/contrib/libxo/configure.ac Mon Aug 7 17:23:10 2017 (r322171) +++ stable/11/contrib/libxo/configure.ac Mon Aug 7 17:23:44 2017 (r322172) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.6.3], [phil@juniper.net]) +AC_INIT([libxo], [0.8.4], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. @@ -20,7 +20,6 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portabili m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC -AM_PROG_AR AC_PROG_INSTALL AC_CONFIG_MACRO_DIR([m4]) AC_PROG_LN_S @@ -135,6 +134,21 @@ if test "$GETTEXT_ENABLE" != "no"; then AC_MSG_RESULT([$HAVE_GETTEXT]) fi + + if test "$HAVE_GETTEXT" != "yes"; then + GETTEXT_PREFIX=/usr/local + AC_MSG_CHECKING([gettext in ${GETTEXT_PREFIX}]) + + _save_cflags="$CFLAGS" + CFLAGS="$CFLAGS -I${GETTEXT_PREFIX}/include -L${GETTEXT_PREFIX}/lib -Werror -lintl" + AC_LINK_IFELSE([AC_LANG_SOURCE([[#include ] + [int main() {char *cp = dgettext(NULL, "xx"); return 0; }]])], + [HAVE_GETTEXT=yes], + [HAVE_GETTEXT=no]) + CFLAGS="$_save_cflags" + + AC_MSG_RESULT([$HAVE_GETTEXT]) + fi fi if test "$HAVE_GETTEXT" = "yes"; then @@ -277,6 +291,13 @@ AC_ARG_ENABLE([debug], [LIBXO_DEBUG=no]) AC_MSG_RESULT([$LIBXO_DEBUG]) AM_CONDITIONAL([LIBXO_DEBUG], [test "$LIBXO_DEBUG" != "no"]) + +AC_MSG_CHECKING([whether to use int return codes]) +AC_ARG_ENABLE([int-return-codes], + [ --enable-int-return-codes Use int return codes (instead of ssize_t)], + [USE_INT_RETURN_CODES=yes; AC_DEFINE([USE_INT_RETURN_CODES], [1], [Use int return codes])], + [USE_INT_RETURN_CODES=no]) +AC_MSG_RESULT([$USE_INT_RETURN_CODES]) AC_MSG_CHECKING([whether to build with text-only rendering]) AC_ARG_ENABLE([text-only], Modified: stable/11/contrib/libxo/doc/Makefile.am ============================================================================== --- stable/11/contrib/libxo/doc/Makefile.am Mon Aug 7 17:23:10 2017 (r322171) +++ stable/11/contrib/libxo/doc/Makefile.am Mon Aug 7 17:23:44 2017 (r322172) @@ -61,9 +61,9 @@ xolint.txt: ${top_srcdir}/xolint/xolint.pl CLEANFILES = \ xolint.txt \ ${INPUT}.xml \ -${INPUT}.txt \ ${INPUT}.fxml \ -${INPUT}.html +${OUTPUT}.txt \ +${OUTPUT}.html else doc docs: @${ECHO} "The 'oxtradoc' tool is not installed; see libslax.org" Modified: stable/11/contrib/libxo/doc/libxo-manual.html ============================================================================== --- stable/11/contrib/libxo/doc/libxo-manual.html Mon Aug 7 17:23:10 2017 (r322171) +++ stable/11/contrib/libxo/doc/libxo-manual.html Mon Aug 7 17:23:44 2017 (r322172) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "May 2016"; + content: "August 2017"; } @top-center { @@ -21983,15 +21983,17 @@ jQuery(function ($) { - - - - - - - - - + + + + + + + + + + + @@ -22009,7 +22011,7 @@ jQuery(function ($) { -May 28, 2016 +August 3, 2017

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

@@ -22018,394 +22020,413 @@ jQuery(function ($) {
  • 1   
    -Overview
    • -
      1.1   
      -Getting libxo
    • -
      2   
      +
      3   
      Formatting with libxo +
    • +
    • +
      4   
      +Command-line Arguments
    • -
      3   
      +
      5   
      The libxo API
      • -
        3.1   
        +
        5.1   
        Handles
      • -
        4   
        +
        6   
        The "xo" Utility
      • -
        5   
        +
        7   
        xolint
      • -
        6   
        +
        8   
        xohtml
      • -
        7   
        +
        9   
        xopo
      • -
        8   
        +
        10   
        FAQs
      • -
        9   
        +
        11   
        Howtos: Focused Directions
      • -
        10   
        +
        12   
        Examples
      • @@ -22638,14 +22659,31 @@ jQuery(function ($) { Overview

        libxo - A Library for Generating Text, XML, JSON, and HTML Output

        -

        You want to prepare for the future, but you need to live in the present. You'd love a flying car, but need to get to work today. You want to support features like XML, JSON, and HTML rendering to allow integration with NETCONF, REST, and web browsers, but you need to make text output for command line users. And you don't want multiple code paths that can't help but get out of sync. None of this "if (xml) {... } else {...}" logic. And ifdefs are right out. But you'd really, really like all the fancy features that modern encoding formats can provide. libxo can help.

        -

        The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced. The application calls a function "xo_emit" to product output that is described in a format string. A "field descriptor" tells libxo what the field is and what it means. Each field descriptor is placed in braces with a printf-like format string (Section 2.2):

        +

        You want to prepare for the future, but you need to live in the present. You'd love a flying car, but need to get to work today. You want to support features like XML, JSON, and HTML rendering to allow integration with NETCONF, REST, and web browsers, but you need to make text output for command line users.

        +

        And you don't want multiple code paths that can't help but get out of sync:

        +    /* None of this "if (xml) {... } else {...}"  logic */
        +    if (xml) {
        +        /* some code to make xml*/
        +    } else {
        +        /* other code to make text */
        +        /* oops forgot to add something on both clauses! */
        +    }
        +
        +    /* And ifdefs are right out. */
        +    #ifdef MAKE_XML
        +        /* icky */
        +    #else
        +        /* pooh */
        +    #endif
        +	    

        But you'd really, really like all the fancy features that modern encoding formats can provide. libxo can help.

        +

        The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced. The application calls a function "xo_emit" to product output that is described in a format string. A "field descriptor" tells libxo what the field is and what it means. Each field descriptor is placed in braces with a printf-like format string (Section 3.2):

        +
             xo_emit(" {:lines/%7ju} {:words/%7ju} "
                     "{:characters/%7ju} {d:filename/%s}\n",
                     linect, wordct, charct, file);
        -	    

        Each field can have a role, with the 'value' role being the default, and the role tells libxo how and when to render that field. Output can then be generated in various style, using the "‑‑libxo" option:

        -
        +	    

        Each field can have a role, with the 'value' role being the default, and the role tells libxo how and when to render that field (see Section 3.2.1 for details). Modifiers change how the field is rendered in different output styles (see Section 3.2.2 for details. Output can then be generated in various style, using the "‑‑libxo" option:

        +
             % wc /etc/motd
                   25     165    1140 /etc/motd
        
        *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 17:28:37 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19BF6DBCBE4;
         Mon,  7 Aug 2017 17:28:37 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 DAC3A75C20;
         Mon,  7 Aug 2017 17:28:36 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77HSafH005598;
         Mon, 7 Aug 2017 17:28:36 GMT (envelope-from markj@FreeBSD.org)
        Received: (from markj@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77HSaIn005597;
         Mon, 7 Aug 2017 17:28:36 GMT (envelope-from markj@FreeBSD.org)
        Message-Id: <201708071728.v77HSaIn005597@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: markj set sender to
         markj@FreeBSD.org using -f
        From: Mark Johnston 
        Date: Mon, 7 Aug 2017 17:28:36 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322173 - stable/11/sys/kern
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: markj
        X-SVN-Commit-Paths: stable/11/sys/kern
        X-SVN-Commit-Revision: 322173
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 17:28:37 -0000
        
        Author: markj
        Date: Mon Aug  7 17:28:35 2017
        New Revision: 322173
        URL: https://svnweb.freebsd.org/changeset/base/322173
        
        Log:
          MFC r321744:
          Correct the predicates on which lockstat:::{thread,spin}-spin fire.
        
        Modified:
          stable/11/sys/kern/kern_mutex.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/kern/kern_mutex.c
        ==============================================================================
        --- stable/11/sys/kern/kern_mutex.c	Mon Aug  7 17:23:44 2017	(r322172)
        +++ stable/11/sys/kern/kern_mutex.c	Mon Aug  7 17:28:35 2017	(r322173)
        @@ -766,7 +766,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t
         	LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m,
         	    contested, waittime, file, line);
         #ifdef KDTRACE_HOOKS
        -	if (spin_time != 0)
        +	if (lda.spin_cnt != 0)
         		LOCKSTAT_RECORD1(spin__spin, m, spin_time);
         #endif
         }
        @@ -879,7 +879,7 @@ retry:
         		LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m,
         		    contested, waittime, file, line);
         #ifdef KDTRACE_HOOKS
        -	if (spin_time != 0)
        +	if (lda.spin_cnt != 0)
         		LOCKSTAT_RECORD1(thread__spin, m, spin_time);
         #endif
         }
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 17:29:49 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C92CDBCD97;
         Mon,  7 Aug 2017 17:29:49 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 6972B75DDF;
         Mon,  7 Aug 2017 17:29:49 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77HTm2t005695;
         Mon, 7 Aug 2017 17:29:48 GMT (envelope-from markj@FreeBSD.org)
        Received: (from markj@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77HTm4e005694;
         Mon, 7 Aug 2017 17:29:48 GMT (envelope-from markj@FreeBSD.org)
        Message-Id: <201708071729.v77HTm4e005694@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: markj set sender to
         markj@FreeBSD.org using -f
        From: Mark Johnston 
        Date: Mon, 7 Aug 2017 17:29:48 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322174 - stable/11/sys/kern
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: markj
        X-SVN-Commit-Paths: stable/11/sys/kern
        X-SVN-Commit-Revision: 322174
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 17:29:49 -0000
        
        Author: markj
        Date: Mon Aug  7 17:29:48 2017
        New Revision: 322174
        URL: https://svnweb.freebsd.org/changeset/base/322174
        
        Log:
          MFC r321805:
          Batch v_wire_count decrements in vm_hold_free_pages().
        
        Modified:
          stable/11/sys/kern/vfs_bio.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/kern/vfs_bio.c
        ==============================================================================
        --- stable/11/sys/kern/vfs_bio.c	Mon Aug  7 17:28:35 2017	(r322173)
        +++ stable/11/sys/kern/vfs_bio.c	Mon Aug  7 17:29:48 2017	(r322174)
        @@ -4507,13 +4507,10 @@ vm_hold_free_pages(struct buf *bp, int newbsize)
         	for (index = newnpages; index < bp->b_npages; index++) {
         		p = bp->b_pages[index];
         		bp->b_pages[index] = NULL;
        -		if (vm_page_sbusied(p))
        -			printf("vm_hold_free_pages: blkno: %jd, lblkno: %jd\n",
        -			    (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno);
         		p->wire_count--;
         		vm_page_free(p);
        -		atomic_subtract_int(&vm_cnt.v_wire_count, 1);
         	}
        +	atomic_subtract_int(&vm_cnt.v_wire_count, bp->b_npages - newnpages);
         	bp->b_npages = newnpages;
         }
         
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 17:30:23 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6375DBCEDC;
         Mon,  7 Aug 2017 17:30:23 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 A4D0876043;
         Mon,  7 Aug 2017 17:30:23 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77HUMal005840;
         Mon, 7 Aug 2017 17:30:22 GMT (envelope-from markj@FreeBSD.org)
        Received: (from markj@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77HUMAq005839;
         Mon, 7 Aug 2017 17:30:22 GMT (envelope-from markj@FreeBSD.org)
        Message-Id: <201708071730.v77HUMAq005839@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: markj set sender to
         markj@FreeBSD.org using -f
        From: Mark Johnston 
        Date: Mon, 7 Aug 2017 17:30:22 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322176 - stable/11/sys/x86/x86
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: markj
        X-SVN-Commit-Paths: stable/11/sys/x86/x86
        X-SVN-Commit-Revision: 322176
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 17:30:23 -0000
        
        Author: markj
        Date: Mon Aug  7 17:30:22 2017
        New Revision: 322176
        URL: https://svnweb.freebsd.org/changeset/base/322176
        
        Log:
          MFC r321803:
          Don't trace running threads that have interrupts disabled.
        
        Modified:
          stable/11/sys/x86/x86/stack_machdep.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/x86/x86/stack_machdep.c
        ==============================================================================
        --- stable/11/sys/x86/x86/stack_machdep.c	Mon Aug  7 17:29:54 2017	(r322175)
        +++ stable/11/sys/x86/x86/stack_machdep.c	Mon Aug  7 17:30:22 2017	(r322176)
        @@ -49,12 +49,14 @@ __FBSDID("$FreeBSD$");
         
         #ifdef __i386__
         #define	PCB_FP(pcb)	((pcb)->pcb_ebp)
        +#define	TF_FLAGS(tf)	((tf)->tf_eflags)
         #define	TF_FP(tf)	((tf)->tf_ebp)
         #define	TF_PC(tf)	((tf)->tf_eip)
         
         typedef struct i386_frame *x86_frame_t;
         #else
         #define	PCB_FP(pcb)	((pcb)->pcb_rbp)
        +#define	TF_FLAGS(tf)	((tf)->tf_rflags)
         #define	TF_FP(tf)	((tf)->tf_rbp)
         #define	TF_PC(tf)	((tf)->tf_rip)
         
        @@ -104,10 +106,10 @@ stack_nmi_handler(struct trapframe *tf)
         	if (nmi_stack == NULL || curthread != nmi_pending)
         		return (0);
         
        -	if (INKERNEL(TF_PC(tf)))
        +	if (INKERNEL(TF_PC(tf)) && (TF_FLAGS(tf) & PSL_I) != 0)
         		stack_capture(curthread, nmi_stack, TF_FP(tf));
         	else
        -		/* We interrupted a thread in user mode. */
        +		/* We were running in usermode or had interrupts disabled. */
         		nmi_stack->depth = 0;
         
         	atomic_store_rel_ptr((long *)&nmi_pending, (long)NULL);
        @@ -155,7 +157,6 @@ stack_save_td_running(struct stack *st, struct thread 
         	mtx_unlock_spin(&nmi_lock);
         
         	if (st->depth == 0)
        -		/* We interrupted a thread in user mode. */
         		return (EAGAIN);
         #else /* !SMP */
         	KASSERT(0, ("curthread isn't running"));
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:14 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55581DC44E8;
         Mon,  7 Aug 2017 19:45:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 17C327F761;
         Mon,  7 Aug 2017 19:45:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjDDn064414;
         Mon, 7 Aug 2017 19:45:13 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjDaS064413;
         Mon, 7 Aug 2017 19:45:13 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjDaS064413@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:13 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322180 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322180
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:14 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:13 2017
        New Revision: 322180
        URL: https://svnweb.freebsd.org/changeset/base/322180
        
        Log:
          Document r321304, libarchive 3.3.2.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:40:03 2017	(r322179)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:13 2017	(r322180)
        @@ -214,9 +214,6 @@
               &man.zlib.3; has been updated to version
         	1.2.11.
         
        -      &man.libarchive.3; has been updated to
        -	version 3.3.1.
        -
               &man.ntpd.8; has been updated to version
         	4.2.8p10.
         
        @@ -225,6 +222,9 @@
         
               &man.tcsh.1; has been updated to version
         	6.20.00.
        +
        +      &man.libarchive.3; has been updated to
        +	version 3.3.2.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:24 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CC1DDC4551;
         Mon,  7 Aug 2017 19:45:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 471CE7F7DF;
         Mon,  7 Aug 2017 19:45:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjNtc064508;
         Mon, 7 Aug 2017 19:45:23 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjNcJ064507;
         Mon, 7 Aug 2017 19:45:23 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjNcJ064507@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:23 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322181 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322181
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:24 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:23 2017
        New Revision: 322181
        URL: https://svnweb.freebsd.org/changeset/base/322181
        
        Log:
          Document r321263, newsyslog(8) RFC5424 logging format.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:13 2017	(r322180)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:23 2017	(r322181)
        @@ -178,6 +178,12 @@
         	&man.src.conf.5; knob has been added, which when enabled
         	allows building &man.rpcbind.8; with
         	warmstart support.
        +
        +      The &man.newsyslog.8; utility has been
        +	updated to support logging to &man.syslogd.8; in a format
        +	compliant with RFC5424.  For more details, see the description
        +	for the T flag in
        +	&man.newsyslog.conf.5;.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:28 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06289DC4580;
         Mon,  7 Aug 2017 19:45:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 C25F57F82E;
         Mon,  7 Aug 2017 19:45:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjQT7064681;
         Mon, 7 Aug 2017 19:45:26 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjQGN064680;
         Mon, 7 Aug 2017 19:45:26 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjQGN064680@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:26 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322185 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322185
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:28 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:26 2017
        New Revision: 322185
        URL: https://svnweb.freebsd.org/changeset/base/322185
        
        Log:
          Document r321216, savecore(8) unit change.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:25 2017	(r322184)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:26 2017	(r322185)
        @@ -215,6 +215,10 @@
         	compliant with RFC5424.  For more details, see the description
         	for the T flag in
         	&man.newsyslog.conf.5;.
        +
        +      The &man.savecore.8; utility has been
        +	updated to use KiB when outputting
        +	information regarding total space, free space, etc.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:28 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAF21DC458F;
         Mon,  7 Aug 2017 19:45:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 74CF37F840;
         Mon,  7 Aug 2017 19:45:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjRrN064726;
         Mon, 7 Aug 2017 19:45:27 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjRUe064725;
         Mon, 7 Aug 2017 19:45:27 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjRUe064725@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:27 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322186 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322186
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:28 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:27 2017
        New Revision: 322186
        URL: https://svnweb.freebsd.org/changeset/base/322186
        
        Log:
          Document r321202, default EFI partition size increase.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:26 2017	(r322185)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:27 2017	(r322186)
        @@ -255,7 +255,10 @@
             
               Installation and Configuration Tools
         
        -       
        +      The
        +	default EFI partition created by
        +	&man.bsdinstall.8; has been increased from 800KB to
        +	200MB.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:25 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C82DC455C;
         Mon,  7 Aug 2017 19:45:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 4E6B77F7F6;
         Mon,  7 Aug 2017 19:45:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjOW0064551;
         Mon, 7 Aug 2017 19:45:24 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjO5l064550;
         Mon, 7 Aug 2017 19:45:24 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjO5l064550@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:24 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322182 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322182
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:25 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:24 2017
        New Revision: 322182
        URL: https://svnweb.freebsd.org/changeset/base/322182
        
        Log:
          Document r321242, cron(8) 'cron.d' directories.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:23 2017	(r322181)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:24 2017	(r322182)
        @@ -200,6 +200,12 @@
               The &man.cxgbetool.8; utility has been
         	added, providing command-line access to features and debugging
         	facilities of &man.cxgbe.4; devices.
        +
        +      The &man.cron.8; utility has been
        +	updated to add support for including files within /etc/cron.d and /usr/local/etc/cron.d by
        +	default.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:27 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2668FDC4571;
         Mon,  7 Aug 2017 19:45:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 E577C7F81A;
         Mon,  7 Aug 2017 19:45:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjPMT064637;
         Mon, 7 Aug 2017 19:45:25 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjPdp064636;
         Mon, 7 Aug 2017 19:45:25 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjPdp064636@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:25 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322184 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322184
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:27 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:25 2017
        New Revision: 322184
        URL: https://svnweb.freebsd.org/changeset/base/322184
        
        Log:
          Move the r321263 entry to 'userland-programs' for consistency.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:24 2017	(r322183)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:25 2017	(r322184)
        @@ -178,12 +178,6 @@
         	&man.src.conf.5; knob has been added, which when enabled
         	allows building &man.rpcbind.8; with
         	warmstart support.
        -
        -      The &man.newsyslog.8; utility has been
        -	updated to support logging to &man.syslogd.8; in a format
        -	compliant with RFC5424.  For more details, see the description
        -	for the T flag in
        -	&man.newsyslog.conf.5;.
             
         
             
        @@ -215,6 +209,12 @@
         	/etc/syslog.d and
         	/usr/local/etc/syslog.d
         	by default.
        +
        +      The &man.newsyslog.8; utility has been
        +	updated to support logging to &man.syslogd.8; in a format
        +	compliant with RFC5424.  For more details, see the description
        +	for the T flag in
        +	&man.newsyslog.conf.5;.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:32 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE51DC45F5;
         Mon,  7 Aug 2017 19:45:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 ABAAB7F8CE;
         Mon,  7 Aug 2017 19:45:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjVVq064944;
         Mon, 7 Aug 2017 19:45:31 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjVZU064943;
         Mon, 7 Aug 2017 19:45:31 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjVZU064943@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:31 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322191 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322191
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:33 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:31 2017
        New Revision: 322191
        URL: https://svnweb.freebsd.org/changeset/base/322191
        
        Log:
          Document r320824, gdb(1)/kgdb(1) deprecation.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:30 2017	(r322190)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:31 2017	(r322191)
        @@ -201,6 +201,12 @@
         	deprecated, and planned for removal in
         	&os; 12.0-RELEASE.
         
        +      The &man.gdb.1; and &man.kgdb.1;
        +	utilities have been marked as deprecated, and planned for
        +	removal from the base system in the future.  A newer version
        +	is available in the devel/gdb port.
        +
               The &man.cron.8; utility has been
         	updated to add support for including files within /etc/cron.d and 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B75DC45CA;
         Mon,  7 Aug 2017 19:45:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 2C4C57F878;
         Mon,  7 Aug 2017 19:45:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjTKv064813;
         Mon, 7 Aug 2017 19:45:29 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjTjY064812;
         Mon, 7 Aug 2017 19:45:29 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjTjY064812@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:29 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322188 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322188
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:30 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:29 2017
        New Revision: 322188
        URL: https://svnweb.freebsd.org/changeset/base/322188
        
        Log:
          Document r321031, NFS 'pNFS commit' support.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:28 2017	(r322187)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:29 2017	(r322188)
        @@ -462,6 +462,11 @@
         	prevent creating new TCP connections when
         	ERESTART is received from
         	&man.sosend.9;.
        +
        +      The NFS client has
        +	been updated to support pNFS
        +	commit through the
        +	DS.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:31 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 465CBDC45DB;
         Mon,  7 Aug 2017 19:45:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 028677F893;
         Mon,  7 Aug 2017 19:45:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjUGM064857;
         Mon, 7 Aug 2017 19:45:30 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjUgd064856;
         Mon, 7 Aug 2017 19:45:30 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjUgd064856@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:30 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322189 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322189
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:31 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:29 2017
        New Revision: 322189
        URL: https://svnweb.freebsd.org/changeset/base/322189
        
        Log:
          Document r321024, kern.features.linux{,64} addition.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:29 2017	(r322188)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:29 2017	(r322189)
        @@ -339,7 +339,13 @@
             
               System Tuning and Controls
         
        -      
        +      The
        +	kern.features.linux and
        +	kern.features.linux64 flags have been
        +	added to the kern.features &man.sysctl.8;,
        +	which when set to 1, indicate the kernel
        +	is configured with compatibility for 32-bit and/or 64-bit
        +	linux binaries, respectively.
             
           
         
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:29 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89752DC45AD;
         Mon,  7 Aug 2017 19:45:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 52F757F85B;
         Mon,  7 Aug 2017 19:45:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjSMt064770;
         Mon, 7 Aug 2017 19:45:28 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjSw5064769;
         Mon, 7 Aug 2017 19:45:28 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjSw5064769@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:28 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322187 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322187
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:29 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:28 2017
        New Revision: 322187
        URL: https://svnweb.freebsd.org/changeset/base/322187
        
        Log:
          Document r321198, vt(4) maximum framebuffer increase.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:27 2017	(r322186)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:28 2017	(r322187)
        @@ -314,6 +314,13 @@
               tuning, and system control parameters that are not otherwise
               categorized.
         
        +    
        +      Miscellaneous Kernel Changes
        +
        +      The &man.vt.4; driver has been updated,
        +	increasing the maximum framebuffer size.
        +    
        +
             
               Kernel Bug Fixes
         
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:26 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53CAEDC4565;
         Mon,  7 Aug 2017 19:45:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 206447F804;
         Mon,  7 Aug 2017 19:45:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjP4O064594;
         Mon, 7 Aug 2017 19:45:25 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjPRl064593;
         Mon, 7 Aug 2017 19:45:25 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjPRl064593@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:25 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322183 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322183
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:26 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:24 2017
        New Revision: 322183
        URL: https://svnweb.freebsd.org/changeset/base/322183
        
        Log:
          Document r321234, syslogd(8) 'syslogd.d' directories.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:24 2017	(r322182)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:24 2017	(r322183)
        @@ -206,6 +206,15 @@
         	  class="directory">/etc/cron.d and /usr/local/etc/cron.d by
         	default.
        +
        +      The &man.syslogd.8; utility has been
        +	updated to add the include keyword which
        +	allows specifying a directory containing configuration files
        +	to be included in addition to &man.syslog.conf.5;.  The
        +	default &man.syslog.conf.5; has been updated to include
        +	/etc/syslog.d and
        +	/usr/local/etc/syslog.d
        +	by default.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:34 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC44DC4629;
         Mon,  7 Aug 2017 19:45:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 626C27F908;
         Mon,  7 Aug 2017 19:45:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjXIL065030;
         Mon, 7 Aug 2017 19:45:33 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjX2X065029;
         Mon, 7 Aug 2017 19:45:33 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjX2X065029@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:33 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322193 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322193
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:34 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:33 2017
        New Revision: 322193
        URL: https://svnweb.freebsd.org/changeset/base/322193
        
        Log:
          Remove r321216 entry, part of which was reverted.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:32 2017	(r322192)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:33 2017	(r322193)
        @@ -227,10 +227,6 @@
         	compliant with RFC5424.  For more details, see the description
         	for the T flag in
         	&man.newsyslog.conf.5;.
        -
        -      The &man.savecore.8; utility has been
        -	updated to use KiB when outputting
        -	information regarding total space, free space, etc.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:33 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE873DC4612;
         Mon,  7 Aug 2017 19:45:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 9047D7F8EE;
         Mon,  7 Aug 2017 19:45:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjW6O064987;
         Mon, 7 Aug 2017 19:45:32 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjW9E064986;
         Mon, 7 Aug 2017 19:45:32 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjW9E064986@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:32 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322192 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322192
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:34 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:32 2017
        New Revision: 322192
        URL: https://svnweb.freebsd.org/changeset/base/322192
        
        Log:
          Document r321067, arcmsr(4) driver version 1.40.00.00.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:31 2017	(r322191)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:32 2017	(r322192)
        @@ -383,6 +383,10 @@
         	to support tri-mode
         	(SAS/SATA/PCIe)
         	Broadcom® storage adapters.
        +
        +      The &man.arcmsr.4; driver has been
        +	updated to version 1.40.00.00, adding support for ARC-1884
        +	SATA controllers.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 19:45:32 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3519DDC45E5;
         Mon,  7 Aug 2017 19:45:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 ED87F7F8B2;
         Mon,  7 Aug 2017 19:45:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77JjUe8064901;
         Mon, 7 Aug 2017 19:45:30 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77JjUEp064900;
         Mon, 7 Aug 2017 19:45:30 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708071945.v77JjUEp064900@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Mon, 7 Aug 2017 19:45:30 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322190 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322190
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 19:45:32 -0000
        
        Author: gjb
        Date: Mon Aug  7 19:45:30 2017
        New Revision: 322190
        URL: https://svnweb.freebsd.org/changeset/base/322190
        
        Log:
          Document r320646, rcmds deprecation.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:29 2017	(r322189)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Aug  7 19:45:30 2017	(r322190)
        @@ -195,6 +195,12 @@
         	added, providing command-line access to features and debugging
         	facilities of &man.cxgbe.4; devices.
         
        +      The &man.rcp.1;, &man.rlogin.1;,
        +	&man.rsh.1;, &man.ruptime.1;, &man.rwho.1;, &man.rlogind.8;,
        +	&man.rshd.8;, and &man.rwhod.8; utilities have been marked as
        +	deprecated, and planned for removal in
        +	&os; 12.0-RELEASE.
        +
               The &man.cron.8; utility has been
         	updated to add support for including files within /etc/cron.d and 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66D57DCCF43;
         Mon,  7 Aug 2017 22:28:29 +0000 (UTC)
         (envelope-from jkim@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 32F901DE4;
         Mon,  7 Aug 2017 22:28:29 +0000 (UTC)
         (envelope-from jkim@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77MSSq8030617;
         Mon, 7 Aug 2017 22:28:28 GMT (envelope-from jkim@FreeBSD.org)
        Received: (from jkim@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77MSSgh030613;
         Mon, 7 Aug 2017 22:28:28 GMT (envelope-from jkim@FreeBSD.org)
        Message-Id: <201708072228.v77MSSgh030613@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: jkim set sender to
         jkim@FreeBSD.org using -f
        From: Jung-uk Kim 
        Date: Mon, 7 Aug 2017 22:28:28 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322204 - in stable/11/sys: amd64/amd64 i386/i386
         x86/include x86/x86
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: jkim
        X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 x86/include x86/x86
        X-SVN-Commit-Revision: 322204
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 22:28:29 -0000
        
        Author: jkim
        Date: Mon Aug  7 22:28:27 2017
        New Revision: 322204
        URL: https://svnweb.freebsd.org/changeset/base/322204
        
        Log:
          MFC:	r322076
          
          Detect hypervisor early so that we set lower hz on it.
        
        Modified:
          stable/11/sys/amd64/amd64/machdep.c
          stable/11/sys/i386/i386/machdep.c
          stable/11/sys/x86/include/x86_var.h
          stable/11/sys/x86/x86/identcpu.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/amd64/amd64/machdep.c
        ==============================================================================
        --- stable/11/sys/amd64/amd64/machdep.c	Mon Aug  7 21:38:10 2017	(r322203)
        +++ stable/11/sys/amd64/amd64/machdep.c	Mon Aug  7 22:28:27 2017	(r322204)
        @@ -1544,6 +1544,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
         
         	kmdp = init_ops.parse_preload_data(modulep);
         
        +	identify_hypervisor();
        +
         	/* Init basic tunables, hz etc */
         	init_param1();
         
        
        Modified: stable/11/sys/i386/i386/machdep.c
        ==============================================================================
        --- stable/11/sys/i386/i386/machdep.c	Mon Aug  7 21:38:10 2017	(r322203)
        +++ stable/11/sys/i386/i386/machdep.c	Mon Aug  7 22:28:27 2017	(r322204)
        @@ -2472,6 +2472,8 @@ init386(int first)
         	else
         		init_static_kenv(NULL, 0);
         
        +	identify_hypervisor();
        +
         	/* Init basic tunables, hz etc */
         	init_param1();
         
        
        Modified: stable/11/sys/x86/include/x86_var.h
        ==============================================================================
        --- stable/11/sys/x86/include/x86_var.h	Mon Aug  7 21:38:10 2017	(r322203)
        +++ stable/11/sys/x86/include/x86_var.h	Mon Aug  7 22:28:27 2017	(r322204)
        @@ -116,6 +116,7 @@ void	cpu_setregs(void);
         void	dump_add_page(vm_paddr_t);
         void	dump_drop_page(vm_paddr_t);
         void	identify_cpu(void);
        +void	identify_hypervisor(void);
         void	initializecpu(void);
         void	initializecpucache(void);
         bool	fix_cpuid(void);
        
        Modified: stable/11/sys/x86/x86/identcpu.c
        ==============================================================================
        --- stable/11/sys/x86/x86/identcpu.c	Mon Aug  7 21:38:10 2017	(r322203)
        +++ stable/11/sys/x86/x86/identcpu.c	Mon Aug  7 22:28:27 2017	(r322204)
        @@ -1252,7 +1252,7 @@ static const char *const vm_pnames[] = {
         	NULL
         };
         
        -static void
        +void
         identify_hypervisor(void)
         {
         	u_int regs[4];
        @@ -1403,7 +1403,6 @@ identify_cpu(void)
         	cpu_feature2 = regs[2];
         #endif
         
        -	identify_hypervisor();
         	cpu_vendor_id = find_cpu_vendor_id();
         
         	if (fix_cpuid()) {
        
        From owner-svn-src-stable@freebsd.org  Mon Aug  7 22:30:19 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id E064EDCD0A4;
         Mon,  7 Aug 2017 22:30:19 +0000 (UTC)
         (envelope-from jkim@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 B946C1F4B;
         Mon,  7 Aug 2017 22:30:19 +0000 (UTC)
         (envelope-from jkim@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v77MUIBY030743;
         Mon, 7 Aug 2017 22:30:18 GMT (envelope-from jkim@FreeBSD.org)
        Received: (from jkim@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v77MUI3N030738;
         Mon, 7 Aug 2017 22:30:18 GMT (envelope-from jkim@FreeBSD.org)
        Message-Id: <201708072230.v77MUI3N030738@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: jkim set sender to
         jkim@FreeBSD.org using -f
        From: Jung-uk Kim 
        Date: Mon, 7 Aug 2017 22:30:18 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322205 - in stable/10/sys: amd64/amd64 amd64/include
         i386/i386 i386/include x86/x86
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: jkim
        X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 amd64/include i386/i386
         i386/include x86/x86
        X-SVN-Commit-Revision: 322205
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Mon, 07 Aug 2017 22:30:20 -0000
        
        Author: jkim
        Date: Mon Aug  7 22:30:18 2017
        New Revision: 322205
        URL: https://svnweb.freebsd.org/changeset/base/322205
        
        Log:
          MFC:	r322076
          
          Detect hypervisor early so that we set lower hz on it.
          > Description of fields to fill in above:                     76 columns --|
          > PR:                       If and which Problem Report is related.
          > Submitted by:             If someone else sent in the change.
          > Reported by:              If someone else reported the issue.
          > Reviewed by:              If someone else reviewed your modification.
          > Approved by:              If you needed approval for this commit.
          > Obtained from:            If the change is from a third party.
          > MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
          > MFH:                      Ports tree branch name.  Request approval for merge.
          > Relnotes:                 Set to 'yes' for mention in release notes.
          > Security:                 Vulnerability reference (one per line) or description.
          > Sponsored by:             If the change was sponsored by an organization.
          > Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
          > Empty fields above will be automatically removed.
          
          _M   .
          M    sys/amd64/amd64/machdep.c
          M    sys/amd64/include/md_var.h
          M    sys/i386/i386/machdep.c
          M    sys/i386/include/md_var.h
          M    sys/x86/x86/identcpu.c
        
        Modified:
          stable/10/sys/amd64/amd64/machdep.c
          stable/10/sys/amd64/include/md_var.h
          stable/10/sys/i386/i386/machdep.c
          stable/10/sys/i386/include/md_var.h
          stable/10/sys/x86/x86/identcpu.c
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/sys/amd64/amd64/machdep.c
        ==============================================================================
        --- stable/10/sys/amd64/amd64/machdep.c	Mon Aug  7 22:28:27 2017	(r322204)
        +++ stable/10/sys/amd64/amd64/machdep.c	Mon Aug  7 22:30:18 2017	(r322205)
        @@ -1853,6 +1853,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
         	ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t);
         #endif
         
        +	identify_hypervisor();
        +
         	/* Init basic tunables, hz etc */
         	init_param1();
         
        
        Modified: stable/10/sys/amd64/include/md_var.h
        ==============================================================================
        --- stable/10/sys/amd64/include/md_var.h	Mon Aug  7 22:28:27 2017	(r322204)
        +++ stable/10/sys/amd64/include/md_var.h	Mon Aug  7 22:30:18 2017	(r322205)
        @@ -120,6 +120,7 @@ void	gsbase_load_fault(void) __asm(__STRING(gsbase_loa
         void	dump_add_page(vm_paddr_t);
         void	dump_drop_page(vm_paddr_t);
         void	identify_cpu(void);
        +void	identify_hypervisor(void);
         void	initializecpu(void);
         void	initializecpucache(void);
         bool	fix_cpuid(void);
        
        Modified: stable/10/sys/i386/i386/machdep.c
        ==============================================================================
        --- stable/10/sys/i386/i386/machdep.c	Mon Aug  7 22:28:27 2017	(r322204)
        +++ stable/10/sys/i386/i386/machdep.c	Mon Aug  7 22:30:18 2017	(r322205)
        @@ -3195,6 +3195,10 @@ init386(int first)
         	else
         		init_static_kenv(NULL, 0);
         
        +#ifndef XEN
        +	identify_hypervisor();
        +#endif
        +
         	/* Init basic tunables, hz etc */
         	init_param1();
         
        
        Modified: stable/10/sys/i386/include/md_var.h
        ==============================================================================
        --- stable/10/sys/i386/include/md_var.h	Mon Aug  7 22:28:27 2017	(r322204)
        +++ stable/10/sys/i386/include/md_var.h	Mon Aug  7 22:30:18 2017	(r322205)
        @@ -128,6 +128,7 @@ void	dump_drop_page(vm_paddr_t);
         void	finishidentcpu(void);
         void	fillw(int /*u_short*/ pat, void *base, size_t cnt);
         void	fill_based_sd(struct segment_descriptor *sdp, uint32_t base);
        +void	identify_hypervisor(void);
         void	initializecpu(void);
         void	initializecpucache(void);
         bool	fix_cpuid(void);
        
        Modified: stable/10/sys/x86/x86/identcpu.c
        ==============================================================================
        --- stable/10/sys/x86/x86/identcpu.c	Mon Aug  7 22:28:27 2017	(r322204)
        +++ stable/10/sys/x86/x86/identcpu.c	Mon Aug  7 22:30:18 2017	(r322205)
        @@ -1229,7 +1229,7 @@ static const char *const vm_pnames[] = {
         	NULL
         };
         
        -static void
        +void
         identify_hypervisor(void)
         {
         	u_int regs[4];
        @@ -1377,9 +1377,6 @@ identify_cpu(void)
         	cpu_feature2 = regs[2];
         #endif
         
        -#ifndef XEN
        -	identify_hypervisor();
        -#endif
         	cpu_vendor_id = find_cpu_vendor_id();
         
         	if (fix_cpuid()) {
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 05:15:21 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF80DDC22CF;
         Tue,  8 Aug 2017 05:15:21 +0000 (UTC)
         (envelope-from ngie@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 9D8D56F77E;
         Tue,  8 Aug 2017 05:15:21 +0000 (UTC)
         (envelope-from ngie@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v785FKGP097341;
         Tue, 8 Aug 2017 05:15:20 GMT (envelope-from ngie@FreeBSD.org)
        Received: (from ngie@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v785FK1W097339;
         Tue, 8 Aug 2017 05:15:20 GMT (envelope-from ngie@FreeBSD.org)
        Message-Id: <201708080515.v785FK1W097339@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: ngie set sender to
         ngie@FreeBSD.org using -f
        From: Ngie Cooper 
        Date: Tue, 8 Aug 2017 05:15:20 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322215 - in stable/11/tools/tools: bootparttest
         zfsboottest
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: ngie
        X-SVN-Commit-Paths: in stable/11/tools/tools: bootparttest zfsboottest
        X-SVN-Commit-Revision: 322215
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 05:15:21 -0000
        
        Author: ngie
        Date: Tue Aug  8 05:15:20 2017
        New Revision: 322215
        URL: https://svnweb.freebsd.org/changeset/base/322215
        
        Log:
          MFC r321849,r321852:
          
          r321849:
          
          Fix the return type for pager_output(..) in bootparttest and zfsboottest
          
          pager_output(..) has always returned int. For some reason (probably the
          clang 5.0 update), this mismatch now results in an error with CC=clang.
          
          r321852:
          
          Fix up r321849
          
          pager_output should return 0 if no more output needs to be paged; non-zero
          otherwise.
          
          MFC with:	r321849
        
        Modified:
          stable/11/tools/tools/bootparttest/stub.c
          stable/11/tools/tools/zfsboottest/zfsboottest.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/tools/tools/bootparttest/stub.c
        ==============================================================================
        --- stable/11/tools/tools/bootparttest/stub.c	Tue Aug  8 04:59:16 2017	(r322214)
        +++ stable/11/tools/tools/bootparttest/stub.c	Tue Aug  8 05:15:20 2017	(r322215)
        @@ -44,9 +44,10 @@ Free(void *ptr, const char *file, int line)
         	return (free(ptr));
         }
         
        -void
        +int
         pager_output(const char *s)
         {
         
         	printf("%s", s);
        +	return (0);
         }
        
        Modified: stable/11/tools/tools/zfsboottest/zfsboottest.c
        ==============================================================================
        --- stable/11/tools/tools/zfsboottest/zfsboottest.c	Tue Aug  8 04:59:16 2017	(r322214)
        +++ stable/11/tools/tools/zfsboottest/zfsboottest.c	Tue Aug  8 05:15:20 2017	(r322215)
        @@ -43,11 +43,12 @@
         
         #define NBBY 8
         
        -void
        +int
         pager_output(const char *line)
         {
         
         	fprintf(stderr, "%s", line);
        +	return (0);
         }
         
         #define ZFS_TEST
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 05:19:47 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59FCDDC280B;
         Tue,  8 Aug 2017 05:19:47 +0000 (UTC)
         (envelope-from ngie@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 273EF6FAA9;
         Tue,  8 Aug 2017 05:19:47 +0000 (UTC)
         (envelope-from ngie@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v785Jk9h097533;
         Tue, 8 Aug 2017 05:19:46 GMT (envelope-from ngie@FreeBSD.org)
        Received: (from ngie@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v785JkEO097532;
         Tue, 8 Aug 2017 05:19:46 GMT (envelope-from ngie@FreeBSD.org)
        Message-Id: <201708080519.v785JkEO097532@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: ngie set sender to
         ngie@FreeBSD.org using -f
        From: Ngie Cooper 
        Date: Tue, 8 Aug 2017 05:19:46 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322216 - stable/11/sys/boot/geli
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: ngie
        X-SVN-Commit-Paths: stable/11/sys/boot/geli
        X-SVN-Commit-Revision: 322216
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 05:19:47 -0000
        
        Author: ngie
        Date: Tue Aug  8 05:19:45 2017
        New Revision: 322216
        URL: https://svnweb.freebsd.org/changeset/base/322216
        
        Log:
          MFC r321851:
          
          Standardize paths on SRCTOP instead of .CURDIR-relative paths
        
        Modified:
          stable/11/sys/boot/geli/Makefile
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/boot/geli/Makefile
        ==============================================================================
        --- stable/11/sys/boot/geli/Makefile	Tue Aug  8 05:15:20 2017	(r322215)
        +++ stable/11/sys/boot/geli/Makefile	Tue Aug  8 05:19:45 2017	(r322216)
        @@ -28,23 +28,23 @@ SRCS+=  bcmp.c bcopy.c bzero.c
         SRCS+=  pwgets.c
         
         # sha256 and sha512 from sys/crypto
        -.PATH: ${.CURDIR}/../../crypto/sha2
        +.PATH: ${SRCTOP}/sys/crypto/sha2
         CFLAGS+=	-DWEAK_REFS
         SRCS+=		sha256c.c sha512c.c
         
         # md5 from libmd
        -.PATH: ${.CURDIR}/../../../lib/libmd
        +.PATH: ${SRCTOP}/lib/libmd
         SRCS+=		md5c.c
         
         # AES implementation from sys/crypto
        -.PATH: ${.CURDIR}/../../crypto/rijndael
        +.PATH: ${SRCTOP}/sys/crypto/rijndael
         CFLAGS+=	-I${.CURDIR}/../../
         # Remove asserts
         CFLAGS+=	-DNDEBUG
         SRCS+=		rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c
         
         # local GELI Implementation
        -.PATH: ${.CURDIR}/../../geom/eli
        +.PATH: ${SRCTOP}/sys/geom/eli
         CFLAGS+=	-D_STAND
         SRCS+=		geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c pkcs5v2.c
         
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 10:45:15 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20F38DD2A83;
         Tue,  8 Aug 2017 10:45:15 +0000 (UTC) (envelope-from se@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 F0B477E6F6;
         Tue,  8 Aug 2017 10:45:14 +0000 (UTC) (envelope-from se@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78AjEcb030537;
         Tue, 8 Aug 2017 10:45:14 GMT (envelope-from se@FreeBSD.org)
        Received: (from se@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78AjDxN030533;
         Tue, 8 Aug 2017 10:45:13 GMT (envelope-from se@FreeBSD.org)
        Message-Id: <201708081045.v78AjDxN030533@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org
         using -f
        From: Stefan Esser 
        Date: Tue, 8 Aug 2017 10:45:13 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322224 - stable/11/share/vt/keymaps
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: se
        X-SVN-Commit-Paths: stable/11/share/vt/keymaps
        X-SVN-Commit-Revision: 322224
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 10:45:15 -0000
        
        Author: se
        Date: Tue Aug  8 10:45:13 2017
        New Revision: 322224
        URL: https://svnweb.freebsd.org/changeset/base/322224
        
        Log:
          MFC 321858: Add alternate Turkish keyboard layout F, submitted by Ufur Guler.
          MFC 321859: While here, adjust a few file and path names in comments.
        
        Added:
          stable/11/share/vt/keymaps/tr.f.kbd
             - copied unchanged from r321858, head/share/vt/keymaps/tr.f.kbd
        Modified:
          stable/11/share/vt/keymaps/INDEX.keymaps
          stable/11/share/vt/keymaps/Makefile
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/share/vt/keymaps/INDEX.keymaps
        ==============================================================================
        --- stable/11/share/vt/keymaps/INDEX.keymaps	Tue Aug  8 10:44:48 2017	(r322223)
        +++ stable/11/share/vt/keymaps/INDEX.keymaps	Tue Aug  8 10:45:13 2017	(r322224)
        @@ -15,7 +15,7 @@
         # 	german.iso.kbd:en:german
         #
         # See also setlocal
        -# /usr/share/locale, /usr/X11/lib/X11/locale/locale.alias
        +# /usr/share/locale, /usr/local/lib/X11/locale/locale.alias
         #
         #
         # Language support: MENU, FONT
        @@ -31,6 +31,7 @@ MENU:he:ךלש תדלקמה תפש ×ª× ×¨×—×‘
         MENU:uk:Оберiть розкладку клавіатури
         MENU:el:Επιλέξτε το πληκτÏολόγιο της κονσόλας
         MENU:hy:Ô¸Õ¶Õ¿Ö€Õ¥Ö„ Õ½Õ¿Õ¥Õ²Õ¶Õ¡Õ·Õ¡Ö€Õ« Õ¤Õ¡Õ½Õ¡Õ¾Õ¸Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨
        +MENU:tr:Klavye düzeninizi seçiniz
         
         #
         # The font definition for "en" is the fall-back font for
        @@ -210,6 +211,7 @@ de.kbd:de:Deutsch
         de.kbd:fr:Allemand
         de.kbd:pt:Alemão
         de.kbd:es:Alemán
        +de.kbd:tr:Almanca
         de.kbd:uk:Ðімецька
         
         de.acc.kbd:en:German (accent keys)
        @@ -502,11 +504,18 @@ ch.macbook.acc.kbd:fr:Suisse-Allemand  Macbook/Macbook
         ch.macbook.acc.kbd:pt:Suiço-Alemão Macbook/Macbook Pro (com acentos)
         ch.macbook.acc.kbd:es:Germanosuizo  Macbook/Macbook Pro (con acentos)
         
        -tr.kbd:en:Turkish
        -tr.kbd:de:Türkisch
        -tr.kbd:fr:Turc
        -tr.kbd:uk:Турецька
        +tr.kbd:en:Turkish (Q)
        +tr.kbd:de:Türkisch (Q)
        +tr.kbd:fr:Turc (Q)
        +tr.kbd:uk:Турецька (Q)
        +tr.kbd:tr:Türkçe (Q)
         
        +tr.f.kbd:en:Turkish (F)
        +tr.f.kbd:de:Türkisch (F)
        +tr.f.kbd:fr:Turc (F)
        +tr.f.kbd:uk:Турецька (F)
        +tr.f.kbd:tr:Türkçe (F)
        +
         uk.kbd:en:United Kingdom
         uk.kbd:de:Vereinigtes Königreich
         uk.kbd:fr:Royaume Uni
        @@ -515,9 +524,9 @@ uk.kbd:es:Británico
         
         uk.capsctrl.kbd:en:United Kingdom (Caps Lock acts as Left Ctrl)
         uk.capsctrl.kbd:de:Vereinigtes Königreich (Caps Lock als linke Strg)
        -#uk.iso-ctrl.kbd:fr:Royaume Uni (caps lock acts as Left Ctrl)
        -#uk.iso-ctrl.kbd:pt:Reino Unido (caps lock acts as Left Ctrl)
        -#uk.iso-ctrl.kbd:es:Británico (caps lock acts as Left Ctrl)
        +#uk.capsctrl.kbd:fr:Royaume Uni (caps lock acts as Left Ctrl)
        +#uk.capsctrl.kbd:pt:Reino Unido (caps lock acts as Left Ctrl)
        +#uk.capsctrl.kbd:es:Británico (caps lock acts as Left Ctrl)
         
         uk.dvorak.kbd:en:United Kingdom Dvorak
         uk.dvorak.kbd:de:Vereinigtes Königreich Dvorak
        
        Modified: stable/11/share/vt/keymaps/Makefile
        ==============================================================================
        --- stable/11/share/vt/keymaps/Makefile	Tue Aug  8 10:44:48 2017	(r322223)
        +++ stable/11/share/vt/keymaps/Makefile	Tue Aug  8 10:45:13 2017	(r322224)
        @@ -69,6 +69,7 @@ FILES=	INDEX.keymaps \
         	se.kbd \
         	si.kbd \
         	sk.kbd \
        +	tr.f.kbd \
         	tr.kbd \
         	ua.kbd \
         	ua.shift.alt.kbd \
        
        Copied: stable/11/share/vt/keymaps/tr.f.kbd (from r321858, head/share/vt/keymaps/tr.f.kbd)
        ==============================================================================
        --- /dev/null	00:00:00 1970	(empty, because file is newly added)
        +++ stable/11/share/vt/keymaps/tr.f.kbd	Tue Aug  8 10:45:13 2017	(r322224, copy of r321858, head/share/vt/keymaps/tr.f.kbd)
        @@ -0,0 +1,121 @@
        +# Turkish F Keyboard (01-08-2017)
        +#
        +# $FreeBSD$
        +#
        +# Ufuk Guler
        +# ufukguler@yahoo.com
        +#
        +# Mobile        : +(90) 544 848 39 09
        +#                                                         alt
        +# scan                       cntrl          alt    alt   cntrl lock
        +# code  base   shift  cntrl  shift  alt    shift  cntrl  shift state
        +# ------------------------------------------------------------------
        +  000   nop    nop    nop    nop    nop    nop    nop    nop     O
        +  001   esc    esc    esc    esc    esc    esc    debug  esc     O
        +  002   '1'    '!'    '1'    '!'    0xB9   0xA1   '1'    '!'     O
        +  003   '2'    '"'    nul    '"'    0xB2   nop    '2'    nul     O
        +  004   '3'    '^'    nop    nop    '#'    0xB3   '#'    '#'     O
        +  005   '4'    '$'    nop    '$'    0xBC   nop    '4'    '$'     O
        +  006   '5'    '%'    nop    '%'    0xBD   nop    '5'    '%'     O
        +  007   '6'    '&'    nop    '&'    0xBE   nop    '6'    nop     O
        +  008   '7'    '''    nop    '''    '{'    nop    nop    '&'     O
        +  009   '8'    '('    nop    '('    '['    nop    nop    '*'     O
        +  010   '9'    ')'    '9'    ')'    ']'    0xB1   gs     '('     O
        +  011   '0'    '='    nop    '='    '}'    0xB0   nop    ')'     O
        +  012   '/'    '?'    nop    nop    '\'    0xBF   fs     nop     O
        +  013   '-'    '_'    nop    nop    '|'    nop    nop    '+'     O
        +  014   bs     bs     del    del    bs     bs     del    del     O
        +  015   ht     btab   nop    nop    ht     btab   nop    nop     O
        +  016   'f'    'F'    ack    ack    '@'    nop    ack    ack     C
        +  017   'g'    'G'    bel    bel    bel    bel    bel    bel     C
        +  018   0x011F 0x011E nop    nop    nop    nop    nop    nop     C
        +  019   0x0131 'I'    ht     ht     0xB6   ht     ht     ht      C
        +  020   'o'    'O'    si     si     0xF4   0xD4   si     si      C
        +  021   'd'    'D'    eot    eot    0xA5   eot    eot    eot     C
        +  022   'r'    'R'    dc2    dc2    0xAE   dc2    dc2    dc2     C
        +  023   'n'    'N'    so     so     so     so     so     so      C
        +  024   'h'    'H'    bs     bs     0xB0   bs     bs     bs      C
        +  025   'p'    'P'    dle    dle    0xA3   dle    dle    dle     C
        +  026   'q'    'Q'    dc1    dc1    0xA8   dc1    dc1    dc1     C
        +  027   'w'    'W'    etb    etb    0x7E   nop    nop    nop     C
        +  028   cr     cr     nl     nl     cr     cr     nl     nl      O
        +  029   lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
        +  030   'u'    'U'    nak    nak    0xFB   0xDB   nak    nak     C
        +  031   'i'    0x0130 nop    nop    0xEE   0x0130 nop    nop     C
        +  032   'e'    'E'    enq    enq    0x20AC enq    enq    enq     C
        +  033   'a'    'A'    soh    soh    0xE2   0xC2   soh    soh     C
        +  034   0xFC   0xDC   nop    nop    0xFB   0xDB   nop    nop     C
        +  035   't'    'T'    dc4    dc4    0x2122 dc4    dc4    dc4     C
        +  036   'k'    'K'    vt     vt     vt     vt     vt     vt      C
        +  037   'm'    'M'    cr     cr     0xB5   cr     cr     cr      C
        +  038   'l'    'L'    ff     ff     ff     ff     ff     ff      C
        +  039   'y'    'Y'    em     em     0xB4   em    ';'     ':'     C
        +  040   0x015F 0x015E '''    '"'    '#'    0x02C7 '#'    '"'     C
        +  041   '+'    '*'    nop    '*'    0xAC   0xB1   nop    nop     C
        +  042   lshift lshift lshift lshift lshift lshift lshift lshift  O
        +  043   'x'    'X'    can    can    0x60   0x60   can    can     C
        +  044   'j'    'J'    nl     nl     0xAB   'J'    nl     nl      C
        +  045   0xF6   0xD6   nop    nop    0xBB   nop    nop    nop     C
        +  046   'v'    'V'    syn    0x60   0x201C syn    syn    syn     C
        +  047   'c'    'C'    etx    etx    0xA2   0xA9   etx    etx     C
        +  048   0xE7    0xC7  nop    nop    0x201D nop    nop    nop     C
        +  049   'z'    'Z'    sub    sub    sub    sub    sub    sub     C
        +  050   's'    'S'    dc3    dc3    0xA7   dc3    dc3    dc3     C
        +  051   'b'    'B'    stx    stx    0xD7   stx    ','    '<'     C
        +  052   '.'    ':'    '.'    ':'    0xF7   0x2022 '.'    '>'     C
        +  053   ','    ';'    ','    ';'    0x2022 nop    '/'    '?'     O
        +  054   rshift rshift rshift rshift rshift rshift rshift rshift  O
        +  055   '*'    '*'    '*'    '*'    '*'    '*'    '*'    '*'     O
        +  056   lalt   lalt   lalt   lalt   lalt   lalt   lalt   lalt    O
        +  057   ' '    ' '    nul    ' '    ' '    ' '    susp   ' '     O
        +  058   clock  clock  clock  clock  clock  clock  clock  clock   O
        +  059   fkey01 fkey13 fkey25 fkey37 scr01  scr11  scr01  scr11   O
        +  060   fkey02 fkey14 fkey26 fkey38 scr02  scr12  scr02  scr12   O
        +  061   fkey03 fkey15 fkey27 fkey39 scr03  scr13  scr03  scr13   O
        +  062   fkey04 fkey16 fkey28 fkey40 scr04  scr14  scr04  scr14   O
        +  063   fkey05 fkey17 fkey29 fkey41 scr05  scr15  scr05  scr15   O
        +  064   fkey06 fkey18 fkey30 fkey42 scr06  scr16  scr06  scr16   O
        +  065   fkey07 fkey19 fkey31 fkey43 scr07  scr07  scr07  scr07   O
        +  066   fkey08 fkey20 fkey32 fkey44 scr08  scr08  scr08  scr08   O
        +  067   fkey09 fkey21 fkey33 fkey45 scr09  scr09  scr09  scr09   O
        +  068   fkey10 fkey22 fkey34 fkey46 scr10  scr10  scr10  scr10   O
        +  069   nlock  nlock  nlock  nlock  nlock  nlock  nlock  nlock   O
        +  070   slock  slock  slock  slock  slock  slock  slock  slock   O
        +  071   fkey49 '7'    '7'    '7'    '7'    '7'    '7'    '7'     N
        +  072   fkey50 '8'    '8'    '8'    '8'    '8'    '8'    '8'     N
        +  073   fkey51 '9'    '9'    '9'    '9'    '9'    '9'    '9'     N
        +  074   fkey52 '-'    '-'    '-'    '-'    '-'    '-'    '-'     N
        +  075   fkey53 '4'    '4'    '4'    '4'    '4'    '4'    '4'     N
        +  076   fkey54 '5'    '5'    '5'    '5'    '5'    '5'    '5'     N
        +  077   fkey55 '6'    '6'    '6'    '6'    '6'    '6'    '6'     N
        +  078   fkey56 '+'    '+'    '+'    '+'    '+'    '+'    '+'     N
        +  079   fkey57 '1'    '1'    '1'    '1'    '1'    '1'    '1'     N
        +  080   fkey58 '2'    '2'    '2'    '2'    '2'    '2'    '2'     N
        +  081   fkey59 '3'    '3'    '3'    '3'    '3'    '3'    '3'     N
        +  082   fkey60 '0'    '0'    '0'    '0'    '0'    '0'    '0'     N
        +  083   del    ','    ','    ','    ','    ','    boot   boot    N
        +  084   nop    nop    nop    nop    nop    nop    nop    nop     O
        +  085   nop    nop    nop    nop    nop    nop    nop    nop     O
        +  086   '<'    '>'    '<'    '>'    '|'    0xA6   nop    0xA6    O
        +  087   fkey11 fkey23 fkey35 fkey47 scr11  scr11  scr11  scr11   O
        +  088   fkey12 fkey24 fkey36 fkey48 scr12  scr12  scr12  scr12   O
        +  089   cr     cr     nl     nl     cr     cr     nl     nl      O
        +  090   rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl   O
        +  091   '/'    '/'    '/'    '/'    '/'    '/'    '/'    '/'     N
        +  092   nscr   pscr   debug  debug  nop    nop    nop    nop     O
        +  093   ralt   ralt   ralt   ralt   ralt   ralt   ralt   ralt    O
        +  094   fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49  O
        +  095   fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50  O
        +  096   fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51  O
        +  097   fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53  O
        +  098   fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55  O
        +  099   fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57  O
        +  100   fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58  O
        +  101   fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59  O
        +  102   fkey60 paste  fkey60 fkey60 fkey60 fkey60 fkey60 fkey60  O
        +  103   fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot   fkey61  O
        +  104   slock  saver  slock  saver  susp   nop    susp   nop     O
        +  105   fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62  O
        +  106   fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63  O
        +  107   fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64  O
        +  108   nop    nop    nop    nop    nop    nop    nop    nop     O
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 10:45:24 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EAEDDD2AE4;
         Tue,  8 Aug 2017 10:45:24 +0000 (UTC) (envelope-from se@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 277177E7D8;
         Tue,  8 Aug 2017 10:45:24 +0000 (UTC) (envelope-from se@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78AjNWN030596;
         Tue, 8 Aug 2017 10:45:23 GMT (envelope-from se@FreeBSD.org)
        Received: (from se@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78AjN0F030592;
         Tue, 8 Aug 2017 10:45:23 GMT (envelope-from se@FreeBSD.org)
        Message-Id: <201708081045.v78AjN0F030592@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org
         using -f
        From: Stefan Esser 
        Date: Tue, 8 Aug 2017 10:45:23 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322225 - stable/10/share/vt/keymaps
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: se
        X-SVN-Commit-Paths: stable/10/share/vt/keymaps
        X-SVN-Commit-Revision: 322225
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 10:45:24 -0000
        
        Author: se
        Date: Tue Aug  8 10:45:22 2017
        New Revision: 322225
        URL: https://svnweb.freebsd.org/changeset/base/322225
        
        Log:
          MFC 321858: Add alternate Turkish keyboard layout F, submitted by Ufur Guler.
          MFC 321859: While here, adjust a few file and path names in comments.
        
        Added:
          stable/10/share/vt/keymaps/tr.f.kbd
             - copied unchanged from r321858, head/share/vt/keymaps/tr.f.kbd
        Modified:
          stable/10/share/vt/keymaps/INDEX.keymaps
          stable/10/share/vt/keymaps/Makefile
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/share/vt/keymaps/INDEX.keymaps
        ==============================================================================
        --- stable/10/share/vt/keymaps/INDEX.keymaps	Tue Aug  8 10:45:13 2017	(r322224)
        +++ stable/10/share/vt/keymaps/INDEX.keymaps	Tue Aug  8 10:45:22 2017	(r322225)
        @@ -15,7 +15,7 @@
         # 	german.iso.kbd:en:german
         #
         # See also setlocal
        -# /usr/share/locale, /usr/X11/lib/X11/locale/locale.alias
        +# /usr/share/locale, /usr/local/lib/X11/locale/locale.alias
         #
         #
         # Language support: MENU, FONT
        @@ -31,6 +31,7 @@ MENU:he:ךלש תדלקמה תפש ×ª× ×¨×—×‘
         MENU:uk:Оберiть розкладку клавіатури
         MENU:el:Επιλέξτε το πληκτÏολόγιο της κονσόλας
         MENU:hy:Ô¸Õ¶Õ¿Ö€Õ¥Ö„ Õ½Õ¿Õ¥Õ²Õ¶Õ¡Õ·Õ¡Ö€Õ« Õ¤Õ¡Õ½Õ¡Õ¾Õ¸Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨
        +MENU:tr:Klavye düzeninizi seçiniz
         
         #
         # The font definition for "en" is the fall-back font for
        @@ -210,6 +211,7 @@ de.kbd:de:Deutsch
         de.kbd:fr:Allemand
         de.kbd:pt:Alemão
         de.kbd:es:Alemán
        +de.kbd:tr:Almanca
         de.kbd:uk:Ðімецька
         
         de.acc.kbd:en:German (accent keys)
        @@ -502,11 +504,18 @@ ch.macbook.acc.kbd:fr:Suisse-Allemand  Macbook/Macbook
         ch.macbook.acc.kbd:pt:Suiço-Alemão Macbook/Macbook Pro (com acentos)
         ch.macbook.acc.kbd:es:Germanosuizo  Macbook/Macbook Pro (con acentos)
         
        -tr.kbd:en:Turkish
        -tr.kbd:de:Türkisch
        -tr.kbd:fr:Turc
        -tr.kbd:uk:Турецька
        +tr.kbd:en:Turkish (Q)
        +tr.kbd:de:Türkisch (Q)
        +tr.kbd:fr:Turc (Q)
        +tr.kbd:uk:Турецька (Q)
        +tr.kbd:tr:Türkçe (Q)
         
        +tr.f.kbd:en:Turkish (F)
        +tr.f.kbd:de:Türkisch (F)
        +tr.f.kbd:fr:Turc (F)
        +tr.f.kbd:uk:Турецька (F)
        +tr.f.kbd:tr:Türkçe (F)
        +
         uk.kbd:en:United Kingdom
         uk.kbd:de:Vereinigtes Königreich
         uk.kbd:fr:Royaume Uni
        @@ -515,9 +524,9 @@ uk.kbd:es:Británico
         
         uk.capsctrl.kbd:en:United Kingdom (Caps Lock acts as Left Ctrl)
         uk.capsctrl.kbd:de:Vereinigtes Königreich (Caps Lock als linke Strg)
        -#uk.iso-ctrl.kbd:fr:Royaume Uni (caps lock acts as Left Ctrl)
        -#uk.iso-ctrl.kbd:pt:Reino Unido (caps lock acts as Left Ctrl)
        -#uk.iso-ctrl.kbd:es:Británico (caps lock acts as Left Ctrl)
        +#uk.capsctrl.kbd:fr:Royaume Uni (caps lock acts as Left Ctrl)
        +#uk.capsctrl.kbd:pt:Reino Unido (caps lock acts as Left Ctrl)
        +#uk.capsctrl.kbd:es:Británico (caps lock acts as Left Ctrl)
         
         uk.dvorak.kbd:en:United Kingdom Dvorak
         uk.dvorak.kbd:de:Vereinigtes Königreich Dvorak
        
        Modified: stable/10/share/vt/keymaps/Makefile
        ==============================================================================
        --- stable/10/share/vt/keymaps/Makefile	Tue Aug  8 10:45:13 2017	(r322224)
        +++ stable/10/share/vt/keymaps/Makefile	Tue Aug  8 10:45:22 2017	(r322225)
        @@ -69,6 +69,7 @@ FILES=	INDEX.keymaps \
         	se.kbd \
         	si.kbd \
         	sk.kbd \
        +	tr.f.kbd \
         	tr.kbd \
         	ua.kbd \
         	ua.shift.alt.kbd \
        
        Copied: stable/10/share/vt/keymaps/tr.f.kbd (from r321858, head/share/vt/keymaps/tr.f.kbd)
        ==============================================================================
        --- /dev/null	00:00:00 1970	(empty, because file is newly added)
        +++ stable/10/share/vt/keymaps/tr.f.kbd	Tue Aug  8 10:45:22 2017	(r322225, copy of r321858, head/share/vt/keymaps/tr.f.kbd)
        @@ -0,0 +1,121 @@
        +# Turkish F Keyboard (01-08-2017)
        +#
        +# $FreeBSD$
        +#
        +# Ufuk Guler
        +# ufukguler@yahoo.com
        +#
        +# Mobile        : +(90) 544 848 39 09
        +#                                                         alt
        +# scan                       cntrl          alt    alt   cntrl lock
        +# code  base   shift  cntrl  shift  alt    shift  cntrl  shift state
        +# ------------------------------------------------------------------
        +  000   nop    nop    nop    nop    nop    nop    nop    nop     O
        +  001   esc    esc    esc    esc    esc    esc    debug  esc     O
        +  002   '1'    '!'    '1'    '!'    0xB9   0xA1   '1'    '!'     O
        +  003   '2'    '"'    nul    '"'    0xB2   nop    '2'    nul     O
        +  004   '3'    '^'    nop    nop    '#'    0xB3   '#'    '#'     O
        +  005   '4'    '$'    nop    '$'    0xBC   nop    '4'    '$'     O
        +  006   '5'    '%'    nop    '%'    0xBD   nop    '5'    '%'     O
        +  007   '6'    '&'    nop    '&'    0xBE   nop    '6'    nop     O
        +  008   '7'    '''    nop    '''    '{'    nop    nop    '&'     O
        +  009   '8'    '('    nop    '('    '['    nop    nop    '*'     O
        +  010   '9'    ')'    '9'    ')'    ']'    0xB1   gs     '('     O
        +  011   '0'    '='    nop    '='    '}'    0xB0   nop    ')'     O
        +  012   '/'    '?'    nop    nop    '\'    0xBF   fs     nop     O
        +  013   '-'    '_'    nop    nop    '|'    nop    nop    '+'     O
        +  014   bs     bs     del    del    bs     bs     del    del     O
        +  015   ht     btab   nop    nop    ht     btab   nop    nop     O
        +  016   'f'    'F'    ack    ack    '@'    nop    ack    ack     C
        +  017   'g'    'G'    bel    bel    bel    bel    bel    bel     C
        +  018   0x011F 0x011E nop    nop    nop    nop    nop    nop     C
        +  019   0x0131 'I'    ht     ht     0xB6   ht     ht     ht      C
        +  020   'o'    'O'    si     si     0xF4   0xD4   si     si      C
        +  021   'd'    'D'    eot    eot    0xA5   eot    eot    eot     C
        +  022   'r'    'R'    dc2    dc2    0xAE   dc2    dc2    dc2     C
        +  023   'n'    'N'    so     so     so     so     so     so      C
        +  024   'h'    'H'    bs     bs     0xB0   bs     bs     bs      C
        +  025   'p'    'P'    dle    dle    0xA3   dle    dle    dle     C
        +  026   'q'    'Q'    dc1    dc1    0xA8   dc1    dc1    dc1     C
        +  027   'w'    'W'    etb    etb    0x7E   nop    nop    nop     C
        +  028   cr     cr     nl     nl     cr     cr     nl     nl      O
        +  029   lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
        +  030   'u'    'U'    nak    nak    0xFB   0xDB   nak    nak     C
        +  031   'i'    0x0130 nop    nop    0xEE   0x0130 nop    nop     C
        +  032   'e'    'E'    enq    enq    0x20AC enq    enq    enq     C
        +  033   'a'    'A'    soh    soh    0xE2   0xC2   soh    soh     C
        +  034   0xFC   0xDC   nop    nop    0xFB   0xDB   nop    nop     C
        +  035   't'    'T'    dc4    dc4    0x2122 dc4    dc4    dc4     C
        +  036   'k'    'K'    vt     vt     vt     vt     vt     vt      C
        +  037   'm'    'M'    cr     cr     0xB5   cr     cr     cr      C
        +  038   'l'    'L'    ff     ff     ff     ff     ff     ff      C
        +  039   'y'    'Y'    em     em     0xB4   em    ';'     ':'     C
        +  040   0x015F 0x015E '''    '"'    '#'    0x02C7 '#'    '"'     C
        +  041   '+'    '*'    nop    '*'    0xAC   0xB1   nop    nop     C
        +  042   lshift lshift lshift lshift lshift lshift lshift lshift  O
        +  043   'x'    'X'    can    can    0x60   0x60   can    can     C
        +  044   'j'    'J'    nl     nl     0xAB   'J'    nl     nl      C
        +  045   0xF6   0xD6   nop    nop    0xBB   nop    nop    nop     C
        +  046   'v'    'V'    syn    0x60   0x201C syn    syn    syn     C
        +  047   'c'    'C'    etx    etx    0xA2   0xA9   etx    etx     C
        +  048   0xE7    0xC7  nop    nop    0x201D nop    nop    nop     C
        +  049   'z'    'Z'    sub    sub    sub    sub    sub    sub     C
        +  050   's'    'S'    dc3    dc3    0xA7   dc3    dc3    dc3     C
        +  051   'b'    'B'    stx    stx    0xD7   stx    ','    '<'     C
        +  052   '.'    ':'    '.'    ':'    0xF7   0x2022 '.'    '>'     C
        +  053   ','    ';'    ','    ';'    0x2022 nop    '/'    '?'     O
        +  054   rshift rshift rshift rshift rshift rshift rshift rshift  O
        +  055   '*'    '*'    '*'    '*'    '*'    '*'    '*'    '*'     O
        +  056   lalt   lalt   lalt   lalt   lalt   lalt   lalt   lalt    O
        +  057   ' '    ' '    nul    ' '    ' '    ' '    susp   ' '     O
        +  058   clock  clock  clock  clock  clock  clock  clock  clock   O
        +  059   fkey01 fkey13 fkey25 fkey37 scr01  scr11  scr01  scr11   O
        +  060   fkey02 fkey14 fkey26 fkey38 scr02  scr12  scr02  scr12   O
        +  061   fkey03 fkey15 fkey27 fkey39 scr03  scr13  scr03  scr13   O
        +  062   fkey04 fkey16 fkey28 fkey40 scr04  scr14  scr04  scr14   O
        +  063   fkey05 fkey17 fkey29 fkey41 scr05  scr15  scr05  scr15   O
        +  064   fkey06 fkey18 fkey30 fkey42 scr06  scr16  scr06  scr16   O
        +  065   fkey07 fkey19 fkey31 fkey43 scr07  scr07  scr07  scr07   O
        +  066   fkey08 fkey20 fkey32 fkey44 scr08  scr08  scr08  scr08   O
        +  067   fkey09 fkey21 fkey33 fkey45 scr09  scr09  scr09  scr09   O
        +  068   fkey10 fkey22 fkey34 fkey46 scr10  scr10  scr10  scr10   O
        +  069   nlock  nlock  nlock  nlock  nlock  nlock  nlock  nlock   O
        +  070   slock  slock  slock  slock  slock  slock  slock  slock   O
        +  071   fkey49 '7'    '7'    '7'    '7'    '7'    '7'    '7'     N
        +  072   fkey50 '8'    '8'    '8'    '8'    '8'    '8'    '8'     N
        +  073   fkey51 '9'    '9'    '9'    '9'    '9'    '9'    '9'     N
        +  074   fkey52 '-'    '-'    '-'    '-'    '-'    '-'    '-'     N
        +  075   fkey53 '4'    '4'    '4'    '4'    '4'    '4'    '4'     N
        +  076   fkey54 '5'    '5'    '5'    '5'    '5'    '5'    '5'     N
        +  077   fkey55 '6'    '6'    '6'    '6'    '6'    '6'    '6'     N
        +  078   fkey56 '+'    '+'    '+'    '+'    '+'    '+'    '+'     N
        +  079   fkey57 '1'    '1'    '1'    '1'    '1'    '1'    '1'     N
        +  080   fkey58 '2'    '2'    '2'    '2'    '2'    '2'    '2'     N
        +  081   fkey59 '3'    '3'    '3'    '3'    '3'    '3'    '3'     N
        +  082   fkey60 '0'    '0'    '0'    '0'    '0'    '0'    '0'     N
        +  083   del    ','    ','    ','    ','    ','    boot   boot    N
        +  084   nop    nop    nop    nop    nop    nop    nop    nop     O
        +  085   nop    nop    nop    nop    nop    nop    nop    nop     O
        +  086   '<'    '>'    '<'    '>'    '|'    0xA6   nop    0xA6    O
        +  087   fkey11 fkey23 fkey35 fkey47 scr11  scr11  scr11  scr11   O
        +  088   fkey12 fkey24 fkey36 fkey48 scr12  scr12  scr12  scr12   O
        +  089   cr     cr     nl     nl     cr     cr     nl     nl      O
        +  090   rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl   O
        +  091   '/'    '/'    '/'    '/'    '/'    '/'    '/'    '/'     N
        +  092   nscr   pscr   debug  debug  nop    nop    nop    nop     O
        +  093   ralt   ralt   ralt   ralt   ralt   ralt   ralt   ralt    O
        +  094   fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49  O
        +  095   fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50  O
        +  096   fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51  O
        +  097   fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53  O
        +  098   fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55  O
        +  099   fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57  O
        +  100   fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58  O
        +  101   fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59  O
        +  102   fkey60 paste  fkey60 fkey60 fkey60 fkey60 fkey60 fkey60  O
        +  103   fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot   fkey61  O
        +  104   slock  saver  slock  saver  susp   nop    susp   nop     O
        +  105   fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62  O
        +  106   fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63  O
        +  107   fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64  O
        +  108   nop    nop    nop    nop    nop    nop    nop    nop     O
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 11:24:41 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86AFDDD50B9;
         Tue,  8 Aug 2017 11:24:41 +0000 (UTC)
         (envelope-from bapt@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 5D4C28130B;
         Tue,  8 Aug 2017 11:24:41 +0000 (UTC)
         (envelope-from bapt@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78BOem6047433;
         Tue, 8 Aug 2017 11:24:40 GMT (envelope-from bapt@FreeBSD.org)
        Received: (from bapt@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78BOeOI047432;
         Tue, 8 Aug 2017 11:24:40 GMT (envelope-from bapt@FreeBSD.org)
        Message-Id: <201708081124.v78BOeOI047432@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: bapt set sender to
         bapt@FreeBSD.org using -f
        From: Baptiste Daroussin 
        Date: Tue, 8 Aug 2017 11:24:40 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322243 - stable/11/share/misc
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: bapt
        X-SVN-Commit-Paths: stable/11/share/misc
        X-SVN-Commit-Revision: 322243
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 11:24:41 -0000
        
        Author: bapt
        Date: Tue Aug  8 11:24:40 2017
        New Revision: 322243
        URL: https://svnweb.freebsd.org/changeset/base/322243
        
        Log:
          MFC r321812:
          
          Update pci_vendors to 2017.07.27
        
        Modified:
          stable/11/share/misc/pci_vendors
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/share/misc/pci_vendors
        ==============================================================================
        --- stable/11/share/misc/pci_vendors	Tue Aug  8 11:24:13 2017	(r322242)
        +++ stable/11/share/misc/pci_vendors	Tue Aug  8 11:24:40 2017	(r322243)
        @@ -3,8 +3,8 @@
         #
         #	List of PCI ID's
         #
        -#	Version: 2017.07.13
        -#	Date:    2017-07-13 03:15:01
        +#	Version: 2017.07.27
        +#	Date:    2017-07-27 03:15:02
         #
         #	Maintained by Albert Pool, Martin Mares, and other volunteers from
         #	the PCI ID Project at http://pci-ids.ucw.cz/.
        @@ -2436,7 +2436,7 @@
         		144d c0c7  Radeon HD 7550M
         	6842  Thames LE [Radeon HD 7000M Series]
         	6843  Thames [Radeon HD 7670M]
        -	6863  Vega 10 [Radeon Vega Frontier Edition]
        +	6863  Vega 10 XTX [Radeon Vega Frontier Edition]
         	687f  Vega [Radeon RX Vega]
         	6888  Cypress XT [FirePro V8800]
         	6889  Cypress PRO [FirePro V7800]
        @@ -2952,6 +2952,8 @@
         	6987  Polaris12
         	6995  Lexa XT [Radeon PRO WX 2100]
         	699f  Lexa PRO [Radeon RX 550]
        +		148c 2380  Lexa XL [Radeon RX 550]
        +		1da2 e367  Lexa PRO [Radeon RX 550]
         	700f  RS100 AGP Bridge
         	7010  RS200/RS250 AGP Bridge
         	7100  R520 [Radeon X1800 XT]
        @@ -6026,11 +6028,12 @@
         		1077 e4f4  FastLinQ QL45411H 40GbE Adapter
         	1644  FastLinQ QL45000 Series 100GbE Controller
         		1077 e4f8  FastLinQ QL45611H 100GbE Adapter
        +	1654  FastLinQ QL45000 Series 50GbE Controller
        +		1590 0223  Synergy 6810C 25/50Gb Ethernet Adapter
         	1656  FastLinQ QL45000 Series 25GbE Controller
         		1077 02a7  QL45212-DE 25GbE Adapter
         		1077 e4f6  FastLinQ QL45211H 25GbE Adapter
         		1077 e4f7  FastLinQ QL45212H 25GbE Adapter
        -		1590 0223  Synergy 6810C 25/50Gb Ethernet Adapter
         	165c  FastLinQ QL45000 Series 40GbE Controller (FCoE)
         		1077 e4f1  FastLinQ QL45462H 40GbE FCoE Adapter
         		1077 e4f2  FastLinQ QL45461H 40GbE FCoE Adapter
        @@ -16128,6 +16131,8 @@
         	50a0  T540-50A0 Unified Wire Ethernet Controller
         	50a1  T540-50A1 Unified Wire Ethernet Controller
         	50a2  T580-50A2 Unified Wire Ethernet Controller
        +	50a3  T580-50A3 Unified Wire Ethernet Controller
        +	50a4  T540-50A4 Unified Wire Ethernet Controller
         	5401  T520-CR Unified Wire Ethernet Controller
         	5402  T522-CR Unified Wire Ethernet Controller
         	5403  T540-CR Unified Wire Ethernet Controller
        @@ -16181,6 +16186,8 @@
         	54a0  T540-50A0 Unified Wire Ethernet Controller
         	54a1  T540-50A1 Unified Wire Ethernet Controller
         	54a2  T580-50A2 Unified Wire Ethernet Controller
        +	54a3  T580-50A3 Unified Wire Ethernet Controller
        +	54a4  T540-50A4 Unified Wire Ethernet Controller
         	5501  T520-CR Unified Wire Storage Controller
         	5502  T522-CR Unified Wire Storage Controller
         	5503  T540-CR Unified Wire Storage Controller
        @@ -16234,6 +16241,8 @@
         	55a0  T540-50A0 Unified Wire Storage Controller
         	55a1  T540-50A1 Unified Wire Storage Controller
         	55a2  T580-50A2 Unified Wire Storage Controller
        +	55a3  T580-50A3 Unified Wire Storage Controller
        +	55a4  T540-50A4 Unified Wire Storage Controller
         	5601  T520-CR Unified Wire Storage Controller
         	5602  T522-CR Unified Wire Storage Controller
         	5603  T540-CR Unified Wire Storage Controller
        @@ -16287,6 +16296,8 @@
         	56a0  T540-50A0 Unified Wire Storage Controller
         	56a1  T540-50A1 Unified Wire Storage Controller
         	56a2  T580-50A2 Unified Wire Storage Controller
        +	56a3  T580-50A3 Unified Wire Storage Controller
        +	56a4  T540-50A4 Unified Wire Storage Controller
         	5701  T520-CR Unified Wire Ethernet Controller
         	5702  T522-CR Unified Wire Ethernet Controller
         	5703  T540-CR Unified Wire Ethernet Controller
        @@ -16379,6 +16390,8 @@
         	58a0  T540-50A0 Unified Wire Ethernet Controller [VF]
         	58a1  T540-50A1 Unified Wire Ethernet Controller [VF]
         	58a2  T580-50A2 Unified Wire Ethernet Controller [VF]
        +	58a3  T580-50A3 Unified Wire Ethernet Controller [VF]
        +	58a4  T540-50A4 Unified Wire Ethernet Controller [VF]
         	6001  T6225-CR Unified Wire Ethernet Controller
         	6002  T6225-SO-CR Unified Wire Ethernet Controller
         	6003  T6425-CR Unified Wire Ethernet Controller
        @@ -16594,6 +16607,7 @@
         	e836  M115S Hybrid Analog/DVB PAL/SECAM/NTSC Tuner
         	f436  AVerTV Hybrid+FM
         1462  Micro-Star International Co., Ltd. [MSI]
        +	aaf0  Radeon RX 580 Gaming X 8G
         1463  Fast Corporation
         1464  Interactive Circuits & Systems Ltd
         1465  GN NETTEST Telecom DIV.
        @@ -19273,6 +19287,7 @@
         		17d3 1880  ARC-1880 8/12/16/24 Port PCIe 2.0 to SAS/SATA 6Gb RAID Controller
         		17d3 1882  ARC-1882 8/12/16/24 Port PCIe 3.0 to SAS/SATA 6Gb RAID Controller
         		17d3 1883  ARC-1883 8/12/16/24 Port PCIe 3.0 to SAS/SATA 12Gb RAID Controller
        +	1884  ARC-1884 series PCIe 3.0 to SAS/SATA 12/6Gb RAID Controller
         # nee Neterion Inc., previously S2io Inc.
         17d5  Exar Corp.
         	5731  Xframe 10-Gigabit Ethernet PCI-X
        @@ -19348,12 +19363,15 @@
         17e4  Sectra AB
         	0001  KK671 Cardbus encryption board
         	0002  KK672 Cardbus encryption board
        -17e6  Entropic Communications Inc.
        +# nee Entropic Communications Inc.
        +17e6  MaxLinear
         	0010  EN2010 [c.Link] MoCA Network Controller (Coax, PCI interface)
         	0011  EN2010 [c.Link] MoCA Network Controller (Coax, MPEG interface)
         	0021  EN2210 [c.Link] MoCA Network Controller (Coax)
         	0025  EN2510 [c.Link] MoCA Network Controller (Coax, PCIe interface)
         	0027  EN2710 [c.Link] MoCA 2.0 Network Controller (Coax, PCIe interface)
        +	3706  MoCA 2.0 Network Controller (Coax, PCIe interface)
        +	3711  MoCA 2.5 Network Controller (Coax, PCIe interface)
         17ee  Connect Components Ltd
         17f2  Albatron Corp.
         17f3  RDC Semiconductor, Inc.
        @@ -24631,6 +24649,7 @@
         	24f3  Wireless 8260
         # Snow Field Peak AC
         		8086 0010  Dual Band Wireless-AC 8260
        +		8086 1010  Dual Band Wireless-AC 8260
         	24f4  Wireless 8260
         # Snow Field Peak AC
         		8086 0030  Dual Band Wireless-AC 8260
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 11:25:11 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33548DD5160;
         Tue,  8 Aug 2017 11:25:11 +0000 (UTC)
         (envelope-from bapt@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 0B01081442;
         Tue,  8 Aug 2017 11:25:10 +0000 (UTC)
         (envelope-from bapt@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78BPAQg047497;
         Tue, 8 Aug 2017 11:25:10 GMT (envelope-from bapt@FreeBSD.org)
        Received: (from bapt@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78BPALb047496;
         Tue, 8 Aug 2017 11:25:10 GMT (envelope-from bapt@FreeBSD.org)
        Message-Id: <201708081125.v78BPALb047496@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: bapt set sender to
         bapt@FreeBSD.org using -f
        From: Baptiste Daroussin 
        Date: Tue, 8 Aug 2017 11:25:10 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322244 - stable/10/share/misc
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: bapt
        X-SVN-Commit-Paths: stable/10/share/misc
        X-SVN-Commit-Revision: 322244
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 11:25:11 -0000
        
        Author: bapt
        Date: Tue Aug  8 11:25:09 2017
        New Revision: 322244
        URL: https://svnweb.freebsd.org/changeset/base/322244
        
        Log:
          MFC r321812:
          
          Update pci_vendors to 2017.07.27
        
        Modified:
          stable/10/share/misc/pci_vendors
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/share/misc/pci_vendors
        ==============================================================================
        --- stable/10/share/misc/pci_vendors	Tue Aug  8 11:24:40 2017	(r322243)
        +++ stable/10/share/misc/pci_vendors	Tue Aug  8 11:25:09 2017	(r322244)
        @@ -3,8 +3,8 @@
         #
         #	List of PCI ID's
         #
        -#	Version: 2017.07.13
        -#	Date:    2017-07-13 03:15:01
        +#	Version: 2017.07.27
        +#	Date:    2017-07-27 03:15:02
         #
         #	Maintained by Albert Pool, Martin Mares, and other volunteers from
         #	the PCI ID Project at http://pci-ids.ucw.cz/.
        @@ -2436,7 +2436,7 @@
         		144d c0c7  Radeon HD 7550M
         	6842  Thames LE [Radeon HD 7000M Series]
         	6843  Thames [Radeon HD 7670M]
        -	6863  Vega 10 [Radeon Vega Frontier Edition]
        +	6863  Vega 10 XTX [Radeon Vega Frontier Edition]
         	687f  Vega [Radeon RX Vega]
         	6888  Cypress XT [FirePro V8800]
         	6889  Cypress PRO [FirePro V7800]
        @@ -2952,6 +2952,8 @@
         	6987  Polaris12
         	6995  Lexa XT [Radeon PRO WX 2100]
         	699f  Lexa PRO [Radeon RX 550]
        +		148c 2380  Lexa XL [Radeon RX 550]
        +		1da2 e367  Lexa PRO [Radeon RX 550]
         	700f  RS100 AGP Bridge
         	7010  RS200/RS250 AGP Bridge
         	7100  R520 [Radeon X1800 XT]
        @@ -6026,11 +6028,12 @@
         		1077 e4f4  FastLinQ QL45411H 40GbE Adapter
         	1644  FastLinQ QL45000 Series 100GbE Controller
         		1077 e4f8  FastLinQ QL45611H 100GbE Adapter
        +	1654  FastLinQ QL45000 Series 50GbE Controller
        +		1590 0223  Synergy 6810C 25/50Gb Ethernet Adapter
         	1656  FastLinQ QL45000 Series 25GbE Controller
         		1077 02a7  QL45212-DE 25GbE Adapter
         		1077 e4f6  FastLinQ QL45211H 25GbE Adapter
         		1077 e4f7  FastLinQ QL45212H 25GbE Adapter
        -		1590 0223  Synergy 6810C 25/50Gb Ethernet Adapter
         	165c  FastLinQ QL45000 Series 40GbE Controller (FCoE)
         		1077 e4f1  FastLinQ QL45462H 40GbE FCoE Adapter
         		1077 e4f2  FastLinQ QL45461H 40GbE FCoE Adapter
        @@ -16128,6 +16131,8 @@
         	50a0  T540-50A0 Unified Wire Ethernet Controller
         	50a1  T540-50A1 Unified Wire Ethernet Controller
         	50a2  T580-50A2 Unified Wire Ethernet Controller
        +	50a3  T580-50A3 Unified Wire Ethernet Controller
        +	50a4  T540-50A4 Unified Wire Ethernet Controller
         	5401  T520-CR Unified Wire Ethernet Controller
         	5402  T522-CR Unified Wire Ethernet Controller
         	5403  T540-CR Unified Wire Ethernet Controller
        @@ -16181,6 +16186,8 @@
         	54a0  T540-50A0 Unified Wire Ethernet Controller
         	54a1  T540-50A1 Unified Wire Ethernet Controller
         	54a2  T580-50A2 Unified Wire Ethernet Controller
        +	54a3  T580-50A3 Unified Wire Ethernet Controller
        +	54a4  T540-50A4 Unified Wire Ethernet Controller
         	5501  T520-CR Unified Wire Storage Controller
         	5502  T522-CR Unified Wire Storage Controller
         	5503  T540-CR Unified Wire Storage Controller
        @@ -16234,6 +16241,8 @@
         	55a0  T540-50A0 Unified Wire Storage Controller
         	55a1  T540-50A1 Unified Wire Storage Controller
         	55a2  T580-50A2 Unified Wire Storage Controller
        +	55a3  T580-50A3 Unified Wire Storage Controller
        +	55a4  T540-50A4 Unified Wire Storage Controller
         	5601  T520-CR Unified Wire Storage Controller
         	5602  T522-CR Unified Wire Storage Controller
         	5603  T540-CR Unified Wire Storage Controller
        @@ -16287,6 +16296,8 @@
         	56a0  T540-50A0 Unified Wire Storage Controller
         	56a1  T540-50A1 Unified Wire Storage Controller
         	56a2  T580-50A2 Unified Wire Storage Controller
        +	56a3  T580-50A3 Unified Wire Storage Controller
        +	56a4  T540-50A4 Unified Wire Storage Controller
         	5701  T520-CR Unified Wire Ethernet Controller
         	5702  T522-CR Unified Wire Ethernet Controller
         	5703  T540-CR Unified Wire Ethernet Controller
        @@ -16379,6 +16390,8 @@
         	58a0  T540-50A0 Unified Wire Ethernet Controller [VF]
         	58a1  T540-50A1 Unified Wire Ethernet Controller [VF]
         	58a2  T580-50A2 Unified Wire Ethernet Controller [VF]
        +	58a3  T580-50A3 Unified Wire Ethernet Controller [VF]
        +	58a4  T540-50A4 Unified Wire Ethernet Controller [VF]
         	6001  T6225-CR Unified Wire Ethernet Controller
         	6002  T6225-SO-CR Unified Wire Ethernet Controller
         	6003  T6425-CR Unified Wire Ethernet Controller
        @@ -16594,6 +16607,7 @@
         	e836  M115S Hybrid Analog/DVB PAL/SECAM/NTSC Tuner
         	f436  AVerTV Hybrid+FM
         1462  Micro-Star International Co., Ltd. [MSI]
        +	aaf0  Radeon RX 580 Gaming X 8G
         1463  Fast Corporation
         1464  Interactive Circuits & Systems Ltd
         1465  GN NETTEST Telecom DIV.
        @@ -19273,6 +19287,7 @@
         		17d3 1880  ARC-1880 8/12/16/24 Port PCIe 2.0 to SAS/SATA 6Gb RAID Controller
         		17d3 1882  ARC-1882 8/12/16/24 Port PCIe 3.0 to SAS/SATA 6Gb RAID Controller
         		17d3 1883  ARC-1883 8/12/16/24 Port PCIe 3.0 to SAS/SATA 12Gb RAID Controller
        +	1884  ARC-1884 series PCIe 3.0 to SAS/SATA 12/6Gb RAID Controller
         # nee Neterion Inc., previously S2io Inc.
         17d5  Exar Corp.
         	5731  Xframe 10-Gigabit Ethernet PCI-X
        @@ -19348,12 +19363,15 @@
         17e4  Sectra AB
         	0001  KK671 Cardbus encryption board
         	0002  KK672 Cardbus encryption board
        -17e6  Entropic Communications Inc.
        +# nee Entropic Communications Inc.
        +17e6  MaxLinear
         	0010  EN2010 [c.Link] MoCA Network Controller (Coax, PCI interface)
         	0011  EN2010 [c.Link] MoCA Network Controller (Coax, MPEG interface)
         	0021  EN2210 [c.Link] MoCA Network Controller (Coax)
         	0025  EN2510 [c.Link] MoCA Network Controller (Coax, PCIe interface)
         	0027  EN2710 [c.Link] MoCA 2.0 Network Controller (Coax, PCIe interface)
        +	3706  MoCA 2.0 Network Controller (Coax, PCIe interface)
        +	3711  MoCA 2.5 Network Controller (Coax, PCIe interface)
         17ee  Connect Components Ltd
         17f2  Albatron Corp.
         17f3  RDC Semiconductor, Inc.
        @@ -24631,6 +24649,7 @@
         	24f3  Wireless 8260
         # Snow Field Peak AC
         		8086 0010  Dual Band Wireless-AC 8260
        +		8086 1010  Dual Band Wireless-AC 8260
         	24f4  Wireless 8260
         # Snow Field Peak AC
         		8086 0030  Dual Band Wireless-AC 8260
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 11:35:32 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96915DD5D39;
         Tue,  8 Aug 2017 11:35:32 +0000 (UTC)
         (envelope-from bapt@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 0FF3F8205B;
         Tue,  8 Aug 2017 11:35:29 +0000 (UTC)
         (envelope-from bapt@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78BZSFn051738;
         Tue, 8 Aug 2017 11:35:28 GMT (envelope-from bapt@FreeBSD.org)
        Received: (from bapt@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78BZRe3051731;
         Tue, 8 Aug 2017 11:35:27 GMT (envelope-from bapt@FreeBSD.org)
        Message-Id: <201708081135.v78BZRe3051731@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: bapt set sender to
         bapt@FreeBSD.org using -f
        From: Baptiste Daroussin 
        Date: Tue, 8 Aug 2017 11:35:27 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322249 - in stable/11: contrib/mdocml usr.bin/mandoc
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: bapt
        X-SVN-Commit-Paths: in stable/11: contrib/mdocml usr.bin/mandoc
        X-SVN-Commit-Revision: 322249
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 11:35:32 -0000
        
        Author: bapt
        Date: Tue Aug  8 11:35:27 2017
        New Revision: 322249
        URL: https://svnweb.freebsd.org/changeset/base/322249
        
        Log:
          MFC r313958, r319717, r321810
          
          r313958:
          Import mandoc 1.4.1rc2
          
          r319717:
          Import mandoc snapshot 2017-06-08
          
          It implements missing man(7) macros used in base by kerberos/ntp and makes them
          supported by mandoc.
          
          This import should have been done before the removal of groff.
          
          Reported by:	gordon
          
          r321810:
          Update mandoc to 1.14.2
        
        Added:
          stable/11/contrib/mdocml/catman.8
             - copied, changed from r313958, head/contrib/mdocml/catman.8
          stable/11/contrib/mdocml/catman.c
             - copied unchanged from r313958, head/contrib/mdocml/catman.c
          stable/11/contrib/mdocml/compat_recallocarray.c
             - copied unchanged from r321810, head/contrib/mdocml/compat_recallocarray.c
          stable/11/contrib/mdocml/man.options.1
             - copied, changed from r313958, head/contrib/mdocml/man.options.1
          stable/11/contrib/mdocml/mandoc_xr.c
             - copied unchanged from r321810, head/contrib/mdocml/mandoc_xr.c
          stable/11/contrib/mdocml/mandoc_xr.h
             - copied unchanged from r321810, head/contrib/mdocml/mandoc_xr.h
          stable/11/contrib/mdocml/mandocd.8
             - copied, changed from r313958, head/contrib/mdocml/mandocd.8
          stable/11/contrib/mdocml/mandocd.c
             - copied, changed from r313958, head/contrib/mdocml/mandocd.c
          stable/11/contrib/mdocml/mdoc_markdown.c
             - copied, changed from r319717, head/contrib/mdocml/mdoc_markdown.c
          stable/11/contrib/mdocml/roff_html.c
             - copied, changed from r319717, head/contrib/mdocml/roff_html.c
          stable/11/contrib/mdocml/roff_term.c
             - copied, changed from r319717, head/contrib/mdocml/roff_term.c
          stable/11/contrib/mdocml/roff_validate.c
             - copied, changed from r319717, head/contrib/mdocml/roff_validate.c
          stable/11/contrib/mdocml/term_tab.c
             - copied, changed from r319717, head/contrib/mdocml/term_tab.c
          stable/11/contrib/mdocml/test-O_DIRECTORY.c
             - copied unchanged from r313958, head/contrib/mdocml/test-O_DIRECTORY.c
          stable/11/contrib/mdocml/test-cmsg.c
             - copied unchanged from r313958, head/contrib/mdocml/test-cmsg.c
          stable/11/contrib/mdocml/test-recallocarray.c
             - copied unchanged from r321810, head/contrib/mdocml/test-recallocarray.c
          stable/11/contrib/mdocml/test-recvmsg.c
             - copied unchanged from r313958, head/contrib/mdocml/test-recvmsg.c
        Deleted:
          stable/11/contrib/mdocml/man_hash.c
          stable/11/contrib/mdocml/manpage.c
          stable/11/contrib/mdocml/mdoc_hash.c
        Modified:
          stable/11/contrib/mdocml/INSTALL
          stable/11/contrib/mdocml/LICENSE
          stable/11/contrib/mdocml/Makefile
          stable/11/contrib/mdocml/Makefile.depend
          stable/11/contrib/mdocml/NEWS
          stable/11/contrib/mdocml/TODO
          stable/11/contrib/mdocml/apropos.1
          stable/11/contrib/mdocml/att.c
          stable/11/contrib/mdocml/cgi.c
          stable/11/contrib/mdocml/cgi.h.example
          stable/11/contrib/mdocml/chars.c
          stable/11/contrib/mdocml/compat_fts.c
          stable/11/contrib/mdocml/config.h
          stable/11/contrib/mdocml/configure
          stable/11/contrib/mdocml/configure.local.example
          stable/11/contrib/mdocml/dba.c
          stable/11/contrib/mdocml/dbm_map.c
          stable/11/contrib/mdocml/demandoc.c
          stable/11/contrib/mdocml/eqn.7
          stable/11/contrib/mdocml/eqn.c
          stable/11/contrib/mdocml/eqn_html.c
          stable/11/contrib/mdocml/eqn_term.c
          stable/11/contrib/mdocml/gmdiff
          stable/11/contrib/mdocml/html.c
          stable/11/contrib/mdocml/html.h
          stable/11/contrib/mdocml/lib.c
          stable/11/contrib/mdocml/libman.h
          stable/11/contrib/mdocml/libmandoc.h
          stable/11/contrib/mdocml/libmdoc.h
          stable/11/contrib/mdocml/libroff.h
          stable/11/contrib/mdocml/main.c
          stable/11/contrib/mdocml/main.h
          stable/11/contrib/mdocml/makewhatis.8
          stable/11/contrib/mdocml/man.1
          stable/11/contrib/mdocml/man.7
          stable/11/contrib/mdocml/man.c
          stable/11/contrib/mdocml/man.cgi.3
          stable/11/contrib/mdocml/man.cgi.8
          stable/11/contrib/mdocml/man.h
          stable/11/contrib/mdocml/man_html.c
          stable/11/contrib/mdocml/man_macro.c
          stable/11/contrib/mdocml/man_term.c
          stable/11/contrib/mdocml/man_validate.c
          stable/11/contrib/mdocml/manconf.h
          stable/11/contrib/mdocml/mandoc.1
          stable/11/contrib/mdocml/mandoc.3
          stable/11/contrib/mdocml/mandoc.c
          stable/11/contrib/mdocml/mandoc.css
          stable/11/contrib/mdocml/mandoc.h
          stable/11/contrib/mdocml/mandoc_aux.c
          stable/11/contrib/mdocml/mandoc_aux.h
          stable/11/contrib/mdocml/mandoc_char.7
          stable/11/contrib/mdocml/mandoc_escape.3
          stable/11/contrib/mdocml/mandoc_headers.3
          stable/11/contrib/mdocml/mandoc_html.3
          stable/11/contrib/mdocml/mandocdb.c
          stable/11/contrib/mdocml/manpath.c
          stable/11/contrib/mdocml/mansearch.3
          stable/11/contrib/mdocml/mansearch.c
          stable/11/contrib/mdocml/mansearch.h
          stable/11/contrib/mdocml/mdoc.7
          stable/11/contrib/mdocml/mdoc.c
          stable/11/contrib/mdocml/mdoc.h
          stable/11/contrib/mdocml/mdoc_argv.c
          stable/11/contrib/mdocml/mdoc_html.c
          stable/11/contrib/mdocml/mdoc_macro.c
          stable/11/contrib/mdocml/mdoc_man.c
          stable/11/contrib/mdocml/mdoc_state.c
          stable/11/contrib/mdocml/mdoc_term.c
          stable/11/contrib/mdocml/mdoc_validate.c
          stable/11/contrib/mdocml/msec.in
          stable/11/contrib/mdocml/out.c
          stable/11/contrib/mdocml/out.h
          stable/11/contrib/mdocml/preconv.c
          stable/11/contrib/mdocml/read.c
          stable/11/contrib/mdocml/roff.7
          stable/11/contrib/mdocml/roff.c
          stable/11/contrib/mdocml/roff.h
          stable/11/contrib/mdocml/roff_int.h
          stable/11/contrib/mdocml/soelim.1
          stable/11/contrib/mdocml/st.c
          stable/11/contrib/mdocml/st.in
          stable/11/contrib/mdocml/tag.c
          stable/11/contrib/mdocml/tbl.7
          stable/11/contrib/mdocml/tbl.c
          stable/11/contrib/mdocml/tbl_data.c
          stable/11/contrib/mdocml/tbl_html.c
          stable/11/contrib/mdocml/tbl_layout.c
          stable/11/contrib/mdocml/tbl_term.c
          stable/11/contrib/mdocml/term.c
          stable/11/contrib/mdocml/term.h
          stable/11/contrib/mdocml/term_ascii.c
          stable/11/contrib/mdocml/term_ps.c
          stable/11/contrib/mdocml/tree.c
          stable/11/usr.bin/mandoc/Makefile
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/contrib/mdocml/INSTALL
        ==============================================================================
        --- stable/11/contrib/mdocml/INSTALL	Tue Aug  8 11:35:02 2017	(r322248)
        +++ stable/11/contrib/mdocml/INSTALL	Tue Aug  8 11:35:27 2017	(r322249)
        @@ -1,22 +1,24 @@
        -$Id: INSTALL,v 1.17 2016/07/19 22:40:33 schwarze Exp $
        +$Id: INSTALL,v 1.20 2017/07/28 14:57:56 schwarze Exp $
         
        -About mdocml, the portable mandoc distribution
        -----------------------------------------------
        -The mandoc manpage compiler toolset is a suite of tools compiling
        -mdoc(7), the roff(7) macro language of choice for BSD manual pages,
        -and man(7), the predominant historical language for UNIX manuals.
        +About the portable mandoc distribution
        +--------------------------------------
        +The mandoc manpage compiler toolset (formerly called "mdocml")
        +is a suite of tools compiling mdoc(7), the roff(7) macro language
        +of choice for BSD manual pages, and man(7), the predominant
        +historical language for UNIX manuals.
        +
         It includes a man(1) manual viewer and additional tools.
        -For general information, see .
        +For general information, see .
         
         In case you have questions or want to provide feedback, read
        -.  Consider subscribing to the
        +.  Consider subscribing to the
         discuss@ mailing list mentioned on that page.  If you intend to
         help with the development of mandoc, consider subscribing to the
         tech@ mailing list, too.
         
         Enjoy using the mandoc toolset!
         
        -Ingo Schwarze, Karlsruhe, July 2016
        +Ingo Schwarze, Karlsruhe, July 2017
         
         
         Installation
        @@ -25,21 +27,27 @@ Before manually installing mandoc on your system, plea
         whether the newest version of mandoc is already installed by default
         or available via a binary package or a ports system.  A list of the
         latest bundled and ported versions of mandoc for various operating
        -systems is maintained at .
        +systems is maintained at .
         
         Regarding how packages and ports are maintained for your operating
         system, please consult your operating system documentation.
         To install mandoc manually, the following steps are needed:
         
        -1. If you want to build the CGI program, man.cgi(8), too, run the
        -command "echo BUILD_CGI=1 > configure.local".  Then run "cp
        -cgi.h.examples cgi.h" and edit cgi.h as desired.
        +1. If you want to build the CGI program, man.cgi(8), too,
        +run the command "echo BUILD_CGI=1 >> configure.local".
        +Then run "cp cgi.h.example cgi.h" and edit cgi.h as desired.
         
        -2. Define MANPATH_DEFAULT in configure.local
        +2. If you also want to build the catman(8) utility, run the
        +command "echo BUILD_CATMAN=1 >> configure.local".  Note that it
        +is unlikely to be a drop-in replacement providing the same
        +functionality as your system's "catman", if your operating
        +system contains one.
        +
        +3. Define MANPATH_DEFAULT in configure.local
         if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate
         for your operating system.
         
        -3. Run "./configure".
        +4. Run "./configure".
         This script attempts autoconfiguration of mandoc for your system.
         Read both its standard output and the file "Makefile.local" it
         generates.  If anything looks wrong or different from what you
        @@ -49,27 +57,31 @@ result seems right to you.
         On Solaris 10 and earlier, you may have to run "ksh ./configure"
         because the native /bin/sh lacks some POSIX features.
         
        -4. Run "make".
        +5. Run "make".
         Any POSIX-compatible make, in particular both BSD make and GNU make,
         should work.  If the build fails, look at "configure.local.example"
         and go back to step 2.
         
        -5. Run "make -n install" and check whether everything will be
        +6. Run "make -n install" and check whether everything will be
         installed to the intended places.  Otherwise, put some *DIR or *NM*
        -variables into "configure.local" and go back to step 3.
        +variables into "configure.local" and go back to step 4.
         
        -6. Run "sudo make install".  If you intend to build a binary
        +7. Optionally run the regression suite.
        +Basically, that amounts to "cd regress && ./regress.pl".
        +But you should probably look at "./mandoc -l regress/regress.pl.1"
        +first.
        +
        +8. Run "sudo make install".  If you intend to build a binary
         package using some kind of fake root mechanism, you may need a
         command like "make DESTDIR=... install".  Read the *-install targets
         in the "Makefile" to understand how DESTDIR is used.
         
        -7. Run the command "sudo
        -makewhatis" to build mandoc.db(5) databases in all the directory
        -trees configured in step 6.  Whenever installing new manual pages,
        -re-run makewhatis(8) to update the databases, or apropos(1) will
        -not find the new pages.
        +9. Run the command "sudo makewhatis" to build mandoc.db(5) databases
        +in all the directory trees configured in step 3.  Whenever installing
        +new manual pages, re-run makewhatis(8) to update the databases, or
        +apropos(1) will not find the new pages.
         
        -8. To set up a man.cgi(8) server, read its manual page.
        +10. To set up a man.cgi(8) server, read its manual page.
         
         Note that some man(7) pages may contain low-level roff(7) markup
         that mandoc does not yet understand.  On some BSD systems using
        @@ -87,9 +99,10 @@ The following libraries are required:
         
         2. The fts(3) directory traversion functions.
         If your system does not have them, the bundled compatibility version
        -will be used, so you need not worry in that case.  But be careful: the
        -glibc version of fts(3) is known to be broken on 32bit platforms,
        -see .
        +will be used, so you need not worry in that case.  But be careful: old
        +glibc versions of fts(3) were known to be broken on 32bit platforms,
        +see .
        +That was presumably fixed in glibc-2.23.
         If you run into that problem, set "HAVE_FTS=0" in configure.local.
         
         3. Marc Espie's ohash(3) library.
        
        Modified: stable/11/contrib/mdocml/LICENSE
        ==============================================================================
        --- stable/11/contrib/mdocml/LICENSE	Tue Aug  8 11:35:02 2017	(r322248)
        +++ stable/11/contrib/mdocml/LICENSE	Tue Aug  8 11:35:27 2017	(r322249)
        @@ -1,18 +1,19 @@
        -$Id: LICENSE,v 1.13 2016/10/18 14:15:33 schwarze Exp $
        +$Id: LICENSE,v 1.17 2017/06/23 15:58:14 schwarze Exp $
         
         With the exceptions noted below, all code and documentation
        -contained in the mdocml toolkit is protected by the Copyright
        +contained in the mandoc toolkit is protected by the Copyright
         of the following developers:
         
         Copyright (c) 2008-2012, 2014 Kristaps Dzonsons 
        -Copyright (c) 2010-2016 Ingo Schwarze 
        +Copyright (c) 2010-2017 Ingo Schwarze 
         Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger 
         Copyright (c) 2013 Franco Fichtner 
         Copyright (c) 2014 Baptiste Daroussin 
         Copyright (c) 2016 Ed Maste 
        +Copyright (c) 2017 Michael Stapelberg 
         Copyright (c) 1999, 2004 Marc Espie 
         Copyright (c) 1998, 2004, 2010 Todd C. Miller 
        -Copyright (c) 2008 Otto Moerbeek 
        +Copyright (c) 2008, 2017 Otto Moerbeek 
         Copyright (c) 2004 Ted Unangst 
         Copyright (c) 1994 Christos Zoulas 
         Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre 
        @@ -21,7 +22,7 @@ See the individual source files for information about 
         to which file during which years.
         
         
        -The mdocml distribution as a whole is distributed by its developers
        +The mandoc distribution as a whole is distributed by its developers
         under the following license:
         
         Permission to use, copy, modify, and distribute this software for any
        
        Modified: stable/11/contrib/mdocml/Makefile
        ==============================================================================
        --- stable/11/contrib/mdocml/Makefile	Tue Aug  8 11:35:02 2017	(r322248)
        +++ stable/11/contrib/mdocml/Makefile	Tue Aug  8 11:35:27 2017	(r322249)
        @@ -1,7 +1,7 @@
        -# $Id: Makefile,v 1.493 2016/11/19 15:24:51 schwarze Exp $
        +# $Id: Makefile,v 1.516 2017/07/20 16:24:53 schwarze Exp $
         #
         # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons 
        -# Copyright (c) 2011, 2013-2016 Ingo Schwarze 
        +# Copyright (c) 2011, 2013-2017 Ingo Schwarze 
         #
         # Permission to use, copy, modify, and distribute this software for any
         # purpose with or without fee is hereby granted, provided that the above
        @@ -15,11 +15,12 @@
         # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
         # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
         
        -VERSION = 1.14.0
        +VERSION = 1.14.2
         
         # === LIST OF FILES ====================================================
         
         TESTSRCS	 = test-be32toh.c \
        +		   test-cmsg.c \
         		   test-dirent-namlen.c \
         		   test-EFTYPE.c \
         		   test-err.c \
        @@ -30,11 +31,14 @@ TESTSRCS	 = test-be32toh.c \
         		   test-mkdtemp.c \
         		   test-nanosleep.c \
         		   test-ntohl.c \
        +		   test-O_DIRECTORY.c \
         		   test-ohash.c \
         		   test-PATH_MAX.c \
         		   test-pledge.c \
         		   test-progname.c \
        +		   test-recvmsg.c \
         		   test-reallocarray.c \
        +		   test-recallocarray.c \
         		   test-rewb-bsd.c \
         		   test-rewb-sysv.c \
         		   test-sandbox_init.c \
        @@ -49,6 +53,7 @@ TESTSRCS	 = test-be32toh.c \
         		   test-wchar.c
         
         SRCS		 = att.c \
        +		   catman.c \
         		   cgi.c \
         		   chars.c \
         		   compat_err.c \
        @@ -60,6 +65,7 @@ SRCS		 = att.c \
         		   compat_ohash.c \
         		   compat_progname.c \
         		   compat_reallocarray.c \
        +		   compat_recallocarray.c \
         		   compat_strcasestr.c \
         		   compat_stringlist.c \
         		   compat_strlcat.c \
        @@ -81,7 +87,6 @@ SRCS		 = att.c \
         		   lib.c \
         		   main.c \
         		   man.c \
        -		   man_hash.c \
         		   man_html.c \
         		   man_macro.c \
         		   man_term.c \
        @@ -89,16 +94,17 @@ SRCS		 = att.c \
         		   mandoc.c \
         		   mandoc_aux.c \
         		   mandoc_ohash.c \
        +		   mandoc_xr.c \
        +		   mandocd.c \
         		   mandocdb.c \
        -		   manpage.c \
         		   manpath.c \
         		   mansearch.c \
         		   mdoc.c \
         		   mdoc_argv.c \
        -		   mdoc_hash.c \
         		   mdoc_html.c \
         		   mdoc_macro.c \
         		   mdoc_man.c \
        +		   mdoc_markdown.c \
         		   mdoc_state.c \
         		   mdoc_term.c \
         		   mdoc_validate.c \
        @@ -107,6 +113,9 @@ SRCS		 = att.c \
         		   preconv.c \
         		   read.c \
         		   roff.c \
        +		   roff_html.c \
        +		   roff_term.c \
        +		   roff_validate.c \
         		   soelim.c \
         		   st.c \
         		   tag.c \
        @@ -119,6 +128,7 @@ SRCS		 = att.c \
         		   term.c \
         		   term_ascii.c \
         		   term_ps.c \
        +		   term_tab.c \
         		   tree.c
         
         DISTFILES	 = INSTALL \
        @@ -128,6 +138,7 @@ DISTFILES	 = INSTALL \
         		   NEWS \
         		   TODO \
         		   apropos.1 \
        +		   catman.8 \
         		   cgi.h.example \
         		   compat_fts.h \
         		   compat_ohash.h \
        @@ -156,6 +167,7 @@ DISTFILES	 = INSTALL \
         		   man.cgi.8 \
         		   man.conf.5 \
         		   man.h \
        +		   man.options.1 \
         		   manconf.h \
         		   mandoc.1 \
         		   mandoc.3 \
        @@ -169,6 +181,8 @@ DISTFILES	 = INSTALL \
         		   mandoc_html.3 \
         		   mandoc_malloc.3 \
         		   mandoc_ohash.h \
        +		   mandoc_xr.h \
        +		   mandocd.8 \
         		   mansearch.3 \
         		   mansearch.h \
         		   mchars_alloc.3 \
        @@ -190,7 +204,6 @@ DISTFILES	 = INSTALL \
         		   $(TESTSRCS)
         
         LIBMAN_OBJS	 = man.o \
        -		   man_hash.o \
         		   man_macro.o \
         		   man_validate.o
         
        @@ -198,7 +211,6 @@ LIBMDOC_OBJS	 = att.o \
         		   lib.o \
         		   mdoc.o \
         		   mdoc_argv.o \
        -		   mdoc_hash.o \
         		   mdoc_macro.o \
         		   mdoc_state.o \
         		   mdoc_validate.o \
        @@ -206,6 +218,7 @@ LIBMDOC_OBJS	 = att.o \
         
         LIBROFF_OBJS	 = eqn.o \
         		   roff.o \
        +		   roff_validate.o \
         		   tbl.o \
         		   tbl_data.o \
         		   tbl_layout.o \
        @@ -218,6 +231,7 @@ LIBMANDOC_OBJS	 = $(LIBMAN_OBJS) \
         		   mandoc.o \
         		   mandoc_aux.o \
         		   mandoc_ohash.o \
        +		   mandoc_xr.o \
         		   msec.o \
         		   preconv.o \
         		   read.o
        @@ -231,6 +245,7 @@ COMPAT_OBJS	 = compat_err.o \
         		   compat_ohash.o \
         		   compat_progname.o \
         		   compat_reallocarray.o \
        +		   compat_recallocarray.o \
         		   compat_strcasestr.o \
         		   compat_strlcat.o \
         		   compat_strlcpy.o \
        @@ -242,16 +257,17 @@ MANDOC_HTML_OBJS = eqn_html.o \
         		   html.o \
         		   man_html.o \
         		   mdoc_html.o \
        +		   roff_html.o \
         		   tbl_html.o
         
        -MANDOC_MAN_OBJS  = mdoc_man.o
        -
         MANDOC_TERM_OBJS = eqn_term.o \
         		   man_term.o \
         		   mdoc_term.o \
        +		   roff_term.o \
         		   term.o \
         		   term_ascii.o \
         		   term_ps.o \
        +		   term_tab.o \
         		   tbl_term.o
         
         DBM_OBJS	 = dbm.o \
        @@ -271,6 +287,8 @@ MAIN_OBJS	 = $(MANDOC_HTML_OBJS) \
         		   $(DBA_OBJS) \
         		   main.o \
         		   manpath.o \
        +		   mdoc_man.o \
        +		   mdoc_markdown.o \
         		   out.o \
         		   tag.o \
         		   tree.o
        @@ -280,9 +298,11 @@ CGI_OBJS	 = $(MANDOC_HTML_OBJS) \
         		   cgi.o \
         		   out.o
         
        -MANPAGE_OBJS	 = $(DBM_OBJS) \
        -		   manpage.o \
        -		   manpath.o
        +MANDOCD_OBJS	 = $(MANDOC_HTML_OBJS) \
        +		   $(MANDOC_TERM_OBJS) \
        +		   mandocd.o \
        +		   out.o \
        +		   tag.o
         
         DEMANDOC_OBJS	 = demandoc.o
         
        @@ -298,6 +318,7 @@ WWW_MANS	 = apropos.1.html \
         		   man.1.html \
         		   mandoc.1.html \
         		   soelim.1.html \
        +		   man.cgi.3.html \
         		   mandoc.3.html \
         		   mandoc_escape.3.html \
         		   mandoc_headers.3.html \
        @@ -311,11 +332,12 @@ WWW_MANS	 = apropos.1.html \
         		   eqn.7.html \
         		   man.7.html \
         		   mandoc_char.7.html \
        +		   mandocd.8.html \
         		   mdoc.7.html \
         		   roff.7.html \
         		   tbl.7.html \
        +		   catman.8.html \
         		   makewhatis.8.html \
        -		   man.cgi.3.html \
         		   man.cgi.8.html \
         		   man.h.html \
         		   manconf.h.html \
        @@ -325,24 +347,17 @@ WWW_MANS	 = apropos.1.html \
         		   mdoc.h.html \
         		   roff.h.html
         
        -WWW_OBJS	 = mdocml.tar.gz \
        -		   mdocml.sha256
        -
         # === USER CONFIGURATION ===============================================
         
         include Makefile.local
         
         # === DEPENDENCY HANDLING ==============================================
         
        -all: base-build $(BUILD_TARGETS) Makefile.local
        +all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile.local
         
        -base-build: mandoc demandoc soelim
        -
        -cgi-build: man.cgi
        -
         install: base-install $(INSTALL_TARGETS)
         
        -www: $(WWW_OBJS) $(WWW_MANS)
        +www: $(WWW_MANS)
         
         $(WWW_MANS): mandoc
         
        @@ -360,13 +375,13 @@ clean:
         	rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
         	rm -f mandoc $(MAIN_OBJS)
         	rm -f man.cgi $(CGI_OBJS)
        -	rm -f manpage $(MANPAGE_OBJS)
        +	rm -f mandocd catman catman.o $(MANDOCD_OBJS)
         	rm -f demandoc $(DEMANDOC_OBJS)
         	rm -f soelim $(SOELIM_OBJS)
        -	rm -f $(WWW_MANS) $(WWW_OBJS)
        +	rm -f $(WWW_MANS) mandoc.tar.gz mandoc.sha256
         	rm -rf *.dSYM
         
        -base-install: base-build
        +base-install: mandoc demandoc soelim
         	mkdir -p $(DESTDIR)$(BINDIR)
         	mkdir -p $(DESTDIR)$(SBINDIR)
         	mkdir -p $(DESTDIR)$(MANDIR)/man1
        @@ -375,29 +390,28 @@ base-install: base-build
         	mkdir -p $(DESTDIR)$(MANDIR)/man8
         	$(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR)
         	$(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM)
        -	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN)
        -	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS)
        -	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS)
        -	ln -f $(DESTDIR)$(BINDIR)/mandoc \
        -		$(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS)
        +	cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_MAN)
        +	cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_APROPOS)
        +	cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_WHATIS)
        +	cd $(DESTDIR)$(SBINDIR) && \
        +		$(LN) ${BIN_FROM_SBIN}/mandoc $(BINM_MAKEWHATIS)
         	$(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
         	$(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1
         	$(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1
         	$(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1
        -	ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \
        -		$(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1
        -	$(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/${MANM_MANCONF}.5
        +	cd $(DESTDIR)$(MANDIR)/man1 && $(LN) $(BINM_APROPOS).1 $(BINM_WHATIS).1
        +	$(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5
         	$(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5
        -	$(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7
        -	$(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MDOC}.7
        -	$(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/${MANM_ROFF}.7
        -	$(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/${MANM_EQN}.7
        -	$(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/${MANM_TBL}.7
        +	$(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7
        +	$(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7
        +	$(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7
        +	$(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7
        +	$(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7
         	$(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
         	$(INSTALL_MAN) makewhatis.8 \
         		$(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
         
        -lib-install: base-build
        +lib-install: libmandoc.a
         	mkdir -p $(DESTDIR)$(LIBDIR)
         	mkdir -p $(DESTDIR)$(INCLUDEDIR)
         	mkdir -p $(DESTDIR)$(MANDIR)/man3
        @@ -407,13 +421,70 @@ lib-install: base-build
         	$(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \
         		mansearch.3 mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3
         
        -cgi-install: cgi-build
        +cgi-install: man.cgi
         	mkdir -p $(DESTDIR)$(CGIBINDIR)
         	mkdir -p $(DESTDIR)$(HTDOCDIR)
         	$(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR)
         	$(INSTALL_DATA) mandoc.css $(DESTDIR)$(HTDOCDIR)
         
        -Makefile.local config.h: configure ${TESTSRCS}
        +catman-install: mandocd catman
        +	mkdir -p $(DESTDIR)$(SBINDIR)
        +	mkdir -p $(DESTDIR)$(MANDIR)/man8
        +	$(INSTALL_PROGRAM) mandocd $(DESTDIR)$(SBINDIR)
        +	$(INSTALL_PROGRAM) catman $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN)
        +	$(INSTALL_MAN) mandocd.8 $(DESTDIR)$(MANDIR)/man8
        +	$(INSTALL_MAN) catman.8 $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8
        +
        +uninstall:
        +	rm -f $(DESTDIR)$(BINDIR)/mandoc
        +	rm -f $(DESTDIR)$(BINDIR)/demandoc
        +	rm -f $(DESTDIR)$(BINDIR)/$(BINM_SOELIM)
        +	rm -f $(DESTDIR)$(BINDIR)/$(BINM_MAN)
        +	rm -f $(DESTDIR)$(BINDIR)/$(BINM_APROPOS)
        +	rm -f $(DESTDIR)$(BINDIR)/$(BINM_WHATIS)
        +	rm -f $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS)
        +	rm -f $(DESTDIR)$(MANDIR)/man1/mandoc.1
        +	rm -f $(DESTDIR)$(MANDIR)/man1/demandoc.1
        +	rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1
        +	rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1
        +	rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1
        +	rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1
        +	rm -f $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5
        +	rm -f $(DESTDIR)$(MANDIR)/man5/mandoc.db.5
        +	rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7
        +	rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7
        +	rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7
        +	rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7
        +	rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7
        +	rm -f $(DESTDIR)$(MANDIR)/man7/mandoc_char.7
        +	rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
        +	rm -f $(DESTDIR)$(CGIBINDIR)/man.cgi
        +	rm -f $(DESTDIR)$(HTDOCDIR)/mandoc.css
        +	rm -f $(DESTDIR)$(SBINDIR)/mandocd
        +	rm -f $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN)
        +	rm -f $(DESTDIR)$(MANDIR)/man8/mandocd.8
        +	rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8
        +	rm -f $(DESTDIR)$(LIBDIR)/libmandoc.a
        +	rm -f $(DESTDIR)$(MANDIR)/man3/mandoc.3
        +	rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_escape.3
        +	rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_malloc.3
        +	rm -f $(DESTDIR)$(MANDIR)/man3/mansearch.3
        +	rm -f $(DESTDIR)$(MANDIR)/man3/mchars_alloc.3
        +	rm -f $(DESTDIR)$(MANDIR)/man3/tbl.3
        +	rm -f $(DESTDIR)$(INCLUDEDIR)/man.h
        +	rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc.h
        +	rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc_aux.h
        +	rm -f $(DESTDIR)$(INCLUDEDIR)/mdoc.h
        +	rm -f $(DESTDIR)$(INCLUDEDIR)/roff.h
        +	[ ! -e $(DESTDIR)$(INCLUDEDIR) ] || rmdir $(DESTDIR)$(INCLUDEDIR)
        +
        +regress: all
        +	cd regress && ./regress.pl
        +
        +regress-clean:
        +	cd regress && ./regress.pl . clean
        +
        +Makefile.local config.h: configure $(TESTSRCS)
         	@echo "$@ is out of date; please run ./configure"
         	@exit 1
         
        @@ -423,12 +494,15 @@ libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
         mandoc: $(MAIN_OBJS) libmandoc.a
         	$(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD)
         
        -manpage: $(MANPAGE_OBJS) libmandoc.a
        -	$(CC) -o $@ $(LDFLAGS) $(MANPAGE_OBJS) libmandoc.a $(LDADD)
        -
         man.cgi: $(CGI_OBJS) libmandoc.a
         	$(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
         
        +mandocd: $(MANDOCD_OBJS) libmandoc.a
        +	$(CC) -o $@ $(LDFLAGS) $(MANDOCD_OBJS) libmandoc.a $(LDADD)
        +
        +catman: catman.o libmandoc.a
        +	$(CC) -o $@ $(LDFLAGS) catman.o libmandoc.a $(LDADD)
        +
         demandoc: $(DEMANDOC_OBJS) libmandoc.a
         	$(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
         
        @@ -438,13 +512,7 @@ soelim: $(SOELIM_OBJS)
         # --- maintainer targets ---
         
         www-install: www
        -	mkdir -p $(HTDOCDIR)/snapshots
         	$(INSTALL_DATA) $(WWW_MANS) mandoc.css $(HTDOCDIR)
        -	$(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots
        -	$(INSTALL_DATA) mdocml.tar.gz \
        -		$(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz
        -	$(INSTALL_DATA) mdocml.sha256 \
        -		$(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256
         
         depend: config.h
         	mkdep -f Makefile.depend $(CFLAGS) $(SRCS)
        @@ -453,16 +521,43 @@ depend: config.h
         		Makefile.depend > Makefile.tmp
         	mv Makefile.tmp Makefile.depend
         
        -dist: mdocml.sha256
        +regress-distclean:
        +	@find regress \
        +		-name '.#*' -o \
        +		-name '*.orig' -o \
        +		-name '*.rej' -o \
        +		-name '*.core' \
        +		-exec rm -i {} \;
         
        -mdocml.sha256: mdocml.tar.gz
        -	sha256 mdocml.tar.gz > $@
        +regress-distcheck:
        +	@find regress ! -type d ! -type f
        +	@find regress -type f \
        +		! -path '*/CVS/*' \
        +		! -name Makefile \
        +		! -name Makefile.inc \
        +		! -name '*.in' \
        +		! -name '*.out_ascii' \
        +		! -name '*.out_utf8' \
        +		! -name '*.out_html' \
        +		! -name '*.out_markdown' \
        +		! -name '*.out_lint' \
        +		! -path regress/regress.pl \
        +		! -path regress/regress.pl.1
         
        -mdocml.tar.gz: $(DISTFILES)
        -	mkdir -p .dist/mdocml-$(VERSION)/
        -	$(INSTALL) -m 0644 $(DISTFILES) .dist/mdocml-$(VERSION)
        -	chmod 755 .dist/mdocml-$(VERSION)/configure
        -	( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) )
        +dist: mandoc.sha256
        +
        +mandoc.sha256: mandoc.tar.gz
        +	sha256 mandoc.tar.gz > $@
        +
        +mandoc.tar.gz: $(DISTFILES)
        +	ls regress/*/*/*.mandoc_* && exit 1 || true
        +	mkdir -p .dist/mandoc-$(VERSION)/
        +	$(INSTALL) -m 0644 $(DISTFILES) .dist/mandoc-$(VERSION)
        +	cp -pR regress .dist/mandoc-$(VERSION)
        +	find .dist/mandoc-$(VERSION)/regress \
        +	    -type d -name CVS -print0 | xargs -0 rm -rf
        +	chmod 755 .dist/mandoc-$(VERSION)/configure
        +	( cd .dist/ && tar zcf ../$@ mandoc-$(VERSION) )
         	rm -rf .dist/
         
         # === SUFFIX RULES =====================================================
        
        Modified: stable/11/contrib/mdocml/Makefile.depend
        ==============================================================================
        --- stable/11/contrib/mdocml/Makefile.depend	Tue Aug  8 11:35:02 2017	(r322248)
        +++ stable/11/contrib/mdocml/Makefile.depend	Tue Aug  8 11:35:27 2017	(r322249)
        @@ -1,4 +1,5 @@
        -att.o: att.c config.h roff.h mdoc.h libmdoc.h
        +att.o: att.c config.h mandoc.h roff.h mdoc.h libmdoc.h
        +catman.o: catman.c config.h compat_fts.h
         cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mansearch.h cgi.h
         chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h
         compat_err.o: compat_err.c config.h
        @@ -10,6 +11,7 @@ compat_mkdtemp.o: compat_mkdtemp.c config.h
         compat_ohash.o: compat_ohash.c config.h compat_ohash.h
         compat_progname.o: compat_progname.c config.h
         compat_reallocarray.o: compat_reallocarray.c config.h
        +compat_recallocarray.o: compat_recallocarray.c config.h
         compat_strcasestr.o: compat_strcasestr.c config.h
         compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h
         compat_strlcat.o: compat_strlcat.c config.h
        @@ -23,42 +25,45 @@ dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_ar
         dba_write.o: dba_write.c config.h dba_write.h
         dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h
         dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h
        -demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h
        -eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h
        +demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h
        +eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h libroff.h
         eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h
         eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h
        -html.o: html.c config.h mandoc.h mandoc_aux.h out.h html.h manconf.h main.h
        -lib.o: lib.c config.h roff.h mdoc.h libmdoc.h lib.in
        -main.o: main.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h
        +html.o: html.c config.h mandoc_aux.h mandoc.h roff.h out.h html.h manconf.h main.h
        +lib.o: lib.c config.h mandoc.h roff.h mdoc.h libmdoc.h lib.in
        +main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h
         man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
        -man_hash.o: man_hash.c config.h mandoc.h roff.h man.h libmandoc.h libman.h
        -man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h
        +man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h
         man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
         man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h
         man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
        -mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h
        +mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h
         mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h
         mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h
        +mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h
        +mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h main.h manconf.h
         mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h
        -manpage.o: manpage.c config.h manconf.h mansearch.h
         manpath.o: manpath.c config.h mandoc_aux.h manconf.h
         mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h
         mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
         mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
        -mdoc_hash.o: mdoc_hash.c config.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h
        -mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h
        +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h
         mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
         mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h
        +mdoc_markdown.o: mdoc_markdown.c mandoc_aux.h mandoc.h roff.h mdoc.h main.h
         mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h
         mdoc_term.o: mdoc_term.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h term.h tag.h main.h
        -mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
        +mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
         msec.o: msec.c config.h mandoc.h libmandoc.h msec.in
         out.o: out.c config.h mandoc_aux.h mandoc.h out.h
         preconv.o: preconv.c config.h mandoc.h libmandoc.h
        -read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h roff_int.h
        -roff.o: roff.c config.h mandoc.h mandoc_aux.h roff.h libmandoc.h roff_int.h libroff.h predefs.in
        +read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h
        +roff.o: roff.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h roff.h libmandoc.h roff_int.h libroff.h predefs.in
        +roff_html.o: roff_html.c mandoc.h roff.h out.h html.h
        +roff_term.o: roff_term.c mandoc.h roff.h out.h term.h
        +roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h
         soelim.o: soelim.c config.h compat_stringlist.h
        -st.o: st.c config.h roff.h mdoc.h libmdoc.h st.in
        +st.o: st.c config.h mandoc.h roff.h mdoc.h libmdoc.h st.in
         tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h
         tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h
         tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h
        @@ -69,4 +74,5 @@ tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h
         term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h
         term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h manconf.h main.h
         term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h manconf.h main.h
        +term_tab.o: term_tab.c mandoc_aux.h out.h term.h
         tree.o: tree.c config.h mandoc.h roff.h mdoc.h man.h main.h
        
        Modified: stable/11/contrib/mdocml/NEWS
        ==============================================================================
        --- stable/11/contrib/mdocml/NEWS	Tue Aug  8 11:35:02 2017	(r322248)
        +++ stable/11/contrib/mdocml/NEWS	Tue Aug  8 11:35:27 2017	(r322249)
        @@ -1,7 +1,221 @@
        -$Id: NEWS,v 1.12 2016/07/14 11:09:06 schwarze Exp $
        +$Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $
         
        -This file lists the most important changes in the mdocml.bsd.lv distribution.
        +This file lists the most important changes in the mandoc.bsd.lv distribution.
         
        +Changes in version 1.14.2, released on July 28, 2017
        +
        +    --- MAJOR NEW FEATURES ---
        + * New mdoc(7) -Tmarkdown output mode.
        + * For -Thtml, implement internal hyperlinks pointing to authoritative
        +   definitions of various syntax elements, similar to the ctags(1)-like
        +   less(1) :t internal searching in terminal mode.
        + * Provide a superset of the functionality of the former mdoclint(1)
        +   utility and a new -Wstyle message level with several new messages,
        +   including validity checking of .Xr cross references.
        + * tbl(7): Implement automatic line breaking inside individual table
        +   cells, and several other formatting improvements.
        + * eqn(7): Complete rewrite of the lexer, resulting in several bugfixes.
        + * Continue parser unification, in particular allowing generation
        +   of syntax tree nodes on the roff(7) level, allowing implementation
        +   of many additional roff requests.
        +    --- REMOVED FUNCTIONALITY ---
        + * Delete the manpage(1) utility.  It was never enabled in any release.
        + * Delete the -Txhtml command line option.  It has been an obsolete
        +   alias for the -Thtml output mode for more than two years.
        +    --- MINOR NEW FEATURES ---
        + * -Tlint now puts parser messages on stdout instead of stderr,
        +   making commands like "man -l -Tlint *.1" useful.
        + * mdoc(7): Various .Lk formatting improvements.
        + * mdoc(7) -Thtml: Better CSS for .Bl lists.
        + * man(7): Implement the .MT/.ME block macro (mailto hyperlink).
        + * man(7): Implement the .DT macro (restore default tab positions).
        + * man(7): Improved support for manuals generated with reStructuredText
        +   by partial support for the \n[an-margin] number register.
        + * man(7) -Thtml: Support deep linking to .SH and .SS headers.
        + * tbl(7): Implement the "allbox" table option.
        + * tbl(7): Implement the column spacing and the 'w' (minimum column
        +   width) layout modifiers.
        + * tbl(7): Significant improvements of the manual page.
        + * eqn(7): Much improved font selection, including recognition of
        +   well-known function names, and a few other formatting improvements.
        + * eqn(7) -Thtml: Use  and  in addition to .
        + * roff(7): Implement the .ce (centering), .mc (margin character),
        +   .rj (right justify), .ta (define tab stops), .ti (temporary indent),
        +   .als (macro alias), .ec and .eo (escape character control),
        +   .po (page offset), and .rn (macro rename) requests.
        + * roff(7) .am: Implement appending to mdoc(7) and man(7) macros.
        + * roff(7): implement the \h (horizontol motion), \l (horizontal
        +   line drawing), and \p (break output line) escape sequences,
        +   and also several additional character escape sequences.
        + * roff(7): Implement the 'd' conditional (macro or string defined).
        + * man.cgi(8) now uses pledge(2), too.
        + * regress.pl(1): simpler user interface, better summary output,
        +   simpler code, and no more recursion.
        +    --- THANKS TO ---
        + * Anthony Bentley (OpenBSD) for the implementation of .MT/.ME,
        +   reports of many bugs and missing features, and suggestions
        +   for a number of feature and documentation improvements.
        + * Sebastien Marie (OpenBSD) for two source code patches and
        +   for some useful discussions.
        + * Florian Obser (OpenBSD) for a bugfix patch and a bug report.
        + * Jonathan Gray (OpenBSD) for several bug reports from afl(1)
        +   and several more from static analysis tools.
        + * Theo Buehler (OpenBSD) for several bug reports, most from afl(1).
        + * Jason McIntyre (OpenBSD) for many useful discussions about a
        +   wide variety of topics, lots of continuous testing, a number of
        +   bug reports, and some suggestions for messages and documentation.
        + * Thomas Klausner (NetBSD) for lots of help while migrating
        +   mdoclint(1) functionality to mandoc -Tlint, for suggesting
        +   several useful new messages, and for release testing.
        + * Reyk Floeter (OpenBSD) and Vsevolod Stakhov (FreeBSD) for
        +   suggesting a markdown output mode.
        + * Thomas Guettler for suggesting -Thtml internal hyperlinks.
        + * Yuri Pankov (Illumos) for inspiring new warning messages and
        +   for extensive release testing.
        + * Anton Lindqvist and TJ Townsend (both OpenBSD) and Jan Stary
        +   for multiple bug reports.
        + * Leah Neukirchen (Void Linux) for bug reports and release testing.
        + * Michael Stapelberg (Debian) for suggesting feature improvements
        +   and for release testing.
        + * Martin Natano and Theo de Raadt (both OpenBSD), Andreas Voegele,
        +   Gabriel Guzman, Gonzalo Tornaria, Markus Waldeck, and Raf Czlonka
        +   for bug reports.
        + * Antoine Jacoutot (OpenBSD) and Steffen Nurpmeso for suggesting
        +   feature improvements.
        + * Dag-Erling Smoergrav (FreeBSD) for inspiring new warning messages.
        + * Ted Unangst and Marc Espie (OpenBSD) for providing useful ideas.
        + * Svyatoslav Mishyn (Crux Linux) for release testing.
        + * Carsten Kunze (Heirloom roff) for help keeping mandoc and groff
        +   compatible and for committing some of my patches to groff.
        +
        +Changes in version 1.14.1, released on February 21, 2017
        +
        +    --- MAJOR NEW FEATURES ---
        + * apropos(1): Reimplement complete semantic search functionality
        +   without the dependency on SQLite3, using only POSIX APIs.
        +   This comes with a completely new mandoc.db(5) file format.
        + * man(1): Support more than one tag entry for the same search term,
        +   plus some minor improvements to the less(1) :t support.
        + * -Thtml: Use real macro names for CSS classes.
        +   Systematic cleanup of and many improvements to mandoc.css.
        + * -Thtml: Produce human readable HTML code by using indentation
        +   and better line breaks.  Improve various HTML elements,
        +   and trim several useless ones.
        + * New catman(8) utility, still somewhat experimental.
        + * Now includes a portable version of the OpenBSD mandoc regression
        +   suite, see regress/regress.pl.1 for details.
        +    --- REMOVED FUNCTIONALITY ---
        + * Operating systems that don't provide mmap(3) are no longer supported.
        + * Drop support for manpath(1).  Even if your system has manpath(1),
        +   it is simpler to use MANPATH_DEFAULT in configure.local for
        +   operating system defaults, man.conf(5) for machine-specific
        +   modifications, and ${MANPATH}, -m, and -M for user preferences
        +   than to bother with the complexity of manpath(1).
        + * makewhatis(8) -p: No longer warn about missing MLINKS since these
        +   are no longer needed for anything.
        +    --- MINOR NEW FEATURES ---
        + * mdoc(7): Warn about invalid punctuation and content below NAME.
        + * mdoc(7): Warn about .Xr lacking the second argument (section).
        + * mdoc(7): Warn about violations of the rule "new sentence, new line".
        + * roff(7): Warn about trailing whitespace at the end of comments.
        + * mdoc(7): Improve rendering of double quotes.
        + * mdoc(7): Always do text production in the validator, never in the
        +   formatters.  Cleaner, simpler, shorter, helps NetBSD apropos(1)
        +   and also makes -Ttree output more useful.
        + * -Ttree: Show metadata and some additional node flags.
        +   New -Onoval output option to show the unvalidated tree.
        +    --- RELIABILITY BUGFIXES ---
        + * man(1): Make "man -l" work with standard input from a pipe or file,
        +   as long as standard output is a terminal.
        + * man(7): Fix out of bounds read access if a text node immediately
        +   preceded the first .SH header.
        + * mdoc(7): Fix out of bounds read access for .Bl without a type
        +   but with a width.
        + * mdoc(7): Fix out of bounds read access for .Bl -column starting
        +   with a tab character instead of a child .It macro.
        + * mdoc(7): Fix syntax tree corruption leading to segfaults caused
        +   by stray block end macros in nested blocks of mismatching type.
        + * man(1): Fix NULL dereference when the first of multiple pages
        +   shown was preformatted.
        + * mdoc(7): Fix syntax tree corruption leading to NULL dereference
        +   caused by partial implicit macros inside .Bl -column table cells.
        + * mdoc(7): Fix syntax tree corruption leading to NULL dereference
        +   for macro sequences like .Bl .Bl .It Bo .El .It.
        + * mdoc(7): Fix syntax tree corruption leading to NULL dereference
        +   caused by .Ta following a nested .Bl -column breaking another block.
        + * mdoc(7): Fix syntax tree corruption sometimes leading to NULL
        +   dereference caused by indirectly broken .Nd or .Nm blocks.
        + * mdoc(7) -Thtml: Fix a NULL dereference for .Bl -column with 0 columns.
        + * mdoc(7): Fix NULL dereference in some specific cases of a
        +   block-end macro calling another block-end macro.
        + * mdoc(7): Fix NULL dereference if the only child of the head
        +   of the first .Sh was an empty in-line macro.
        + * eqn(7): Fix NULL dereference in the terminal formatter
        +   for empty matrices and empty square roots.
        + * mdoc(7): Fix an assertion failure for a .Bd without a type that
        +   breaks another block.
        + * mdoc(7): Fix an assertion failure that happened for some .Bl -column
        +   lists containing a column width of "-4n", "-3n", or "-2n".
        + * mdoc(7): Fix an assertion failure caused by .Bl -column without .It
        +   but containing eqn(7) or tbl(7) code.
        + * roff(7): Fix an assertion failure caused by \z\[u00FF] with -Tps/-Tpdf.
        + * roff(7): Fix an assertion failures caused by whitespace inside \o''
        +   (overstrike) sequences.
        + * -Thtml: Fix an assertion failure caused by -Oman or -Oincludes of
        +   excessive length.
        +    --- PORTABILITY IMPROVEMENTS ---
        + * man(1): Do not mix stdio narrow and wide stream orientation
        +   on stdout, which could cause output corruption on glibc.
        + * mandoc(1): Autodetect a suitable locale for -Tutf8 mode.
        + * ./configure: Autodetect whether PATH_MAX and O_DIRECTORY are defined.
        + * ./configure: Autodetect if nanosleep(3) needs -lrt.
        + * ./configure: Provide an ${LN} configuration variable.
        + * ./configure: Put compiler arguments that may contain -l at the end.
        +    --- MINOR BUGFIXES ---
        + * mdoc(7): Fix SYNOPSIS output if the first child of .Nm is a macro.
        + * mdoc(7) -Thtml: Improve formatting of .Bl -tag with short tags.
        + * man(7) -Thtml: Preserve whitespace in .nf (nofill) mode.
        + * mandoc(1): Error out on invalid output options on the command line.
        +    --- STRUCTURAL CHANGES, no functional change ---
        + * Redesign part of the mandoc_html(3) interfaces, making them much
        +   easier to use and reducing the amount of code by a few hundred lines.
        +    --- THANKS TO ---
        + * Michael Stapelberg (Debian) for designing the new mandocd(8)
        +   and parts of the new catman(8), for release testing, and for a
        +   number of patches and bug reports.
        + * Baptiste Daroussin (FreeBSD) for profiling the new makewhatis(8)
        +   implementation and suggesting an algorithmic improvement which
        +   more than doubled performance, and for a few bug reports.
        + * Ed Maste (FreeBSD) for an important patch improving reproducibility
        +   of builds in makewhatis(8), and for a few bug reports.
        + * Theo Buehler (OpenBSD) for almost twenty important bug reports,
        +   most of them found by systematic afl(1) fuzzing.
        + * Benny Lofgren, David Dahlberg, and in particular Vadim Zhukov
        +   for crucial help in getting .Bl -tag CSS formatting fixed.
        + * Svyatoslav Mishyn (Crux Linux) for an initial version of the
        +   patch to autodetect a suitable locale for -Tutf8 mode
        +   and for release testing.
        + * Jason McIntyre (OpenBSD) for multiple useful discussions
        +   and a number of bug reports.
        + * Sevan Janiyan (NetBSD) for extensive release testing and multiple
        +   bug reports.
        + * Thomas Klausner and Christos Zoulas (NetBSD), Yuri Pankov (illumos),
        +   and Leah Neukirchen (Void Linux) for release testing and bug reports.
        + * Ulrich Spoerlein (FreeBSD) for release testing.
        + * Alexander Bluhm, Andrew Fresh, Antoine Jacoutot, Antony Bentley,
        +   Christian Weisgerber, Jonathan Gray, Marc Espie, Martijn van Duren,
        +   Stuart Henderson, Ted Unangst, Theo de Raadt (OpenBSD), Abhinav
        +   Upadhyay, Kamil Rytarowski (NetBSD), Aaron M. Ucko, Bdale Garbee,
        +   Reiner Herrmann, Shane Kerr (Debian), Daniel Sabogal (Alpine Linux),
        +   Carsten Kunze (Heirloom roff), Kristaps Dzonsons (bsd.lv),
        +   Anton Lindqvist, Jan Stary, Jeremy A. Mates, Mark Patruck,
        +   Pavan Maddamsetti, Sean Levy , and
        +   Tiago Silva for bug reports.
        + * Brent Cook, Marc Espie, Philip Guenther, Todd Miller (OpenBSD)
        +   and Markus Waldeck for useful discussions.
        + * And as usual, OpenCSW for providing me with a Solaris 9/10/11
        +   testing environment.
        +
         Changes in version 1.13.4, released on July 14, 2016
         
             --- MAJOR NEW FEATURES ---
        @@ -109,7 +323,7 @@ Changes in version 1.13.4, released on July 14, 2016
            again resulting in more than half a dozen important bug reports.
          * Svyatoslav Mishyn (Crux Linux) for some patches, several bug
            reports, and extensive release testing.
        - * Christian Neukirchen (void Linux) for a number of compatibility
        + * Leah Neukirchen (Void Linux) for a number of compatibility
            patches and suggestions and several bug reports.
          * Christos Zoulas (NetBSD) for a bug fix patch and some useful
            suggestions for cleanup.
        @@ -146,11 +360,11 @@ Changes in version 1.13.3, released on March 13, 2015
          * New -Wunsupp message level.
             --- POTENTIONALLY SECURITY RELEVANT BUGFIXES ---
          * Fix a potential write buffer overrun on incomplete string conditionals.
        -   http://mdocml.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.241
        +   http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.241
          * Fix a potential write buffer overrun on backslash at EOF in a conditional.
        -   http://mdocml.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.247
        +   http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.247
          * Fix a use after free sometimes hit when validation deletes a block.
        -   http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c#rev1.180
        +   http://mandoc.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c#rev1.180
             --- MAJOR FUNCTIONALLY RELEVANT BUGFIXES ---
          * Let man(1) show manuals for the current architecture by default,
            and support the MACHINE environment variable.
        @@ -761,4 +975,4 @@ Changes in version 1.9.15, released on February 18, 20
          * and column lengths handled correctly.
         
         For older releases, see the ChangeLog files
        -in http://mdocml.bsd.lv/snapshots/ .
        +in http://mandoc.bsd.lv/snapshots/ .
        
        Modified: stable/11/contrib/mdocml/TODO
        ==============================================================================
        --- stable/11/contrib/mdocml/TODO	Tue Aug  8 11:35:02 2017	(r322248)
        +++ stable/11/contrib/mdocml/TODO	Tue Aug  8 11:35:27 2017	(r322249)
        @@ -1,6 +1,6 @@
         ************************************************************************
         * Official mandoc TODO.
        -* $Id: TODO,v 1.223 2017/01/17 15:32:43 schwarze Exp $
        +* $Id: TODO,v 1.246 2017/07/24 11:15:12 schwarze Exp $
         ************************************************************************
         
         Many issues are annotated for difficulty as follows:
        @@ -61,37 +61,14 @@ are mere guesses, and some may be wrong.
           reported by brad@  Sat, 15 Jan 2011 15:45:23 -0500
           loc ***  exist ***  algo ***  size **  imp *
         
        -- .ta (tab settings)
        -  #1 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100
        -  ircbug(1) gnats(1) reported by brad@  Sat, 15 Jan 2011 15:50:51 -0500
        -  also Tcl_NewStringObj(3) via wiz@  Wed, 5 Mar 2014 22:27:43 +0100
        -  also posix2time(3) Carsten Kunze  Mon, 1 Dec 2014 13:03:10 +0100
        -  loc **  exist ***  algo **  size **  imp ***
        
        *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 13:44:34 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03380DB4492;
         Tue,  8 Aug 2017 13:44:34 +0000 (UTC)
         (envelope-from emaste@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 C57393AA6;
         Tue,  8 Aug 2017 13:44:33 +0000 (UTC)
         (envelope-from emaste@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78DiWs1005117;
         Tue, 8 Aug 2017 13:44:32 GMT (envelope-from emaste@FreeBSD.org)
        Received: (from emaste@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78DiW2O005116;
         Tue, 8 Aug 2017 13:44:32 GMT (envelope-from emaste@FreeBSD.org)
        Message-Id: <201708081344.v78DiW2O005116@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: emaste set sender to
         emaste@FreeBSD.org using -f
        From: Ed Maste 
        Date: Tue, 8 Aug 2017 13:44:32 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322254 - stable/11/usr.sbin/bsdinstall/scripts
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: emaste
        X-SVN-Commit-Paths: stable/11/usr.sbin/bsdinstall/scripts
        X-SVN-Commit-Revision: 322254
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 13:44:34 -0000
        
        Author: emaste
        Date: Tue Aug  8 13:44:32 2017
        New Revision: 322254
        URL: https://svnweb.freebsd.org/changeset/base/322254
        
        Log:
          MFC r321734: bsdinstall: default to UEFI-only boot on arm64
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/11/usr.sbin/bsdinstall/scripts/zfsboot
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/usr.sbin/bsdinstall/scripts/zfsboot
        ==============================================================================
        --- stable/11/usr.sbin/bsdinstall/scripts/zfsboot	Tue Aug  8 13:27:32 2017	(r322253)
        +++ stable/11/usr.sbin/bsdinstall/scripts/zfsboot	Tue Aug  8 13:44:32 2017	(r322254)
        @@ -1554,17 +1554,27 @@ f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSDINSTALL_TMPETC
         f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT"
         
         #
        -# If the system was booted with UEFI, set the default boot type to UEFI
        +# Determine default boot type
         #
        -bootmethod=$( sysctl -n machdep.bootmethod )
        -f_dprintf "machdep.bootmethod=[%s]" "$bootmethod"
        -if [ "$bootmethod" = "UEFI" ]; then
        -	: ${ZFSBOOT_BOOT_TYPE:=BIOS+UEFI}
        +case $(uname -m) in
        +arm64)
        +	# We support only UEFI boot for arm64
        +	: ${ZFSBOOT_BOOT_TYPE:=UEFI}
         	: ${ZFSBOOT_PARTITION_SCHEME:=GPT}
        -else
        -	: ${ZFSBOOT_BOOT_TYPE:=BIOS}
        -	: ${ZFSBOOT_PARTITION_SCHEME:=GPT}
        -fi
        +	;;
        +*)
        +	# If the system was booted with UEFI, set the default boot type to UEFI
        +	bootmethod=$( sysctl -n machdep.bootmethod )
        +	f_dprintf "machdep.bootmethod=[%s]" "$bootmethod"
        +	if [ "$bootmethod" = "UEFI" ]; then
        +		: ${ZFSBOOT_BOOT_TYPE:=BIOS+UEFI}
        +		: ${ZFSBOOT_PARTITION_SCHEME:=GPT}
        +	else
        +		: ${ZFSBOOT_BOOT_TYPE:=BIOS}
        +		: ${ZFSBOOT_PARTITION_SCHEME:=GPT}
        +	fi
        +	;;
        +esac
         
         #
         # Loop over the main menu until we've accomplished what we came here to do
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 19:47:13 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 163B3DCC6C9;
         Tue,  8 Aug 2017 19:47:13 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 D3B597100D;
         Tue,  8 Aug 2017 19:47:12 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78JlBho078011;
         Tue, 8 Aug 2017 19:47:11 GMT (envelope-from markj@FreeBSD.org)
        Received: (from markj@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78JlBXn078010;
         Tue, 8 Aug 2017 19:47:11 GMT (envelope-from markj@FreeBSD.org)
        Message-Id: <201708081947.v78JlBXn078010@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: markj set sender to
         markj@FreeBSD.org using -f
        From: Mark Johnston 
        Date: Tue, 8 Aug 2017 19:47:11 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322273 - stable/11/sys/kern
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: markj
        X-SVN-Commit-Paths: stable/11/sys/kern
        X-SVN-Commit-Revision: 322273
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 19:47:13 -0000
        
        Author: markj
        Date: Tue Aug  8 19:47:11 2017
        New Revision: 322273
        URL: https://svnweb.freebsd.org/changeset/base/322273
        
        Log:
          MFC r321884, r321896:
          Fix a witness assertion that fires when a lock type's class changes.
        
        Modified:
          stable/11/sys/kern/subr_witness.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/kern/subr_witness.c
        ==============================================================================
        --- stable/11/sys/kern/subr_witness.c	Tue Aug  8 19:36:34 2017	(r322272)
        +++ stable/11/sys/kern/subr_witness.c	Tue Aug  8 19:47:11 2017	(r322273)
        @@ -1850,12 +1850,14 @@ enroll(const char *description, struct lock_class *loc
         	return (w);
         found:
         	w->w_refcount++;
        +	if (w->w_refcount == 1)
        +		w->w_class = lock_class;
         	mtx_unlock_spin(&w_mtx);
         	if (lock_class != w->w_class)
         		kassert_panic(
        -			"lock (%s) %s does not match earlier (%s) lock",
        -			description, lock_class->lc_name,
        -			w->w_class->lc_name);
        +		    "lock (%s) %s does not match earlier (%s) lock",
        +		    description, lock_class->lc_name,
        +		    w->w_class->lc_name);
         	return (w);
         }
         
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 19:49:37 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AE58DCC912;
         Tue,  8 Aug 2017 19:49:37 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 EC1227119F;
         Tue,  8 Aug 2017 19:49:36 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78Jna6M078155;
         Tue, 8 Aug 2017 19:49:36 GMT (envelope-from markj@FreeBSD.org)
        Received: (from markj@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78Jna07078154;
         Tue, 8 Aug 2017 19:49:36 GMT (envelope-from markj@FreeBSD.org)
        Message-Id: <201708081949.v78Jna07078154@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: markj set sender to
         markj@FreeBSD.org using -f
        From: Mark Johnston 
        Date: Tue, 8 Aug 2017 19:49:36 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322274 - stable/11/cddl/contrib/opensolaris/cmd/lockstat
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: markj
        X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/cmd/lockstat
        X-SVN-Commit-Revision: 322274
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 19:49:37 -0000
        
        Author: markj
        Date: Tue Aug  8 19:49:35 2017
        New Revision: 322274
        URL: https://svnweb.freebsd.org/changeset/base/322274
        
        Log:
          MFC r321843, r321843:
          Let lockstat use ksyms(4)'s mmap interface.
        
        Modified:
          stable/11/cddl/contrib/opensolaris/cmd/lockstat/sym.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/cddl/contrib/opensolaris/cmd/lockstat/sym.c
        ==============================================================================
        --- stable/11/cddl/contrib/opensolaris/cmd/lockstat/sym.c	Tue Aug  8 19:47:11 2017	(r322273)
        +++ stable/11/cddl/contrib/opensolaris/cmd/lockstat/sym.c	Tue Aug  8 19:49:35 2017	(r322274)
        @@ -175,10 +175,6 @@ symtab_init(void)
         	int		fd;
         	int		i;
         	int		strindex = -1;
        -#ifndef illumos
        -	void		*ksyms;
        -	size_t		sz;
        -#endif
         
         #ifndef illumos
         	if ((fd = open("/dev/ksyms", O_RDONLY)) == -1) {
        @@ -194,33 +190,9 @@ symtab_init(void)
         		return (-1);
         #endif
         
        -#ifdef illumos
         	(void) elf_version(EV_CURRENT);
         
         	elf = elf_begin(fd, ELF_C_READ, NULL);
        -#else
        -	/* 
        -	 * XXX - libelf needs to be fixed so it will work with
        -	 * non 'ordinary' files like /dev/ksyms.  The following
        -	 * is a work around for now.
        -	 */ 
        -	if (elf_version(EV_CURRENT) == EV_NONE) {
        -		close(fd);
        -		return (-1);
        -	}
        -	if (ioctl(fd, KIOCGSIZE, &sz) < 0) {
        -		close(fd);
        -		return (-1);
        -	}
        -	if (ioctl(fd, KIOCGADDR, &ksyms) < 0) {
        -		close(fd);
        -		return (-1);
        -	}
        -	if ((elf = elf_memory(ksyms, sz)) == NULL) {
        -		close(fd);
        -		return (-1);
        -	}
        -#endif 
         
         	for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) {
         		Shdr *shdr = elf_getshdr(scn);
        
        From owner-svn-src-stable@freebsd.org  Tue Aug  8 19:53:08 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70CBFDCCC78;
         Tue,  8 Aug 2017 19:53:08 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 4AA4A71592;
         Tue,  8 Aug 2017 19:53:08 +0000 (UTC)
         (envelope-from markj@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v78Jr7We082259;
         Tue, 8 Aug 2017 19:53:07 GMT (envelope-from markj@FreeBSD.org)
        Received: (from markj@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v78Jr7dw082257;
         Tue, 8 Aug 2017 19:53:07 GMT (envelope-from markj@FreeBSD.org)
        Message-Id: <201708081953.v78Jr7dw082257@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: markj set sender to
         markj@FreeBSD.org using -f
        From: Mark Johnston 
        Date: Tue, 8 Aug 2017 19:53:07 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322275 - in stable/11/sys: amd64/amd64 i386/i386
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: markj
        X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386
        X-SVN-Commit-Revision: 322275
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Tue, 08 Aug 2017 19:53:08 -0000
        
        Author: markj
        Date: Tue Aug  8 19:53:06 2017
        New Revision: 322275
        URL: https://svnweb.freebsd.org/changeset/base/322275
        
        Log:
          MFC r321847:
          Batch updates to v_wire_count when freeing page table pages on x86.
        
        Modified:
          stable/11/sys/amd64/amd64/pmap.c
          stable/11/sys/i386/i386/pmap.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/amd64/amd64/pmap.c
        ==============================================================================
        --- stable/11/sys/amd64/amd64/pmap.c	Tue Aug  8 19:49:35 2017	(r322274)
        +++ stable/11/sys/amd64/amd64/pmap.c	Tue Aug  8 19:53:06 2017	(r322275)
        @@ -2200,12 +2200,14 @@ static __inline void
         pmap_free_zero_pages(struct spglist *free)
         {
         	vm_page_t m;
        +	int count;
         
        -	while ((m = SLIST_FIRST(free)) != NULL) {
        +	for (count = 0; (m = SLIST_FIRST(free)) != NULL; count++) {
         		SLIST_REMOVE_HEAD(free, plinks.s.ss);
         		/* Preserve the page's PG_ZERO setting. */
         		vm_page_free_toq(m);
         	}
        +	atomic_subtract_int(&vm_cnt.v_wire_count, count);
         }
         
         /*
        @@ -2311,13 +2313,6 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_
         		pmap_unwire_ptp(pmap, va, pdppg, free);
         	}
         
        -	/*
        -	 * This is a release store so that the ordinary store unmapping
        -	 * the page table page is globally performed before TLB shoot-
        -	 * down is begun.
        -	 */
        -	atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1);
        -
         	/* 
         	 * Put page on a list so that it is released after
         	 * *ALL* TLB shootdown is done
        @@ -3001,7 +2996,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
         		SLIST_REMOVE_HEAD(&free, plinks.s.ss);
         		/* Recycle a freed page table page. */
         		m_pc->wire_count = 1;
        -		atomic_add_int(&vm_cnt.v_wire_count, 1);
         	}
         	pmap_free_zero_pages(&free);
         	return (m_pc);
        @@ -3666,7 +3660,6 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse
         			    ("pmap_remove_pde: pte page wire count error"));
         			mpte->wire_count = 0;
         			pmap_add_delayed_free_list(mpte, free, FALSE);
        -			atomic_subtract_int(&vm_cnt.v_wire_count, 1);
         		}
         	}
         	return (pmap_unuse_pt(pmap, sva, *pmap_pdpe(pmap, sva), free));
        @@ -5531,7 +5524,6 @@ pmap_remove_pages(pmap_t pmap)
         						    ("pmap_remove_pages: pte page wire count error"));
         						mpte->wire_count = 0;
         						pmap_add_delayed_free_list(mpte, &free, FALSE);
        -						atomic_subtract_int(&vm_cnt.v_wire_count, 1);
         					}
         				} else {
         					pmap_resident_count_dec(pmap, 1);
        
        Modified: stable/11/sys/i386/i386/pmap.c
        ==============================================================================
        --- stable/11/sys/i386/i386/pmap.c	Tue Aug  8 19:49:35 2017	(r322274)
        +++ stable/11/sys/i386/i386/pmap.c	Tue Aug  8 19:53:06 2017	(r322275)
        @@ -1709,12 +1709,14 @@ static __inline void
         pmap_free_zero_pages(struct spglist *free)
         {
         	vm_page_t m;
        +	int count;
         
        -	while ((m = SLIST_FIRST(free)) != NULL) {
        +	for (count = 0; (m = SLIST_FIRST(free)) != NULL; count++) {
         		SLIST_REMOVE_HEAD(free, plinks.s.ss);
         		/* Preserve the page's PG_ZERO setting. */
         		vm_page_free_toq(m);
         	}
        +	atomic_subtract_int(&vm_cnt.v_wire_count, count);
         }
         
         /*
        @@ -1792,13 +1794,6 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spgl
         	--pmap->pm_stats.resident_count;
         
         	/*
        -	 * This is a release store so that the ordinary store unmapping
        -	 * the page table page is globally performed before TLB shoot-
        -	 * down is begun.
        -	 */
        -	atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1);
        -
        -	/*
         	 * Do an invltlb to make the invalidated mapping
         	 * take effect immediately.
         	 */
        @@ -2061,11 +2056,11 @@ pmap_release(pmap_t pmap)
         		    ("pmap_release: got wrong ptd page"));
         #endif
         		m->wire_count--;
        -		atomic_subtract_int(&vm_cnt.v_wire_count, 1);
         		vm_page_free_zero(m);
         	}
        +	atomic_subtract_int(&vm_cnt.v_wire_count, NPGPTD);
         }
        -
        +
         static int
         kvm_size(SYSCTL_HANDLER_ARGS)
         {
        @@ -2324,7 +2319,6 @@ out:
         		SLIST_REMOVE_HEAD(&free, plinks.s.ss);
         		/* Recycle a freed page table page. */
         		m_pc->wire_count = 1;
        -		atomic_add_int(&vm_cnt.v_wire_count, 1);
         	}
         	pmap_free_zero_pages(&free);
         	return (m_pc);
        @@ -2873,7 +2867,6 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse
         			    ("pmap_remove_pde: pte page wire count error"));
         			mpte->wire_count = 0;
         			pmap_add_delayed_free_list(mpte, free, FALSE);
        -			atomic_subtract_int(&vm_cnt.v_wire_count, 1);
         		}
         	}
         }
        @@ -4617,7 +4610,6 @@ pmap_remove_pages(pmap_t pmap)
         						    ("pmap_remove_pages: pte page wire count error"));
         						mpte->wire_count = 0;
         						pmap_add_delayed_free_list(mpte, &free, FALSE);
        -						atomic_subtract_int(&vm_cnt.v_wire_count, 1);
         					}
         				} else {
         					pmap->pm_stats.resident_count--;
        
        From owner-svn-src-stable@freebsd.org  Wed Aug  9 08:57:02 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05898DC7298;
         Wed,  9 Aug 2017 08:57:02 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 C5CA968C89;
         Wed,  9 Aug 2017 08:57:01 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v798v017002424;
         Wed, 9 Aug 2017 08:57:00 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v798v0oG002422;
         Wed, 9 Aug 2017 08:57:00 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708090857.v798v0oG002422@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Wed, 9 Aug 2017 08:57:00 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322301 - in stable/11/sys: amd64/amd64 i386/i386
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386
        X-SVN-Commit-Revision: 322301
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Wed, 09 Aug 2017 08:57:02 -0000
        
        Author: kib
        Date: Wed Aug  9 08:57:00 2017
        New Revision: 322301
        URL: https://svnweb.freebsd.org/changeset/base/322301
        
        Log:
          MFC r321919:
          Do not call trapsignal() after handling usermode fault or interrupt,
          when a signal is not intended to be sent.
        
        Modified:
          stable/11/sys/amd64/amd64/trap.c
          stable/11/sys/i386/i386/trap.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/amd64/amd64/trap.c
        ==============================================================================
        --- stable/11/sys/amd64/amd64/trap.c	Wed Aug  9 07:24:58 2017	(r322300)
        +++ stable/11/sys/amd64/amd64/trap.c	Wed Aug  9 08:57:00 2017	(r322301)
        @@ -370,7 +370,7 @@ trap(struct trapframe *frame)
         #ifdef DEV_ISA
         		case T_NMI:
         			nmi_handle_intr(type, frame);
        -			break;
        +			goto out;
         #endif /* DEV_ISA */
         
         		case T_OFLOW:		/* integer overflow fault */
        @@ -408,7 +408,7 @@ trap(struct trapframe *frame)
         			if (dtrace_return_probe_ptr != NULL &&
         			    dtrace_return_probe_ptr(®s) == 0)
         				goto out;
        -			break;
        +			goto userout;
         #endif
         		}
         	} else {
        
        Modified: stable/11/sys/i386/i386/trap.c
        ==============================================================================
        --- stable/11/sys/i386/i386/trap.c	Wed Aug  9 07:24:58 2017	(r322300)
        +++ stable/11/sys/i386/i386/trap.c	Wed Aug  9 08:57:00 2017	(r322301)
        @@ -455,7 +455,7 @@ user_trctrap_out:
         			goto userout;
         #else /* !POWERFAIL_NMI */
         			nmi_handle_intr(type, frame);
        -			break;
        +			goto out;
         #endif /* POWERFAIL_NMI */
         #endif /* DEV_ISA */
         
        @@ -499,7 +499,7 @@ user_trctrap_out:
         			if (dtrace_return_probe_ptr != NULL &&
         			    dtrace_return_probe_ptr(®s) == 0)
         				goto out;
        -			break;
        +			goto userout;
         #endif
         		}
         	} else {
        
        From owner-svn-src-stable@freebsd.org  Wed Aug  9 09:16:18 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48DD0DC7BD0;
         Wed,  9 Aug 2017 09:16:18 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 158CF69F02;
         Wed,  9 Aug 2017 09:16:18 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v799GH8i011653;
         Wed, 9 Aug 2017 09:16:17 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v799GHPG011651;
         Wed, 9 Aug 2017 09:16:17 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708090916.v799GHPG011651@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Wed, 9 Aug 2017 09:16:17 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322303 - in stable/10/sys: amd64/amd64 i386/i386
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 i386/i386
        X-SVN-Commit-Revision: 322303
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Wed, 09 Aug 2017 09:16:18 -0000
        
        Author: kib
        Date: Wed Aug  9 09:16:16 2017
        New Revision: 322303
        URL: https://svnweb.freebsd.org/changeset/base/322303
        
        Log:
          MFC r321919:
          Do not call trapsignal() after handling usermode fault or interrupt,
          when a signal is not intended to be sent.
        
        Modified:
          stable/10/sys/amd64/amd64/trap.c
          stable/10/sys/i386/i386/trap.c
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/sys/amd64/amd64/trap.c
        ==============================================================================
        --- stable/10/sys/amd64/amd64/trap.c	Wed Aug  9 09:13:15 2017	(r322302)
        +++ stable/10/sys/amd64/amd64/trap.c	Wed Aug  9 09:16:16 2017	(r322303)
        @@ -396,7 +396,7 @@ trap(struct trapframe *frame)
         				goto userout;
         			} else if (panic_on_nmi)
         				panic("NMI indicates hardware failure");
        -			break;
        +			goto out;
         #endif /* DEV_ISA */
         
         		case T_OFLOW:		/* integer overflow fault */
        @@ -434,7 +434,7 @@ trap(struct trapframe *frame)
         			if (dtrace_return_probe_ptr != NULL &&
         			    dtrace_return_probe_ptr(®s) == 0)
         				goto out;
        -			break;
        +			goto userout;
         #endif
         		}
         	} else {
        
        Modified: stable/10/sys/i386/i386/trap.c
        ==============================================================================
        --- stable/10/sys/i386/i386/trap.c	Wed Aug  9 09:13:15 2017	(r322302)
        +++ stable/10/sys/i386/i386/trap.c	Wed Aug  9 09:16:16 2017	(r322303)
        @@ -469,7 +469,7 @@ trap(struct trapframe *frame)
         				goto userout;
         			} else if (panic_on_nmi)
         				panic("NMI indicates hardware failure");
        -			break;
        +			goto out;
         #endif /* POWERFAIL_NMI */
         #endif /* DEV_ISA */
         
        @@ -519,7 +519,7 @@ trap(struct trapframe *frame)
         			if (dtrace_return_probe_ptr != NULL &&
         			    dtrace_return_probe_ptr(®s) == 0)
         				goto out;
        -			break;
        +			goto userout;
         #endif
         		}
         	} else {
        
        From owner-svn-src-stable@freebsd.org  Wed Aug  9 12:45:49 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id C36B7DCC31A;
         Wed,  9 Aug 2017 12:45:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 8FC9C709F7;
         Wed,  9 Aug 2017 12:45:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v79CjmVK097626;
         Wed, 9 Aug 2017 12:45:48 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v79CjmRJ097625;
         Wed, 9 Aug 2017 12:45:48 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708091245.v79CjmRJ097625@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Wed, 9 Aug 2017 12:45:48 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322311 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322311
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Wed, 09 Aug 2017 12:45:49 -0000
        
        Author: gjb
        Date: Wed Aug  9 12:45:48 2017
        New Revision: 322311
        URL: https://svnweb.freebsd.org/changeset/base/322311
        
        Log:
          Document r321964, bmake 20170720.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Wed Aug  9 12:24:07 2017	(r322310)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Wed Aug  9 12:45:48 2017	(r322311)
        @@ -258,6 +258,9 @@
         
               &man.libarchive.3; has been updated to
         	version 3.3.2.
        +
        +      bmake has
        +	been updated to version 20170720.
             
         
             
        
        From owner-svn-src-stable@freebsd.org  Wed Aug  9 12:45:50 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AF0DCC321;
         Wed,  9 Aug 2017 12:45:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 63064709F8;
         Wed,  9 Aug 2017 12:45:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v79Cjn5A097669;
         Wed, 9 Aug 2017 12:45:49 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v79CjnoC097668;
         Wed, 9 Aug 2017 12:45:49 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708091245.v79CjnoC097668@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Wed, 9 Aug 2017 12:45:49 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322312 - stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/10/release/doc/en_US.ISO8859-1/relnotes
        X-SVN-Commit-Revision: 322312
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Wed, 09 Aug 2017 12:45:50 -0000
        
        Author: gjb
        Date: Wed Aug  9 12:45:49 2017
        New Revision: 322312
        URL: https://svnweb.freebsd.org/changeset/base/322312
        
        Log:
          Revise entry for r320646, rwho/rwhod/ruptime are not part of rcmds.
          Fix line wrapping.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        
        Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
        ==============================================================================
        --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Wed Aug  9 12:45:48 2017	(r322311)
        +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml	Wed Aug  9 12:45:49 2017	(r322312)
        @@ -196,9 +196,8 @@
         	facilities of &man.cxgbe.4; devices.
         
               The &man.rcp.1;, &man.rlogin.1;,
        -	&man.rsh.1;, &man.ruptime.1;, &man.rwho.1;, &man.rlogind.8;,
        -	&man.rshd.8;, and &man.rwhod.8; utilities have been marked as
        -	deprecated, and planned for removal in
        +	&man.rsh.1;, &man.rlogind.8;, and &man.rshd.8; utilities have
        +	been marked as deprecated, and planned for removal in
         	&os; 12.0-RELEASE.
         
               The &man.gdb.1; and &man.kgdb.1;
        
        From owner-svn-src-stable@freebsd.org  Wed Aug  9 12:56:00 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94894DCC665;
         Wed,  9 Aug 2017 12:56:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 5E49E71086;
         Wed,  9 Aug 2017 12:56:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v79CtxHN001717;
         Wed, 9 Aug 2017 12:55:59 GMT (envelope-from gjb@FreeBSD.org)
        Received: (from gjb@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v79CtxMw001716;
         Wed, 9 Aug 2017 12:55:59 GMT (envelope-from gjb@FreeBSD.org)
        Message-Id: <201708091255.v79CtxMw001716@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
         using -f
        From: Glen Barber 
        Date: Wed, 9 Aug 2017 12:55:59 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322313 - stable/11/release/doc/en_US.ISO8859-1/errata
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: gjb
        X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/errata
        X-SVN-Commit-Revision: 322313
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Wed, 09 Aug 2017 12:56:00 -0000
        
        Author: gjb
        Date: Wed Aug  9 12:55:58 2017
        New Revision: 322313
        URL: https://svnweb.freebsd.org/changeset/base/322313
        
        Log:
          Add an errata entry for ruptime(1), rwho(1), and rwhod(8), not
          included in the rcmds deprecation.
          
          Sponsored by:	The FreeBSD Foundation
        
        Modified:
          stable/11/release/doc/en_US.ISO8859-1/errata/article.xml
        
        Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml
        ==============================================================================
        --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml	Wed Aug  9 12:45:49 2017	(r322312)
        +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml	Wed Aug  9 12:55:58 2017	(r322313)
        @@ -186,6 +186,16 @@ boot
         	  Communications, LLC (Netgate), when in fact this work was
         	  done by Hiroki Mori independently.
               
        +
        +      
        +	[2017-08-09] The release notes stated the
        +	  &man.ruptime.1;, &man.rwho.1;, and &man.rwhod.8; utilities
        +	  have been marked "deprecated", however this change
        +	  was reversed in 12.0-CURRENT.
        +
        +	The other utilities mentioned in the entry in the
        +	  release notes, however, are unchanged.
        +      
             
           
         
        
        From owner-svn-src-stable@freebsd.org  Wed Aug  9 13:26:13 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DA11DCCFE7;
         Wed,  9 Aug 2017 13:26:13 +0000 (UTC)
         (envelope-from tuexen@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 67C587212C;
         Wed,  9 Aug 2017 13:26:13 +0000 (UTC)
         (envelope-from tuexen@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v79DQCIk013952;
         Wed, 9 Aug 2017 13:26:12 GMT (envelope-from tuexen@FreeBSD.org)
        Received: (from tuexen@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v79DQCwZ013950;
         Wed, 9 Aug 2017 13:26:12 GMT (envelope-from tuexen@FreeBSD.org)
        Message-Id: <201708091326.v79DQCwZ013950@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: tuexen set sender to
         tuexen@FreeBSD.org using -f
        From: Michael Tuexen 
        Date: Wed, 9 Aug 2017 13:26:12 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322315 - stable/10/sys/netinet
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: tuexen
        X-SVN-Commit-Paths: stable/10/sys/netinet
        X-SVN-Commit-Revision: 322315
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Wed, 09 Aug 2017 13:26:13 -0000
        
        Author: tuexen
        Date: Wed Aug  9 13:26:12 2017
        New Revision: 322315
        URL: https://svnweb.freebsd.org/changeset/base/322315
        
        Log:
          MFC r317208:
          
          Syncoockies can be used in combination with the syncache. If the cache
          overflows, syncookies are used.
          This patch restricts the usage of syncookies in this case: accept
          syncookies only if there was an overflow of the syncache recently.
          This mitigates a problem reported in PR217637, where is syncookie was
          accepted without any recent drops.
          Thanks to glebius@ for suggesting an improvement.
          
          PR:			217637
          Reviewed by:		gnn, glebius
          Differential Revision:	https://reviews.freebsd.org/D10272
        
        Modified:
          stable/10/sys/netinet/tcp_syncache.c
          stable/10/sys/netinet/tcp_syncache.h
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/sys/netinet/tcp_syncache.c
        ==============================================================================
        --- stable/10/sys/netinet/tcp_syncache.c	Wed Aug  9 13:25:27 2017	(r322314)
        +++ stable/10/sys/netinet/tcp_syncache.c	Wed Aug  9 13:26:12 2017	(r322315)
        @@ -277,6 +277,7 @@ syncache_init(void)
         			 &V_tcp_syncache.hashbase[i].sch_mtx, 0);
         		V_tcp_syncache.hashbase[i].sch_length = 0;
         		V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache;
        +		V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN;
         	}
         
         	/* Create the syncache entry zone. */
        @@ -357,6 +358,7 @@ syncache_insert(struct syncache *sc, struct syncache_h
         		KASSERT(!TAILQ_EMPTY(&sch->sch_bucket),
         			("sch->sch_length incorrect"));
         		sc2 = TAILQ_LAST(&sch->sch_bucket, sch_head);
        +		sch->sch_last_overflow = time_uptime;
         		syncache_drop(sc2, sch);
         		TCPSTAT_INC(tcps_sc_bucketoverflow);
         	}
        @@ -985,10 +987,13 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt
         		/*
         		 * There is no syncache entry, so see if this ACK is
         		 * a returning syncookie.  To do this, first:
        -		 *  A. See if this socket has had a syncache entry dropped in
        -		 *     the past.  We don't want to accept a bogus syncookie
        -		 *     if we've never received a SYN.
        -		 *  B. check that the syncookie is valid.  If it is, then
        +		 *  A. Check if syncookies are used in case of syncache
        +		 *     overflows
        +		 *  B. See if this socket has had a syncache entry dropped in
        +		 *     the recent past. We don't want to accept a bogus
        +		 *     syncookie if we've never received a SYN or accept it
        +		 *     twice.
        +		 *  C. check that the syncookie is valid.  If it is, then
         		 *     cobble up a fake syncache entry, and return.
         		 */
         		if (!V_tcp_syncookies) {
        @@ -999,6 +1004,15 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt
         				    s, __func__);
         			goto failed;
         		}
        +		if (!V_tcp_syncookiesonly &&
        +		    sch->sch_last_overflow < time_uptime - SYNCOOKIE_LIFETIME) {
        +			SCH_UNLOCK(sch);
        +			if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
        +				log(LOG_DEBUG, "%s; %s: Spurious ACK, "
        +				    "segment rejected (no syncache entry)\n",
        +				    s, __func__);
        +			goto failed;
        +		}
         		bzero(&scs, sizeof(scs));
         		sc = syncookie_lookup(inc, sch, &scs, th, to, *lsop);
         		SCH_UNLOCK(sch);
        @@ -1336,8 +1350,10 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t
         		 * entry and insert the new one.
         		 */
         		TCPSTAT_INC(tcps_sc_zonefail);
        -		if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL)
        +		if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) {
        +			sch->sch_last_overflow = time_uptime;
         			syncache_drop(sc, sch);
        +		}
         		sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO);
         		if (sc == NULL) {
         			if (V_tcp_syncookies) {
        
        Modified: stable/10/sys/netinet/tcp_syncache.h
        ==============================================================================
        --- stable/10/sys/netinet/tcp_syncache.h	Wed Aug  9 13:25:27 2017	(r322314)
        +++ stable/10/sys/netinet/tcp_syncache.h	Wed Aug  9 13:26:12 2017	(r322315)
        @@ -100,6 +100,7 @@ struct syncache_head {
         	int		sch_nextc;
         	u_int		sch_length;
         	struct tcp_syncache *sch_sc;
        +	time_t		sch_last_overflow;
         };
         
         #define	SYNCOOKIE_SECRET_SIZE	16
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 05:22:10 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1875FDC4CC4
         for ;
         Thu, 10 Aug 2017 05:22:10 +0000 (UTC)
         (envelope-from mailing-machine@vniz.net)
        Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com
         [209.85.215.68])
         (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
         (Client CN "smtp.gmail.com",
         Issuer "Google Internet Authority G2" (verified OK))
         by mx1.freebsd.org (Postfix) with ESMTPS id C43876FEA3
         for ; Thu, 10 Aug 2017 05:22:09 +0000 (UTC)
         (envelope-from mailing-machine@vniz.net)
        Received: by mail-lf0-f68.google.com with SMTP id x16so5695328lfb.4
         for ; Wed, 09 Aug 2017 22:22:09 -0700 (PDT)
        X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
         d=1e100.net; s=20161025;
         h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-language
         :content-transfer-encoding;
         bh=JYsn+U8b91HB46gZceAaRtrnF2VYR/ugwZA6WHY6B3Y=;
         b=kHTLbDdLikPIcCi7T98tET5qLGTJbS9nKWl8Q8cq5+CAS5EXj7tWG4u/fi9yMu3w/I
         yu5wG2HmvZ6p8KoIP7PVtPtyWblATClcE/cjqBvFmJu3jwGplPDxyo62U1vyGmI7TUn3
         5WBrE/8hHyXXVcMUExIg+37HaZuxyh361xrP61jlsswD0BdbNEuqj3C5k8l5CxESRJjG
         UHhJqwto+D2L4OK8quH+nXWpV9MtdvJ8CCo82mP5qpsdzPfYFX2VC7gJHYL9wQPj0U55
         6yiklpCc+nkj3jot7scqdW/HpTTMyABsYmGRoFesCmNO121CNkzYYS6UDld/vtbuSbr7
         Y3+w==
        X-Gm-Message-State: AHYfb5jfIZYie/ObZ4gw7sY0OIS/OHyOz3io5Fzt5l1MjEVZc0md7kqx
         e1NDGZK+bb15VFnY
        X-Received: by 10.25.33.129 with SMTP id h123mr3213844lfh.68.1502342522207;
         Wed, 09 Aug 2017 22:22:02 -0700 (PDT)
        Received: from [192.168.1.2] ([89.169.174.106])
         by smtp.gmail.com with ESMTPSA id f78sm900982lji.45.2017.08.09.22.22.01
         (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
         Wed, 09 Aug 2017 22:22:01 -0700 (PDT)
        Subject: Re: svn commit: r322315 - stable/10/sys/netinet
        To: Michael Tuexen , src-committers@freebsd.org,
         svn-src-all@freebsd.org, svn-src-stable@freebsd.org,
         svn-src-stable-10@freebsd.org
        References: <201708091326.v79DQCwZ013950@repo.freebsd.org>
        From: Andrey Chernov 
        Message-ID: <278107ed-e602-d92b-7c3d-211c23e8c653@freebsd.org>
        Date: Thu, 10 Aug 2017 08:22:00 +0300
        User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
         Thunderbird/52.2.1
        MIME-Version: 1.0
        In-Reply-To: <201708091326.v79DQCwZ013950@repo.freebsd.org>
        Content-Type: text/plain; charset=us-ascii
        Content-Language: ru-English
        Content-Transfer-Encoding: 7bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 05:22:10 -0000
        
        On 09.08.2017 16:26, Michael Tuexen wrote:
        > Author: tuexen
        > Date: Wed Aug  9 13:26:12 2017
        > New Revision: 322315
        > URL: https://svnweb.freebsd.org/changeset/base/322315
        > 
        > Log:
        >   MFC r317208:
        >   
        >   Syncoockies can be used in combination with the syncache. If the cache
        >   overflows, syncookies are used.
        
        It cause error for i386 stable-10
        
         -ffreestanding -fstack-protector -gdwarf-2 -Werror
        ../../../netinet/tcp_syncache.c
        ../../../netinet/tcp_syncache.c:280:50: error: implicit conversion from
              'long long' to 'time_t' (aka 'int') changes value from
              -9223372036854775808 to 0 [-Werror,-Wconstant-conversion]
                        V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN;
                                                                     ~ ^~~~~~~~~
        ./x86/_stdint.h:89:41: note: expanded from macro 'INT64_MIN'
        #define INT64_MIN       (-0x7fffffffffffffffLL-1)
                                 ~~~~~~~~~~~~~~~~~~~~~^~
        1 error generated.
        *** Error code 1
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 05:35:47 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11FB0DC54AB;
         Thu, 10 Aug 2017 05:35:47 +0000 (UTC)
         (envelope-from dchagin@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 D0CB47051A;
         Thu, 10 Aug 2017 05:35:46 +0000 (UTC)
         (envelope-from dchagin@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7A5Zkc6013195;
         Thu, 10 Aug 2017 05:35:46 GMT (envelope-from dchagin@FreeBSD.org)
        Received: (from dchagin@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7A5Zklw013194;
         Thu, 10 Aug 2017 05:35:46 GMT (envelope-from dchagin@FreeBSD.org)
        Message-Id: <201708100535.v7A5Zklw013194@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: dchagin set sender to
         dchagin@FreeBSD.org using -f
        From: Dmitry Chagin 
        Date: Thu, 10 Aug 2017 05:35:46 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322339 - stable/11/sys/fs/fdescfs
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: dchagin
        X-SVN-Commit-Paths: stable/11/sys/fs/fdescfs
        X-SVN-Commit-Revision: 322339
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 05:35:47 -0000
        
        Author: dchagin
        Date: Thu Aug 10 05:35:45 2017
        New Revision: 322339
        URL: https://svnweb.freebsd.org/changeset/base/322339
        
        Log:
          MFC r321460:
          
          Replace unnecessary _KERNEL by double-include protection.
        
        Modified:
          stable/11/sys/fs/fdescfs/fdesc.h
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/fs/fdescfs/fdesc.h
        ==============================================================================
        --- stable/11/sys/fs/fdescfs/fdesc.h	Thu Aug 10 03:43:23 2017	(r322338)
        +++ stable/11/sys/fs/fdescfs/fdesc.h	Thu Aug 10 05:35:45 2017	(r322339)
        @@ -34,7 +34,9 @@
          * $FreeBSD$
          */
         
        -#ifdef _KERNEL
        +#ifndef _FS_FDESC_H_
        +#define _FS_FDESC_H_
        +
         /* Private mount flags for fdescfs. */
         #define FMNT_UNMOUNTF 0x01
         struct fdescmount {
        @@ -66,4 +68,4 @@ extern vfs_init_t fdesc_init;
         extern vfs_uninit_t fdesc_uninit;
         extern int fdesc_allocvp(fdntype, unsigned, int, struct mount *,
             struct vnode **);
        -#endif /* _KERNEL */
        +#endif /* !_FS_FDESC_H_ */
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 05:38:33 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150DDDC55D8;
         Thu, 10 Aug 2017 05:38:33 +0000 (UTC)
         (envelope-from dchagin@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 E545B7069C;
         Thu, 10 Aug 2017 05:38:32 +0000 (UTC)
         (envelope-from dchagin@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7A5cW8d013353;
         Thu, 10 Aug 2017 05:38:32 GMT (envelope-from dchagin@FreeBSD.org)
        Received: (from dchagin@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7A5cVsi013346;
         Thu, 10 Aug 2017 05:38:31 GMT (envelope-from dchagin@FreeBSD.org)
        Message-Id: <201708100538.v7A5cVsi013346@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: dchagin set sender to
         dchagin@FreeBSD.org using -f
        From: Dmitry Chagin 
        Date: Thu, 10 Aug 2017 05:38:31 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322340 - in stable/11: share/man/man4 share/man/man5
         sys/fs/fdescfs sys/kern sys/sys
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: dchagin
        X-SVN-Commit-Paths: in stable/11: share/man/man4 share/man/man5 sys/fs/fdescfs
         sys/kern sys/sys
        X-SVN-Commit-Revision: 322340
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 05:38:33 -0000
        
        Author: dchagin
        Date: Thu Aug 10 05:38:31 2017
        New Revision: 322340
        URL: https://svnweb.freebsd.org/changeset/base/322340
        
        Log:
          MFC r321839:
          
          Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
          Linux specific things to the native fdescfs file system.
          
          Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
          links to the actual files, which the process has open.
          A readlink(2) call on this file returns a full path in case of regular file
          or a string in a special format (type:[inode], anon_inode:, etc..).
          As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
          equivalent to duplicating the corresponding file descriptor.
          
          Here we have mutually exclusive requirements:
          - in case of readlink(2) call fdescfs lookup() method should return VLNK
          vnode otherwise our kern_readlink() fail with EINVAL error;
          - in the other calls fdescfs lookup() method should return non VLNK vnode.
          
          For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed
          mounted with linrdlnk option an modified kern_readlinkat() to properly handle it.
          
          For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:
          
            mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd
          
          Relnotes:	yes
          Differential Revision:	https://reviews.freebsd.org/D11452
        
        Modified:
          stable/11/share/man/man4/linux.4
          stable/11/share/man/man5/fdescfs.5
          stable/11/sys/fs/fdescfs/fdesc.h
          stable/11/sys/fs/fdescfs/fdesc_vfsops.c
          stable/11/sys/fs/fdescfs/fdesc_vnops.c
          stable/11/sys/kern/vfs_syscalls.c
          stable/11/sys/sys/vnode.h
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/share/man/man4/linux.4
        ==============================================================================
        --- stable/11/share/man/man4/linux.4	Thu Aug 10 05:35:45 2017	(r322339)
        +++ stable/11/share/man/man4/linux.4	Thu Aug 10 05:38:31 2017	(r322340)
        @@ -24,7 +24,7 @@
         .\"
         .\" $FreeBSD$
         .\"
        -.Dd February 8, 2010
        +.Dd August 1, 2017
         .Dt LINUX 4
         .Os
         .Sh NAME
        @@ -127,9 +127,11 @@ regardless of whether the
         module is statically linked into the kernel
         or loaded as a module.
         .Sh FILES
        -.Bl -tag -width /compat/linux/proc -compact
        +.Bl -tag -width /compat/linux/dev/fd -compact
         .It Pa /compat/linux
         minimal Linux run-time environment
        +.It Pa /compat/linux/dev/fd
        +limited Linux file-descriptor file system
         .It Pa /compat/linux/proc
         limited Linux process file system
         .It Pa /compat/linux/sys
        @@ -138,6 +140,7 @@ limited Linux system file system
         .Sh SEE ALSO
         .Xr brandelf 1 ,
         .Xr elf 5 ,
        +.Xr fdescfs 5 ,
         .Xr linprocfs 5 ,
         .Xr linsysfs 5
         .Sh HISTORY
        
        Modified: stable/11/share/man/man5/fdescfs.5
        ==============================================================================
        --- stable/11/share/man/man5/fdescfs.5	Thu Aug 10 05:35:45 2017	(r322339)
        +++ stable/11/share/man/man5/fdescfs.5	Thu Aug 10 05:38:31 2017	(r322340)
        @@ -34,7 +34,7 @@
         .\"
         .\" $FreeBSD$
         .\"
        -.Dd September 18, 2010
        +.Dd August 1, 2017
         .Dt FDESCFS 5
         .Os
         .Sh NAME
        @@ -92,6 +92,14 @@ and
         files are created by default when devfs alone is mounted.
         .Nm
         creates entries for all file descriptors opened by the process.
        +.Pp
        +For
        +.Xr linux 4
        +ABI compatibility mount
        +.Nm
        +volume with
        +.Cm linrdlnk
        +option.
         .Sh FILES
         .Bl -tag -width /dev/stderr -compact
         .It Pa /dev/fd/#
        @@ -103,6 +111,12 @@ volume located on
         .Pa /dev/fd :
         .Pp
         .Dl "mount -t fdescfs null /dev/fd"
        +.Pp
        +For
        +.Xr linux 4
        +ABI compatibility:
        +.Pp
        +.Dl "mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd"
         .Sh SEE ALSO
         .Xr devfs 5 ,
         .Xr mount 8
        
        Modified: stable/11/sys/fs/fdescfs/fdesc.h
        ==============================================================================
        --- stable/11/sys/fs/fdescfs/fdesc.h	Thu Aug 10 05:35:45 2017	(r322339)
        +++ stable/11/sys/fs/fdescfs/fdesc.h	Thu Aug 10 05:38:31 2017	(r322340)
        @@ -38,7 +38,9 @@
         #define _FS_FDESC_H_
         
         /* Private mount flags for fdescfs. */
        -#define FMNT_UNMOUNTF 0x01
        +#define FMNT_UNMOUNTF	0x01
        +#define FMNT_LINRDLNKF	0x02
        +
         struct fdescmount {
         	struct vnode	*f_root;	/* Root node */
         	int flags;
        
        Modified: stable/11/sys/fs/fdescfs/fdesc_vfsops.c
        ==============================================================================
        --- stable/11/sys/fs/fdescfs/fdesc_vfsops.c	Thu Aug 10 05:35:45 2017	(r322339)
        +++ stable/11/sys/fs/fdescfs/fdesc_vfsops.c	Thu Aug 10 05:38:31 2017	(r322340)
        @@ -101,6 +101,8 @@ fdesc_mount(struct mount *mp)
         	 */
         	mp->mnt_data = fmp;
         	fmp->flags = 0;
        +	if (vfs_getopt(mp->mnt_optnew, "linrdlnk", NULL, NULL) == 0)
        +		fmp->flags |= FMNT_LINRDLNKF;
         	error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp);
         	if (error) {
         		free(fmp, M_FDESCMNT);
        
        Modified: stable/11/sys/fs/fdescfs/fdesc_vnops.c
        ==============================================================================
        --- stable/11/sys/fs/fdescfs/fdesc_vnops.c	Thu Aug 10 05:35:45 2017	(r322339)
        +++ stable/11/sys/fs/fdescfs/fdesc_vnops.c	Thu Aug 10 05:38:31 2017	(r322340)
        @@ -69,6 +69,7 @@ static vop_getattr_t	fdesc_getattr;
         static vop_lookup_t	fdesc_lookup;
         static vop_open_t	fdesc_open;
         static vop_readdir_t	fdesc_readdir;
        +static vop_readlink_t	fdesc_readlink;
         static vop_reclaim_t	fdesc_reclaim;
         static vop_setattr_t	fdesc_setattr;
         
        @@ -81,6 +82,7 @@ static struct vop_vector fdesc_vnodeops = {
         	.vop_open =		fdesc_open,
         	.vop_pathconf =		vop_stdpathconf,
         	.vop_readdir =		fdesc_readdir,
        +	.vop_readlink =		fdesc_readlink,
         	.vop_reclaim =		fdesc_reclaim,
         	.vop_setattr =		fdesc_setattr,
         };
        @@ -195,6 +197,8 @@ loop:
         	fd->fd_type = ftype;
         	fd->fd_fd = fd_fd;
         	fd->fd_ix = ix;
        +	if (ftype == Fdesc && fmp->flags & FMNT_LINRDLNKF)
        +		vp->v_vflag |= VV_READLINK;
         	error = insmntque1(vp, mp, fdesc_insmntque_dtr, NULL);
         	if (error != 0) {
         		*vpp = NULLVP;
        @@ -420,7 +424,7 @@ fdesc_getattr(struct vop_getattr_args *ap)
         		break;
         
         	case Fdesc:
        -		vap->va_type = VCHR;
        +		vap->va_type = (vp->v_vflag & VV_READLINK) == 0 ? VCHR : VLNK;
         		vap->va_nlink = 1;
         		vap->va_size = 0;
         		vap->va_rdev = makedev(0, vap->va_fileid);
        @@ -490,6 +494,7 @@ fdesc_setattr(struct vop_setattr_args *ap)
         static int
         fdesc_readdir(struct vop_readdir_args *ap)
         {
        +	struct fdescmount *fmp;
         	struct uio *uio = ap->a_uio;
         	struct filedesc *fdp;
         	struct dirent d;
        @@ -499,6 +504,7 @@ fdesc_readdir(struct vop_readdir_args *ap)
         	if (VTOFDESC(ap->a_vp)->fd_type != Froot)
         		panic("fdesc_readdir: not dir");
         
        +	fmp = VFSTOFDESC(ap->a_vp->v_mount);
         	if (ap->a_ncookies != NULL)
         		*ap->a_ncookies = 0;
         
        @@ -530,7 +536,8 @@ fdesc_readdir(struct vop_readdir_args *ap)
         				break;
         			dp->d_namlen = sprintf(dp->d_name, "%d", fcnt);
         			dp->d_reclen = UIO_MX;
        -			dp->d_type = DT_CHR;
        +			dp->d_type = (fmp->flags & FMNT_LINRDLNKF) == 0 ?
        +			    DT_CHR : DT_LNK;
         			dp->d_fileno = i + FD_DESC;
         			break;
         		}
        @@ -566,4 +573,53 @@ fdesc_reclaim(struct vop_reclaim_args *ap)
         	free(vp->v_data, M_TEMP);
         	vp->v_data = NULL;
         	return (0);
        +}
        +
        +static int
        +fdesc_readlink(struct vop_readlink_args *va)
        +{
        +	struct vnode *vp, *vn;
        +	cap_rights_t rights;
        +	struct thread *td;
        +	struct uio *uio;
        +	struct file *fp;
        +	char *freepath, *fullpath;
        +	size_t pathlen;
        +	int lockflags, fd_fd;
        +	int error;
        +
        +	freepath = NULL;
        +	vn = va->a_vp;
        +	if (VTOFDESC(vn)->fd_type != Fdesc)
        +		panic("fdesc_readlink: not fdescfs link");
        +	fd_fd = ((struct fdescnode *)vn->v_data)->fd_fd;
        +	lockflags = VOP_ISLOCKED(vn);
        +	VOP_UNLOCK(vn, 0);
        +
        +	td = curthread;
        +	error = fget_cap(td, fd_fd, cap_rights_init(&rights), &fp, NULL);
        +	if (error != 0)
        +		goto out;
        +
        +	switch (fp->f_type) {
        +	case DTYPE_VNODE:
        +		vp = fp->f_vnode;
        +		error = vn_fullpath(td, vp, &fullpath, &freepath);
        +		break;
        +	default:
        +		fullpath = "anon_inode:[unknown]";
        +		break;
        +	}
        +	if (error == 0) {
        +		uio = va->a_uio;
        +		pathlen = strlen(fullpath);
        +		error = uiomove(fullpath, pathlen, uio);
        +	}
        +	if (freepath != NULL)
        +		free(freepath, M_TEMP);
        +	fdrop(fp, td);
        +
        +out:
        +	vn_lock(vn, lockflags | LK_RETRY);
        +	return (error);
         }
        
        Modified: stable/11/sys/kern/vfs_syscalls.c
        ==============================================================================
        --- stable/11/sys/kern/vfs_syscalls.c	Thu Aug 10 05:35:45 2017	(r322339)
        +++ stable/11/sys/kern/vfs_syscalls.c	Thu Aug 10 05:38:31 2017	(r322340)
        @@ -2409,7 +2409,7 @@ kern_readlinkat(struct thread *td, int fd, char *path,
         		return (error);
         	}
         #endif
        -	if (vp->v_type != VLNK)
        +	if (vp->v_type != VLNK && (vp->v_vflag & VV_READLINK) == 0)
         		error = EINVAL;
         	else {
         		aiov.iov_base = buf;
        
        Modified: stable/11/sys/sys/vnode.h
        ==============================================================================
        --- stable/11/sys/sys/vnode.h	Thu Aug 10 05:35:45 2017	(r322339)
        +++ stable/11/sys/sys/vnode.h	Thu Aug 10 05:38:31 2017	(r322340)
        @@ -253,6 +253,7 @@ struct xvnode {
         #define	VV_DELETED	0x0400	/* should be removed */
         #define	VV_MD		0x0800	/* vnode backs the md device */
         #define	VV_FORCEINSMQ	0x1000	/* force the insmntque to succeed */
        +#define	VV_READLINK	0x2000	/* fdescfs linux vnode */
         
         /*
          * Vnode attributes.  A field value of VNOVAL represents a field whose value
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 06:36:38 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84465DC6AE6;
         Thu, 10 Aug 2017 06:36:38 +0000 (UTC)
         (envelope-from delphij@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 5077372198;
         Thu, 10 Aug 2017 06:36:38 +0000 (UTC)
         (envelope-from delphij@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7A6abFV037848;
         Thu, 10 Aug 2017 06:36:37 GMT (envelope-from delphij@FreeBSD.org)
        Received: (from delphij@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7A6abvW037847;
         Thu, 10 Aug 2017 06:36:37 GMT (envelope-from delphij@FreeBSD.org)
        Message-Id: <201708100636.v7A6abvW037847@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: delphij set sender to
         delphij@FreeBSD.org using -f
        From: Xin LI 
        Date: Thu, 10 Aug 2017 06:36:37 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322341 - in stable: 10/crypto/openssh 11/crypto/openssh
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: delphij
        X-SVN-Commit-Paths: in stable: 10/crypto/openssh 11/crypto/openssh
        X-SVN-Commit-Revision: 322341
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 06:36:38 -0000
        
        Author: delphij
        Date: Thu Aug 10 06:36:37 2017
        New Revision: 322341
        URL: https://svnweb.freebsd.org/changeset/base/322341
        
        Log:
          Apply upstream fix:
          
          Skip passwords longer than 1k in length so clients can't
          easily DoS sshd by sending very long passwords, causing it to spend CPU
          hashing them. feedback djm@, ok markus@.
          
          Brought to our attention by tomas.kuthan at oracle.com, shilei-c at
          360.cn and coredump at autistici.org
          
          Security:	CVE-2016-6515
          Security:	FreeBSD-SA-17:06.openssh
        
        Modified:
          stable/11/crypto/openssh/auth-passwd.c
        
        Changes in other areas also in this revision:
        Modified:
          stable/10/crypto/openssh/auth-passwd.c
        
        Modified: stable/11/crypto/openssh/auth-passwd.c
        ==============================================================================
        --- stable/11/crypto/openssh/auth-passwd.c	Thu Aug 10 05:38:31 2017	(r322340)
        +++ stable/11/crypto/openssh/auth-passwd.c	Thu Aug 10 06:36:37 2017	(r322341)
        @@ -66,6 +66,8 @@ extern login_cap_t *lc;
         #define DAY		(24L * 60 * 60) /* 1 day in seconds */
         #define TWO_WEEKS	(2L * 7 * DAY)	/* 2 weeks in seconds */
         
        +#define MAX_PASSWORD_LEN	1024
        +
         void
         disable_forwarding(void)
         {
        @@ -86,6 +88,9 @@ auth_password(Authctxt *authctxt, const char *password
         #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
         	static int expire_checked = 0;
         #endif
        +
        +	if (strlen(password) > MAX_PASSWORD_LEN)
        +		return 0;
         
         #ifndef HAVE_CYGWIN
         	if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 06:36:38 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3541DC6AEA;
         Thu, 10 Aug 2017 06:36:38 +0000 (UTC)
         (envelope-from delphij@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 8F13D7219A;
         Thu, 10 Aug 2017 06:36:38 +0000 (UTC)
         (envelope-from delphij@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7A6abF3037854;
         Thu, 10 Aug 2017 06:36:37 GMT (envelope-from delphij@FreeBSD.org)
        Received: (from delphij@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7A6abxI037853;
         Thu, 10 Aug 2017 06:36:37 GMT (envelope-from delphij@FreeBSD.org)
        Message-Id: <201708100636.v7A6abxI037853@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: delphij set sender to
         delphij@FreeBSD.org using -f
        From: Xin LI 
        Date: Thu, 10 Aug 2017 06:36:37 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322341 - in stable: 10/crypto/openssh 11/crypto/openssh
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: delphij
        X-SVN-Commit-Paths: in stable: 10/crypto/openssh 11/crypto/openssh
        X-SVN-Commit-Revision: 322341
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 06:36:38 -0000
        
        Author: delphij
        Date: Thu Aug 10 06:36:37 2017
        New Revision: 322341
        URL: https://svnweb.freebsd.org/changeset/base/322341
        
        Log:
          Apply upstream fix:
          
          Skip passwords longer than 1k in length so clients can't
          easily DoS sshd by sending very long passwords, causing it to spend CPU
          hashing them. feedback djm@, ok markus@.
          
          Brought to our attention by tomas.kuthan at oracle.com, shilei-c at
          360.cn and coredump at autistici.org
          
          Security:	CVE-2016-6515
          Security:	FreeBSD-SA-17:06.openssh
        
        Modified:
          stable/10/crypto/openssh/auth-passwd.c
        
        Changes in other areas also in this revision:
        Modified:
          stable/11/crypto/openssh/auth-passwd.c
        
        Modified: stable/10/crypto/openssh/auth-passwd.c
        ==============================================================================
        --- stable/10/crypto/openssh/auth-passwd.c	Thu Aug 10 05:38:31 2017	(r322340)
        +++ stable/10/crypto/openssh/auth-passwd.c	Thu Aug 10 06:36:37 2017	(r322341)
        @@ -66,6 +66,8 @@ extern login_cap_t *lc;
         #define DAY		(24L * 60 * 60) /* 1 day in seconds */
         #define TWO_WEEKS	(2L * 7 * DAY)	/* 2 weeks in seconds */
         
        +#define MAX_PASSWORD_LEN	1024
        +
         void
         disable_forwarding(void)
         {
        @@ -86,6 +88,9 @@ auth_password(Authctxt *authctxt, const char *password
         #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
         	static int expire_checked = 0;
         #endif
        +
        +	if (strlen(password) > MAX_PASSWORD_LEN)
        +		return 0;
         
         #ifndef HAVE_CYGWIN
         	if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 09:00:16 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98050DCC5E1;
         Thu, 10 Aug 2017 09:00:16 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 6C9DE77C33;
         Thu, 10 Aug 2017 09:00:16 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7A90F0W094475;
         Thu, 10 Aug 2017 09:00:15 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7A90FjI094474;
         Thu, 10 Aug 2017 09:00:15 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708100900.v7A90FjI094474@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Thu, 10 Aug 2017 09:00:15 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322345 - stable/11/lib/libc/x86/sys
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: stable/11/lib/libc/x86/sys
        X-SVN-Commit-Revision: 322345
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 09:00:16 -0000
        
        Author: kib
        Date: Thu Aug 10 09:00:15 2017
        New Revision: 322345
        URL: https://svnweb.freebsd.org/changeset/base/322345
        
        Log:
          MFC r321608:
          Use MFENCE to serialize RDTSC on non-Intel CPUs.
        
        Modified:
          stable/11/lib/libc/x86/sys/__vdso_gettc.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/lib/libc/x86/sys/__vdso_gettc.c
        ==============================================================================
        --- stable/11/lib/libc/x86/sys/__vdso_gettc.c	Thu Aug 10 06:59:43 2017	(r322344)
        +++ stable/11/lib/libc/x86/sys/__vdso_gettc.c	Thu Aug 10 09:00:15 2017	(r322345)
        @@ -52,57 +52,108 @@ __FBSDID("$FreeBSD$");
         #endif
         #include "libc_private.h"
         
        +static enum LMB {
        +	LMB_UNKNOWN,
        +	LMB_NONE,
        +	LMB_MFENCE,
        +	LMB_LFENCE
        +} lfence_works = LMB_UNKNOWN;
        +
         static void
        -lfence_mb(void)
        +cpuidp(u_int leaf, u_int p[4])
         {
        +
        +	__asm __volatile(
         #if defined(__i386__)
        -	static int lfence_works = -1;
        +	    "	pushl	%%ebx\n"
        +#endif
        +	    "	cpuid\n"
        +#if defined(__i386__)
        +	    "	movl	%%ebx,%1\n"
        +	    "	popl	%%ebx"
        +#endif
        +	    : "=a" (p[0]),
        +#if defined(__i386__)
        +	    "=r" (p[1]),
        +#elif defined(__amd64__)
        +	    "=b" (p[1]),
        +#else
        +#error "Arch"
        +#endif
        +	    "=c" (p[2]), "=d" (p[3])
        +	    :  "0" (leaf));
        +}
        +
        +static enum LMB
        +select_lmb(void)
        +{
        +	u_int p[4];
        +	static const char intel_id[] = "GenuntelineI";
        +
        +	cpuidp(0, p);
        +	return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ?
        +	    LMB_LFENCE : LMB_MFENCE);
        +}
        +
        +static void
        +init_fence(void)
        +{
        +#if defined(__i386__)
         	u_int cpuid_supported, p[4];
         
        -	if (lfence_works == -1) {
        -		__asm __volatile(
        -		    "	pushfl\n"
        -		    "	popl	%%eax\n"
        -		    "	movl    %%eax,%%ecx\n"
        -		    "	xorl    $0x200000,%%eax\n"
        -		    "	pushl	%%eax\n"
        -		    "	popfl\n"
        -		    "	pushfl\n"
        -		    "	popl    %%eax\n"
        -		    "	xorl    %%eax,%%ecx\n"
        -		    "	je	1f\n"
        -		    "	movl	$1,%0\n"
        -		    "	jmp	2f\n"
        -		    "1:	movl	$0,%0\n"
        -		    "2:\n"
        -		    : "=r" (cpuid_supported) : : "eax", "ecx", "cc");
        -		if (cpuid_supported) {
        -			__asm __volatile(
        -			    "	pushl	%%ebx\n"
        -			    "	cpuid\n"
        -			    "	movl	%%ebx,%1\n"
        -			    "	popl	%%ebx\n"
        -			    : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3])
        -			    :  "0" (0x1));
        -			lfence_works = (p[3] & CPUID_SSE2) != 0;
        -		} else
        -			lfence_works = 0;
        -	}
        -	if (lfence_works == 1)
        -		lfence();
        +	__asm __volatile(
        +	    "	pushfl\n"
        +	    "	popl	%%eax\n"
        +	    "	movl    %%eax,%%ecx\n"
        +	    "	xorl    $0x200000,%%eax\n"
        +	    "	pushl	%%eax\n"
        +	    "	popfl\n"
        +	    "	pushfl\n"
        +	    "	popl    %%eax\n"
        +	    "	xorl    %%eax,%%ecx\n"
        +	    "	je	1f\n"
        +	    "	movl	$1,%0\n"
        +	    "	jmp	2f\n"
        +	    "1:	movl	$0,%0\n"
        +	    "2:\n"
        +	    : "=r" (cpuid_supported) : : "eax", "ecx", "cc");
        +	if (cpuid_supported) {
        +		cpuidp(0x1, p);
        +		if ((p[3] & CPUID_SSE2) != 0)
        +			lfence_works = select_lmb();
        +	} else
        +		lfence_works = LMB_NONE;
         #elif defined(__amd64__)
        -	lfence();
        +	lfence_works = select_lmb();
         #else
        -#error "arch"
        +#error "Arch"
         #endif
         }
         
        +static void
        +rdtsc_mb(void)
        +{
        +
        +again:
        +	if (__predict_true(lfence_works == LMB_LFENCE)) {
        +		lfence();
        +		return;
        +	} else if (lfence_works == LMB_MFENCE) {
        +		mfence();
        +		return;
        +	} else if (lfence_works == LMB_NONE) {
        +		return;
        +	}
        +	init_fence();
        +	goto again;
        +}
        +
         static u_int
         __vdso_gettc_rdtsc_low(const struct vdso_timehands *th)
         {
         	u_int rv;
         
        -	lfence_mb();
        +	rdtsc_mb();
         	__asm __volatile("rdtsc; shrd %%cl, %%edx, %0"
         	    : "=a" (rv) : "c" (th->th_x86_shift) : "edx");
         	return (rv);
        @@ -112,7 +163,7 @@ static u_int
         __vdso_rdtsc32(void)
         {
         
        -	lfence_mb();
        +	rdtsc_mb();
         	return (rdtsc32());
         }
         
        @@ -211,7 +262,7 @@ __vdso_hyperv_tsc(struct hyperv_reftsc *tsc_ref, u_int
         		scale = tsc_ref->tsc_scale;
         		ofs = tsc_ref->tsc_ofs;
         
        -		lfence_mb();
        +		rdtsc_mb();
         		tsc = rdtsc();
         
         		/* ret = ((tsc * scale) >> 64) + ofs */
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 09:02:46 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A8CFDCC7EE;
         Thu, 10 Aug 2017 09:02:46 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 EDB477C17F;
         Thu, 10 Aug 2017 09:02:45 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7A92jO9098364;
         Thu, 10 Aug 2017 09:02:45 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7A92jRK098363;
         Thu, 10 Aug 2017 09:02:45 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708100902.v7A92jRK098363@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Thu, 10 Aug 2017 09:02:45 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322346 - stable/11/libexec/rtld-elf
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: stable/11/libexec/rtld-elf
        X-SVN-Commit-Revision: 322346
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 09:02:46 -0000
        
        Author: kib
        Date: Thu Aug 10 09:02:44 2017
        New Revision: 322346
        URL: https://svnweb.freebsd.org/changeset/base/322346
        
        Log:
          MFC r321607:
          Allow to specify targets by absolute paths in libmap.conf.
          
          PR:	221032
        
        Modified:
          stable/11/libexec/rtld-elf/rtld.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/libexec/rtld-elf/rtld.c
        ==============================================================================
        --- stable/11/libexec/rtld-elf/rtld.c	Thu Aug 10 09:00:15 2017	(r322345)
        +++ stable/11/libexec/rtld-elf/rtld.c	Thu Aug 10 09:02:44 2017	(r322346)
        @@ -1589,19 +1589,20 @@ find_library(const char *xname, const Obj_Entry *refob
             bool nodeflib, objgiven;
         
             objgiven = refobj != NULL;
        -    if (strchr(xname, '/') != NULL) {	/* Hard coded pathname */
        -	if (xname[0] != '/' && !trust) {
        +
        +    if (libmap_disable || !objgiven ||
        +      (name = lm_find(refobj->path, xname)) == NULL)
        +	name = (char *)xname;
        +
        +    if (strchr(name, '/') != NULL) {	/* Hard coded pathname */
        +	if (name[0] != '/' && !trust) {
         	    _rtld_error("Absolute pathname required for shared object \"%s\"",
        -	      xname);
        -	    return NULL;
        +	      name);
        +	    return (NULL);
         	}
         	return (origin_subst(__DECONST(Obj_Entry *, refobj),
        -	  __DECONST(char *, xname)));
        +	  __DECONST(char *, name)));
             }
        -
        -    if (libmap_disable || !objgiven ||
        -	(name = lm_find(refobj->path, xname)) == NULL)
        -	name = (char *)xname;
         
             dbg(" Searching for \"%s\"", name);
         
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 15:34:51 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D9CADD5E2F;
         Thu, 10 Aug 2017 15:34:51 +0000 (UTC) (envelope-from ken@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 0726E654D0;
         Thu, 10 Aug 2017 15:34:50 +0000 (UTC) (envelope-from ken@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7AFYolf059101;
         Thu, 10 Aug 2017 15:34:50 GMT (envelope-from ken@FreeBSD.org)
        Received: (from ken@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7AFYom6059099;
         Thu, 10 Aug 2017 15:34:50 GMT (envelope-from ken@FreeBSD.org)
        Message-Id: <201708101534.v7AFYom6059099@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org
         using -f
        From: "Kenneth D. Merry" 
        Date: Thu, 10 Aug 2017 15:34:50 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322366 - in stable/11: lib/libmt usr.bin/mt
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: ken
        X-SVN-Commit-Paths: in stable/11: lib/libmt usr.bin/mt
        X-SVN-Commit-Revision: 322366
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 15:34:51 -0000
        
        Author: ken
        Date: Thu Aug 10 15:34:49 2017
        New Revision: 322366
        URL: https://svnweb.freebsd.org/changeset/base/322366
        
        Log:
          MFC r320991, r322016:
          
            ------------------------------------------------------------------------
            r320991 | ken | 2017-07-14 10:45:46 -0600 (Fri, 14 Jul 2017) | 17 lines
          
            Add IBM TS1155 density codes to libmt and the mt(1) man page.
          
            These are taken directly from the density report from a TS1155
            tape drive.  (Using mt getdensity)
          
            lib/libmt/mtlib.c:
            	Add 3592B5 encrypted/unencrypted density codes, and bpmm/bpi
            	values.  The bpmm/bpi values are the same as TS1150, but
            	there are 50% more tracks.
          
            usr.bin/mt/mt.1:
            	Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
            	values and number of tracks.  Bump the man page date.
          
            Sponsored by:	Spectra Logic
          
            ------------------------------------------------------------------------
            r322016 | ken | 2017-08-03 09:04:54 -0600 (Thu, 03 Aug 2017) | 6 lines
          
            Oracle T10000 tape drives use PRML encoding.
          
            Source:  	Oracle T10000 SCSI reference guide.
            Sponsored by:	Spectra Logic
          
            ------------------------------------------------------------------------
        
        Modified:
          stable/11/lib/libmt/mtlib.c
          stable/11/usr.bin/mt/mt.1
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/lib/libmt/mtlib.c
        ==============================================================================
        --- stable/11/lib/libmt/mtlib.c	Thu Aug 10 15:31:45 2017	(r322365)
        +++ stable/11/lib/libmt/mtlib.c	Thu Aug 10 15:34:49 2017	(r322366)
        @@ -641,6 +641,7 @@ static struct densities {
         	{ 0x53, 13452,  341681, "3592A3 (unencrypted)" },
         	{ 0x54, 19686,  500024, "3592A4 (unencrypted)" },
         	{ 0x55, 20670,  525018, "3592A5 (unencrypted)" },
        +	{ 0x56, 20670,  525018, "3592B5 (unencrypted)" },
         	{ 0x58, 15142,  384607, "LTO-5" },
         	{ 0x5A, 15142,  384607, "LTO-6" },
         	{ 0x5C, 19107,  485318, "LTO-7" },
        @@ -650,6 +651,7 @@ static struct densities {
         	{ 0x73, 13452,  341681, "3592A3 (encrypted)" },
         	{ 0x74, 19686,  500024, "3592A4 (encrypted)" },
         	{ 0x75, 20670,  525018, "3592A5 (encrypted)" },
        +	{ 0x76, 20670,  525018, "3592B5 (encrypted)" },
         	{ 0x8c,  1789,   45434, "EXB-8500c" },
         	{ 0x90,  1703,   43245, "EXB-8200c" },
         	{ 0, 0, 0, NULL }
        
        Modified: stable/11/usr.bin/mt/mt.1
        ==============================================================================
        --- stable/11/usr.bin/mt/mt.1	Thu Aug 10 15:31:45 2017	(r322365)
        +++ stable/11/usr.bin/mt/mt.1	Thu Aug 10 15:34:49 2017	(r322366)
        @@ -29,7 +29,7 @@
         .\"	@(#)mt.1	8.1 (Berkeley) 6/6/93
         .\" $FreeBSD$
         .\"
        -.Dd May 11, 2017
        +.Dd August 3, 2017
         .Dt MT 1
         .Os
         .Sh NAME
        @@ -509,15 +509,16 @@ Value  Width        Tracks    Density         Code Typ
         0x47    3.81 (0.25)   ?      6,417  (163,000)       CS  DAT-72
         0x48   12.7  (0.5)  448      5,236  (133,000) PRML  C   SDLTapeI(110) 6,8,13
         0x49   12.7  (0.5)  448      7,598  (193,000) PRML  C   SDLTapeI(160) 6,8
        -0x4A   12.7  (0.5)  768          ?                  C   T10000A      10
        -0x4B   12.7  (0.5) 1152          ?                  C   T10000B      10
        -0x4C   12.7  (0.5) 3584          ?                  C   T10000C      10
        -0x4D   12.7  (0.5) 4608          ?                  C   T10000D      10
        +0x4A   12.7  (0.5)  768          ?            PRML  C   T10000A      10
        +0x4B   12.7  (0.5) 1152          ?            PRML  C   T10000B      10
        +0x4C   12.7  (0.5) 3584          ?            PRML  C   T10000C      10
        +0x4D   12.7  (0.5) 4608          ?            PRML  C   T10000D      10
         0x51   12.7  (0.5)  512      11,800 (299,720)       C   3592A1 (unencrypted)
         0x52   12.7  (0.5)  896      11,800 (299,720)       C   3592A2 (unencrypted)
         0x53   12.7  (0.5) 1152      13,452 (341,681)       C   3592A3 (unencrypted)
         0x54   12.7  (0.5) 2560      19,686 (500,024)       C   3592A4 (unencrypted)
         0x55   12.7  (0.5) 5120      20,670 (525,018)       C   3592A5 (unencrypted)
        +0x56   12.7  (0.5) 7680      20,670 (525,018)       C   3592B5 (unencrypted)
         0x58   12.7  (0.5) 1280      15,142 (384,607)       C   LTO-5
         0x5A   12.7  (0.5) 2176      15,142 (384,607)       C   LTO-6
         0x5C   12.7  (0.5) 3584      19,107 (485,318)       C   LTO-7
        @@ -527,6 +528,7 @@ Value  Width        Tracks    Density         Code Typ
         0x73   12.7  (0.5) 1152      13,452 (341,681)       C   3592A3 (encrypted)
         0x74   12.7  (0.5) 2560      19,686 (500,024)       C   3592A4 (encrypted)
         0x75   12.7  (0.5) 5120      20,670 (525,018)       C   3592A5 (encrypted)
        +0x76   12.7  (0.5) 7680      20,670 (525,018)       C   3592B5 (encrypted)
         0x8c    8.0  (0.315)  1      1,789  (45,434)  RLL   CS  EXB-8500c    5,9
         0x90    8.0  (0.315)  1      1,703  (43,245)  RLL   CS  EXB-8200c    5,9
         .Ed
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 15:34:52 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32618DD5E37;
         Thu, 10 Aug 2017 15:34:52 +0000 (UTC) (envelope-from ken@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 0C98B654D1;
         Thu, 10 Aug 2017 15:34:51 +0000 (UTC) (envelope-from ken@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7AFYp9m059147;
         Thu, 10 Aug 2017 15:34:51 GMT (envelope-from ken@FreeBSD.org)
        Received: (from ken@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7AFYpxH059145;
         Thu, 10 Aug 2017 15:34:51 GMT (envelope-from ken@FreeBSD.org)
        Message-Id: <201708101534.v7AFYpxH059145@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org
         using -f
        From: "Kenneth D. Merry" 
        Date: Thu, 10 Aug 2017 15:34:51 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322367 - in stable/10: lib/libmt usr.bin/mt
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: ken
        X-SVN-Commit-Paths: in stable/10: lib/libmt usr.bin/mt
        X-SVN-Commit-Revision: 322367
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 15:34:52 -0000
        
        Author: ken
        Date: Thu Aug 10 15:34:50 2017
        New Revision: 322367
        URL: https://svnweb.freebsd.org/changeset/base/322367
        
        Log:
          MFC r320991, r322016:
          
            ------------------------------------------------------------------------
            r320991 | ken | 2017-07-14 10:45:46 -0600 (Fri, 14 Jul 2017) | 17 lines
          
            Add IBM TS1155 density codes to libmt and the mt(1) man page.
          
            These are taken directly from the density report from a TS1155
            tape drive.  (Using mt getdensity)
          
            lib/libmt/mtlib.c:
            	Add 3592B5 encrypted/unencrypted density codes, and bpmm/bpi
            	values.  The bpmm/bpi values are the same as TS1150, but
            	there are 50% more tracks.
          
            usr.bin/mt/mt.1:
            	Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
            	values and number of tracks.  Bump the man page date.
          
            Sponsored by:	Spectra Logic
          
            ------------------------------------------------------------------------
            r322016 | ken | 2017-08-03 09:04:54 -0600 (Thu, 03 Aug 2017) | 6 lines
          
            Oracle T10000 tape drives use PRML encoding.
          
            Source:  	Oracle T10000 SCSI reference guide.
            Sponsored by:	Spectra Logic
          
            ------------------------------------------------------------------------
        
        Modified:
          stable/10/lib/libmt/mtlib.c
          stable/10/usr.bin/mt/mt.1
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/lib/libmt/mtlib.c
        ==============================================================================
        --- stable/10/lib/libmt/mtlib.c	Thu Aug 10 15:34:49 2017	(r322366)
        +++ stable/10/lib/libmt/mtlib.c	Thu Aug 10 15:34:50 2017	(r322367)
        @@ -641,6 +641,7 @@ static struct densities {
         	{ 0x53, 13452,  341681, "3592A3 (unencrypted)" },
         	{ 0x54, 19686,  500024, "3592A4 (unencrypted)" },
         	{ 0x55, 20670,  525018, "3592A5 (unencrypted)" },
        +	{ 0x56, 20670,  525018, "3592B5 (unencrypted)" },
         	{ 0x58, 15142,  384607, "LTO-5" },
         	{ 0x5A, 15142,  384607, "LTO-6" },
         	{ 0x5C, 19107,  485318, "LTO-7" },
        @@ -650,6 +651,7 @@ static struct densities {
         	{ 0x73, 13452,  341681, "3592A3 (encrypted)" },
         	{ 0x74, 19686,  500024, "3592A4 (encrypted)" },
         	{ 0x75, 20670,  525018, "3592A5 (encrypted)" },
        +	{ 0x76, 20670,  525018, "3592B5 (encrypted)" },
         	{ 0x8c,  1789,   45434, "EXB-8500c" },
         	{ 0x90,  1703,   43245, "EXB-8200c" },
         	{ 0, 0, 0, NULL }
        
        Modified: stable/10/usr.bin/mt/mt.1
        ==============================================================================
        --- stable/10/usr.bin/mt/mt.1	Thu Aug 10 15:34:49 2017	(r322366)
        +++ stable/10/usr.bin/mt/mt.1	Thu Aug 10 15:34:50 2017	(r322367)
        @@ -29,7 +29,7 @@
         .\"	@(#)mt.1	8.1 (Berkeley) 6/6/93
         .\" $FreeBSD$
         .\"
        -.Dd May 11, 2017
        +.Dd August 3, 2017
         .Dt MT 1
         .Os
         .Sh NAME
        @@ -509,15 +509,16 @@ Value  Width        Tracks    Density         Code Typ
         0x47    3.81 (0.25)   ?      6,417  (163,000)       CS  DAT-72
         0x48   12.7  (0.5)  448      5,236  (133,000) PRML  C   SDLTapeI(110) 6,8,13
         0x49   12.7  (0.5)  448      7,598  (193,000) PRML  C   SDLTapeI(160) 6,8
        -0x4A   12.7  (0.5)  768          ?                  C   T10000A      10
        -0x4B   12.7  (0.5) 1152          ?                  C   T10000B      10
        -0x4C   12.7  (0.5) 3584          ?                  C   T10000C      10
        -0x4D   12.7  (0.5) 4608          ?                  C   T10000D      10
        +0x4A   12.7  (0.5)  768          ?            PRML  C   T10000A      10
        +0x4B   12.7  (0.5) 1152          ?            PRML  C   T10000B      10
        +0x4C   12.7  (0.5) 3584          ?            PRML  C   T10000C      10
        +0x4D   12.7  (0.5) 4608          ?            PRML  C   T10000D      10
         0x51   12.7  (0.5)  512      11,800 (299,720)       C   3592A1 (unencrypted)
         0x52   12.7  (0.5)  896      11,800 (299,720)       C   3592A2 (unencrypted)
         0x53   12.7  (0.5) 1152      13,452 (341,681)       C   3592A3 (unencrypted)
         0x54   12.7  (0.5) 2560      19,686 (500,024)       C   3592A4 (unencrypted)
         0x55   12.7  (0.5) 5120      20,670 (525,018)       C   3592A5 (unencrypted)
        +0x56   12.7  (0.5) 7680      20,670 (525,018)       C   3592B5 (unencrypted)
         0x58   12.7  (0.5) 1280      15,142 (384,607)       C   LTO-5
         0x5A   12.7  (0.5) 2176      15,142 (384,607)       C   LTO-6
         0x5C   12.7  (0.5) 3584      19,107 (485,318)       C   LTO-7
        @@ -527,6 +528,7 @@ Value  Width        Tracks    Density         Code Typ
         0x73   12.7  (0.5) 1152      13,452 (341,681)       C   3592A3 (encrypted)
         0x74   12.7  (0.5) 2560      19,686 (500,024)       C   3592A4 (encrypted)
         0x75   12.7  (0.5) 5120      20,670 (525,018)       C   3592A5 (encrypted)
        +0x76   12.7  (0.5) 7680      20,670 (525,018)       C   3592B5 (encrypted)
         0x8c    8.0  (0.315)  1      1,789  (45,434)  RLL   CS  EXB-8500c    5,9
         0x90    8.0  (0.315)  1      1,703  (43,245)  RLL   CS  EXB-8200c    5,9
         .Ed
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 21:39:11 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B7BEDDD810;
         Thu, 10 Aug 2017 21:39:11 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 454A072447;
         Thu, 10 Aug 2017 21:39:11 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7ALdAL0009774;
         Thu, 10 Aug 2017 21:39:10 GMT (envelope-from marius@FreeBSD.org)
        Received: (from marius@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7ALdAOP009773;
         Thu, 10 Aug 2017 21:39:10 GMT (envelope-from marius@FreeBSD.org)
        Message-Id: <201708102139.v7ALdAOP009773@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: marius set sender to
         marius@FreeBSD.org using -f
        From: Marius Strobl 
        Date: Thu, 10 Aug 2017 21:39:10 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322375 - stable/11/usr.sbin/tzsetup
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: marius
        X-SVN-Commit-Paths: stable/11/usr.sbin/tzsetup
        X-SVN-Commit-Revision: 322375
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 21:39:11 -0000
        
        Author: marius
        Date: Thu Aug 10 21:39:10 2017
        New Revision: 322375
        URL: https://svnweb.freebsd.org/changeset/base/322375
        
        Log:
          MFC: r322097, r322203
          
          - Since r301131, /etc/localtime is also installed when selecting UTC in
            interactive configurations. Thus, the code added in r220172 which treats
            a NULL zone file name as UTC and removes /etc/localtime in that case can
            go again.
          - Consistently refer to "could not delete" (as chosen by the oldest such
            code in here) when unlink(2) fails instead of a to mixture of "delete"
            and "unlink" in error messages.
        
        Modified:
          stable/11/usr.sbin/tzsetup/tzsetup.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/usr.sbin/tzsetup/tzsetup.c
        ==============================================================================
        --- stable/11/usr.sbin/tzsetup/tzsetup.c	Thu Aug 10 20:26:07 2017	(r322374)
        +++ stable/11/usr.sbin/tzsetup/tzsetup.c	Thu Aug 10 21:39:10 2017	(r322375)
        @@ -107,7 +107,7 @@ xdialog_count_rows(const char *p)
         		rows++;
         	}
         
        -	return rows ? rows : 1;
        +	return (rows ? rows : 1);
         }
         
         static int
        @@ -124,7 +124,7 @@ xdialog_count_columns(const char *p)
         
         	len = strlen(p);
         	max_len = MAX(max_len, len);
        -	return max_len;
        +	return (max_len);
         }
         
         static int
        @@ -164,7 +164,8 @@ xdialog_menu(const char *title, const char *cprompt, i
         				tag_x = MAX(tag_x, l + k + 2);
         			}
         		}
        -		width = MAX(xdialog_count_columns(cprompt), title != NULL ? xdialog_count_columns(title) : 0);
        +		width = MAX(xdialog_count_columns(cprompt), title != NULL ?
        +		    xdialog_count_columns(title) : 0);
         		width = MAX(width, tag_x + 4) + 4;
         	}
         	width = MAX(width, 24);
        @@ -199,7 +200,7 @@ again:
         
         	free(listitems);
         	dlg_restore_vars(&save_vars);
        -	return result;
        +	return (result);
         }
         
         static int usedialog = 1;
        @@ -269,7 +270,7 @@ continent_country_menu(dialogMenuItem *continent)
         	int		rv;
         
         	if (strcmp(continent->title, "UTC") == 0)
        -	        return set_zone_utc();
        +		return (set_zone_utc());
         
         	/* Short cut -- if there's only one country, don't post a menu. */
         	if (contp->nitems == 1)
        @@ -642,7 +643,7 @@ set_zone_menu(dialogMenuItem *dmi)
         static int
         set_zone_utc(void)
         {
        -	if (!confirm_zone(NULL))
        +	if (!confirm_zone("UTC"))
         		return (DITEM_FAILURE | DITEM_RECREATE);
         
         	return (install_zoneinfo("UTC"));
        @@ -656,7 +657,7 @@ confirm_zone(const char *filename)
         	struct tm	*tm;
         	int		rv;
         
        -	setenv("TZ", filename == NULL ? "" : filename, 1);
        +	setenv("TZ", filename, 1);
         	tzset();
         	tm = localtime(&t);
         
        @@ -714,11 +715,8 @@ install_zoneinfo_file(const char *zoneinfo_file)
         
         #ifdef VERBOSE
         	snprintf(title, sizeof(title), "Info");
        -	if (zoneinfo_file == NULL)
        +	if (copymode)
         		snprintf(prompt, sizeof(prompt),
        -		    "Removing %s", path_localtime);
        -	else if (copymode)
        -		snprintf(prompt, sizeof(prompt),
         		    "Copying %s to %s", zoneinfo_file, path_localtime);
         	else
         		snprintf(prompt, sizeof(prompt),
        @@ -733,49 +731,6 @@ install_zoneinfo_file(const char *zoneinfo_file)
         #endif
         
         	if (reallydoit) {
        -		if (zoneinfo_file == NULL) {
        -			if (unlink(path_localtime) < 0 && errno != ENOENT) {
        -				snprintf(title, sizeof(title), "Error");
        -				snprintf(prompt, sizeof(prompt),
        -				     "Could not delete %s: %s", path_localtime,
        -				     strerror(errno));
        -#ifdef HAVE_DIALOG
        -				if (usedialog)
        -					dialog_msgbox(title, prompt, 8, 72, 1);
        -				else
        -#endif
        -					fprintf(stderr, "%s\n", prompt);
        -
        -				return (DITEM_FAILURE | DITEM_RECREATE);
        -			}
        -			if (unlink(path_db) < 0 && errno != ENOENT) {
        -				snprintf(title, sizeof(title), "Error");
        -				snprintf(prompt, sizeof(prompt),
        -				     "Could not delete %s: %s", path_db,
        -				     strerror(errno));
        -#ifdef HAVE_DIALOG
        -				if (usedialog)
        -					dialog_msgbox(title, prompt, 8, 72, 1);
        -				else
        -#endif
        -					fprintf(stderr, "%s\n", prompt);
        -
        -				return (DITEM_FAILURE | DITEM_RECREATE);
        -			}
        -#ifdef VERBOSE
        -			snprintf(title, sizeof(title), "Done");
        -			snprintf(prompt, sizeof(prompt),
        -			    "Removed %s", path_localtime);
        -#ifdef HAVE_DIALOG
        -			if (usedialog)
        -				dialog_msgbox(title, prompt, 8, 72, 1);
        -			else
        -#endif
        -				fprintf(stderr, "%s\n", prompt);
        -#endif
        -			return (DITEM_LEAVE_MENU);
        -		}
        -
         		if (copymode) {
         			fd1 = open(zoneinfo_file, O_RDONLY, 0);
         			if (fd1 < 0) {
        @@ -794,7 +749,7 @@ install_zoneinfo_file(const char *zoneinfo_file)
         
         			if (unlink(path_localtime) < 0 && errno != ENOENT) {
         				snprintf(prompt, sizeof(prompt),
        -				    "Could not unlink %s: %s",
        +				    "Could not delete %s: %s",
         				    path_localtime, strerror(errno));
         #ifdef HAVE_DIALOG
         				if (usedialog) {
        @@ -859,7 +814,7 @@ install_zoneinfo_file(const char *zoneinfo_file)
         			}
         			if (unlink(path_localtime) < 0 && errno != ENOENT) {
         				snprintf(prompt, sizeof(prompt),
        -				    "Could not unlink %s: %s",
        +				    "Could not delete %s: %s",
         				    path_localtime, strerror(errno));
         #ifdef HAVE_DIALOG
         				if (usedialog) {
        @@ -999,7 +954,6 @@ main(int argc, char **argv)
         		sprintf(path_wall_cmos_clock, "%s/%s", chrootenv,
         		    _PATH_WALL_CMOS_CLOCK);
         	}
        -
         
         	/* Override the user-supplied umask. */
         	(void)umask(S_IWGRP | S_IWOTH);
        
        From owner-svn-src-stable@freebsd.org  Thu Aug 10 21:39:23 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id A245FDDD852;
         Thu, 10 Aug 2017 21:39:23 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 7DA97724ED;
         Thu, 10 Aug 2017 21:39:23 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7ALdMNw009826;
         Thu, 10 Aug 2017 21:39:22 GMT (envelope-from marius@FreeBSD.org)
        Received: (from marius@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7ALdMYg009825;
         Thu, 10 Aug 2017 21:39:22 GMT (envelope-from marius@FreeBSD.org)
        Message-Id: <201708102139.v7ALdMYg009825@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: marius set sender to
         marius@FreeBSD.org using -f
        From: Marius Strobl 
        Date: Thu, 10 Aug 2017 21:39:22 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322376 - stable/10/usr.sbin/tzsetup
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: marius
        X-SVN-Commit-Paths: stable/10/usr.sbin/tzsetup
        X-SVN-Commit-Revision: 322376
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Thu, 10 Aug 2017 21:39:23 -0000
        
        Author: marius
        Date: Thu Aug 10 21:39:22 2017
        New Revision: 322376
        URL: https://svnweb.freebsd.org/changeset/base/322376
        
        Log:
          MFC: r322097, r322203
          
          - Since r301131 (MFCed to stable/10 in r321895), /etc/localtime is also
            installed when selecting UTC in interactive configurations. Thus, the
            code added in r220172 which treats a NULL zone file name as UTC and
            removes /etc/localtime in that case can go again.
          - Consistently refer to "could not delete" (as chosen by the oldest such
            code in here) when unlink(2) fails instead of a to mixture of "delete"
            and "unlink" in error messages.
        
        Modified:
          stable/10/usr.sbin/tzsetup/tzsetup.c
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/usr.sbin/tzsetup/tzsetup.c
        ==============================================================================
        --- stable/10/usr.sbin/tzsetup/tzsetup.c	Thu Aug 10 21:39:10 2017	(r322375)
        +++ stable/10/usr.sbin/tzsetup/tzsetup.c	Thu Aug 10 21:39:22 2017	(r322376)
        @@ -107,7 +107,7 @@ xdialog_count_rows(const char *p)
         		rows++;
         	}
         
        -	return rows ? rows : 1;
        +	return (rows ? rows : 1);
         }
         
         static int
        @@ -124,7 +124,7 @@ xdialog_count_columns(const char *p)
         
         	len = strlen(p);
         	max_len = MAX(max_len, len);
        -	return max_len;
        +	return (max_len);
         }
         
         static int
        @@ -164,7 +164,8 @@ xdialog_menu(const char *title, const char *cprompt, i
         				tag_x = MAX(tag_x, l + k + 2);
         			}
         		}
        -		width = MAX(xdialog_count_columns(cprompt), title != NULL ? xdialog_count_columns(title) : 0);
        +		width = MAX(xdialog_count_columns(cprompt), title != NULL ?
        +		    xdialog_count_columns(title) : 0);
         		width = MAX(width, tag_x + 4) + 4;
         	}
         	width = MAX(width, 24);
        @@ -199,7 +200,7 @@ again:
         
         	free(listitems);
         	dlg_restore_vars(&save_vars);
        -	return result;
        +	return (result);
         }
         
         static int usedialog = 1;
        @@ -269,7 +270,7 @@ continent_country_menu(dialogMenuItem *continent)
         	int		rv;
         
         	if (strcmp(continent->title, "UTC") == 0)
        -	        return set_zone_utc();
        +		return (set_zone_utc());
         
         	/* Short cut -- if there's only one country, don't post a menu. */
         	if (contp->nitems == 1)
        @@ -642,7 +643,7 @@ set_zone_menu(dialogMenuItem *dmi)
         static int
         set_zone_utc(void)
         {
        -	if (!confirm_zone(NULL))
        +	if (!confirm_zone("UTC"))
         		return (DITEM_FAILURE | DITEM_RECREATE);
         
         	return (install_zoneinfo("UTC"));
        @@ -656,7 +657,7 @@ confirm_zone(const char *filename)
         	struct tm	*tm;
         	int		rv;
         
        -	setenv("TZ", filename == NULL ? "" : filename, 1);
        +	setenv("TZ", filename, 1);
         	tzset();
         	tm = localtime(&t);
         
        @@ -714,11 +715,8 @@ install_zoneinfo_file(const char *zoneinfo_file)
         
         #ifdef VERBOSE
         	snprintf(title, sizeof(title), "Info");
        -	if (zoneinfo_file == NULL)
        +	if (copymode)
         		snprintf(prompt, sizeof(prompt),
        -		    "Removing %s", path_localtime);
        -	else if (copymode)
        -		snprintf(prompt, sizeof(prompt),
         		    "Copying %s to %s", zoneinfo_file, path_localtime);
         	else
         		snprintf(prompt, sizeof(prompt),
        @@ -733,49 +731,6 @@ install_zoneinfo_file(const char *zoneinfo_file)
         #endif
         
         	if (reallydoit) {
        -		if (zoneinfo_file == NULL) {
        -			if (unlink(path_localtime) < 0 && errno != ENOENT) {
        -				snprintf(title, sizeof(title), "Error");
        -				snprintf(prompt, sizeof(prompt),
        -				     "Could not delete %s: %s", path_localtime,
        -				     strerror(errno));
        -#ifdef HAVE_DIALOG
        -				if (usedialog)
        -					dialog_msgbox(title, prompt, 8, 72, 1);
        -				else
        -#endif
        -					fprintf(stderr, "%s\n", prompt);
        -
        -				return (DITEM_FAILURE | DITEM_RECREATE);
        -			}
        -			if (unlink(path_db) < 0 && errno != ENOENT) {
        -				snprintf(title, sizeof(title), "Error");
        -				snprintf(prompt, sizeof(prompt),
        -				     "Could not delete %s: %s", path_db,
        -				     strerror(errno));
        -#ifdef HAVE_DIALOG
        -				if (usedialog)
        -					dialog_msgbox(title, prompt, 8, 72, 1);
        -				else
        -#endif
        -					fprintf(stderr, "%s\n", prompt);
        -
        -				return (DITEM_FAILURE | DITEM_RECREATE);
        -			}
        -#ifdef VERBOSE
        -			snprintf(title, sizeof(title), "Done");
        -			snprintf(prompt, sizeof(prompt),
        -			    "Removed %s", path_localtime);
        -#ifdef HAVE_DIALOG
        -			if (usedialog)
        -				dialog_msgbox(title, prompt, 8, 72, 1);
        -			else
        -#endif
        -				fprintf(stderr, "%s\n", prompt);
        -#endif
        -			return (DITEM_LEAVE_MENU);
        -		}
        -
         		if (copymode) {
         			fd1 = open(zoneinfo_file, O_RDONLY, 0);
         			if (fd1 < 0) {
        @@ -794,7 +749,7 @@ install_zoneinfo_file(const char *zoneinfo_file)
         
         			if (unlink(path_localtime) < 0 && errno != ENOENT) {
         				snprintf(prompt, sizeof(prompt),
        -				    "Could not unlink %s: %s",
        +				    "Could not delete %s: %s",
         				    path_localtime, strerror(errno));
         #ifdef HAVE_DIALOG
         				if (usedialog) {
        @@ -859,7 +814,7 @@ install_zoneinfo_file(const char *zoneinfo_file)
         			}
         			if (unlink(path_localtime) < 0 && errno != ENOENT) {
         				snprintf(prompt, sizeof(prompt),
        -				    "Could not unlink %s: %s",
        +				    "Could not delete %s: %s",
         				    path_localtime, strerror(errno));
         #ifdef HAVE_DIALOG
         				if (usedialog) {
        @@ -999,7 +954,6 @@ main(int argc, char **argv)
         		sprintf(path_wall_cmos_clock, "%s/%s", chrootenv,
         		    _PATH_WALL_CMOS_CLOCK);
         	}
        -
         
         	/* Override the user-supplied umask. */
         	(void)umask(S_IWGRP | S_IWOTH);
        
        From owner-svn-src-stable@freebsd.org  Fri Aug 11 00:41:20 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C2B9C7D6CC;
         Fri, 11 Aug 2017 00:41:20 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 5A8C27C3B6;
         Fri, 11 Aug 2017 00:41:20 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7B0fJq0083384;
         Fri, 11 Aug 2017 00:41:19 GMT (envelope-from marius@FreeBSD.org)
        Received: (from marius@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7B0fJ3x083379;
         Fri, 11 Aug 2017 00:41:19 GMT (envelope-from marius@FreeBSD.org)
        Message-Id: <201708110041.v7B0fJ3x083379@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: marius set sender to
         marius@FreeBSD.org using -f
        From: Marius Strobl 
        Date: Fri, 11 Aug 2017 00:41:19 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322388 - stable/11/sys/dev/mmc
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: marius
        X-SVN-Commit-Paths: stable/11/sys/dev/mmc
        X-SVN-Commit-Revision: 322388
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Fri, 11 Aug 2017 00:41:20 -0000
        
        Author: marius
        Date: Fri Aug 11 00:41:19 2017
        New Revision: 322388
        URL: https://svnweb.freebsd.org/changeset/base/322388
        
        Log:
          MFC: r322209
          
          - If available, use TRIM instead of ERASE for implementing BIO_DELETE.
            This also involves adding a quirk table as TRIM is broken for some
            Kingston eMMC devices, though. Compared to ERASE (declared "legacy"
            in the eMMC specification v5.1), TRIM has the advantage of operating
            on write sectors rather than on erase sectors, which typically are
            of a much larger size. Thus, employing TRIM, we don't need to fiddle
            with coalescing BIO_DELETE requests that are also of (write) sector
            units into erase sectors, which might not even add up in all cases.
          - For some SanDisk iNAND devices, the CMD38 argument, e. g. ERASE,
            TRIM etc., has to be specified via EXT_CSD[113], which now is also
            handled via a quirk.
          - My initial understanding was that for eMMC partitions, the granularity
            should be used as erase sector size, e. g. 128 KB for boot partitions.
            However, rereading the relevant parts of the eMMC specification v5.1,
            this isn't actually correct. So drop the code which used partition
            granularities for delmaxsize and stripesize. For the most part, this
            change is a NOP, though, because a) for ERASE, mmcsd_delete() used
            the erase sector size unconditionally for all partitions anyway and
            b) g_disk_limit() doesn't actually take the stripesize into account.
          - Take some more advantage of mmcsd_errmsg() in mmcsd(4) for making
            error codes human readable.
        
        Modified:
          stable/11/sys/dev/mmc/bridge.h
          stable/11/sys/dev/mmc/mmc.c
          stable/11/sys/dev/mmc/mmcreg.h
          stable/11/sys/dev/mmc/mmcsd.c
          stable/11/sys/dev/mmc/mmcvar.h
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/dev/mmc/bridge.h
        ==============================================================================
        --- stable/11/sys/dev/mmc/bridge.h	Fri Aug 11 00:01:22 2017	(r322387)
        +++ stable/11/sys/dev/mmc/bridge.h	Fri Aug 11 00:41:19 2017	(r322388)
        @@ -179,7 +179,7 @@ struct mmc_host {
         extern driver_t   mmc_driver;
         extern devclass_t mmc_devclass;
         
        -#define	MMC_VERSION	4
        +#define	MMC_VERSION	5
         
         #define	MMC_DECLARE_BRIDGE(name)					\
             DRIVER_MODULE(mmc, name, mmc_driver, mmc_devclass, NULL, NULL);	\
        
        Modified: stable/11/sys/dev/mmc/mmc.c
        ==============================================================================
        --- stable/11/sys/dev/mmc/mmc.c	Fri Aug 11 00:01:22 2017	(r322387)
        +++ stable/11/sys/dev/mmc/mmc.c	Fri Aug 11 00:41:19 2017	(r322388)
        @@ -104,12 +104,34 @@ struct mmc_ivars {
         	uint32_t hs_tran_speed;	/* Max speed in high speed mode */
         	uint32_t erase_sector;	/* Card native erase sector size */
         	uint32_t cmd6_time;	/* Generic switch timeout [us] */
        +	uint32_t quirks;	/* Quirks as per mmc_quirk->quirks */
         	char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */
         	char card_sn_string[16];/* Formatted serial # for disk->d_ident */
         };
         
         #define	CMD_RETRIES	3
         
        +static const struct mmc_quirk mmc_quirks[] = {
        +	/*
        +	 * For some SanDisk iNAND devices, the CMD38 argument needs to be
        +	 * provided in EXT_CSD[113].
        +	 */
        +	{ 0x2, 0x100,	 		"SEM02G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM04G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM08G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM16G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM32G", MMC_QUIRK_INAND_CMD38 },
        +
        +	/*
        +	 * Disable TRIM for Kingston eMMCs where a firmware bug can lead to
        +	 * unrecoverable data corruption.
        +	 */
        +	{ 0x70, MMC_QUIRK_OID_ANY,	"V10008", MMC_QUIRK_BROKEN_TRIM },
        +	{ 0x70, MMC_QUIRK_OID_ANY,	"V10016", MMC_QUIRK_BROKEN_TRIM },
        +
        +	{ 0x0, 0x0, NULL, 0x0 }
        +};
        +
         static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver");
         
         static int mmc_debug;
        @@ -1109,7 +1131,7 @@ mmc_format_card_id_string(struct mmc_ivars *ivar)
         	/*
         	 * Format a card ID string for use by the mmcsd driver, it's what
         	 * appears between the <> in the following:
        -	 * mmcsd0: 968MB  at mmc0
        +	 * mmcsd0: 968MB  at mmc0
         	 * 22.5MHz/4bit/128-block
         	 *
         	 * Also format just the card serial number, which the mmcsd driver will
        @@ -1547,6 +1569,7 @@ mmc_log_card(device_t dev, struct mmc_ivars *ivar, int
         			break;
         		}
         	}
        +	device_printf(dev, " quirks: %b\n", ivar->quirks, MMC_QUIRKS_FMT);
         	device_printf(dev, " bus: %ubit, %uMHz (%s timing)\n",
         	    (ivar->bus_width == bus_width_1 ? 1 :
         	    (ivar->bus_width == bus_width_4 ? 4 : 8)),
        @@ -1563,6 +1586,7 @@ mmc_discover_cards(struct mmc_softc *sc)
         	u_char switch_res[64];
         	uint32_t raw_cid[4];
         	struct mmc_ivars *ivar = NULL;
        +	const struct mmc_quirk *quirk;
         	device_t child;
         	int err, host_caps, i, newcard;
         	uint32_t resp, sec_count, status;
        @@ -1870,6 +1894,18 @@ mmc_discover_cards(struct mmc_softc *sc)
         		    ivar->raw_ext_csd[EXT_CSD_REV] >= 5);
         
         child_common:
        +		for (quirk = &mmc_quirks[0]; quirk->mid != 0x0; quirk++) {
        +			if ((quirk->mid == MMC_QUIRK_MID_ANY ||
        +			    quirk->mid == ivar->cid.mid) &&
        +			    (quirk->oid == MMC_QUIRK_OID_ANY ||
        +			    quirk->oid == ivar->cid.oid) &&
        +			    strncmp(quirk->pnm, ivar->cid.pnm,
        +			    sizeof(ivar->cid.pnm)) == 0) {
        +				ivar->quirks = quirk->quirks;
        +				break;
        +			}
        +		}
        +
         		/*
         		 * Some cards that report maximum I/O block sizes greater
         		 * than 512 require the block length to be set to 512, even
        @@ -2470,6 +2506,12 @@ mmc_read_ivar(device_t bus, device_t child, int which,
         		break;
         	case MMC_IVAR_MAX_DATA:
         		*result = mmcbr_get_max_data(bus);
        +		break;
        +	case MMC_IVAR_CMD6_TIMEOUT:
        +		*result = ivar->cmd6_time;
        +		break;
        +	case MMC_IVAR_QUIRKS:
        +		*result = ivar->quirks;
         		break;
         	case MMC_IVAR_CARD_ID_STRING:
         		*(char **)result = ivar->card_id_string;
        
        Modified: stable/11/sys/dev/mmc/mmcreg.h
        ==============================================================================
        --- stable/11/sys/dev/mmc/mmcreg.h	Fri Aug 11 00:01:22 2017	(r322387)
        +++ stable/11/sys/dev/mmc/mmcreg.h	Fri Aug 11 00:41:19 2017	(r322388)
        @@ -238,6 +238,13 @@ struct mmc_request {
         #define	MMC_ERASE_GROUP_END	36
         			/* 37 -- reserved old command */
         #define	MMC_ERASE		38
        +#define	 MMC_ERASE_ERASE	0x00000000
        +#define	 MMC_ERASE_TRIM		0x00000001
        +#define	 MMC_ERASE_FULE		0x00000002
        +#define	 MMC_ERASE_DISCARD	0x00000003
        +#define	 MMC_ERASE_SECURE_ERASE	0x80000000
        +#define	 MMC_ERASE_SECURE_TRIM1	0x80000001
        +#define	 MMC_ERASE_SECURE_TRIM2	0x80008000
         
         /* Class 9: I/O mode commands */
         #define	MMC_FAST_IO		39
        @@ -321,6 +328,7 @@ struct mmc_request {
         #define	EXT_CSD_ERASE_TO_MULT	223	/* RO */
         #define	EXT_CSD_ERASE_GRP_SIZE	224	/* RO */
         #define	EXT_CSD_BOOT_SIZE_MULT	226	/* RO */
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT 231	/* RO */
         #define	EXT_CSD_PWR_CL_200_195	236	/* RO */
         #define	EXT_CSD_PWR_CL_200_360	237	/* RO */
         #define	EXT_CSD_PWR_CL_52_195_DDR 238	/* RO */
        @@ -405,6 +413,22 @@ struct mmc_request {
         
         #define	EXT_CSD_STROBE_SUPPORT_EN	0x01
         
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_ER_EN	0x01
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_BD_BLK_EN	0x04
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_GB_CL_EN	0x10
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_SANITIZE	0x40
        +
        +/*
        + * Vendor specific EXT_CSD fields
        + */
        +/* SanDisk iNAND */
        +#define	EXT_CSD_INAND_CMD38			113
        +#define	 EXT_CSD_INAND_CMD38_ERASE		0x00
        +#define	 EXT_CSD_INAND_CMD38_TRIM		0x01
        +#define	 EXT_CSD_INAND_CMD38_SECURE_ERASE	0x80
        +#define	 EXT_CSD_INAND_CMD38_SECURE_TRIM1	0x81
        +#define	 EXT_CSD_INAND_CMD38_SECURE_TRIM2	0x82
        +
         #define	MMC_TYPE_HS_26_MAX		26000000
         #define	MMC_TYPE_HS_52_MAX		52000000
         #define	MMC_TYPE_DDR52_MAX		52000000
        @@ -498,8 +522,7 @@ struct mmc_cid {
         	uint8_t fwrev;
         };
         
        -struct mmc_csd
        -{
        +struct mmc_csd {
         	uint8_t csd_structure;
         	uint8_t spec_vers;
         	uint16_t ccc;
        @@ -525,16 +548,14 @@ struct mmc_csd
         	    wp_grp_enable:1;
         };
         
        -struct mmc_scr
        -{
        +struct mmc_scr {
         	unsigned char		sda_vsn;
         	unsigned char		bus_widths;
         #define	SD_SCR_BUS_WIDTH_1	(1 << 0)
         #define	SD_SCR_BUS_WIDTH_4	(1 << 2)
         };
         
        -struct mmc_sd_status
        -{
        +struct mmc_sd_status {
         	uint8_t			bus_width;
         	uint8_t			secured_mode;
         	uint16_t		card_type;
        @@ -546,6 +567,19 @@ struct mmc_sd_status
         	uint8_t			erase_timeout;
         	uint8_t			erase_offset;
         };
        +
        +struct mmc_quirk {
        +	uint32_t mid;
        +#define	MMC_QUIRK_MID_ANY	((uint32_t)-1)
        +	uint16_t oid;
        +#define	MMC_QUIRK_OID_ANY	((uint16_t)-1)
        +	const char *pnm;
        +	uint32_t quirks;
        +#define	MMC_QUIRK_INAND_CMD38	0x0001
        +#define	MMC_QUIRK_BROKEN_TRIM	0x0002
        +};
        +
        +#define	MMC_QUIRKS_FMT		"\020" "\001INAND_CMD38" "\002BROKEN_TRIM"
         
         /*
          * Various MMC/SD constants
        
        Modified: stable/11/sys/dev/mmc/mmcsd.c
        ==============================================================================
        --- stable/11/sys/dev/mmc/mmcsd.c	Fri Aug 11 00:01:22 2017	(r322387)
        +++ stable/11/sys/dev/mmc/mmcsd.c	Fri Aug 11 00:41:19 2017	(r322388)
        @@ -126,6 +126,10 @@ struct mmcsd_softc {
         	uint8_t part_curr;	/* Partition currently switched to */
         	uint8_t ext_csd[MMC_EXTCSD_SIZE];
         	uint16_t rca;
        +	uint32_t flags;
        +#define	MMCSD_INAND_CMD38	0x0001
        +#define	MMCSD_USE_TRIM		0x0002
        +	uint32_t cmd6_time;	/* Generic switch timeout [us] */
         	uint32_t part_time;	/* Partition switch timeout [us] */
         	off_t enh_base;		/* Enhanced user data area slice base ... */
         	off_t enh_size;		/* ... and size [bytes] */
        @@ -168,9 +172,10 @@ static int mmcsd_ioctl_rpmb(struct cdev *dev, u_long c
             int fflag, struct thread *td);
         
         static void mmcsd_add_part(struct mmcsd_softc *sc, u_int type,
        -    const char *name, u_int cnt, off_t media_size, off_t erase_size, bool ro);
        +    const char *name, u_int cnt, off_t media_size, bool ro);
         static int mmcsd_bus_bit_width(device_t dev);
         static daddr_t mmcsd_delete(struct mmcsd_part *part, struct bio *bp);
        +static const char *mmcsd_errmsg(int e);
         static int mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data,
             int fflag);
         static int mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic,
        @@ -221,6 +226,7 @@ mmcsd_attach(device_t dev)
         	off_t erase_size, sector_size, size, wp_size;
         	uintmax_t bytes;
         	int err, i;
        +	uint32_t quirks;
         	uint8_t rev;
         	bool comp, ro;
         	char unit[2];
        @@ -239,21 +245,48 @@ mmcsd_attach(device_t dev)
         	 * place either.
         	 */
         	sc->max_data = mmc_get_max_data(dev);
        -	sc->erase_sector = mmc_get_erase_sector(dev);
         	sc->high_cap = mmc_get_high_cap(dev);
         	sc->rca = mmc_get_rca(dev);
        +	sc->cmd6_time = mmc_get_cmd6_timeout(dev);
        +	quirks = mmc_get_quirks(dev);
         
         	/* Only MMC >= 4.x devices support EXT_CSD. */
         	if (mmc_get_spec_vers(dev) >= 4) {
         		MMCBUS_ACQUIRE_BUS(mmcbus, dev);
         		err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd);
         		MMCBUS_RELEASE_BUS(mmcbus, dev);
        -		if (err != MMC_ERR_NONE)
        -			bzero(sc->ext_csd, sizeof(sc->ext_csd));
        +		if (err != MMC_ERR_NONE) {
        +			device_printf(dev, "Error reading EXT_CSD %s\n",
        +			    mmcsd_errmsg(err));
        +			return (ENXIO);
        +		}
         	}
         	ext_csd = sc->ext_csd;
         
        +	if ((quirks & MMC_QUIRK_INAND_CMD38) != 0) {
        +		if (mmc_get_spec_vers(dev) < 4) {
        +			device_printf(dev,
        +			    "MMC_QUIRK_INAND_CMD38 set but no EXT_CSD\n");
        +			return (EINVAL);
        +		}
        +		sc->flags |= MMCSD_INAND_CMD38;
        +	}
        +
         	/*
        +	 * EXT_CSD_SEC_FEATURE_SUPPORT_GB_CL_EN denotes support for both
        +	 * insecure and secure TRIM.
        +	 */
        +	if ((ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT] &
        +	    EXT_CSD_SEC_FEATURE_SUPPORT_GB_CL_EN) != 0 &&
        +	    (quirks & MMC_QUIRK_BROKEN_TRIM) == 0) {
        +		if (bootverbose)
        +			device_printf(dev, "taking advantage of TRIM\n");
        +		sc->flags |= MMCSD_USE_TRIM;
        +		sc->erase_sector = 1;
        +	} else
        +		sc->erase_sector = mmc_get_erase_sector(dev);
        +
        +	/*
         	 * Enhanced user data area and general purpose partitions are only
         	 * supported in revision 1.4 (EXT_CSD_REV == 4) and later, the RPMB
         	 * partition in revision 1.5 (MMC v4.41, EXT_CSD_REV == 5) and later.
        @@ -306,8 +339,7 @@ mmcsd_attach(device_t dev)
         	 */
         	ro = mmc_get_read_only(dev);
         	mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_DEFAULT, "mmcsd",
        -	    device_get_unit(dev), mmc_get_media_size(dev) * sector_size,
        -	    sc->erase_sector * sector_size, ro);
        +	    device_get_unit(dev), mmc_get_media_size(dev) * sector_size, ro);
         
         	if (mmc_get_spec_vers(dev) < 3)
         		return (0);
        @@ -332,11 +364,11 @@ mmcsd_attach(device_t dev)
         	size = ext_csd[EXT_CSD_BOOT_SIZE_MULT] * MMC_BOOT_RPMB_BLOCK_SIZE;
         	if (size > 0 && (mmcbr_get_caps(mmcbus) & MMC_CAP_BOOT_NOACC) == 0) {
         		mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_BOOT0,
        -		    MMCSD_FMT_BOOT, 0, size, MMC_BOOT_RPMB_BLOCK_SIZE,
        +		    MMCSD_FMT_BOOT, 0, size,
         		    ro | ((ext_csd[EXT_CSD_BOOT_WP_STATUS] &
         		    EXT_CSD_BOOT_WP_STATUS_BOOT0_MASK) != 0));
         		mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_BOOT1,
        -		    MMCSD_FMT_BOOT, 1, size, MMC_BOOT_RPMB_BLOCK_SIZE,
        +		    MMCSD_FMT_BOOT, 1, size,
         		    ro | ((ext_csd[EXT_CSD_BOOT_WP_STATUS] &
         		    EXT_CSD_BOOT_WP_STATUS_BOOT1_MASK) != 0));
         	}
        @@ -345,7 +377,7 @@ mmcsd_attach(device_t dev)
         	size = ext_csd[EXT_CSD_RPMB_MULT] * MMC_BOOT_RPMB_BLOCK_SIZE;
         	if (rev >= 5 && size > 0)
         		mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_RPMB,
        -		    MMCSD_FMT_RPMB, 0, size, MMC_BOOT_RPMB_BLOCK_SIZE, ro);
        +		    MMCSD_FMT_RPMB, 0, size, ro);
         
         	if (rev <= 3 || comp == FALSE)
         		return (0);
        @@ -365,8 +397,7 @@ mmcsd_attach(device_t dev)
         			if (size == 0)
         				continue;
         			mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_GP0 + i,
        -			    MMCSD_FMT_GP, i, size * erase_size * wp_size,
        -			    erase_size, ro);
        +			    MMCSD_FMT_GP, i, size * erase_size * wp_size, ro);
         		}
         	}
         	return (0);
        @@ -419,7 +450,7 @@ static struct cdevsw mmcsd_rpmb_cdevsw = {
         
         static void
         mmcsd_add_part(struct mmcsd_softc *sc, u_int type, const char *name, u_int cnt,
        -    off_t media_size, off_t erase_size, bool ro)
        +    off_t media_size, bool ro)
         {
         	struct make_dev_args args;
         	device_t dev, mmcbus;
        @@ -482,10 +513,10 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con
         		d->d_sectorsize = mmc_get_sector_size(dev);
         		d->d_maxsize = sc->max_data * d->d_sectorsize;
         		d->d_mediasize = media_size;
        -		d->d_stripesize = erase_size;
        +		d->d_stripesize = sc->erase_sector * d->d_sectorsize;
         		d->d_unit = cnt;
         		d->d_flags = DISKFLAG_CANDELETE;
        -		d->d_delmaxsize = erase_size;
        +		d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize;
         		strlcpy(d->d_ident, mmc_get_card_sn_string(dev),
         		    sizeof(d->d_ident));
         		strlcpy(d->d_descr, mmc_get_card_id_string(dev),
        @@ -1151,6 +1182,8 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	struct mmcsd_softc *sc;
         	device_t dev, mmcbus;
         	u_int erase_sector, sz;
        +	int err;
        +	bool use_trim;
         
         	sc = part->sc;
         	dev = sc->dev;
        @@ -1159,24 +1192,46 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	block = bp->bio_pblkno;
         	sz = part->disk->d_sectorsize;
         	end = bp->bio_pblkno + (bp->bio_bcount / sz);
        -	/* Coalesce with part remaining from previous request. */
        -	if (block > part->eblock && block <= part->eend)
        -		block = part->eblock;
        -	if (end >= part->eblock && end < part->eend)
        -		end = part->eend;
        -	/* Safe round to the erase sector boundaries. */
        -	erase_sector = sc->erase_sector;
        -	start = block + erase_sector - 1;	 /* Round up. */
        -	start -= start % erase_sector;
        -	stop = end;				/* Round down. */
        -	stop -= end % erase_sector;
        -	/* We can't erase an area smaller than a sector, store it for later. */
        -	if (start >= stop) {
        -		part->eblock = block;
        -		part->eend = end;
        -		return (end);
        +	use_trim = sc->flags & MMCSD_USE_TRIM;
        +	if (use_trim == true) {
        +		start = block;
        +		stop = end;
        +	} else {
        +		/* Coalesce with the remainder of the previous request. */
        +		if (block > part->eblock && block <= part->eend)
        +			block = part->eblock;
        +		if (end >= part->eblock && end < part->eend)
        +			end = part->eend;
        +		/* Safely round to the erase sector boundaries. */
        +		erase_sector = sc->erase_sector;
        +		start = block + erase_sector - 1;	 /* Round up. */
        +		start -= start % erase_sector;
        +		stop = end;				/* Round down. */
        +		stop -= end % erase_sector;
        +		/*
        +		 * We can't erase an area smaller than an erase sector, so
        +		 * store it for later.
        +		 */
        +		if (start >= stop) {
        +			part->eblock = block;
        +			part->eend = end;
        +			return (end);
        +		}
         	}
         
        +	if ((sc->flags & MMCSD_INAND_CMD38) != 0) {
        +		err = mmc_switch(mmcbus, dev, sc->rca, EXT_CSD_CMD_SET_NORMAL,
        +		    EXT_CSD_INAND_CMD38, use_trim == true ?
        +		    EXT_CSD_INAND_CMD38_TRIM : EXT_CSD_INAND_CMD38_ERASE,
        +		    sc->cmd6_time, true);
        +		if (err != MMC_ERR_NONE) {
        +			device_printf(dev,
        +			    "Setting iNAND erase command failed %s\n",
        +			    mmcsd_errmsg(err));
        +			return (block);
        +		}
        +	}
        +
         	/*
         	 * Pause re-tuning so it won't interfere with the order of erase
         	 * commands.  Note that these latter don't use the data lines, so
        @@ -1198,8 +1253,8 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
         	MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req);
         	if (req.cmd->error != MMC_ERR_NONE) {
        -		device_printf(dev, "Setting erase start position failed %d\n",
        -		    req.cmd->error);
        +		device_printf(dev, "Setting erase start position failed %s\n",
        +		    mmcsd_errmsg(req.cmd->error));
         		block = bp->bio_pblkno;
         		goto unpause;
         	}
        @@ -1218,8 +1273,8 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
         	MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req);
         	if (req.cmd->error != MMC_ERR_NONE) {
        -		device_printf(dev, "Setting erase stop position failed %d\n",
        -		    req.cmd->error);
        +		device_printf(dev, "Setting erase stop position failed %s\n",
        +		    mmcsd_errmsg(req.cmd->error));
         		block = bp->bio_pblkno;
         		goto unpause;
         	}
        @@ -1228,23 +1283,24 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	memset(&cmd, 0, sizeof(cmd));
         	req.cmd = &cmd;
         	cmd.opcode = MMC_ERASE;
        -	cmd.arg = 0;
        +	cmd.arg = use_trim == true ? MMC_ERASE_TRIM : MMC_ERASE_ERASE;
         	cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
         	MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req);
         	if (req.cmd->error != MMC_ERR_NONE) {
        -		device_printf(dev, "erase err3: %d\n", req.cmd->error);
        -		device_printf(dev, "Issuing erase command failed %d\n",
        -		    req.cmd->error);
        +		device_printf(dev, "Issuing erase command failed %s\n",
        +		    mmcsd_errmsg(req.cmd->error));
         		block = bp->bio_pblkno;
         		goto unpause;
         	}
        -	/* Store one of remaining parts for the next call. */
        -	if (bp->bio_pblkno >= part->eblock || block == start) {
        -		part->eblock = stop;	/* Predict next forward. */
        -		part->eend = end;
        -	} else {
        -		part->eblock = block;	/* Predict next backward. */
        -		part->eend = start;
        +	if (use_trim == false) {
        +		/* Store one of the remaining parts for the next call. */
        +		if (bp->bio_pblkno >= part->eblock || block == start) {
        +			part->eblock = stop;	/* Predict next forward. */
        +			part->eend = end;
        +		} else {
        +			part->eblock = block;	/* Predict next backward. */
        +			part->eend = start;
        +		}
         	}
         	block = end;
         unpause:
        
        Modified: stable/11/sys/dev/mmc/mmcvar.h
        ==============================================================================
        --- stable/11/sys/dev/mmc/mmcvar.h	Fri Aug 11 00:01:22 2017	(r322387)
        +++ stable/11/sys/dev/mmc/mmcvar.h	Fri Aug 11 00:41:19 2017	(r322388)
        @@ -68,6 +68,8 @@ enum mmc_device_ivars {
             MMC_IVAR_BUS_WIDTH,
             MMC_IVAR_ERASE_SECTOR,
             MMC_IVAR_MAX_DATA,
        +    MMC_IVAR_CMD6_TIMEOUT,
        +    MMC_IVAR_QUIRKS,
             MMC_IVAR_CARD_ID_STRING,
             MMC_IVAR_CARD_SN_STRING,
         };
        @@ -90,6 +92,8 @@ MMC_ACCESSOR(card_type, CARD_TYPE, int)
         MMC_ACCESSOR(bus_width, BUS_WIDTH, int)
         MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int)
         MMC_ACCESSOR(max_data, MAX_DATA, int)
        +MMC_ACCESSOR(cmd6_timeout, CMD6_TIMEOUT, u_int)
        +MMC_ACCESSOR(quirks, QUIRKS, u_int)
         MMC_ACCESSOR(card_id_string, CARD_ID_STRING, const char *)
         MMC_ACCESSOR(card_sn_string, CARD_SN_STRING, const char *)
         
        
        From owner-svn-src-stable@freebsd.org  Fri Aug 11 00:41:45 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D806C7D792;
         Fri, 11 Aug 2017 00:41:45 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 F1B057C622;
         Fri, 11 Aug 2017 00:41:44 +0000 (UTC)
         (envelope-from marius@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7B0fiFR084320;
         Fri, 11 Aug 2017 00:41:44 GMT (envelope-from marius@FreeBSD.org)
        Received: (from marius@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7B0fhE6084315;
         Fri, 11 Aug 2017 00:41:43 GMT (envelope-from marius@FreeBSD.org)
        Message-Id: <201708110041.v7B0fhE6084315@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: marius set sender to
         marius@FreeBSD.org using -f
        From: Marius Strobl 
        Date: Fri, 11 Aug 2017 00:41:43 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322389 - stable/10/sys/dev/mmc
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: marius
        X-SVN-Commit-Paths: stable/10/sys/dev/mmc
        X-SVN-Commit-Revision: 322389
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Fri, 11 Aug 2017 00:41:45 -0000
        
        Author: marius
        Date: Fri Aug 11 00:41:43 2017
        New Revision: 322389
        URL: https://svnweb.freebsd.org/changeset/base/322389
        
        Log:
          MFC: r322209
          
          - If available, use TRIM instead of ERASE for implementing BIO_DELETE.
            This also involves adding a quirk table as TRIM is broken for some
            Kingston eMMC devices, though. Compared to ERASE (declared "legacy"
            in the eMMC specification v5.1), TRIM has the advantage of operating
            on write sectors rather than on erase sectors, which typically are
            of a much larger size. Thus, employing TRIM, we don't need to fiddle
            with coalescing BIO_DELETE requests that are also of (write) sector
            units into erase sectors, which might not even add up in all cases.
          - For some SanDisk iNAND devices, the CMD38 argument, e. g. ERASE,
            TRIM etc., has to be specified via EXT_CSD[113], which now is also
            handled via a quirk.
          - My initial understanding was that for eMMC partitions, the granularity
            should be used as erase sector size, e. g. 128 KB for boot partitions.
            However, rereading the relevant parts of the eMMC specification v5.1,
            this isn't actually correct. So drop the code which used partition
            granularities for delmaxsize and stripesize. For the most part, this
            change is a NOP, though, because a) for ERASE, mmcsd_delete() used
            the erase sector size unconditionally for all partitions anyway and
            b) g_disk_limit() doesn't actually take the stripesize into account.
          - Take some more advantage of mmcsd_errmsg() in mmcsd(4) for making
            error codes human readable.
        
        Modified:
          stable/10/sys/dev/mmc/bridge.h
          stable/10/sys/dev/mmc/mmc.c
          stable/10/sys/dev/mmc/mmcreg.h
          stable/10/sys/dev/mmc/mmcsd.c
          stable/10/sys/dev/mmc/mmcvar.h
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/sys/dev/mmc/bridge.h
        ==============================================================================
        --- stable/10/sys/dev/mmc/bridge.h	Fri Aug 11 00:41:19 2017	(r322388)
        +++ stable/10/sys/dev/mmc/bridge.h	Fri Aug 11 00:41:43 2017	(r322389)
        @@ -179,7 +179,7 @@ struct mmc_host {
         extern driver_t   mmc_driver;
         extern devclass_t mmc_devclass;
         
        -#define	MMC_VERSION	4
        +#define	MMC_VERSION	5
         
         #define	MMC_DECLARE_BRIDGE(name)					\
             DRIVER_MODULE(mmc, name, mmc_driver, mmc_devclass, NULL, NULL);	\
        
        Modified: stable/10/sys/dev/mmc/mmc.c
        ==============================================================================
        --- stable/10/sys/dev/mmc/mmc.c	Fri Aug 11 00:41:19 2017	(r322388)
        +++ stable/10/sys/dev/mmc/mmc.c	Fri Aug 11 00:41:43 2017	(r322389)
        @@ -104,12 +104,34 @@ struct mmc_ivars {
         	uint32_t hs_tran_speed;	/* Max speed in high speed mode */
         	uint32_t erase_sector;	/* Card native erase sector size */
         	uint32_t cmd6_time;	/* Generic switch timeout [us] */
        +	uint32_t quirks;	/* Quirks as per mmc_quirk->quirks */
         	char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */
         	char card_sn_string[16];/* Formatted serial # for disk->d_ident */
         };
         
         #define	CMD_RETRIES	3
         
        +static const struct mmc_quirk mmc_quirks[] = {
        +	/*
        +	 * For some SanDisk iNAND devices, the CMD38 argument needs to be
        +	 * provided in EXT_CSD[113].
        +	 */
        +	{ 0x2, 0x100,	 		"SEM02G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM04G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM08G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM16G", MMC_QUIRK_INAND_CMD38 },
        +	{ 0x2, 0x100,			"SEM32G", MMC_QUIRK_INAND_CMD38 },
        +
        +	/*
        +	 * Disable TRIM for Kingston eMMCs where a firmware bug can lead to
        +	 * unrecoverable data corruption.
        +	 */
        +	{ 0x70, MMC_QUIRK_OID_ANY,	"V10008", MMC_QUIRK_BROKEN_TRIM },
        +	{ 0x70, MMC_QUIRK_OID_ANY,	"V10016", MMC_QUIRK_BROKEN_TRIM },
        +
        +	{ 0x0, 0x0, NULL, 0x0 }
        +};
        +
         static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver");
         
         static int mmc_debug;
        @@ -1110,7 +1132,7 @@ mmc_format_card_id_string(struct mmc_ivars *ivar)
         	/*
         	 * Format a card ID string for use by the mmcsd driver, it's what
         	 * appears between the <> in the following:
        -	 * mmcsd0: 968MB  at mmc0
        +	 * mmcsd0: 968MB  at mmc0
         	 * 22.5MHz/4bit/128-block
         	 *
         	 * Also format just the card serial number, which the mmcsd driver will
        @@ -1548,6 +1570,7 @@ mmc_log_card(device_t dev, struct mmc_ivars *ivar, int
         			break;
         		}
         	}
        +	device_printf(dev, " quirks: %b\n", ivar->quirks, MMC_QUIRKS_FMT);
         	device_printf(dev, " bus: %ubit, %uMHz (%s timing)\n",
         	    (ivar->bus_width == bus_width_1 ? 1 :
         	    (ivar->bus_width == bus_width_4 ? 4 : 8)),
        @@ -1564,6 +1587,7 @@ mmc_discover_cards(struct mmc_softc *sc)
         	u_char switch_res[64];
         	uint32_t raw_cid[4];
         	struct mmc_ivars *ivar = NULL;
        +	const struct mmc_quirk *quirk;
         	device_t child;
         	int err, host_caps, i, newcard;
         	uint32_t resp, sec_count, status;
        @@ -1871,6 +1895,18 @@ mmc_discover_cards(struct mmc_softc *sc)
         		    ivar->raw_ext_csd[EXT_CSD_REV] >= 5);
         
         child_common:
        +		for (quirk = &mmc_quirks[0]; quirk->mid != 0x0; quirk++) {
        +			if ((quirk->mid == MMC_QUIRK_MID_ANY ||
        +			    quirk->mid == ivar->cid.mid) &&
        +			    (quirk->oid == MMC_QUIRK_OID_ANY ||
        +			    quirk->oid == ivar->cid.oid) &&
        +			    strncmp(quirk->pnm, ivar->cid.pnm,
        +			    sizeof(ivar->cid.pnm)) == 0) {
        +				ivar->quirks = quirk->quirks;
        +				break;
        +			}
        +		}
        +
         		/*
         		 * Some cards that report maximum I/O block sizes greater
         		 * than 512 require the block length to be set to 512, even
        @@ -2471,6 +2507,12 @@ mmc_read_ivar(device_t bus, device_t child, int which,
         		break;
         	case MMC_IVAR_MAX_DATA:
         		*result = mmcbr_get_max_data(bus);
        +		break;
        +	case MMC_IVAR_CMD6_TIMEOUT:
        +		*result = ivar->cmd6_time;
        +		break;
        +	case MMC_IVAR_QUIRKS:
        +		*result = ivar->quirks;
         		break;
         	case MMC_IVAR_CARD_ID_STRING:
         		*(char **)result = ivar->card_id_string;
        
        Modified: stable/10/sys/dev/mmc/mmcreg.h
        ==============================================================================
        --- stable/10/sys/dev/mmc/mmcreg.h	Fri Aug 11 00:41:19 2017	(r322388)
        +++ stable/10/sys/dev/mmc/mmcreg.h	Fri Aug 11 00:41:43 2017	(r322389)
        @@ -238,6 +238,13 @@ struct mmc_request {
         #define	MMC_ERASE_GROUP_END	36
         			/* 37 -- reserved old command */
         #define	MMC_ERASE		38
        +#define	 MMC_ERASE_ERASE	0x00000000
        +#define	 MMC_ERASE_TRIM		0x00000001
        +#define	 MMC_ERASE_FULE		0x00000002
        +#define	 MMC_ERASE_DISCARD	0x00000003
        +#define	 MMC_ERASE_SECURE_ERASE	0x80000000
        +#define	 MMC_ERASE_SECURE_TRIM1	0x80000001
        +#define	 MMC_ERASE_SECURE_TRIM2	0x80008000
         
         /* Class 9: I/O mode commands */
         #define	MMC_FAST_IO		39
        @@ -321,6 +328,7 @@ struct mmc_request {
         #define	EXT_CSD_ERASE_TO_MULT	223	/* RO */
         #define	EXT_CSD_ERASE_GRP_SIZE	224	/* RO */
         #define	EXT_CSD_BOOT_SIZE_MULT	226	/* RO */
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT 231	/* RO */
         #define	EXT_CSD_PWR_CL_200_195	236	/* RO */
         #define	EXT_CSD_PWR_CL_200_360	237	/* RO */
         #define	EXT_CSD_PWR_CL_52_195_DDR 238	/* RO */
        @@ -405,6 +413,22 @@ struct mmc_request {
         
         #define	EXT_CSD_STROBE_SUPPORT_EN	0x01
         
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_ER_EN	0x01
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_BD_BLK_EN	0x04
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_GB_CL_EN	0x10
        +#define	EXT_CSD_SEC_FEATURE_SUPPORT_SANITIZE	0x40
        +
        +/*
        + * Vendor specific EXT_CSD fields
        + */
        +/* SanDisk iNAND */
        +#define	EXT_CSD_INAND_CMD38			113
        +#define	 EXT_CSD_INAND_CMD38_ERASE		0x00
        +#define	 EXT_CSD_INAND_CMD38_TRIM		0x01
        +#define	 EXT_CSD_INAND_CMD38_SECURE_ERASE	0x80
        +#define	 EXT_CSD_INAND_CMD38_SECURE_TRIM1	0x81
        +#define	 EXT_CSD_INAND_CMD38_SECURE_TRIM2	0x82
        +
         #define	MMC_TYPE_HS_26_MAX		26000000
         #define	MMC_TYPE_HS_52_MAX		52000000
         #define	MMC_TYPE_DDR52_MAX		52000000
        @@ -498,8 +522,7 @@ struct mmc_cid {
         	uint8_t fwrev;
         };
         
        -struct mmc_csd
        -{
        +struct mmc_csd {
         	uint8_t csd_structure;
         	uint8_t spec_vers;
         	uint16_t ccc;
        @@ -525,16 +548,14 @@ struct mmc_csd
         	    wp_grp_enable:1;
         };
         
        -struct mmc_scr
        -{
        +struct mmc_scr {
         	unsigned char		sda_vsn;
         	unsigned char		bus_widths;
         #define	SD_SCR_BUS_WIDTH_1	(1 << 0)
         #define	SD_SCR_BUS_WIDTH_4	(1 << 2)
         };
         
        -struct mmc_sd_status
        -{
        +struct mmc_sd_status {
         	uint8_t			bus_width;
         	uint8_t			secured_mode;
         	uint16_t		card_type;
        @@ -546,6 +567,19 @@ struct mmc_sd_status
         	uint8_t			erase_timeout;
         	uint8_t			erase_offset;
         };
        +
        +struct mmc_quirk {
        +	uint32_t mid;
        +#define	MMC_QUIRK_MID_ANY	((uint32_t)-1)
        +	uint16_t oid;
        +#define	MMC_QUIRK_OID_ANY	((uint16_t)-1)
        +	const char *pnm;
        +	uint32_t quirks;
        +#define	MMC_QUIRK_INAND_CMD38	0x0001
        +#define	MMC_QUIRK_BROKEN_TRIM	0x0002
        +};
        +
        +#define	MMC_QUIRKS_FMT		"\020" "\001INAND_CMD38" "\002BROKEN_TRIM"
         
         /*
          * Various MMC/SD constants
        
        Modified: stable/10/sys/dev/mmc/mmcsd.c
        ==============================================================================
        --- stable/10/sys/dev/mmc/mmcsd.c	Fri Aug 11 00:41:19 2017	(r322388)
        +++ stable/10/sys/dev/mmc/mmcsd.c	Fri Aug 11 00:41:43 2017	(r322389)
        @@ -126,6 +126,10 @@ struct mmcsd_softc {
         	uint8_t part_curr;	/* Partition currently switched to */
         	uint8_t ext_csd[MMC_EXTCSD_SIZE];
         	uint16_t rca;
        +	uint32_t flags;
        +#define	MMCSD_INAND_CMD38	0x0001
        +#define	MMCSD_USE_TRIM		0x0002
        +	uint32_t cmd6_time;	/* Generic switch timeout [us] */
         	uint32_t part_time;	/* Partition switch timeout [us] */
         	off_t enh_base;		/* Enhanced user data area slice base ... */
         	off_t enh_size;		/* ... and size [bytes] */
        @@ -168,9 +172,10 @@ static int mmcsd_ioctl_rpmb(struct cdev *dev, u_long c
             int fflag, struct thread *td);
         
         static void mmcsd_add_part(struct mmcsd_softc *sc, u_int type,
        -    const char *name, u_int cnt, off_t media_size, off_t erase_size, bool ro);
        +    const char *name, u_int cnt, off_t media_size, bool ro);
         static int mmcsd_bus_bit_width(device_t dev);
         static daddr_t mmcsd_delete(struct mmcsd_part *part, struct bio *bp);
        +static const char *mmcsd_errmsg(int e);
         static int mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data,
             int fflag);
         static int mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic,
        @@ -221,6 +226,7 @@ mmcsd_attach(device_t dev)
         	off_t erase_size, sector_size, size, wp_size;
         	uintmax_t bytes;
         	int err, i;
        +	uint32_t quirks;
         	uint8_t rev;
         	bool comp, ro;
         	char unit[2];
        @@ -239,21 +245,48 @@ mmcsd_attach(device_t dev)
         	 * place either.
         	 */
         	sc->max_data = mmc_get_max_data(dev);
        -	sc->erase_sector = mmc_get_erase_sector(dev);
         	sc->high_cap = mmc_get_high_cap(dev);
         	sc->rca = mmc_get_rca(dev);
        +	sc->cmd6_time = mmc_get_cmd6_timeout(dev);
        +	quirks = mmc_get_quirks(dev);
         
         	/* Only MMC >= 4.x devices support EXT_CSD. */
         	if (mmc_get_spec_vers(dev) >= 4) {
         		MMCBUS_ACQUIRE_BUS(mmcbus, dev);
         		err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd);
         		MMCBUS_RELEASE_BUS(mmcbus, dev);
        -		if (err != MMC_ERR_NONE)
        -			bzero(sc->ext_csd, sizeof(sc->ext_csd));
        +		if (err != MMC_ERR_NONE) {
        +			device_printf(dev, "Error reading EXT_CSD %s\n",
        +			    mmcsd_errmsg(err));
        +			return (ENXIO);
        +		}
         	}
         	ext_csd = sc->ext_csd;
         
        +	if ((quirks & MMC_QUIRK_INAND_CMD38) != 0) {
        +		if (mmc_get_spec_vers(dev) < 4) {
        +			device_printf(dev,
        +			    "MMC_QUIRK_INAND_CMD38 set but no EXT_CSD\n");
        +			return (EINVAL);
        +		}
        +		sc->flags |= MMCSD_INAND_CMD38;
        +	}
        +
         	/*
        +	 * EXT_CSD_SEC_FEATURE_SUPPORT_GB_CL_EN denotes support for both
        +	 * insecure and secure TRIM.
        +	 */
        +	if ((ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT] &
        +	    EXT_CSD_SEC_FEATURE_SUPPORT_GB_CL_EN) != 0 &&
        +	    (quirks & MMC_QUIRK_BROKEN_TRIM) == 0) {
        +		if (bootverbose)
        +			device_printf(dev, "taking advantage of TRIM\n");
        +		sc->flags |= MMCSD_USE_TRIM;
        +		sc->erase_sector = 1;
        +	} else
        +		sc->erase_sector = mmc_get_erase_sector(dev);
        +
        +	/*
         	 * Enhanced user data area and general purpose partitions are only
         	 * supported in revision 1.4 (EXT_CSD_REV == 4) and later, the RPMB
         	 * partition in revision 1.5 (MMC v4.41, EXT_CSD_REV == 5) and later.
        @@ -306,8 +339,7 @@ mmcsd_attach(device_t dev)
         	 */
         	ro = mmc_get_read_only(dev);
         	mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_DEFAULT, "mmcsd",
        -	    device_get_unit(dev), mmc_get_media_size(dev) * sector_size,
        -	    sc->erase_sector * sector_size, ro);
        +	    device_get_unit(dev), mmc_get_media_size(dev) * sector_size, ro);
         
         	if (mmc_get_spec_vers(dev) < 3)
         		return (0);
        @@ -332,11 +364,11 @@ mmcsd_attach(device_t dev)
         	size = ext_csd[EXT_CSD_BOOT_SIZE_MULT] * MMC_BOOT_RPMB_BLOCK_SIZE;
         	if (size > 0 && (mmcbr_get_caps(mmcbus) & MMC_CAP_BOOT_NOACC) == 0) {
         		mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_BOOT0,
        -		    MMCSD_FMT_BOOT, 0, size, MMC_BOOT_RPMB_BLOCK_SIZE,
        +		    MMCSD_FMT_BOOT, 0, size,
         		    ro | ((ext_csd[EXT_CSD_BOOT_WP_STATUS] &
         		    EXT_CSD_BOOT_WP_STATUS_BOOT0_MASK) != 0));
         		mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_BOOT1,
        -		    MMCSD_FMT_BOOT, 1, size, MMC_BOOT_RPMB_BLOCK_SIZE,
        +		    MMCSD_FMT_BOOT, 1, size,
         		    ro | ((ext_csd[EXT_CSD_BOOT_WP_STATUS] &
         		    EXT_CSD_BOOT_WP_STATUS_BOOT1_MASK) != 0));
         	}
        @@ -345,7 +377,7 @@ mmcsd_attach(device_t dev)
         	size = ext_csd[EXT_CSD_RPMB_MULT] * MMC_BOOT_RPMB_BLOCK_SIZE;
         	if (rev >= 5 && size > 0)
         		mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_RPMB,
        -		    MMCSD_FMT_RPMB, 0, size, MMC_BOOT_RPMB_BLOCK_SIZE, ro);
        +		    MMCSD_FMT_RPMB, 0, size, ro);
         
         	if (rev <= 3 || comp == FALSE)
         		return (0);
        @@ -365,8 +397,7 @@ mmcsd_attach(device_t dev)
         			if (size == 0)
         				continue;
         			mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_GP0 + i,
        -			    MMCSD_FMT_GP, i, size * erase_size * wp_size,
        -			    erase_size, ro);
        +			    MMCSD_FMT_GP, i, size * erase_size * wp_size, ro);
         		}
         	}
         	return (0);
        @@ -419,7 +450,7 @@ static struct cdevsw mmcsd_rpmb_cdevsw = {
         
         static void
         mmcsd_add_part(struct mmcsd_softc *sc, u_int type, const char *name, u_int cnt,
        -    off_t media_size, off_t erase_size, bool ro)
        +    off_t media_size, bool ro)
         {
         	struct make_dev_args args;
         	device_t dev, mmcbus;
        @@ -482,10 +513,10 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con
         		d->d_sectorsize = mmc_get_sector_size(dev);
         		d->d_maxsize = sc->max_data * d->d_sectorsize;
         		d->d_mediasize = media_size;
        -		d->d_stripesize = erase_size;
        +		d->d_stripesize = sc->erase_sector * d->d_sectorsize;
         		d->d_unit = cnt;
         		d->d_flags = DISKFLAG_CANDELETE;
        -		d->d_delmaxsize = erase_size;
        +		d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize;
         		strlcpy(d->d_ident, mmc_get_card_sn_string(dev),
         		    sizeof(d->d_ident));
         		strlcpy(d->d_descr, mmc_get_card_id_string(dev),
        @@ -1151,6 +1182,8 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	struct mmcsd_softc *sc;
         	device_t dev, mmcbus;
         	u_int erase_sector, sz;
        +	int err;
        +	bool use_trim;
         
         	sc = part->sc;
         	dev = sc->dev;
        @@ -1159,24 +1192,46 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	block = bp->bio_pblkno;
         	sz = part->disk->d_sectorsize;
         	end = bp->bio_pblkno + (bp->bio_bcount / sz);
        -	/* Coalesce with part remaining from previous request. */
        -	if (block > part->eblock && block <= part->eend)
        -		block = part->eblock;
        -	if (end >= part->eblock && end < part->eend)
        -		end = part->eend;
        -	/* Safe round to the erase sector boundaries. */
        -	erase_sector = sc->erase_sector;
        -	start = block + erase_sector - 1;	 /* Round up. */
        -	start -= start % erase_sector;
        -	stop = end;				/* Round down. */
        -	stop -= end % erase_sector;
        -	/* We can't erase an area smaller than a sector, store it for later. */
        -	if (start >= stop) {
        -		part->eblock = block;
        -		part->eend = end;
        -		return (end);
        +	use_trim = sc->flags & MMCSD_USE_TRIM;
        +	if (use_trim == true) {
        +		start = block;
        +		stop = end;
        +	} else {
        +		/* Coalesce with the remainder of the previous request. */
        +		if (block > part->eblock && block <= part->eend)
        +			block = part->eblock;
        +		if (end >= part->eblock && end < part->eend)
        +			end = part->eend;
        +		/* Safely round to the erase sector boundaries. */
        +		erase_sector = sc->erase_sector;
        +		start = block + erase_sector - 1;	 /* Round up. */
        +		start -= start % erase_sector;
        +		stop = end;				/* Round down. */
        +		stop -= end % erase_sector;
        +		/*
        +		 * We can't erase an area smaller than an erase sector, so
        +		 * store it for later.
        +		 */
        +		if (start >= stop) {
        +			part->eblock = block;
        +			part->eend = end;
        +			return (end);
        +		}
         	}
         
        +	if ((sc->flags & MMCSD_INAND_CMD38) != 0) {
        +		err = mmc_switch(mmcbus, dev, sc->rca, EXT_CSD_CMD_SET_NORMAL,
        +		    EXT_CSD_INAND_CMD38, use_trim == true ?
        +		    EXT_CSD_INAND_CMD38_TRIM : EXT_CSD_INAND_CMD38_ERASE,
        +		    sc->cmd6_time, true);
        +		if (err != MMC_ERR_NONE) {
        +			device_printf(dev,
        +			    "Setting iNAND erase command failed %s\n",
        +			    mmcsd_errmsg(err));
        +			return (block);
        +		}
        +	}
        +
         	/*
         	 * Pause re-tuning so it won't interfere with the order of erase
         	 * commands.  Note that these latter don't use the data lines, so
        @@ -1198,8 +1253,8 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
         	MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req);
         	if (req.cmd->error != MMC_ERR_NONE) {
        -		device_printf(dev, "Setting erase start position failed %d\n",
        -		    req.cmd->error);
        +		device_printf(dev, "Setting erase start position failed %s\n",
        +		    mmcsd_errmsg(req.cmd->error));
         		block = bp->bio_pblkno;
         		goto unpause;
         	}
        @@ -1218,8 +1273,8 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
         	MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req);
         	if (req.cmd->error != MMC_ERR_NONE) {
        -		device_printf(dev, "Setting erase stop position failed %d\n",
        -		    req.cmd->error);
        +		device_printf(dev, "Setting erase stop position failed %s\n",
        +		    mmcsd_errmsg(req.cmd->error));
         		block = bp->bio_pblkno;
         		goto unpause;
         	}
        @@ -1228,23 +1283,24 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
         	memset(&cmd, 0, sizeof(cmd));
         	req.cmd = &cmd;
         	cmd.opcode = MMC_ERASE;
        -	cmd.arg = 0;
        +	cmd.arg = use_trim == true ? MMC_ERASE_TRIM : MMC_ERASE_ERASE;
         	cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
         	MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req);
         	if (req.cmd->error != MMC_ERR_NONE) {
        -		device_printf(dev, "erase err3: %d\n", req.cmd->error);
        -		device_printf(dev, "Issuing erase command failed %d\n",
        -		    req.cmd->error);
        +		device_printf(dev, "Issuing erase command failed %s\n",
        +		    mmcsd_errmsg(req.cmd->error));
         		block = bp->bio_pblkno;
         		goto unpause;
         	}
        -	/* Store one of remaining parts for the next call. */
        -	if (bp->bio_pblkno >= part->eblock || block == start) {
        -		part->eblock = stop;	/* Predict next forward. */
        -		part->eend = end;
        -	} else {
        -		part->eblock = block;	/* Predict next backward. */
        -		part->eend = start;
        +	if (use_trim == false) {
        +		/* Store one of the remaining parts for the next call. */
        +		if (bp->bio_pblkno >= part->eblock || block == start) {
        +			part->eblock = stop;	/* Predict next forward. */
        +			part->eend = end;
        +		} else {
        +			part->eblock = block;	/* Predict next backward. */
        +			part->eend = start;
        +		}
         	}
         	block = end;
         unpause:
        
        Modified: stable/10/sys/dev/mmc/mmcvar.h
        ==============================================================================
        --- stable/10/sys/dev/mmc/mmcvar.h	Fri Aug 11 00:41:19 2017	(r322388)
        +++ stable/10/sys/dev/mmc/mmcvar.h	Fri Aug 11 00:41:43 2017	(r322389)
        @@ -68,6 +68,8 @@ enum mmc_device_ivars {
             MMC_IVAR_BUS_WIDTH,
             MMC_IVAR_ERASE_SECTOR,
             MMC_IVAR_MAX_DATA,
        +    MMC_IVAR_CMD6_TIMEOUT,
        +    MMC_IVAR_QUIRKS,
             MMC_IVAR_CARD_ID_STRING,
             MMC_IVAR_CARD_SN_STRING,
         };
        @@ -90,6 +92,8 @@ MMC_ACCESSOR(card_type, CARD_TYPE, int)
         MMC_ACCESSOR(bus_width, BUS_WIDTH, int)
         MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int)
         MMC_ACCESSOR(max_data, MAX_DATA, int)
        +MMC_ACCESSOR(cmd6_timeout, CMD6_TIMEOUT, u_int)
        +MMC_ACCESSOR(quirks, QUIRKS, u_int)
         MMC_ACCESSOR(card_id_string, CARD_ID_STRING, const char *)
         MMC_ACCESSOR(card_sn_string, CARD_SN_STRING, const char *)
         
        
        From owner-svn-src-stable@freebsd.org  Fri Aug 11 07:27:56 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB9B9DC836E;
         Fri, 11 Aug 2017 07:27:56 +0000 (UTC)
         (envelope-from avos@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 771A864648;
         Fri, 11 Aug 2017 07:27:56 +0000 (UTC)
         (envelope-from avos@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7B7RtAX049464;
         Fri, 11 Aug 2017 07:27:55 GMT (envelope-from avos@FreeBSD.org)
        Received: (from avos@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7B7Rt4O049463;
         Fri, 11 Aug 2017 07:27:55 GMT (envelope-from avos@FreeBSD.org)
        Message-Id: <201708110727.v7B7Rt4O049463@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: avos set sender to
         avos@FreeBSD.org using -f
        From: Andriy Voskoboinyk 
        Date: Fri, 11 Aug 2017 07:27:55 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322393 - stable/11/usr.sbin/bluetooth/rfcomm_pppd
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: avos
        X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/rfcomm_pppd
        X-SVN-Commit-Revision: 322393
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Fri, 11 Aug 2017 07:27:56 -0000
        
        Author: avos
        Date: Fri Aug 11 07:27:55 2017
        New Revision: 322393
        URL: https://svnweb.freebsd.org/changeset/base/322393
        
        Log:
          MFC r322124:
          rfcomm_pppd.8: fix a typo (SPD -> SDP).
        
        Modified:
          stable/11/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8
        ==============================================================================
        --- stable/11/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8	Fri Aug 11 03:59:48 2017	(r322392)
        +++ stable/11/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8	Fri Aug 11 07:27:55 2017	(r322393)
        @@ -348,7 +348,7 @@ label.
         The
         .Nm
         utility in server mode will try to register the Bluetooth LAN Access Over PPP
        -service with the local SPD daemon.
        +service with the local SDP daemon.
         If the local SDP daemon is not running,
         .Nm
         will exit with an error.
        
        From owner-svn-src-stable@freebsd.org  Fri Aug 11 07:29:52 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E245DC848C;
         Fri, 11 Aug 2017 07:29:52 +0000 (UTC) (envelope-from ed@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 CB929647A3;
         Fri, 11 Aug 2017 07:29:51 +0000 (UTC) (envelope-from ed@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7B7ToTl049572;
         Fri, 11 Aug 2017 07:29:50 GMT (envelope-from ed@FreeBSD.org)
        Received: (from ed@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7B7ToBI049571;
         Fri, 11 Aug 2017 07:29:50 GMT (envelope-from ed@FreeBSD.org)
        Message-Id: <201708110729.v7B7ToBI049571@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
         using -f
        From: Ed Schouten 
        Date: Fri, 11 Aug 2017 07:29:50 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322394 - stable/11/sys/amd64/cloudabi64
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: ed
        X-SVN-Commit-Paths: stable/11/sys/amd64/cloudabi64
        X-SVN-Commit-Revision: 322394
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Fri, 11 Aug 2017 07:29:52 -0000
        
        Author: ed
        Date: Fri Aug 11 07:29:50 2017
        New Revision: 322394
        URL: https://svnweb.freebsd.org/changeset/base/322394
        
        Log:
          MFC r321924:
          
            Keep top page on CloudABI to work around AMD Ryzen stability issues.
          
            Similar to r321899, reduce sv_maxuser by one page inside of CloudABI.
            This ensures that the stack, the vDSO and any allocations cannot touch
            the top page of user virtual memory.
          
            Considering that CloudABI userspace is completely oblivious to virtual
            memory layout, don't bother making this conditional based on the CPU of
            the running system.
        
        Modified:
          stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c
        ==============================================================================
        --- stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Fri Aug 11 07:27:55 2017	(r322393)
        +++ stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Fri Aug 11 07:29:50 2017	(r322394)
        @@ -199,7 +199,8 @@ static struct sysentvec cloudabi64_elf_sysvec = {
         	.sv_coredump		= elf64_coredump,
         	.sv_pagesize		= PAGE_SIZE,
         	.sv_minuser		= VM_MIN_ADDRESS,
        -	.sv_maxuser		= VM_MAXUSER_ADDRESS,
        +	/* Keep top page reserved to work around AMD Ryzen stability issues. */
        +	.sv_maxuser		= VM_MAXUSER_ADDRESS - PAGE_SIZE,
         	.sv_stackprot		= VM_PROT_READ | VM_PROT_WRITE,
         	.sv_copyout_strings	= cloudabi64_copyout_strings,
         	.sv_setregs		= cloudabi64_proc_setregs,
        
        From owner-svn-src-stable@freebsd.org  Fri Aug 11 10:05:43 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01B60DC2918;
         Fri, 11 Aug 2017 10:05:43 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 C35B06AADC;
         Fri, 11 Aug 2017 10:05:42 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7BA5fS1015492;
         Fri, 11 Aug 2017 10:05:41 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7BA5f05015491;
         Fri, 11 Aug 2017 10:05:41 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708111005.v7BA5f05015491@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Fri, 11 Aug 2017 10:05:41 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322395 - stable/11/sys/sys
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: stable/11/sys/sys
        X-SVN-Commit-Revision: 322395
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Fri, 11 Aug 2017 10:05:43 -0000
        
        Author: kib
        Date: Fri Aug 11 10:05:41 2017
        New Revision: 322395
        URL: https://svnweb.freebsd.org/changeset/base/322395
        
        Log:
          MFC r322050:
          Relax visibility for some termios symbols.
        
        Modified:
          stable/11/sys/sys/_termios.h
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/sys/_termios.h
        ==============================================================================
        --- stable/11/sys/sys/_termios.h	Fri Aug 11 07:29:50 2017	(r322394)
        +++ stable/11/sys/sys/_termios.h	Fri Aug 11 10:05:41 2017	(r322395)
        @@ -91,8 +91,10 @@
         #define	ICRNL		0x00000100	/* map CR to NL (ala CRMOD) */
         #define	IXON		0x00000200	/* enable output flow control */
         #define	IXOFF		0x00000400	/* enable input flow control */
        -#if __BSD_VISIBLE
        +#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
         #define	IXANY		0x00000800	/* any char will restart after stop */
        +#endif
        +#if __BSD_VISIBLE
         #define	IMAXBEL		0x00002000	/* ring bell on input queue full */
         #endif
         
        @@ -100,12 +102,16 @@
          * Output flags - software output processing
          */
         #define	OPOST		0x00000001	/* enable following output processing */
        -#if __BSD_VISIBLE
        +#if __XSI_VISIBLE
         #define	ONLCR		0x00000002	/* map NL to CR-NL (ala CRMOD) */
        +#endif
        +#if __BSD_VISIBLE
         #define	TABDLY		0x00000004	/* tab delay mask */
         #define	    TAB0	    0x00000000	    /* no tab delay and expansion */
         #define	    TAB3	    0x00000004	    /* expand tabs to spaces */
         #define	ONOEOT		0x00000008	/* discard EOT's (^D) on output) */
        +#endif
        +#if __XSI_VISIBLE
         #define	OCRNL		0x00000010	/* map CR to NL on output */
         #define	ONOCR		0x00000020	/* no CR output at column 0 */
         #define	ONLRET		0x00000040	/* NL performs CR function */
        
        From owner-svn-src-stable@freebsd.org  Fri Aug 11 10:08:19 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4A5CDC2B90;
         Fri, 11 Aug 2017 10:08:19 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 B39DB6ACAE;
         Fri, 11 Aug 2017 10:08:19 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7BA8IdH015632;
         Fri, 11 Aug 2017 10:08:18 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7BA8Inx015631;
         Fri, 11 Aug 2017 10:08:18 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708111008.v7BA8Inx015631@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Fri, 11 Aug 2017 10:08:18 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322396 - stable/11/usr.sbin/pmcstat
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: stable/11/usr.sbin/pmcstat
        X-SVN-Commit-Revision: 322396
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Fri, 11 Aug 2017 10:08:20 -0000
        
        Author: kib
        Date: Fri Aug 11 10:08:18 2017
        New Revision: 322396
        URL: https://svnweb.freebsd.org/changeset/base/322396
        
        Log:
          MFC r322059:
          Fix off by one in calculation of the number of buckets for the pc
          addresses.
        
        Modified:
          stable/11/usr.sbin/pmcstat/pmcpl_gprof.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/usr.sbin/pmcstat/pmcpl_gprof.c
        ==============================================================================
        --- stable/11/usr.sbin/pmcstat/pmcpl_gprof.c	Fri Aug 11 10:05:41 2017	(r322395)
        +++ stable/11/usr.sbin/pmcstat/pmcpl_gprof.c	Fri Aug 11 10:08:18 2017	(r322396)
        @@ -468,8 +468,8 @@ pmcpl_gmon_process(struct pmcstat_process *pp, struct 
         		    image, pmcid);
         		pgf->pgf_pmcid = pmcid;
         		assert(image->pi_end > image->pi_start);
        -		pgf->pgf_nbuckets = (image->pi_end - image->pi_start) /
        -		    FUNCTION_ALIGNMENT;	/* see  */
        +		pgf->pgf_nbuckets = howmany(image->pi_end - image->pi_start,
        +		    FUNCTION_ALIGNMENT);	/* see  */
         		pgf->pgf_ndatabytes = sizeof(struct gmonhdr) +
         		    pgf->pgf_nbuckets * hc_sz;
         		pgf->pgf_nsamples = 0;
        
        From owner-svn-src-stable@freebsd.org  Fri Aug 11 11:38:05 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id F06A1DC8288;
         Fri, 11 Aug 2017 11:38:05 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 BDB976E243;
         Fri, 11 Aug 2017 11:38:05 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7BBc474052867;
         Fri, 11 Aug 2017 11:38:04 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7BBc4lw052866;
         Fri, 11 Aug 2017 11:38:04 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708111138.v7BBc4lw052866@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Fri, 11 Aug 2017 11:38:04 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
        Subject: svn commit: r322399 - stable/10/usr.sbin/pmcstat
        X-SVN-Group: stable-10
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: stable/10/usr.sbin/pmcstat
        X-SVN-Commit-Revision: 322399
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Fri, 11 Aug 2017 11:38:06 -0000
        
        Author: kib
        Date: Fri Aug 11 11:38:04 2017
        New Revision: 322399
        URL: https://svnweb.freebsd.org/changeset/base/322399
        
        Log:
          MFC r322059:
          Fix off by one in calculation of the number of buckets for the pc
          addresses.
          
          Approved by:	re (marius)
        
        Modified:
          stable/10/usr.sbin/pmcstat/pmcpl_gprof.c
        Directory Properties:
          stable/10/   (props changed)
        
        Modified: stable/10/usr.sbin/pmcstat/pmcpl_gprof.c
        ==============================================================================
        --- stable/10/usr.sbin/pmcstat/pmcpl_gprof.c	Fri Aug 11 10:59:34 2017	(r322398)
        +++ stable/10/usr.sbin/pmcstat/pmcpl_gprof.c	Fri Aug 11 11:38:04 2017	(r322399)
        @@ -464,8 +464,8 @@ pmcpl_gmon_process(struct pmcstat_process *pp, struct 
         		    image, pmcid);
         		pgf->pgf_pmcid = pmcid;
         		assert(image->pi_end > image->pi_start);
        -		pgf->pgf_nbuckets = (image->pi_end - image->pi_start) /
        -		    FUNCTION_ALIGNMENT;	/* see  */
        +		pgf->pgf_nbuckets = howmany(image->pi_end - image->pi_start,
        +		    FUNCTION_ALIGNMENT);	/* see  */
         		pgf->pgf_ndatabytes = sizeof(struct gmonhdr) +
         		    pgf->pgf_nbuckets * hc_sz;
         		pgf->pgf_nsamples = 0;
        
        From owner-svn-src-stable@freebsd.org  Sat Aug 12 08:51:20 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56B64DC7242;
         Sat, 12 Aug 2017 08:51:20 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 238EF7DBDD;
         Sat, 12 Aug 2017 08:51:20 +0000 (UTC) (envelope-from kib@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7C8pJrs074221;
         Sat, 12 Aug 2017 08:51:19 GMT (envelope-from kib@FreeBSD.org)
        Received: (from kib@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7C8pJ0m074220;
         Sat, 12 Aug 2017 08:51:19 GMT (envelope-from kib@FreeBSD.org)
        Message-Id: <201708120851.v7C8pJ0m074220@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
         using -f
        From: Konstantin Belousov 
        Date: Sat, 12 Aug 2017 08:51:19 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322422 - stable/11/share/man/man3
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: kib
        X-SVN-Commit-Paths: stable/11/share/man/man3
        X-SVN-Commit-Revision: 322422
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Sat, 12 Aug 2017 08:51:20 -0000
        
        Author: kib
        Date: Sat Aug 12 08:51:19 2017
        New Revision: 322422
        URL: https://svnweb.freebsd.org/changeset/base/322422
        
        Log:
          MFC r322077:
          Provide more detailed specification for major(), minor() and makedev().
        
        Modified:
          stable/11/share/man/man3/makedev.3
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/share/man/man3/makedev.3
        ==============================================================================
        --- stable/11/share/man/man3/makedev.3	Fri Aug 11 23:12:28 2017	(r322421)
        +++ stable/11/share/man/man3/makedev.3	Sat Aug 12 08:51:19 2017	(r322422)
        @@ -24,7 +24,7 @@
         .\"
         .\" $FreeBSD$
         .\"
        -.Dd September 28, 2008
        +.Dd August 3, 2017
         .Dt MAKEDEV 3
         .Os
         .Sh NAME
        @@ -43,7 +43,7 @@
         .Sh DESCRIPTION
         The
         .Fn makedev
        -macro allows a unique device number to be generated based on its
        +macro returns a device number created from the provided
         .Fa major
         and
         .Fa minor
        @@ -52,13 +52,26 @@ The
         .Fn major
         and
         .Fn minor
        -macros can be used to obtain the original numbers from the device number
        +macros return the original numbers from the device number
         .Fa dev .
        +In other words, for a value
        +.Va dev
        +of the type
        +.Vt dev_t ,
        +and values
        +.Va ma , mi
        +of the type
        +.Vt int ,
        +the assertions
        +.Dl dev == makedev(major(dev), minor(dev))
        +.Dl ma == major(makedev(ma, mi))
        +.Dl mi == minor(makedev(ma, mi))
        +are valid.
         .Pp
         In previous implementations of
         .Fx
         all block and character devices were uniquely identified by a pair of
        -major and minor numbers.
        +stable major and minor numbers.
         The major number referred to a certain device class (e.g. disks, TTYs)
         while the minor number identified an instance within the device class.
         Later versions of
        @@ -66,7 +79,8 @@ Later versions of
         automatically generate a unique device number for each character device
         visible in
         .Pa /dev/ .
        -These numbers are not divided in device classes.
        +These numbers are not divided in device classes and are not guaranteed
        +to be stable upon reboot or driver reload.
         .Pp
         On
         .Fx
        @@ -78,11 +92,9 @@ conventional way.
         .Sh RETURN VALUES
         The
         .Fn major
        -macro returns a device major number that has a value between 0 and 255.
        -The
        +and
         .Fn minor
        -macro returns a device minor number whose value can span the complete
        -range of an
        +macros return numbers whose value can span the complete range of an
         .Vt int .
         .Sh SEE ALSO
         .Xr mknod 2 ,
        
        From owner-svn-src-stable@freebsd.org  Sat Aug 12 10:22:19 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A28DCC05E;
         Sat, 12 Aug 2017 10:22:19 +0000 (UTC) (envelope-from mav@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 9F97580459;
         Sat, 12 Aug 2017 10:22:19 +0000 (UTC) (envelope-from mav@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7CAMIDN014908;
         Sat, 12 Aug 2017 10:22:18 GMT (envelope-from mav@FreeBSD.org)
        Received: (from mav@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7CAMIqj014907;
         Sat, 12 Aug 2017 10:22:18 GMT (envelope-from mav@FreeBSD.org)
        Message-Id: <201708121022.v7CAMIqj014907@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
         using -f
        From: Alexander Motin 
        Date: Sat, 12 Aug 2017 10:22:18 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322423 - stable/11/sys/cam/ctl
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: mav
        X-SVN-Commit-Paths: stable/11/sys/cam/ctl
        X-SVN-Commit-Revision: 322423
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Sat, 12 Aug 2017 10:22:20 -0000
        
        Author: mav
        Date: Sat Aug 12 10:22:18 2017
        New Revision: 322423
        URL: https://svnweb.freebsd.org/changeset/base/322423
        
        Log:
          MFC r322302: Do not loose CCB flags after r320493.
          
          There is at least CAM_UNLOCKED that should be kept.
        
        Modified:
          stable/11/sys/cam/ctl/scsi_ctl.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/sys/cam/ctl/scsi_ctl.c
        ==============================================================================
        --- stable/11/sys/cam/ctl/scsi_ctl.c	Sat Aug 12 08:51:19 2017	(r322422)
        +++ stable/11/sys/cam/ctl/scsi_ctl.c	Sat Aug 12 10:22:18 2017	(r322423)
        @@ -1009,7 +1009,8 @@ ctlfe_requeue_ccb(struct cam_periph *periph, union ccb
         	 * target/lun.  Reset the target and LUN fields back to the wildcard
         	 * values before we send them back down to the SIM.
         	 */
        -	xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NONE);
        +	xpt_setup_ccb_flags(&ccb->ccb_h, periph->path, CAM_PRIORITY_NONE,
        +	    ccb->ccb_h.flags);
         
         	xpt_action(ccb);
         }
        
        From owner-svn-src-stable@freebsd.org  Sat Aug 12 17:50:23 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C26DB7464;
         Sat, 12 Aug 2017 17:50:23 +0000 (UTC) (envelope-from dim@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 5E6926A9AF;
         Sat, 12 Aug 2017 17:50:23 +0000 (UTC) (envelope-from dim@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7CHoMH1096758;
         Sat, 12 Aug 2017 17:50:22 GMT (envelope-from dim@FreeBSD.org)
        Received: (from dim@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7CHoMeG096756;
         Sat, 12 Aug 2017 17:50:22 GMT (envelope-from dim@FreeBSD.org)
        Message-Id: <201708121750.v7CHoMeG096756@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
         using -f
        From: Dimitry Andric 
        Date: Sat, 12 Aug 2017 17:50:22 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322433 - stable/11
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: dim
        X-SVN-Commit-Paths: stable/11
        X-SVN-Commit-Revision: 322433
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Sat, 12 Aug 2017 17:50:23 -0000
        
        Author: dim
        Date: Sat Aug 12 17:50:22 2017
        New Revision: 322433
        URL: https://svnweb.freebsd.org/changeset/base/322433
        
        Log:
          MFC r321684:
          
          Don't use libc++ when cross-building for gcc arches
          
          Since we imported clang 5.0.0, the version check in Makefile.inc1 which
          checks whether to use libc++ fires even when the compiler for the target
          architecture is gcc 4.2.1.  This is because only X_COMPILER_VERSION is
          checked.  Also check X_COMPILER_TYPE, so it will only use libc++ when an
          external gcc toolchain is used.
          
          Reviewed by:	emaste, rpokala
          Differential Revision: https://reviews.freebsd.org/D11776
          
          MFC r322170:
          
          Follow-up to r321684 (Don't use libc++ when cross-building for gcc
          arches), and handle two more cases where libc++ includes could be
          incorrectly enabled, in case the host compiler is clang 5.0.0, and the
          target (cross) compiler is gcc 4.2.1.
          
          Noted by:	bdrewery
        
        Modified:
          stable/11/Makefile.inc1
          stable/11/Makefile.libcompat
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/Makefile.inc1
        ==============================================================================
        --- stable/11/Makefile.inc1	Sat Aug 12 17:46:50 2017	(r322432)
        +++ stable/11/Makefile.inc1	Sat Aug 12 17:50:22 2017	(r322433)
        @@ -589,8 +589,7 @@ TARGET_ABI=	gnueabi
         # is added before the port PREFIX library path.
         XCFLAGS+=	-isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
         # Force using libc++ for external GCC.
        -# XXX: This should be checking MK_GNUCXX == no
        -.if ${X_COMPILER_VERSION} >= 40800
        +.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800
         XCXXFLAGS+=	-isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \
         		-nostdinc++ -L${WORLDTMP}/../lib/libc++
         .endif
        @@ -2537,8 +2536,7 @@ CD2CFLAGS+=	-isystem ${XDDESTDIR}/usr/include -L${XDDE
         # combined with --sysroot.
         CD2CFLAGS+=	-B${XDDESTDIR}/usr/lib
         # Force using libc++ for external GCC.
        -# XXX: This should be checking MK_GNUCXX == no
        -.if ${X_COMPILER_VERSION} >= 40800
        +.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800
         CD2CXXFLAGS+=	-isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \
         		-nostdinc++
         .endif
        
        Modified: stable/11/Makefile.libcompat
        ==============================================================================
        --- stable/11/Makefile.libcompat	Sat Aug 12 17:46:50 2017	(r322432)
        +++ stable/11/Makefile.libcompat	Sat Aug 12 17:50:22 2017	(r322433)
        @@ -82,8 +82,7 @@ LIBCOMPATCFLAGS+=	-B${LIBCOMPATTMP}/usr/lib${libcompat
         # sysroot path which --sysroot does not actually do for headers.
         LIBCOMPATCFLAGS+=	-isystem ${LIBCOMPATTMP}/usr/include
         # Force using libc++ for external GCC.
        -# XXX: This should be checking MK_GNUCXX == no
        -.if ${X_COMPILER_VERSION} >= 40800 && \
        +.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 && \
             (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no")
         LIBCOMPATCXXFLAGS+=	-isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \
         			-nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++
        
        From owner-svn-src-stable@freebsd.org  Sat Aug 12 22:12:12 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F6BDCC0EA;
         Sat, 12 Aug 2017 22:12:12 +0000 (UTC)
         (envelope-from peter@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 4126A73699;
         Sat, 12 Aug 2017 22:12:12 +0000 (UTC)
         (envelope-from peter@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7CMCBNY009710;
         Sat, 12 Aug 2017 22:12:11 GMT (envelope-from peter@FreeBSD.org)
        Received: (from peter@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7CMC9bA009694;
         Sat, 12 Aug 2017 22:12:09 GMT (envelope-from peter@FreeBSD.org)
        Message-Id: <201708122212.v7CMC9bA009694@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: peter set sender to
         peter@FreeBSD.org using -f
        From: Peter Wemm 
        Date: Sat, 12 Aug 2017 22:12:09 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322442 - in stable/11/contrib/subversion: .
         subversion/include subversion/libsvn_client subversion/libsvn_fs_fs
         subversion/libsvn_fs_x subversion/libsvn_ra_svn subversion/libsvn_repos ...
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: peter
        X-SVN-Commit-Paths: in stable/11/contrib/subversion: . subversion/include
         subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x
         subversion/libsvn_ra_svn subversion/libsvn_repos subversion/libsvn_subr su...
        X-SVN-Commit-Revision: 322442
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Sat, 12 Aug 2017 22:12:12 -0000
        
        Author: peter
        Date: Sat Aug 12 22:12:09 2017
        New Revision: 322442
        URL: https://svnweb.freebsd.org/changeset/base/322442
        
        Log:
          MFC: r322380 Update subversion 1.9.5 -> 1.9.7
        
        Modified:
          stable/11/contrib/subversion/CHANGES
          stable/11/contrib/subversion/NOTICE
          stable/11/contrib/subversion/build-outputs.mk
          stable/11/contrib/subversion/configure
          stable/11/contrib/subversion/subversion/include/svn_version.h
          stable/11/contrib/subversion/subversion/libsvn_client/copy.c
          stable/11/contrib/subversion/subversion/libsvn_client/merge.c
          stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c
          stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h
          stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h
          stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c
          stable/11/contrib/subversion/subversion/libsvn_fs_fs/transaction.c
          stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h
          stable/11/contrib/subversion/subversion/libsvn_ra_svn/client.c
          stable/11/contrib/subversion/subversion/libsvn_repos/dump.c
          stable/11/contrib/subversion/subversion/libsvn_subr/config_file.c
          stable/11/contrib/subversion/subversion/libsvn_subr/internal_statements.h
          stable/11/contrib/subversion/subversion/libsvn_subr/io.c
          stable/11/contrib/subversion/subversion/libsvn_subr/version.c
          stable/11/contrib/subversion/subversion/libsvn_wc/wc-checks.h
          stable/11/contrib/subversion/subversion/libsvn_wc/wc-metadata.h
          stable/11/contrib/subversion/subversion/libsvn_wc/wc-queries.h
          stable/11/contrib/subversion/subversion/svnadmin/svnadmin.c
          stable/11/contrib/subversion/win-tests.py
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/contrib/subversion/CHANGES
        ==============================================================================
        --- stable/11/contrib/subversion/CHANGES	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/CHANGES	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -1,3 +1,63 @@
        +Version 1.9.7
        +(10 Aug 2017, from /branches/1.9.x)
        +http://svn.apache.org/repos/asf/subversion/tags/1.9.7
        +
        + User-visible changes:
        +  - Client-side bugfixes:
        +    * Fix arbitrary code execution vulnerability CVE-2017-9800
        +        See 
        +        for details.
        +
        +  - Server-side bugfixes:
        +    (none)
        +
        +  - Bindings bugfixes:
        +    (none)
        +
        + Developer-visible changes:
        +  - General:
        +    (none)
        +
        +  - API changes:
        +    (none)
        +
        +
        +Version 1.9.6
        +(5 Jul 2017, from /branches/1.9.x)
        +http://svn.apache.org/repos/asf/subversion/tags/1.9.6
        +
        + User-visible changes:
        +  - Client-side bugfixes:
        +    * cp/mv: improve error message when target is an unversioned dir (r1779948)
        +    * merge: reduce memory usage with large amounts of mergeinfo (issue #4667)
        +
        +  - Server-side bugfixes:
        +    * 'svnadmin freeze': document the purpose more clearly (r1774109)
        +    * dump: fix segfault when a revision has no revprops (r1781507)
        +    * fsfs: improve error message upon failure to open rep-cache (r1781655)
        +    * fsfs: never attempt to share directory representations (r1785053)
        +    * fsfs: make consistency independent of hash algorithms (r1785737 et al)
        +	This change makes Subversion resilient to collision attacks, including
        +	SHA-1 collision attacks such as .  See also our
        +	documentation at  and
        +	.
        +
        +  - Client-side and server-side bugfixes:
        +    * work around an APR bug related to file truncation (r1759116)
        +
        +  - Bindings bugfixes:
        +    * javahl: follow redirects when opening a connection (r1667738, r1796720)
        +
        + Developer-visible changes:
        +  - General:
        +    * win_tests.py: make the --bin option work, rather than abort (r1706432)
        +      (regression introduced in 1.9.2)
        +    * windows: support building with 'zlibstat.lib' in install-layout (r1783704)
        +
        +  - API changes:
        +    (none)
        +
        +
         Version 1.9.5
         (29 Nov 2016, from /branches/1.9.x)
         http://svn.apache.org/repos/asf/subversion/tags/1.9.5
        @@ -19,7 +79,7 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.5
             * fsfs: fix "offset too large" error during pack (issue #4657)
             * svnserve: enable hook script environments (r1769152)
             * fsfs: fix possible data reconstruction error (issue #4658)
        -    * fix source of spurious 'incoming edit' tree conflicts (r1770108)
        +    * fix source of spurious 'incoming edit' tree conflicts (r1760570)
             * fsfs: improve caching for large directories (r1721285)
             * fsfs: fix crash when encountering all-zero checksums (r1759686)
             * fsfs: fix potential source of repository corruptions (r1756266)
        @@ -34,19 +94,19 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.5
         
           - Bindings bugfixes:
             * swig-pl: do not corrupt "{DATE}" revision variable (r1767768)
        -    * javahl: fix temporary accepting SSL server certificates (r1764851)
        +    * javahl: fix temporarily accepting SSL server certificates (r1764851)
             * swig-pl: fix possible stack corruption (r1683266, r1683267)
         
          Developer-visible changes:
           - General:
             * add zlib discovery through pkg-config (issue #4655)
             * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653)
        -    * ruby: fix test failures with ruby >= 2.2 (r1766621)
        -    * fix link error with --disable-keychain on OS X (r1765385)
        +    * ruby: fix test failures with ruby >= 2.2 (r1766240)
        +    * fix link error with --disable-keychain on OS X (r1761755)
             * swig: enable building with SWIG >= 3.0.6 (r1721488 et al)
             * swig: fix building with -Wdate-time in $CPPFLAGS (r1722164)
             * update serf download URI in build scripts (r1700130 et al)
        -    * raise minimal httpd version from 2.0 to 2.2 (r1754193)
        +    * raise minimal httpd version from 2.0 to 2.2 (r1754190)
         
         
         Version 1.9.4
        @@ -105,7 +165,6 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.3
             * svn: report lock/unlock errors as failures (r1701598 et al)
             * svn: cleanup user deleted external registrations (r1705843, r1710558)
             * svn: allow simple resolving of binary file text conflicts (r1703581)
        -    * svnlook: properly remove tempfiles on diff errors (r1711346)
             * ra_serf: report built- and run-time versions of libserf (r1704847)
             * ra_serf: set Content-Type header in outgoing requests (r1715224 et al)
             * svn: fix merging deletes of svn:eol-style CRLF/CR files (r1703689 et al)
        @@ -118,6 +177,7 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.3
             * mod_dav_svn: use LimitXMLRequestBody for skel-encoded requests (r1687812)
             * svnadmin dump: preserve no-op changes (r1709388 et al, issue #4598)
             * fsfs: avoid unneeded I/O when opening transactions (r1715793)
        +    * svnlook: properly remove tempfiles on diff errors (r1711346)
         
           - Client-side and server-side bugfixes:
             * fix heap overflow in svn:// protocol parser (CVE-2015-5259)
        @@ -942,18 +1002,18 @@ http://svn.apache.org/repos/asf/subversion/tags/1.8.17
           - Client-side bugfixes:
             * fix handling of newly secured subdirectories in working copy (r1724448)
             * ra_serf: fix deleting directories with many files (issue #4557)
        -    * svnlook: properly remove tempfiles on diff errors (r1711346)
             * gpg-agent: properly handle passwords with percent characters (issue #4611)
             * merge: fix crash when merging to a local add (r1702299 et al)
         
           - Server-side bugfixes:
             * fsfs: fix possible data reconstruction error (issue #4658)
        +    * svnlook: properly remove tempfiles on diff errors (r1711346)
         
           - Client-side and server-side bugfixes:
             * fix potential memory access bugs (r1722860 et al)
         
           - Bindings bugfixes:
        -    * javahl: fix temporary accepting SSL server certificates (r1764851)
        +    * javahl: fix temporarily accepting SSL server certificates (r1764851)
             * swig-pl: do not corrupt "{DATE}" revision variable (r1767768)
             * swig-pl: fix possible stack corruption (r1683266)
         
        
        Modified: stable/11/contrib/subversion/NOTICE
        ==============================================================================
        --- stable/11/contrib/subversion/NOTICE	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/NOTICE	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -1,5 +1,5 @@
         Apache Subversion
        -Copyright 2016 The Apache Software Foundation
        +Copyright 2017 The Apache Software Foundation
         
         This product includes software developed by many people, and distributed
         under Contributor License Agreements to The Apache Software Foundation
        
        Modified: stable/11/contrib/subversion/build-outputs.mk
        ==============================================================================
        --- stable/11/contrib/subversion/build-outputs.mk	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/build-outputs.mk	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -2782,7 +2782,7 @@ subversion/libsvn_ra_serf/util_error.lo: subversion/li
         
         subversion/libsvn_ra_serf/xml.lo: subversion/libsvn_ra_serf/xml.c subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/include/svn_xml.h subversion/libsvn_ra/ra_loader.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_se
         rf.h subversion/svn_private_config.h
         
        -subversion/libsvn_ra_svn/client.lo: subversion/libsvn_ra_svn/client.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_ra_svn_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_compat.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_ra_svn.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_ra/ra_loader.h sub
         version/libsvn_ra/wrapper_template.h subversion/libsvn_ra_svn/ra_svn.h subversion/svn_private_config.h
        +subversion/libsvn_ra_svn/client.lo: subversion/libsvn_ra_svn/client.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_ra_svn_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_compat.h subversion/include/svn_config.h subversion/include/svn_ctype.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_ra_svn.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subve
         rsion/libsvn_ra/ra_loader.h subversion/libsvn_ra/wrapper_template.h subversion/libsvn_ra_svn/ra_svn.h subversion/svn_private_config.h
         
         subversion/libsvn_ra_svn/cram.lo: subversion/libsvn_ra_svn/cram.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_ra_svn_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_ra.h subversion/include/svn_ra_svn.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_ra_svn/ra_svn.h subversion/svn_private_config.h
         
        
        Modified: stable/11/contrib/subversion/configure
        ==============================================================================
        --- stable/11/contrib/subversion/configure	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/configure	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -1,6 +1,6 @@
         #! /bin/sh
         # Guess values for system-dependent variables and create Makefiles.
        -# Generated by GNU Autoconf 2.69 for subversion 1.9.5.
        +# Generated by GNU Autoconf 2.69 for subversion 1.9.7.
         #
         # Report bugs to .
         #
        @@ -590,8 +590,8 @@ MAKEFLAGS=
         # Identity of this package.
         PACKAGE_NAME='subversion'
         PACKAGE_TARNAME='subversion'
        -PACKAGE_VERSION='1.9.5'
        -PACKAGE_STRING='subversion 1.9.5'
        +PACKAGE_VERSION='1.9.7'
        +PACKAGE_STRING='subversion 1.9.7'
         PACKAGE_BUGREPORT='http://subversion.apache.org/'
         PACKAGE_URL=''
         
        @@ -1471,7 +1471,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 subversion 1.9.5 to adapt to many kinds of systems.
        +\`configure' configures subversion 1.9.7 to adapt to many kinds of systems.
         
         Usage: $0 [OPTION]... [VAR=VALUE]...
         
        @@ -1537,7 +1537,7 @@ fi
         
         if test -n "$ac_init_help"; then
           case $ac_init_help in
        -     short | recursive ) echo "Configuration of subversion 1.9.5:";;
        +     short | recursive ) echo "Configuration of subversion 1.9.7:";;
            esac
           cat <<\_ACEOF
         
        @@ -1751,7 +1751,7 @@ fi
         test -n "$ac_init_help" && exit $ac_status
         if $ac_init_version; then
           cat <<\_ACEOF
        -subversion configure 1.9.5
        +subversion configure 1.9.7
         generated by GNU Autoconf 2.69
         
         Copyright (C) 2012 Free Software Foundation, Inc.
        @@ -2295,7 +2295,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 subversion $as_me 1.9.5, which was
        +It was created by subversion $as_me 1.9.7, which was
         generated by GNU Autoconf 2.69.  Invocation command line was
         
           $ $0 $@
        @@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please 
         
         
         
        -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.5" >&5
        -$as_echo "$as_me: Configuring Subversion 1.9.5" >&6;}
        +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.7" >&5
        +$as_echo "$as_me: Configuring Subversion 1.9.7" >&6;}
         
         abs_srcdir="`cd $srcdir && pwd`"
         
        @@ -26756,7 +26756,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 subversion $as_me 1.9.5, which was
        +This file was extended by subversion $as_me 1.9.7, which was
         generated by GNU Autoconf 2.69.  Invocation command line was
         
           CONFIG_FILES    = $CONFIG_FILES
        @@ -26822,7 +26822,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="\\
        -subversion config.status 1.9.5
        +subversion config.status 1.9.7
         configured by $0, generated by GNU Autoconf 2.69,
           with options \\"\$ac_cs_config\\"
         
        
        Modified: stable/11/contrib/subversion/subversion/include/svn_version.h
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/include/svn_version.h	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/include/svn_version.h	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -70,7 +70,7 @@ extern "C" {
          *
          * @since New in 1.1.
          */
        -#define SVN_VER_PATCH      5
        +#define SVN_VER_PATCH      7
         
         
         /** @deprecated Provided for backward compatibility with the 1.0 API. */
        @@ -93,7 +93,7 @@ extern "C" {
          *
          * Always change this at the same time as SVN_VER_NUMTAG.
          */
        -#define SVN_VER_TAG        " (r1770682)"
        +#define SVN_VER_TAG        " (r1800392)"
         
         
         /** Number tag: a string describing the version.
        @@ -117,7 +117,7 @@ extern "C" {
          * file version. Its value remains 0 in the repository except in release
          * tags where it is the revision from which the tag was created.
          */
        -#define SVN_VER_REVISION   1770682
        +#define SVN_VER_REVISION   1800392
         
         
         /* Version strings composed from the above definitions. */
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_client/copy.c
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_client/copy.c	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_client/copy.c	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -1057,10 +1057,24 @@ verify_wc_dsts(const apr_array_header_t *copy_pairs,
                                         ctx->wc_ctx, pair->dst_parent_abspath,
                                         FALSE, TRUE,
                                         iterpool));
        -      if (make_parents && dst_parent_kind == svn_node_none)
        +      if (dst_parent_kind == svn_node_none)
                 {
        -          SVN_ERR(svn_client__make_local_parents(pair->dst_parent_abspath,
        -                                                 TRUE, ctx, iterpool));
        +          if (make_parents)
        +            SVN_ERR(svn_client__make_local_parents(pair->dst_parent_abspath,
        +                                                   TRUE, ctx, iterpool));
        +          else
        +            {
        +              SVN_ERR(svn_io_check_path(pair->dst_parent_abspath,
        +                                        &dst_parent_kind, scratch_pool));
        +              return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
        +                                       (dst_parent_kind == svn_node_dir)
        +                                         ? _("Directory '%s' is not under "
        +                                             "version control")
        +                                         : _("Path '%s' is not a directory"),
        +                                       svn_dirent_local_style(
        +                                         pair->dst_parent_abspath,
        +                                         scratch_pool));
        +            }
                 }
               else if (dst_parent_kind != svn_node_dir)
                 {
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_client/merge.c
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_client/merge.c	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_client/merge.c	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -6465,6 +6465,7 @@ get_mergeinfo_paths(apr_array_header_t *children_with_
         {
           int i;
           apr_pool_t *iterpool = svn_pool_create(scratch_pool);
        +  apr_pool_t *swmi_pool;
           apr_hash_t *subtrees_with_mergeinfo;
           apr_hash_t *excluded_subtrees;
           apr_hash_t *switched_subtrees;
        @@ -6473,10 +6474,13 @@ get_mergeinfo_paths(apr_array_header_t *children_with_
           struct pre_merge_status_baton_t pre_merge_status_baton;
         
           /* Case 1: Subtrees with explicit mergeinfo. */
        +  /* Use a subpool for subtrees_with_mergeinfo, as it can be very large
        +     and is temporary. */
        +  swmi_pool = svn_pool_create(scratch_pool);
           SVN_ERR(get_wc_explicit_mergeinfo_catalog(&subtrees_with_mergeinfo,
                                                     target->abspath,
                                                     depth, ctx,
        -                                            result_pool, scratch_pool));
        +                                            swmi_pool, swmi_pool));
           if (subtrees_with_mergeinfo)
             {
               apr_hash_index_t *hi;
        @@ -6513,6 +6517,7 @@ get_mergeinfo_paths(apr_array_header_t *children_with_
                     children_with_mergeinfo->elt_size,
                     compare_merge_path_t_as_paths);
             }
        +  svn_pool_destroy(swmi_pool);
         
           /* Case 2: Switched subtrees
              Case 10: Paths at depths of 'empty' or 'files'
        @@ -12331,6 +12336,10 @@ find_last_merged_location(svn_client__pathrev_t **base
           svn_revnum_t youngest_merged_rev = SVN_INVALID_REVNUM;
           svn_mergeinfo_catalog_t target_mergeinfo_cat = NULL;
         
        +  /* Using a local subpool for 'target_mergeinfo_cat' can make a big
        +     reduction in overall memory usage. */
        +  apr_pool_t *tmic_pool = svn_pool_create(scratch_pool);
        +
           source_peg_rev.kind = svn_opt_revision_number;
           source_peg_rev.value.number = source_branch->tip->rev;
           source_start_rev.kind = svn_opt_revision_number;
        @@ -12351,7 +12360,7 @@ find_last_merged_location(svn_client__pathrev_t **base
                                               operative_rev_receiver,
                                               &youngest_merged_rev,
                                               ctx, ra_session,
        -                                      result_pool, scratch_pool));
        +                                      tmic_pool, tmic_pool));
         
           if (!SVN_IS_VALID_REVNUM(youngest_merged_rev))
             {
        @@ -12387,7 +12396,7 @@ find_last_merged_location(svn_client__pathrev_t **base
                                                   operative_rev_receiver,
                                                   &oldest_eligible_rev,
                                                   ctx, ra_session,
        -                                          scratch_pool, scratch_pool));
        +                                          tmic_pool, tmic_pool));
         
               /* If there are revisions eligible for merging, use the oldest one
                  to calculate the base.  Otherwise there are no operative revisions
        @@ -12409,6 +12418,7 @@ find_last_merged_location(svn_client__pathrev_t **base
                                                    result_pool, scratch_pool));
             }
         
        +  svn_pool_destroy(tmic_pool);
           return SVN_NO_ERROR;
         }
         
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -2029,8 +2029,13 @@ rep_read_contents(void *baton,
               SVN_ERR(skip_contents(rb, rb->fulltext_delivered));
             }
         
        -  /* Get the next block of data. */
        -  SVN_ERR(get_contents_from_windows(rb, buf, len));
        +  /* Get the next block of data.
        +   * Keep in mind that the representation might be empty and leave us
        +   * already positioned at the end of the rep. */
        +  if (rb->off == rb->len)
        +    *len = 0;
        +  else
        +    SVN_ERR(get_contents_from_windows(rb, buf, len));
         
           if (rb->current_fulltext)
             svn_stringbuf_appendbytes(rb->current_fulltext, buf, *len);
        @@ -2119,6 +2124,96 @@ svn_fs_fs__get_contents(svn_stream_t **contents_p,
                                    rep_read_contents);
               svn_stream_set_close(*contents_p, rep_read_contents_close);
             }
        +
        +  return SVN_NO_ERROR;
        +}
        +
        +svn_error_t *
        +svn_fs_fs__get_contents_from_file(svn_stream_t **contents_p,
        +                                  svn_fs_t *fs,
        +                                  representation_t *rep,
        +                                  apr_file_t *file,
        +                                  apr_off_t offset,
        +                                  apr_pool_t *pool)
        +{
        +  struct rep_read_baton *rb;
        +  pair_cache_key_t fulltext_cache_key = { SVN_INVALID_REVNUM, 0 };
        +  rep_state_t *rs = apr_pcalloc(pool, sizeof(*rs));
        +  svn_fs_fs__rep_header_t *rh;
        +
        +  /* Initialize the reader baton.  Some members may added lazily
        +   * while reading from the stream. */
        +  SVN_ERR(rep_read_get_baton(&rb, fs, rep, fulltext_cache_key, pool));
        +
        +  /* Continue constructing RS. Leave caches as NULL. */
        +  rs->size = rep->size;
        +  rs->revision = SVN_INVALID_REVNUM;
        +  rs->item_index = 0;
        +  rs->ver = -1;
        +  rs->start = -1;
        +
        +  /* Provide just enough file access info to allow for a basic read from
        +   * FILE but leave all index / footer info with empty values b/c FILE
        +   * probably is not a complete revision file. */
        +  rs->sfile = apr_pcalloc(pool, sizeof(*rs->sfile));
        +  rs->sfile->revision = rep->revision;
        +  rs->sfile->pool = pool;
        +  rs->sfile->fs = fs;
        +  rs->sfile->rfile = apr_pcalloc(pool, sizeof(*rs->sfile->rfile));
        +  rs->sfile->rfile->start_revision = SVN_INVALID_REVNUM;
        +  rs->sfile->rfile->file = file;
        +  rs->sfile->rfile->stream = svn_stream_from_aprfile2(file, TRUE, pool);
        +
        +  /* Read the rep header. */
        +  SVN_ERR(aligned_seek(fs, file, NULL, offset, pool));
        +  SVN_ERR(svn_fs_fs__read_rep_header(&rh, rs->sfile->rfile->stream,
        +                                     pool, pool));
        +  SVN_ERR(get_file_offset(&rs->start, rs, pool));
        +  rs->header_size = rh->header_size;
        +
        +  /* Log the access. */
        +  SVN_ERR(dbg_log_access(fs, SVN_INVALID_REVNUM, 0, rh,
        +                         SVN_FS_FS__ITEM_TYPE_ANY_REP, pool));
        +
        +  /* Build the representation list (delta chain). */
        +  if (rh->type == svn_fs_fs__rep_plain)
        +    {
        +      rb->rs_list = apr_array_make(pool, 0, sizeof(rep_state_t *));
        +      rb->src_state = rs;
        +    }
        +  else if (rh->type == svn_fs_fs__rep_self_delta)
        +    {
        +      rb->rs_list = apr_array_make(pool, 1, sizeof(rep_state_t *));
        +      APR_ARRAY_PUSH(rb->rs_list, rep_state_t *) = rs;
        +      rb->src_state = NULL;
        +    }
        +  else
        +    {
        +      representation_t next_rep = { 0 };
        +
        +      /* skip "SVNx" diff marker */
        +      rs->current = 4;
        +
        +      /* REP's base rep is inside a proper revision.
        +       * It can be reconstructed in the usual way.  */
        +      next_rep.revision = rh->base_revision;
        +      next_rep.item_index = rh->base_item_index;
        +      next_rep.size = rh->base_length;
        +      svn_fs_fs__id_txn_reset(&next_rep.txn_id);
        +
        +      SVN_ERR(build_rep_list(&rb->rs_list, &rb->base_window,
        +                             &rb->src_state, &rb->len, rb->fs, &next_rep,
        +                             rb->filehandle_pool));
        +
        +      /* Insert the access to REP as the first element of the delta chain. */
        +      svn_sort__array_insert(rb->rs_list, &rs, 0);
        +    }
        +
        +  /* Now, the baton is complete and we can assemble the stream around it. */
        +  *contents_p = svn_stream_create(rb, pool);
        +  svn_stream_set_read2(*contents_p, NULL /* only full read support */,
        +                       rep_read_contents);
        +  svn_stream_set_close(*contents_p, rep_read_contents_close);
         
           return SVN_NO_ERROR;
         }
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -81,6 +81,18 @@ svn_fs_fs__get_contents(svn_stream_t **contents_p,
                                 svn_boolean_t cache_fulltext,
                                 apr_pool_t *pool);
         
        +/* Set *CONTENTS_P to be a readable svn_stream_t that receives the text
        +   representation REP as seen in filesystem FS.  Read the latest element
        +   of the delta chain from FILE at offset OFFSET.
        +   Use POOL for allocations. */
        +svn_error_t *
        +svn_fs_fs__get_contents_from_file(svn_stream_t **contents_p,
        +                                  svn_fs_t *fs,
        +                                  representation_t *rep,
        +                                  apr_file_t *file,
        +                                  apr_off_t offset,
        +                                  apr_pool_t *pool);
        +
         /* Attempt to fetch the text representation of node-revision NODEREV as
            seen in filesystem FS and pass it along with the BATON to the PROCESSOR.
            Set *SUCCESS only of the data could be provided and the processing
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -1,4 +1,4 @@
        -/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_fs_fs/token-map.h.
        +/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.7/subversion/libsvn_fs_fs/token-map.h.
          * Do not edit this file -- edit the source and rerun gen-make.py */
         
         #define STMT_CREATE_SCHEMA 0
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -128,7 +128,10 @@ svn_fs_fs__open_rep_cache(svn_fs_t *fs,
           fs_fs_data_t *ffd = fs->fsap_data;
           svn_error_t *err = svn_atomic__init_once(&ffd->rep_cache_db_opened,
                                                    open_rep_cache, fs, pool);
        -  return svn_error_quick_wrap(err, _("Couldn't open rep-cache database"));
        +  return svn_error_quick_wrapf(err,
        +                               _("Couldn't open rep-cache database '%s'"),
        +                               svn_dirent_local_style(
        +                                 path_rep_cache_db(fs->path, pool), pool));
         }
         
         svn_error_t *
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/transaction.c
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/transaction.c	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/transaction.c	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -2128,6 +2128,11 @@ rep_write_get_baton(struct rep_write_baton **wb_p,
            there may be new duplicate representations within the same uncommitted
            revision, those can be passed in REPS_HASH (maps a sha1 digest onto
            representation_t*), otherwise pass in NULL for REPS_HASH.
        +
        +   The content of both representations will be compared, taking REP's content
        +   from FILE at OFFSET.  Only if they actually match, will *OLD_REP not be
        +   NULL.
        +
            Use RESULT_POOL for *OLD_REP  allocations and SCRATCH_POOL for temporaries.
            The lifetime of *OLD_REP is limited by both, RESULT_POOL and REP lifetime.
          */
        @@ -2135,6 +2140,8 @@ static svn_error_t *
         get_shared_rep(representation_t **old_rep,
                        svn_fs_t *fs,
                        representation_t *rep,
        +               apr_file_t *file,
        +               apr_off_t offset,
                        apr_hash_t *reps_hash,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
        @@ -2142,6 +2149,10 @@ get_shared_rep(representation_t **old_rep,
           svn_error_t *err;
           fs_fs_data_t *ffd = fs->fsap_data;
         
        +  svn_checksum_t checksum;
        +  checksum.digest = rep->sha1_digest;
        +  checksum.kind = svn_checksum_sha1;
        +
           /* Return NULL, if rep sharing has been disabled. */
           *old_rep = NULL;
           if (!ffd->rep_sharing_allowed)
        @@ -2158,9 +2169,6 @@ get_shared_rep(representation_t **old_rep,
           /* If we haven't found anything yet, try harder and consult our DB. */
           if (*old_rep == NULL)
             {
        -      svn_checksum_t checksum;
        -      checksum.digest = rep->sha1_digest;
        -      checksum.kind = svn_checksum_sha1;
               err = svn_fs_fs__get_rep_reference(old_rep, fs, &checksum, result_pool);
               /* ### Other error codes that we shouldn't mask out? */
               if (err == SVN_NO_ERROR)
        @@ -2235,6 +2243,72 @@ get_shared_rep(representation_t **old_rep,
               (*old_rep)->uniquifier = rep->uniquifier;
             }
         
        +  /* If we (very likely) found a matching representation, compare the actual
        +   * contents such that we can be sure that no rep-cache.db corruption or
        +   * hash collision produced a false positive. */
        +  if (*old_rep)
        +    {
        +      apr_off_t old_position;
        +      svn_stream_t *contents;
        +      svn_stream_t *old_contents;
        +      svn_boolean_t same;
        +
        +      /* The existing representation may itself be part of the current
        +       * transaction.  In that case, it may be in different stages of
        +       * the commit finalization process.
        +       *
        +       * OLD_REP_NORM is the same as that OLD_REP but it is assigned
        +       * explicitly to REP's transaction if OLD_REP does not point
        +       * to an already committed revision.  This then prevents the
        +       * revision lookup and the txn data will be accessed.
        +       */
        +      representation_t old_rep_norm = **old_rep;
        +      if (   !SVN_IS_VALID_REVNUM(old_rep_norm.revision)
        +          || old_rep_norm.revision > ffd->youngest_rev_cache)
        +        old_rep_norm.txn_id = rep->txn_id;
        +
        +      /* Make sure we can later restore FILE's current position. */
        +      SVN_ERR(svn_fs_fs__get_file_offset(&old_position, file, scratch_pool));
        +
        +      /* Compare the two representations.
        +       * Note that the stream comparison might also produce MD5 checksum
        +       * errors or other failures in case of SHA1 collisions. */
        +      SVN_ERR(svn_fs_fs__get_contents_from_file(&contents, fs, rep, file,
        +                                                offset, scratch_pool));
        +      SVN_ERR(svn_fs_fs__get_contents(&old_contents, fs, &old_rep_norm,
        +                                      FALSE, scratch_pool));
        +      err = svn_stream_contents_same2(&same, contents, old_contents,
        +                                      scratch_pool);
        +
        +      /* A mismatch should be extremely rare.
        +       * If it does happen, reject the commit. */
        +      if (!same || err)
        +        {
        +          /* SHA1 collision or worse. */
        +          svn_stringbuf_t *old_rep_str
        +            = svn_fs_fs__unparse_representation(*old_rep,
        +                                                ffd->format, FALSE,
        +                                                scratch_pool,
        +                                                scratch_pool);
        +          svn_stringbuf_t *rep_str
        +            = svn_fs_fs__unparse_representation(rep,
        +                                                ffd->format, FALSE,
        +                                                scratch_pool,
        +                                                scratch_pool);
        +          const char *checksum__str
        +            = svn_checksum_to_cstring_display(&checksum, scratch_pool);
        +
        +          return svn_error_createf(SVN_ERR_FS_GENERAL,
        +                                   err, "SHA1 of reps '%s' and '%s' "
        +                                   "matches (%s) but contents differ",
        +                                   old_rep_str->data, rep_str->data,
        +                                   checksum__str);
        +        }
        +
        +      /* Restore FILE's read / write position. */
        +      SVN_ERR(svn_io_file_seek(file, APR_SET, &old_position, scratch_pool));
        +    }
        +
           return SVN_NO_ERROR;
         }
         
        @@ -2293,8 +2367,8 @@ rep_write_contents_close(void *baton)
         
           /* Check and see if we already have a representation somewhere that's
              identical to the one we just wrote out. */
        -  SVN_ERR(get_shared_rep(&old_rep, b->fs, rep, NULL, b->result_pool,
        -                         b->scratch_pool));
        +  SVN_ERR(get_shared_rep(&old_rep, b->fs, rep, b->file, b->rep_offset, NULL,
        +                         b->result_pool, b->scratch_pool));
         
           if (old_rep)
             {
        @@ -2519,11 +2593,16 @@ write_directory_to_stream(svn_stream_t *stream,
         /* Write out the COLLECTION as a text representation to file FILE using
            WRITER.  In the process, record position, the total size of the dump and
            MD5 as well as SHA1 in REP.   Add the representation of type ITEM_TYPE to
        -   the indexes if necessary.  If rep sharing has been enabled and REPS_HASH
        -   is not NULL, it will be used in addition to the on-disk cache to find
        -   earlier reps with the same content.  When such existing reps can be
        -   found, we will truncate the one just written from the file and return
        -   the existing rep.  Perform temporary allocations in SCRATCH_POOL. */
        +   the indexes if necessary.
        +
        +   If ALLOW_REP_SHARING is FALSE, rep-sharing will not be used, regardless
        +   of any other option and rep-sharing settings.  If rep sharing has been
        +   enabled and REPS_HASH is not NULL, it will be used in addition to the
        +   on-disk cache to find earlier reps with the same content.  If such
        +   existing reps can be found, we will truncate the one just written from
        +   the file and return the existing rep.
        +
        +   Perform temporary allocations in SCRATCH_POOL. */
         static svn_error_t *
         write_container_rep(representation_t *rep,
                             apr_file_t *file,
        @@ -2531,14 +2610,15 @@ write_container_rep(representation_t *rep,
                             collection_writer_t writer,
                             svn_fs_t *fs,
                             apr_hash_t *reps_hash,
        +                    svn_boolean_t allow_rep_sharing,
                             apr_uint32_t item_type,
                             apr_pool_t *scratch_pool)
         {
           svn_stream_t *stream;
           struct write_container_baton *whb;
           svn_checksum_ctx_t *fnv1a_checksum_ctx;
        -  representation_t *old_rep;
           apr_off_t offset = 0;
        +  svn_fs_fs__p2l_entry_t entry;
         
           SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
         
        @@ -2562,58 +2642,62 @@ write_container_rep(representation_t *rep,
           /* Store the results. */
           SVN_ERR(digests_final(rep, whb->md5_ctx, whb->sha1_ctx, scratch_pool));
         
        +  /* Update size info. */
        +  rep->expanded_size = whb->size;
        +  rep->size = whb->size;
        +
           /* Check and see if we already have a representation somewhere that's
              identical to the one we just wrote out. */
        -  SVN_ERR(get_shared_rep(&old_rep, fs, rep, reps_hash, scratch_pool,
        -                         scratch_pool));
        -
        -  if (old_rep)
        +  if (allow_rep_sharing)
             {
        -      /* We need to erase from the protorev the data we just wrote. */
        -      SVN_ERR(svn_io_file_trunc(file, offset, scratch_pool));
        +      representation_t *old_rep;
        +      SVN_ERR(get_shared_rep(&old_rep, fs, rep, file, offset, reps_hash,
        +                             scratch_pool, scratch_pool));
         
        -      /* Use the old rep for this content. */
        -      memcpy(rep, old_rep, sizeof (*rep));
        +      if (old_rep)
        +        {
        +          /* We need to erase from the protorev the data we just wrote. */
        +          SVN_ERR(svn_io_file_trunc(file, offset, scratch_pool));
        +
        +          /* Use the old rep for this content. */
        +          memcpy(rep, old_rep, sizeof (*rep));
        +          return SVN_NO_ERROR;
        +        }
             }
        -  else
        -    {
        -      svn_fs_fs__p2l_entry_t entry;
         
        -      /* Write out our cosmetic end marker. */
        -      SVN_ERR(svn_stream_puts(whb->stream, "ENDREP\n"));
        +  /* Write out our cosmetic end marker. */
        +  SVN_ERR(svn_stream_puts(whb->stream, "ENDREP\n"));
         
        -      SVN_ERR(allocate_item_index(&rep->item_index, fs, &rep->txn_id,
        -                                  offset, scratch_pool));
        +  SVN_ERR(allocate_item_index(&rep->item_index, fs, &rep->txn_id,
        +                              offset, scratch_pool));
         
        -      entry.offset = offset;
        -      SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
        -      entry.size = offset - entry.offset;
        -      entry.type = item_type;
        -      entry.item.revision = SVN_INVALID_REVNUM;
        -      entry.item.number = rep->item_index;
        -      SVN_ERR(fnv1a_checksum_finalize(&entry.fnv1_checksum,
        -                                      fnv1a_checksum_ctx,
        -                                      scratch_pool));
        +  entry.offset = offset;
        +  SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
        +  entry.size = offset - entry.offset;
        +  entry.type = item_type;
        +  entry.item.revision = SVN_INVALID_REVNUM;
        +  entry.item.number = rep->item_index;
        +  SVN_ERR(fnv1a_checksum_finalize(&entry.fnv1_checksum,
        +                                  fnv1a_checksum_ctx,
        +                                  scratch_pool));
         
        -      SVN_ERR(store_p2l_index_entry(fs, &rep->txn_id, &entry, scratch_pool));
        +  SVN_ERR(store_p2l_index_entry(fs, &rep->txn_id, &entry, scratch_pool));
         
        -      /* update the representation */
        -      rep->size = whb->size;
        -      rep->expanded_size = whb->size;
        -    }
        -
           return SVN_NO_ERROR;
         }
         
         /* Write out the COLLECTION pertaining to the NODEREV in FS as a deltified
            text representation to file FILE using WRITER.  In the process, record the
            total size and the md5 digest in REP and add the representation of type
        -   ITEM_TYPE to the indexes if necessary.  If rep sharing has been enabled and
        -   REPS_HASH is not NULL, it will be used in addition to the on-disk cache to
        -   find earlier reps with the same content.  When such existing reps can be
        -   found, we will truncate the one just written from the file and return the
        -   existing rep.
        +   ITEM_TYPE to the indexes if necessary.
         
        +   If ALLOW_REP_SHARING is FALSE, rep-sharing will not be used, regardless
        +   of any other option and rep-sharing settings.  If rep sharing has been
        +   enabled and REPS_HASH is not NULL, it will be used in addition to the
        +   on-disk cache to find earlier reps with the same content.  If such
        +   existing reps can be found, we will truncate the one just written from
        +   the file and return the existing rep.
        +
            If ITEM_TYPE is IS_PROPS equals SVN_FS_FS__ITEM_TYPE_*_PROPS, assume
            that we want to a props representation as the base for our delta.
            Perform temporary allocations in SCRATCH_POOL.
        @@ -2626,6 +2710,7 @@ write_container_delta_rep(representation_t *rep,
                                   svn_fs_t *fs,
                                   node_revision_t *noderev,
                                   apr_hash_t *reps_hash,
        +                          svn_boolean_t allow_rep_sharing,
                                   apr_uint32_t item_type,
                                   apr_pool_t *scratch_pool)
         {
        @@ -2635,10 +2720,10 @@ write_container_delta_rep(representation_t *rep,
           svn_stream_t *file_stream;
           svn_stream_t *stream;
           representation_t *base_rep;
        -  representation_t *old_rep;
           svn_checksum_ctx_t *fnv1a_checksum_ctx;
           svn_stream_t *source;
           svn_fs_fs__rep_header_t header = { 0 };
        +  svn_fs_fs__p2l_entry_t entry;
         
           apr_off_t rep_end = 0;
           apr_off_t delta_start = 0;
        @@ -2701,47 +2786,48 @@ write_container_delta_rep(representation_t *rep,
           /* Store the results. */
           SVN_ERR(digests_final(rep, whb->md5_ctx, whb->sha1_ctx, scratch_pool));
         
        +  /* Update size info. */
        +  SVN_ERR(svn_fs_fs__get_file_offset(&rep_end, file, scratch_pool));
        +  rep->size = rep_end - delta_start;
        +  rep->expanded_size = whb->size;
        +
           /* Check and see if we already have a representation somewhere that's
              identical to the one we just wrote out. */
        -  SVN_ERR(get_shared_rep(&old_rep, fs, rep, reps_hash, scratch_pool,
        -                         scratch_pool));
        -
        -  if (old_rep)
        +  if (allow_rep_sharing)
             {
        -      /* We need to erase from the protorev the data we just wrote. */
        -      SVN_ERR(svn_io_file_trunc(file, offset, scratch_pool));
        +      representation_t *old_rep;
        +      SVN_ERR(get_shared_rep(&old_rep, fs, rep, file, offset, reps_hash,
        +                             scratch_pool, scratch_pool));
         
        -      /* Use the old rep for this content. */
        -      memcpy(rep, old_rep, sizeof (*rep));
        +      if (old_rep)
        +        {
        +          /* We need to erase from the protorev the data we just wrote. */
        +          SVN_ERR(svn_io_file_trunc(file, offset, scratch_pool));
        +
        +          /* Use the old rep for this content. */
        +          memcpy(rep, old_rep, sizeof (*rep));
        +          return SVN_NO_ERROR;
        +        }
             }
        -  else
        -    {
        -      svn_fs_fs__p2l_entry_t entry;
         
        -      /* Write out our cosmetic end marker. */
        -      SVN_ERR(svn_fs_fs__get_file_offset(&rep_end, file, scratch_pool));
        -      SVN_ERR(svn_stream_puts(file_stream, "ENDREP\n"));
        +  /* Write out our cosmetic end marker. */
        +  SVN_ERR(svn_stream_puts(file_stream, "ENDREP\n"));
         
        -      SVN_ERR(allocate_item_index(&rep->item_index, fs, &rep->txn_id,
        -                                  offset, scratch_pool));
        +  SVN_ERR(allocate_item_index(&rep->item_index, fs, &rep->txn_id,
        +                              offset, scratch_pool));
         
        -      entry.offset = offset;
        -      SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
        -      entry.size = offset - entry.offset;
        -      entry.type = item_type;
        -      entry.item.revision = SVN_INVALID_REVNUM;
        -      entry.item.number = rep->item_index;
        -      SVN_ERR(fnv1a_checksum_finalize(&entry.fnv1_checksum,
        -                                      fnv1a_checksum_ctx,
        -                                      scratch_pool));
        +  entry.offset = offset;
        +  SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
        +  entry.size = offset - entry.offset;
        +  entry.type = item_type;
        +  entry.item.revision = SVN_INVALID_REVNUM;
        +  entry.item.number = rep->item_index;
        +  SVN_ERR(fnv1a_checksum_finalize(&entry.fnv1_checksum,
        +                                  fnv1a_checksum_ctx,
        +                                  scratch_pool));
         
        -      SVN_ERR(store_p2l_index_entry(fs, &rep->txn_id, &entry, scratch_pool));
        +  SVN_ERR(store_p2l_index_entry(fs, &rep->txn_id, &entry, scratch_pool));
         
        -      /* update the representation */
        -      rep->expanded_size = whb->size;
        -      rep->size = rep_end - delta_start;
        -    }
        -
           return SVN_NO_ERROR;
         }
         
        @@ -2920,13 +3006,14 @@ write_final_rev(const svn_fs_id_t **new_id_p,
                     SVN_ERR(write_container_delta_rep(noderev->data_rep, file,
                                                       entries,
                                                       write_directory_to_stream,
        -                                              fs, noderev, NULL,
        +                                              fs, noderev, NULL, FALSE,
                                                       SVN_FS_FS__ITEM_TYPE_DIR_REP,
                                                       pool));
                   else
                     SVN_ERR(write_container_rep(noderev->data_rep, file, entries,
                                                 write_directory_to_stream, fs, NULL,
        -                                        SVN_FS_FS__ITEM_TYPE_DIR_REP, pool));
        +                                        FALSE, SVN_FS_FS__ITEM_TYPE_DIR_REP,
        +                                        pool));
         
                   reset_txn_in_rep(noderev->data_rep);
                 }
        @@ -2971,11 +3058,11 @@ write_final_rev(const svn_fs_id_t **new_id_p,
               if (ffd->deltify_properties)
                 SVN_ERR(write_container_delta_rep(noderev->prop_rep, file, proplist,
                                                   write_hash_to_stream, fs, noderev,
        -                                          reps_hash, item_type, pool));
        +                                          reps_hash, TRUE, item_type, pool));
               else
                 SVN_ERR(write_container_rep(noderev->prop_rep, file, proplist,
                                             write_hash_to_stream, fs, reps_hash,
        -                                    item_type, pool));
        +                                    TRUE, item_type, pool));
         
               reset_txn_in_rep(noderev->prop_rep);
             }
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -1,4 +1,4 @@
        -/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_fs_x/token-map.h.
        +/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.7/subversion/libsvn_fs_x/token-map.h.
          * Do not edit this file -- edit the source and rerun gen-make.py */
         
         #define STMT_CREATE_SCHEMA 0
        
        Modified: stable/11/contrib/subversion/subversion/libsvn_ra_svn/client.c
        ==============================================================================
        --- stable/11/contrib/subversion/subversion/libsvn_ra_svn/client.c	Sat Aug 12 21:26:46 2017	(r322441)
        +++ stable/11/contrib/subversion/subversion/libsvn_ra_svn/client.c	Sat Aug 12 22:12:09 2017	(r322442)
        @@ -46,6 +46,7 @@
         #include "svn_props.h"
         #include "svn_mergeinfo.h"
         #include "svn_version.h"
        +#include "svn_ctype.h"
         
         #include "svn_private_config.h"
         
        @@ -396,7 +397,7 @@ static svn_error_t *find_tunnel_agent(const char *tunn
                * versions have it too. If the user is using some other ssh
                * implementation that doesn't accept it, they can override it
                * in the [tunnels] section of the config. */
        -      val = "$SVN_SSH ssh -q";
        +      val = "$SVN_SSH ssh -q --";
             }
         
           if (!val || !*val)
        @@ -441,7 +442,7 @@ static svn_error_t *find_tunnel_agent(const char *tunn
           for (n = 0; cmd_argv[n] != NULL; n++)
             argv[n] = cmd_argv[n];
         
        -  argv[n++] = svn_path_uri_decode(hostinfo, pool);
        +  argv[n++] = hostinfo;
           argv[n++] = "svnserve";
           argv[n++] = "-t";
           argv[n] = NULL;
        @@ -802,7 +803,33 @@ ra_svn_get_schemes(apr_pool_t *pool)
         }
         
         
        +/* A simple whitelist to ensure the following are valid:
        + *   user@server
        + *   [::1]:22
        + *   server-name
        + *   server_name
        + *   127.0.0.1
        + * with an extra restriction that a leading '-' is invalid.
        + */
        +static svn_boolean_t
        +is_valid_hostinfo(const char *hostinfo)
        +{
        +  const char *p = hostinfo;
         
        +  if (p[0] == '-')
        +    return FALSE;
        +
        +  while (*p)
        +    {
        +      if (!svn_ctype_isalnum(*p) && !strchr(":.-_[]@", *p))
        +        return FALSE;
        +
        +      ++p;
        +    }
        +
        +  return TRUE;
        +}
        +
         static svn_error_t *ra_svn_open(svn_ra_session_t *session,
                                         const char **corrected_url,
                                         const char *url,
        @@ -835,8 +862,18 @@ static svn_error_t *ra_svn_open(svn_ra_session_t *sess
                   || (callbacks->check_tunnel_func && callbacks->open_tunnel_func
                       && !callbacks->check_tunnel_func(callbacks->tunnel_baton,
                                                        tunnel))))
        -    SVN_ERR(find_tunnel_agent(tunnel, uri.hostinfo, &tunnel_argv, config,
        
        *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
        
        From owner-svn-src-stable@freebsd.org  Sat Aug 12 22:14:11 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 495FBDCC40A;
         Sat, 12 Aug 2017 22:14:11 +0000 (UTC)
         (envelope-from peter@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 0034273B4D;
         Sat, 12 Aug 2017 22:14:10 +0000 (UTC)
         (envelope-from peter@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7CMEASD010056;
         Sat, 12 Aug 2017 22:14:10 GMT (envelope-from peter@FreeBSD.org)
        Received: (from peter@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7CME9SL010051;
         Sat, 12 Aug 2017 22:14:09 GMT (envelope-from peter@FreeBSD.org)
        Message-Id: <201708122214.v7CME9SL010051@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: peter set sender to
         peter@FreeBSD.org using -f
        From: Peter Wemm 
        Date: Sat, 12 Aug 2017 22:14:09 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322444 - in stable/11/contrib/sqlite3: . tea tea/generic
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: peter
        X-SVN-Commit-Paths: in stable/11/contrib/sqlite3: . tea tea/generic
        X-SVN-Commit-Revision: 322444
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Sat, 12 Aug 2017 22:14:11 -0000
        
        Author: peter
        Date: Sat Aug 12 22:14:09 2017
        New Revision: 322444
        URL: https://svnweb.freebsd.org/changeset/base/322444
        
        Log:
          MFC: r322386 Update private sqlite3-3.14.1 to sqlite3-3.20.0.
        
        Modified:
          stable/11/contrib/sqlite3/Makefile.msc
          stable/11/contrib/sqlite3/configure
          stable/11/contrib/sqlite3/configure.ac
          stable/11/contrib/sqlite3/shell.c
          stable/11/contrib/sqlite3/sqlite3.c
          stable/11/contrib/sqlite3/sqlite3.h
          stable/11/contrib/sqlite3/sqlite3ext.h
          stable/11/contrib/sqlite3/tea/configure
          stable/11/contrib/sqlite3/tea/configure.ac
          stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/contrib/sqlite3/Makefile.msc
        ==============================================================================
        --- stable/11/contrib/sqlite3/Makefile.msc	Sat Aug 12 22:13:06 2017	(r322443)
        +++ stable/11/contrib/sqlite3/Makefile.msc	Sat Aug 12 22:14:09 2017	(r322444)
        @@ -21,9 +21,16 @@ TOP = .
         # Set this non-0 to enable full warnings (-W4, etc) when compiling.
         #
         !IFNDEF USE_FULLWARN
        -USE_FULLWARN = 0
        +USE_FULLWARN = 1
         !ENDIF
         
        +# Set this non-0 to enable treating warnings as errors (-WX, etc) when
        +# compiling.
        +#
        +!IFNDEF USE_FATAL_WARN
        +USE_FATAL_WARN = 0
        +!ENDIF
        +
         # Set this non-0 to enable full runtime error checks (-RTC1, etc).  This
         # has no effect if (any) optimizations are enabled.
         #
        @@ -31,6 +38,13 @@ USE_FULLWARN = 0
         USE_RUNTIME_CHECKS = 0
         !ENDIF
         
        +# Set this non-0 to create a SQLite amalgamation file that excludes the
        +# various built-in extensions.
        +#
        +!IFNDEF MINIMAL_AMALGAMATION
        +MINIMAL_AMALGAMATION = 0
        +!ENDIF
        +
         # Set this non-0 to use "stdcall" calling convention for the core library
         # and shell executable.
         #
        @@ -255,12 +269,15 @@ SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
         !ENDIF
         !ENDIF
         
        +
         # These are the "standard" SQLite compilation options used when compiling for
         # the Windows platform.
         #
         !IFNDEF OPT_FEATURE_FLAGS
        +!IF $(MINIMAL_AMALGAMATION)==0
         OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
         OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
        +!ENDIF
         OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
         !ENDIF
         
        @@ -444,6 +461,12 @@ TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $
         TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
         !ENDIF
         
        +# Check if warnings should be treated as errors when compiling.
        +#
        +!IF $(USE_FATAL_WARN)!=0
        +TCC = $(TCC) -WX
        +!ENDIF
        +
         TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise
         RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
         
        @@ -622,7 +645,11 @@ RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
         !IF $(DEBUG)>2
         TCC = $(TCC) -DSQLITE_DEBUG=1
         RCC = $(RCC) -DSQLITE_DEBUG=1
        +!IF $(DYNAMIC_SHELL)==0
        +TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
        +RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
         !ENDIF
        +!ENDIF
         
         !IF $(DEBUG)>4 || $(OSTRACE)!=0
         TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
        @@ -900,7 +927,7 @@ LIBRESOBJS =
         # when the shell is not being dynamically linked.
         #
         !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
        -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
        +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
         !ENDIF
         
         
        @@ -927,7 +954,7 @@ Replace.exe:
         sqlite3.def:	Replace.exe $(LIBOBJ)
         	echo EXPORTS > sqlite3.def
         	dumpbin /all $(LIBOBJ) \
        -		| .\Replace.exe "^\s+/EXPORT:_?(sqlite3_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
        +		| .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
         		| sort >> sqlite3.def
         
         $(SQLITE3EXE):	$(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
        
        Modified: stable/11/contrib/sqlite3/configure
        ==============================================================================
        --- stable/11/contrib/sqlite3/configure	Sat Aug 12 22:13:06 2017	(r322443)
        +++ stable/11/contrib/sqlite3/configure	Sat Aug 12 22:14:09 2017	(r322444)
        @@ -1,6 +1,6 @@
         #! /bin/sh
         # Guess values for system-dependent variables and create Makefiles.
        -# Generated by GNU Autoconf 2.69 for sqlite 3.14.1.
        +# Generated by GNU Autoconf 2.69 for sqlite 3.20.0.
         #
         # Report bugs to .
         #
        @@ -590,8 +590,8 @@ MAKEFLAGS=
         # Identity of this package.
         PACKAGE_NAME='sqlite'
         PACKAGE_TARNAME='sqlite'
        -PACKAGE_VERSION='3.14.1'
        -PACKAGE_STRING='sqlite 3.14.1'
        +PACKAGE_VERSION='3.20.0'
        +PACKAGE_STRING='sqlite 3.20.0'
         PACKAGE_BUGREPORT='http://www.sqlite.org'
         PACKAGE_URL=''
         
        @@ -1330,7 +1330,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.14.1 to adapt to many kinds of systems.
        +\`configure' configures sqlite 3.20.0 to adapt to many kinds of systems.
         
         Usage: $0 [OPTION]... [VAR=VALUE]...
         
        @@ -1400,7 +1400,7 @@ fi
         
         if test -n "$ac_init_help"; then
           case $ac_init_help in
        -     short | recursive ) echo "Configuration of sqlite 3.14.1:";;
        +     short | recursive ) echo "Configuration of sqlite 3.20.0:";;
            esac
           cat <<\_ACEOF
         
        @@ -1521,7 +1521,7 @@ fi
         test -n "$ac_init_help" && exit $ac_status
         if $ac_init_version; then
           cat <<\_ACEOF
        -sqlite configure 3.14.1
        +sqlite configure 3.20.0
         generated by GNU Autoconf 2.69
         
         Copyright (C) 2012 Free Software Foundation, Inc.
        @@ -1936,7 +1936,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.14.1, which was
        +It was created by sqlite $as_me 3.20.0, which was
         generated by GNU Autoconf 2.69.  Invocation command line was
         
           $ $0 $@
        @@ -2802,7 +2802,7 @@ fi
         
         # Define the identity of the package.
          PACKAGE='sqlite'
        - VERSION='3.14.1'
        + VERSION='3.20.0'
         
         
         cat >>confdefs.h <<_ACEOF
        @@ -13108,7 +13108,7 @@ for ac_lib in '' edit; do
             ac_res="none required"
           else
             ac_res=-l$ac_lib
        -    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
        +    LIBS="-l$ac_lib -ltinfo $ac_func_search_save_LIBS"
           fi
           if ac_fn_c_try_link "$LINENO"; then :
           ac_cv_search_readline=$ac_res
        @@ -13136,7 +13136,7 @@ if test "$ac_res" != no; then :
         
         $as_echo "#define HAVE_EDITLINE 1" >>confdefs.h
         
        -      READLINE_LIBS=$LIBS
        +      READLINE_LIBS="$LIBS -ltinfo"
               enable_readline=no
         
         fi
        @@ -14227,7 +14227,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.14.1, which was
        +This file was extended by sqlite $as_me 3.20.0, which was
         generated by GNU Autoconf 2.69.  Invocation command line was
         
           CONFIG_FILES    = $CONFIG_FILES
        @@ -14284,7 +14284,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.14.1
        +sqlite config.status 3.20.0
         configured by $0, generated by GNU Autoconf 2.69,
           with options \\"\$ac_cs_config\\"
         
        
        Modified: stable/11/contrib/sqlite3/configure.ac
        ==============================================================================
        --- stable/11/contrib/sqlite3/configure.ac	Sat Aug 12 22:13:06 2017	(r322443)
        +++ stable/11/contrib/sqlite3/configure.ac	Sat Aug 12 22:14:09 2017	(r322444)
        @@ -10,7 +10,7 @@
         #
         
         AC_PREREQ(2.61)
        -AC_INIT(sqlite, 3.14.1, http://www.sqlite.org)
        +AC_INIT(sqlite, 3.20.0, http://www.sqlite.org)
         AC_CONFIG_SRCDIR([sqlite3.c])
         
         # Use automake.
        @@ -55,9 +55,9 @@ AS_IF([ test x"$enable_editline" != xno ],[
             LIBS=""
             AC_SEARCH_LIBS([readline],[edit],[
               AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
        -      READLINE_LIBS=$LIBS
        +      READLINE_LIBS="$LIBS -ltinfo"
               enable_readline=no
        -    ])
        +    ],[],[-ltinfo])
             AS_UNSET(ac_cv_search_readline)
             LIBS=$sLIBS
           ])
        
        Modified: stable/11/contrib/sqlite3/shell.c
        ==============================================================================
        --- stable/11/contrib/sqlite3/shell.c	Sat Aug 12 22:13:06 2017	(r322443)
        +++ stable/11/contrib/sqlite3/shell.c	Sat Aug 12 22:14:09 2017	(r322444)
        @@ -1,3 +1,21 @@
        +/* DO NOT EDIT!
        +** This file is automatically generated by the script in the canonical
        +** SQLite source tree at tool/mkshellc.tcl.  That script combines source
        +** code from various constituent source files of SQLite into this single
        +** "shell.c" file used to implement the SQLite command-line shell.
        +**
        +** Most of the code found below comes from the "src/shell.c.in" file in
        +** the canonical SQLite source tree.  That main file contains "INCLUDE"
        +** lines that specify other files in the canonical source tree that are
        +** inserted to getnerate this complete program source file.
        +**
        +** The code from multiple files is combined into this single "shell.c"
        +** source file to help make the command-line program easier to compile.
        +**
        +** To modify this program, get a copy of the canonical SQLite source tree,
        +** edit the src/shell.c.in" and/or some of the other files that are included
        +** by "src/shell.c.in", then rerun the tool/mkshellc.tcl script.
        +*/
         /*
         ** 2001 September 15
         **
        @@ -18,11 +36,25 @@
         #endif
         
         /*
        -** If requested, include the SQLite compiler options file for MSVC.
        +** Warning pragmas copied from msvc.h in the core.
         */
        -#if defined(INCLUDE_MSVC_H)
        -#include "msvc.h"
        -#endif
        +#if defined(_MSC_VER)
        +#pragma warning(disable : 4054)
        +#pragma warning(disable : 4055)
        +#pragma warning(disable : 4100)
        +#pragma warning(disable : 4127)
        +#pragma warning(disable : 4130)
        +#pragma warning(disable : 4152)
        +#pragma warning(disable : 4189)
        +#pragma warning(disable : 4206)
        +#pragma warning(disable : 4210)
        +#pragma warning(disable : 4232)
        +#pragma warning(disable : 4244)
        +#pragma warning(disable : 4305)
        +#pragma warning(disable : 4306)
        +#pragma warning(disable : 4702)
        +#pragma warning(disable : 4706)
        +#endif /* defined(_MSC_VER) */
         
         /*
         ** No support for loadable extensions in VxWorks.
        @@ -143,6 +175,7 @@
         extern char *sqlite3_win32_unicode_to_utf8(LPCWSTR);
         extern char *sqlite3_win32_mbcs_to_utf8_v2(const char *, int);
         extern char *sqlite3_win32_utf8_to_mbcs_v2(const char *, int);
        +extern LPWSTR sqlite3_win32_utf8_to_unicode(const char *zText);
         #endif
         
         /* On Windows, we normally run with output mode of TEXT so that \n characters
        @@ -426,7 +459,37 @@ static void SQLITE_CDECL iotracePrintf(const char *zFo
         }
         #endif
         
        +/*
        +** Output string zUtf to stream pOut as w characters.  If w is negative,
        +** then right-justify the text.  W is the width in UTF-8 characters, not
        +** in bytes.  This is different from the %*.*s specification in printf
        +** since with %*.*s the width is measured in bytes, not characters.
        +*/
        +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++;
        +      if( n==aw ){
        +        do{ i++; }while( (zUtf[i]&0xc0)==0x80 );
        +        break;
        +      }
        +    }
        +  }
        +  if( n>=aw ){
        +    utf8_printf(pOut, "%.*s", i, zUtf);
        +  }else if( w<0 ){
        +    utf8_printf(pOut, "%*s%s", aw-n, "", zUtf);
        +  }else{
        +    utf8_printf(pOut, "%s%*s", zUtf, aw-n, "");
        +  }
        +}
         
        +
         /*
         ** Determines if a string is a number of not.
         */
        @@ -455,28 +518,6 @@ static int isNumber(const char *z, int *realnum){
         }
         
         /*
        -** A global char* and an SQL function to access its current value
        -** from within an SQL statement. This program used to use the
        -** sqlite_exec_printf() API to substitue a string into an SQL statement.
        -** The correct way to do this with sqlite3 is to use the bind API, but
        -** since the shell is built around the callback paradigm it would be a lot
        -** of work. Instead just use this hack, which is quite harmless.
        -*/
        -static const char *zShellStatic = 0;
        -static void shellstaticFunc(
        -  sqlite3_context *context,
        -  int argc,
        -  sqlite3_value **argv
        -){
        -  assert( 0==argc );
        -  assert( zShellStatic );
        -  UNUSED_PARAMETER(argc);
        -  UNUSED_PARAMETER(argv);
        -  sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC);
        -}
        -
        -
        -/*
         ** Compute a string length that is limited to what can be stored in
         ** lower 30 bits of a 32-bit signed integer.
         */
        @@ -487,6 +528,18 @@ static int strlen30(const char *z){
         }
         
         /*
        +** Return the length of a string in characters.  Multibyte UTF8 characters
        +** count as a single character.
        +*/
        +static int strlenChar(const char *z){
        +  int n = 0;
        +  while( *z ){
        +    if( (0xc0&*(z++))!=0x80 ) n++;
        +  }
        +  return n;
        +}
        +
        +/*
         ** This routine reads a line of text from FILE in, stores
         ** the text in memory obtained from malloc() and returns a pointer
         ** to the text.  NULL is returned at end of file, or if malloc()
        @@ -524,7 +577,7 @@ static char *local_getline(char *zLine, FILE *in){
         #if defined(_WIN32) || defined(WIN32)
           /* For interactive input on Windows systems, translate the
           ** multi-byte characterset characters into UTF-8. */
        -  if( stdin_is_interactive ){
        +  if( stdin_is_interactive && in==stdin ){
             char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0);
             if( zTrans ){
               int nTrans = strlen30(zTrans)+1;
        @@ -576,7 +629,1534 @@ static char *one_input_line(FILE *in, char *zPrior, in
           }
           return zResult;
         }
        +/*
        +** A variable length string to which one can append text.
        +*/
        +typedef struct ShellText ShellText;
        +struct ShellText {
        +  char *z;
        +  int n;
        +  int nAlloc;
        +};
         
        +/*
        +** Initialize and destroy a ShellText object
        +*/
        +static void initText(ShellText *p){
        +  memset(p, 0, sizeof(*p));
        +}
        +static void freeText(ShellText *p){
        +  free(p->z);
        +  initText(p);
        +}
        +
        +/* zIn is either a pointer to a NULL-terminated string in memory obtained
        +** from malloc(), or a NULL pointer. The string pointed to by zAppend is
        +** added to zIn, and the result returned in memory obtained from malloc().
        +** zIn, if it was not NULL, is freed.
        +**
        +** If the third argument, quote, is not '\0', then it is used as a
        +** quote character for zAppend.
        +*/
        +static void appendText(ShellText *p, char const *zAppend, char quote){
        +  int len;
        +  int i;
        +  int nAppend = strlen30(zAppend);
        +
        +  len = nAppend+p->n+1;
        +  if( quote ){
        +    len += 2;
        +    for(i=0; in+len>=p->nAlloc ){
        +    p->nAlloc = p->nAlloc*2 + len + 20;
        +    p->z = realloc(p->z, p->nAlloc);
        +    if( p->z==0 ){
        +      memset(p, 0, sizeof(*p));
        +      return;
        +    }
        +  }
        +
        +  if( quote ){
        +    char *zCsr = p->z+p->n;
        +    *zCsr++ = quote;
        +    for(i=0; in = (int)(zCsr - p->z);
        +    *zCsr = '\0';
        +  }else{
        +    memcpy(p->z+p->n, zAppend, nAppend);
        +    p->n += nAppend;
        +    p->z[p->n] = '\0';
        +  }
        +}
        +
        +/*
        +** Attempt to determine if identifier zName needs to be quoted, either
        +** because it contains non-alphanumeric characters, or because it is an
        +** SQLite keyword.  Be conservative in this estimate:  When in doubt assume
        +** that quoting is required.
        +**
        +** Return '"' if quoting is required.  Return 0 if no quoting is required.
        +*/
        +static char quoteChar(const char *zName){
        +  /* All SQLite keywords, in alphabetical order */
        +  static const char *azKeywords[] = {
        +    "ABORT", "ACTION", "ADD", "AFTER", "ALL", "ALTER", "ANALYZE", "AND", "AS",
        +    "ASC", "ATTACH", "AUTOINCREMENT", "BEFORE", "BEGIN", "BETWEEN", "BY",
        +    "CASCADE", "CASE", "CAST", "CHECK", "COLLATE", "COLUMN", "COMMIT",
        +    "CONFLICT", "CONSTRAINT", "CREATE", "CROSS", "CURRENT_DATE",
        +    "CURRENT_TIME", "CURRENT_TIMESTAMP", "DATABASE", "DEFAULT", "DEFERRABLE",
        +    "DEFERRED", "DELETE", "DESC", "DETACH", "DISTINCT", "DROP", "EACH",
        +    "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUSIVE", "EXISTS", "EXPLAIN",
        +    "FAIL", "FOR", "FOREIGN", "FROM", "FULL", "GLOB", "GROUP", "HAVING", "IF",
        +    "IGNORE", "IMMEDIATE", "IN", "INDEX", "INDEXED", "INITIALLY", "INNER",
        +    "INSERT", "INSTEAD", "INTERSECT", "INTO", "IS", "ISNULL", "JOIN", "KEY",
        +    "LEFT", "LIKE", "LIMIT", "MATCH", "NATURAL", "NO", "NOT", "NOTNULL",
        +    "NULL", "OF", "OFFSET", "ON", "OR", "ORDER", "OUTER", "PLAN", "PRAGMA",
        +    "PRIMARY", "QUERY", "RAISE", "RECURSIVE", "REFERENCES", "REGEXP",
        +    "REINDEX", "RELEASE", "RENAME", "REPLACE", "RESTRICT", "RIGHT",
        +    "ROLLBACK", "ROW", "SAVEPOINT", "SELECT", "SET", "TABLE", "TEMP",
        +    "TEMPORARY", "THEN", "TO", "TRANSACTION", "TRIGGER", "UNION", "UNIQUE",
        +    "UPDATE", "USING", "VACUUM", "VALUES", "VIEW", "VIRTUAL", "WHEN", "WHERE",
        +    "WITH", "WITHOUT",
        +  };
        +  int i, lwr, upr, mid, c;
        +  if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"';
        +  for(i=0; zName[i]; i++){
        +    if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"';
        +  }
        +  lwr = 0;
        +  upr = sizeof(azKeywords)/sizeof(azKeywords[0]) - 1;
        +  while( lwr<=upr ){
        +    mid = (lwr+upr)/2;
        +    c = sqlite3_stricmp(azKeywords[mid], zName);
        +    if( c==0 ) return '"';
        +    if( c<0 ){
        +      lwr = mid+1;
        +    }else{
        +      upr = mid-1;
        +    }
        +  }
        +  return 0;
        +}
        +
        +/*
        +** SQL function:  shell_add_schema(S,X)
        +**
        +** Add the schema name X to the CREATE statement in S and return the result.
        +** Examples:
        +**
        +**    CREATE TABLE t1(x)   ->   CREATE TABLE xyz.t1(x);
        +**
        +** Also works on
        +**
        +**    CREATE INDEX
        +**    CREATE UNIQUE INDEX
        +**    CREATE VIEW
        +**    CREATE TRIGGER
        +**    CREATE VIRTUAL TABLE
        +**
        +** This UDF is used by the .schema command to insert the schema name of
        +** attached databases into the middle of the sqlite_master.sql field.
        +*/
        +static void shellAddSchemaName(
        +  sqlite3_context *pCtx,
        +  int nVal,
        +  sqlite3_value **apVal
        +){
        +  static const char *aPrefix[] = {
        +     "TABLE",
        +     "INDEX",
        +     "UNIQUE INDEX",
        +     "VIEW",
        +     "TRIGGER",
        +     "VIRTUAL TABLE"
        +  };
        +  int i = 0;
        +  const char *zIn = (const char*)sqlite3_value_text(apVal[0]);
        +  const char *zSchema = (const char*)sqlite3_value_text(apVal[1]);
        +  assert( nVal==2 );
        +  if( zIn!=0 && strncmp(zIn, "CREATE ", 7)==0 ){
        +    for(i=0; i<(int)(sizeof(aPrefix)/sizeof(aPrefix[0])); i++){
        +      int n = strlen30(aPrefix[i]);
        +      if( strncmp(zIn+7, aPrefix[i], n)==0 && zIn[n+7]==' ' ){
        +        char cQuote = quoteChar(zSchema);
        +        char *z;
        +        if( cQuote ){
        +         z = sqlite3_mprintf("%.*s \"%w\".%s", n+7, zIn, zSchema, zIn+n+8);
        +        }else{
        +          z = sqlite3_mprintf("%.*s %s.%s", n+7, zIn, zSchema, zIn+n+8);
        +        }
        +        sqlite3_result_text(pCtx, z, -1, sqlite3_free);
        +        return;
        +      }
        +    }
        +  }
        +  sqlite3_result_value(pCtx, apVal[0]);
        +}
        +
        +/*
        +** The source code for several run-time loadable extensions is inserted
        +** below by the ../tool/mkshellc.tcl script.  Before processing that included
        +** code, we need to override some macros to make the included program code
        +** work here in the middle of this regular program.
        +*/
        +#define SQLITE_EXTENSION_INIT1
        +#define SQLITE_EXTENSION_INIT2(X) (void)(X)
        +
        +/************************* Begin ../ext/misc/shathree.c ******************/
        +/*
        +** 2017-03-08
        +**
        +** 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 SQLite extension implements a functions that compute SHA1 hashes.
        +** Two SQL functions are implemented:
        +**
        +**     sha3(X,SIZE)
        +**     sha3_query(Y,SIZE)
        +**
        +** The sha3(X) function computes the SHA3 hash of the input X, or NULL if
        +** X is NULL.
        +**
        +** The sha3_query(Y) function evalutes all queries in the SQL statements of Y
        +** and returns a hash of their results.
        +**
        +** The SIZE argument is optional.  If omitted, the SHA3-256 hash algorithm
        +** is used.  If SIZE is included it must be one of the integers 224, 256,
        +** 384, or 512, to determine SHA3 hash variant that is computed.
        +*/
        +SQLITE_EXTENSION_INIT1
        +#include 
        +#include 
        +#include 
        +typedef sqlite3_uint64 u64;
        +
        +/******************************************************************************
        +** The Hash Engine
        +*/
        +/*
        +** Macros to determine whether the machine is big or little endian,
        +** and whether or not that determination is run-time or compile-time.
        +**
        +** For best performance, an attempt is made to guess at the byte-order
        +** using C-preprocessor macros.  If that is unsuccessful, or if
        +** -DSHA3_BYTEORDER=0 is set, then byte-order is determined
        +** at run-time.
        +*/
        +#ifndef SHA3_BYTEORDER
        +# if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
        +     defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
        +     defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
        +     defined(__arm__)
        +#   define SHA3_BYTEORDER    1234
        +# elif defined(sparc)    || defined(__ppc__)
        +#   define SHA3_BYTEORDER    4321
        +# else
        +#   define SHA3_BYTEORDER 0
        +# endif
        +#endif
        +
        +
        +/*
        +** State structure for a SHA3 hash in progress
        +*/
        +typedef struct SHA3Context SHA3Context;
        +struct SHA3Context {
        +  union {
        +    u64 s[25];                /* Keccak state. 5x5 lines of 64 bits each */
        +    unsigned char x[1600];    /* ... or 1600 bytes */
        +  } u;
        +  unsigned nRate;        /* Bytes of input accepted per Keccak iteration */
        +  unsigned nLoaded;      /* Input bytes loaded into u.x[] so far this cycle */
        +  unsigned ixMask;       /* Insert next input into u.x[nLoaded^ixMask]. */
        +};
        +
        +/*
        +** A single step of the Keccak mixing function for a 1600-bit state
        +*/
        +static void KeccakF1600Step(SHA3Context *p){
        +  int i;
        +  u64 B0, B1, B2, B3, B4;
        +  u64 C0, C1, C2, C3, C4;
        +  u64 D0, D1, D2, D3, D4;
        +  static const u64 RC[] = {
        +    0x0000000000000001ULL,  0x0000000000008082ULL,
        +    0x800000000000808aULL,  0x8000000080008000ULL,
        +    0x000000000000808bULL,  0x0000000080000001ULL,
        +    0x8000000080008081ULL,  0x8000000000008009ULL,
        +    0x000000000000008aULL,  0x0000000000000088ULL,
        +    0x0000000080008009ULL,  0x000000008000000aULL,
        +    0x000000008000808bULL,  0x800000000000008bULL,
        +    0x8000000000008089ULL,  0x8000000000008003ULL,
        +    0x8000000000008002ULL,  0x8000000000000080ULL,
        +    0x000000000000800aULL,  0x800000008000000aULL,
        +    0x8000000080008081ULL,  0x8000000000008080ULL,
        +    0x0000000080000001ULL,  0x8000000080008008ULL
        +  };
        +# define A00 (p->u.s[0])
        +# define A01 (p->u.s[1])
        +# define A02 (p->u.s[2])
        +# define A03 (p->u.s[3])
        +# define A04 (p->u.s[4])
        +# define A10 (p->u.s[5])
        +# define A11 (p->u.s[6])
        +# define A12 (p->u.s[7])
        +# define A13 (p->u.s[8])
        +# define A14 (p->u.s[9])
        +# define A20 (p->u.s[10])
        +# define A21 (p->u.s[11])
        +# define A22 (p->u.s[12])
        +# define A23 (p->u.s[13])
        +# define A24 (p->u.s[14])
        +# define A30 (p->u.s[15])
        +# define A31 (p->u.s[16])
        +# define A32 (p->u.s[17])
        +# define A33 (p->u.s[18])
        +# define A34 (p->u.s[19])
        +# define A40 (p->u.s[20])
        +# define A41 (p->u.s[21])
        +# define A42 (p->u.s[22])
        +# define A43 (p->u.s[23])
        +# define A44 (p->u.s[24])
        +# define ROL64(a,x) ((a<>(64-x)))
        +
        +  for(i=0; i<24; i+=4){
        +    C0 = A00^A10^A20^A30^A40;
        +    C1 = A01^A11^A21^A31^A41;
        +    C2 = A02^A12^A22^A32^A42;
        +    C3 = A03^A13^A23^A33^A43;
        +    C4 = A04^A14^A24^A34^A44;
        +    D0 = C4^ROL64(C1, 1);
        +    D1 = C0^ROL64(C2, 1);
        +    D2 = C1^ROL64(C3, 1);
        +    D3 = C2^ROL64(C4, 1);
        +    D4 = C3^ROL64(C0, 1);
        +
        +    B0 = (A00^D0);
        +    B1 = ROL64((A11^D1), 44);
        +    B2 = ROL64((A22^D2), 43);
        +    B3 = ROL64((A33^D3), 21);
        +    B4 = ROL64((A44^D4), 14);
        +    A00 =   B0 ^((~B1)&  B2 );
        +    A00 ^= RC[i];
        +    A11 =   B1 ^((~B2)&  B3 );
        +    A22 =   B2 ^((~B3)&  B4 );
        +    A33 =   B3 ^((~B4)&  B0 );
        +    A44 =   B4 ^((~B0)&  B1 );
        +
        +    B2 = ROL64((A20^D0), 3);
        +    B3 = ROL64((A31^D1), 45);
        +    B4 = ROL64((A42^D2), 61);
        +    B0 = ROL64((A03^D3), 28);
        +    B1 = ROL64((A14^D4), 20);
        +    A20 =   B0 ^((~B1)&  B2 );
        +    A31 =   B1 ^((~B2)&  B3 );
        +    A42 =   B2 ^((~B3)&  B4 );
        +    A03 =   B3 ^((~B4)&  B0 );
        +    A14 =   B4 ^((~B0)&  B1 );
        +
        +    B4 = ROL64((A40^D0), 18);
        +    B0 = ROL64((A01^D1), 1);
        +    B1 = ROL64((A12^D2), 6);
        +    B2 = ROL64((A23^D3), 25);
        +    B3 = ROL64((A34^D4), 8);
        +    A40 =   B0 ^((~B1)&  B2 );
        +    A01 =   B1 ^((~B2)&  B3 );
        +    A12 =   B2 ^((~B3)&  B4 );
        +    A23 =   B3 ^((~B4)&  B0 );
        +    A34 =   B4 ^((~B0)&  B1 );
        +
        +    B1 = ROL64((A10^D0), 36);
        +    B2 = ROL64((A21^D1), 10);
        +    B3 = ROL64((A32^D2), 15);
        +    B4 = ROL64((A43^D3), 56);
        +    B0 = ROL64((A04^D4), 27);
        +    A10 =   B0 ^((~B1)&  B2 );
        +    A21 =   B1 ^((~B2)&  B3 );
        +    A32 =   B2 ^((~B3)&  B4 );
        +    A43 =   B3 ^((~B4)&  B0 );
        +    A04 =   B4 ^((~B0)&  B1 );
        +
        +    B3 = ROL64((A30^D0), 41);
        +    B4 = ROL64((A41^D1), 2);
        +    B0 = ROL64((A02^D2), 62);
        +    B1 = ROL64((A13^D3), 55);
        +    B2 = ROL64((A24^D4), 39);
        +    A30 =   B0 ^((~B1)&  B2 );
        +    A41 =   B1 ^((~B2)&  B3 );
        +    A02 =   B2 ^((~B3)&  B4 );
        +    A13 =   B3 ^((~B4)&  B0 );
        +    A24 =   B4 ^((~B0)&  B1 );
        +
        +    C0 = A00^A20^A40^A10^A30;
        +    C1 = A11^A31^A01^A21^A41;
        +    C2 = A22^A42^A12^A32^A02;
        +    C3 = A33^A03^A23^A43^A13;
        +    C4 = A44^A14^A34^A04^A24;
        +    D0 = C4^ROL64(C1, 1);
        +    D1 = C0^ROL64(C2, 1);
        +    D2 = C1^ROL64(C3, 1);
        +    D3 = C2^ROL64(C4, 1);
        +    D4 = C3^ROL64(C0, 1);
        +
        +    B0 = (A00^D0);
        +    B1 = ROL64((A31^D1), 44);
        +    B2 = ROL64((A12^D2), 43);
        +    B3 = ROL64((A43^D3), 21);
        +    B4 = ROL64((A24^D4), 14);
        +    A00 =   B0 ^((~B1)&  B2 );
        +    A00 ^= RC[i+1];
        +    A31 =   B1 ^((~B2)&  B3 );
        +    A12 =   B2 ^((~B3)&  B4 );
        +    A43 =   B3 ^((~B4)&  B0 );
        +    A24 =   B4 ^((~B0)&  B1 );
        +
        +    B2 = ROL64((A40^D0), 3);
        +    B3 = ROL64((A21^D1), 45);
        +    B4 = ROL64((A02^D2), 61);
        +    B0 = ROL64((A33^D3), 28);
        +    B1 = ROL64((A14^D4), 20);
        +    A40 =   B0 ^((~B1)&  B2 );
        +    A21 =   B1 ^((~B2)&  B3 );
        +    A02 =   B2 ^((~B3)&  B4 );
        +    A33 =   B3 ^((~B4)&  B0 );
        +    A14 =   B4 ^((~B0)&  B1 );
        +
        +    B4 = ROL64((A30^D0), 18);
        +    B0 = ROL64((A11^D1), 1);
        +    B1 = ROL64((A42^D2), 6);
        +    B2 = ROL64((A23^D3), 25);
        +    B3 = ROL64((A04^D4), 8);
        +    A30 =   B0 ^((~B1)&  B2 );
        +    A11 =   B1 ^((~B2)&  B3 );
        +    A42 =   B2 ^((~B3)&  B4 );
        +    A23 =   B3 ^((~B4)&  B0 );
        +    A04 =   B4 ^((~B0)&  B1 );
        +
        +    B1 = ROL64((A20^D0), 36);
        +    B2 = ROL64((A01^D1), 10);
        +    B3 = ROL64((A32^D2), 15);
        +    B4 = ROL64((A13^D3), 56);
        +    B0 = ROL64((A44^D4), 27);
        +    A20 =   B0 ^((~B1)&  B2 );
        +    A01 =   B1 ^((~B2)&  B3 );
        +    A32 =   B2 ^((~B3)&  B4 );
        +    A13 =   B3 ^((~B4)&  B0 );
        +    A44 =   B4 ^((~B0)&  B1 );
        +
        +    B3 = ROL64((A10^D0), 41);
        +    B4 = ROL64((A41^D1), 2);
        +    B0 = ROL64((A22^D2), 62);
        +    B1 = ROL64((A03^D3), 55);
        +    B2 = ROL64((A34^D4), 39);
        +    A10 =   B0 ^((~B1)&  B2 );
        +    A41 =   B1 ^((~B2)&  B3 );
        +    A22 =   B2 ^((~B3)&  B4 );
        +    A03 =   B3 ^((~B4)&  B0 );
        +    A34 =   B4 ^((~B0)&  B1 );
        +
        +    C0 = A00^A40^A30^A20^A10;
        +    C1 = A31^A21^A11^A01^A41;
        +    C2 = A12^A02^A42^A32^A22;
        +    C3 = A43^A33^A23^A13^A03;
        +    C4 = A24^A14^A04^A44^A34;
        +    D0 = C4^ROL64(C1, 1);
        +    D1 = C0^ROL64(C2, 1);
        +    D2 = C1^ROL64(C3, 1);
        +    D3 = C2^ROL64(C4, 1);
        +    D4 = C3^ROL64(C0, 1);
        +
        +    B0 = (A00^D0);
        +    B1 = ROL64((A21^D1), 44);
        +    B2 = ROL64((A42^D2), 43);
        +    B3 = ROL64((A13^D3), 21);
        +    B4 = ROL64((A34^D4), 14);
        +    A00 =   B0 ^((~B1)&  B2 );
        +    A00 ^= RC[i+2];
        +    A21 =   B1 ^((~B2)&  B3 );
        +    A42 =   B2 ^((~B3)&  B4 );
        +    A13 =   B3 ^((~B4)&  B0 );
        +    A34 =   B4 ^((~B0)&  B1 );
        +
        +    B2 = ROL64((A30^D0), 3);
        +    B3 = ROL64((A01^D1), 45);
        +    B4 = ROL64((A22^D2), 61);
        +    B0 = ROL64((A43^D3), 28);
        +    B1 = ROL64((A14^D4), 20);
        +    A30 =   B0 ^((~B1)&  B2 );
        +    A01 =   B1 ^((~B2)&  B3 );
        +    A22 =   B2 ^((~B3)&  B4 );
        +    A43 =   B3 ^((~B4)&  B0 );
        +    A14 =   B4 ^((~B0)&  B1 );
        +
        +    B4 = ROL64((A10^D0), 18);
        +    B0 = ROL64((A31^D1), 1);
        +    B1 = ROL64((A02^D2), 6);
        +    B2 = ROL64((A23^D3), 25);
        +    B3 = ROL64((A44^D4), 8);
        +    A10 =   B0 ^((~B1)&  B2 );
        +    A31 =   B1 ^((~B2)&  B3 );
        +    A02 =   B2 ^((~B3)&  B4 );
        +    A23 =   B3 ^((~B4)&  B0 );
        +    A44 =   B4 ^((~B0)&  B1 );
        +
        +    B1 = ROL64((A40^D0), 36);
        +    B2 = ROL64((A11^D1), 10);
        +    B3 = ROL64((A32^D2), 15);
        +    B4 = ROL64((A03^D3), 56);
        +    B0 = ROL64((A24^D4), 27);
        +    A40 =   B0 ^((~B1)&  B2 );
        +    A11 =   B1 ^((~B2)&  B3 );
        +    A32 =   B2 ^((~B3)&  B4 );
        +    A03 =   B3 ^((~B4)&  B0 );
        +    A24 =   B4 ^((~B0)&  B1 );
        +
        +    B3 = ROL64((A20^D0), 41);
        +    B4 = ROL64((A41^D1), 2);
        +    B0 = ROL64((A12^D2), 62);
        +    B1 = ROL64((A33^D3), 55);
        +    B2 = ROL64((A04^D4), 39);
        +    A20 =   B0 ^((~B1)&  B2 );
        +    A41 =   B1 ^((~B2)&  B3 );
        +    A12 =   B2 ^((~B3)&  B4 );
        +    A33 =   B3 ^((~B4)&  B0 );
        +    A04 =   B4 ^((~B0)&  B1 );
        +
        +    C0 = A00^A30^A10^A40^A20;
        +    C1 = A21^A01^A31^A11^A41;
        +    C2 = A42^A22^A02^A32^A12;
        +    C3 = A13^A43^A23^A03^A33;
        +    C4 = A34^A14^A44^A24^A04;
        +    D0 = C4^ROL64(C1, 1);
        +    D1 = C0^ROL64(C2, 1);
        +    D2 = C1^ROL64(C3, 1);
        +    D3 = C2^ROL64(C4, 1);
        +    D4 = C3^ROL64(C0, 1);
        +
        +    B0 = (A00^D0);
        +    B1 = ROL64((A01^D1), 44);
        +    B2 = ROL64((A02^D2), 43);
        +    B3 = ROL64((A03^D3), 21);
        +    B4 = ROL64((A04^D4), 14);
        +    A00 =   B0 ^((~B1)&  B2 );
        +    A00 ^= RC[i+3];
        +    A01 =   B1 ^((~B2)&  B3 );
        +    A02 =   B2 ^((~B3)&  B4 );
        +    A03 =   B3 ^((~B4)&  B0 );
        +    A04 =   B4 ^((~B0)&  B1 );
        +
        +    B2 = ROL64((A10^D0), 3);
        +    B3 = ROL64((A11^D1), 45);
        +    B4 = ROL64((A12^D2), 61);
        +    B0 = ROL64((A13^D3), 28);
        +    B1 = ROL64((A14^D4), 20);
        +    A10 =   B0 ^((~B1)&  B2 );
        +    A11 =   B1 ^((~B2)&  B3 );
        +    A12 =   B2 ^((~B3)&  B4 );
        +    A13 =   B3 ^((~B4)&  B0 );
        +    A14 =   B4 ^((~B0)&  B1 );
        +
        +    B4 = ROL64((A20^D0), 18);
        +    B0 = ROL64((A21^D1), 1);
        +    B1 = ROL64((A22^D2), 6);
        +    B2 = ROL64((A23^D3), 25);
        +    B3 = ROL64((A24^D4), 8);
        +    A20 =   B0 ^((~B1)&  B2 );
        +    A21 =   B1 ^((~B2)&  B3 );
        +    A22 =   B2 ^((~B3)&  B4 );
        +    A23 =   B3 ^((~B4)&  B0 );
        +    A24 =   B4 ^((~B0)&  B1 );
        +
        +    B1 = ROL64((A30^D0), 36);
        +    B2 = ROL64((A31^D1), 10);
        +    B3 = ROL64((A32^D2), 15);
        +    B4 = ROL64((A33^D3), 56);
        +    B0 = ROL64((A34^D4), 27);
        +    A30 =   B0 ^((~B1)&  B2 );
        +    A31 =   B1 ^((~B2)&  B3 );
        +    A32 =   B2 ^((~B3)&  B4 );
        +    A33 =   B3 ^((~B4)&  B0 );
        +    A34 =   B4 ^((~B0)&  B1 );
        +
        +    B3 = ROL64((A40^D0), 41);
        +    B4 = ROL64((A41^D1), 2);
        +    B0 = ROL64((A42^D2), 62);
        +    B1 = ROL64((A43^D3), 55);
        +    B2 = ROL64((A44^D4), 39);
        +    A40 =   B0 ^((~B1)&  B2 );
        +    A41 =   B1 ^((~B2)&  B3 );
        +    A42 =   B2 ^((~B3)&  B4 );
        +    A43 =   B3 ^((~B4)&  B0 );
        +    A44 =   B4 ^((~B0)&  B1 );
        +  }
        +}
        +
        +/*
        +** Initialize a new hash.  iSize determines the size of the hash
        +** in bits and should be one of 224, 256, 384, or 512.  Or iSize
        +** can be zero to use the default hash size of 256 bits.
        +*/
        +static void SHA3Init(SHA3Context *p, int iSize){
        +  memset(p, 0, sizeof(*p));
        +  if( iSize>=128 && iSize<=512 ){
        +    p->nRate = (1600 - ((iSize + 31)&~31)*2)/8;
        +  }else{
        +    p->nRate = (1600 - 2*256)/8;
        +  }
        +#if SHA3_BYTEORDER==1234
        +  /* Known to be little-endian at compile-time. No-op */
        +#elif SHA3_BYTEORDER==4321
        +  p->ixMask = 7;  /* Big-endian */
        +#else
        +  {
        +    static unsigned int one = 1;
        +    if( 1==*(unsigned char*)&one ){
        +      /* Little endian.  No byte swapping. */
        +      p->ixMask = 0;
        +    }else{
        +      /* Big endian.  Byte swap. */
        +      p->ixMask = 7;
        +    }
        +  }
        +#endif
        +}
        +
        +/*
        +** Make consecutive calls to the SHA3Update function to add new content
        +** to the hash
        +*/
        +static void SHA3Update(
        +  SHA3Context *p,
        +  const unsigned char *aData,
        +  unsigned int nData
        +){
        +  unsigned int i = 0;
        +#if SHA3_BYTEORDER==1234
        +  if( (p->nLoaded % 8)==0 && ((aData - (const unsigned char*)0)&7)==0 ){
        +    for(; i+7u.s[p->nLoaded/8] ^= *(u64*)&aData[i];
        
        *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
        
        From owner-svn-src-stable@freebsd.org  Sat Aug 12 23:40:03 2017
        Return-Path: 
        Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
        Received: from mx1.freebsd.org (mx1.freebsd.org
         [IPv6:2001:1900:2254:206a::19:1])
         by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E4A0DD1F53;
         Sat, 12 Aug 2017 23:40:03 +0000 (UTC)
         (envelope-from ngie@FreeBSD.org)
        Received: from repo.freebsd.org (repo.freebsd.org
         [IPv6:2610:1c1:1:6068::e6a:0])
         (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 0B13D769B2;
         Sat, 12 Aug 2017 23:40:02 +0000 (UTC)
         (envelope-from ngie@FreeBSD.org)
        Received: from repo.freebsd.org ([127.0.1.37])
         by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7CNe2o8042763;
         Sat, 12 Aug 2017 23:40:02 GMT (envelope-from ngie@FreeBSD.org)
        Received: (from ngie@localhost)
         by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7CNe2HX042762;
         Sat, 12 Aug 2017 23:40:02 GMT (envelope-from ngie@FreeBSD.org)
        Message-Id: <201708122340.v7CNe2HX042762@repo.freebsd.org>
        X-Authentication-Warning: repo.freebsd.org: ngie set sender to
         ngie@FreeBSD.org using -f
        From: Ngie Cooper 
        Date: Sat, 12 Aug 2017 23:40:02 +0000 (UTC)
        To: src-committers@freebsd.org, svn-src-all@freebsd.org,
         svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
        Subject: svn commit: r322446 - stable/11/lib/libxo/tests
        X-SVN-Group: stable-11
        X-SVN-Commit-Author: ngie
        X-SVN-Commit-Paths: stable/11/lib/libxo/tests
        X-SVN-Commit-Revision: 322446
        X-SVN-Commit-Repository: base
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit
        X-BeenThere: svn-src-stable@freebsd.org
        X-Mailman-Version: 2.1.23
        Precedence: list
        List-Id: SVN commit messages for all the -stable branches of the src tree
         
        List-Unsubscribe: , 
         
        List-Archive: 
        List-Post: 
        List-Help: 
        List-Subscribe: ,
         
        X-List-Received-Date: Sat, 12 Aug 2017 23:40:03 -0000
        
        Author: ngie
        Date: Sat Aug 12 23:40:01 2017
        New Revision: 322446
        URL: https://svnweb.freebsd.org/changeset/base/322446
        
        Log:
          MFC r322023:
          
          Remove special-case logic for running tests on host machines
          
          I'm not sure what process sjg@ was using, but using CHECKDIR=${.OBJDIR} with
          "make check" on ^/head is the correct thing to do. This unbreaks "make check"
          for me (unsandboxed, not using CHECKDIR=${.OBJDIR}).
          
          While here, fix a whitespace nit with LIBADD.
        
        Modified:
          stable/11/lib/libxo/tests/Makefile
        Directory Properties:
          stable/11/   (props changed)
        
        Modified: stable/11/lib/libxo/tests/Makefile
        ==============================================================================
        --- stable/11/lib/libxo/tests/Makefile	Sat Aug 12 22:20:08 2017	(r322445)
        +++ stable/11/lib/libxo/tests/Makefile	Sat Aug 12 23:40:01 2017	(r322446)
        @@ -242,13 +242,8 @@ PROGS+= test_11
         
         CFLAGS+=	-I${LIBXOSRC}/libxo -I${.CURDIR:H}
         
        -LIBADD=		xo util 
        +LIBADD=		xo util
         
         SUBDIR+=	encoder
        -
        -.if ${MACHINE} == "host"
        -# make it easy to test without install
        -TESTSDIR=	${.OBJDIR}
        -.endif
         
         .include