From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 25 12:27:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECC79236; Sun, 25 Nov 2012 12:27:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D10ED8FC17; Sun, 25 Nov 2012 12:27:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPCRJOx059046; Sun, 25 Nov 2012 12:27:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPCRJmm059045; Sun, 25 Nov 2012 12:27:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211251227.qAPCRJmm059045@svn.freebsd.org> From: Dimitry Andric Date: Sun, 25 Nov 2012 12:27:19 +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: r243511 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 12:27:20 -0000 Author: dim Date: Sun Nov 25 12:27:19 2012 New Revision: 243511 URL: http://svnweb.freebsd.org/changeset/base/243511 Log: MFC r243348: Do not expose LIBCXXRT and LIBCPLUSPLUS in bsd.libnames.mk, if WITHOUT_LIBCPLUSPLUS is specified. Submitted by: Garrett Cooper Modified: stable/9/share/mk/bsd.libnames.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.libnames.mk ============================================================================== --- stable/9/share/mk/bsd.libnames.mk Sun Nov 25 12:19:17 2012 (r243510) +++ stable/9/share/mk/bsd.libnames.mk Sun Nov 25 12:27:19 2012 (r243511) @@ -26,8 +26,10 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxm LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a +.if ${MK_LIBCPLUSPLUS} != "no" LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a +.endif LIBC?= ${DESTDIR}${LIBDIR}/libc.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 01:57:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94F92C98; Mon, 26 Nov 2012 01:57:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7974C8FC0C; Mon, 26 Nov 2012 01:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ1vMhM067470; Mon, 26 Nov 2012 01:57:22 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ1vMxE067469; Mon, 26 Nov 2012 01:57:22 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201211260157.qAQ1vMxE067469@svn.freebsd.org> From: Sean Bruno Date: Mon, 26 Nov 2012 01:57:22 +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: r243534 - stable/9/sys/dev/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 01:57:22 -0000 Author: sbruno Date: Mon Nov 26 01:57:22 2012 New Revision: 243534 URL: http://svnweb.freebsd.org/changeset/base/243534 Log: MFC 242922 Update MAX_TASKS to scale a bit based on MAXCPU This alleviates issues on newer Sandy/Ivy Bridge gear that seems to require boatloads more ACPI resources than before. Modified: stable/9/sys/dev/acpica/acpivar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpivar.h ============================================================================== --- stable/9/sys/dev/acpica/acpivar.h Mon Nov 26 01:54:00 2012 (r243533) +++ stable/9/sys/dev/acpica/acpivar.h Mon Nov 26 01:57:22 2012 (r243534) @@ -476,7 +476,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL /* Default maximum number of tasks to enqueue. */ #ifndef ACPI_MAX_TASKS -#define ACPI_MAX_TASKS 32 +#define ACPI_MAX_TASKS MAX(32, MAXCPU * 2) #endif /* Default number of task queue threads to start. */ From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 02:31:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AD306A5; Mon, 26 Nov 2012 02:31:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 001F18FC0C; Mon, 26 Nov 2012 02:31:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2VSW0073040; Mon, 26 Nov 2012 02:31:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2VSJ2073039; Mon, 26 Nov 2012 02:31:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260231.qAQ2VSJ2073039@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 02:31:28 +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: r243536 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:31:29 -0000 Author: yongari Date: Mon Nov 26 02:31:28 2012 New Revision: 243536 URL: http://svnweb.freebsd.org/changeset/base/243536 Log: MFC r241215-241216,241219-241220,241341,241343: r241215: Don't touch EMAC Mode and TX/RX MAC Mode register when driver is not running. r241216: APE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep the MAC connected to the outside world. So keep the accesses atomic. r241219: Add 40 microseconds delay after updating EMAC Mode register as recommended by Broadcom data sheet. r241220: Follow Broadcom datasheet: Delay 100 microseconds after enabling transmit MAC. Delay 10 microseconds after enabling receive MAC. r241341: Limit applying TX data corruption and FIFO workaround to BCM5719 A0. It's believed BCM5720 does not have the issue. r241343: Rework device detach. While here, move driver lock/callout initialization to the beginning of device attach for readability. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:04:11 2012 (r243535) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:31:28 2012 (r243536) @@ -896,7 +896,11 @@ bge_miibus_statchg(device_t dev) { struct bge_softc *sc; struct mii_data *mii; + uint32_t mac_mode, rx_mode, tx_mode; + sc = device_get_softc(dev); + if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; mii = device_get_softc(sc->bge_miibus); if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == @@ -922,30 +926,40 @@ bge_miibus_statchg(device_t dev) sc->bge_link = 0; if (sc->bge_link == 0) return; - BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); + + /* + * APE firmware touches these registers to keep the MAC + * connected to the outside world. Try to keep the + * accesses atomic. + */ + + /* Set the port mode (MII/GMII) to match the link speed. */ + mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & + ~(BGE_MACMODE_PORTMODE | BGE_MACMODE_HALF_DUPLEX); + tx_mode = CSR_READ_4(sc, BGE_TX_MODE); + rx_mode = CSR_READ_4(sc, BGE_RX_MODE); + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); + mac_mode |= BGE_PORTMODE_GMII; else - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); + mac_mode |= BGE_PORTMODE_MII; + /* Set MAC flow control behavior to match link flow control settings. */ + tx_mode &= ~BGE_TXMODE_FLOWCTL_ENABLE; + rx_mode &= ~BGE_RXMODE_FLOWCTL_ENABLE; if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { - BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); - if ((IFM_OPTIONS(mii->mii_media_active) & - IFM_ETH_TXPAUSE) != 0) - BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - else - BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - if ((IFM_OPTIONS(mii->mii_media_active) & - IFM_ETH_RXPAUSE) != 0) - BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - else - BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - } else { - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); - BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - } + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + tx_mode |= BGE_TXMODE_FLOWCTL_ENABLE; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + rx_mode |= BGE_RXMODE_FLOWCTL_ENABLE; + } else + mac_mode |= BGE_MACMODE_HALF_DUPLEX; + + CSR_WRITE_4(sc, BGE_MAC_MODE, mac_mode); + DELAY(40); + CSR_WRITE_4(sc, BGE_TX_MODE, tx_mode); + CSR_WRITE_4(sc, BGE_RX_MODE, rx_mode); } /* @@ -1421,6 +1435,7 @@ bge_chipinit(struct bge_softc *sc) /* Clear the MAC control register */ CSR_WRITE_4(sc, BGE_MAC_MODE, 0); + DELAY(40); /* * Clear the MAC statistics block in the NIC's @@ -2033,6 +2048,7 @@ bge_blockinit(struct bge_softc *sc) /* Turn on DMA, clear stats */ CSR_WRITE_4(sc, BGE_MAC_MODE, val); + DELAY(40); /* Set misc. local control, enable interrupts on attentions */ CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN); @@ -2105,8 +2121,8 @@ bge_blockinit(struct bge_softc *sc) * Adjust tx margin to prevent TX data corruption and * fix internal FIFO overflow. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || - sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | BGE_RDMA_RSRVCTRL_TXMRGN_MASK); @@ -2884,7 +2900,9 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + BGE_LOCK_INIT(sc, device_get_nameunit(dev)); TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); + callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); /* * Map control/status registers. @@ -3243,8 +3261,6 @@ bge_attach(device_t dev) bge_devinfo(sc); - BGE_LOCK_INIT(sc, device_get_nameunit(dev)); - /* Try to reset the chip. */ if (bge_reset(sc)) { device_printf(sc->bge_dev, "chip reset failed\n"); @@ -3448,7 +3464,6 @@ again: * Call MI attach routine. */ ether_ifattach(ifp, eaddr); - callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); /* Tell upper layer we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); @@ -3465,7 +3480,7 @@ again: if (sc->bge_tq == NULL) { device_printf(dev, "could not create taskqueue.\n"); ether_ifdetach(ifp); - error = ENXIO; + error = ENOMEM; goto fail; } taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", @@ -3473,23 +3488,19 @@ again: error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, &sc->bge_intrhand); - if (error) - ether_ifdetach(ifp); } else error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, &sc->bge_intrhand); if (error) { - bge_detach(dev); + ether_ifdetach(ifp); device_printf(sc->bge_dev, "couldn't set up irq\n"); } - return (0); - fail: - bge_release_resources(sc); - + if (error) + bge_detach(dev); return (error); } @@ -3507,16 +3518,16 @@ bge_detach(device_t dev) ether_poll_deregister(ifp); #endif - BGE_LOCK(sc); - bge_stop(sc); - bge_reset(sc); - BGE_UNLOCK(sc); - - callout_drain(&sc->bge_stat_ch); + if (device_is_attached(dev)) { + ether_ifdetach(ifp); + BGE_LOCK(sc); + bge_stop(sc); + BGE_UNLOCK(sc); + callout_drain(&sc->bge_stat_ch); + } if (sc->bge_tq) taskqueue_drain(sc->bge_tq, &sc->bge_intr_task); - ether_ifdetach(ifp); if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_removeall(&sc->bge_ifmedia); @@ -3764,6 +3775,7 @@ bge_reset(struct bge_softc *sc) BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); CSR_WRITE_4(sc, BGE_MAC_MODE, 0); + DELAY(40); /* * The 5704 in TBI mode apparently needs some special @@ -5041,9 +5053,11 @@ bge_init_locked(struct bge_softc *sc) } /* Turn on transmitter. */ CSR_WRITE_4(sc, BGE_TX_MODE, mode | BGE_TXMODE_ENABLE); + DELAY(100); /* Turn on receiver. */ BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); + DELAY(10); /* * Set the number of good frames to receive after RX MBUF @@ -5079,11 +5093,11 @@ bge_init_locked(struct bge_softc *sc) bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); } - bge_ifmedia_upd_locked(ifp); - ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + bge_ifmedia_upd_locked(ifp); + callout_reset(&sc->bge_stat_ch, hz, bge_tick, sc); } @@ -5160,6 +5174,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); } + DELAY(40); break; default: return (EINVAL); @@ -5635,9 +5650,11 @@ bge_link_upd(struct bge_softc *sc) if (status & BGE_MACSTAT_TBI_PCS_SYNCHED) { if (!sc->bge_link) { sc->bge_link++; - if (sc->bge_asicrev == BGE_ASICREV_BCM5704) + if (sc->bge_asicrev == BGE_ASICREV_BCM5704) { BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_TBI_SEND_CFGS); + DELAY(40); + } CSR_WRITE_4(sc, BGE_MAC_STS, 0xFFFFFFFF); if (bootverbose) if_printf(sc->bge_ifp, "link UP\n"); From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 02:41:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F07BBC3; Mon, 26 Nov 2012 02:41:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1452B8FC08; Mon, 26 Nov 2012 02:41:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2fUKa074746; Mon, 26 Nov 2012 02:41:30 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2fU7w074744; Mon, 26 Nov 2012 02:41:30 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260241.qAQ2fU7w074744@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 02:41:30 +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: r243538 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:41:31 -0000 Author: yongari Date: Mon Nov 26 02:41:30 2012 New Revision: 243538 URL: http://svnweb.freebsd.org/changeset/base/243538 Log: MFC r241388-241393: r241388: If the maximum payload size is 256 bytes or more, set the DMA write water mark to 256 bytes. Otherwise controller will encounter DMA write under run errors and would result in RX DMA hang. If the maximum payload size is 128 bytes, the water mark is set to 128 bytes as usual. While here, set maximum read request size to 2048 for BCM5719/BCM5720. For other PCIe devices, use 4096. And reprogram the maximum read request size whenever device reset is performed. r241389: On PHY write error use hex number to show the value. Add more comments. r241390: Honor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720. r241391: Do not force PCIe 1.0a mode in device reset on BCM5717 and newer controllers. BCM5785 does not require PCI 1.0a mode as well during reset. r241392: Fix a long standing VCPU reset sequence bug on BCM5906. The VCPU(Virtual CPU) of BCM5906 is used to provide a mechanism to control the bootcode execution and to pick up configuration data stored inside the EEPROM. The bootcode of BCM5906 will check the BGE_VCPU_STATUS_DRV_RESET bit to decide which booting procedure to choose. Data sheet indicates the VCPU of BCM5906 should set BGE_VCPU_STATUS_DRV_RESET bit *before* VCPU reset or global reset. r241393: Remove unnecessary delay. I don't see any comments in data sheet that requires 10ms delay after device reset. Because that code was there from day 1, I guess it was added to give enough settlement time after updating BGE_MAC_MODE register. The recommended delay time for BGE_MAC_MODE after updating is 40us and it was already done in r241219. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:32:32 2012 (r243537) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:41:30 2012 (r243538) @@ -885,7 +885,7 @@ bge_miibus_writereg(device_t dev, int ph if (i == BGE_TIMEOUT) device_printf(sc->bge_dev, - "PHY write timed out (phy %d, reg %d, val %d)\n", + "PHY write timed out (phy %d, reg %d, val 0x%04x)\n", phy, reg, val); return (0); @@ -1466,8 +1466,10 @@ bge_chipinit(struct bge_softc *sc) dma_rw_ctl = BGE_PCIDMARWCTL_RD_CMD_SHIFT(6) | BGE_PCIDMARWCTL_WR_CMD_SHIFT(7); if (sc->bge_flags & BGE_FLAG_PCIE) { - /* Read watermark not used, 128 bytes for write. */ - dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(3); + if (sc->bge_mps >= 256) + dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(7); + else + dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(3); } else if (sc->bge_flags & BGE_FLAG_PCIX) { if (BGE_IS_5714_FAMILY(sc)) { /* 256 bytes for read and write. */ @@ -2034,6 +2036,7 @@ bge_blockinit(struct bge_softc *sc) if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); + /* Turn on DMA, clear stats. */ val = BGE_MACMODE_TXDMA_ENB | BGE_MACMODE_RXDMA_ENB | BGE_MACMODE_RX_STATS_CLEAR | BGE_MACMODE_TX_STATS_CLEAR | BGE_MACMODE_RX_STATS_ENB | BGE_MACMODE_TX_STATS_ENB | @@ -2046,7 +2049,6 @@ bge_blockinit(struct bge_softc *sc) else val |= BGE_PORTMODE_MII; - /* Turn on DMA, clear stats */ CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); @@ -3186,11 +3188,16 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; + /* Extract supported maximum payload size. */ + sc->bge_mps = pci_read_config(dev, sc->bge_expcap + + PCIER_DEVICE_CAP, 2); + sc->bge_mps = 128 << (sc->bge_mps & PCIEM_CAP_MAX_PAYLOAD); if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || sc->bge_asicrev == BGE_ASICREV_BCM5720) - pci_set_max_read_req(dev, 2048); - else if (pci_get_max_read_req(dev) != 4096) - pci_set_max_read_req(dev, 4096); + sc->bge_expmrq = 2048; + else + sc->bge_expmrq = 4096; + pci_set_max_read_req(dev, sc->bge_expmrq); } else { /* * Check if the device is in PCI-X Mode. @@ -3399,7 +3406,7 @@ bge_attach(device_t dev) /* The SysKonnect SK-9D41 is a 1000baseSX card. */ if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { - if (BGE_IS_5714_FAMILY(sc)) + if (BGE_IS_5705_PLUS(sc)) sc->bge_flags |= BGE_FLAG_MII_SERDES; else sc->bge_flags |= BGE_FLAG_TBI; @@ -3622,8 +3629,11 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE) { - if (CSR_READ_4(sc, 0x7E2C) == 0x60) /* PCIE 1.0 */ - CSR_WRITE_4(sc, 0x7E2C, 0x20); + if (sc->bge_asicrev != BGE_ASICREV_BCM5785 && + (sc->bge_flags & BGE_FLAG_5717_PLUS) == 0) { + if (CSR_READ_4(sc, 0x7E2C) == 0x60) /* PCIE 1.0 */ + CSR_WRITE_4(sc, 0x7E2C, 0x20); + } if (sc->bge_chipid != BGE_CHIPID_BCM5750_A0) { /* Prevent PCIE link training during global reset */ CSR_WRITE_4(sc, BGE_MISC_CFG, 1 << 29); @@ -3631,6 +3641,15 @@ bge_reset(struct bge_softc *sc) } } + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { + val = CSR_READ_4(sc, BGE_VCPU_STATUS); + CSR_WRITE_4(sc, BGE_VCPU_STATUS, + val | BGE_VCPU_STATUS_DRV_RESET); + val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL); + CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL, + val & ~BGE_VCPU_EXT_CTRL_HALT_CPU); + } + /* * Set GPHY Power Down Override to leave GPHY * powered up in D0 uninitialized. @@ -3642,15 +3661,6 @@ bge_reset(struct bge_softc *sc) /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); - if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { - val = CSR_READ_4(sc, BGE_VCPU_STATUS); - CSR_WRITE_4(sc, BGE_VCPU_STATUS, - val | BGE_VCPU_STATUS_DRV_RESET); - val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL); - CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL, - val & ~BGE_VCPU_EXT_CTRL_HALT_CPU); - } - DELAY(1000); /* XXX: Broadcom Linux driver. */ @@ -3667,6 +3677,7 @@ bge_reset(struct bge_softc *sc) PCIEM_CTL_NOSNOOP_ENABLE); pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_CTL, devctl, 2); + pci_set_max_read_req(dev, sc->bge_expmrq); /* Clear error status. */ pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_STA, PCIEM_STA_CORRECTABLE_ERROR | @@ -3798,7 +3809,6 @@ bge_reset(struct bge_softc *sc) val = CSR_READ_4(sc, 0x7C00); CSR_WRITE_4(sc, 0x7C00, val | (1 << 25)); } - DELAY(10000); if (sc->bge_asicrev == BGE_ASICREV_BCM5720) BGE_CLRBIT(sc, BGE_CPMU_CLCK_ORIDE, @@ -4088,10 +4098,12 @@ bge_poll(struct ifnet *ifp, enum poll_cm bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + /* Fetch updates from the status block. */ rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; statusword = sc->bge_ldata.bge_status_block->bge_status; + /* Clear the status so the next pass only sees the changes. */ sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, @@ -4159,11 +4171,12 @@ bge_intr_task(void *arg, int pending) sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* Save producer/consumer indexess. */ + /* Save producer/consumer indices. */ rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; status = sc->bge_ldata.bge_status_block->bge_status; status_tag = sc->bge_ldata.bge_status_block->bge_status_tag << 24; + /* Dirty the status flag. */ sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, @@ -5703,7 +5716,7 @@ bge_link_upd(struct bge_softc *sc) bge_miibus_statchg(sc->bge_dev); } - /* Clear the attention. */ + /* Disable MAC attention when link is up. */ CSR_WRITE_4(sc, BGE_MAC_STS, BGE_MACSTAT_SYNC_CHANGED | BGE_MACSTAT_CFG_CHANGED | BGE_MACSTAT_MI_COMPLETE | BGE_MACSTAT_LINK_CHANGED); Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 02:32:32 2012 (r243537) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 02:41:30 2012 (r243538) @@ -2802,6 +2802,7 @@ struct bge_softc { struct resource *bge_res; struct ifmedia bge_ifmedia; /* TBI media info */ int bge_expcap; + int bge_expmrq; int bge_msicap; int bge_pcixcap; uint32_t bge_flags; @@ -2845,6 +2846,7 @@ struct bge_softc { uint32_t bge_chiprev; uint8_t bge_asf_mode; uint8_t bge_asf_count; + uint16_t bge_mps; struct bge_ring_data bge_ldata; /* rings */ struct bge_chain_data bge_cdata; /* mbufs */ uint16_t bge_tx_saved_considx; From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 02:48:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D415EF6; Mon, 26 Nov 2012 02:48:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4183E8FC08; Mon, 26 Nov 2012 02:48:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2mvLi075899; Mon, 26 Nov 2012 02:48:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2mvow075898; Mon, 26 Nov 2012 02:48:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260248.qAQ2mvow075898@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 02:48: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: r243540 - stable/9/usr.bin/find X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:48:57 -0000 Author: eadler Date: Mon Nov 26 02:48:56 2012 New Revision: 243540 URL: http://svnweb.freebsd.org/changeset/base/243540 Log: MFC r243280: Use .Nm instead of a self xref Approved by: cperciva (implicit) Modified: stable/9/usr.bin/find/find.1 Directory Properties: stable/9/usr.bin/find/ (props changed) Modified: stable/9/usr.bin/find/find.1 ============================================================================== --- stable/9/usr.bin/find/find.1 Mon Nov 26 02:42:19 2012 (r243539) +++ stable/9/usr.bin/find/find.1 Mon Nov 26 02:48:56 2012 (r243540) @@ -285,7 +285,7 @@ Non-portable, BSD-specific version of .Ic depth . GNU find implements this as a primary in mistaken emulation of .Fx -.Xr find 1 . +.Nm . .It Ic -delete Delete found files and/or directories. Always returns true. @@ -457,7 +457,7 @@ for compatibility with GNU find. GNU find imposes a restriction that .Ar gname is numeric, while -.Xr find 1 +.Nm does not. .It Ic -group Ar gname True if the file belongs to the group @@ -620,7 +620,7 @@ This option is for GNU find compatibilit .It Ic -noleaf This option is for GNU find compatibility. In GNU find it disables an optimization not relevant to -.Xr find 1 , +.Nm , so it is ignored. .It Ic -nouser True if the file belongs to an unknown user. @@ -813,7 +813,7 @@ for compatibility with GNU find. GNU find imposes a restriction that .Ar uname is numeric, while -.Xr find 1 +.Nm does not. .It Ic -user Ar uname True if the file belongs to the user From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 04:10:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18095C35; Mon, 26 Nov 2012 04:10:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F17748FC15; Mon, 26 Nov 2012 04:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4AR4l090227; Mon, 26 Nov 2012 04:10:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4ARTE090223; Mon, 26 Nov 2012 04:10:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260410.qAQ4ARTE090223@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:10:27 +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: r243541 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:10:28 -0000 Author: yongari Date: Mon Nov 26 04:10:27 2012 New Revision: 243541 URL: http://svnweb.freebsd.org/changeset/base/243541 Log: MFC r241436: Rework controller reset procedure. Previously driver saved BGE_PCI_PCISTATE register before issuing global reset. After issuing reset, it reads BGE_PCI_PCISTATE register again and compares the saved register value and current value. It was used to know whether the global reset operation was completed or not. Unfortunately, this logic caused several issues on recent BCM5717/ 5718/5719 and BCM5720 controllers. It seems APE firmware accesses some registers while global reset is in progress such that reading BGE_PCI_PCISTATE register after reset does not yield old pre-reset state value. This resulted in consuming too much time in global reset and sometimes it couldn't successfully complete reset. The BGE_MISCCFG_RESET_CORE_CLOCKS of BGE_MISC_CFG register is self-clearing bit so driver is able to know the reset completion. But the core-lock reset will disable indirect/flat/standard access modes such that driver cannot poll BGE_MISCCFG_RESET_CORE_CLOCKS bit of BGE_MISC_CFG register. So just wait enough time for core-clock reset to complete. Data sheet says driver should wait 100us for PCI/PCI-X devices and 100ms for PCIe devices. I chose 1ms for PCI/PCI-X since this value was used for many years in bge(4). For PCIe devices, use 100ms as recommended by data sheet. bge_chipinit() also cleared BGE_MAC_MODE register which shall clear firmware configured mode information. I think this will result in losing ASF/IPMI link in device attachment. Let bge_reset() honor firmware configured BGE_MAC_MODE register and don't announce driver is UP in bge_reset(). Firmware should have control over driver until it's fully initialized by driver. While I'm here, enable workaround for PCI-X BCM5704 A0 in bge_reset(). This will prevent internal arbitration logic from switching to the other DMA engine after a retry cycle. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:48:56 2012 (r243540) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:10:27 2012 (r243541) @@ -1433,10 +1433,6 @@ bge_chipinit(struct bge_softc *sc) misc_ctl |= BGE_PCIMISCCTL_TAGGED_STATUS; pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, misc_ctl, 4); - /* Clear the MAC control register */ - CSR_WRITE_4(sc, BGE_MAC_MODE, 0); - DELAY(40); - /* * Clear the MAC statistics block in the NIC's * internal memory. @@ -3585,13 +3581,16 @@ static int bge_reset(struct bge_softc *sc) { device_t dev; - uint32_t cachesize, command, pcistate, reset, val; + uint32_t cachesize, command, mac_mode, mac_mode_mask, reset, val; void (*write_op)(struct bge_softc *, int, int); uint16_t devctl; int i; dev = sc->bge_dev; + mac_mode_mask = BGE_MACMODE_HALF_DUPLEX | BGE_MACMODE_PORTMODE; + mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & mac_mode_mask; + if (BGE_IS_575X_PLUS(sc) && !BGE_IS_5714_FAMILY(sc) && (sc->bge_asicrev != BGE_ASICREV_BCM5906)) { if (sc->bge_flags & BGE_FLAG_PCIE) @@ -3604,7 +3603,6 @@ bge_reset(struct bge_softc *sc) /* Save some important PCI state. */ cachesize = pci_read_config(dev, BGE_PCI_CACHESZ, 4); command = pci_read_config(dev, BGE_PCI_CMD, 4); - pcistate = pci_read_config(dev, BGE_PCI_PCISTATE, 4); pci_write_config(dev, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_INDIRECT_ACCESS | BGE_PCIMISCCTL_MASK_PCI_INTR | @@ -3661,7 +3659,10 @@ bge_reset(struct bge_softc *sc) /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); - DELAY(1000); + if (sc->bge_flags & BGE_FLAG_PCIE) + DELAY(100 * 1000); + else + DELAY(1000); /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE) { @@ -3689,9 +3690,13 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_INDIRECT_ACCESS | BGE_PCIMISCCTL_MASK_PCI_INTR | BGE_HIF_SWAP_OPTIONS | BGE_PCIMISCCTL_PCISTATE_RW, 4); + val = BGE_PCISTATE_ROM_ENABLE | BGE_PCISTATE_ROM_RETRY_ENABLE; + if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0 && + (sc->bge_flags & BGE_FLAG_PCIX) != 0) + val |= BGE_PCISTATE_RETRY_SAME_DMA; + pci_write_config(dev, BGE_PCI_PCISTATE, val, 4); pci_write_config(dev, BGE_PCI_CACHESZ, cachesize, 4); pci_write_config(dev, BGE_PCI_CMD, command, 4); - write_op(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); /* * Disable PCI-X relaxed ordering to ensure status block update * comes first then packet buffer DMA. Otherwise driver may @@ -3730,6 +3735,14 @@ bge_reset(struct bge_softc *sc) } else CSR_WRITE_4(sc, BGE_MARB_MODE, BGE_MARBMODE_ENABLE); + /* Fix up byte swapping. */ + CSR_WRITE_4(sc, BGE_MODE_CTL, bge_dma_swap_options(sc)); + + val = CSR_READ_4(sc, BGE_MAC_MODE); + val = (val & ~mac_mode_mask) | mac_mode; + CSR_WRITE_4(sc, BGE_MAC_MODE, val); + DELAY(40); + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { for (i = 0; i < BGE_TIMEOUT; i++) { val = CSR_READ_4(sc, BGE_VCPU_STATUS); @@ -3765,30 +3778,6 @@ bge_reset(struct bge_softc *sc) } /* - * XXX Wait for the value of the PCISTATE register to - * return to its original pre-reset state. This is a - * fairly good indicator of reset completion. If we don't - * wait for the reset to fully complete, trying to read - * from the device's non-PCI registers may yield garbage - * results. - */ - for (i = 0; i < BGE_TIMEOUT; i++) { - if (pci_read_config(dev, BGE_PCI_PCISTATE, 4) == pcistate) - break; - DELAY(10); - } - - /* Fix up byte swapping. */ - CSR_WRITE_4(sc, BGE_MODE_CTL, bge_dma_swap_options(sc)); - - /* Tell the ASF firmware we are up */ - if (sc->bge_asf_mode & ASF_STACKUP) - BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); - - CSR_WRITE_4(sc, BGE_MAC_MODE, 0); - DELAY(40); - - /* * The 5704 in TBI mode apparently needs some special * adjustment to insure the SERDES drive level is set * to 1.2V. Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 02:48:56 2012 (r243540) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:10:27 2012 (r243541) @@ -430,10 +430,11 @@ #define BGE_PCISTATE_PCI_BUSMODE 0x00000004 /* 1 = PCI, 0 = PCI-X */ #define BGE_PCISTATE_PCI_BUSSPEED 0x00000008 /* 1 = 66/133, 0 = 33/66 */ #define BGE_PCISTATE_32BIT_BUS 0x00000010 /* 1 = 32bit, 0 = 64bit */ -#define BGE_PCISTATE_WANT_EXPROM 0x00000020 -#define BGE_PCISTATE_EXPROM_RETRY 0x00000040 +#define BGE_PCISTATE_ROM_ENABLE 0x00000020 +#define BGE_PCISTATE_ROM_RETRY_ENABLE 0x00000040 #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 +#define BGE_PCISTATE_RETRY_SAME_DMA 0x00002000 /* * PCI Clock Control register -- note, this register is read only From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 04:20:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF8C028E; Mon, 26 Nov 2012 04:20:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4F108FC14; Mon, 26 Nov 2012 04:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4KB3t092185; Mon, 26 Nov 2012 04:20:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4KBdJ092184; Mon, 26 Nov 2012 04:20:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260420.qAQ4KBdJ092184@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:20:11 +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: r243544 - stable/9/sys/dev/mii X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:20:12 -0000 Author: yongari Date: Mon Nov 26 04:20:11 2012 New Revision: 243544 URL: http://svnweb.freebsd.org/changeset/base/243544 Log: MFC r241437: For 5717C/5719C/5720C and 57765 PHYs, do not perform any special handling(jumbo, wire speed etc) in brgphy_reset(). Touching BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that it couldn't establish a link. Modified: stable/9/sys/dev/mii/brgphy.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mii/brgphy.c ============================================================================== --- stable/9/sys/dev/mii/brgphy.c Mon Nov 26 04:18:58 2012 (r243543) +++ stable/9/sys/dev/mii/brgphy.c Mon Nov 26 04:20:11 2012 (r243544) @@ -918,6 +918,15 @@ brgphy_reset(struct mii_softc *sc) break; } break; + case MII_OUI_BROADCOM3: + switch (sc->mii_mpd_model) { + case MII_MODEL_BROADCOM3_BCM5717C: + case MII_MODEL_BROADCOM3_BCM5719C: + case MII_MODEL_BROADCOM3_BCM5720C: + case MII_MODEL_BROADCOM3_BCM57765: + return; + } + break; } ifp = sc->mii_pdata->mii_ifp; From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 04:25:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2564593; Mon, 26 Nov 2012 04:25:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4EB78FC0C; Mon, 26 Nov 2012 04:25:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4Pf5i093179; Mon, 26 Nov 2012 04:25:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4PfJG093177; Mon, 26 Nov 2012 04:25:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260425.qAQ4PfJG093177@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:25:41 +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: r243546 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:25:41 -0000 Author: yongari Date: Mon Nov 26 04:25:41 2012 New Revision: 243546 URL: http://svnweb.freebsd.org/changeset/base/243546 Log: MFC r241438: Add APE firmware support and improve firmware handshake procedure. This change will enable IPMI access on 5717/5718/5719/5720 and 5761 controllers. Because ASF is not available when APE firmware is present, bge_allow_asf tunable is ignored when driver detects APE firmware. Also bge(4) no longer performs two resets(one blind reset and the other reset with firmware in mind) in device attach. Now bge(4) performs a reset with enough information in bge_reset(). The APE firmware also needs special handling to make suspend/resume work but it was not implemented yet. With this change, bge(4) should work on any 5717/5718/5719/5720 controllers. Special thanks to Mike Hibler at Emulab who setup remote debugging on Dell R820. Without his help I couldn't be able to address several issues happened on Dell Rx20 systems. And many thanks to Broadcom for continuing to support FreeBSD! Submitted by: davidch (initial version) H/W donated by: Broadcom Tested by: many Tested on: Del R820/R720/R620/R420/R320 and HP Proliant DL 360 G8 Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:20:59 2012 (r243545) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:25:41 2012 (r243546) @@ -461,8 +461,9 @@ static void bge_miibus_statchg(device_t) static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count); #endif -#define BGE_RESET_START 1 -#define BGE_RESET_STOP 2 +#define BGE_RESET_SHUTDOWN 0 +#define BGE_RESET_START 1 +#define BGE_RESET_SUSPEND 2 static void bge_sig_post_reset(struct bge_softc *, int); static void bge_sig_legacy(struct bge_softc *, int); static void bge_sig_pre_reset(struct bge_softc *, int); @@ -470,6 +471,13 @@ static void bge_stop_fw(struct bge_softc static int bge_reset(struct bge_softc *); static void bge_link_upd(struct bge_softc *); +static void bge_ape_lock_init(struct bge_softc *); +static void bge_ape_read_fw_ver(struct bge_softc *); +static int bge_ape_lock(struct bge_softc *, int); +static void bge_ape_unlock(struct bge_softc *, int); +static void bge_ape_send_event(struct bge_softc *, uint32_t); +static void bge_ape_driver_state_change(struct bge_softc *, int); + /* * The BGE_REGISTER_DEBUG option is only for low-level debugging. It may * leak information to untrusted users. It is also known to cause alignment @@ -478,6 +486,7 @@ static void bge_link_upd(struct bge_soft #ifdef BGE_REGISTER_DEBUG static int bge_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static int bge_sysctl_reg_read(SYSCTL_HANDLER_ARGS); +static int bge_sysctl_ape_read(SYSCTL_HANDLER_ARGS); static int bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS); #endif static void bge_add_sysctls(struct bge_softc *); @@ -643,6 +652,318 @@ bge_writembx(struct bge_softc *sc, int o } /* + * Clear all stale locks and select the lock for this driver instance. + */ +static void +bge_ape_lock_init(struct bge_softc *sc) +{ + uint32_t bit, regbase; + int i; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + regbase = BGE_APE_LOCK_GRANT; + else + regbase = BGE_APE_PER_LOCK_GRANT; + + /* Clear any stale locks. */ + for (i = BGE_APE_LOCK_PHY0; i <= BGE_APE_LOCK_GPIO; i++) { + switch (i) { + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + bit = BGE_APE_LOCK_GRANT_DRIVER0; + break; + default: + if (sc->bge_func_addr != 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + } + APE_WRITE_4(sc, regbase + 4 * i, bit); + } + + /* Select the PHY lock based on the device's function number. */ + switch (sc->bge_func_addr) { + case 0: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY0; + break; + case 1: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY1; + break; + case 2: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY2; + break; + case 3: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY3; + break; + default: + device_printf(sc->bge_dev, + "PHY lock not supported on this function\n"); + } +} + +/* + * Check for APE firmware, set flags, and print version info. + */ +static void +bge_ape_read_fw_ver(struct bge_softc *sc) +{ + const char *fwtype; + uint32_t apedata, features; + + /* Check for a valid APE signature in shared memory. */ + apedata = APE_READ_4(sc, BGE_APE_SEG_SIG); + if (apedata != BGE_APE_SEG_SIG_MAGIC) { + sc->bge_mfw_flags &= ~ BGE_MFW_ON_APE; + return; + } + + /* Check if APE firmware is running. */ + apedata = APE_READ_4(sc, BGE_APE_FW_STATUS); + if ((apedata & BGE_APE_FW_STATUS_READY) == 0) { + device_printf(sc->bge_dev, "APE signature found " + "but FW status not ready! 0x%08x\n", apedata); + return; + } + + sc->bge_mfw_flags |= BGE_MFW_ON_APE; + + /* Fetch the APE firwmare type and version. */ + apedata = APE_READ_4(sc, BGE_APE_FW_VERSION); + features = APE_READ_4(sc, BGE_APE_FW_FEATURES); + if ((features & BGE_APE_FW_FEATURE_NCSI) != 0) { + sc->bge_mfw_flags |= BGE_MFW_TYPE_NCSI; + fwtype = "NCSI"; + } else if ((features & BGE_APE_FW_FEATURE_DASH) != 0) { + sc->bge_mfw_flags |= BGE_MFW_TYPE_DASH; + fwtype = "DASH"; + } else + fwtype = "UNKN"; + + /* Print the APE firmware version. */ + device_printf(sc->bge_dev, "APE FW version: %s v%d.%d.%d.%d\n", + fwtype, + (apedata & BGE_APE_FW_VERSION_MAJMSK) >> BGE_APE_FW_VERSION_MAJSFT, + (apedata & BGE_APE_FW_VERSION_MINMSK) >> BGE_APE_FW_VERSION_MINSFT, + (apedata & BGE_APE_FW_VERSION_REVMSK) >> BGE_APE_FW_VERSION_REVSFT, + (apedata & BGE_APE_FW_VERSION_BLDMSK)); +} + +static int +bge_ape_lock(struct bge_softc *sc, int locknum) +{ + uint32_t bit, gnt, req, status; + int i, off; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return (0); + + /* Lock request/grant registers have different bases. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) { + req = BGE_APE_LOCK_REQ; + gnt = BGE_APE_LOCK_GRANT; + } else { + req = BGE_APE_PER_LOCK_REQ; + gnt = BGE_APE_PER_LOCK_GRANT; + } + + off = 4 * locknum; + + switch (locknum) { + case BGE_APE_LOCK_GPIO: + /* Lock required when using GPIO. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + return (0); + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_GRC: + /* Lock required to reset the device. */ + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_MEM: + /* Lock required when accessing certain APE memory. */ + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + /* Lock required when accessing PHYs. */ + bit = BGE_APE_LOCK_REQ_DRIVER0; + break; + default: + return (EINVAL); + } + + /* Request a lock. */ + APE_WRITE_4(sc, req + off, bit); + + /* Wait up to 1 second to acquire lock. */ + for (i = 0; i < 20000; i++) { + status = APE_READ_4(sc, gnt + off); + if (status == bit) + break; + DELAY(50); + } + + /* Handle any errors. */ + if (status != bit) { + device_printf(sc->bge_dev, "APE lock %d request failed! " + "request = 0x%04x[0x%04x], status = 0x%04x[0x%04x]\n", + locknum, req + off, bit & 0xFFFF, gnt + off, + status & 0xFFFF); + /* Revoke the lock request. */ + APE_WRITE_4(sc, gnt + off, bit); + return (EBUSY); + } + + return (0); +} + +static void +bge_ape_unlock(struct bge_softc *sc, int locknum) +{ + uint32_t bit, gnt; + int off; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + gnt = BGE_APE_LOCK_GRANT; + else + gnt = BGE_APE_PER_LOCK_GRANT; + + off = 4 * locknum; + + switch (locknum) { + case BGE_APE_LOCK_GPIO: + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + return; + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_GRC: + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_MEM: + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + bit = BGE_APE_LOCK_GRANT_DRIVER0; + break; + default: + return; + } + + APE_WRITE_4(sc, gnt + off, bit); +} + +/* + * Send an event to the APE firmware. + */ +static void +bge_ape_send_event(struct bge_softc *sc, uint32_t event) +{ + uint32_t apedata; + int i; + + /* NCSI does not support APE events. */ + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + /* Wait up to 1ms for APE to service previous event. */ + for (i = 10; i > 0; i--) { + if (bge_ape_lock(sc, BGE_APE_LOCK_MEM) != 0) + break; + apedata = APE_READ_4(sc, BGE_APE_EVENT_STATUS); + if ((apedata & BGE_APE_EVENT_STATUS_EVENT_PENDING) == 0) { + APE_WRITE_4(sc, BGE_APE_EVENT_STATUS, event | + BGE_APE_EVENT_STATUS_EVENT_PENDING); + bge_ape_unlock(sc, BGE_APE_LOCK_MEM); + APE_WRITE_4(sc, BGE_APE_EVENT, BGE_APE_EVENT_1); + break; + } + bge_ape_unlock(sc, BGE_APE_LOCK_MEM); + DELAY(100); + } + if (i == 0) + device_printf(sc->bge_dev, "APE event 0x%08x send timed out\n", + event); +} + +static void +bge_ape_driver_state_change(struct bge_softc *sc, int kind) +{ + uint32_t apedata, event; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + switch (kind) { + case BGE_RESET_START: + /* If this is the first load, clear the load counter. */ + apedata = APE_READ_4(sc, BGE_APE_HOST_SEG_SIG); + if (apedata != BGE_APE_HOST_SEG_SIG_MAGIC) + APE_WRITE_4(sc, BGE_APE_HOST_INIT_COUNT, 0); + else { + apedata = APE_READ_4(sc, BGE_APE_HOST_INIT_COUNT); + APE_WRITE_4(sc, BGE_APE_HOST_INIT_COUNT, ++apedata); + } + APE_WRITE_4(sc, BGE_APE_HOST_SEG_SIG, + BGE_APE_HOST_SEG_SIG_MAGIC); + APE_WRITE_4(sc, BGE_APE_HOST_SEG_LEN, + BGE_APE_HOST_SEG_LEN_MAGIC); + + /* Add some version info if bge(4) supports it. */ + APE_WRITE_4(sc, BGE_APE_HOST_DRIVER_ID, + BGE_APE_HOST_DRIVER_ID_MAGIC(1, 0)); + APE_WRITE_4(sc, BGE_APE_HOST_BEHAVIOR, + BGE_APE_HOST_BEHAV_NO_PHYLOCK); + APE_WRITE_4(sc, BGE_APE_HOST_HEARTBEAT_INT_MS, + BGE_APE_HOST_HEARTBEAT_INT_DISABLE); + APE_WRITE_4(sc, BGE_APE_HOST_DRVR_STATE, + BGE_APE_HOST_DRVR_STATE_START); + event = BGE_APE_EVENT_STATUS_STATE_START; + break; + case BGE_RESET_SHUTDOWN: + APE_WRITE_4(sc, BGE_APE_HOST_DRVR_STATE, + BGE_APE_HOST_DRVR_STATE_UNLOAD); + event = BGE_APE_EVENT_STATUS_STATE_UNLOAD; + break; + case BGE_RESET_SUSPEND: + event = BGE_APE_EVENT_STATUS_STATE_SUSPEND; + break; + default: + return; + } + + bge_ape_send_event(sc, event | BGE_APE_EVENT_STATUS_DRIVER_EVNT | + BGE_APE_EVENT_STATUS_STATE_CHNGE); +} + +/* * Map a single buffer address. */ @@ -806,6 +1127,9 @@ bge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); + if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) + return (0); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -840,6 +1164,8 @@ bge_miibus_readreg(device_t dev, int phy DELAY(80); } + bge_ape_unlock(sc, sc->bge_phy_ape_lock); + if (val & BGE_MICOMM_READFAIL) return (0); @@ -858,6 +1184,9 @@ bge_miibus_writereg(device_t dev, int ph (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) return (0); + if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) + return (0); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -883,6 +1212,8 @@ bge_miibus_writereg(device_t dev, int ph DELAY(80); } + bge_ape_unlock(sc, sc->bge_phy_ape_lock); + if (i == BGE_TIMEOUT) device_printf(sc->bge_dev, "PHY write timed out (phy %d, reg %d, val 0x%04x)\n", @@ -1335,12 +1666,19 @@ bge_sig_pre_reset(struct bge_softc *sc, bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_START); break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD); break; + case BGE_RESET_SUSPEND: + bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, + BGE_FW_DRV_STATE_SUSPEND); + break; } } + + if (type == BGE_RESET_START || type == BGE_RESET_SUSPEND) + bge_ape_driver_state_change(sc, type); } static void @@ -1354,12 +1692,14 @@ bge_sig_post_reset(struct bge_softc *sc, BGE_FW_DRV_STATE_START_DONE); /* START DONE */ break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD_DONE); break; } } + if (type == BGE_RESET_SHUTDOWN) + bge_ape_driver_state_change(sc, type); } static void @@ -1372,7 +1712,7 @@ bge_sig_legacy(struct bge_softc *sc, int bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_START); break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD); break; @@ -1409,11 +1749,6 @@ bge_dma_swap_options(struct bge_softc *s #if BYTE_ORDER == BIG_ENDIAN dma_options |= BGE_MODECTL_BYTESWAP_NONFRAME; #endif - if ((sc)->bge_asicrev == BGE_ASICREV_BCM5720) - dma_options |= BGE_MODECTL_BYTESWAP_B2HRX_DATA | - BGE_MODECTL_WORDSWAP_B2HRX_DATA | BGE_MODECTL_B2HRX_ENABLE | - BGE_MODECTL_HTX2B_ENABLE; - return (dma_options); } @@ -1540,8 +1875,16 @@ bge_chipinit(struct bge_softc *sc) /* * Set up general mode register. */ - mode_ctl = bge_dma_swap_options(sc) | BGE_MODECTL_MAC_ATTN_INTR | - BGE_MODECTL_HOST_SEND_BDS | BGE_MODECTL_TX_NO_PHDR_CSUM; + mode_ctl = bge_dma_swap_options(sc); + if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + /* Retain Host-2-BMC settings written by APE firmware. */ + mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) & + (BGE_MODECTL_BYTESWAP_B2HRX_DATA | + BGE_MODECTL_WORDSWAP_B2HRX_DATA | + BGE_MODECTL_B2HRX_ENABLE | BGE_MODECTL_HTX2B_ENABLE); + } + mode_ctl |= BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS | + BGE_MODECTL_TX_NO_PHDR_CSUM; /* * BCM5701 B5 have a bug causing data corruption when using @@ -2045,6 +2388,10 @@ bge_blockinit(struct bge_softc *sc) else val |= BGE_PORTMODE_MII; + /* Allow APE to send/receive frames. */ + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + val |= BGE_MACMODE_APE_RX_EN | BGE_MACMODE_APE_TX_EN; + CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); @@ -2891,9 +3238,9 @@ bge_attach(device_t dev) { struct ifnet *ifp; struct bge_softc *sc; - uint32_t hwcfg = 0, misccfg; + uint32_t hwcfg = 0, misccfg, pcistate; u_char eaddr[ETHER_ADDR_LEN]; - int capmask, error, f, msicount, phy_addr, reg, rid, trys; + int capmask, error, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2912,12 +3259,13 @@ bge_attach(device_t dev) RF_ACTIVE); if (sc->bge_res == NULL) { - device_printf (sc->bge_dev, "couldn't map memory\n"); + device_printf (sc->bge_dev, "couldn't map BAR0 memory\n"); error = ENXIO; goto fail; } /* Save various chip information. */ + sc->bge_func_addr = pci_get_function(dev); sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; @@ -2964,25 +3312,32 @@ bge_attach(device_t dev) * BCM5719 | 1 | 8 | 2 | 9 | * BCM5720 | 1 | 8 | 2 | 9 | * + * | F2 Cu | F2 Sr | F3 Cu | F3 Sr | + * ---------+-------+-------+-------+-------+ + * BCM57XX | X | X | X | X | + * BCM5704 | X | X | X | X | + * BCM5717 | X | X | X | X | + * BCM5719 | 3 | 10 | 4 | 11 | + * BCM5720 | X | X | X | X | + * * Other addresses may respond but they are not * IEEE compliant PHYs and should be ignored. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || sc->bge_asicrev == BGE_ASICREV_BCM5719 || sc->bge_asicrev == BGE_ASICREV_BCM5720) { - f = pci_get_function(dev); - if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { + if (sc->bge_chipid != BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & BGE_SGDIGSTS_IS_SERDES) - phy_addr = f + 8; + phy_addr = sc->bge_func_addr + 8; else - phy_addr = f + 1; + phy_addr = sc->bge_func_addr + 1; } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) - phy_addr = f + 8; + phy_addr = sc->bge_func_addr + 8; else - phy_addr = f + 1; + phy_addr = sc->bge_func_addr + 1; } } @@ -3045,6 +3400,39 @@ bge_attach(device_t dev) break; } + /* Identify chips with APE processor. */ + switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5717: + case BGE_ASICREV_BCM5719: + case BGE_ASICREV_BCM5720: + case BGE_ASICREV_BCM5761: + sc->bge_flags |= BGE_FLAG_APE; + break; + } + + /* Chips with APE need BAR2 access for APE registers/memory. */ + if ((sc->bge_flags & BGE_FLAG_APE) != 0) { + rid = PCIR_BAR(2); + sc->bge_res2 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->bge_res2 == NULL) { + device_printf (sc->bge_dev, + "couldn't map BAR2 memory\n"); + error = ENXIO; + goto fail; + } + + /* Enable APE register/memory access by host driver. */ + pcistate = pci_read_config(dev, BGE_PCI_PCISTATE, 4); + pcistate |= BGE_PCISTATE_ALLOW_APE_CTLSPC_WR | + BGE_PCISTATE_ALLOW_APE_SHMEM_WR | + BGE_PCISTATE_ALLOW_APE_PSPACE_WR; + pci_write_config(dev, BGE_PCI_PCISTATE, pcistate, 4); + + bge_ape_lock_init(sc); + bge_ape_read_fw_ver(sc); + } + /* Add SYSCTLs, requires the chipset family to be set. */ bge_add_sysctls(sc); @@ -3264,36 +3652,31 @@ bge_attach(device_t dev) bge_devinfo(sc); - /* Try to reset the chip. */ - if (bge_reset(sc)) { - device_printf(sc->bge_dev, "chip reset failed\n"); - error = ENXIO; - goto fail; - } - sc->bge_asf_mode = 0; - if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) == - BGE_SRAM_DATA_SIG_MAGIC)) { - if (bge_readmem_ind(sc, BGE_SRAM_DATA_CFG) - & BGE_HWCFG_ASF) { - sc->bge_asf_mode |= ASF_ENABLE; - sc->bge_asf_mode |= ASF_STACKUP; - if (BGE_IS_575X_PLUS(sc)) - sc->bge_asf_mode |= ASF_NEW_HANDSHAKE; + /* No ASF if APE present. */ + if ((sc->bge_flags & BGE_FLAG_APE) == 0) { + if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) == + BGE_SRAM_DATA_SIG_MAGIC)) { + if (bge_readmem_ind(sc, BGE_SRAM_DATA_CFG) & + BGE_HWCFG_ASF) { + sc->bge_asf_mode |= ASF_ENABLE; + sc->bge_asf_mode |= ASF_STACKUP; + if (BGE_IS_575X_PLUS(sc)) + sc->bge_asf_mode |= ASF_NEW_HANDSHAKE; + } } } - /* Try to reset the chip again the nice way. */ bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_STOP); + bge_sig_pre_reset(sc, BGE_RESET_START); if (bge_reset(sc)) { device_printf(sc->bge_dev, "chip reset failed\n"); error = ENXIO; goto fail; } - bge_sig_legacy(sc, BGE_RESET_STOP); - bge_sig_post_reset(sc, BGE_RESET_STOP); + bge_sig_legacy(sc, BGE_RESET_START); + bge_sig_post_reset(sc, BGE_RESET_START); if (bge_chipinit(sc)) { device_printf(sc->bge_dev, "chip initialization failed\n"); @@ -3568,6 +3951,10 @@ bge_release_resources(struct bge_softc * bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->bge_res); + if (sc->bge_res2 != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + PCIR_BAR(2), sc->bge_res2); + if (sc->bge_ifp != NULL) if_free(sc->bge_ifp); @@ -3589,6 +3976,8 @@ bge_reset(struct bge_softc *sc) dev = sc->bge_dev; mac_mode_mask = BGE_MACMODE_HALF_DUPLEX | BGE_MACMODE_PORTMODE; + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + mac_mode_mask |= BGE_MACMODE_APE_RX_EN | BGE_MACMODE_APE_TX_EN; mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & mac_mode_mask; if (BGE_IS_575X_PLUS(sc) && !BGE_IS_5714_FAMILY(sc) && @@ -3600,6 +3989,9 @@ bge_reset(struct bge_softc *sc) } else write_op = bge_writereg_ind; + /* Take APE lock when performing reset. */ + bge_ape_lock(sc, BGE_APE_LOCK_GRC); + /* Save some important PCI state. */ cachesize = pci_read_config(dev, BGE_PCI_CACHESZ, 4); command = pci_read_config(dev, BGE_PCI_CMD, 4); @@ -3694,6 +4086,10 @@ bge_reset(struct bge_softc *sc) if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0 && (sc->bge_flags & BGE_FLAG_PCIX) != 0) val |= BGE_PCISTATE_RETRY_SAME_DMA; + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + val |= BGE_PCISTATE_ALLOW_APE_CTLSPC_WR | + BGE_PCISTATE_ALLOW_APE_SHMEM_WR | + BGE_PCISTATE_ALLOW_APE_PSPACE_WR; pci_write_config(dev, BGE_PCI_PCISTATE, val, 4); pci_write_config(dev, BGE_PCI_CACHESZ, cachesize, 4); pci_write_config(dev, BGE_PCI_CMD, command, 4); @@ -3743,6 +4139,8 @@ bge_reset(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); + bge_ape_unlock(sc, BGE_APE_LOCK_GRC); + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { for (i = 0; i < BGE_TIMEOUT; i++) { val = CSR_READ_4(sc, BGE_VCPU_STATUS); @@ -4315,6 +4713,8 @@ bge_tick(void *xsc) else bge_stats_update(sc); + /* XXX Add APE heartbeat check here? */ + if ((sc->bge_flags & BGE_FLAG_TBI) == 0) { mii = device_get_softc(sc->bge_miibus); /* @@ -5058,7 +5458,10 @@ bge_init_locked(struct bge_softc *sc) DELAY(100); /* Turn on receiver. */ - BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); + mode = CSR_READ_4(sc, BGE_RX_MODE); + if (BGE_IS_5755_PLUS(sc)) + mode |= BGE_RXMODE_IPV6_ENABLE; + CSR_WRITE_4(sc,BGE_RX_MODE, mode | BGE_RXMODE_ENABLE); DELAY(10); /* @@ -5464,7 +5867,7 @@ bge_stop(struct bge_softc *sc) * Tell firmware we're shutting down. */ bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_STOP); + bge_sig_pre_reset(sc, BGE_RESET_SHUTDOWN); /* * Disable all of the receiver blocks. @@ -5510,8 +5913,8 @@ bge_stop(struct bge_softc *sc) bge_stats_update_regs(sc); bge_reset(sc); - bge_sig_legacy(sc, BGE_RESET_STOP); - bge_sig_post_reset(sc, BGE_RESET_STOP); + bge_sig_legacy(sc, BGE_RESET_SHUTDOWN); + bge_sig_post_reset(sc, BGE_RESET_SHUTDOWN); /* * Keep the ASF firmware running if up. @@ -5553,7 +5956,6 @@ bge_shutdown(device_t dev) sc = device_get_softc(dev); BGE_LOCK(sc); bge_stop(sc); - bge_reset(sc); BGE_UNLOCK(sc); return (0); @@ -5729,7 +6131,11 @@ bge_add_sysctls(struct bge_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reg_read", CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_reg_read, "I", - "Register Read"); + "MAC Register Read"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ape_read", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_ape_read, "I", + "APE Register Read"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mem_read", CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_mem_read, "I", @@ -6128,6 +6534,28 @@ bge_sysctl_reg_read(SYSCTL_HANDLER_ARGS) } static int +bge_sysctl_ape_read(SYSCTL_HANDLER_ARGS) +{ + struct bge_softc *sc; + int error; + uint16_t result; + uint32_t val; + + result = -1; + error = sysctl_handle_int(oidp, &result, 0, req); + if (error || (req->newptr == NULL)) + return (error); + + if (result < 0x8000) { + sc = (struct bge_softc *)arg1; + val = APE_READ_4(sc, result); + printf("reg 0x%06X = 0x%08X\n", result, val); + } + + return (error); +} + +static int bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS) { struct bge_softc *sc; Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:20:59 2012 (r243545) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:25:41 2012 (r243546) @@ -435,6 +435,9 @@ #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 #define BGE_PCISTATE_RETRY_SAME_DMA 0x00002000 +#define BGE_PCISTATE_ALLOW_APE_CTLSPC_WR 0x00010000 +#define BGE_PCISTATE_ALLOW_APE_SHMEM_WR 0x00020000 +#define BGE_PCISTATE_ALLOW_APE_PSPACE_WR 0x00040000 /* * PCI Clock Control register -- note, this register is read only @@ -460,6 +463,8 @@ #define PCIM_CMD_INTxDIS 0x0400 #endif +/* BAR0 (MAC) Register Definitions */ + /* * High priority mailbox registers * Each mailbox is 64-bits wide, though we only use the @@ -742,6 +747,8 @@ #define BGE_MACMODE_TXDMA_ENB 0x00200000 #define BGE_MACMODE_RXDMA_ENB 0x00400000 #define BGE_MACMODE_FRMHDR_DMA_ENB 0x00800000 +#define BGE_MACMODE_APE_RX_EN 0x08000000 +#define BGE_MACMODE_APE_TX_EN 0x10000000 #define BGE_PORTMODE_NONE 0x00000000 #define BGE_PORTMODE_MII 0x00000004 @@ -829,6 +836,7 @@ #define BGE_RXMODE_RX_PROMISC 0x00000100 #define BGE_RXMODE_RX_NO_CRC_CHECK 0x00000200 #define BGE_RXMODE_RX_KEEP_VLAN_DIAG 0x00000400 +#define BGE_RXMODE_IPV6_ENABLE 0x01000000 /* Receive MAC status register */ #define BGE_RXSTAT_REMOTE_XOFFED 0x00000001 @@ -1578,6 +1586,22 @@ #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 +/* BD Read DMA Mode register */ +#define BGE_RDMA_BD_MODE 0x4A00 +/* BD Read DMA Mode status register */ +#define BGE_RDMA_BD_STATUS 0x4A04 + +#define BGE_RDMA_BD_MODE_RESET 0x00000001 +#define BGE_RDMA_BD_MODE_ENABLE 0x00000002 + +/* Non-LSO Read DMA Mode register */ +#define BGE_RDMA_NON_LSO_MODE 0x4B00 +/* Non-LSO Read DMA Mode status register */ +#define BGE_RDMA_NON_LSO_STATUS 0x4B04 + +#define BGE_RDMA_NON_LSO_MODE_RESET 0x00000001 +#define BGE_RDMA_NON_LSO_MODE_ENABLE 0x00000002 + /* * Write DMA control registers */ @@ -2065,6 +2089,112 @@ #define BGE_MEMWIN_START 0x00008000 #define BGE_MEMWIN_END 0x0000FFFF +/* BAR1 (APE) Register Definitions */ + +#define BGE_APE_GPIO_MSG 0x0008 +#define BGE_APE_EVENT 0x000C +#define BGE_APE_LOCK_REQ 0x002C +#define BGE_APE_LOCK_GRANT 0x004C + +#define BGE_APE_GPIO_MSG_SHIFT 4 + +#define BGE_APE_EVENT_1 0x00000001 + +#define BGE_APE_LOCK_REQ_DRIVER0 0x00001000 + +#define BGE_APE_LOCK_GRANT_DRIVER0 0x00001000 + +/* APE Shared Memory block (writable by APE only) */ +#define BGE_APE_SEG_SIG 0x4000 +#define BGE_APE_FW_STATUS 0x400C +#define BGE_APE_FW_FEATURES 0x4010 +#define BGE_APE_FW_BEHAVIOR 0x4014 +#define BGE_APE_FW_VERSION 0x4018 +#define BGE_APE_FW_HEARTBEAT_INTERVAL 0x4024 +#define BGE_APE_FW_HEARTBEAT 0x4028 +#define BGE_APE_FW_ERROR_FLAGS 0x4074 + +#define BGE_APE_SEG_SIG_MAGIC 0x41504521 + +#define BGE_APE_FW_STATUS_READY 0x00000100 + +#define BGE_APE_FW_FEATURE_DASH 0x00000001 +#define BGE_APE_FW_FEATURE_NCSI 0x00000002 + +#define BGE_APE_FW_VERSION_MAJMSK 0xFF000000 +#define BGE_APE_FW_VERSION_MAJSFT 24 +#define BGE_APE_FW_VERSION_MINMSK 0x00FF0000 +#define BGE_APE_FW_VERSION_MINSFT 16 +#define BGE_APE_FW_VERSION_REVMSK 0x0000FF00 +#define BGE_APE_FW_VERSION_REVSFT 8 +#define BGE_APE_FW_VERSION_BLDMSK 0x000000FF + +/* Host Shared Memory block (writable by host only) */ +#define BGE_APE_HOST_SEG_SIG 0x4200 +#define BGE_APE_HOST_SEG_LEN 0x4204 +#define BGE_APE_HOST_INIT_COUNT 0x4208 +#define BGE_APE_HOST_DRIVER_ID 0x420C +#define BGE_APE_HOST_BEHAVIOR 0x4210 +#define BGE_APE_HOST_HEARTBEAT_INT_MS 0x4214 +#define BGE_APE_HOST_HEARTBEAT_COUNT 0x4218 +#define BGE_APE_HOST_DRVR_STATE 0x421C +#define BGE_APE_HOST_WOL_SPEED 0x4224 + +#define BGE_APE_HOST_SEG_SIG_MAGIC 0x484F5354 + +#define BGE_APE_HOST_SEG_LEN_MAGIC 0x00000020 + +#define BGE_APE_HOST_DRIVER_ID_FBSD 0xF6000000 +#define BGE_APE_HOST_DRIVER_ID_MAGIC(maj, min) \ + (BGE_APE_HOST_DRIVER_ID_FBSD | \ + ((maj) & 0xffd) << 16 | ((min) & 0xff) << 8) + +#define BGE_APE_HOST_BEHAV_NO_PHYLOCK 0x00000001 + +#define BGE_APE_HOST_HEARTBEAT_INT_DISABLE 0 +#define BGE_APE_HOST_HEARTBEAT_INT_5SEC 5000 + +#define BGE_APE_HOST_DRVR_STATE_START 0x00000001 +#define BGE_APE_HOST_DRVR_STATE_UNLOAD 0x00000002 +#define BGE_APE_HOST_DRVR_STATE_WOL 0x00000003 +#define BGE_APE_HOST_DRVR_STATE_SUSPEND 0x00000004 + +#define BGE_APE_HOST_WOL_SPEED_AUTO 0x00008000 + +#define BGE_APE_EVENT_STATUS 0x4300 + +#define BGE_APE_EVENT_STATUS_DRIVER_EVNT 0x00000010 +#define BGE_APE_EVENT_STATUS_STATE_CHNGE 0x00000500 +#define BGE_APE_EVENT_STATUS_STATE_START 0x00010000 +#define BGE_APE_EVENT_STATUS_STATE_UNLOAD 0x00020000 +#define BGE_APE_EVENT_STATUS_STATE_WOL 0x00030000 +#define BGE_APE_EVENT_STATUS_STATE_SUSPEND 0x00040000 +#define BGE_APE_EVENT_STATUS_EVENT_PENDING 0x80000000 + +#define BGE_APE_DEBUG_LOG 0x4E00 +#define BGE_APE_DEBUG_LOG_LEN 0x0100 + +#define BGE_APE_PER_LOCK_REQ 0x8400 +#define BGE_APE_PER_LOCK_GRANT 0x8420 + +#define BGE_APE_LOCK_PER_REQ_DRIVER0 0x00001000 +#define BGE_APE_LOCK_PER_REQ_DRIVER1 0x00000002 +#define BGE_APE_LOCK_PER_REQ_DRIVER2 0x00000004 +#define BGE_APE_LOCK_PER_REQ_DRIVER3 0x00000008 + +#define BGE_APE_PER_LOCK_GRANT_DRIVER0 0x00001000 +#define BGE_APE_PER_LOCK_GRANT_DRIVER1 0x00000002 +#define BGE_APE_PER_LOCK_GRANT_DRIVER2 0x00000004 +#define BGE_APE_PER_LOCK_GRANT_DRIVER3 0x00000008 + +/* APE Mutex Resources */ +#define BGE_APE_LOCK_PHY0 0 +#define BGE_APE_LOCK_GRC 1 +#define BGE_APE_LOCK_PHY1 2 +#define BGE_APE_LOCK_PHY2 3 +#define BGE_APE_LOCK_MEM 4 +#define BGE_APE_LOCK_PHY3 5 +#define BGE_APE_LOCK_GPIO 7 #define BGE_MEMWIN_READ(sc, x, val) \ do { \ @@ -2659,7 +2789,7 @@ struct bge_gib { #define BGE_INC(x, y) (x) = (x + 1) % y /* - * Register access macros. The Tigon always uses memory mapped register + * BAR0 MAC register access macros. The Tigon always uses memory mapped register * accesses and all registers must be accessed with 32 bit operations. */ @@ -2674,6 +2804,18 @@ struct bge_gib { #define BGE_CLRBIT(sc, reg, x) \ CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) & ~(x))) +/* BAR2 APE register access macros. */ +#define APE_WRITE_4(sc, reg, val) \ + bus_write_4(sc->bge_res2, reg, val) + +#define APE_READ_4(sc, reg) \ + bus_read_4(sc->bge_res2, reg) + +#define APE_SETBIT(sc, reg, x) \ + APE_WRITE_4(sc, reg, (APE_READ_4(sc, reg) | (x))) +#define APE_CLRBIT(sc, reg, x) \ + APE_WRITE_4(sc, reg, (APE_READ_4(sc, reg) & ~(x))) + #define PCI_SETBIT(dev, reg, x, s) \ pci_write_config(dev, reg, (pci_read_config(dev, reg, s) | (x)), s) #define PCI_CLRBIT(dev, reg, x, s) \ @@ -2800,7 +2942,8 @@ struct bge_softc { device_t bge_miibus; void *bge_intrhand; struct resource *bge_irq; - struct resource *bge_res; + struct resource *bge_res; /* MAC mapped I/O */ + struct resource *bge_res2; /* APE mapped I/O */ struct ifmedia bge_ifmedia; /* TBI media info */ int bge_expcap; int bge_expmrq; @@ -2814,6 +2957,7 @@ struct bge_softc { #define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_CPMU_PRESENT 0x00000020 #define BGE_FLAG_TAGGED_STATUS 0x00000040 +#define BGE_FLAG_APE 0x00000080 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 @@ -2833,6 +2977,13 @@ struct bge_softc { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 04:34:06 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 62426A41; Mon, 26 Nov 2012 04:34:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF788FC15; Mon, 26 Nov 2012 04:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4Y6wZ094861; Mon, 26 Nov 2012 04:34:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4Y6Cx094859; Mon, 26 Nov 2012 04:34:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260434.qAQ4Y6Cx094859@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:34:05 +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: r243549 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:34:06 -0000 Author: yongari Date: Mon Nov 26 04:34:05 2012 New Revision: 243549 URL: http://svnweb.freebsd.org/changeset/base/243549 Log: MFC r241983-241985: r241983: Do not hardcode phy address. Multi-port controllers use different phy address. r241984: Ethernet@WireSpeed is defined for 1000baseT adapter to establish a link at a lower speed so enabling it for fiber adapters is wrong. Fix the issue by setting BGE_PHY_NO_WIRESPEED such that brgphy(4) wouldn't enable the feature. While I'm here move PHY specific feature/bug configuration to new location(just before mii attach) for readability. r241985: For fast ethernet controllers, Ethernet@WireSpeed is not defined so explicitly set BGE_PHY_NO_WIRESPEED flag. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:29:47 2012 (r243548) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:34:05 2012 (r243549) @@ -3240,7 +3240,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg, pcistate; u_char eaddr[ETHER_ADDR_LEN]; - int capmask, error, msicount, phy_addr, reg, rid, trys; + int capmask, error, msicount, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -3300,7 +3300,7 @@ bge_attach(device_t dev) sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ - phy_addr = 1; + sc->bge_phy_addr = 1; /* * PHY address mapping for various devices. * @@ -3329,29 +3329,18 @@ bge_attach(device_t dev) if (sc->bge_chipid != BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & BGE_SGDIGSTS_IS_SERDES) - phy_addr = sc->bge_func_addr + 8; + sc->bge_phy_addr = sc->bge_func_addr + 8; else - phy_addr = sc->bge_func_addr + 1; + sc->bge_phy_addr = sc->bge_func_addr + 1; } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) - phy_addr = sc->bge_func_addr + 8; + sc->bge_phy_addr = sc->bge_func_addr + 8; else - phy_addr = sc->bge_func_addr + 1; + sc->bge_phy_addr = sc->bge_func_addr + 1; } } - /* - * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the - * 5705 A0 and A1 chips. - */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5700 || - (sc->bge_asicrev == BGE_ASICREV_BCM5705 && - (sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && - sc->bge_chipid != BGE_CHIPID_BCM5705_A1)) || - sc->bge_asicrev == BGE_ASICREV_BCM5906) - sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; - if (bge_has_eaddr(sc)) sc->bge_flags |= BGE_FLAG_EADDR; @@ -3436,38 +3425,6 @@ bge_attach(device_t dev) /* Add SYSCTLs, requires the chipset family to be set. */ bge_add_sysctls(sc); - /* Set various PHY bug flags. */ - if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || - sc->bge_chipid == BGE_CHIPID_BCM5701_B0) - sc->bge_phy_flags |= BGE_PHY_CRC_BUG; - if (sc->bge_chiprev == BGE_CHIPREV_5703_AX || - sc->bge_chiprev == BGE_CHIPREV_5704_AX) - sc->bge_phy_flags |= BGE_PHY_ADC_BUG; - if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) - sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; - if (pci_get_subvendor(dev) == DELL_VENDORID) - sc->bge_phy_flags |= BGE_PHY_NO_3LED; - if ((BGE_IS_5705_PLUS(sc)) && - sc->bge_asicrev != BGE_ASICREV_BCM5906 && - sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM5719 && - sc->bge_asicrev != BGE_ASICREV_BCM5720 && - sc->bge_asicrev != BGE_ASICREV_BCM5785 && - sc->bge_asicrev != BGE_ASICREV_BCM57765 && - sc->bge_asicrev != BGE_ASICREV_BCM57780) { - if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5761 || - sc->bge_asicrev == BGE_ASICREV_BCM5784 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) { - if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && - pci_get_device(dev) != BCOM_DEVICEID_BCM5756) - sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; - if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) - sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; - } else - sc->bge_phy_flags |= BGE_PHY_BER_BUG; - } - /* Identify the chips that use an CPMU. */ if (BGE_IS_5717_PLUS(sc) || sc->bge_asicrev == BGE_ASICREV_BCM5784 || @@ -3528,6 +3485,7 @@ bge_attach(device_t dev) sc->bge_asicrev == BGE_ASICREV_BCM5906) { /* These chips are 10/100 only. */ capmask &= ~BMSR_EXTSTAT; + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; } /* @@ -3785,12 +3743,55 @@ bge_attach(device_t dev) /* The SysKonnect SK-9D41 is a 1000baseSX card. */ if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { - if (BGE_IS_5705_PLUS(sc)) + if (BGE_IS_5705_PLUS(sc)) { sc->bge_flags |= BGE_FLAG_MII_SERDES; - else + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; + } else sc->bge_flags |= BGE_FLAG_TBI; } + /* Set various PHY bug flags. */ + if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || + sc->bge_chipid == BGE_CHIPID_BCM5701_B0) + sc->bge_phy_flags |= BGE_PHY_CRC_BUG; + if (sc->bge_chiprev == BGE_CHIPREV_5703_AX || + sc->bge_chiprev == BGE_CHIPREV_5704_AX) + sc->bge_phy_flags |= BGE_PHY_ADC_BUG; + if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) + sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; + if (pci_get_subvendor(dev) == DELL_VENDORID) + sc->bge_phy_flags |= BGE_PHY_NO_3LED; + if ((BGE_IS_5705_PLUS(sc)) && + sc->bge_asicrev != BGE_ASICREV_BCM5906 && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5719 && + sc->bge_asicrev != BGE_ASICREV_BCM5720 && + sc->bge_asicrev != BGE_ASICREV_BCM5785 && + sc->bge_asicrev != BGE_ASICREV_BCM57765 && + sc->bge_asicrev != BGE_ASICREV_BCM57780) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5787) { + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5756) + sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; + if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) + sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; + } else + sc->bge_phy_flags |= BGE_PHY_BER_BUG; + } + + /* + * Don't enable Ethernet@WireSpeed for the 5700 or the + * 5705 A0 and A1 chips. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 || + (sc->bge_asicrev == BGE_ASICREV_BCM5705 && + (sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && + sc->bge_chipid != BGE_CHIPID_BCM5705_A1))) + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; + if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, bge_ifmedia_sts); @@ -3814,13 +3815,13 @@ again: bge_asf_driver_up(sc); error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd, - bge_ifmedia_sts, capmask, phy_addr, MII_OFFSET_ANY, + bge_ifmedia_sts, capmask, sc->bge_phy_addr, MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); - bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, - BMCR_RESET); + bge_miibus_writereg(sc->bge_dev, + sc->bge_phy_addr, MII_BMCR, BMCR_RESET); goto again; } device_printf(sc->bge_dev, "attaching PHYs failed\n"); @@ -6042,9 +6043,10 @@ bge_link_upd(struct bge_softc *sc) /* Clear the interrupt. */ CSR_WRITE_4(sc, BGE_MAC_EVT_ENB, BGE_EVTENB_MI_INTERRUPT); - bge_miibus_readreg(sc->bge_dev, 1, BRGPHY_MII_ISR); - bge_miibus_writereg(sc->bge_dev, 1, BRGPHY_MII_IMR, - BRGPHY_INTRS); + bge_miibus_readreg(sc->bge_dev, sc->bge_phy_addr, + BRGPHY_MII_ISR); + bge_miibus_writereg(sc->bge_dev, sc->bge_phy_addr, + BRGPHY_MII_IMR, BRGPHY_INTRS); } return; } Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:29:47 2012 (r243548) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:34:05 2012 (r243549) @@ -2984,6 +2984,7 @@ struct bge_softc { #define BGE_MFW_TYPE_DASH 0x00000008 int bge_phy_ape_lock; int bge_func_addr; + int bge_phy_addr; uint32_t bge_phy_flags; #define BGE_PHY_NO_WIRESPEED 0x00000001 #define BGE_PHY_ADC_BUG 0x00000002 From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 04:39:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 122F6DF7; Mon, 26 Nov 2012 04:39:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D16918FC13; Mon, 26 Nov 2012 04:39:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4dfNb095976; Mon, 26 Nov 2012 04:39:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4df9d095975; Mon, 26 Nov 2012 04:39:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260439.qAQ4df9d095975@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:39:41 +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: r243551 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:39:42 -0000 Author: yongari Date: Mon Nov 26 04:39:41 2012 New Revision: 243551 URL: http://svnweb.freebsd.org/changeset/base/243551 Log: MFC r242426: TCP/UDP checksum offloading feature for IP fragmented datagram was removed in r99417. bge(4) controllers can do TCP checksum offload for IP fragmented datagrams but unlike ti(4), it lacks UDP checksum offloading for IP fragmented datagrams. The problem was bge(4) blindly requested TCP/UDP checksum for IP fragmented datagrams such that it resulted in corrupted UDP datagrams before r99417. Remove remaining code for TCP checksum offloading for IP fragmented datagrams which should have been removed in r99417. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:34:53 2012 (r243550) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:39:41 2012 (r243551) @@ -5128,10 +5128,6 @@ bge_encap(struct bge_softc *sc, struct m return (error); } } - if (m->m_flags & M_LASTFRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG; } if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) { @@ -5253,29 +5249,6 @@ bge_start_locked(struct ifnet *ifp) break; /* - * XXX - * The code inside the if() block is never reached since we - * must mark CSUM_IP_FRAGS in our if_hwassist to start getting - * requests to checksum TCP/UDP in a fragmented packet. - * - * XXX - * safety overkill. If this is a fragmented packet chain - * with delayed TCP/UDP checksums, then only encapsulate - * it if we have enough descriptors to handle the entire - * chain at once. - * (paranoia -- may not actually be needed) - */ - if (m_head->m_flags & M_FIRSTFRAG && - m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) { - if ((BGE_TX_RING_CNT - sc->bge_txcnt) < - m_head->m_pkthdr.csum_data + 16) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } - } - - /* * Pack the data into the transmit ring. If we * don't have room, set the OACTIVE flag and wait * for the NIC to drain the ring. From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 05:13:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47F876DA; Mon, 26 Nov 2012 05:13:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE738FC12; Mon, 26 Nov 2012 05:13:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ5Dwfw003049; Mon, 26 Nov 2012 05:13:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ5DwZV003048; Mon, 26 Nov 2012 05:13:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260513.qAQ5DwZV003048@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 05:13:58 +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: r243557 - stable/9/bin/mv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 05:13:58 -0000 Author: eadler Date: Mon Nov 26 05:13:57 2012 New Revision: 243557 URL: http://svnweb.freebsd.org/changeset/base/243557 Log: MFC r243072: Follow the behavior as specified in POSIX: if (exists AND (NOT f_option) AND ((not_writable AND input_is_terminal) OR i_option)) prompt in particular, add the test for input_is_terminal PR: bin/173039 Approved by: cperciva (implicit) Modified: stable/9/bin/mv/mv.c Directory Properties: stable/9/bin/mv/ (props changed) Modified: stable/9/bin/mv/mv.c ============================================================================== --- stable/9/bin/mv/mv.c Mon Nov 26 05:13:57 2012 (r243556) +++ stable/9/bin/mv/mv.c Mon Nov 26 05:13:57 2012 (r243557) @@ -199,7 +199,7 @@ do_move(const char *from, const char *to } else if (iflg) { (void)fprintf(stderr, "overwrite %s? %s", to, YESNO); ask = 1; - } else if (access(to, W_OK) && !stat(to, &sb)) { + } else if (access(to, W_OK) && !stat(to, &sb) && isatty(STDIN_FILENO)) { strmode(sb.st_mode, modep); (void)fprintf(stderr, "override %s%s%s/%s for %s? %s", modep + 1, modep[9] == ' ' ? "" : " ", From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 15:34:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC1DB6DD; Mon, 26 Nov 2012 15:34:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6C408FC14; Mon, 26 Nov 2012 15:34:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQFYSft018239; Mon, 26 Nov 2012 15:34:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQFYS2i018238; Mon, 26 Nov 2012 15:34:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211261534.qAQFYS2i018238@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Nov 2012 15:34:28 +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: r243562 - stable/9/sys/dev/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 15:34:29 -0000 Author: mav Date: Mon Nov 26 15:34:28 2012 New Revision: 243562 URL: http://svnweb.freebsd.org/changeset/base/243562 Log: MFC r238943: Add several performance optimizations to acpi_cpu_idle(). For C1 and C2 states use cpu_ticks() to measure sleep time instead of much slower ACPI timer. We can't do it for C3, as TSC may stop there. But it is less important there as wake up latency is high any way. For C1 and C2 states do not check/clear bus mastering activity status, as it is important only for C3. As side effect it can make CPU enter C2 instead of C3 if last BM activity was two sleeps back (unlike one before), but that may be even good because of collecting more statistics. Premature BM wakeup from C3, entered because of overestimation, can easily be worse then entering C2 from both performance and power consumption points of view. Together on dual Xeon E5645 system on sequential 512 bytes read test this change makes cpu_idle_acpi() as fast as simplest cpu_idle_hlt() and only few percents slower then cpu_idle_mwait(), while deeper states are still actively used during idle periods. To help with diagnostics, add C-state type into dev.cpu.X.cx_supported. PR: kern/170021 Modified: stable/9/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Mon Nov 26 13:16:55 2012 (r243561) +++ stable/9/sys/dev/acpica/acpi_cpu.c Mon Nov 26 15:34:28 2012 (r243562) @@ -876,7 +876,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported), SBUF_FIXEDLEN); for (i = 0; i < sc->cpu_cx_count; i++) - sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); + sbuf_printf(&sb, "C%d/%d/%d ", i + 1, sc->cpu_cx_states[i].type, + sc->cpu_cx_states[i].trans_lat); sbuf_trim(&sb); sbuf_finish(&sb); } @@ -921,6 +922,7 @@ acpi_cpu_idle() { struct acpi_cpu_softc *sc; struct acpi_cx *cx_next; + uint64_t cputicks; uint32_t start_time, end_time; int bm_active, cx_next_idx, i; @@ -960,11 +962,12 @@ acpi_cpu_idle() * driver polling for new devices keeps this bit set all the * time if USB is loaded. */ - if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { + if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0 && + cx_next_idx > sc->cpu_non_c3) { AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); if (bm_active != 0) { AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); - cx_next_idx = min(cx_next_idx, sc->cpu_non_c3); + cx_next_idx = sc->cpu_non_c3; } } @@ -980,11 +983,10 @@ acpi_cpu_idle() * we are called inside critical section, delaying context switch. */ if (cx_next->type == ACPI_STATE_C1) { - AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + cputicks = cpu_ticks(); acpi_cpu_c1(); - AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - end_time = PM_USEC(acpi_TimerDelta(end_time, start_time)); - if (curthread->td_critnest == 0) + end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); + if (curthread->td_critnest == 0) end_time = min(end_time, 500000 / hz); sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + end_time) / 4; return; @@ -1008,7 +1010,13 @@ acpi_cpu_idle() * get the time very close to the CPU start/stop clock logic, this * is the only reliable time source. */ - AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + if (cx_next->type == ACPI_STATE_C3) { + AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + cputicks = 0; + } else { + start_time = 0; + cputicks = cpu_ticks(); + } CPU_GET_REG(cx_next->p_lvlx, 1); /* @@ -1018,7 +1026,11 @@ acpi_cpu_idle() * margin that we are certain to have a correct value. */ AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + if (cx_next->type == ACPI_STATE_C3) { + AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + end_time = acpi_TimerDelta(end_time, start_time); + } else + end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); /* Enable bus master arbitration and disable bus master wakeup. */ if (cx_next->type == ACPI_STATE_C3 && @@ -1028,8 +1040,6 @@ acpi_cpu_idle() } ACPI_ENABLE_IRQS(); - /* Find the actual time asleep in microseconds. */ - end_time = acpi_TimerDelta(end_time, start_time); sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + PM_USEC(end_time)) / 4; } From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 26 18:10:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 830E3DF5; Mon, 26 Nov 2012 18:10:15 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6769A8FC15; Mon, 26 Nov 2012 18:10:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQIAFRY043493; Mon, 26 Nov 2012 18:10:15 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQIAFRE043492; Mon, 26 Nov 2012 18:10:15 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201211261810.qAQIAFRE043492@svn.freebsd.org> From: Warren Block Date: Mon, 26 Nov 2012 18:10:15 +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: r243566 - stable/9/sbin/mdconfig X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 18:10:15 -0000 Author: wblock (doc committer) Date: Mon Nov 26 18:10:15 2012 New Revision: 243566 URL: http://svnweb.freebsd.org/changeset/base/243566 Log: MFC r242546: Add an example showing the use of gnop(8) to skip over header data. PR: kern/145999 Reviewed by: mjg Modified: stable/9/sbin/mdconfig/mdconfig.8 Directory Properties: stable/9/sbin/mdconfig/ (props changed) Modified: stable/9/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/9/sbin/mdconfig/mdconfig.8 Mon Nov 26 16:44:03 2012 (r243565) +++ stable/9/sbin/mdconfig/mdconfig.8 Mon Nov 26 18:10:15 2012 (r243566) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd November 3, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -253,6 +253,18 @@ are implied), using the first available device, and then mount the new memory disk: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt +.Pp +.Ed +Create a file-backed device from a hard disk image that begins +with 512K of raw header information. +.Xr gnop 8 +is used to skip over the header information, positioning +.Pa md1.nop +to the start of the filesystem in the image. +.Bd -literal -offset indent +mdconfig -f diskimage.img -u 1 +gnop create -o 512K md1 +mount /dev/md1.nop /mnt .Ed .Sh SEE ALSO .Xr md 4 , From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 27 01:28:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A85B3B52; Tue, 27 Nov 2012 01:28:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B7F38FC27; Tue, 27 Nov 2012 01:28:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1SZh9033797; Tue, 27 Nov 2012 01:28:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1SZ6w033796; Tue, 27 Nov 2012 01:28:35 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211270128.qAR1SZ6w033796@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 27 Nov 2012 01:28:35 +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: r243582 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:28:35 -0000 Author: mjg Date: Tue Nov 27 01:28:35 2012 New Revision: 243582 URL: http://svnweb.freebsd.org/changeset/base/243582 Log: MFC r243007: enterpgrp: get rid of pgrp2 variable and use KASSERT directly on pgfind result. pgrp2 was used only for debugging, but pgrp2 = pgfind(..) was present in compiled code Modified: stable/9/sys/kern/kern_proc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Tue Nov 27 01:17:50 2012 (r243581) +++ stable/9/sys/kern/kern_proc.c Tue Nov 27 01:28:35 2012 (r243582) @@ -421,17 +421,13 @@ enterpgrp(p, pgid, pgrp, sess) struct pgrp *pgrp; struct session *sess; { - struct pgrp *pgrp2; sx_assert(&proctree_lock, SX_XLOCKED); KASSERT(pgrp != NULL, ("enterpgrp: pgrp == NULL")); KASSERT(p->p_pid == pgid, ("enterpgrp: new pgrp and pid != pgid")); - - pgrp2 = pgfind(pgid); - - KASSERT(pgrp2 == NULL, + KASSERT(pgfind(pgid) == NULL, ("enterpgrp: pgrp with pgid exists")); KASSERT(!SESS_LEADER(p), ("enterpgrp: session leader attempted setpgrp")); From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 27 01:33:23 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9216E3B; Tue, 27 Nov 2012 01:33:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D05B8FC08; Tue, 27 Nov 2012 01:33:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1XNUC034989; Tue, 27 Nov 2012 01:33:23 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1XNx4034987; Tue, 27 Nov 2012 01:33:23 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211270133.qAR1XNx4034987@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 27 Nov 2012 01:33:23 +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: r243584 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:33:23 -0000 Author: mjg Date: Tue Nov 27 01:33:23 2012 New Revision: 243584 URL: http://svnweb.freebsd.org/changeset/base/243584 Log: MFC r243234: Fix possible fp reference leak in posix_openpt Modified: stable/9/sys/kern/tty_pts.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/tty_pts.c ============================================================================== --- stable/9/sys/kern/tty_pts.c Tue Nov 27 01:30:12 2012 (r243583) +++ stable/9/sys/kern/tty_pts.c Tue Nov 27 01:33:23 2012 (r243584) @@ -836,6 +836,7 @@ sys_posix_openpt(struct thread *td, stru error = pts_alloc(FFLAGS(uap->flags & O_ACCMODE), td, fp); if (error != 0) { fdclose(td->td_proc->p_fd, fp, fd, td); + fdrop(fp, td); return (error); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 27 01:59:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E9943E5; Tue, 27 Nov 2012 01:59:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11C9C8FC13; Tue, 27 Nov 2012 01:59:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1xqkl041028; Tue, 27 Nov 2012 01:59:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1xpsX041008; Tue, 27 Nov 2012 01:59:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211270159.qAR1xpsX041008@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 27 Nov 2012 01:59:51 +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: r243586 - in stable/9: . sbin/ipfw share/man/man4 sys/conf sys/netinet sys/netinet6 sys/netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:59:52 -0000 Author: ae Date: Tue Nov 27 01:59:51 2012 New Revision: 243586 URL: http://svnweb.freebsd.org/changeset/base/243586 Log: MFC r242079: Remove the IPFIREWALL_FORWARD kernel option and make possible to turn on the related functionality in the runtime via the sysctl variable net.pfil.forward. It is turned off by default. MFC r242082: Note the removal of the IPFIREWALL_FORWARD kernel option. MFC r242463: Remove the recently added sysctl variable net.pfil.forward. Instead, add protocol specific mbuf flags M_IP_NEXTHOP and M_IP6_NEXTHOP. Use them to indicate that the mbuf's chain contains the PACKET_TAG_IPFORWARD tag. And do a tag lookup only when this flag is set. Modified: stable/9/UPDATING (contents, props changed) stable/9/sbin/ipfw/ipfw.8 stable/9/share/man/man4/ipfirewall.4 stable/9/sys/conf/NOTES stable/9/sys/conf/options stable/9/sys/netinet/ip_fastfwd.c stable/9/sys/netinet/ip_input.c stable/9/sys/netinet/ip_output.c stable/9/sys/netinet/ip_var.h stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/udp_usrreq.c stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/ip6_var.h stable/9/sys/netinet6/udp6_usrreq.c stable/9/sys/netpfil/ipfw/ip_fw2.c stable/9/sys/netpfil/ipfw/ip_fw_pfil.c stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/9/sbin/ipfw/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/UPDATING Tue Nov 27 01:59:51 2012 (r243586) @@ -10,6 +10,10 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20121102: + The IPFIREWALL_FORWARD kernel option has been removed. Its + functionality now turned on by default. + 20120913: The random(4) support for the VIA hardware random number generator (`PADLOCK') is no longer enabled unconditionally. Modified: stable/9/sbin/ipfw/ipfw.8 ============================================================================== --- stable/9/sbin/ipfw/ipfw.8 Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sbin/ipfw/ipfw.8 Tue Nov 27 01:59:51 2012 (r243586) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2012 +.Dd October 25, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -764,11 +764,6 @@ This makes the .Xr netstat 1 entry look rather weird but is intended for use with transparent proxy servers. -.Pp -To enable -.Cm fwd -a custom kernel needs to be compiled with the option -.Cd "options IPFIREWALL_FORWARD" . .It Cm nat Ar nat_nr | tablearg Pass packet to a nat instance Modified: stable/9/share/man/man4/ipfirewall.4 ============================================================================== --- stable/9/share/man/man4/ipfirewall.4 Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/share/man/man4/ipfirewall.4 Tue Nov 27 01:59:51 2012 (r243586) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2006 +.Dd October 25, 2012 .Dt IPFW 4 .Os .Sh NAME @@ -21,7 +21,6 @@ Other kernel options related to which may also be useful are: .Bd -ragged -offset indent .Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT" -.Cd "options IPFIREWALL_FORWARD" .Cd "options IPFIREWALL_VERBOSE" .Cd "options IPFIREWALL_VERBOSE_LIMIT=100" .Ed @@ -72,12 +71,6 @@ from flooding system logs or causing loc This option may be set to the number of packets which will be logged on a per-entry basis before the entry is rate-limited. .Pp -Policy routing and transparent forwarding features of -.Nm -can be enabled by -.Dv IPFIREWALL_FORWARD -kernel option. -.Pp The user interface for .Nm is implemented by the Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/conf/NOTES Tue Nov 27 01:59:51 2012 (r243586) @@ -903,12 +903,6 @@ device lagg # IPDIVERT enables the divert IP sockets, used by ``ipfw divert''. It # depends on IPFIREWALL if compiled into the kernel. # -# IPFIREWALL_FORWARD enables changing of the packet destination either -# to do some sort of policy routing or transparent proxying. Used by -# ``ipfw forward''. All redirections apply to locally generated -# packets too. Because of this great care is required when -# crafting the ruleset. -# # IPFIREWALL_NAT adds support for in kernel nat in ipfw, and it requires # LIBALIAS. # @@ -925,7 +919,6 @@ options IPFIREWALL #firewall options IPFIREWALL_VERBOSE #enable logging to syslogd(8) options IPFIREWALL_VERBOSE_LIMIT=100 #limit verbosity options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default -options IPFIREWALL_FORWARD #packet destination changes options IPFIREWALL_NAT #ipfw kernel nat support options IPDIVERT #divert sockets options IPFILTER #ipfilter support Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/conf/options Tue Nov 27 01:59:51 2012 (r243586) @@ -405,7 +405,7 @@ IPFILTER_LOG opt_ipfilter.h IPFILTER_LOOKUP opt_ipfilter.h IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h -IPFIREWALL_FORWARD opt_ipfw.h +IPFIREWALL_FORWARD IPFIREWALL_NAT opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h Modified: stable/9/sys/netinet/ip_fastfwd.c ============================================================================== --- stable/9/sys/netinet/ip_fastfwd.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_fastfwd.c Tue Nov 27 01:59:51 2012 (r243586) @@ -167,9 +167,7 @@ ip_fastforward(struct mbuf *m) u_short sum, ip_len; int error = 0; int hlen, mtu; -#ifdef IPFIREWALL_FORWARD - struct m_tag *fwd_tag; -#endif + struct m_tag *fwd_tag = NULL; /* * Are we active and forwarding packets? @@ -378,14 +376,13 @@ ip_fastforward(struct mbuf *m) * Go on with new destination address */ } -#ifdef IPFIREWALL_FORWARD + if (m->m_flags & M_FASTFWD_OURS) { /* * ipfw changed it for a local address on this host. */ goto forwardlocal; } -#endif /* IPFIREWALL_FORWARD */ passin: /* @@ -455,20 +452,13 @@ passin: /* * Destination address changed? */ -#ifndef IPFIREWALL_FORWARD - if (odest.s_addr != dest.s_addr) { -#else - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); + if (m->m_flags & M_IP_NEXTHOP) + fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); if (odest.s_addr != dest.s_addr || fwd_tag != NULL) { -#endif /* IPFIREWALL_FORWARD */ /* * Is it now for a local address on this host? */ -#ifndef IPFIREWALL_FORWARD - if (in_localip(dest)) { -#else if (m->m_flags & M_FASTFWD_OURS || in_localip(dest)) { -#endif /* IPFIREWALL_FORWARD */ forwardlocal: /* * Return packet for processing by ip_input(). @@ -483,13 +473,12 @@ forwardlocal: /* * Redo route lookup with new destination address */ -#ifdef IPFIREWALL_FORWARD if (fwd_tag) { dest.s_addr = ((struct sockaddr_in *) (fwd_tag + 1))->sin_addr.s_addr; m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } -#endif /* IPFIREWALL_FORWARD */ RTFREE(ro.ro_rt); if ((dst = ip_findroute(&ro, dest, m)) == NULL) return NULL; /* icmp unreach already sent */ Modified: stable/9/sys/netinet/ip_input.c ============================================================================== --- stable/9/sys/netinet/ip_input.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_input.c Tue Nov 27 01:59:51 2012 (r243586) @@ -516,22 +516,22 @@ tooshort: dchg = (odst.s_addr != ip->ip_dst.s_addr); ifp = m->m_pkthdr.rcvif; -#ifdef IPFIREWALL_FORWARD if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; goto ours; } - if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { - /* - * Directly ship the packet on. This allows forwarding - * packets originally destined to us to some other directly - * connected host. - */ - ip_forward(m, dchg); - return; + if (m->m_flags & M_IP_NEXTHOP) { + dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL); + if (dchg != 0) { + /* + * Directly ship the packet on. This allows + * forwarding packets originally destined to us + * to some other directly connected host. + */ + ip_forward(m, 1); + return; + } } -#endif /* IPFIREWALL_FORWARD */ - passin: /* * Process options and, if not destined for us, Modified: stable/9/sys/netinet/ip_output.c ============================================================================== --- stable/9/sys/netinet/ip_output.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_output.c Tue Nov 27 01:59:51 2012 (r243586) @@ -129,9 +129,7 @@ ip_output(struct mbuf *m, struct mbuf *o struct route iproute; struct rtentry *rte; /* cache for ro->ro_rt */ struct in_addr odst; -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag = NULL; -#endif #ifdef IPSEC int no_route_but_check_spd = 0; #endif @@ -216,11 +214,7 @@ again: ro->ro_lle = NULL; rte = NULL; } -#ifdef IPFIREWALL_FORWARD if (rte == NULL && fwd_tag == NULL) { -#else - if (rte == NULL) { -#endif bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); @@ -541,7 +535,6 @@ sendit: } } -#ifdef IPFIREWALL_FORWARD /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -562,17 +555,17 @@ sendit: goto done; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); if (ia != NULL) ifa_free(&ia->ia_ifa); goto again; } -#endif /* IPFIREWALL_FORWARD */ passout: /* 127/8 must not appear on wire - RFC1122. */ Modified: stable/9/sys/netinet/ip_var.h ============================================================================== --- stable/9/sys/netinet/ip_var.h Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_var.h Tue Nov 27 01:59:51 2012 (r243586) @@ -162,6 +162,7 @@ void kmod_ipstat_dec(int statnum); * mbuf flag used by ip_fastfwd */ #define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ #ifdef __NO_STRICT_ALIGNMENT #define IP_HDR_ALIGNED_P(ip) 1 Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/tcp_input.c Tue Nov 27 01:59:51 2012 (r243586) @@ -575,9 +575,7 @@ tcp_input(struct mbuf *m, int off0) uint8_t sig_checked = 0; #endif uint8_t iptos = 0; -#ifdef IPFIREWALL_FORWARD - struct m_tag *fwd_tag; -#endif + struct m_tag *fwd_tag = NULL; #ifdef INET6 struct ip6_hdr *ip6 = NULL; int isipv6; @@ -791,15 +789,13 @@ findpcb: } #endif -#ifdef IPFIREWALL_FORWARD /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); -#endif /* IPFIREWALL_FORWARD */ + if (m->m_flags & M_IP_NEXTHOP) + fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); #ifdef INET6 -#ifdef IPFIREWALL_FORWARD if (isipv6 && fwd_tag != NULL) { struct sockaddr_in6 *next_hop6; @@ -825,9 +821,8 @@ findpcb: } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); - } else -#endif /* IPFIREWALL_FORWARD */ - if (isipv6) { + m->m_flags &= ~M_IP_NEXTHOP; + } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, @@ -838,7 +833,6 @@ findpcb: else #endif #ifdef INET -#ifdef IPFIREWALL_FORWARD if (fwd_tag != NULL) { struct sockaddr_in *next_hop; @@ -864,8 +858,8 @@ findpcb: } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } else -#endif /* IPFIREWALL_FORWARD */ inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, Modified: stable/9/sys/netinet/udp_usrreq.c ============================================================================== --- stable/9/sys/netinet/udp_usrreq.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/udp_usrreq.c Tue Nov 27 01:59:51 2012 (r243586) @@ -341,9 +341,7 @@ udp_input(struct mbuf *m, int off) int len; struct ip save_ip; struct sockaddr_in udp_in; -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif ifp = m->m_pkthdr.rcvif; UDPSTAT_INC(udps_ipackets); @@ -546,12 +544,12 @@ udp_input(struct mbuf *m, int off) /* * Locate pcb for datagram. */ -#ifdef IPFIREWALL_FORWARD + /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag != NULL) { + if ((m->m_flags & M_IP_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { struct sockaddr_in *next_hop; next_hop = (struct sockaddr_in *)(fwd_tag + 1); @@ -576,8 +574,8 @@ udp_input(struct mbuf *m, int off) } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } else -#endif /* IPFIREWALL_FORWARD */ inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, ifp, m); Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_forward.c Tue Nov 27 01:59:51 2012 (r243586) @@ -108,9 +108,7 @@ ip6_forward(struct mbuf *m, int srcrt) #ifdef SCTP int sw_csum; #endif -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; #ifdef IPSEC @@ -359,9 +357,7 @@ again: dst->sin6_len = sizeof(struct sockaddr_in6); dst->sin6_family = AF_INET6; dst->sin6_addr = ip6->ip6_dst; -#ifdef IPFIREWALL_FORWARD again2: -#endif rin6.ro_rt = in6_rtalloc1((struct sockaddr *)dst, 0, 0, M_GETFIB(m)); if (rin6.ro_rt != NULL) RT_UNLOCK(rin6.ro_rt); @@ -596,7 +592,6 @@ skip_routing: goto again; /* Redo the routing table lookup. */ } -#ifdef IPFIREWALL_FORWARD /* See if local, if yes, send it to netisr. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -614,15 +609,15 @@ skip_routing: goto out; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in6 *)&rin6.ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP6_NEXTHOP; m_tag_delete(m, fwd_tag); goto again2; } -#endif /* IPFIREWALL_FORWARD */ pass: error = nd6_output(rt->rt_ifp, origifp, m, dst, rt); Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_input.c Tue Nov 27 01:59:51 2012 (r243586) @@ -626,14 +626,14 @@ ip6_input(struct mbuf *m) ip6 = mtod(m, struct ip6_hdr *); srcrt = !IN6_ARE_ADDR_EQUAL(&odst, &ip6->ip6_dst); -#ifdef IPFIREWALL_FORWARD if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; ours = 1; deliverifp = m->m_pkthdr.rcvif; goto hbhcheck; } - if (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { + if ((m->m_flags & M_IP6_NEXTHOP) && + m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { /* * Directly ship the packet on. This allows forwarding * packets originally destined to us to some other directly @@ -642,7 +642,6 @@ ip6_input(struct mbuf *m) ip6_forward(m, 1); goto out; } -#endif /* IPFIREWALL_FORWARD */ passin: /* Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_output.c Tue Nov 27 01:59:51 2012 (r243586) @@ -257,9 +257,7 @@ ip6_output(struct mbuf *m0, struct ip6_p int segleft_org = 0; struct secpolicy *sp = NULL; #endif /* IPSEC */ -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif ip6 = mtod(m, struct ip6_hdr *); if (ip6 == NULL) { @@ -915,7 +913,6 @@ again: goto again; /* Redo the routing table lookup. */ } -#ifdef IPFIREWALL_FORWARD /* See if local, if yes, send it to netisr. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -933,15 +930,15 @@ again: goto done; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in6 *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP6_NEXTHOP; m_tag_delete(m, fwd_tag); goto again; } -#endif /* IPFIREWALL_FORWARD */ passout: /* Modified: stable/9/sys/netinet6/ip6_var.h ============================================================================== --- stable/9/sys/netinet6/ip6_var.h Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_var.h Tue Nov 27 01:59:51 2012 (r243586) @@ -285,6 +285,8 @@ struct ip6aux { #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ + #ifdef __NO_STRICT_ALIGNMENT #define IP6_HDR_ALIGNED_P(ip) 1 #else Modified: stable/9/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/udp6_usrreq.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/udp6_usrreq.c Tue Nov 27 01:59:51 2012 (r243586) @@ -182,9 +182,7 @@ udp6_input(struct mbuf **mp, int *offp, int off = *offp; int plen, ulen; struct sockaddr_in6 fromsa; -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif uint16_t uh_sum; ifp = m->m_pkthdr.rcvif; @@ -393,12 +391,12 @@ udp6_input(struct mbuf **mp, int *offp, /* * Locate pcb for datagram. */ -#ifdef IPFIREWALL_FORWARD + /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag != NULL) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { struct sockaddr_in6 *next_hop6; next_hop6 = (struct sockaddr_in6 *)(fwd_tag + 1); @@ -424,8 +422,8 @@ udp6_input(struct mbuf **mp, int *offp, } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP6_NEXTHOP; } else -#endif /* IPFIREWALL_FORWARD */ inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src, uh->uh_sport, &ip6->ip6_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, Modified: stable/9/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw2.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netpfil/ipfw/ip_fw2.c Tue Nov 27 01:59:51 2012 (r243586) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2532,12 +2533,6 @@ ipfw_init(void) "(+ipv6) " #endif "initialized, divert %s, nat %s, " - "rule-based forwarding " -#ifdef IPFIREWALL_FORWARD - "enabled, " -#else - "disabled, " -#endif "default to %s, logging ", #ifdef IPDIVERT "enabled", Modified: stable/9/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_pfil.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netpfil/ipfw/ip_fw_pfil.c Tue Nov 27 01:59:51 2012 (r243586) @@ -153,7 +153,7 @@ again: /* next_hop may be set by ipfw_chk */ if (args.next_hop == NULL && args.next_hop6 == NULL) break; /* pass */ -#if !defined(IPFIREWALL_FORWARD) || (!defined(INET6) && !defined(INET)) +#if (!defined(INET6) && !defined(INET)) ret = EACCES; #else { @@ -193,6 +193,7 @@ again: bcopy(args.next_hop6, (fwd_tag+1), len); if (in6_localip(&args.next_hop6->sin6_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; + (*m0)->m_flags |= M_IP6_NEXTHOP; } #endif #ifdef INET @@ -200,11 +201,12 @@ again: bcopy(args.next_hop, (fwd_tag+1), len); if (in_localip(args.next_hop->sin_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; + (*m0)->m_flags |= M_IP_NEXTHOP; } #endif m_tag_prepend(*m0, fwd_tag); } -#endif /* IPFIREWALL_FORWARD */ +#endif /* INET || INET6 */ break; case IP_FW_DENY: Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Tue Nov 27 01:59:51 2012 (r243586) @@ -710,23 +710,14 @@ check_ipfw_struct(struct ip_fw *rule, in goto check_action; case O_FORWARD_IP: -#ifdef IPFIREWALL_FORWARD if (cmdlen != F_INSN_SIZE(ipfw_insn_sa)) goto bad_size; goto check_action; -#else - return EINVAL; -#endif - #ifdef INET6 case O_FORWARD_IP6: -#ifdef IPFIREWALL_FORWARD if (cmdlen != F_INSN_SIZE(ipfw_insn_sa6)) goto bad_size; goto check_action; -#else - return (EINVAL); -#endif #endif /* INET6 */ case O_DIVERT: From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 27 08:32:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24CBC782; Tue, 27 Nov 2012 08:32:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 091848FC08; Tue, 27 Nov 2012 08:32:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR8WC9r021181; Tue, 27 Nov 2012 08:32:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR8WCi1021180; Tue, 27 Nov 2012 08:32:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211270832.qAR8WCi1021180@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 27 Nov 2012 08:32:12 +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: r243605 - stable/9/sys/dev/cxgbe/tom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 08:32:13 -0000 Author: np Date: Tue Nov 27 08:32:12 2012 New Revision: 243605 URL: http://svnweb.freebsd.org/changeset/base/243605 Log: MFC r243110: cxgbe/tom: Plug mbuf leak. Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_listen.c Tue Nov 27 06:50:24 2012 (r243604) +++ stable/9/sys/dev/cxgbe/tom/t4_listen.c Tue Nov 27 08:32:12 2012 (r243605) @@ -559,8 +559,10 @@ t4_syncache_respond(struct toedev *tod, struct tcphdr *th = (void *)(ip + 1); wr = (struct wrqe *)atomic_readandclear_ptr(&synqe->wr); - if (wr == NULL) + if (wr == NULL) { + m_freem(m); return (EALREADY); + } bzero(&to, sizeof(to)); tcp_dooptions(&to, (void *)(th + 1), (th->th_off << 2) - sizeof(*th), From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 27 16:20:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E572B585; Tue, 27 Nov 2012 16:20:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C74748FC16; Tue, 27 Nov 2012 16:20:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARGKiO0006554; Tue, 27 Nov 2012 16:20:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARGKiSq006553; Tue, 27 Nov 2012 16:20:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211271620.qARGKiSq006553@svn.freebsd.org> From: Ed Maste Date: Tue, 27 Nov 2012 16:20:44 +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: r243616 - stable/9/sys/dev/mmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 16:20:45 -0000 Author: emaste Date: Tue Nov 27 16:20:44 2012 New Revision: 243616 URL: http://svnweb.freebsd.org/changeset/base/243616 Log: MFC r243387: Use %u for unsigned serial number Modified: stable/9/sys/dev/mmc/mmc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mmc/mmc.c ============================================================================== --- stable/9/sys/dev/mmc/mmc.c Tue Nov 27 12:23:57 2012 (r243615) +++ stable/9/sys/dev/mmc/mmc.c Tue Nov 27 16:20:44 2012 (r243616) @@ -878,7 +878,7 @@ mmc_format_card_id_string(struct mmc_iva else snprintf(oidstr, sizeof(oidstr), "0x%04x", ivar->cid.oid); snprintf(ivar->card_id_string, sizeof(ivar->card_id_string), - "%s%s %s %d.%d SN %d MFG %02d/%04d by %d %s", + "%s%s %s %d.%d SN %u MFG %02d/%04d by %d %s", ivar->mode == mode_sd ? "SD" : "MMC", ivar->high_cap ? "HC" : "", ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, ivar->cid.psn, ivar->cid.mdt_month, ivar->cid.mdt_year, From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 27 19:23:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3928825E; Tue, 27 Nov 2012 19:23:55 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1CC318FC08; Tue, 27 Nov 2012 19:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARJNsYb039481; Tue, 27 Nov 2012 19:23:54 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARJNsbM039480; Tue, 27 Nov 2012 19:23:54 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201211271923.qARJNsbM039480@svn.freebsd.org> From: Peter Jeremy Date: Tue, 27 Nov 2012 19:23:54 +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: r243623 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 19:23:55 -0000 Author: peterj Date: Tue Nov 27 19:23:54 2012 New Revision: 243623 URL: http://svnweb.freebsd.org/changeset/base/243623 Log: MFC r241708: Explicitly specify 'np' so that getty(8) does not simulate even parity on local.9600. PR: 76226 Approved by: jhb (mentor) Modified: stable/9/etc/gettytab Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/gettytab ============================================================================== --- stable/9/etc/gettytab Tue Nov 27 19:09:36 2012 (r243622) +++ stable/9/etc/gettytab Tue Nov 27 19:23:54 2012 (r243623) @@ -96,7 +96,7 @@ local.9600|CLOCAL tty @ 9600 Bd:\ :o0#0x00000007:o1#0x00000002:o2#0x00000007:\ :i0#0x00000704:i1#0x00000000:i2#0x00000704:\ :l0#0x000005cf:l1#0x00000000:l2#0x000005cf:\ - :sp#9600: + :sp#9600:np: # # Dial in rotary tables, speed selection via 'break' From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 28 17:43:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A3B911C; Wed, 28 Nov 2012 17:43:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0549B8FC0C; Wed, 28 Nov 2012 17:43:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASHhfoS099529; Wed, 28 Nov 2012 17:43:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASHhfVS099527; Wed, 28 Nov 2012 17:43:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281743.qASHhfVS099527@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 17:43:41 +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: r243654 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 17:43:42 -0000 Author: hselasky Date: Wed Nov 28 17:43:41 2012 New Revision: 243654 URL: http://svnweb.freebsd.org/changeset/base/243654 Log: Add new USB IDs. PR: usb/173503 Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Wed Nov 28 17:34:17 2012 (r243653) +++ stable/9/sys/dev/usb/serial/u3g.c Wed Nov 28 17:43:41 2012 (r243654) @@ -319,6 +319,10 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K3770, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K3770_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K4505, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K4505_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Wed Nov 28 17:34:17 2012 (r243653) +++ stable/9/sys/dev/usb/usbdevs Wed Nov 28 17:43:41 2012 (r243654) @@ -2188,12 +2188,16 @@ product HUAWEI E143D 0x143d 3G modem product HUAWEI E143E 0x143e 3G modem product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem +product HUAWEI K4505 0x1464 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider +product HUAWEI K3770 0x14c9 3G modem +product HUAWEI K3770_INIT 0x14d1 K3770 Initial product HUAWEI E3131_INIT 0x14fe 3G modem initial product HUAWEI E392 0x1505 LTE modem product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial +product HUAWEI K4505_INIT 0x1521 K4505 Initial product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 28 18:10:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC4F3BA9; Wed, 28 Nov 2012 18:10:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9823F8FC13; Wed, 28 Nov 2012 18:10:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASIA5Hk004372; Wed, 28 Nov 2012 18:10:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASIA5E5004369; Wed, 28 Nov 2012 18:10:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281810.qASIA5E5004369@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 18:10:05 +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: r243656 - in stable/9/sys: dev/usb/serial sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:10:05 -0000 Author: hselasky Date: Wed Nov 28 18:10:05 2012 New Revision: 243656 URL: http://svnweb.freebsd.org/changeset/base/243656 Log: MFC r242619, r242695, r242702 and r242703: Implement support for RTS (flow control). Improve USB serial console support. Implement a USB serial jitter buffer in receive direction. Modified: stable/9/sys/dev/usb/serial/usb_serial.c stable/9/sys/dev/usb/serial/usb_serial.h stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/9/sys/dev/usb/serial/usb_serial.c Wed Nov 28 17:55:18 2012 (r243655) +++ stable/9/sys/dev/usb/serial/usb_serial.c Wed Nov 28 18:10:05 2012 (r243656) @@ -162,6 +162,7 @@ static tsw_ioctl_t ucom_ioctl; static tsw_modem_t ucom_modem; static tsw_param_t ucom_param; static tsw_outwakeup_t ucom_outwakeup; +static tsw_inwakeup_t ucom_inwakeup; static tsw_free_t ucom_free; static struct ttydevsw ucom_class = { @@ -169,6 +170,7 @@ static struct ttydevsw ucom_class = { .tsw_open = ucom_open, .tsw_close = ucom_close, .tsw_outwakeup = ucom_outwakeup, + .tsw_inwakeup = ucom_inwakeup, .tsw_ioctl = ucom_ioctl, .tsw_param = ucom_param, .tsw_modem = ucom_modem, @@ -423,16 +425,13 @@ ucom_attach_tty(struct ucom_super_softc if ((ucom_cons_softc == NULL) && (ssc->sc_unit == ucom_cons_unit) && (sc->sc_subunit == ucom_cons_subunit)) { - struct termios t; - DPRINTF("unit %d subunit %d is console", ssc->sc_unit, sc->sc_subunit); + DPRINTF("unit %d subunit %d is console", + ssc->sc_unit, sc->sc_subunit); ucom_cons_softc = sc; - memset(&t, 0, sizeof(t)); - t.c_ispeed = ucom_cons_baud; - t.c_ospeed = t.c_ispeed; - t.c_cflag = CS8; + tty_init_console(tp, ucom_cons_baud); UCOM_MTX_LOCK(ucom_cons_softc); ucom_cons_rx_low = 0; @@ -441,7 +440,7 @@ ucom_attach_tty(struct ucom_super_softc ucom_cons_tx_high = 0; sc->sc_flag |= UCOM_FLAG_CONSOLE; ucom_open(ucom_cons_softc->sc_tty); - ucom_param(ucom_cons_softc->sc_tty, &t); + ucom_param(ucom_cons_softc->sc_tty, &tp->t_termios_init_in); UCOM_MTX_UNLOCK(ucom_cons_softc); } @@ -716,6 +715,10 @@ ucom_open(struct tty *tp) sc->sc_pls_set = 0; sc->sc_pls_clr = 0; + /* reset jitter buffer */ + sc->sc_jitterbuf_in = 0; + sc->sc_jitterbuf_out = 0; + ucom_queue_command(sc, ucom_cfg_open, NULL, &sc->sc_open_task[0].hdr, &sc->sc_open_task[1].hdr); @@ -780,6 +783,46 @@ ucom_close(struct tty *tp) } } +static void +ucom_inwakeup(struct tty *tp) +{ + struct ucom_softc *sc = tty_softc(tp); + uint16_t pos; + + if (sc == NULL) + return; + + UCOM_MTX_ASSERT(sc, MA_OWNED); + + DPRINTF("tp=%p\n", tp); + + if (ttydisc_can_bypass(tp) != 0 || + (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { + return; + } + + pos = sc->sc_jitterbuf_out; + + while (sc->sc_jitterbuf_in != pos) { + int c; + + c = (char)sc->sc_jitterbuf[pos]; + + if (ttydisc_rint(tp, c, 0) == -1) + break; + pos++; + if (pos >= UCOM_JITTERBUF_SIZE) + pos -= UCOM_JITTERBUF_SIZE; + } + + sc->sc_jitterbuf_out = pos; + + /* clear RTS in async fashion */ + if ((sc->sc_jitterbuf_in == pos) && + (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) + ucom_rts(sc, 0); +} + static int ucom_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { @@ -1139,17 +1182,22 @@ ucom_param(struct tty *tp, struct termio if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) { /* XXX the TTY layer should call "open()" first! */ - + /* + * Not quite: Its ordering is partly backwards, but + * some parameters must be set early in ttydev_open(), + * possibly before calling ttydevsw_open(). + */ error = ucom_open(tp); - if (error) { + if (error) goto done; - } + opened = 1; } DPRINTF("sc = %p\n", sc); /* Check requested parameters. */ if (t->c_ispeed && (t->c_ispeed != t->c_ospeed)) { + /* XXX c_ospeed == 0 is perfectly valid. */ DPRINTF("mismatch ispeed and ospeed\n"); error = EINVAL; goto done; @@ -1360,6 +1408,11 @@ ucom_put_data(struct ucom_softc *sc, str /* first check if we can pass the buffer directly */ if (ttydisc_can_bypass(tp)) { + + /* clear any jitter buffer */ + sc->sc_jitterbuf_in = 0; + sc->sc_jitterbuf_out = 0; + if (ttydisc_rint_bypass(tp, buf, cnt) != cnt) { DPRINTF("tp=%p, data lost\n", tp); } @@ -1368,8 +1421,31 @@ ucom_put_data(struct ucom_softc *sc, str /* need to loop */ for (cnt = 0; cnt != res.length; cnt++) { - if (ttydisc_rint(tp, buf[cnt], 0) == -1) { - /* XXX what should we do? */ + if (sc->sc_jitterbuf_in != sc->sc_jitterbuf_out || + ttydisc_rint(tp, buf[cnt], 0) == -1) { + uint16_t end; + uint16_t pos; + + pos = sc->sc_jitterbuf_in; + end = sc->sc_jitterbuf_out + + UCOM_JITTERBUF_SIZE - 1; + if (end >= UCOM_JITTERBUF_SIZE) + end -= UCOM_JITTERBUF_SIZE; + + for (; cnt != res.length; cnt++) { + if (pos == end) + break; + sc->sc_jitterbuf[pos] = buf[cnt]; + pos++; + if (pos >= UCOM_JITTERBUF_SIZE) + pos -= UCOM_JITTERBUF_SIZE; + } + + sc->sc_jitterbuf_in = pos; + + /* set RTS in async fashion */ + if (sc->sc_flag & UCOM_FLAG_RTS_IFLOW) + ucom_rts(sc, 1); DPRINTF("tp=%p, lost %d " "chars\n", tp, res.length - cnt); Modified: stable/9/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/9/sys/dev/usb/serial/usb_serial.h Wed Nov 28 17:55:18 2012 (r243655) +++ stable/9/sys/dev/usb/serial/usb_serial.h Wed Nov 28 18:10:05 2012 (r243656) @@ -78,6 +78,7 @@ #define UCOM_MINVER 1 #define UCOM_PREFVER UCOM_MODVER #define UCOM_MAXVER 1 +#define UCOM_JITTERBUF_SIZE 128 /* bytes */ struct usb_device; struct ucom_softc; @@ -169,6 +170,8 @@ struct ucom_softc { struct mtx *sc_mtx; void *sc_parent; int sc_subunit; + uint16_t sc_jitterbuf_in; + uint16_t sc_jitterbuf_out; uint16_t sc_portno; uint16_t sc_flag; #define UCOM_FLAG_RTS_IFLOW 0x01 /* use RTS input flow control */ @@ -191,6 +194,7 @@ struct ucom_softc { #define UCOM_LS_RTS 0x02 #define UCOM_LS_BREAK 0x04 #define UCOM_LS_RING 0x08 + uint8_t sc_jitterbuf[UCOM_JITTERBUF_SIZE]; }; #define UCOM_MTX_ASSERT(sc, what) mtx_assert((sc)->sc_mtx, what) Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Wed Nov 28 17:55:18 2012 (r243655) +++ stable/9/sys/sys/param.h Wed Nov 28 18:10:05 2012 (r243656) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 901501 /* Master, propagated to newvers */ +#define __FreeBSD_version 901502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 28 18:13:36 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C649E49; Wed, 28 Nov 2012 18:13:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 150928FC13; Wed, 28 Nov 2012 18:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASIDZHV005144; Wed, 28 Nov 2012 18:13:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASIDZFl005143; Wed, 28 Nov 2012 18:13:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281813.qASIDZFl005143@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 18:13:35 +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: r243657 - stable/9/sys/dev/usb/serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:13:36 -0000 Author: hselasky Date: Wed Nov 28 18:13:35 2012 New Revision: 243657 URL: http://svnweb.freebsd.org/changeset/base/243657 Log: MFC r243380: Fix uplcom clear stall logic for PL2303HX. Submitted by: Mark Johnston Modified: stable/9/sys/dev/usb/serial/uplcom.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uplcom.c Wed Nov 28 18:10:05 2012 (r243656) +++ stable/9/sys/dev/usb/serial/uplcom.c Wed Nov 28 18:13:35 2012 (r243657) @@ -432,11 +432,21 @@ uplcom_attach(device_t dev) usbd_errstr(error)); goto detach; } - /* clear stall at first run */ - mtx_lock(&sc->sc_mtx); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); - mtx_unlock(&sc->sc_mtx); + + if (sc->sc_chiptype != TYPE_PL2303HX) { + /* HX variants seem to lock up after a clear stall request. */ + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); + mtx_unlock(&sc->sc_mtx); + } else { + if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 8, 0, 0) || + uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 9, 0, 0)) { + goto detach; + } + } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &uplcom_callback, &sc->sc_mtx); @@ -555,9 +565,6 @@ uplcom_pl2303_init(struct usb_device *ud if (err) return (EIO); - if (uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) - || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 9, 0, 0)) - return (EIO); return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 29 14:05:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDAA1F6A; Thu, 29 Nov 2012 14:05:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A20318FC08; Thu, 29 Nov 2012 14:05:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATE547A091479; Thu, 29 Nov 2012 14:05:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATE54uo091470; Thu, 29 Nov 2012 14:05:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211291405.qATE54uo091470@svn.freebsd.org> From: Martin Matuska Date: Thu, 29 Nov 2012 14:05: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: r243674 - in stable/9: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolar... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 14:05:04 -0000 Author: mm Date: Thu Nov 29 14:05:04 2012 New Revision: 243674 URL: http://svnweb.freebsd.org/changeset/base/243674 Log: Merge ZFS feature flags support and related bugfixes: 236884, 237001, 237119, 237458, 237972, 238113, 238391, 238422, 238926, 238950, 238951, 239389, 239394, 239620, 239774, 239953, 239958, 239967, 239968, 240063, 240133, 240153, 240303, 240345, 240415, 240955, 241655, 243014, 243505, 243506 MFC r236884: Introduce "feature flags" for ZFS pools (bump SPA version to 5000). Add first feature "com.delphix:async_destroy" (asynchronous destroy of ZFS datasets). Implement features support in ZFS boot code. Illumos revisions merged: 13700:2889e2596bd6 13701:1949b688d5fb 2619 asynchronous destruction of ZFS file systems 2747 SPA versioning with zfs feature flags References: https://www.illumos.org/issues/2619 https://www.illumos.org/issues/2747 MFC r237001: Fix ZFS boot with pre-features pools (version <= 28) broken in r236884 MFC r237119 [1]: Do not remount ZFS dataset if changing canmount property to "on" and dataset is already mounted. MFC r237458: Import Illumos revision 13736:9f1d48e1681f 2901 ZFS receive fails for exabyte sparse files References: https://www.illumos.org/issues/2901 MFC r237972: Expose scrub and resilver tunables. This allows the user to tune the priority trade-off between scrub/resilver and other ZFS I/O. MFC r238113 (pjd): vdev_io_done stage is not used for ioctls. MFC r238391: Change behavior introduced in r237119 to vendor solution References: https://www.illumos.org/issues/2883 MFC r238422: Merge illumos commit 13749:df4cd82e2b60 1796 "ZFS HOLD" should not be used when doing "ZFS SEND" froma read-only pool 2871 support for __ZFS_POOL_RESTRICT used by ZFS test suite 2903 zfs destroy -d does not work 2957 zfs destroy -R/r sometimes fails when removing defer-destroyed snapshot References: https://www.illumos.org/issues/1796 https://www.illumos.org/issues/2871 https://www.illumos.org/issues/2903 https://www.illumos.org/issues/2957 MFC r238926: Partial MFV (illumos-gate 13753:2aba784c276b) 2762 zpool command should have better support for feature flags References: https://www.illumos.org/issues/2762 MFC r238950: Fix reporting of root pool upgrade notice. MFC r238951: Fix wrong indent according to style(9) MFC r239389: Backport fix for vendor issue #3085 3085 zfs diff panics, then panics in a loop on booting References: https://www.illumos.org/issues/3085 MFC r239394: Update zfs(8) manpage with illumos version of "zfs diff" Illumos issue: 2399 zfs manual page does not document use of "zfs diff" References: https://www.illumos.org/issues/2399 MFC r239620 [2]: Merge recent vendor changes: 3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets 3090 vdev_reopen() during reguid causes vdev to be treated as corrupt 3102 vdev_uberblock_load() and vdev_validate() may read the wrong label Referenes: https://www.illumos.org/issues/3086 https://www.illumos.org/issues/3090 https://www.illumos.org/issues/3102 MFC r239774: Merge recent vendor changes: 3100 zvol rename fails with EBUSY when dirty 3104 eliminate empty bpobjs 3120 zinject hangs in zfsdev_ioctl() due to uninitialized zc References: https://www.illumos.org/issues/3100 https://www.illumos.org/issues/3104 https://www.illumos.org/issues/3120 MFC r239953 (joel): Mdoc fixes. MFC r239958 (joel): Minor mdoc fixes. MFC r239967 (joel): Mdoc fixes. MFC r239968 (joel): Remove trailing whitespace. MFC r240063 (gjb): Add myself to copyright sections, per CDDL license. MFC r240133: Merge recent vendor changes and sync code: 1862 incremental zfs receive fails for sparse file > 8PB 3112 ztest does not honor ZFS_DEBUG 3122 zfs destroy filesystem should prefetch blocks 3129 'zpool reopen' restarts resilvers 3130 ztest failure: Assertion failed: 0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10) References: https://www.illumos.org/issues/1862 https://www.illumos.org/issues/3112 https://www.illumos.org/issues/3122 https://www.illumos.org/issues/3129 https://www.illumos.org/issues/3130 MFC r240153 (gjb) [3]: Typo fix and minor word swap. MFC r240303: Add assfail() and assfail3() to the opensolaris module. Remove obsoleted intermediate cddl/compat/opensolaris/sys/debug.h. MFC r240345 (avg): zfs: fix sa_modify_attrs handling of variable-sized attributes - skip length_idx index for a replaced variable-sized attribute - skip length_idx index for a removed variable-sized attribute - also re-arranged code to make sure that length_idx is always incremented for variable-sized attributes - additionally add an assertion that the number of actually produced attributes is the same as the expected number of resulting attributes MFC r240415: Merge recent zfs vendor changes, sync code and adjust userland DEBUG. Illumos issued covered: 1884 Empty "used" field for zfs *space commands 3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero 3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID 3048 zfs {user,group}space [-s|-S] is broken 3049 zfs {user,group}space -t doesn't really filter the results 3060 zfs {user,group}space -H output isn't tab-delimited 3061 zfs {user,group}space -o doesn't use specified fields order 3064 usr/src/cmd/zpool/zpool_main.c misspells "successful" 3093 zfs {user,group}space's -i is noop 3098 zfs userspace/groupspace fail without saying why when run as non-root References: https://www.illumos.org/issues/ + [issue_id] MFC r240955 (partial): Merge recent vendor changes in ZFS. Illumos issued covered: 3139 zdb dies when it tries to determine path of unlinked file 3189 kernel panic in ZFS test suite during hotspare_onoffline_004_neg 3208 moving zpool cross-endian results in incorrect user/group accounting References: https://www.illumos.org/issues/ + [issue_id] MFC r241655: Add missing initialization for do_prefix. Corrects porting error in r238391 Vendor issue and changeset reference: 2883 changing "canmount" property to "on" should not always remount dataset https://www.illumos.org/issues/2883 Changeset 13743:95aba6e49b9f MFC r243014: Move zpool-features manual page from section 5 to section 7 and fix references Reported by: pluknet MFC r243505: Illumos 13886:e3261d03efbf 3349 zpool upgrade -V bumps the on disk version number, but leaves the in core version References: https://www.illumos.org/issues/3349 MFC r243506: zfs sha256 checksum is missing in zfs.8 manpage PR: kern/167905 [1], kern/170912 [2], kern/170914 [2], doc/171356 [3] Added: stable/9/cddl/contrib/opensolaris/cmd/zhack/ - copied from r236884, head/cddl/contrib/opensolaris/cmd/zhack/ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 - copied unchanged from r243014, head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/9/cddl/usr.sbin/zhack/ - copied from r236884, head/cddl/usr.sbin/zhack/ stable/9/sys/cddl/compat/opensolaris/sys/assfail.h - copied, changed from r240303, head/sys/cddl/compat/opensolaris/sys/assfail.h stable/9/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h - copied unchanged from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Replaced: stable/9/sys/cddl/compat/opensolaris/sys/debug.h - copied unchanged from r240415, head/sys/cddl/compat/opensolaris/sys/debug.h Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/UPDATING stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c stable/9/cddl/contrib/opensolaris/lib/libuutil/common/uu_misc.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/9/cddl/lib/libnvpair/Makefile stable/9/cddl/lib/libzfs/Makefile stable/9/cddl/lib/libzpool/Makefile stable/9/cddl/sbin/zpool/Makefile stable/9/cddl/usr.bin/ztest/Makefile stable/9/cddl/usr.sbin/Makefile stable/9/cddl/usr.sbin/zdb/Makefile stable/9/cddl/usr.sbin/zhack/Makefile stable/9/rescue/rescue/Makefile stable/9/sys/boot/zfs/zfsimpl.c stable/9/sys/cddl/boot/zfs/zfsimpl.h stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h stable/9/sys/modules/zfs/Makefile Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/cddl/lib/ (props changed) stable/9/rescue/rescue/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/Makefile.inc1 Thu Nov 29 14:05:04 2012 (r243674) @@ -1273,7 +1273,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ - ${_cddl_lib_libumem} \ + ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1292,6 +1292,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem +_cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib= cddl/lib .endif Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/UPDATING Thu Nov 29 14:05:04 2012 (r243674) @@ -9,6 +9,16 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121129: + A new version of ZFS (pool version 5000) has been merged to 9-STABLE. + Starting with this version the old system of ZFS pool versioning + is superseded by "feature flags". This concept enables forward + compatibility against certain future changes in functionality of ZFS + pools. The first two read-only compatible "feature flags" for ZFS + pools are "com.delphix:async_destroy" and "com.delphix:empty_bpobj". + For more information read the new zpool-features(7) manual page. + Please refer to the "ZFS notes" section of this file for information + on upgrading boot ZFS pools. 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Thu Nov 29 14:05:04 2012 (r243674) @@ -93,14 +93,14 @@ If specified multiple times, verify the .It Fl C Display information about the configuration. If specified with no other options, instead display information about the cache file -.Ns ( Pa /etc/zfs/zpool.cache Ns ). +.Po Pa /etc/zfs/zpool.cache Pc . To specify the cache file to display, see .Fl U .Pp If specified multiple times, and a pool name is also specified display both the cached configuration and the on-disk configuration. If specified multiple times with -.FL e +.Fl e also display the configuration that would be used were the pool to be imported. .It Fl d @@ -135,7 +135,7 @@ option is also specified, also display t .It Fl L Disable leak tracing and the loading of space maps. By default, -.Nm +.Nm verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. @@ -253,7 +253,7 @@ MOS Configuration: .Li # Ic zdb -d rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects -... + ... .Ed .It Xo Sy Example 3 Display basic information about object 0 in .Sy 'rpool/export/home' @@ -272,7 +272,7 @@ Dataset rpool/export/home [ZPL], ID 137, .Li # Ic zdb -S rpool Simulated DDT histogram: -bucket allocated referenced +bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Nov 29 14:05:04 2012 (r243674) @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -54,6 +56,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -63,7 +66,8 @@ #define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ zio_checksum_table[(idx)].ci_name : "UNKNOWN") #define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : "UNKNOWN") + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") #define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) #ifndef lint @@ -1088,7 +1092,7 @@ dump_dsl_dataset(objset_t *os, uint64_t ASSERT(size == sizeof (*ds)); crtime = ds->ds_creation_time; - zdb_nicenum(ds->ds_used_bytes, used); + zdb_nicenum(ds->ds_referenced_bytes, used); zdb_nicenum(ds->ds_compressed_bytes, compressed); zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed); zdb_nicenum(ds->ds_unique_bytes, unique); @@ -1132,6 +1136,44 @@ dump_dsl_dataset(objset_t *os, uint64_t /* ARGSUSED */ static int +dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) +{ + char blkbuf[BP_SPRINTF_LEN]; + + if (bp->blk_birth != 0) { + sprintf_blkptr(blkbuf, bp); + (void) printf("\t%s\n", blkbuf); + } + return (0); +} + +static void +dump_bptree(objset_t *os, uint64_t obj, char *name) +{ + char bytes[32]; + bptree_phys_t *bt; + dmu_buf_t *db; + + if (dump_opt['d'] < 3) + return; + + VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db)); + bt = db->db_data; + zdb_nicenum(bt->bt_bytes, bytes); + (void) printf("\n %s: %llu datasets, %s\n", + name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes); + dmu_buf_rele(db, FTAG); + + if (dump_opt['d'] < 5) + return; + + (void) printf("\n"); + + (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL); +} + +/* ARGSUSED */ +static int dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { char blkbuf[BP_SPRINTF_LEN]; @@ -1883,11 +1925,13 @@ typedef struct zdb_blkstats { */ #define ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0) #define ZDB_OT_DITTO (DMU_OT_NUMTYPES + 1) -#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_OTHER (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 3) static char *zdb_ot_extname[] = { "deferred free", "dedup ditto", + "other", "Total", }; @@ -1968,9 +2012,10 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog type = BP_GET_TYPE(bp); - zdb_count_block(zcb, zilog, bp, type); + zdb_count_block(zcb, zilog, bp, + (type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type); - is_metadata = (BP_GET_LEVEL(bp) != 0 || dmu_ot[type].ot_metadata); + is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { int ioerr; @@ -2197,6 +2242,12 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, + &zcb, NULL)); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; @@ -2373,7 +2424,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo } if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF || - BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata) + BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp))) return (0); ddt_key_fill(&zdde_search.zdde_key, bp); @@ -2478,7 +2529,14 @@ dump_zpool(spa_t *spa) dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool frees"); + "Pool snapshot frees"); + } + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + dump_bptree(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, + "Pool dataset frees"); } dump_dtl(spa->spa_root_vdev, 0); } Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Nov 29 14:05:04 2012 (r243674) @@ -23,6 +23,7 @@ .\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Bryan Drewery +.\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" @@ -57,8 +58,8 @@ .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Nm .Cm snapshot @@ -136,17 +137,21 @@ .Fl a | Ar filesystem .Nm .Cm userspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot .Nm .Cm groupspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -619,7 +624,7 @@ privilege with .Qq Nm Cm allow , can access everyone's usage. .Pp -The +The .Sy userused@ Ns ... properties are not displayed by .Qq Nm Cm get all . @@ -819,7 +824,7 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, @@ -1129,7 +1134,7 @@ will not use configured pool log devices will instead optimize synchronous operations for global pool throughput and efficient use of resources. .It Sy snapdir Ns = Ns Cm hidden | visible -Controls whether the +Controls whether the .Pa \&.zfs directory is hidden or visible in the root of the file system as discussed in the @@ -1196,7 +1201,7 @@ are not reflected in the reservation. The .Sy vscan property is currently not supported on -.Fx . +.Fx . .It Sy xattr Ns = Ns Cm off | on The .Sy xattr @@ -1283,7 +1288,7 @@ properties. The correlation between prop In addition, these options can be set on a per-mount basis using the .Fl o option, without affecting the property that is stored on disk. The values -specified on the command line override the values stored in the dataset. These +specified on the command line override the values stored in the dataset. These properties are reported as "temporary" by the .Qq Nm Cm get command. If the properties are changed while the dataset is mounted, the new @@ -1322,7 +1327,7 @@ domain name for the .Ar module component of property names to reduce the chance that two independently-developed packages use the same property name for different -purposes. Property names beginning with +purposes. Property names beginning with .Em com.sun are reserved for use by Sun Microsystems. .Pp @@ -1489,8 +1494,8 @@ behavior for mounted file systems in use .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Xc .Pp @@ -1978,9 +1983,11 @@ Upgrade the specified file system. .It Xo .Nm .Cm userspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -1998,9 +2005,9 @@ Print numeric ID instead of user/group n .It Fl H Do not print headers, use tab-delimited output. .It Fl p -Use exact (parseable) numeric output. +Use exact (parsable) numeric output. .It Fl o Ar field Ns Op , Ns Ar ... -Display only the specified fields from the following set, +Display only the specified fields from the following set: .Sy type,name,used,quota . The default is to display all fields. .It Fl s Ar field @@ -2015,7 +2022,7 @@ another. The default is Sort by this field in reverse order. See .Fl s . .It Fl t Ar type Ns Op , Ns Ar ... -Print only the specified types from the following set, +Print only the specified types from the following set: .Sy all,posixuser,smbuser,posixgroup,smbgroup . .Pp The default is @@ -2029,9 +2036,11 @@ Translate SID to POSIX ID. This flag cur .It Xo .Nm .Cm groupspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -2209,7 +2218,7 @@ and it is assumed to be from the same fi .Ar snapshot . .Pp If the destination is a clone, the source may be the origin snapshot, which -must be fully specified (for example, +must be fully specified (for example, .Cm pool/fs@origin , not just .Cm @origin ) . @@ -2458,24 +2467,26 @@ subcommand or change a property. The following permissions are available: .Bl -column -offset 4n "secondarycache" "subcommand" .It NAME Ta TYPE Ta NOTES -.It Xo allow Ta subcommand Ta Must +.It allow Ta subcommand Ta Must Xo also have the permission that is being allowed .Xc -.It Xo clone Ta subcommand Ta Must +.It clone Ta subcommand Ta Must Xo also have the 'create' ability and 'mount' ability in the origin file system .Xc .It create Ta subcommand Ta Must also have the 'mount' ability .It destroy Ta subcommand Ta Must also have the 'mount' ability +.It diff Ta subcommand Ta Allows lookup of paths within a dataset given an +object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets -.It Xo promote Ta subcommand Ta Must +.It promote Ta subcommand Ta Must Xo also have the 'mount' and 'promote' ability in the origin file system .Xc .It receive Ta subcommand Ta Must also have the 'mount' and 'create' ability -.It Xo release Ta subcommand Ta Allows +.It release Ta subcommand Ta Allows Xo releasing a user hold which might destroy the snapshot .Xc -.It Xo rename Ta subcommand Ta Must +.It rename Ta subcommand Ta Must Xo also have the 'mount' and 'create' ability in the new parent .Xc .It rollback Ta subcommand Ta Must also have the 'mount' ability @@ -2491,7 +2502,6 @@ protocol .It userprop Ta other Ta Allows changing any user property .It userquota Ta other Ta Allows accessing any userquota@... property .It userused Ta other Ta Allows reading any userused@... property -.It Ta .It aclinherit Ta property .It aclmode Ta property .It atime Ta property @@ -2669,43 +2679,42 @@ descendent file systems. .Op Ar snapshot Ns | Ns Ar filesystem .Xc .Pp -Describes differences between a snapshot and a successor dataset. The -successor dataset can be a later snapshot or the current filesystem. -.Pp -The changed files are displayed including the change type. The change type -is displayed useing a single character. If a file or directory was renamed, -the old and the new names are displayed. -.Pp -The following change types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "CHANGE TYPE" -.It CHARACTER Ta CHANGE TYPE -.It \&+ Ta file was added -.It \&- Ta file was removed -.It \&M Ta file was modified -.It \&R Ta file was renamed +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname +.Pq in case of rename , +change in link count, and optionally file type and/or change time. +.Pp +The types of change are: +.Bl -column -offset 2n indent +.It \&- Ta path was removed +.It \&+ Ta path was added +.It \&M Ta path was modified +.It \&R Ta path was renamed .El .Bl -tag -width indent .It Fl F -Display a single letter for the file type in second to last column. -.Pp -The following file types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "FILE TYPE" -.It CHARACTER Ta FILE TYPE -.It \&F Ta file -.It \&/ Ta directory +Display an indication of the type of file, in a manner similar to the +.Fl F +option of +.Xr ls 1 . +.Bl -column -offset 2n indent .It \&B Ta block device +.It \&C Ta character device +.It \&F Ta regular file +.It \&/ Ta directory .It \&@ Ta symbolic link .It \&= Ta socket .It \&> Ta door (not supported on Fx ) -.It \&| Ta FIFO (not supported on Fx ) -.It \&P Ta event portal (not supported on Fx ) +.It \&| Ta named pipe (not supported on Fx ) +.It \&P Ta event port (not supported on Fx ) .El .It Fl H -Machine-parseable output, fields separated a tab character. +Give more parseable tab-separated output, without header lines and without +arrows. .It Fl t -Display a change timestamp in the first column. +Display the path's inode change time as the first column of output. .El .It Xo .Nm @@ -2742,6 +2751,16 @@ Detaches the specified from the jail identified by JID .Ar jailid . .El +.Sh EXIT STATUS +The following exit values are returned: +.Bl -tag -offset 2n -width 2n +.It 0 +Successful completion. +.It 1 +An error occurred. +.It 2 +Invalid command line options were specified. +.El .Sh EXAMPLES .Bl -tag -width 0n .It Sy Example 1 No Creating a Tn ZFS No File System Hierarchy @@ -2807,7 +2826,7 @@ Snapshots are displayed if the .Sy listsnaps property is .Cm on . -The default is +The default is .Cm off . See .Xr zpool 8 @@ -3158,16 +3177,21 @@ Local+Descendent permissions on (tank/us group staff @pset,create,mount ------------------------------------------------------------- .Ed -.El -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -Successful completion. -.It 1 -An error occurred. -.It 2 -Invalid command line options were specified. +.It Sy Example 22 Showing the differences between a snapshot and a ZFS Dataset +.Pp +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The +.Fl F +option is used to indicate type information for the files affected. +.Bd -literal -offset 2n +.Li # Ic zfs diff tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.Ed .El .Sh SEE ALSO .Xr chmod 2 , Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Nov 29 14:05:04 2012 (r243674) @@ -304,13 +304,13 @@ get_usage(zfs_help_t idx) "\tunallow [-r] -s @setname [[,...]] " "\n")); case HELP_USERSPACE: - return (gettext("\tuserspace [-niHp] [-o field[,...]] " - "[-sS field] ... [-t type[,...]]\n" - "\t \n")); + return (gettext("\tuserspace [-Hinp] [-o field[,...]] " + "[-s field] ...\n\t[-S field] ... " + "[-t type[,...]] \n")); case HELP_GROUPSPACE: - return (gettext("\tgroupspace [-niHp] [-o field[,...]] " - "[-sS field] ... [-t type[,...]]\n" - "\t \n")); + return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " + "[-s field] ...\n\t[-S field] ... " + "[-t type[,...]] \n")); case HELP_HOLD: return (gettext("\thold [-r] ...\n")); case HELP_HOLDS: @@ -1081,7 +1081,7 @@ snapshot_to_nvl_cb(zfs_handle_t *zhp, vo int err = 0; /* Check for clones. */ - if (!cb->cb_doclones) { + if (!cb->cb_doclones && !cb->cb_defer_destroy) { cb->cb_target = zhp; cb->cb_first = B_TRUE; err = zfs_iter_dependents(zhp, B_TRUE, @@ -2057,30 +2057,52 @@ zfs_do_upgrade(int argc, char **argv) return (ret); } -#define USTYPE_USR_BIT (0) -#define USTYPE_GRP_BIT (1) -#define USTYPE_PSX_BIT (2) -#define USTYPE_SMB_BIT (3) - -#define USTYPE_USR (1 << USTYPE_USR_BIT) -#define USTYPE_GRP (1 << USTYPE_GRP_BIT) - -#define USTYPE_PSX (1 << USTYPE_PSX_BIT) -#define USTYPE_SMB (1 << USTYPE_SMB_BIT) - -#define USTYPE_PSX_USR (USTYPE_PSX | USTYPE_USR) -#define USTYPE_SMB_USR (USTYPE_SMB | USTYPE_USR) -#define USTYPE_PSX_GRP (USTYPE_PSX | USTYPE_GRP) -#define USTYPE_SMB_GRP (USTYPE_SMB | USTYPE_GRP) -#define USTYPE_ALL (USTYPE_PSX_USR | USTYPE_SMB_USR \ - | USTYPE_PSX_GRP | USTYPE_SMB_GRP) +/* + * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...] + * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...] + * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * + * -H Scripted mode; elide headers and separate columns by tabs. + * -i Translate SID to POSIX ID. + * -n Print numeric ID instead of user/group name. + * -o Control which fields to display. + * -p Use exact (parseable) numeric output. + * -s Specify sort columns, descending order. + * -S Specify sort columns, ascending order. + * -t Control which object types to display. + * + * Displays space consumed by, and quotas on, each user in the specified + * filesystem or snapshot. + */ +/* us_field_types, us_field_hdr and us_field_names should be kept in sync */ +enum us_field_types { + USFIELD_TYPE, + USFIELD_NAME, + USFIELD_USED, + USFIELD_QUOTA +}; +static char *us_field_hdr[] = { "TYPE", "NAME", "USED", "QUOTA" }; +static char *us_field_names[] = { "type", "name", "used", "quota" }; +#define USFIELD_LAST (sizeof (us_field_names) / sizeof (char *)) -#define USPROP_USED_BIT (0) -#define USPROP_QUOTA_BIT (1) +#define USTYPE_PSX_GRP (1 << 0) +#define USTYPE_PSX_USR (1 << 1) +#define USTYPE_SMB_GRP (1 << 2) +#define USTYPE_SMB_USR (1 << 3) +#define USTYPE_ALL \ + (USTYPE_PSX_GRP | USTYPE_PSX_USR | USTYPE_SMB_GRP | USTYPE_SMB_USR) -#define USPROP_USED (1 << USPROP_USED_BIT) -#define USPROP_QUOTA (1 << USPROP_QUOTA_BIT) +static int us_type_bits[] = { + USTYPE_PSX_GRP, + USTYPE_PSX_USR, + USTYPE_SMB_GRP, + USTYPE_SMB_USR, + USTYPE_ALL +}; +static char *us_type_names[] = { "posixgroup", "posxiuser", "smbgroup", + "smbuser", "all" }; typedef struct us_node { nvlist_t *usn_nvl; @@ -2089,37 +2111,49 @@ typedef struct us_node { } us_node_t; typedef struct us_cbdata { - nvlist_t **cb_nvlp; - uu_avl_pool_t *cb_avl_pool; - uu_avl_t *cb_avl; - boolean_t cb_numname; - boolean_t cb_nicenum; - boolean_t cb_sid2posix; - zfs_userquota_prop_t cb_prop; - zfs_sort_column_t *cb_sortcol; - size_t cb_max_typelen; - size_t cb_max_namelen; - size_t cb_max_usedlen; - size_t cb_max_quotalen; + nvlist_t **cb_nvlp; + uu_avl_pool_t *cb_avl_pool; + uu_avl_t *cb_avl; + boolean_t cb_numname; + boolean_t cb_nicenum; + boolean_t cb_sid2posix; + zfs_userquota_prop_t cb_prop; + zfs_sort_column_t *cb_sortcol; + size_t cb_width[USFIELD_LAST]; } us_cbdata_t; +static boolean_t us_populated = B_FALSE; + typedef struct { zfs_sort_column_t *si_sortcol; - boolean_t si_num_name; - boolean_t si_parsable; + boolean_t si_numname; } us_sort_info_t; static int +us_field_index(char *field) +{ + int i; + + for (i = 0; i < USFIELD_LAST; i++) { + if (strcmp(field, us_field_names[i]) == 0) + return (i); + } + + return (-1); +} + +static int us_compare(const void *larg, const void *rarg, void *unused) { const us_node_t *l = larg; const us_node_t *r = rarg; - int rc = 0; us_sort_info_t *si = (us_sort_info_t *)unused; zfs_sort_column_t *sortcol = si->si_sortcol; - boolean_t num_name = si->si_num_name; + boolean_t numname = si->si_numname; nvlist_t *lnvl = l->usn_nvl; nvlist_t *rnvl = r->usn_nvl; + int rc = 0; + boolean_t lvb, rvb; for (; sortcol != NULL; sortcol = sortcol->sc_next) { char *lvstr = ""; @@ -2138,17 +2172,17 @@ us_compare(const void *larg, const void (void) nvlist_lookup_uint32(lnvl, propname, &lv32); (void) nvlist_lookup_uint32(rnvl, propname, &rv32); if (rv32 != lv32) - rc = (rv32 > lv32) ? 1 : -1; + rc = (rv32 < lv32) ? 1 : -1; break; case ZFS_PROP_NAME: propname = "name"; - if (num_name) { - (void) nvlist_lookup_uint32(lnvl, propname, - &lv32); - (void) nvlist_lookup_uint32(rnvl, propname, - &rv32); - if (rv32 != lv32) - rc = (rv32 > lv32) ? 1 : -1; + if (numname) { + (void) nvlist_lookup_uint64(lnvl, propname, + &lv64); + (void) nvlist_lookup_uint64(rnvl, propname, + &rv64); + if (rv64 != lv64) + rc = (rv64 < lv64) ? 1 : -1; } else { (void) nvlist_lookup_string(lnvl, propname, &lvstr); @@ -2157,27 +2191,40 @@ us_compare(const void *larg, const void rc = strcmp(lvstr, rvstr); } break; - case ZFS_PROP_USED: case ZFS_PROP_QUOTA: - if (ZFS_PROP_USED == prop) + if (!us_populated) + break; + if (prop == ZFS_PROP_USED) propname = "used"; else propname = "quota"; (void) nvlist_lookup_uint64(lnvl, propname, &lv64); (void) nvlist_lookup_uint64(rnvl, propname, &rv64); if (rv64 != lv64) - rc = (rv64 > lv64) ? 1 : -1; + rc = (rv64 < lv64) ? 1 : -1; + break; } - if (rc) + if (rc != 0) { if (rc < 0) return (reverse ? 1 : -1); else return (reverse ? -1 : 1); + } } - return (rc); + /* + * If entries still seem to be the same, check if they are of the same + * type (smbentity is added only if we are doing SID to POSIX ID + * translation where we can have duplicate type/name combinations). + */ + if (nvlist_lookup_boolean_value(lnvl, "smbentity", &lvb) == 0 && + nvlist_lookup_boolean_value(rnvl, "smbentity", &rvb) == 0 && + lvb != rvb) + return (lvb < rvb ? -1 : 1); + + return (0); } static inline const char * @@ -2197,9 +2244,6 @@ us_type2str(unsigned field_type) } } -/* - * zfs userspace - */ static int userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space) { @@ -2207,7 +2251,6 @@ userspace_cb(void *arg, const char *doma zfs_userquota_prop_t prop = cb->cb_prop; char *name = NULL; char *propname; - char namebuf[32]; char sizebuf[32]; us_node_t *node; uu_avl_pool_t *avl_pool = cb->cb_avl_pool; @@ -2221,32 +2264,30 @@ userspace_cb(void *arg, const char *doma size_t namelen; size_t typelen; size_t sizelen; + int typeidx, nameidx, sizeidx; us_sort_info_t sortinfo = { sortcol, cb->cb_numname }; + boolean_t smbentity = B_FALSE; - if (domain == NULL || domain[0] == '\0') { - /* POSIX */ - if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { - type = USTYPE_PSX_GRP; - struct group *g = getgrgid(rid); - if (g) - name = g->gr_name; - } else { - type = USTYPE_PSX_USR; - struct passwd *p = getpwuid(rid); - if (p) - name = p->pw_name; - } - } else { - char sid[ZFS_MAXNAMELEN+32]; + if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) + nomem(); + node = safe_malloc(sizeof (us_node_t)); + uu_avl_node_init(node, &node->usn_avlnode, avl_pool); + node->usn_nvl = props; + + if (domain != NULL && domain[0] != '\0') { + /* SMB */ + char sid[ZFS_MAXNAMELEN + 32]; uid_t id; uint64_t classes; #ifdef sun - int err = 0; + int err; directory_error_t e; #endif + smbentity = B_TRUE; + (void) snprintf(sid, sizeof (sid), "%s-%u", domain, rid); - /* SMB */ + if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { type = USTYPE_SMB_GRP; #ifdef sun @@ -2262,217 +2303,139 @@ userspace_cb(void *arg, const char *doma #ifdef sun if (err == 0) { rid = id; - - e = directory_name_from_sid(NULL, sid, &name, &classes); - if (e != NULL) { - directory_error_free(e); - return (NULL); + if (!cb->cb_sid2posix) { + e = directory_name_from_sid(NULL, sid, &name, + &classes); + if (e != NULL) + directory_error_free(e); + if (name == NULL) + name = sid; } - - if (name == NULL) - name = sid; } #endif } -/* - * if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) - * ug = "group"; - * else - * ug = "user"; - */ - - if (prop == ZFS_PROP_USERUSED || prop == ZFS_PROP_GROUPUSED) - propname = "used"; - else - propname = "quota"; - - (void) snprintf(namebuf, sizeof (namebuf), "%u", rid); - if (name == NULL) - name = namebuf; - - if (cb->cb_nicenum) - zfs_nicenum(space, sizebuf, sizeof (sizebuf)); - else - (void) sprintf(sizebuf, "%llu", space); + if (cb->cb_sid2posix || domain == NULL || domain[0] == '\0') { + /* POSIX or -i */ + if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { + type = USTYPE_PSX_GRP; + if (!cb->cb_numname) { + struct group *g; - node = safe_malloc(sizeof (us_node_t)); - uu_avl_node_init(node, &node->usn_avlnode, avl_pool); + if ((g = getgrgid(rid)) != NULL) + name = g->gr_name; + } + } else { + type = USTYPE_PSX_USR; + if (!cb->cb_numname) { + struct passwd *p; - if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) { - free(node); - return (-1); + if ((p = getpwuid(rid)) != NULL) + name = p->pw_name; + } + } } + /* + * Make sure that the type/name combination is unique when doing + * SID to POSIX ID translation (hence changing the type from SMB to + * POSIX). + */ + if (cb->cb_sid2posix && + nvlist_add_boolean_value(props, "smbentity", smbentity) != 0) + nomem(); + + /* Calculate/update width of TYPE field */ + typestr = us_type2str(type); + typelen = strlen(gettext(typestr)); + typeidx = us_field_index("type"); + if (typelen > cb->cb_width[typeidx]) + cb->cb_width[typeidx] = typelen; if (nvlist_add_uint32(props, "type", type) != 0) nomem(); - if (cb->cb_numname) { - if (nvlist_add_uint32(props, "name", rid) != 0) + /* Calculate/update width of NAME field */ + if ((cb->cb_numname && cb->cb_sid2posix) || name == NULL) { + if (nvlist_add_uint64(props, "name", rid) != 0) nomem(); - namelen = strlen(namebuf); + namelen = snprintf(NULL, 0, "%u", rid); } else { if (nvlist_add_string(props, "name", name) != 0) nomem(); namelen = strlen(name); } + nameidx = us_field_index("name"); + if (namelen > cb->cb_width[nameidx]) + cb->cb_width[nameidx] = namelen; - typestr = us_type2str(type); - typelen = strlen(gettext(typestr)); - if (typelen > cb->cb_max_typelen) - cb->cb_max_typelen = typelen; - - if (namelen > cb->cb_max_namelen) - cb->cb_max_namelen = namelen; - - sizelen = strlen(sizebuf); - if (0 == strcmp(propname, "used")) { - if (sizelen > cb->cb_max_usedlen) - cb->cb_max_usedlen = sizelen; - } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 29 17:35:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A5AA4B6; Thu, 29 Nov 2012 17:35:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3F28FC0C; Thu, 29 Nov 2012 17:35:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATHZwTp026354; Thu, 29 Nov 2012 17:35:58 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATHZwvL026352; Thu, 29 Nov 2012 17:35:58 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211291735.qATHZwvL026352@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 29 Nov 2012 17:35: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: r243676 - in stable/9/sys: modules netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 17:35:58 -0000 Author: ae Date: Thu Nov 29 17:35:57 2012 New Revision: 243676 URL: http://svnweb.freebsd.org/changeset/base/243676 Log: MFC r243336: Remove opt_inet.h, it isn't required here. MFC r243337: Connect ip6_mroute kernel module to the build. Modified: stable/9/sys/modules/Makefile stable/9/sys/netinet6/ip6_mroute.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Thu Nov 29 15:08:13 2012 (r243675) +++ stable/9/sys/modules/Makefile Thu Nov 29 17:35:57 2012 (r243676) @@ -147,6 +147,7 @@ SUBDIR= \ ${_ipfw} \ ipfw_nat \ ${_ipmi} \ + ip6_mroute_mod \ ip_mroute_mod \ ${_ips} \ ${_ipw} \ Modified: stable/9/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/9/sys/netinet6/ip6_mroute.c Thu Nov 29 15:08:13 2012 (r243675) +++ stable/9/sys/netinet6/ip6_mroute.c Thu Nov 29 17:35:57 2012 (r243676) @@ -81,7 +81,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_inet.h" #include "opt_inet6.h" #include From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 29 18:08:37 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 169BED56; Thu, 29 Nov 2012 18:08:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC0308FC16; Thu, 29 Nov 2012 18:08:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATI8aCn031224; Thu, 29 Nov 2012 18:08:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATI8a9M031211; Thu, 29 Nov 2012 18:08:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211291808.qATI8a9M031211@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Nov 2012 18:08: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: r243678 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 18:08:37 -0000 Author: mav Date: Thu Nov 29 18:08:36 2012 New Revision: 243678 URL: http://svnweb.freebsd.org/changeset/base/243678 Log: MFC r242323, r242328: Add basic BIO_DELETE support to GEOM RAID class for all RAID levels. If at least one subdisk in the volume supports it, BIO_DELETE requests will be propagated down. Unfortunatelly, for RAID levels with redundancy unmapped blocks will be mapped back during first rebuild/resync process. Modified: stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/g_raid.h stable/9/sys/geom/raid/md_ddf.c stable/9/sys/geom/raid/md_intel.c stable/9/sys/geom/raid/md_jmicron.c stable/9/sys/geom/raid/md_nvidia.c stable/9/sys/geom/raid/md_promise.c stable/9/sys/geom/raid/md_sii.c stable/9/sys/geom/raid/tr_concat.c stable/9/sys/geom/raid/tr_raid0.c stable/9/sys/geom/raid/tr_raid1.c stable/9/sys/geom/raid/tr_raid1e.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/g_raid.c Thu Nov 29 18:08:36 2012 (r243678) @@ -499,6 +499,34 @@ g_raid_get_diskname(struct g_raid_disk * } void +g_raid_get_disk_info(struct g_raid_disk *disk) +{ + struct g_consumer *cp = disk->d_consumer; + int error, len; + + /* Read kernel dumping information. */ + disk->d_kd.offset = 0; + disk->d_kd.length = OFF_MAX; + len = sizeof(disk->d_kd); + error = g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); + if (error) + disk->d_kd.di.dumper = NULL; + if (disk->d_kd.di.dumper == NULL) + G_RAID_DEBUG1(2, disk->d_softc, + "Dumping not supported by %s: %d.", + cp->provider->name, error); + + /* Read BIO_DELETE support. */ + error = g_getattr("GEOM::candelete", cp, &disk->d_candelete); + if (error) + disk->d_candelete = 0; + if (!disk->d_candelete) + G_RAID_DEBUG1(2, disk->d_softc, + "BIO_DELETE not supported by %s: %d.", + cp->provider->name, error); +} + +void g_raid_report_disk_state(struct g_raid_disk *disk) { struct g_raid_subdisk *sd; @@ -1052,6 +1080,31 @@ g_raid_kerneldump(struct g_raid_softc *s } static void +g_raid_candelete(struct g_raid_softc *sc, struct bio *bp) +{ + struct g_provider *pp; + struct g_raid_volume *vol; + struct g_raid_subdisk *sd; + int *val; + int i; + + val = (int *)bp->bio_data; + pp = bp->bio_to; + vol = pp->private; + *val = 0; + for (i = 0; i < vol->v_disks_count; i++) { + sd = &vol->v_subdisks[i]; + if (sd->sd_state == G_RAID_SUBDISK_S_NONE) + continue; + if (sd->sd_disk->d_candelete) { + *val = 1; + break; + } + } + g_io_deliver(bp, 0); +} + +static void g_raid_start(struct bio *bp) { struct g_raid_softc *sc; @@ -1073,7 +1126,9 @@ g_raid_start(struct bio *bp) case BIO_FLUSH: break; case BIO_GETATTR: - if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) + if (!strcmp(bp->bio_attribute, "GEOM::candelete")) + g_raid_candelete(sc, bp); + else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) g_raid_kerneldump(sc, bp); else g_io_deliver(bp, EOPNOTSUPP); Modified: stable/9/sys/geom/raid/g_raid.h ============================================================================== --- stable/9/sys/geom/raid/g_raid.h Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/g_raid.h Thu Nov 29 18:08:36 2012 (r243678) @@ -153,6 +153,7 @@ struct g_raid_disk { struct g_consumer *d_consumer; /* GEOM disk consumer. */ void *d_md_data; /* Disk's metadata storage. */ struct g_kerneldump d_kd; /* Kernel dumping method/args. */ + int d_candelete; /* BIO_DELETE supported. */ uint64_t d_flags; /* Additional flags. */ u_int d_state; /* Disk state. */ u_int d_load; /* Disk average load. */ @@ -418,6 +419,7 @@ struct g_raid_volume * g_raid_create_vol const char *name, int id); struct g_raid_disk * g_raid_create_disk(struct g_raid_softc *sc); const char * g_raid_get_diskname(struct g_raid_disk *disk); +void g_raid_get_disk_info(struct g_raid_disk *disk); int g_raid_start_volume(struct g_raid_volume *vol); Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_ddf.c Thu Nov 29 18:08:36 2012 (r243678) @@ -2087,7 +2087,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj struct g_raid_md_ddf_perdisk *pd; struct g_raid_md_ddf_object *mdi; struct g_geom *geom; - int error, result, len, be; + int error, result, be; char name[16]; G_RAID_DEBUG(1, "Tasting DDF on %s", cp->provider->name); @@ -2154,14 +2154,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_ddf_new_disk(disk); @@ -2348,15 +2341,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec ddf_meta_update(&mdi->mdio_meta, &pd->pd_meta); g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, GET64(&pd->pd_meta, @@ -2675,15 +2660,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_intel.c Thu Nov 29 18:08:36 2012 (r243678) @@ -1369,14 +1369,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_intel_new_disk(disk); @@ -1556,15 +1549,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); intel_set_disk_sectors(&pd->pd_disk_meta, pp->mediasize / pp->sectorsize); @@ -2080,15 +2065,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); memcpy(&pd->pd_disk_meta.serial[0], &serial[0], INTEL_SERIAL_LEN); Modified: stable/9/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/9/sys/geom/raid/md_jmicron.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_jmicron.c Thu Nov 29 18:08:36 2012 (r243678) @@ -826,7 +826,7 @@ g_raid_md_taste_jmicron(struct g_raid_md struct jmicron_raid_conf *meta; struct g_raid_md_jmicron_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[16]; uint16_t vendor; @@ -945,14 +945,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_jmicron_new_disk(disk); @@ -1115,15 +1108,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1374,15 +1359,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_jmicron_start_disk(disk); Modified: stable/9/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/9/sys/geom/raid/md_nvidia.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_nvidia.c Thu Nov 29 18:08:36 2012 (r243678) @@ -830,7 +830,7 @@ g_raid_md_taste_nvidia(struct g_raid_md_ struct nvidia_raid_conf *meta; struct g_raid_md_nvidia_perdisk *pd; struct g_geom *geom; - int error, result, spare, len; + int result, spare, len; char name[32]; uint16_t vendor; @@ -939,14 +939,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_nvidia_new_disk(disk); @@ -1117,15 +1110,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1377,15 +1362,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_nvidia_start_disk(disk); Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_promise.c Thu Nov 29 18:08:36 2012 (r243678) @@ -1046,7 +1046,7 @@ g_raid_md_taste_promise(struct g_raid_md struct promise_raid_conf *meta, *metaarr[4]; struct g_raid_md_promise_perdisk *pd; struct g_geom *geom; - int error, i, j, result, len, subdisks; + int i, j, result, len, subdisks; char name[16]; uint16_t vendor; @@ -1142,14 +1142,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_promise_new_disk(disk); @@ -1337,15 +1330,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, pp->mediasize - 131072llu * pp->sectorsize); @@ -1659,15 +1644,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: stable/9/sys/geom/raid/md_sii.c ============================================================================== --- stable/9/sys/geom/raid/md_sii.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_sii.c Thu Nov 29 18:08:36 2012 (r243678) @@ -912,7 +912,7 @@ g_raid_md_taste_sii(struct g_raid_md_obj struct sii_raid_conf *meta; struct g_raid_md_sii_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[32]; uint16_t vendor; @@ -1032,14 +1032,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_sii_new_disk(disk); @@ -1201,15 +1194,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1459,15 +1444,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_sii_start_disk(disk); Modified: stable/9/sys/geom/raid/tr_concat.c ============================================================================== --- stable/9/sys/geom/raid/tr_concat.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_concat.c Thu Nov 29 18:08:36 2012 (r243678) @@ -248,7 +248,8 @@ g_raid_tr_iostart_concat(struct g_raid_t cbp->bio_caller1 = sd; bioq_insert_tail(&queue, cbp); remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; offset = 0; no++; KASSERT(no < vol->v_disks_count || remain == 0, Modified: stable/9/sys/geom/raid/tr_raid0.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid0.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_raid0.c Thu Nov 29 18:08:36 2012 (r243678) @@ -234,7 +234,8 @@ g_raid_tr_iostart_raid0(struct g_raid_tr offset += strip_size; } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } while (remain > 0); for (cbp = bioq_first(&queue); cbp != NULL; Modified: stable/9/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_raid1.c Thu Nov 29 18:08:36 2012 (r243678) @@ -647,10 +647,8 @@ g_raid_tr_iostart_raid1(struct g_raid_tr g_raid_tr_iostart_raid1_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -896,7 +894,7 @@ rebuild_round_done: if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); } Modified: stable/9/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1e.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_raid1e.c Thu Nov 29 18:08:36 2012 (r243678) @@ -802,7 +802,8 @@ nextdisk: } } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } for (cbp = bioq_first(&queue); cbp != NULL; @@ -858,10 +859,8 @@ g_raid_tr_iostart_raid1e(struct g_raid_t g_raid_tr_iostart_raid1e_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1e_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1e_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -1122,7 +1121,7 @@ rebuild_round_done: if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 29 21:26:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4110F1; Thu, 29 Nov 2012 21:26:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 867978FC0C; Thu, 29 Nov 2012 21:26:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATLQw90058791; Thu, 29 Nov 2012 21:26:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATLQvdm058769; Thu, 29 Nov 2012 21:26:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211292126.qATLQvdm058769@svn.freebsd.org> From: Dimitry Andric Date: Thu, 29 Nov 2012 21:26: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: r243683 - in stable/9/contrib/libc++: include include/ext src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 21:26:58 -0000 Author: dim Date: Thu Nov 29 21:26:57 2012 New Revision: 243683 URL: http://svnweb.freebsd.org/changeset/base/243683 Log: MFC r242945 (by theraven): Import new version of libc++ into base. Modified: stable/9/contrib/libc++/include/__config stable/9/contrib/libc++/include/__functional_base stable/9/contrib/libc++/include/__functional_base_03 stable/9/contrib/libc++/include/__locale stable/9/contrib/libc++/include/__mutex_base stable/9/contrib/libc++/include/algorithm stable/9/contrib/libc++/include/cmath stable/9/contrib/libc++/include/complex stable/9/contrib/libc++/include/condition_variable stable/9/contrib/libc++/include/cstddef stable/9/contrib/libc++/include/ext/__hash stable/9/contrib/libc++/include/future stable/9/contrib/libc++/include/ios stable/9/contrib/libc++/include/istream stable/9/contrib/libc++/include/iterator stable/9/contrib/libc++/include/locale stable/9/contrib/libc++/include/memory stable/9/contrib/libc++/include/ostream stable/9/contrib/libc++/include/random stable/9/contrib/libc++/include/streambuf stable/9/contrib/libc++/include/string stable/9/contrib/libc++/include/system_error stable/9/contrib/libc++/include/tuple stable/9/contrib/libc++/include/type_traits stable/9/contrib/libc++/include/utility stable/9/contrib/libc++/include/valarray stable/9/contrib/libc++/include/vector stable/9/contrib/libc++/src/memory.cpp Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/9/contrib/libc++/include/__config ============================================================================== --- stable/9/contrib/libc++/include/__config Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__config Thu Nov 29 21:26:57 2012 (r243683) @@ -415,11 +415,11 @@ template struct __static_asse #endif #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum _ +#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ - _ __v_; \ - _LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \ - _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<_>(__v)) {} \ + __lx __v_; \ + _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ + _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS @@ -427,6 +427,10 @@ template struct __static_asse #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) #endif // _LIBCPP_HAS_NO_STRONG_ENUMS +#ifndef _LIBCPP_EXTERN_TEMPLATE +#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; +#endif + #if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__ #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif Modified: stable/9/contrib/libc++/include/__functional_base ============================================================================== --- stable/9/contrib/libc++/include/__functional_base Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__functional_base Thu Nov 29 21:26:57 2012 (r243683) @@ -43,7 +43,7 @@ template struct __has_result_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::result_type* = 0); public: @@ -69,7 +69,7 @@ template struct __derives_from_unary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static unary_function<_Ap, _Rp> @@ -83,7 +83,7 @@ template struct __derives_from_binary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static binary_function<_A1, _A2, _Rp> Modified: stable/9/contrib/libc++/include/__functional_base_03 ============================================================================== --- stable/9/contrib/libc++/include/__functional_base_03 Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__functional_base_03 Thu Nov 29 21:26:57 2012 (r243683) @@ -19,7 +19,7 @@ template struct __derives_from_unary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static unary_function<_Ap, _Rp> @@ -33,7 +33,7 @@ template struct __derives_from_binary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static binary_function<_A1, _A2, _Rp> @@ -943,7 +943,7 @@ template struct __has_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::type* = 0); public: Modified: stable/9/contrib/libc++/include/__locale ============================================================================== --- stable/9/contrib/libc++/include/__locale Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__locale Thu Nov 29 21:26:57 2012 (r243683) @@ -254,8 +254,8 @@ collate<_CharT>::do_hash(const char_type return static_cast(__h); } -extern template class _LIBCPP_VISIBLE collate; -extern template class _LIBCPP_VISIBLE collate; +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate) +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate) // template class collate_byname; @@ -1135,10 +1135,10 @@ codecvt_byname<_InternT, _ExternT, _Stat { } -extern template class codecvt_byname; -extern template class codecvt_byname; -extern template class codecvt_byname; -extern template class codecvt_byname; +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) _LIBCPP_VISIBLE void __throw_runtime_error(const char*); Modified: stable/9/contrib/libc++/include/__mutex_base ============================================================================== --- stable/9/contrib/libc++/include/__mutex_base Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__mutex_base Thu Nov 29 21:26:57 2012 (r243683) @@ -287,14 +287,14 @@ swap(unique_lock<_Mutex>& __x, unique_lo struct _LIBCPP_VISIBLE cv_status { - enum _ { + enum __lx { no_timeout, timeout }; - _ __v_; + __lx __v_; - _LIBCPP_INLINE_VISIBILITY cv_status(_ __v) : __v_(__v) {} + _LIBCPP_INLINE_VISIBILITY cv_status(__lx __v) : __v_(__v) {} _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} }; Modified: stable/9/contrib/libc++/include/algorithm ============================================================================== --- stable/9/contrib/libc++/include/algorithm Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/algorithm Thu Nov 29 21:26:57 2012 (r243683) @@ -3782,39 +3782,39 @@ sort(__wrap_iter<_Tp*> __first, __wrap_i #pragma warning( push ) #pragma warning( disable: 4231) #endif // _MSC_VER -extern template void __sort<__less&, char*>(char*, char*, __less&); -extern template void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&); -extern template void __sort<__less&, signed char*>(signed char*, signed char*, __less&); -extern template void __sort<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&); -extern template void __sort<__less&, short*>(short*, short*, __less&); -extern template void __sort<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&); -extern template void __sort<__less&, int*>(int*, int*, __less&); -extern template void __sort<__less&, unsigned*>(unsigned*, unsigned*, __less&); -extern template void __sort<__less&, long*>(long*, long*, __less&); -extern template void __sort<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&); -extern template void __sort<__less&, long long*>(long long*, long long*, __less&); -extern template void __sort<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&); -extern template void __sort<__less&, float*>(float*, float*, __less&); -extern template void __sort<__less&, double*>(double*, double*, __less&); -extern template void __sort<__less&, long double*>(long double*, long double*, __less&); - -extern template bool __insertion_sort_incomplete<__less&, char*>(char*, char*, __less&); -extern template bool __insertion_sort_incomplete<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&); -extern template bool __insertion_sort_incomplete<__less&, signed char*>(signed char*, signed char*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&); -extern template bool __insertion_sort_incomplete<__less&, short*>(short*, short*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&); -extern template bool __insertion_sort_incomplete<__less&, int*>(int*, int*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned*>(unsigned*, unsigned*, __less&); -extern template bool __insertion_sort_incomplete<__less&, long*>(long*, long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, long long*>(long long*, long long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, float*>(float*, float*, __less&); -extern template bool __insertion_sort_incomplete<__less&, double*>(double*, double*, __less&); -extern template bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&); +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, char*>(char*, char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, signed char*>(signed char*, signed char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, short*>(short*, short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, int*>(int*, int*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned*>(unsigned*, unsigned*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, long*>(long*, long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, long long*>(long long*, long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, float*>(float*, float*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, double*>(double*, double*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, long double*>(long double*, long double*, __less&)) + +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, char*>(char*, char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, signed char*>(signed char*, signed char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, short*>(short*, short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, int*>(int*, int*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned*>(unsigned*, unsigned*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, long*>(long*, long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, long long*>(long long*, long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, float*>(float*, float*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, double*>(double*, double*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&)) -extern template unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&); +_LIBCPP_EXTERN_TEMPLATE(unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&)) #ifdef _MSC_VER #pragma warning( pop ) #endif // _MSC_VER Modified: stable/9/contrib/libc++/include/cmath ============================================================================== --- stable/9/contrib/libc++/include/cmath Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/cmath Thu Nov 29 21:26:57 2012 (r243683) @@ -1202,7 +1202,9 @@ fdim(_A1 __x, _A2 __y) _NOEXCEPT // fma inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) _NOEXCEPT {return (float)((double)__x*__y + __z);} +#ifndef FP_FAST_FMAF #define FP_FAST_FMAF +#endif using ::fma; Modified: stable/9/contrib/libc++/include/complex ============================================================================== --- stable/9/contrib/libc++/include/complex Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/complex Thu Nov 29 21:26:57 2012 (r243683) @@ -1249,10 +1249,12 @@ acosh(const complex<_Tp>& __x) if (isnan(__x.imag())) return complex<_Tp>(abs(__x.real()), __x.imag()); if (isinf(__x.imag())) + { if (__x.real() > 0) return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag())); else return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag())); + } if (__x.real() < 0) return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag())); return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag())); Modified: stable/9/contrib/libc++/include/condition_variable ============================================================================== --- stable/9/contrib/libc++/include/condition_variable Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/condition_variable Thu Nov 29 21:26:57 2012 (r243683) @@ -163,7 +163,7 @@ inline _LIBCPP_INLINE_VISIBILITY void condition_variable_any::notify_one() _NOEXCEPT { - {lock_guard _(*__mut_);} + {lock_guard __lx(*__mut_);} __cv_.notify_one(); } @@ -171,7 +171,7 @@ inline _LIBCPP_INLINE_VISIBILITY void condition_variable_any::notify_all() _NOEXCEPT { - {lock_guard _(*__mut_);} + {lock_guard __lx(*__mut_);} __cv_.notify_all(); } @@ -188,8 +188,8 @@ condition_variable_any::wait(_Lock& __lo shared_ptr __mut = __mut_; unique_lock __lk(*__mut); __lock.unlock(); - unique_ptr<_Lock, __lock_external> __(&__lock); - lock_guard > _(__lk, adopt_lock); + unique_ptr<_Lock, __lock_external> __lxx(&__lock); + lock_guard > __lx(__lk, adopt_lock); __cv_.wait(__lk); } // __mut_.unlock(), __lock.lock() @@ -210,8 +210,8 @@ condition_variable_any::wait_until(_Lock shared_ptr __mut = __mut_; unique_lock __lk(*__mut); __lock.unlock(); - unique_ptr<_Lock, __lock_external> __(&__lock); - lock_guard > _(__lk, adopt_lock); + unique_ptr<_Lock, __lock_external> __lxx(&__lock); + lock_guard > __lx(__lk, adopt_lock); return __cv_.wait_until(__lk, __t); } // __mut_.unlock(), __lock.lock() Modified: stable/9/contrib/libc++/include/cstddef ============================================================================== --- stable/9/contrib/libc++/include/cstddef Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/cstddef Thu Nov 29 21:26:57 2012 (r243683) @@ -58,12 +58,12 @@ typedef long double max_align_t; struct _LIBCPP_VISIBLE nullptr_t { - void* _; + void* __lx; struct __nat {int __for_bool_;}; - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : _(0) {} - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : _(0) {} + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {} + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {} _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;} Modified: stable/9/contrib/libc++/include/ext/__hash ============================================================================== --- stable/9/contrib/libc++/include/ext/__hash Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/ext/__hash Thu Nov 29 21:26:57 2012 (r243683) @@ -43,4 +43,4 @@ template <> struct _LIBCPP_VISIBLE hash< }; } -#endif _LIBCPP_EXT_HASH +#endif // _LIBCPP_EXT_HASH Modified: stable/9/contrib/libc++/include/future ============================================================================== --- stable/9/contrib/libc++/include/future Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/future Thu Nov 29 21:26:57 2012 (r243683) @@ -391,7 +391,7 @@ struct _LIBCPP_VISIBLE is_error_code_enu #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS template <> -struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; +struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; #endif //enum class launch Modified: stable/9/contrib/libc++/include/ios ============================================================================== --- stable/9/contrib/libc++/include/ios Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/ios Thu Nov 29 21:26:57 2012 (r243683) @@ -384,7 +384,7 @@ struct _LIBCPP_VISIBLE is_error_code_enu #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS template <> -struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; +struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; #endif _LIBCPP_VISIBLE Modified: stable/9/contrib/libc++/include/istream ============================================================================== --- stable/9/contrib/libc++/include/istream Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/istream Thu Nov 29 21:26:57 2012 (r243683) @@ -1189,7 +1189,11 @@ basic_istream<_CharT, _Traits>::peek() #endif // _LIBCPP_NO_EXCEPTIONS sentry __sen(*this, true); if (__sen) + { __r = this->rdbuf()->sgetc(); + if (traits_type::eq_int_type(__r, traits_type::eof())) + this->setstate(ios_base::eofbit); + } #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) @@ -1706,9 +1710,9 @@ operator>>(basic_istream<_CharT, _Traits return __is; } -extern template class basic_istream; -extern template class basic_istream; -extern template class basic_iostream; +_LIBCPP_EXTERN_TEMPLATE(class basic_istream) +_LIBCPP_EXTERN_TEMPLATE(class basic_istream) +_LIBCPP_EXTERN_TEMPLATE(class basic_iostream) _LIBCPP_END_NAMESPACE_STD Modified: stable/9/contrib/libc++/include/iterator ============================================================================== --- stable/9/contrib/libc++/include/iterator Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/iterator Thu Nov 29 21:26:57 2012 (r243683) @@ -337,7 +337,7 @@ template struct __has_iterator_category { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::iterator_category* = 0); public: Modified: stable/9/contrib/libc++/include/locale ============================================================================== --- stable/9/contrib/libc++/include/locale Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/locale Thu Nov 29 21:26:57 2012 (r243683) @@ -692,8 +692,8 @@ __num_get<_CharT>::__stage2_float_loop(_ return 0; } -extern template struct __num_get; -extern template struct __num_get; +_LIBCPP_EXTERN_TEMPLATE(struct __num_get) +_LIBCPP_EXTERN_TEMPLATE(struct __num_get) template > class _LIBCPP_VISIBLE num_get @@ -1314,8 +1314,8 @@ num_get<_CharT, _InputIterator>::do_get( return __b; } -extern template class num_get; -extern template class num_get; +_LIBCPP_EXTERN_TEMPLATE(class num_get) +_LIBCPP_EXTERN_TEMPLATE(class num_get) struct __num_put_base { @@ -1464,8 +1464,8 @@ __num_put<_CharT>::__widen_and_group_flo __op = __ob + (__np - __nb); } -extern template struct __num_put; -extern template struct __num_put; +_LIBCPP_EXTERN_TEMPLATE(struct __num_put) +_LIBCPP_EXTERN_TEMPLATE(struct __num_put) template > class _LIBCPP_VISIBLE num_put @@ -1938,8 +1938,8 @@ num_put<_CharT, _OutputIterator>::do_put return __pad_and_output(__s, __o, __op, __oe, __iob, __fl); } -extern template class num_put; -extern template class num_put; +_LIBCPP_EXTERN_TEMPLATE(class num_put) +_LIBCPP_EXTERN_TEMPLATE(class num_put) template _LIBCPP_HIDDEN @@ -2605,8 +2605,8 @@ time_get<_CharT, _InputIterator>::do_get return __b; } -extern template class time_get; -extern template class time_get; +_LIBCPP_EXTERN_TEMPLATE(class time_get) +_LIBCPP_EXTERN_TEMPLATE(class time_get) class __time_get { @@ -2688,8 +2688,8 @@ private: virtual const string_type& __X() const {return this->__X_;} }; -extern template class time_get_byname; -extern template class time_get_byname; +_LIBCPP_EXTERN_TEMPLATE(class time_get_byname) +_LIBCPP_EXTERN_TEMPLATE(class time_get_byname) class __time_put { @@ -2801,8 +2801,8 @@ time_put<_CharT, _OutputIterator>::do_pu return _VSTD::copy(__nb, __ne, __s); } -extern template class time_put; -extern template class time_put; +_LIBCPP_EXTERN_TEMPLATE(class time_put) +_LIBCPP_EXTERN_TEMPLATE(class time_put) template > class _LIBCPP_VISIBLE time_put_byname @@ -2822,8 +2822,8 @@ protected: ~time_put_byname() {} }; -extern template class time_put_byname; -extern template class time_put_byname; +_LIBCPP_EXTERN_TEMPLATE(class time_put_byname) +_LIBCPP_EXTERN_TEMPLATE(class time_put_byname) // money_base @@ -2885,10 +2885,10 @@ template ::id; -extern template class moneypunct; -extern template class moneypunct; -extern template class moneypunct; -extern template class moneypunct; +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) // moneypunct_byname @@ -2942,10 +2942,10 @@ template<> void moneypunct_byname void moneypunct_byname::init(const char*); template<> void moneypunct_byname::init(const char*); -extern template class moneypunct_byname; -extern template class moneypunct_byname; -extern template class moneypunct_byname; -extern template class moneypunct_byname; +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) // money_get @@ -3001,8 +3001,8 @@ __money_get<_CharT>::__gather_info(bool } } -extern template class __money_get; -extern template class __money_get; +_LIBCPP_EXTERN_TEMPLATE(class __money_get) +_LIBCPP_EXTERN_TEMPLATE(class __money_get) template > class _LIBCPP_VISIBLE money_get @@ -3382,8 +3382,8 @@ money_get<_CharT, _InputIterator>::do_ge return __b; } -extern template class money_get; -extern template class money_get; +_LIBCPP_EXTERN_TEMPLATE(class money_get) +_LIBCPP_EXTERN_TEMPLATE(class money_get) // money_put @@ -3557,8 +3557,8 @@ __money_put<_CharT>::__format(char_type* __mi = __mb; } -extern template class __money_put; -extern template class __money_put; +_LIBCPP_EXTERN_TEMPLATE(class __money_put) +_LIBCPP_EXTERN_TEMPLATE(class __money_put) template > class _LIBCPP_VISIBLE money_put @@ -3714,8 +3714,8 @@ money_put<_CharT, _OutputIterator>::do_p return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl); } -extern template class money_put; -extern template class money_put; +_LIBCPP_EXTERN_TEMPLATE(class money_put) +_LIBCPP_EXTERN_TEMPLATE(class money_put) // messages @@ -3824,8 +3824,8 @@ messages<_CharT>::do_close(catalog __c) #endif // !_WIN32 } -extern template class messages; -extern template class messages; +_LIBCPP_EXTERN_TEMPLATE(class messages) +_LIBCPP_EXTERN_TEMPLATE(class messages) template class _LIBCPP_VISIBLE messages_byname @@ -3848,8 +3848,8 @@ protected: ~messages_byname() {} }; -extern template class messages_byname; -extern template class messages_byname; +_LIBCPP_EXTERN_TEMPLATE(class messages_byname) +_LIBCPP_EXTERN_TEMPLATE(class messages_byname) template, Modified: stable/9/contrib/libc++/include/memory ============================================================================== --- stable/9/contrib/libc++/include/memory Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/memory Thu Nov 29 21:26:57 2012 (r243683) @@ -694,7 +694,7 @@ template struct __has_element_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::element_type* = 0); public: @@ -782,7 +782,7 @@ template struct __has_difference_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::difference_type* = 0); public: @@ -805,7 +805,7 @@ template struct __has_rebind { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Xp::template rebind<_Up>* = 0); public: @@ -998,7 +998,7 @@ template struct __has_const_pointer { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::const_pointer* = 0); public: @@ -1025,7 +1025,7 @@ template struct __has_void_pointer { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::void_pointer* = 0); public: @@ -1052,7 +1052,7 @@ template struct __has_const_void_pointer { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::const_void_pointer* = 0); public: @@ -1095,7 +1095,7 @@ template struct __has_size_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::size_type* = 0); public: @@ -1118,7 +1118,7 @@ template struct __has_propagate_on_container_copy_assignment { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::propagate_on_container_copy_assignment* = 0); public: @@ -1141,7 +1141,7 @@ template struct __has_propagate_on_container_move_assignment { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::propagate_on_container_move_assignment* = 0); public: @@ -1164,7 +1164,7 @@ template struct __has_propagate_on_container_swap { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::propagate_on_container_swap* = 0); public: @@ -1187,7 +1187,7 @@ template static __two __test(...); template static char __test(typename _Xp::template rebind<_Up>::other* = 0); public: @@ -5268,7 +5268,7 @@ operator<<(basic_ostream<_CharT, _Traits class __sp_mut { - void* _; + void* __lx; public: void lock() _NOEXCEPT; void unlock() _NOEXCEPT; @@ -5395,17 +5395,17 @@ atomic_compare_exchange_weak_explicit(sh //enum class struct _LIBCPP_VISIBLE pointer_safety { - enum _ + enum __lx { relaxed, preferred, strict }; - _ __v_; + __lx __v_; _LIBCPP_INLINE_VISIBILITY - pointer_safety(_ __v) : __v_(__v) {} + pointer_safety(__lx __v) : __v_(__v) {} _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} }; Modified: stable/9/contrib/libc++/include/ostream ============================================================================== --- stable/9/contrib/libc++/include/ostream Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/ostream Thu Nov 29 21:26:57 2012 (r243683) @@ -1287,8 +1287,8 @@ operator<<(basic_ostream<_CharT, _Traits use_facet >(__os.getloc()).widen('1')); } -extern template class basic_ostream; -extern template class basic_ostream; +_LIBCPP_EXTERN_TEMPLATE(class basic_ostream) +_LIBCPP_EXTERN_TEMPLATE(class basic_ostream) _LIBCPP_END_NAMESPACE_STD Modified: stable/9/contrib/libc++/include/random ============================================================================== --- stable/9/contrib/libc++/include/random Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/random Thu Nov 29 21:26:57 2012 (r243683) @@ -1991,7 +1991,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const linear_congruential_engine<_UIntType, __a, __c, __m>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); __os.fill(__os.widen(' ')); return __os << __x.__x_; @@ -2003,7 +2003,7 @@ basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, linear_congruential_engine<_UIntType, __a, __c, __m>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _UIntType __t; __is >> __t; @@ -2377,7 +2377,7 @@ operator<<(basic_ostream<_CharT, _Traits const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -2398,7 +2398,7 @@ operator>>(basic_istream<_CharT, _Traits mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _UI __t[_Np]; for (size_t __i = 0; __i < _Np; ++__i) @@ -2684,7 +2684,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -2703,7 +2703,7 @@ basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _UI __t[_Rp+1]; for (size_t __i = 0; __i < _Rp+1; ++__i) @@ -2859,7 +2859,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const discard_block_engine<_Eng, _Pp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -2872,7 +2872,7 @@ basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, discard_block_engine<_Eng, _Pp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _Eng __e; int __n; @@ -3340,7 +3340,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const shuffle_order_engine<_Eng, _Kp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -3357,7 +3357,7 @@ operator>>(basic_istream<_CharT, _Traits shuffle_order_engine<_Eng, _Kp>& __x) { typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _Eng __e; result_type _Vp[_Kp+1]; @@ -3561,7 +3561,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const uniform_int_distribution<_IT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -3576,7 +3576,7 @@ operator>>(basic_istream<_CharT, _Traits typedef uniform_int_distribution<_IT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -3682,7 +3682,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const uniform_real_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -3698,7 +3698,7 @@ operator>>(basic_istream<_CharT, _Traits typedef uniform_real_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -3793,7 +3793,7 @@ template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -3807,7 +3807,7 @@ operator>>(basic_istream<_CharT, _Traits { typedef bernoulli_distribution _Eng; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); double __p; __is >> __p; @@ -3955,7 +3955,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const binomial_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -3971,7 +3971,7 @@ operator>>(basic_istream<_CharT, _Traits typedef binomial_distribution<_IntType> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __t; double __p; @@ -4073,7 +4073,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const exponential_distribution<_RealType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); return __os << __x.lambda(); @@ -4087,7 +4087,7 @@ operator>>(basic_istream<_CharT, _Traits typedef exponential_distribution<_RealType> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __lambda; __is >> __lambda; @@ -4227,7 +4227,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const normal_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -4246,7 +4246,7 @@ operator>>(basic_istream<_CharT, _Traits typedef normal_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __mean; result_type __stddev; @@ -4598,7 +4598,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const poisson_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); return __os << __x.mean(); @@ -4611,7 +4611,7 @@ operator>>(basic_istream<_CharT, _Traits { typedef poisson_distribution<_IntType> _Eng; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); double __mean; __is >> __mean; @@ -4709,7 +4709,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const weibull_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -4726,7 +4726,7 @@ operator>>(basic_istream<_CharT, _Traits typedef weibull_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -4828,7 +4828,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const extreme_value_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -4845,7 +4845,7 @@ operator>>(basic_istream<_CharT, _Traits typedef extreme_value_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -5000,7 +5000,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const gamma_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -5017,7 +5017,7 @@ operator>>(basic_istream<_CharT, _Traits typedef gamma_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __alpha; result_type __beta; @@ -5136,7 +5136,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const negative_binomial_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -5152,7 +5152,7 @@ operator>>(basic_istream<_CharT, _Traits typedef negative_binomial_distribution<_IntType> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __k; double __p; @@ -5242,7 +5242,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const geometric_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); return __os << __x.p(); @@ -5255,7 +5255,7 @@ operator>>(basic_istream<_CharT, _Traits { typedef geometric_distribution<_IntType> _Eng; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 30 03:38:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 800C1659; Fri, 30 Nov 2012 03:38:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64EA08FC14; Fri, 30 Nov 2012 03:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3c30H009044; Fri, 30 Nov 2012 03:38:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3c33n009043; Fri, 30 Nov 2012 03:38:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211300338.qAU3c33n009043@svn.freebsd.org> From: Eitan Adler Date: Fri, 30 Nov 2012 03:38:03 +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: r243697 - stable/9/sys/dev/mfi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:38:03 -0000 Author: eadler Date: Fri Nov 30 03:38:02 2012 New Revision: 243697 URL: http://svnweb.freebsd.org/changeset/base/243697 Log: MFC r243078: Add deviceid to the disk output on boot to help debugging. PR: kern/173290 Approved by: cperciva (implicit) Modified: stable/9/sys/dev/mfi/mfi_syspd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi_syspd.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:38:01 2012 (r243696) +++ stable/9/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:38:02 2012 (r243697) @@ -116,8 +116,8 @@ mfi_syspd_attach(device_t dev) mtx_lock(&sc->pd_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->pd_controller->mfi_syspd_tqh, sc, pd_link); mtx_unlock(&sc->pd_controller->mfi_io_lock); - device_printf(dev, "%juMB (%ju sectors) SYSPD volume\n", - sectors / (1024 * 1024 / secsize), sectors); + device_printf(dev, "%juMB (%ju sectors) SYSPD volume (deviceid: %d)\n", + sectors / (1024 * 1024 / secsize), sectors, sc->pd_id); sc->pd_disk = disk_alloc(); sc->pd_disk->d_drv1 = sc; sc->pd_disk->d_maxsize = sc->pd_controller->mfi_max_io * secsize; From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 30 03:48:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1079AB55; Fri, 30 Nov 2012 03:48:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEFE68FC16; Fri, 30 Nov 2012 03:48:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3mj5j010620; Fri, 30 Nov 2012 03:48:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3mjRQ010618; Fri, 30 Nov 2012 03:48:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211300348.qAU3mjRQ010618@svn.freebsd.org> From: Eitan Adler Date: Fri, 30 Nov 2012 03:48:45 +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: r243698 - stable/9/sbin/umount X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:48:46 -0000 Author: eadler Date: Fri Nov 30 03:48:45 2012 New Revision: 243698 URL: http://svnweb.freebsd.org/changeset/base/243698 Log: MFC r243082: Fix memory leak in umount.c PR: bin/172553 Approved by: cperciva (implicit) Modified: stable/9/sbin/umount/umount.c Directory Properties: stable/9/sbin/umount/ (props changed) Modified: stable/9/sbin/umount/umount.c ============================================================================== --- stable/9/sbin/umount/umount.c Fri Nov 30 03:38:02 2012 (r243697) +++ stable/9/sbin/umount/umount.c Fri Nov 30 03:48:45 2012 (r243698) @@ -359,8 +359,10 @@ umountfs(struct statfs *sfs) do_rpc = 1; } - if (!namematch(ai)) + if (!namematch(ai)) { + free(orignfsdirname); return (1); + } /* First try to unmount using the file system ID. */ snprintf(fsidbuf, sizeof(fsidbuf), "FSID:%d:%d", sfs->f_fsid.val[0], sfs->f_fsid.val[1]); @@ -369,13 +371,16 @@ umountfs(struct statfs *sfs) if (errno != ENOENT || sfs->f_fsid.val[0] != 0 || sfs->f_fsid.val[1] != 0) warn("unmount of %s failed", sfs->f_mntonname); - if (errno != ENOENT) + if (errno != ENOENT) { + free(orignfsdirname); return (1); + } /* Compatibility for old kernels. */ if (sfs->f_fsid.val[0] != 0 || sfs->f_fsid.val[1] != 0) warnx("retrying using path instead of file system ID"); if (unmount(sfs->f_mntonname, fflag) != 0) { warn("unmount of %s failed", sfs->f_mntonname); + free(orignfsdirname); return (1); } } @@ -393,6 +398,7 @@ umountfs(struct statfs *sfs) if (clp == NULL) { warnx("%s: %s", hostp, clnt_spcreateerror("MOUNTPROG")); + free(orignfsdirname); return (1); } clp->cl_auth = authsys_create_default(); @@ -403,6 +409,7 @@ umountfs(struct statfs *sfs) if (clnt_stat != RPC_SUCCESS) { warnx("%s: %s", hostp, clnt_sperror(clp, "RPCMNT_UMOUNT")); + free(orignfsdirname); return (1); } /* @@ -415,10 +422,10 @@ umountfs(struct statfs *sfs) hostp, nfsdirname); free_mtab(); } - free(orignfsdirname); auth_destroy(clp->cl_auth); clnt_destroy(clp); } + free(orignfsdirname); return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 30 05:30:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82DC417D; Fri, 30 Nov 2012 05:30:32 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0928FC14; Fri, 30 Nov 2012 05:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU5UWaF023780; Fri, 30 Nov 2012 05:30:32 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU5UWvR023779; Fri, 30 Nov 2012 05:30:32 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201211300530.qAU5UWvR023779@svn.freebsd.org> From: David Xu Date: Fri, 30 Nov 2012 05:30: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: r243702 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 05:30:32 -0000 Author: davidxu Date: Fri Nov 30 05:30:31 2012 New Revision: 243702 URL: http://svnweb.freebsd.org/changeset/base/243702 Log: MFC r243599: Take first active vnode correctly. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Fri Nov 30 04:56:39 2012 (r243701) +++ stable/9/sys/kern/vfs_subr.c Fri Nov 30 05:30:31 2012 (r243702) @@ -4776,7 +4776,7 @@ __mnt_vnode_first_active(struct vnode ** MNT_REF(mp); (*mvp)->v_type = VMARKER; - vp = TAILQ_NEXT(*mvp, v_actfreelist); + vp = TAILQ_FIRST(&mp->mnt_activevnodelist); while (vp != NULL) { VI_LOCK(vp); if (vp->v_mount == mp && vp->v_type != VMARKER && From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 30 19:27:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4308DB1; Fri, 30 Nov 2012 19:27:31 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A94F38FC17; Fri, 30 Nov 2012 19:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUJRVkY043073; Fri, 30 Nov 2012 19:27:31 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUJRVcI043072; Fri, 30 Nov 2012 19:27:31 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201211301927.qAUJRVcI043072@svn.freebsd.org> From: Ken Smith Date: Fri, 30 Nov 2012 19:27:31 +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: r243708 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 19:27:31 -0000 Author: kensmith Date: Fri Nov 30 19:27:31 2012 New Revision: 243708 URL: http://svnweb.freebsd.org/changeset/base/243708 Log: Guess when we'll be ready to announce 9.1-RELEASE. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Fri Nov 30 16:33:22 2012 (r243707) +++ stable/9/UPDATING Fri Nov 30 19:27:31 2012 (r243708) @@ -9,6 +9,9 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121205: + 9.1-RELEASE. + 20121129: A new version of ZFS (pool version 5000) has been merged to 9-STABLE. Starting with this version the old system of ZFS pool versioning From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 01:07:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0BD1A02; Sat, 1 Dec 2012 01:07:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A64E18FC12; Sat, 1 Dec 2012 01:07:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB117pZ5093745; Sat, 1 Dec 2012 01:07:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB117pv5093741; Sat, 1 Dec 2012 01:07:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212010107.qB117pv5093741@svn.freebsd.org> From: Rick Macklem Date: Sat, 1 Dec 2012 01:07:51 +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: r243738 - in stable/9/sys: fs/nfsserver nfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:07:51 -0000 Author: rmacklem Date: Sat Dec 1 01:07:51 2012 New Revision: 243738 URL: http://svnweb.freebsd.org/changeset/base/243738 Log: MFC: r241561 Add two new options to the nfssvc(2) syscall that allow processes running as root to suspend/resume execution of the kernel nfsd threads. An earlier version of this patch was tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/9/sys/fs/nfsserver/nfs_nfsdport.c stable/9/sys/nfs/nfs_nfssvc.c stable/9/sys/nfs/nfssvc.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat Dec 1 01:07:51 2012 (r243738) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include NFSDLOCKMUTEX; +NFSV4ROOTLOCKMUTEX; +struct nfsv4lock nfsd_suspend_lock; /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. @@ -221,9 +223,24 @@ nfssvc_program(struct svc_req *rqst, SVC #ifdef MAC mac_cred_associate_nfsd(nd.nd_cred); #endif + /* + * Get a refcnt (shared lock) on nfsd_suspend_lock. + * NFSSVC_SUSPENDNFSD will take an exclusive lock on + * nfsd_suspend_lock to suspend these threads. + * This must be done here, before the check of + * nfsv4root exports by nfsvno_v4rootexport(). + */ + NFSLOCKV4ROOTMUTEX(); + nfsv4_getref(&nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); + NFSUNLOCKV4ROOTMUTEX(); + if ((nd.nd_flag & ND_NFSV4) != 0) { nd.nd_repstat = nfsvno_v4rootexport(&nd); if (nd.nd_repstat != 0) { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); svcerr_weakauth(rqst); svc_freereq(rqst); m_freem(nd.nd_mrep); @@ -233,6 +250,9 @@ nfssvc_program(struct svc_req *rqst, SVC cacherep = nfs_proc(&nd, rqst->rq_xid, xprt->xp_socket, xprt->xp_sockref, &rp); + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); } else { NFSMGET(nd.nd_mreq); nd.nd_mreq->m_len = 0; Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sat Dec 1 01:07:51 2012 (r243738) @@ -57,6 +57,7 @@ extern struct mount nfsv4root_mnt; extern struct nfsrv_stablefirst nfsrv_stablefirst; extern void (*nfsd_call_servertimer)(void); extern SVCPOOL *nfsrvd_pool; +extern struct nfsv4lock nfsd_suspend_lock; struct vfsoptlist nfsv4root_opt, nfsv4root_newopt; NFSDLOCKMUTEX; struct mtx nfs_cache_mutex; @@ -3104,8 +3105,9 @@ nfssvc_srvcall(struct thread *p, struct struct nfsd_dumplocks *dumplocks; struct nameidata nd; vnode_t vp; - int error = EINVAL; + int error = EINVAL, igotlock; struct proc *procp; + static int suspend_nfsd = 0; if (uap->flag & NFSSVC_PUBLICFH) { NFSBZERO((caddr_t)&nfs_pubfh.nfsrvfh_data, @@ -3184,6 +3186,26 @@ nfssvc_srvcall(struct thread *p, struct nfsd_master_start = procp->p_stats->p_start; nfsd_master_proc = procp; PROC_UNLOCK(procp); + } else if ((uap->flag & NFSSVC_SUSPENDNFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd == 0) { + /* Lock out all nfsd threads */ + do { + igotlock = nfsv4_lock(&nfsd_suspend_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (igotlock == 0 && suspend_nfsd == 0); + suspend_nfsd = 1; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; + } else if ((uap->flag & NFSSVC_RESUMENFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd != 0) { + nfsv4_unlock(&nfsd_suspend_lock, 0); + suspend_nfsd = 0; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; } NFSEXITCODE(error); Modified: stable/9/sys/nfs/nfs_nfssvc.c ============================================================================== --- stable/9/sys/nfs/nfs_nfssvc.c Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/nfs/nfs_nfssvc.c Sat Dec 1 01:07:51 2012 (r243738) @@ -102,7 +102,8 @@ sys_nfssvc(struct thread *td, struct nfs else if ((uap->flag & (NFSSVC_NFSDNFSD | NFSSVC_NFSDADDSOCK | NFSSVC_PUBLICFH | NFSSVC_V4ROOTEXPORT | NFSSVC_NOPUBLICFH | NFSSVC_STABLERESTART | NFSSVC_ADMINREVOKE | - NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE)) && + NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE | + NFSSVC_SUSPENDNFSD | NFSSVC_RESUMENFSD)) && nfsd_call_nfsd != NULL) error = (*nfsd_call_nfsd)(td, uap); if (error == EINTR || error == ERESTART) Modified: stable/9/sys/nfs/nfssvc.h ============================================================================== --- stable/9/sys/nfs/nfssvc.h Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/nfs/nfssvc.h Sat Dec 1 01:07:51 2012 (r243738) @@ -66,5 +66,7 @@ #define NFSSVC_BACKUPSTABLE 0x00800000 #define NFSSVC_ZEROCLTSTATS 0x01000000 /* modifier for GETSTATS */ #define NFSSVC_ZEROSRVSTATS 0x02000000 /* modifier for GETSTATS */ +#define NFSSVC_SUSPENDNFSD 0x04000000 +#define NFSSVC_RESUMENFSD 0x08000000 #endif /* _NFS_NFSSVC_H */ From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 01:12:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94E10B79; Sat, 1 Dec 2012 01:12:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DA0B8FC0C; Sat, 1 Dec 2012 01:12:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB11C0Q7094521; Sat, 1 Dec 2012 01:12:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB11C0cM094520; Sat, 1 Dec 2012 01:12:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212010112.qB11C0cM094520@svn.freebsd.org> From: Rick Macklem Date: Sat, 1 Dec 2012 01:12:00 +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: r243739 - stable/9/usr.sbin/mountd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:12:00 -0000 Author: rmacklem Date: Sat Dec 1 01:11:59 2012 New Revision: 243739 URL: http://svnweb.freebsd.org/changeset/base/243739 Log: MFC: r241568 Add a new '-S' option to mountd, which tells it to suspend execution of the nfsd threads while it is reloading the exports. This avoids clients from getting intermittent access errors when the exports are being reloaded non-atomically. It is not an ideal solution, since requests will back up while the nfsd threads are suspended. Also, when this option is used, if mountd crashes while reloading exports, mountd will have to be restarted to get the nfsd threads to resume execution. This has been tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). The nfse patch offers a more comprehensive solution for this issue. Modified: stable/9/usr.sbin/mountd/mountd.c Directory Properties: stable/9/usr.sbin/mountd/ (props changed) Modified: stable/9/usr.sbin/mountd/mountd.c ============================================================================== --- stable/9/usr.sbin/mountd/mountd.c Sat Dec 1 01:07:51 2012 (r243738) +++ stable/9/usr.sbin/mountd/mountd.c Sat Dec 1 01:11:59 2012 (r243739) @@ -246,6 +246,7 @@ static int mallocd_svcport = 0; static int *sock_fd; static int sock_fdcnt; static int sock_fdpos; +static int suspend_nfsd = 0; int opt_flags; static int have_v6 = 1; @@ -311,7 +312,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnop:r")) != -1) + while ((c = getopt(argc, argv, "2deh:lnop:rS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -363,6 +364,9 @@ main(int argc, char **argv) out_of_mem(); } break; + case 'S': + suspend_nfsd = 1; + break; default: usage(); }; @@ -921,7 +925,7 @@ usage(void) { fprintf(stderr, "usage: mountd [-2] [-d] [-e] [-l] [-n] [-p ] [-r] " - "[-h ] [export_file ...]\n"); + "[-S] [-h ] [export_file ...]\n"); exit(1); } @@ -1660,6 +1664,8 @@ get_exportlist(void) int done; struct nfsex_args eargs; + if (suspend_nfsd != 0) + (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); v4root_dirpath[0] = '\0'; bzero(&export, sizeof(export)); export.ex_flags = MNT_DELEXPORT; @@ -1790,6 +1796,9 @@ get_exportlist(void) */ if (run_v4server > 0 && has_publicfh == 0) (void) nfssvc(NFSSVC_NOPUBLICFH, NULL); + + /* Resume the nfsd. If they weren't suspended, this is harmless. */ + (void)nfssvc(NFSSVC_RESUMENFSD, NULL); } /* From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 01:16:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44EB7CF2; Sat, 1 Dec 2012 01:16:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27DD08FC08; Sat, 1 Dec 2012 01:16:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB11Gfuj095316; Sat, 1 Dec 2012 01:16:41 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB11GeLS095315; Sat, 1 Dec 2012 01:16:40 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212010116.qB11GeLS095315@svn.freebsd.org> From: Rick Macklem Date: Sat, 1 Dec 2012 01:16:40 +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: r243740 - stable/9/usr.sbin/mountd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:16:41 -0000 Author: rmacklem Date: Sat Dec 1 01:16:40 2012 New Revision: 243740 URL: http://svnweb.freebsd.org/changeset/base/243740 Log: MFC: r241569 Document the -S option added by r241568. Modified: stable/9/usr.sbin/mountd/mountd.8 Directory Properties: stable/9/usr.sbin/mountd/ (props changed) Modified: stable/9/usr.sbin/mountd/mountd.8 ============================================================================== --- stable/9/usr.sbin/mountd/mountd.8 Sat Dec 1 01:11:59 2012 (r243739) +++ stable/9/usr.sbin/mountd/mountd.8 Sat Dec 1 01:16:40 2012 (r243740) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 23, 2011 +.Dd October 14, 2012 .Dt MOUNTD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnor +.Op Fl 2delnorS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -131,6 +131,19 @@ flag. Specify an alternate location for the exports file. More than one exports file can be specified. +.It Fl S +Tell mountd to suspend/resume execution of the nfsd threads whenever +the exports list is being reloaded. +This avoids intermittent access +errors for clients that do NFS RPCs while the exports are being +reloaded, but introduces a delay in RPC response while the reload +is in progress. +If +.Nm +crashes while an exports load is in progress, +.Nm +must be restarted to get the nfsd threads running again, if this +option is used. .El .Pp When From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 02:02:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54A0F357; Sat, 1 Dec 2012 02:02:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39CD18FC16; Sat, 1 Dec 2012 02:02:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB122KT0001993; Sat, 1 Dec 2012 02:02:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB122K7c001991; Sat, 1 Dec 2012 02:02:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201212010202.qB122K7c001991@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Dec 2012 02:02:20 +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: r243742 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 02:02:20 -0000 Author: pfg Date: Sat Dec 1 02:02:19 2012 New Revision: 243742 URL: http://svnweb.freebsd.org/changeset/base/243742 Log: MFC r243562: Update some definitions or make them match NetBSD's headers. Bring several definitions required for newer ext4 features. Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it is not being used yet and the new name is more compatible with NetBSD and Linux. This change is purely cosmetic. Obtained from: NetBSD Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2fs.h Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Dec 1 01:24:40 2012 (r243741) +++ stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Dec 1 02:02:19 2012 (r243742) @@ -60,8 +60,15 @@ #define EXT2_APPEND 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ - -#define EXT2_HTREE 0x00001000 /* HTree-indexed directory */ +#define EXT2_INDEX 0x00001000 /* hash-indexed directory */ +#define EXT2_IMAGIC 0x00002000 /* AFS directory */ +#define EXT2_JOURNAL_DATA 0x00004000 /* file data should be journaled */ +#define EXT2_NOTAIL 0x00008000 /* file tail should not be merged */ +#define EXT2_DIRSYNC 0x00010000 /* dirsync behaviour */ +#define EXT2_TOPDIR 0x00020000 /* Top of directory hierarchies*/ +#define EXT2_HUGE_FILE 0x00040000 /* Set to each huge file */ +#define EXT2_EXTENTS 0x00080000 /* Inode uses extents */ +#define EXT2_EOFBLOCKS 0x00400000 /* Blocks allocated beyond EOF */ /* * Definitions for nanosecond timestamps. @@ -95,9 +102,8 @@ struct ext2fs_dinode { uint32_t e2di_facl; /* 104: file ACL (not implemented) */ uint32_t e2di_dacl; /* 108: dir ACL (not implemented) */ uint32_t e2di_faddr; /* 112: fragment address */ - uint8_t e2di_nfrag; /* 116: fragment number */ - uint8_t e2di_fsize; /* 117: fragment size */ - uint16_t e2di_linux_reserved2; /* 118 */ + uint16_t e2di_nblock_high; /* 116: Blocks count bits 47:32 */ + uint16_t e2di_facl_high; /* 118: file ACL bits 47:32 */ uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_t e2di_linux_reserved3; /* 124 */ Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Sat Dec 1 01:24:40 2012 (r243741) +++ stable/9/sys/fs/ext2fs/ext2fs.h Sat Dec 1 02:02:19 2012 (r243742) @@ -210,15 +210,23 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 -#define EXT2F_COMPAT_HTREE 0x0020 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT4F_ROCOMPAT_HUGE_FILE 0x0008 +#define EXT4F_ROCOMPAT_GDT_CSUM 0x0010 +#define EXT4F_ROCOMPAT_DIR_NLINK 0x0020 #define EXT4F_ROCOMPAT_EXTRA_ISIZE 0x0040 #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT4F_INCOMPAT_META_BG 0x0010 +#define EXT4F_INCOMPAT_EXTENTS 0x0040 +#define EXT4F_INCOMPAT_64BIT 0x0080 +#define EXT4F_INCOMPAT_MMP 0x0100 +#define EXT4F_INCOMPAT_FLEX_BG 0x0200 /* * Features supported in this implementation From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 11:03:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE8EEDC5; Sat, 1 Dec 2012 11:03:19 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B89348FC12; Sat, 1 Dec 2012 11:03:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1B3JR5092929; Sat, 1 Dec 2012 11:03:19 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1B3JdA092928; Sat, 1 Dec 2012 11:03:19 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201212011103.qB1B3JdA092928@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 1 Dec 2012 11:03:19 +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: r243747 - stable/9/contrib/sendmail/src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 11:03:20 -0000 Author: ume Date: Sat Dec 1 11:03:19 2012 New Revision: 243747 URL: http://svnweb.freebsd.org/changeset/base/243747 Log: MFC r243649: cyrus-sasl 2.1.26 was released. In this version, the type of callback functions was changed from "unsigned long" to "size_t". Modified: stable/9/contrib/sendmail/src/sasl.c Directory Properties: stable/9/contrib/sendmail/ (props changed) Modified: stable/9/contrib/sendmail/src/sasl.c ============================================================================== --- stable/9/contrib/sendmail/src/sasl.c Sat Dec 1 08:59:36 2012 (r243746) +++ stable/9/contrib/sendmail/src/sasl.c Sat Dec 1 11:03:19 2012 (r243747) @@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08 ** using unsigned long: for portability, it should be size_t. */ -void *sm_sasl_malloc __P((unsigned long)); -static void *sm_sasl_calloc __P((unsigned long, unsigned long)); -static void *sm_sasl_realloc __P((void *, unsigned long)); +#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a +#define SM_SASL_SIZE_T size_t +#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ +#define SM_SASL_SIZE_T unsigned long +#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ + +void *sm_sasl_malloc __P((SM_SASL_SIZE_T)); +static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T)); +static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T)); void sm_sasl_free __P((void *)); /* @@ -50,7 +56,7 @@ void sm_sasl_free __P((void *)); void * sm_sasl_malloc(size) - unsigned long size; + SM_SASL_SIZE_T size; { return sm_malloc((size_t) size); } @@ -71,8 +77,8 @@ sm_sasl_malloc(size) static void * sm_sasl_calloc(nelem, elemsize) - unsigned long nelem; - unsigned long elemsize; + SM_SASL_SIZE_T nelem; + SM_SASL_SIZE_T elemsize; { size_t size; void *p; @@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize) static void * sm_sasl_realloc(o, size) void *o; - unsigned long size; + SM_SASL_SIZE_T size; { return sm_realloc(o, (size_t) size); } From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 15:46:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40646D49; Sat, 1 Dec 2012 15:46:28 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 250808FC13; Sat, 1 Dec 2012 15:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1FkSQY041347; Sat, 1 Dec 2012 15:46:28 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1FkRT0041346; Sat, 1 Dec 2012 15:46:27 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201212011546.qB1FkRT0041346@svn.freebsd.org> From: Chris Rees Date: Sat, 1 Dec 2012 15:46:27 +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: r243754 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 15:46:28 -0000 Author: crees (ports committer) Date: Sat Dec 1 15:46:27 2012 New Revision: 243754 URL: http://svnweb.freebsd.org/changeset/base/243754 Log: MFC r242183: Allow spaces in _chroot Approved by: hrs Modified: stable/9/etc/rc.subr Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.subr ============================================================================== --- stable/9/etc/rc.subr Sat Dec 1 15:25:41 2012 (r243753) +++ stable/9/etc/rc.subr Sat Dec 1 15:46:27 2012 (r243754) @@ -302,8 +302,8 @@ _find_processes() _pref= if [ $_interpreter != "." ]; then # an interpreted script - _script=${_chroot}${_chroot:+"/"}$_procname - if [ -r $_script ]; then + _script="${_chroot}${_chroot:+/}$_procname" + if [ -r "$_script" ]; then read _interp < $_script # read interpreter name case "$_interp" in \#!*) @@ -746,7 +746,7 @@ run_rc_command() return 1 fi - if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then + if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then warn "run_rc_command: cannot run $command" return 1 fi From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 16:44:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B40F59C; Sat, 1 Dec 2012 16:44:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF678FC08; Sat, 1 Dec 2012 16:44:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1GiXSE049810; Sat, 1 Dec 2012 16:44:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1GiX19049809; Sat, 1 Dec 2012 16:44:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212011644.qB1GiX19049809@svn.freebsd.org> From: Eitan Adler Date: Sat, 1 Dec 2012 16:44:33 +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: r243757 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 16:44:34 -0000 Author: eadler Date: Sat Dec 1 16:44:33 2012 New Revision: 243757 URL: http://svnweb.freebsd.org/changeset/base/243757 Log: MFC r243080: Only pass ip[46].addr when _addrl contains a value Approved by: cperciva (implicit) Modified: stable/9/etc/rc.d/jail Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/jail ============================================================================== --- stable/9/etc/rc.d/jail Sat Dec 1 15:54:54 2012 (r243756) +++ stable/9/etc/rc.d/jail Sat Dec 1 16:44:33 2012 (r243757) @@ -656,7 +656,8 @@ jail_start() done eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \ - ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ + ${_addrl:+ip4.addr=\"${_addrl}\"} ${_addr6l:+ip6.addr=\"${_addr6l}\"} \ + ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 466DB953; Sat, 1 Dec 2012 19:05:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11DA18FC08; Sat, 1 Dec 2012 19:05:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1J5UOw072223; Sat, 1 Dec 2012 19:05:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1J5UkY072221; Sat, 1 Dec 2012 19:05:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011905.qB1J5UkY072221@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:05:30 +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: r243765 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:05:31 -0000 Author: avg Date: Sat Dec 1 19:05:30 2012 New Revision: 243765 URL: http://svnweb.freebsd.org/changeset/base/243765 Log: MFC r243271,243400: vnode_if: fix locking protocol description for lookup and cachedlookup Modified: stable/9/sys/kern/vfs_subr.c stable/9/sys/kern/vnode_if.src Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sat Dec 1 18:16:14 2012 (r243764) +++ stable/9/sys/kern/vfs_subr.c Sat Dec 1 19:05:30 2012 (r243765) @@ -4084,40 +4084,6 @@ vop_strategy_pre(void *ap) } void -vop_lookup_pre(void *ap) -{ -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - - a = ap; - dvp = a->a_dvp; - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); -#endif -} - -void -vop_lookup_post(void *ap, int rc) -{ -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - struct vnode *vp; - - a = ap; - dvp = a->a_dvp; - vp = *(a->a_vpp); - - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); - - if (!rc) - ASSERT_VOP_LOCKED(vp, "VOP_LOOKUP (child)"); -#endif -} - -void vop_lock_pre(void *ap) { #ifdef DEBUG_VFS_LOCKS Modified: stable/9/sys/kern/vnode_if.src ============================================================================== --- stable/9/sys/kern/vnode_if.src Sat Dec 1 18:16:14 2012 (r243764) +++ stable/9/sys/kern/vnode_if.src Sat Dec 1 19:05:30 2012 (r243765) @@ -63,10 +63,8 @@ vop_islocked { IN struct vnode *vp; }; -%% lookup dvp L ? ? +%% lookup dvp L L L %% lookup vpp - L - -%! lookup pre vop_lookup_pre -%! lookup post vop_lookup_post # XXX - the lookup locking protocol defies simple description and depends # on the flags and operation fields in the (cnp) structure. Note @@ -78,7 +76,7 @@ vop_lookup { IN struct componentname *cnp; }; -%% cachedlookup dvp L ? ? +%% cachedlookup dvp L L L %% cachedlookup vpp - L - # This must be an exact copy of lookup. See kern/vfs_cache.c for details. From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 19:12:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4885DBBB; Sat, 1 Dec 2012 19:12:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5238FC0C; Sat, 1 Dec 2012 19:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JCiCb073776; Sat, 1 Dec 2012 19:12:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JCipk073775; Sat, 1 Dec 2012 19:12:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011912.qB1JCipk073775@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:12:44 +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: r243767 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:12:44 -0000 Author: avg Date: Sat Dec 1 19:12:43 2012 New Revision: 243767 URL: http://svnweb.freebsd.org/changeset/base/243767 Log: MFC r242575: zfs_dirlook: bailout early if directory is unlinked Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Dec 1 19:05:47 2012 (r243766) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Dec 1 19:12:43 2012 (r243767) @@ -374,8 +374,15 @@ zfs_dirlook(znode_t *dzp, char *name, vn znode_t *zp; int error = 0; uint64_t parent; + int unlinked; if (name[0] == 0 || (name[0] == '.' && name[1] == 0)) { + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + *vpp = ZTOV(dzp); VN_HOLD(*vpp); } else if (name[0] == '.' && name[1] == '.' && name[2] == 0) { @@ -394,6 +401,13 @@ zfs_dirlook(znode_t *dzp, char *name, vn NULL, NULL, NULL); return (error); } + + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + rw_enter(&dzp->z_parent_lock, RW_READER); error = zfs_zget(zfsvfs, parent, &zp); if (error == 0) From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 19:14:36 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B0F5DDB; Sat, 1 Dec 2012 19:14:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3208FC08; Sat, 1 Dec 2012 19:14:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JEaBu074166; Sat, 1 Dec 2012 19:14:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JEaig074165; Sat, 1 Dec 2012 19:14:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011914.qB1JEaig074165@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:14: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: r243769 - stable/9/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:14:36 -0000 Author: avg Date: Sat Dec 1 19:14:35 2012 New Revision: 243769 URL: http://svnweb.freebsd.org/changeset/base/243769 Log: MFC r243498: opensolaris compat: terminate cmn_err mesages with a new line Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Dec 1 19:12:55 2012 (r243768) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Dec 1 19:14:35 2012 (r243769) @@ -60,6 +60,7 @@ vcmn_err(int ce, const char *fmt, va_lis if (ce != CE_IGNORE) { printf("%s", prefix); vprintf(fmt, adx); + printf("\n"); } } From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 19:16:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98C94FFB; Sat, 1 Dec 2012 19:16:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1528FC14; Sat, 1 Dec 2012 19:16:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JGiMn074618; Sat, 1 Dec 2012 19:16:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JGiYB074617; Sat, 1 Dec 2012 19:16:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011916.qB1JGiYB074617@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:16:44 +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: r243771 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:16:44 -0000 Author: avg Date: Sat Dec 1 19:16:44 2012 New Revision: 243771 URL: http://svnweb.freebsd.org/changeset/base/243771 Log: MFC r243500: spa_import_rootpool: do not call spa_history_log_version Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:14:48 2012 (r243770) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:16:44 2012 (r243771) @@ -3848,8 +3848,6 @@ spa_import_rootpool(const char *name) return (error); } - spa_history_log_version(spa, LOG_POOL_IMPORT); - spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 19:20:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 323652AE; Sat, 1 Dec 2012 19:20:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1690A8FC0C; Sat, 1 Dec 2012 19:20:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JK4K6075266; Sat, 1 Dec 2012 19:20:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JK4Mr075265; Sat, 1 Dec 2012 19:20:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011920.qB1JK4Mr075265@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:20: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: r243773 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:20:05 -0000 Author: avg Date: Sat Dec 1 19:20:04 2012 New Revision: 243773 URL: http://svnweb.freebsd.org/changeset/base/243773 Log: MFC r243501: spa_import_rootpool: initialize ub_version before calling spa_config_parse Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:16:57 2012 (r243772) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:20:04 2012 (r243773) @@ -3821,6 +3821,14 @@ spa_import_rootpool(const char *name) spa_remove(spa); } spa = spa_add(pname, config, NULL); + + /* + * Set spa_ubsync.ub_version as it can be used in vdev_alloc() + * via spa_version(). + */ + if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &spa->spa_ubsync.ub_version) != 0) + spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL; } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 19:22:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0C164D6; Sat, 1 Dec 2012 19:22:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C52348FC12; Sat, 1 Dec 2012 19:22:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JM1wX075742; Sat, 1 Dec 2012 19:22:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JM1ss075741; Sat, 1 Dec 2012 19:22:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011922.qB1JM1ss075741@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:22:01 +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: r243775 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:22:02 -0000 Author: avg Date: Sat Dec 1 19:22:01 2012 New Revision: 243775 URL: http://svnweb.freebsd.org/changeset/base/243775 Log: MFC r243268: zfs_remove: set VV_NOSYNC flag if a node is unlinked Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:20:19 2012 (r243774) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:22:01 2012 (r243775) @@ -1940,6 +1940,9 @@ top: } else if (unlinked) { mutex_exit(&zp->z_lock); zfs_unlinked_add(zp, tx); +#ifdef __FreeBSD__ + vp->v_vflag |= VV_NOSYNC; +#endif } txtype = TX_REMOVE; From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 1 19:24:09 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA3F171D; Sat, 1 Dec 2012 19:24:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADE8E8FC08; Sat, 1 Dec 2012 19:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JO9GX076205; Sat, 1 Dec 2012 19:24:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JO9ra076204; Sat, 1 Dec 2012 19:24:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011924.qB1JO9ra076204@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:24:09 +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: r243777 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:24:09 -0000 Author: avg Date: Sat Dec 1 19:24:09 2012 New Revision: 243777 URL: http://svnweb.freebsd.org/changeset/base/243777 Log: MFC r243270: zfs_remove: assert that delete_now case is never true on FreeBSD Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:22:18 2012 (r243776) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:24:09 2012 (r243777) @@ -1911,6 +1911,9 @@ top: } if (delete_now) { +#ifdef __FreeBSD__ + panic("zfs_remove: delete_now branch taken"); +#endif if (xattr_obj_unlinked) { ASSERT3U(xzp->z_links, ==, 2); mutex_enter(&xzp->z_lock);